Skip to content

Commit 0297664

Browse files
committed
Merge reviewed workflow delivery gates into exec output fix
2 parents ba71128 + 98cc6f1 commit 0297664

51 files changed

Lines changed: 1266 additions & 173 deletions

Some content is hidden

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

‎examples/adversarial-implementation/README.md‎

Lines changed: 143 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Adversarial implementation
22

3-
Deliver accepted work through one launch. Prepared scope facts select direct
3+
Run implementation feedback from accepted work through one launch. Prepared scope facts select direct
44
implementation, ordinary planning followed by implementation, or a validated API
55
foundation followed by remaining consumer migration. Existing impact policy
6-
selects independent review separately from that route.
6+
selects internal feedback separately from that route. Delivery additionally requires
7+
the recorded independent review and current CI.
78

89
## Applies to
910

@@ -17,7 +18,7 @@ change a running role's model or a live workflow's include directory.
1718

1819
Prepare this repository with `deno task setup`. Copy `task.example.json` to a
1920
local file and replace its source, exact revision, output directory, accepted
20-
request, selected evidence paths and unused session names. Prepare the selected
21+
request, selected evidence paths, role providers, correction budgets, delivery policy and unused session names. Prepare the selected
2122
source through its own repository instructions. Its feedback commits use its
2223
configured Git signing and verification. Run from that source checkout:
2324

@@ -37,6 +38,36 @@ The workflow enters the prepared checkout and artifact directory through absolut
3738
`Dir` paths. Enable `--allow-absolute` for these runs; the flag retains existing
3839
read/write restrictions.
3940

41+
## Select role providers and budgets
42+
43+
The launch task requires `providers` for all three original roles and explicit
44+
`maxCorrections`, `maxApiRepairs` and `maxResponseCorrections`. For ordinary Codex
45+
work, select:
46+
47+
```json
48+
{
49+
"providers": {"architect":"codex","planner":"codex","implementor":"codex"},
50+
"maxCorrections": 3,
51+
"maxApiRepairs": 3,
52+
"maxResponseCorrections": 0
53+
}
54+
```
55+
56+
Planner and Implementor can independently select `claude` instead. The fixed
57+
profiles below determine model and effort; provider selection never substitutes
58+
another provider when one refuses. Architect uses `codex`. Missing or invalid
59+
allocation or budget fields hold before paid work. The resolved Ticket manifest
60+
retains the selected providers and all three budgets through continuation.
61+
62+
`maxCorrections` bounds source corrections and `maxApiRepairs` bounds
63+
consumer-driven API repairs, each from zero through ten. `maxResponseCorrections`
64+
bounds extra response-format calls per completed assignment, from zero through
65+
three. Zero admits no extra response call. It applies to ordinary planning,
66+
implementation, selected feedback reviews and foundation replies, including
67+
repairs by their original owner. It authorizes no transport retry or repetition
68+
of uncertain productive work. Continuing a Ticket keeps its consumed source
69+
correction count and recorded allocation; it does not restart a failed attempt.
70+
4071
## Prepare scope and impact
4172

4273
All four closed scope groups are required. Their evidence arrays name nonempty,
@@ -134,6 +165,106 @@ The roles use the normal agent permission policy. Running this example invokes
134165
paid coding agents and permits the assigned implementation work. Publication,
135166
issue/PR metadata and delivery remain with the Sidekick running Codex.
136167

168+
## Complete delivery from recorded requirements
169+
170+
Use this after implementation feedback, for ordinary runs and REPL entries.
171+
`feedback_ready` establishes the selected internal feedback; it leaves independent
172+
review, required CI and current main health outstanding. `run.md` requires a
173+
`delivery` declaration before any role starts and writes its original captured
174+
acceptance text to `delivery/requirements.json`. A missing declaration refuses
175+
launch. Clause IDs are distinct and each source selects an original `task.inputs`
176+
reference. The independent reviewer uses a separate conversation from all three
177+
implementation roles.
178+
179+
Publish the branch and draft PR through the existing owner, then run from the
180+
same source checkout:
181+
182+
```bash
183+
xmd run --allow-absolute /absolute/path/to/workflow/examples/adversarial-implementation/delivery.md \
184+
--props-record /absolute/work/fresh-bounded-parser-fix/delivery/requirements.json \
185+
--props-number 123 --props-action status \
186+
--include /absolute/path/to/workflow/examples/adversarial-implementation/components --raw
187+
```
188+
189+
`status` starts no model. It reads the saved joined review, the current PR and
190+
GitHub's CI workflow runs. Its `nextAction` is computed from the same facts as
191+
its `status` and `remaining` fields. When it requests `review`, select
192+
`--props-action review` on that command to perform one independent review with
193+
the provider, model, effort and session recorded at launch. Prepare the installed
194+
client for that model beforehand; a provider refusal retains its original
195+
attempt and grants no fallback. The review uses normal coding-agent permissions.
196+
It receives the original captured acceptance text and may inspect source and run
197+
focused checks; it receives no implementation, delegation, posting or merge task.
198+
199+
```text
200+
feedback pending -> continue original feedback
201+
feedback ready -> independent review pending -> joined exact-commit verdict
202+
| incomplete/uncertain -> reconcile original call
203+
| blocking finding -> request approved repair
204+
| pass + required CI + main -> finish PR metadata
205+
| all passed + PR ready -> await authorized merge
206+
| confirmed merge -> delivered
207+
```
208+
209+
A complete review covers every recorded clause and has no blocking finding.
210+
The component writes its completion receipt after the role operation has returned
211+
and its scope has unwound. Status compares that receipt with the actual saved
212+
execution reply, reviewer configuration and acceptance clauses. A matching JSON
213+
summary alone supplies none of this correspondence. An occupied attempt is held
214+
for reconciliation, including a failure before a result or receipt exists; a
215+
second invocation never repeats that model call automatically. A new source
216+
commit requires matching implementation feedback and independent review. A
217+
repair keeps the original conversations and its separately approved correction
218+
allowance; this entry grants no repair round.
219+
220+
The PR must name the checkout's exact current commit and branch with base main.
221+
Readback checks the PR and main heads again after the remote reads, and checks
222+
the checkout again. CI selection follows the highest run number and attempt for
223+
the requested PR, its exact head commit and head branch, and requires that attempt's
224+
actual `green` job to succeed. Missing PR association supplies no passing evidence.
225+
Main health reuses the repository's authoritative selection
226+
rule for a push to main's exact current head. Pending, cancelled, skipped and
227+
failed runs cannot pass. The maintainer-applied `ci-main-red-fix` exception keeps
228+
the repository's CI contract: it substitutes composability for the main lookup
229+
inside CI. A draft PR remains `publication_pending`; only a confirmed merge with
230+
a merge commit reports `delivered`. Refresh status before acting on readiness.
231+
232+
The saved `status.json` is the last observation, not a second execution state.
233+
Use the command for a current answer. Local records are trusted workflow
234+
artifacts, not signatures or remotely verifiable attestations. GitHub does not
235+
read them, and this gate does not prevent an arbitrary chat message or a person
236+
from claiming readiness or merging independently.
237+
238+
## Prepare requests without metadata repair turns
239+
240+
These rules apply to separate phase requests and Ticket role calls.
241+
`Phase.Request` renders the complete prompt before entering an Agent, including
242+
initial repository instructions, role instructions, assignment, selected text and
243+
response schema. A missing selected component or input fails there; a packet
244+
above 256000 characters refuses before provider dispatch. The selected evidence
245+
keeps its separate 64000-character bound; the complete-prompt ceiling also accommodates
246+
mandatory initialization instructions and the response schema. Nothing is truncated.
247+
Provider configuration and client compatibility retain their existing checks before a turn starts.
248+
No paid prompt probes installation or repairs launch metadata.
249+
250+
`Phase.Response` supplies omitted phase and work from the assignment, and the
251+
assigned revision for a read-only phase. It supplies the accepted continuation
252+
for complete/pass. Explicit conflicting fields remain errors. The Implementor
253+
still supplies its actual resulting commit, and every role supplies its real
254+
verdict, findings and evidence. The existing zero-response-correction option
255+
continues to validate and retain a reply at zero; missing substantive facts are
256+
never synthesized to make a reply pass.
257+
258+
Acceptance clauses preserve their original source and wording through delivery.
259+
A reviewer reports a material ambiguity as blocked instead of strengthening a
260+
criterion. This records traceability; it does not mechanically decide whether two
261+
natural-language requirements mean the same thing.
262+
263+
Submission-owned progress and joined entry completion remain separate work in
264+
[#1062](https://github.com/taras/executable.md/issues/1062). Fatal entry outcome
265+
diagnostics remain [#1059](https://github.com/taras/executable.md/issues/1059).
266+
Neither is replaced by the delivery status file or an attachment observer.
267+
137268
## Run a separate phase or continue a saved ticket
138269

139270
Use these entries from the workflow repository when coordinating a separate
@@ -205,6 +336,7 @@ omitted. A direct REPL invocation uses the same option:
205336
<Phase.Run phase={request.assignment.phase} role={request.role}
206337
session={request.session} assignment={request.assignment} attempt={request.attempt}
207338
initialize={request.initialize ?? false} inputs={Object.values(documents)}
339+
plannerProvider={request.plannerProvider ?? "claude"}
208340
implementationProvider={request.implementationProvider ?? "claude"}
209341
maxResponseCorrections={0} successor={request.assignment.continuation.phase}
210342
nextRole={request.assignment.continuation.role} as="phase" />
@@ -246,14 +378,14 @@ determine the work's outcome.
246378

247379
| Owner | Work | Model and effort |
248380
| --- | --- | --- |
249-
| Planner | Ordinary plan/evidence; on migration, implement the API, validate representative consumers and repair API conflicts | Claude `opus`; ordinary planning uses ReviewPolicy effort: medium, high for a concrete recorded risk; migration foundation design uses high |
250-
| Implementor | Implement accepted work; on migration, challenge the API, convert consumers and delete obsolete machinery | Claude `sonnet`, high |
251-
| Planner reviewer | Inspect the migration against the accepted outcome and evidence | Same Opus session, medium; high for a concrete recorded risk |
381+
| Planner | Ordinary plan/evidence; on migration, implement the API, validate representative consumers and repair API conflicts | Selected Codex `gpt-6.1-sol` or Claude `opus`; ordinary planning uses medium, high for a concrete recorded risk; migration foundation design uses high |
382+
| Implementor | Implement accepted work; on migration, challenge the API, convert consumers and delete obsolete machinery | Selected Codex `gpt-6.1-sol`, medium (high for a concrete recorded risk), or Claude `sonnet`, high |
383+
| Planner reviewer | Inspect the migration against the accepted outcome and evidence | Same selected provider and original Planner session, medium; high for a concrete recorded risk |
252384
| Architect | Answer a concrete structural question or review structural impact | Codex `gpt-6.1-sol`, medium; high for a concrete recorded risk |
253385
| Sidekick running Codex | Author and apply issue/PR titles and descriptions; own publication and delivery | Existing coordinating Sidekick |
254386

255-
Aliases select the provider's available Opus and Sonnet models. The two Claude
256-
roles do not draft or edit issue/PR titles or descriptions. The phase runner
387+
Aliases select the provider's available Opus and Sonnet models. Coding roles
388+
do not draft or edit issue/PR titles or descriptions. The phase runner
257389
refuses editorial assignments; technical handoffs and API documentation remain
258390
part of the roles' work.
259391

@@ -304,7 +436,7 @@ reply and diagnostics. Schema matching never chooses between candidates.
304436

305437
When the only invalid fields are an oversized summary or handoff, foundation
306438
response correction can shorten those fields in the same Planner session, at
307-
most three times. Every other field is frozen, including the API, source,
439+
most `task.maxResponseCorrections` times. Every other field is frozen, including the API, source,
308440
assessment and evidence. Each correction saves its request, raw reply and
309441
disposition, and checks that source remains at the same clean commit. The
310442
productive assignment is not repeated. An ambiguous or substantively invalid
@@ -323,8 +455,8 @@ provider failure, malformed response, unanswered decision or exhausted bound
323455
holds with saved evidence. It does not trigger an uncertain prompt retry.
324456

325457
`maxApiRepairs` bounds consumer-driven API repairs; `maxCorrections` bounds the
326-
existing implementation-review corrections. Both default to three and accept
327-
zero through ten. Repeated redesign is evidence that the split is not paying
458+
existing implementation-review corrections. Both are explicit launch inputs and
459+
accept zero through ten. Repeated redesign is evidence that the split is not paying
328460
for itself: inspect the saved consumer conflicts before extending either bound.
329461

330462
The imported feedback loop retains impact-selected reviews, bounded response

‎examples/adversarial-implementation/components/Adversarial/PlannerRole.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ props:
1111
---
1212

1313
<Adversarial.Schema as="schemas" />
14-
<Phase.Profile role="planner" design={true} assessment={props.assignment.assessment} as="profile" />
15-
<Output><Agent name="claude"><Session name={props.assignment.session} model={profile.model} effort={profile.effort}><Prompt throwOnError={true}>
14+
<Phase.Profile role="planner" design={true} plannerProvider={props.assignment.plannerProvider} assessment={props.assignment.assessment} as="profile" />
15+
<Output><Agent name={profile.provider}><Session name={props.assignment.session} model={profile.model} effort={profile.effort}><Prompt throwOnError={true}>
1616
<If condition={props.correction !== null}>
17-
You remain the original Planner. This is response-only correction {props.correction.ordinal} of three. Shorten only the rejected summary or handoff to its stated bound. Every other result value is frozen by the supplied schema, including the API, outcome, source revision, artifacts, assessment and command evidence.
17+
You remain the original Planner. This is response-only correction {props.correction.ordinal} with {props.correction.remaining} remaining. Shorten only the rejected summary or handoff to its stated bound. Every other result value is frozen by the supplied schema, including the API, outcome, source revision, artifacts, assessment and command evidence.
1818

1919
Perform no implementation, command execution, test, signing, publication or other productive work. Do not repeat the earlier assignment. Return only the corrected JSON result. If the existing facts cannot satisfy the schema, preserve that uncertainty; do not invent evidence.
2020

@@ -29,6 +29,8 @@ Repository instructions:
2929
Role instructions:
3030
{props.guide}
3131
</If>
32+
Use the provider, model and effort explicitly selected by this workflow; historical role-guide defaults do not replace that allocation.
33+
3234
Continue in the same Planner conversation. Use the supplied inputs and prior API evidence; investigate a specific missing fact instead of repeating discovery. A repair preserves the original accepted outcome and completed migration work.
3335

3436
Do not draft, create or edit PR or issue titles or descriptions. The Sidekick running Codex authors and applies that metadata. Return technical artifacts and evidence; API usage documentation remains your responsibility.

‎examples/adversarial-implementation/components/Adversarial/Response.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ returns: {type: object}
2727
<If condition={!established.ok}><Fail message="No unambiguous substantive foundation result is established. Preserve raw.txt and response-rejection-0000.json; no productive prompt is repeated." /></If>
2828
<Let as="frozen" value={{...schemas.foundation,properties:Object.fromEntries(Object.entries(schemas.foundation.properties).map(([key,schema]) => [key,(key === "summary" || key === "handoff") && established.value[key].length > schema.maxLength ? schema : {const:established.value[key]}]))}} />
2929
<Loop max={3}>
30-
<If condition={checked.ok}><Break /></If>
30+
<If condition={checked.ok || round >= props.assignment.maxResponseCorrections}><Break /></If>
3131
<Let as="round" value={round + 1} />
3232
<Let as="directory" value={props.assignment.attempt + "/response-corrections/" + round} />
3333
<Dir path={props.assignment.attempt + "/response-corrections"}><Let as="parentPrepared" value={true} /></Dir>
@@ -36,7 +36,7 @@ returns: {type: object}
3636
mkdir -- {quoted}
3737
```
3838
<If condition={reserved.exitCode !== 0}><Fail message="Preserve the occupied response correction; do not repeat its prompt." /></If>
39-
<Let as="packet" value={{ordinal:round,remaining:3-round,raw:rawPath,rejection:checked.errors,established:established.value,resultSchema:frozen}} />
39+
<Let as="packet" value={{ordinal:round,remaining:props.assignment.maxResponseCorrections-round,raw:rawPath,rejection:checked.errors,established:established.value,resultSchema:frozen}} />
4040
<If condition={JSON.stringify(packet).length > 64000}><Fail message="The response correction packet exceeds its input bound; preserve it without dispatch." /></If>
4141
<Dir path={directory}><File path="request.json"><Json value={packet} /></File></Dir>
4242
<Ticket.Checkout repository={props.assignment.repository} as="before" />
@@ -64,6 +64,9 @@ git status --porcelain=v1 --untracked-files=all
6464
<If condition={extracted.ok}><SafeParse schema={frozen} as="checked">{extracted.json}</SafeParse></If>
6565
<Dir path={directory}><File path="disposition.json"><Json value={{round,accepted:checked.ok,raw:rawPath,errors:checked.ok ? [] : checked.errors}} /></File></Dir>
6666
</Loop>
67-
<If condition={!checked.ok}><Fail message="Three response-only corrections are exhausted. Preserve their receipts; no productive prompt is repeated." /></If>
67+
<If condition={!checked.ok}>
68+
<Dir path={props.assignment.attempt}><File path="response-disposition.json"><Json value={{status:"failed_without_result",dispatchable:false,consumed:round,limit:props.assignment.maxResponseCorrections}} /></File></Dir>
69+
<Fail message="The selected response-only correction budget is exhausted. Preserve its receipts; no productive prompt is repeated." />
70+
</If>
6871
</If>
6972
<Return value={{result:checked.value,round,rawPath}} />

0 commit comments

Comments
 (0)