feat(meta-orchestrator): Stage 3 — delta-diff helper + reconciliation rule + paired-negative - #243
Merged
Merged
Conversation
… rule + paired-negative
Stage 3 of the meta-orchestrator-mode-triage-and-planner umbrella ships the
read-side cohesion layer for the delta artefact persisted by Stage 2B and
wired in Stage 2C: a deterministic set-diff helper (delta-diff.sh) + a
discipline reference doc (master-backlog-delta.md) + a 7-case paired-negative
test for the set-diff logic. SKILL.md §2.5 Step 8 is rewritten to invoke the
helper deterministically while preserving the β-2 rationale; Step 1 gains a
reconciliation pointer.
What ships:
- New helpers/delta-diff.sh — pure-bash + jq, positional-arg set-diff between
prior .untracked_seen[].id (delta JSON) and current candidate ids; emits
"NEW-SINCE-LAST: <id>" + "RESOLVED-SINCE-LAST: <id>" lines. Edge cases:
missing file → all current = NEW; corrupt JSON → exit 1 + stderr; zero
args → exit 2 + usage. MO_DELTA_FILE seam. Carries @dual-pair:
meta-orchestrator-delta-diff + @cc-only-rationale (in-session CC helper).
- New references/master-backlog-delta.md (78 LOC) — mirrors plan-cache.md §1-§4
for the parallel delta artefact: §1 read-side touchpoints, §2 reconciliation
rule (binding trigger = L1+L2-sweep divergence, NOT git-HEAD-SHA — counters
the cache→delta verbatim-mirror trap T-Stage3-A), §3 helper-scope contract
(writer = metadata only; arrays = body-owned per Stage 2C), §4 anti-patterns
(#delta-as-source-of-truth, #delta-arrays-writer-creep,
#delta-clobbers-mechanical-state, T-Stage3-A
#cache-delta-mirror-pattern-mismatch). Carries @dual-pair:
meta-orchestrator-master-backlog-delta + Authoritative-for header per
doc-authority-hierarchy.md §3.
- SKILL.md §2.5 Step 1 — inlines reconciliation pointer + T-mem-A counter
reference to references/master-backlog-delta.md §2 (mechanical L1+L2 sweep
wins on divergence; untracked_seen is stage-0 cache, never load-bearing).
- SKILL.md §2.5 Step 8 — replaces 2C prose with the deterministic helper
invocation (inline backtick command, kept prose-form to fit under the
600-line markdown cap; AI invokes via its own emitted shell block at
runtime); preserves the β-2 rationale ("Direction A REJECTED per R-phase
β-2") + adds set-diff semantics + paired-negative contract pointers.
- SKILL.md See also — consolidates plan-cache.md + master-backlog-delta.md
link as parallel cache + delta discipline references.
- New packages/core/hooks/delta-diff.test.ts (153 LOC) — 7-case paired-
negative (EMPTY-SEEN / IDENTICAL / MIXED-DIFF / ALL-RESOLVED / SPECIAL-
CHARS / CORRUPT-JSON / BOUNDARY); label-mutation falsifier in MIXED-DIFF
(swap of NEW/RESOLVED prefix in helper would fail per-id label assertion).
Binding spec compliance:
- design §7.1 (β-2 sibling JSON sidecar) — Stage 3 ships the read side that
consumes the writer shipped Stage 2B (#240) + body-owned arrays shipped
Stage 2C (#242). update-delta.sh UNCHANGED per kickoff scope.
- design §7.2 (master-plan auto-update) — NO auto-write to wave-sequencing-
plan.md §0 (Direction A REJECTED). Maintainer manually updates §0 from
surfaced NEW/RESOLVED-SINCE-LAST emissions.
- R-phase §2 — β-2 verdict honoured; T16 problem-class separation from
Cline Memory Bank ADAPT pattern.
- plan-cache.md precedent (PR #236) — §1-§4 structure mirrored; trigger
condition rebuilt from scratch per T-Stage3-A.
Phase -1 self-review (Opus reviewer Agent, cold-start) caught and forced
resolution on 2 BLOCKER + 3 MAJOR + 4 MINOR before dispatch (B1 candidate-id
source, B2 Prior-art trailer obligation, M1 3-way anchor collision, M2 β-2
rationale preservation, M3 T-trap enumeration; m1-m4 fix-in-place).
§1.7: forward-check applied — build-first-reuse-default.md:50 (REUSE plan-cache.md §1-§4 + BUILD delta-diff per R-phase Area B verdict); no-paid-llm-in-ci.md:23 (deterministic bash + jq, zero API calls); doc-authority-hierarchy.md:71 (master-backlog-delta.md carries Authoritative-for header); dual-implementation-discipline.md:73 (delta-diff.sh carries @dual-pair: meta-orchestrator-delta-diff + @cc-only-rationale; doc + writer share meta-orchestrator-master-backlog-delta anchor); ai-laziness-traps.md:115 (T3/T7/T11/T13/T15/T16/T19/T20 enumerated + domain-specific T-Stage3-A codified in references/master-backlog-delta.md:55); reviewer-discipline.md:24 (Phase -1 REVISE findings resolved before dispatch, not auto-picked); parallel-subwave-isolation.md:25 (isolated worktree at rules-as-tests-aif-stage-3-delta); recommendation-laziness-discipline.md:33 (all design choices cite design §7.1/§7.2 + R-phase §2 inline by file:line); phase-research-coverage.md:50 (this trailer = §1.7 check); phase-research-coverage.md:107 (source-of-truth verify — discovered local staging was 2 commits behind origin/staging mid-session, base corrected before edits); phase-research-coverage.md:118 (β-2 verdict committed not option-dumped). backward-check sweep — .claude/skills/meta-orchestrator/SKILL.md:159 (§2.5 Step 1 minor edit: reconciliation pointer inline); .claude/skills/meta-orchestrator/SKILL.md:225 (§2.5 Step 8 prose rewrite preserving β-2 rationale); .claude/skills/meta-orchestrator/SKILL.md:604 (See also consolidated link); .claude/skills/meta-orchestrator/helpers/delta-diff.sh:1 (new 68 LOC helper); .claude/skills/meta-orchestrator/references/master-backlog-delta.md:1 (new 78 LOC discipline doc); packages/core/hooks/delta-diff.test.ts:1 (new 153 LOC paired-negative — capability commit per CLAUDE.md gate, Prior-art trailers below); .claude/skills/meta-orchestrator/helpers/update-delta.sh:1 UNCHANGED (Stage 2B contract); .claude/skills/meta-orchestrator/references/plan-cache.md:1 UNCHANGED (precedent referenced not modified); no .claude/rules/*.md modified; no .husky/* modified (classifier-protected + out of scope per kickoff "NOT scope" list); no existing packages/core/principles/*.test.ts modified; principle 18/19 still green (verified via vitest run); file scope exactly 4 (M SKILL.md + 3 new files; verified via git diff origin/staging --name-only).
Prior-art: docs/meta-factory/research-patches/2026-05-26-meta-orchestrator-mode-triage-prior-art.md §2 (Area B BUILD verdict — β-2 sibling JSON sidecar; T16 problem-class separation from Cline Memory Bank ADAPT pattern; mirrors update-delta.sh writer-side contract shipped Stage 2B).
Prior-art: docs/meta-factory/research-patches/2026-05-25-meta-orchestrator-mode-triage-and-planner-design.md §7.1 (binding design — read-side delta diff + reconciliation pointer for §2.5 Step 8).
artyhoo
enabled auto-merge
May 26, 2026 11:11
auto-merge was automatically disabled
May 26, 2026 12:42
Pull request was closed
artyhoo
enabled auto-merge
May 26, 2026 12:43
artyhoo
added a commit
that referenced
this pull request
May 26, 2026
…) + parse helper + paired-negative Stage 4 of meta-orchestrator-mode-triage-and-planner umbrella (optional per design §13). Wires the 6 override flags referenced in SKILL.md §2.5 Step 5 predicates but never parsed. Pure-bash parser; OVERRIDE_MODE+REASON emission; routing tree short-circuit. Anti-pattern guard mechanism documented in references/mode-overrides.md §5 (active rate-check deferred to follow-up — override_log[] schema field absent from current _master-backlog-delta.json per Stage 2B/2C contract; mechanism wired only when schema extension lands). SKILL.md wiring (Step 0 preamble + §2.5 short-circuit) deferred to follow-up after maintainer cap-bump PR (per #243 follow-up note). Stage 4 ships A/B/C infrastructure only; helper is fully testable in isolation. Cap blocker: SKILL.md at 600 LOC; D.1-D.3 add ~11-12 LOC; achievable compression ~8-9 LOC max (Phase -1 reviewer MAJOR-3 finding). Prior-art: docs/meta-factory/prior-art-evaluations.md#81 (oh-my-openagent alias dispatch REFERENCE; R-phase Area C verdict 2026-05-26 BUILD for flags + REFERENCE for aif-handoff AGENT_USE_SUBAGENTS shape). Prior-art: docs/meta-factory/research-patches/2026-05-25-meta-orchestrator-mode-triage-and-planner-design.md §10 (override-flags spec — 6 flags + reason ≥20 chars + emission contract + anti-pattern). §1.7: forward-check applied — .claude/rules/build-first-reuse-default.md:50 (REUSE plan-cache.md:3-4 / update-delta.sh:1-40 header + seams pattern for new helper + ref doc; BUILD parse-override-flags.sh per R-phase Area C verdict — no upstream bash CLI override parser with 6-flag mutually-exclusive semantics; confirmed R-phase §3 evidence); .claude/rules/no-paid-llm-in-ci.md:23 (deterministic bash, zero API calls); .claude/rules/doc-authority-hierarchy.md:71 (references/mode-overrides.md:3-6 carries blockquote Authoritative-for header mirroring plan-cache.md:3-4 format; Class C declared line 3); .claude/rules/dual-implementation-discipline.md:73 (helpers/parse-override-flags.sh:37 carries @dual-pair: meta-orchestrator-mode-overrides + @cc-only-rationale:38; ref doc line 27 carries matching HTML comment anchor); .claude/rules/ai-laziness-traps.md:115 (T3/T7/T11/T13/T15/T16/T19/T20 + T-MO-design-A + T-Stage4-A domain-specific traps active; T19 own cold-QA: all 17 VERIFY rows run; T20 all recommendations backed by tool-call evidence); .claude/rules/reviewer-discipline.md:24 (Phase -1 cold-review 2 BLOCKER + 4 MAJOR + 5 MINOR findings resolved before dispatch; cap-blocker finding MAJOR-3 correctly handled via fallback path); .claude/rules/parallel-subwave-isolation.md:25 (CC isolation:worktree verified — worktree branch feat/meta-orchestrator-stage-4-cli-overrides from origin/staging HEAD c4b63ac); .claude/rules/phase-research-coverage.md:50 (this trailer = §1.7 check); .claude/rules/phase-research-coverage.md:107 §1.11 (base = origin/staging c4b63ac = Stage 3 merged PR #243 verified via git log). backward-check sweep — .claude/skills/meta-orchestrator/references/mode-overrides.md:1 (NEW 171 LOC Class C ref doc; blockquote header; §1-§7 sections; @dual-pair anchor line 27); .claude/skills/meta-orchestrator/helpers/parse-override-flags.sh:1 (NEW 128 LOC pure-bash helper; @dual-pair line 37; @cc-only-rationale line 38; MO_OVERRIDE_REASON_MIN seam line 42; bash 3.2 compatible — no associative arrays; case statement alias map lines ~79-87); packages/core/hooks/parse-override-flags.test.ts:1 (NEW 137 LOC paired-negative — 9 cases / 14 tests via it.each; capability commit ≥80 LOC under packages/; spawnSync shape mirrors delta-diff.test.ts:68 + update-delta.test.ts:32); .claude/skills/meta-orchestrator/SKILL.md:1 UNCHANGED (deferred pending cap-bump follow-up; D.1-D.3 edits deferred; SKILL.md stays at 600 LOC = pre-commit cap limit); .claude/skills/meta-orchestrator/helpers/update-delta.sh:1 UNCHANGED (schema unchanged; override_log[] is design-only spec in references/mode-overrides.md §5); .claude/skills/meta-orchestrator/helpers/classify-work.sh:1 UNCHANGED (DN-3 binding); .claude/skills/meta-orchestrator/helpers/update-cache.sh:1 UNCHANGED; .claude/rules/*.md UNCHANGED; .husky/* UNCHANGED (classifier-protected); allowed-tools frontmatter UNCHANGED; existing packages/core/principles/*.test.ts UNCHANGED; docs/meta-factory/prior-art-evaluations.md:1 UNCHANGED (SSOT row #81 shipped Stage 3; not touched per feedback_no_drive_by_prs).
artyhoo
added a commit
that referenced
this pull request
Aug 9, 2026
…python lane's provenance producer (#1338) S1 shipped the per-rule lock shape and a working fragment READER; the PRODUCER never existed for the python lane's live researched path, so every emitted rule reads {"provenance":[],"tier":2}. Recorded as PARK-S1-7 in PR #1333 because the fix needs packages/core/install/rule-bootstrap-cli.ts, outside S1 §2. Un-parked by operator decision 2026-08-09 (the recorded revisit trigger — S2's targeted staleness — had NOT fired: no S2 kickoff, branch or PR exists). Authored as its own stage rather than folded into S2: the file sets are disjoint (S2 owns the three deps-hash-check.sh copies), and unlike S2 this stage is container-dispatchable because it writes nothing under .claude/**. Beyond the two causes the park record named, §1 adds one the park did not know: the fragment dir is SHARED across lanes and cargo/go glob it whole (46-cargo.sh:257-268, 47-go.sh:224-232), so python fragments written naively surface as foreign rules in their locks. Both readers are therefore in §2 and criterion 4 gates it. The §3 host-verify contract also closes the two gate-coverage holes S1 shipped with: it runs packages/core/synthesizer (S1's contract never did, so it could not see this defect class) and the synth-bundle drift check that run-local-ci-sweep.sh omits. Verified 5/5 on Darwin. Prior-art: skipped — kickoff markdown only, no capability introduced; the stage's own §4 routes the executor to SSOT #243 if its implementation crosses a LOC threshold. Co-authored-by: Test <test@example.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage 3 of the
meta-orchestrator-mode-triage-and-plannerumbrella ships the read-side cohesion layer for the delta artefact persisted by Stage 2B (#240) and wired in Stage 2C (#242). Substrate stays β-2 (sibling JSON sidecar) per R-phase verdict.What ships:
helpers/delta-diff.sh(68 LOC) — deterministic positional-arg set-diff between prior.untracked_seen[].id(delta JSON) and current candidate ids; emitsNEW-SINCE-LAST: <id>/RESOLVED-SINCE-LAST: <id>sorted lines. Edge cases: missing → all current = NEW; corrupt JSON → exit 1 + stderr; zero args → exit 2 + usage.MO_DELTA_FILEseam. Carries@dual-pair: meta-orchestrator-delta-diff+@cc-only-rationale.references/master-backlog-delta.md(78 LOC) — discipline reference doc mirroringplan-cache.md§1–§4 for the parallel delta artefact: §1 read-side touchpoints, §2 reconciliation rule (binding trigger = L1+L2-sweep divergence, NOT git-HEAD-SHA — counters T-Stage3-A), §3 helper-scope contract, §4 anti-patterns (#delta-as-source-of-truth,#delta-arrays-writer-creep,#delta-clobbers-mechanical-state,T-Stage3-A #cache-delta-mirror-pattern-mismatch).SKILL.md §2.5— Step 1 inlines reconciliation pointer + T-mem-A counter; Step 8 rewritten to invokedelta-diff.shdeterministically while preserving the β-2 rationale (Direction A REJECTED per R-phase β-2); See also consolidates the cache + delta discipline references.packages/core/hooks/delta-diff.test.ts(153 LOC) — 7-case paired-negative:EMPTY-SEEN/IDENTICAL/MIXED-DIFF(label-mutation falsifier — swap ofNEW/RESOLVEDprefix in helper would fail per-id label assertion) /ALL-RESOLVED/SPECIAL-CHARS(real namespace shapes perpriority-score.sh) /CORRUPT-JSON/BOUNDARY. 7/7 green.Process discipline:
B1candidate-id source ambiguity → positional args;B2Prior-art trailer obligation;M13-way anchor collision → separate anchor fordelta-diff.sh;M2β-2 rationale preservation;M3T-trap enumeration).update-delta.shUNCHANGED per kickoff scope.!shellblock to prose-with-inline-backtick after classifier blocked both cap bump in.husky/pre-commitandallowed-toolsexpansion in SKILL.md frontmatter)..husky/**orallowed-tools(both denied; no bypass attempted).Binding spec compliance
wave-sequencing-plan.md §0(Direction A REJECTED); maintainer manually updates §0 from surfacedNEW/RESOLVED-SINCE-LASTlines.plan-cache.mdprecedent (PR feat(meta-orchestrator): skill memory — cache + injection + writer #236) — §1–§4 structure mirrored; trigger condition rebuilt from scratch for delta domain per T-Stage3-A counter.§1.7 Forward-check applied
Forward — complies with which project rules:
build-first-reuse-default.md:50 — REUSEplan-cache.md§1–§4 structure; BUILDdelta-diff.shper R-phase Area B verdict (no upstream in-session bash multi-source-aggregator set-diff helper).no-paid-llm-in-ci.md:23 — deterministic bash + jq + comm + sed; zero API-billed calls.doc-authority-hierarchy.md:71 —master-backlog-delta.mdcarries Authoritative-for + NOT-authoritative-for header.dual-implementation-discipline.md:73 —delta-diff.shcarries@dual-pair: meta-orchestrator-delta-diff+@cc-only-rationale; doc +update-delta.shsharemeta-orchestrator-master-backlog-deltaanchor (mirrorsplan-cache.md↔update-cache.shprecedent).ai-laziness-traps.md:115 — canonicalT3/T7/T11/T13/T15/T16/T19/T20enumerated in commit body + domain-specificT-Stage3-A(#cache-delta-mirror-pattern-mismatch) codified inreferences/master-backlog-delta.md:55 §4.reviewer-discipline.md:24 — Phase -1 reviewer findings resolved before dispatch (not auto-picked); REVISE → 2 BLOCKER + 3 MAJOR addressed.parallel-subwave-isolation.md:25 — worked in isolated worktree at/Users/art/code/rules-as-tests-aif-stage-3-delta(branch offorigin/stagingperproject_automerge_staging_plan).recommendation-laziness-discipline.md:33 — all design choices cite design §7.1/§7.2 + R-phase §2 inline by file:line; no inline verdicts without evidence.phase-research-coverage.md:50 — this PR-body section is the §1.7 check.phase-research-coverage.md:107 §1.11 — source-of-truth verified mid-session; caught localstaging2 commits behindorigin/stagingbefore edits (would have built against stale base; corrected by branching offorigin/stagingdirectly).phase-research-coverage.md:118 §1.12 — β-2 verdict committed not option-dumped (R-phase §2.5 evidence —#cache-writer-feature-creepanti-pattern atplan-cache.md:55).§1.7 Backward-check applied
Backward — what is superseded or affected:
SKILL.md:159 — §2.5 Step 1 minor edit: parenthetical with reconciliation pointer added to header line (NET 0 LOC).SKILL.md:225 — §2.5 Step 8 prose rewrite: was 2C 1-line prose set-diff stub; now 1-line prose with inline helper invocation + β-2 rationale preserved + paired-negative + reference doc pointers (NET 0 LOC).SKILL.md:604 — See also: consolidated parallel cache + delta references into single new bullet (NET +1 LOC; total SKILL.md = exactly 600 / cap).helpers/delta-diff.sh:1 NEW — 68 LOC; pure-bash + jq + comm.references/master-backlog-delta.md:1 NEW — 78 LOC; mirrors plan-cache.md.packages/core/hooks/delta-diff.test.ts:1 NEW — 153 LOC paired-negative; capability commit per CLAUDE.md gate (>80 LOC under packages/) →Prior-art:trailer present below.helpers/update-delta.sh:1 UNCHANGED — Stage 2B writer-side contract preserved per kickoff scope.references/plan-cache.md:1 UNCHANGED — precedent referenced, never modified..claude/rules/*.mdmodified..husky/*modified (classifier-protected + out of scope per kickoff «NOT scope» list — cap-bump deferred).allowed-toolsfrontmatter expansion (classifier-protected; Step 8 reverted to prose-with-inline-backtick to fit existing permission surface).packages/core/principles/*.test.tsmodified.pnpm -C packages/core exec vitest run principles/18-... principles/19-...; 32 tests pass).SKILL.md+ 3 new files; verified viagit diff origin/staging --name-only).prior-art-evaluations.mdUNCHANGED in this PR — R-phase rows docs(research): cross-worktree gitignored coord-doc sync — verdict ADAPT (symlink-to-canonical) #78–fix(hooks): force visible "🟢 Простыми словами" block in end-of-turn reminder #81 ship in a separate atomic commit perfeedback_no_drive_by_prs(this PR's scope = Stage 3 implementation deliverable only).Pre-merge verification
delta-diff.shsmoke-tested locally (6 cases: missing file / empty seen / mixed diff / all-resolved / corrupt JSON / boundary /MO_DELTA_FILEseam) — verified: local Bash invocationspackages/core/hooks/delta-diff.test.ts7/7 green — verified:pnpm exec vitest run hooks/delta-diff.test.tsdelta-diff+update-delta+update-cache+ principles 18/19) — verified: 35 tests / 4 files green local runpnpm exec vitest run principles/markdownlint-cli20 errors on SKILL.md + master-backlog-delta.md — verified: local lint runscripts/check-skill-drift.sh0 errors — verified: local run (rules-table region up-to-date)wc -ldoc-authority-hierarchyhook PASS onmaster-backlog-delta.md(exit 0) — verified: piped JSON probeci-successgreen on PR — owner: GitHub Actions (post-push)stagingonceci-successgreen — owner: GitHub auto-merge (post-CI)Acceptance criteria
delta-diff.sh(inline backtick command, preserves β-2 rationale) — verified: file contentreferences/master-backlog-delta.mdexists with §1–§5 mirroring plan-cache.md structure + binding trigger condition (L1+L2-sweep divergence) — verified: file content + grephelpers/delta-diff.shships with deterministic set-diff semantics + 4 edge cases + MO_DELTA_FILE seam — verified: smoke tests + paired-negativepackages/core/hooks/delta-diff.test.ts7 cases ≥1 label-mutation falsifier — verified: MIXED-DIFF asserts per-id label bindinggit diff origin/staging -- helpers/update-delta.shAuto-merge
This PR targets
staging(trunk perproject_automerge_staging_plan). Auto-merge will fire onci-successgreen via the repo's branch-protection configuration. No squash needed (single commit).Follow-ups (separate atomic PRs per
feedback_no_drive_by_prs)prior-art-evaluations.md(R-phase verdicts for surfaces f/g/h + alias precedent) — separate atomic commit.--mode-directetc., design §10) — gated on Stage 3 stability..github/workflows/audit-self.yml.