Repository navigation
feat(cutover-c3): stage-grouped + concurrent bed-member walk (kit) + all-or-nothing load validation - #236
Conversation
…) + all-or-nothing load validation Cutover C tasks 5-7. kit.RunPlanStaged is the canonical stage-grouped, member-concurrent bed walk; RunPlan now delegates to it (one canonical engine): - stages (first-seen order across members, recorded from authored order at load) dominate `parallel:`; within a stage, steps on DIFFERENT members run as INDEPENDENT Runner instances CONCURRENTLY (A4 — never share one Runner); same-member steps keep authored order. - without stages: today's sequential per-member walk, plus whole-member-plan concurrency when `parallel: true`. - result collection is concurrency-safe: per-member slices, ONE mutex serializing every shared-summary append (the A4 fix), venue-keyed deterministic final order. - drain semantics: a member step failure never stops other members — stage WaitGroup barriers drain every member before the next stage starts; per-member verdicts land in the results. loaderkit.ValidateCheckBeds gains the task-4 load invariant: stage authoring is ALL-OR-NOTHING per bed (the root plus the whole uniform member tree must all carry `stage:` or none may) — the walk can then rely on unambiguous grouping. Stage names dot-free is CUE-enforced on #Op (spec #116). Tests: kit/planrun_staged_test.go (stage first-seen order, same-member authored order, concurrent independent runners via barrier handshake, stage drain on member failure, parallel whole-member plans, deterministic venue-keyed order, RunPlan delegation, unstaged-step survival); loaderkit/validate_check_beds_stage_test.go (all-or-nothing + hook-in). Spec re-pin: github.com/opencharly/spec v0.2026250.709 -> v0.2026250.903 (the stage:/parallel: schema, spec #116).
Review — BLOCKHead SHA: Change class: feature (sdk/kit walk + loader validation; spec re-pin) Security screen: PASS — no scope mismatch, secrets, exfiltration, weakened guardrails, or supply-chain anomaly (spec bump Blocks
Placement
Verdict: BLOCK ollama/deepseek-v4-flash — pi-review-action. |
…en stage order in the grouped test B18/R1 validator findings on sdk #236: - planrun_staged.go: two leftover `println("DEBUG …")` calls in runStagedGroups emitted debug output on every staged bed run from concurrent member goroutines; removed (zero-warning mandate). - planrun_staged_test.go TestRunPlanStaged_StageGroupsFirstSeenOrder: the never-invoked `idx` closure is deleted and the test now asserts the actual first-seen stage order (a2 before a1 — s2 first-seen before s1), instead of only the result count.
Review — PASSHead SHA: Security screen: PASS — no scope mismatch (all 7 files accounted for in the body), no secrets/exfiltration, no weakened guardrails, no supply-chain anomaly (spec bump Prior
Placement: CORRECT — the walk is a kind-blind reusable mechanism in Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
Summary
Cutover C tasks 5-7 (CC-3 wave, PR 2 of 3: spec → sdk → charly → umbrella).
The canonical stage-grouped + concurrent bed-member walk (
kit/planrun_staged.go, task 5):RunPlanStaged(ctx, members []MemberRun, parallel, strict)executes a bed's member plans with the CC-3 execution model;RunPlannow delegates to it (ONE canonical engine, R3).stage:: steps are grouped by stage and stage groups execute in FIRST-SEEN order (recorded from the authored order at load — task 4). Within a stage, steps on DIFFERENT members run as INDEPENDENT Runner instances CONCURRENTLY (A4 — never share one Runner); same-member steps keep authored order.parallel:does not interact with stages — stages dominate.parallel: true.Concurrency-safe result collection (task 6): per-member result slices; ONE mutex serializes every shared-summary append (the A4 fix — no races in the -race run); final order is venue-keyed deterministic (members in authored order, steps in authored order), never completion-time.
Drain semantics (task 7): a member step failure does NOT stop other members — every stage's WaitGroup barrier drains all its members before the next stage starts; per-member verdicts land in the results. Tear-down of all members on every terminal path stays the bed runner's job (plugin-check), which the drain makes safe to rely on.
Load-time all-or-nothing validation (task 4):
loaderkit.ValidateCheckBedsnow rejects a bed whose root + whole uniform member tree MIX staged and unstaged steps (stage authoring is all-or-nothing per bed) — the walk can then rely on unambiguous grouping. Dot-free stage names are CUE-enforced on #Op (spec #116).Spec re-pin:
github.com/opencharly/spec v0.2026250.709 → v0.2026250.903(the stage:/parallel: schema).How tested
TDD coverage (
kit/planrun_staged_test.go):Load validation tests (
loaderkit/validate_check_beds_stage_test.go): all-or-nothing across root + deploy-level/in-substrate members + recursive grandchild; hook-in through the real ValidateCheckBeds entrypoint.Rulebook compliance
Change classification
go build ./...+go test ./...+-raceon the changed packages green on the final treeAssisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)