Skip to content

fix(kickoff/swarm): flow-integrity and enforcement defect cluster (gh#19, gh#56, gh#57, gh#58, gh#60) - #65

Merged
dollspace-gay merged 7 commits into
Corvidae-Coding-Projects:developfrom
magnificentlycursed:fix/56-57-58-60-19-kickoff-flow-integrity
Aug 2, 2026
Merged

fix(kickoff/swarm): flow-integrity and enforcement defect cluster (gh#19, gh#56, gh#57, gh#58, gh#60)#65
dollspace-gay merged 7 commits into
Corvidae-Coding-Projects:developfrom
magnificentlycursed:fix/56-57-58-60-19-kickoff-flow-integrity

Conversation

@magnificentlycursed

Copy link
Copy Markdown
Contributor

Fixes #19. Fixes #56. Fixes #57. Fixes #58. Fixes #60.

The kickoff/swarm flow-integrity and enforcement defect cluster from the vsdd kickoff bundle. One commit per issue.

gh#19 — plan/run --dry-run side effects (2cf4fbd4)

Both dry-run guards ran after worktree creation (plan also after its permanent PlanRecord write), so repeated dry-runs accumulated orphan worktrees and phantom "planning" rows no cleanup flag reclaims. The guards now run before any creation and print the would-be worktree/branch/agent names. One deliberate remainder: run --dry-run still creates the tracker issue when none is passed, since the printed prompt embeds its id.

gh#60 — TIMEOUT sentinel never written (d6ee70c3)

Both launch paths (local/sandbox and container) now append an exit-code-124 trailer that writes TIMEOUT to .kickoff-status when the timeout wrapper kills the agent; normalize_status classifies it as timed-out. Killed agents previously kept RUNNING at the sentinel layer forever.

gh#57 — documented H2 phasing headers dropped (a4d80b40)

H2 ## Phase: / ## Layer: sections (the form the swarm guide documents) now parse into RequirementGroups via the same header/list machinery as the H3-under-Requirements form, extend flat requirements for backward compat, and no longer fall into unknown_sections. "Phased Rollout"-style titles don't false-positive.

gh#56 — /design --continue wipes pipeline.json (a977e8a2)

The skill's pipeline-state step now creates the file only when absent; when it exists it updates doc_hash/design_doc in place via jq, preserving stage/plans/runs.

gh#58 — hook enforcement vs documented contract (06ac4a67)

Agent hook enforcement (agent_overrides + work-check.py agent defaults) now mechanically blocks git merge/rebase/cherry-pick/reset, stash/tag/patch, and branch surgery, and gates git commit on an active issue — matching the claims in the guides and generated prompt. Plain git push stays allowed deliberately: the CI-verify flow instructs the agent to push a draft PR, so blocking it would break that flow. The prompt's Blocked Actions section and both guides now state that contract accurately (force-push always blocked; plain push reserved for the CI-verification steps) instead of overclaiming "no push".

Testing

  • New: test_parse_h2_phase_headers_documented_form, test_parse_h2_layer_numbered_and_no_false_positive, test_normalize_status_timeout_sentinel; exact-command asserts updated for the TIMEOUT trailer.
  • Suites green: kickoff (184), design_doc (47), init (154); py_compile clean on work-check.py; full bin suite green.
  • CI-exact clippy (-D warnings -W clippy::unwrap_used -W clippy::expect_used) and cargo fmt --check clean.

CHANGELOG entries are placed mid-### Fixed (after the merged gh#48 entry) so this PR, #63, and #64 merge cleanly in any order — verified pairwise with 3-way merge simulations.

Part of the vsdd kickoff-bundle epic (magnificentlycursed#2).

Authored by Claude Code on behalf of @magnificentlycursed.

Generated with Claude Code

magnificentlycursed and others added 5 commits August 1, 2026 14:48
Both dry-run guards executed after worktree creation: plan() had already
created the worktree/branch, written .kickoff-slug and PLAN_KICKOFF.md,
and recorded a permanent PlanRecord{stage:"planning"}; run() had created
its worktree and written .kickoff-slug/.kickoff-metadata.json. Repeated
dry-runs accumulated orphan worktrees and phantom "planning" rows that
cleanup classifies Stale and skips, and that pipeline reconciliation
(runs-only) never reclaims.

The guards now run before any creation. The dry-run output prints the
would-be worktree/branch (the exact names create_worktree derives) and
the prompt, unchanged in format. run --dry-run still creates the tracker
issue when none is passed - the printed prompt embeds its id.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The timeout wrapper killed the agent but nothing updated
.kickoff-status, so killed agents kept RUNNING forever at the sentinel
layer and only the wall-clock check against .kickoff-metadata.json ever
noticed. Both launch paths (local/sandbox via build_agent_command, and
the container's bash -c command) now append an exit-code-124 trailer
that writes TIMEOUT to the sentinel, and normalize_status classifies
TIMEOUT/timed* as "timed-out".

Tests: exact-command asserts updated for the trailer;
test_normalize_status_timeout_sentinel pins the classification.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…(gh#57)

The swarm guide documents H2 Phase/Layer headers as the explicit-phasing
form, but the design-doc parser recognized only H3 '### Phase N:'
headers inside '## Requirements' - the documented form fell into
unknown_sections and phasing intent silently degraded to
auto-decomposition. H2 sections whose title starts with Phase/Layer
(colon or space form) now parse into RequirementGroups via the same
parse_layer_header/list-collapsing path, extend the flat requirements
list for backward compat, and stay out of unknown_sections. Titles like
"Phased Rollout" do not false-positive.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The skill's Pipeline State Initialization step wrote pipeline.json via
an unconditional heredoc on every invocation - including --continue on a
design whose pipeline had advanced - wiping plans/runs and regressing
stage to "designed". The step now creates the file only when absent; when
it exists, a jq update rewrites doc_hash (and design_doc) in place,
preserving stage/plans/runs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The shipped agent_overrides (and work-check.py's built-in agent
defaults) blocked destructive operations only - plain git merge, rebase,
cherry-pick, reset, stash/tag/patch, and branch surgery were allowed at
the hook layer, and no command was gated - while container-agents.qmd,
kickoff.qmd, and the generated KICKOFF.md prompt all claimed "no push,
no merge, gated commits".

Enforcement now matches the claims where they were unambiguous: those
commands are mechanically blocked for agents and git commit is gated on
an active issue (explicit overrides still win). Plain git push remains
allowed because the CI-verify flow instructs the agent to push a draft
PR - blocking it would break that flow - so the prompt's Blocked Actions
section and both guides now state the real contract: force-push always
blocked, plain push reserved for the CI-verification steps.

Includes the CHANGELOG entries for the gh#19/60/57/56/58 cluster.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
test_kickoff_dry_run_creates_kickoff_md pinned the pre-gh#19 behavior:
it asserted the dry run CREATED the worktree and KICKOFF.md - the exact
side effect gh#19 removes - and so failed CI on this branch (the local
gate only ran the bin suite, missing tests/). Renamed to
test_kickoff_dry_run_is_side_effect_free_and_prints_prompt: it now
asserts the would-be worktree does NOT exist and checks the same prompt
contract markers against stdout, where the dry run prints the prompt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@magnificentlycursed

Copy link
Copy Markdown
Contributor Author

Review note from the vsdd-cli consumer (we verified this PR's gh#58 reconciliation against our own git-posture ruling — the PR-boundary model it ratifies is exactly right, and we've aligned our hook config to match): one residual doc overclaim survives the fix — tracking-modes.qmd:67-68 still reads "These are human-only operations. Agents should never push code", which now contradicts the PR's own deliberate plain-push carve-out ("push is reserved for the CI-verify draft-PR flow"). One sentence there would finish the docs-vs-hooks alignment this PR otherwise completes.

@dollspace-gay

Copy link
Copy Markdown
Member

merge conflict

…Projects#64) into fix/56-57-58-60-19

Resolves the overlap between this cluster and the merged container fixes.
- launch.rs: build_agent_command auto-merged cleanly (permission_flag()
  refactor from Corvidae-Coding-Projects#63 + the gh#60 TIMEOUT trailer from this branch, in
  non-overlapping regions); launch_container's command resolved to carry
  BOTH the {skip_flag} (gh#59) and the exit-124 TIMEOUT trailer (gh#60).
- kickoff/tests.rs: kept both appended tests (test_permission_flag_postures
  from Corvidae-Coding-Projects#63, test_normalize_status_timeout_sentinel from this branch).
- CHANGELOG.md: repaired an auto-merge that silently dropped the gh#53
  entry's opening line; full Fixed section audited.

Full suite green (bin 2857, integration 194, smoke 159); clippy/fmt clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dollspace-gay
dollspace-gay merged commit a153c3d into Corvidae-Coding-Projects:develop Aug 2, 2026
6 checks passed
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.

2 participants