| name | author-decision-mapping |
| description | v4 sub-skill #3. Adds the `decisions:` block to the brief and emits
one Cypher precedent-query file per HITL phase under
`api/server/services/precedent_queries/<workflow_type>_<phase>.cypher`.
|
| audience | design-time-only |
| forbidden-runtime | true |
| inputs | [{"brief.phases (kind":"hitl entries)"},"brief.entities (so decided_on_entities can resolve)"] |
| outputs | ["brief.decisions","<sandbox>/api/server/services/precedent_queries/<wt>_<phase>.cypher"] |
| hands_off_to | author-function-membership |
author-decision-mapping
This sub-skill encodes the persona-precedent contract: every HITL
phase that wants to surface "what did this persona decide last time
on a similar entity?" gets a Cypher template that the Phase 3
persona reasoning loop will run with bind params
$entity_id and $limit.
Procedure
-
Read the v1 brief (now carrying entities).
-
Propose decisions:. One entry per HITL phase that should
record a precedent. Schema:
decisions:
- phase: <hitl-phase-name>
persona: <role>
source_event: <FleetEvent type>
decided_on_entities: [payload.X.id]
attributes_from_context:
<key>: payload.<path>
-
Validate. Run validator.py:validate(brief, ...). STOP on
SchemaError.
-
Render. For each decision, call
codegen.render_cypher(brief, decision). Write each to
<sandbox>/api/server/services/precedent_queries/<workflow_type>_<phase>.cypher.
-
Hand off to author-function-membership.
Cypher template (replicated from blueprint §10 decision #4)
// Auto-generated by compose-domain v4 author-decision-mapping codegen.
MATCH (d:Decision)-[:DECIDED_ON]->(e {id: $entity_id})
WHERE d.persona_role = '<persona>'
AND d.workflow_type = '<workflow_type>'
RETURN d
ORDER BY d.decided_at DESC
LIMIT $limit
The persona reasoning loop binds $entity_id from the current
workflow's entity ref and $limit from the per-call cap.
Constraints
- Exactly one decision per HITL phase (the dedupe triple
(workflow_id, phase, persona_role) is enforced by Phase 1's
reflector).
- Persona names must reference an existing folder under
api/server/personae/.
source_event defaults to workflow.hitl.requested when omitted.