Skip to content

fix(corpflow): Sync CORPFLOW.md to the 4.0.27 contract - #24

Merged
ikorich merged 1 commit into
masterfrom
bugfix/corpflow-4-0-27-seam-sync
Aug 29, 2026
Merged

ikorich merged 1 commit into
masterfrom
bugfix/corpflow-4-0-27-seam-sync

Conversation

@ikorich

@ikorich ikorich commented Aug 29, 2026

Copy link
Copy Markdown
Member

Motivation

CORPFLOW.md targeted an older corpflow contract, so this plugin emitted handoff frontmatter the
harness rejects outright. Reproduced against handoff-harness.sh --validate-frontmatter, which
corpflow runs at every stage boundary and which hard-fails the stage:

fail: stage=DV missing required field: summary

The shape it taught (from/to/run_index/status/artifacts/metadata{}) is read by nothing:
state-patch.sh reads handoff.stage, .verdict, .summary, .worktree_path,
.worktree_branch, and handoff.metadata.* has no reader at all.

Separately, the file is read in full on every cross-plugin delegation, so its size is a
per-dispatch token cost rather than a documentation concern.

Changes

  • Adopt corpflow's canonical handoff: schema. The annotated DV block is now both schema and
    template; AR, DR, SR, QA and IR collapse into a delta table.
  • Add the closing elicitation sweep — required on all 13 stages, hard-failing at every stage
    boundary regardless of --strict — with its item shape, ## elicitation-sweep anchor, and rules.
  • Add the state-patch.sh --facts payload, a sweep stub's only route to the gate that renders it.
  • Add the worktree / worktree_path / worktree_branch fields DR checks; absent or false is
    worktree_isolation_violation.
  • Correct artifact basenames: testing-N.md (was qa-<N>.md), incident-N.md (was
    incident-report.md).
  • Drop needs_changes, which is outside the verdict enum.
  • Mark DR, SR and QA as consultations — corpflow's own agents own those stages and artifacts — and
    state that DV ownership depends on tasks.DV0.agent.
  • Correct the pipeline: nine stages by default, --secure adds SR and RE, emergency is
    IR→DV→DR→QA→RE→FN.
  • Compact throughout: merge the two frontmatter sections and the return/gate-feedback sections,
    drop restated rationale. Rules that hard-fail a stage keep a short cost clause; the rest are bare
    imperatives. A size budget row is recorded in the footer.

Test plan

  • Built a DV artifact from the new frontmatter block plus a matching facts.open_questions[] and
    ran corpflow's handoff-harness.sh --validate-frontmatter <artifact> --state <state.json>:
    ok: stage=DV tokens=103, exit 0. The previous shape fails the same check.
  • corpflow bats suites routing-matrix, handoff-harness and desc-lint: 52 passed, 0 failed.
  • scripts/validate.sh: 0 errors (1 pre-existing unrelated SKILL.md size warning).
  • Section headings are byte-identical across all six sibling plugins, so a future contract change
    stays one mechanical pass.
  • Compared the backticked-identifier set against the previous revision; every dropped token is one
    of the intentional removals listed above.

Notes

Part of a seven-repo sync against corpflow 4.0.27 — the template in corpflow and the five other
platform plugins carry the same change.

Closes #23

CORPFLOW.md targeted an older corpflow contract, so this plugin emitted
handoff frontmatter the harness rejects outright:
`fail: stage=DV missing required field: summary`. The shape it taught
(from/to/run_index/status/artifacts/metadata{}) is read by nothing:
state-patch.sh reads handoff.stage/.verdict/.summary/.worktree_*, and
handoff.metadata.* has no reader at all.

Adopt the canonical schema. Add the closing elicitation sweep, now
required on all 13 stages and hard-failing at every stage boundary, plus
the --facts payload that is a sweep stub's only route to the gate that
renders it. Add the worktree fields DR checks. Correct the artifact
basenames (testing-N.md, incident-N.md), drop the invalid
`needs_changes` verdict, and mark DR/SR/QA as the consultations they are
-- corpflow's own agents own those stages and artifacts. Correct the
stage sets: nine by default, --secure adds SR and RE, emergency is
IR->DV->DR->QA->RE->FN.

The file is read in full on every cross-plugin dispatch, so size is a
per-delegation token cost. Merging the two frontmatter sections and
dropping restated rationale keeps it near its previous length while
carrying a contract that was not there before. Rules that hard-fail a
stage keep a short cost clause; the rest are bare imperatives.
@ikorich
ikorich merged commit 04f085d into master Aug 29, 2026
2 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.

CORPFLOW.md teaches a non-canonical handoff schema and omits the closing elicitation sweep

1 participant