Skip to content

Commit 3da4abd

Browse files
committed
Merge published main into ACP error diagnostics delivery
2 parents cbe8b2b + 32b53ab commit 3da4abd

43 files changed

Lines changed: 755 additions & 289 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎bun.lock‎

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎examples/adversarial-implementation/README.md‎

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ The table is ordered. Missing or unknown facts never become false or null.
9898
| Any `decisions.openQuestions` item | Hold before paid roles; show the unanswered question and evidence |
9999
| Valid non-null migration record and `sharedApi.needed=true` | Existing Planner foundation and representative validation, then remaining consumer implementation, selected review and retirement |
100100
| `migration=null`, `sharedApi.needed=false`, `implementation.ready=true` | Direct Implementor, then existing impact-selected independent review |
101-
| `migration=null`, `sharedApi.needed=false`, `implementation.ready=false` | Ordinary Planner plan/evidence, then Implementor and selected review |
102-
| `migration=null`, `sharedApi.needed=true`, either readiness value | Ordinary Planner plan/evidence, then one Implementor for necessary API work and consumers, followed by selected review |
101+
| `migration=null`, `sharedApi.needed=false`, `implementation.ready=false` | Ordinary Planner plan/evidence, with original Architect discovery when requested, then the same Planner handoff to Implementor and selected review |
102+
| `migration=null`, `sharedApi.needed=true`, either readiness value | Ordinary Planner plan/evidence, with original Architect discovery when requested, then the same Planner handoff to one Implementor for necessary API work and consumers, followed by selected review |
103103

104104
```text
105105
Normal run.md launch
@@ -123,7 +123,9 @@ Justified migration record? (requires sharedApi.needed=true)
123123
v
124124
Shared API needed?
125125
| yes -----------------------> STANDARD
126-
| Planner plan/evidence -> Implementor
126+
| Planner plan/evidence
127+
| -> original Architect if discovery needed
128+
| -> same Planner -> Implementor
127129
| -> impact-selected review
128130
| no
129131
v
@@ -155,6 +157,17 @@ existing Ticket record; migration returns the existing Adversarial result.
155157
Provider and persistence failures retain their existing handling. Preserve first
156158
failure output and partial effects before another attempt.
157159

160+
The ordinary Ticket starts before the first Planner call. A validated
161+
`needs_discovery` request reaches the original Architect and returns its answer
162+
to the same Planner. Only that Planner's complete handoff starts implementation.
163+
The initial journey runs at most those three discovery calls. Another discovery
164+
request returns `status=paused`, `dispatchable=true`, `hold=null` and the exact
165+
pending gate. Save the complete returned record and advance it with `continue.md
166+
--props-record /absolute/path/to/ticket-record.json --props-steps 1`.
167+
Planning and discovery must leave source clean at the exact launch revision,
168+
including when a reply is rejected or absent. They require no signed feedback
169+
commit. Routing consumes and resets none of the three correction allowances.
170+
158171
An occupied fresh-work directory holds; it is never an implicit retry or
159172
continuation. An ordinary command's diagnostic journal is not a continuation
160173
checkpoint. Reconcile its saved calls and partial effects before new work. In a
@@ -253,7 +266,12 @@ for complete/pass. Explicit conflicting fields remain errors. The Implementor
253266
still supplies its actual resulting commit, and every role supplies its real
254267
verdict, findings and evidence. The existing zero-response-correction option
255268
continues to validate and retain a reply at zero; missing substantive facts are
256-
never synthesized to make a reply pass.
269+
never synthesized to make a reply pass. `discoveryRequests[].role` and
270+
`discoveryGaps[].request.role` name the invoked reporting actor. A Planner
271+
requesting Architect discovery still names `planner` as author; `next.role`
272+
names `architect` as successor. Explicit contradictory authors are rejected.
273+
The raw reply, rejection and disposition remain inspectable without becoming a
274+
canonical result.
257275

258276
Acceptance clauses preserve their original source and wording through delivery.
259277
A reviewer reports a material ambiguity as blocked instead of strengthening a
@@ -346,7 +364,7 @@ Here `request` is the prepared phase request above and `documents` is the
346364
selected input map returned by `<Ticket.Documents>`. Keep the original session
347365
and reserved attempts when changing this limit at a completed phase boundary.
348366

349-
To advance a saved `Ticket.Run` or `Ticket.Continue` record, pass that complete
367+
To advance a saved ordinary `run.md`, `Ticket.Run` or `Ticket.Continue` record, pass that complete
350368
record rather than reconstructing its assignment or artifact paths:
351369

352370
```bash
@@ -356,7 +374,11 @@ deno task xmd run --allow-absolute examples/adversarial-implementation/continue.
356374
```
357375

358376
The returned record preserves the original manifest, sessions, documents, calls
359-
and correction counts. Each step executes at most one recorded role. Held and
377+
and correction counts, including a pre-implementation planning checkpoint.
378+
Each explicit step executes at most one recorded role and joins settlement.
379+
A dispatchable pause names its next gate and continuation action. A genuine
380+
hold is nondispatchable and retains its pending assignment and reconciliation
381+
reason. Held and
360382
completed records return without a prompt. This entry does not clear a hold or
361383
retry an uncertain execution. Resolve the recorded cause before preparing a
362384
continuation, and preserve the original evidence. Capture the complete output
@@ -390,7 +412,8 @@ refuses editorial assignments; technical handoffs and API documentation remain
390412
part of the roles' work.
391413

392414
Architect is conditional: reserving its conversation name starts no discovery
393-
call. A Planner can return `needs_architect` with one structural question. An
415+
call. An ordinary Planner returns `needs_discovery` with its concrete structural
416+
question; the foundation route retains its `needs_architect` handoff. An
394417
implemented change's impact selects architecture review. Existing repository
395418
rules still govern material product decisions and architectural choices.
396419
When the API foundation has structural impact, Architect reviews that committed

‎examples/adversarial-implementation/components/Phase/Instructions.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ Communicate the document sections relevant to this ticket in result.contract. Re
7070
Use assignment.contract for the Architect-selected sections and ticket requirements. Omit result.contract; Preparation carries the existing packet forward. Identify a precise missing fact or a named document change in the handoff when the packet needs an Architect refresh. Existing mandatory reading requirements still apply.
7171
</If>
7272

73-
Use discoveryRequests to name reusable questions as part of your first meaningful assignment; do not add a preliminary call merely to request them. Give each request a stable key, your role, a concrete question, neededFor, evidenceNeeded and the originating assignment or feedback reference. Read supplied answers first. Search for a precise missing fact or a named change, rather than repeating an earlier discovery walk. Tools remain available and mandatory readings remain required.
73+
Use discoveryRequests to name reusable questions as part of your first meaningful assignment; do not add a preliminary call merely to request them. Give each request a stable key, role={props.role} (the actual invoked author), a concrete question, neededFor, evidenceNeeded and the originating assignment or feedback reference. Read supplied answers first. Search for a precise missing fact or a named change, rather than repeating an earlier discovery walk. Tools remain available and mandatory readings remain required.
74+
75+
Keep discoveryRequests[].role and discoveryGaps[].request.role equal to {props.role}. These fields name you, the reporting actor. next.role names the requested successor; requesting Architect does not make Architect the request author. Never relabel an explicit contradictory author.
7476

7577
Return discoveryGaps for preparation that missed something: the request, searched references, open/resolved status and actual evidence. An open gap returns needs_discovery and stops productive successors. When you resolved the gap within this assignment, retain it as resolved so later preparation can improve without repeating the investigation. A resolved gap requires evidence. Record toolCalls and elapsedMs only when measured; use null when unavailable. Return empty arrays when there are no requests or gaps. Never invent costs, proof or answers to complete a packet.
7678

@@ -104,7 +106,9 @@ Reference individual UTF-8 text or JSON files in artifacts, evidence and handoff
104106
Return exactly one JSON object conforming to this contract, without Markdown fences or surrounding prose. The handoff field is the complete ready-to-send request for the next owner; only that field becomes the next request. Artifacts and evidence travel as structured references. For a command on an uncommitted candidate, use evidence.revision=null and candidate=the retained candidate/command metadata path; a base HEAD is not its tested revision. Use a commit SHA only when the tested inputs correspond to that commit. Report observations as observations; schema validation does not establish test results, approvals or delivery readiness.
105107
<Phase.Schema as="schemas" />
106108
<Let as="phaseOutcome" value={schemas.result.allOf[["discovery","implementation","review"].indexOf(props.assignment.phase)].then.properties.outcome} />
107-
<Let as="promptContract" value={{type:schemas.result.type,required:[...schemas.result.required.filter(name => !["phase","work",...(props.assignment.phase === "implementation" ? [] : ["revision"])].includes(name)),"discoveryRequests","discoveryGaps"],additionalProperties:false,properties:{...schemas.result.properties,phase:{const:props.assignment.phase},work:{const:props.assignment.work},outcome:phaseOutcome,contract:props.role === "architect" && props.assignment.phase === "discovery" ? schemas.result.properties.contract : undefined},$defs:schemas.result.$defs}} />
109+
<Let as="authorRequest" value={{...schemas.result.properties.discoveryRequests.items,properties:{...schemas.result.properties.discoveryRequests.items.properties,role:{const:props.role}}}} />
110+
<Let as="authorGap" value={{...schemas.result.properties.discoveryGaps.items,properties:{...schemas.result.properties.discoveryGaps.items.properties,request:authorRequest}}} />
111+
<Let as="promptContract" value={{type:schemas.result.type,required:[...schemas.result.required.filter(name => !["phase","work",...(props.assignment.phase === "implementation" ? [] : ["revision"])].includes(name)),"discoveryRequests","discoveryGaps"],additionalProperties:false,properties:{...schemas.result.properties,discoveryRequests:{...schemas.result.properties.discoveryRequests,items:authorRequest},discoveryGaps:{...schemas.result.properties.discoveryGaps,items:authorGap},phase:{const:props.assignment.phase},work:{const:props.assignment.work},outcome:phaseOutcome,contract:props.role === "architect" && props.assignment.phase === "discovery" ? schemas.result.properties.contract : undefined},$defs:schemas.result.$defs}} />
108112
<Let as="resultContract" value={JSON.stringify(promptContract)} />
109113
{resultContract}
110114
</Output>

‎examples/adversarial-implementation/components/Ticket/Advance.md‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,25 @@ returns: {type: object}
1616
A decision or contract conflict holds the ticket for its existing approval gate.
1717
A correction clears prior verdicts. Readiness requires every selected reviewer to
1818
PASS the same signed implementation SHA; it does not authorize delivery or merge.
19+
Selected feedback documents remain available across reviews and corrections.
1920

2021
<Let as="state" value={props.pending.checkpoint} />
2122
<Let as="result" value={props.result} />
2223
<Let as="call" value={props.pending.call} />
24+
<If condition={call.assignment.phase === "discovery"}>
25+
<Phase.Next result={result} successor={result.outcome === "escalate" ? call.assignment.phase : call.assignment.continuation.phase} role={result.outcome === "escalate" ? call.role : call.assignment.continuation.role} as="next" />
26+
<Let as="held" value={next.phase === "hold"} />
27+
<Let as="assignment" value={state.assignment} />
28+
<Let as="gate" value={state.gate} />
29+
<If condition={!held}>
30+
<Phase.Preparation from={{assignment:call.assignment,result,next}} target={next.target} as="prepared" />
31+
<Let as="gate" value={next.target === "implementation" ? "implementation" : next.role === "planner" ? "planning" : "architect-discovery"} />
32+
<Let as="continuation" value={gate === "planning" ? {phase:"implementation",role:"implementor"} : gate === "architect-discovery" ? {phase:"discovery",role:"planner"} : call.assignment.continuation} />
33+
<Let as="assignment" value={{...prepared.assignment,continuation}} />
34+
</If>
35+
<Return value={{...state,gate,assignment,status:held ? "hold" : "running",dispatchable:!held && props.pending.execution.status !== "failed",hold:held ? {kind:result.outcome,reason:result.handoff} : null,discovery:[...(state.discovery ?? []),{role:call.role,revision:result.revision,result:props.pending.resultPath,requests:result.discoveryRequests ?? [],gaps:result.discoveryGaps ?? []}]}} />
36+
</If>
37+
<If condition={call.assignment.phase !== "discovery"}>
2338
<Let as="correction" value={result.outcome === "changes_required" || result.outcome === "missing_evidence"} />
2439
<Let as="round" value={state.round + (correction ? 1 : 0)} />
2540
<Let as="held" value={["blocked","needs_decision","needs_discovery"].includes(result.outcome) || correction && round > props.pending.manifest.maxCorrections} />
@@ -33,5 +48,7 @@ PASS the same signed implementation SHA; it does not authorize delivery or merge
3348
<Let as="ready" value={!held && !correction && ["pass","complete"].includes(result.outcome) && remaining.length === 0} />
3449
<Let as="gate" value={held || result.outcome === "escalate" ? state.gate : correction ? "implementation" : ready ? "feedback-ready" : remaining[0] + "-review"} />
3550
<Let as="status" value={held ? "hold" : ready ? "feedback_ready" : props.pending.execution.status === "failed" ? "paused" : "running"} />
36-
<Let as="assignment" value={{...props.pending.manifest.assignment,phase:gate === "implementation" ? "implementation" : "review",assessment:reviewPolicy.assessment,reviewKind:reviewPolicy.kind,revision,priorRevision:props.pending.manifest.assignment.revision,request:result.handoff,handoffInputs:result.handoffInputs ?? [],changedPaths:props.observation.changedPaths,artifacts:[...result.artifacts,props.observation.path],evidence:result.evidence,findings:result.findings,contract:result.contract ?? props.pending.manifest.assignment.contract ?? null}} />
37-
<Return value={{...state,status,dispatchable:!held && !ready && props.pending.execution.status !== "failed",round,gate,revision,reviews,reviewPolicy,exactApproval,exactReview,assignment,feedbackInputs:result.outcome === "complete" && call.role === "implementor" ? result.handoffInputs ?? [] : state.feedbackInputs ?? [],discovery:[...(state.discovery ?? []),...((result.discoveryRequests?.length ?? 0) + (result.discoveryGaps?.length ?? 0) > 0 ? [{role:call.role,revision:result.revision,result:props.pending.resultPath,requests:result.discoveryRequests ?? [],gaps:result.discoveryGaps ?? []}] : [])],feedback:result.outcome === "complete" && call.role === "implementor" ? [props.pending.resultPath,props.observation.path] : state.feedback,hold:held ? {kind:correction ? "correction_bound" : result.outcome,reason:result.handoff} : null}} />
51+
<Let as="assignment" value={{...props.pending.manifest.assignment,phase:gate === "implementation" ? "implementation" : "review",assessment:reviewPolicy.assessment,reviewKind:reviewPolicy.kind,revision,priorRevision:props.pending.manifest.assignment.revision,request:result.handoff,handoffInputs:result.handoffInputs ?? [],changedPaths:props.observation.changedPaths,artifacts:[...result.artifacts,props.observation.path],evidence:result.evidence,findings:result.findings,contract:result.contract ?? state.assignment.contract ?? null}} />
52+
<Return value={{...state,status,dispatchable:!held && !ready && props.pending.execution.status !== "failed",round,gate,revision,reviews,reviewPolicy,exactApproval,exactReview,assignment,feedbackInputs:result.outcome === "complete" && call.role === "implementor" ? [...new Set([...(state.feedbackInputs ?? []),...(state.assignment.handoffInputs ?? []),...(result.handoffInputs ?? [])])] : state.feedbackInputs ?? [],discovery:[...(state.discovery ?? []),...((result.discoveryRequests?.length ?? 0) + (result.discoveryGaps?.length ?? 0) > 0 ? [{role:call.role,revision:result.revision,result:props.pending.resultPath,requests:result.discoveryRequests ?? [],gaps:result.discoveryGaps ?? []}] : [])],feedback:result.outcome === "complete" && call.role === "implementor" ? [props.pending.resultPath,props.observation.path] : state.feedback,hold:held ? {kind:correction ? "correction_bound" : result.outcome,reason:result.handoff} : null}} />
53+
54+
</If>

0 commit comments

Comments
 (0)