Skip to content

feat(orchestrate): delegate the slice and map the failure class - #379

Merged
rodrigorjsf merged 1 commit into
orchestrate/umbrella-prd352-20260803-015333from
orchestrate/slice-362
Aug 3, 2026
Merged

rodrigorjsf merged 1 commit into
orchestrate/umbrella-prd352-20260803-015333from
orchestrate/slice-362

Conversation

@rodrigorjsf

Copy link
Copy Markdown
Owner

Slice #362 of PRD #352 — the integration keystone. Ten slices built the parts; this one wires them together. The orchestrator stops running slices and starts delegating them.

Section 3 collapses to five steps: create the worktree, freeze routing, spawn orchestrate:slice-executor-<variant> with a briefing, validate the returned envelope, act on it. Investigation, implementation, the continue-in-place loop, review, the changeset check and the capability gate all leave the spine, because they live in the skill the executor preloads.

The spine grew, and that needed defending rather than explaining away

Body went 501 → 542 lines. The investigation predicted ~466. Since the whole point of the issue is that the spine collapses, growth in the wrong direction is exactly the shape a failure would take — procedural detail deleted in one place and reintroduced elsewhere in new clothing.

Review audited it by hunk map rather than line counts. Fifteen hunks; the gaps prove byte-identical regions across modes, start-of-run, complexity tiering, the entire wave loop, and all of tracker updates. Growth concentrates in four regions, each a post-ADR-0017 obligation that did not exist before: the AC12 self-describing paragraph, the AC2 briefing contract, the AC7 structured-recovery branch, and the AC8 read boundary. The failure section itself is a net −23.

A brief instruction was refused, correctly

The investigation proposed a new executing subState. The implementer refused: subState is a closed six-member z.enum (render.ts:15-22) that validate_run_state parses through (validate-run-state.ts:128), and the spine stops loudly on an invalid checkpoint — so writing executing would have aborted every mid-executor resume, the exact case AC6 exists to protect. The matrix instead re-anchors its (absent) row on recover_slice_progress, which is AC6's own wording and reuses the tool AC7 already puts in the spine.

The matrix goes seven rows to four. A legacy intra-slice subState from a pre-delegation checkpoint is explicitly handled as (absent), so run-state.md's back-compat claim is honoured by the matrix rather than merely asserted — otherwise a legacy checkpoint would match no row and the run would stall.

AC12 is satisfied the honest way

The old paragraph claimed the spine "lands near ~425 lines, within the project's 500-line cap". Both halves were false: it was 501, and the cap's paths: in .claude/rules/plugin-skills.md does not even reach plugins/orchestrate/** — corroborated behaviourally, since the same rule mandates semantic tags neither orchestrate skill has. The cap binds by self-declaration only.

At 542 the paragraph now invokes the ADR-0013 exception explicitly, by name, at the measured figure, and states which number it reports — body, not total. A count without its definition is what produced the original false claim. CONTEXT.md moved from "holds the exception in reserve" to "exercises it".

Review found a real AC4 defect

The spine's failure opener says the class-to-label mapping lives once in references/failure-handling.md and "do not restate either here" — then restated one of its rows eighteen lines later, the environment-fault carve-out. A grep could not see it because the spine's copy carries no label literal. Rewritten to defer, deliberately line-neutral, because AC12's figure describes its own file.

Also verified rather than assumed

references/slice-pipeline.md does not die — roughly 40% of it is orchestrator-only git and forge work that AC11 protects and the executor skill forbids itself. It keeps its name and its step numbers 6–9, because wave-loop.md cites "steps 6–9" and is itself AC11-protected. 430 → 247 lines. The step-reference grep contract now resolves to exactly step 2, step 6 and step 9.

Two .describe() drifts corrected: reportPath said worktree-relative when #365 established the run directory, and continuationBudget still named the orchestrator as the party that re-spawns. dist/ rebuilt and committed.

A follow-up was found and confirmed harmless: resolvedRoutingSchema does not enumerate slice-executor, so Zod strips the key — but both safeParse sites are read-only and the sole writer mutates raw-parsed JSON surgically, so frozen executor routing survives every round-trip. Schema-description gap only.

Verification

Orchestrator pre-merge gate: build passed; tests 807/808 with the single known RE-ENTRANCY baseline failure; dist/ drift confined to index.js, correct for two .describe()-only source edits.

Carried to #363

plugins/orchestrate/README.md line 42 — "the orchestrator does not spawn it yet" — becomes false the moment this merges. Its tree comment is stale, and the file is 470 lines against a 400-line cap.

Closes #362

@rodrigorjsf
rodrigorjsf merged commit e0d378d into orchestrate/umbrella-prd352-20260803-015333 Aug 3, 2026
1 check passed
@rodrigorjsf
rodrigorjsf deleted the orchestrate/slice-362 branch August 3, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant