Skip to content

docs: post-1A follow-up (Class C reviewer-discipline, Q3/Q5, README absolutism) - #67

Merged
artyhoo merged 3 commits into
mainfrom
docs/post-1a-followup-2026-05-16
May 16, 2026
Merged

docs: post-1A follow-up (Class C reviewer-discipline, Q3/Q5, README absolutism)#67
artyhoo merged 3 commits into
mainfrom
docs/post-1a-followup-2026-05-16

Conversation

@artyhoo

@artyhoo artyhoo commented May 16, 2026

Copy link
Copy Markdown
Owner

Summary

Post-1A coordination follow-up — 3 atomic commits закрывают decision-needed items из 2026-05-16 dialogue cycle:

  1. 305720a docs(principles): revise principle 11 design sketch Q3/Q5 per Track 5 evidence

    • Q3 «every npm test invocation» replaces «nightly + per-PR scoped» — original recommendation contradicted by evidence probes (no schedule: triggers in .github/workflows/*.yml; no incremental: true in packages/core/stryker.config.mjs)
    • Q5 «hard-fail from day one» replaces «2-week warning grace period» — aligns with principles 08/09 ship precedent
    • Q4 capability-count threshold tightened 200 → 150 as early warning
    • Fixes 3 broken ../../docs/... paths to ../../../docs/... matching repo-root pattern at lines 145-149 of design.md
  2. 4d52a72 docs(rules): reclassify reviewer-discipline as Class C (no current mechanism)

    • D1 = C-revise-2 path per maintainer decision 2026-05-16
    • Adds explicit §5 «Classification — Class C (no current mechanism)»
    • Removes 1A draft's implicit claim that agents/compliance-verifier.md serves as compensating mechanism (Track 3 §3.3 found it scoped to PR §1.7 review, NOT reviewer role-swap detection — T16 pattern-matching-on-name)
    • Path forward documented: C-revise-1 (new agents/reviewer-discipline-verifier.md prompt) when §4 promotion criterion fires (3+ role-swap incidents in 6 months)
  3. a56ab5b docs(research-patches): surface README absolutism vs Class C practice gap

    • Reviewer-mode meta-observation surfaced via maintainer challenge on D1: «does C-revise-2 contradict our central thesis "rule = test"?»
    • Quotes README.md:43 verbatim («every rule that governs your codebase is an executable artifact… that fails when violated, at the earliest reachable channel») + session-bootstrap digest
    • Enumerates current Class C rules (parallel-subwave-isolation, reviewer-discipline post-D1) — ≥2 prose-only rules with no executable artifact, contradicting «every» absolutism
    • Observation-only per reviewer-discipline.md §2 surface-as-decision-needed: §4 lists 3 resolution options without picking; §7 surfaces 4 DECISION-NEEDED items (resolution path, inventory completeness, §13.x graduation, Class self-description mechanism)

§1.7 Forward-check applied

This PR ships changes touching .claude/rules/reviewer-discipline.md (rule semantics extension — new §5 Class C declaration + promotion path) and packages/core/principles/11-build-first-reuse-default.design.md (design sketch refinement based on Track 5 evidence-probe). Forward-compliance with all currently active disciplines:

  • doc-authority-hierarchy.md §3 header format: .claude/rules/reviewer-discipline.md:3-4 retains valid Authoritative-for / NOT authoritative-for header (unchanged); new §5 at .claude/rules/reviewer-discipline.md:38 follows established ## §N Title H2 convention and inherits per-file authority.
  • phase-research-coverage.md §1.7 self-reflexive trigger: this PR ships companion research-patch at docs/meta-factory/research-patches/2026-05-16-readme-absolutism-vs-class-c-practice.md:1-249 walking Class C reclassification through §1.1-§1.7 self-review; its §6 runs recursive §1.7 with honest «I didn't grep all rules» disclosure.
  • ai-laziness-traps.md T16 «pattern-matching-on-name»: evidence trail cited at docs/meta-factory/research-patches/2026-05-16-prose-rules-audit-research.md:69-92 (§3.3) confirms compliance-verifier.md was misidentified by 1A draft because its name sounds catch-all but scope is narrow (PR §1.7 substance only). T16 caught the implicit claim before it shipped.
  • no-paid-llm-in-ci.md: no new CI/LLM dependencies introduced; rule edit + research-patch additions only.
  • build-first-reuse-default.md: design sketch Q3/Q5 revision is refinement of already-ADOPT-VOCABULARY pattern (companion principle-test slot 11), not new capability — no new SSOT entry needed; Prior-art: skipped valid on all 3 commits per .husky/pre-push:167-172 capability detection (no new deps, no new files ≥80 LOC under packages/, no new ≥50 LOC files under new packages/core//).
  • CLAUDE.md Artifact Ownership Contract: edits stay within .claude/rules/ (phase-research/capability-commit author owned), packages/core/principles/*.design.md (same), and docs/meta-factory/research-patches/ (session that discovered gap owned). No maintainer-owned artefact (README, EXECUTION-PLAN, PROPOSAL, hooks) modified.

§1.7 Backward-check applied

Backward-sweep of all artefacts under the new §5 «Class C classification» rule scope introduced by commit 4d52a72:

  • .claude/rules/parallel-subwave-isolation.md:1-4 — pre-existing Class C rule (Track 3 verdict at docs/meta-factory/research-patches/2026-05-16-prose-rules-audit-research.md:108-127 §3.5 CONFIRMED-DEFER). Referenced from new §5 in 4d52a72 as sibling Class C precedent. No edits needed there — its existing classification is consistent with this PR's framing.
  • .claude/rules/reviewer-discipline.md:42-46 — old «See also» entries for agents/compliance-verifier.md and agents/review-sidecar.md updated by 4d52a72 from neutral «sub-agent precedent» framing to explicit «NOT a reviewer-discipline mechanism per Track 3 §3.3» — prevents future drift where another agent could re-establish the mistaken claim.
  • agents/compliance-verifier.md:3 — verified externally (file unchanged) that scope description «Reviews PR description §1.7 Forward-check and Backward-check sections for substantive evidence» does NOT cover reviewer role-swap detection or strategy-imperative phrase checking. Empirical evidence backing the §5 «NOT compliance-verifier» claim.
  • docs/meta-factory/research-patches/2026-05-16-prose-rules-audit-research.md:259-267 — Decision A C-revise-2 path source documents exact transition this PR ships (Class B → C, 15min reclassification, no new mechanism).
  • reviewer-discipline.md:35 — existing §4 promotion criterion line («if 3 cross-session role-swap incidents occur within 6 months») remains the trigger condition for future C-revise-1 path; new §5 cross-references it without changing the threshold.
  • No companion principle test yet for reviewer-discipline (Class C explicitly = «mechanism deferred» per new §5); this PR does NOT create packages/core/principles/12-reviewer-discipline.test.ts — promotion is incident-evidence-gated.
  • Other prose-only rules in scope of new §5 framing: only parallel-subwave-isolation.md shares Class C status; full rule-by-class inventory at docs/meta-factory/research-patches/2026-05-16-readme-absolutism-vs-class-c-practice.md:44-61 (§3 table) confirms no other rule file requires update under the new classification.

Test plan

  • CI discipline-self-check.yml passes — §1.7 substance arm with H3 «applied» headers + file:line citations in both Forward and Backward sections
  • CI audit-self.yml passes — no canonical-phrase drift; new research-patch under research-patches/ path-exempted from 500-line markdown limit per commit 5e41b7a
  • CI workflow-integrity.yml passes — no .github/workflows/*.yml files touched
  • CI principles test sweep passes — locally verified 56/56 (npx vitest run principles/ from packages/core/)
  • Markdownlint passes — pre-commit hook clean on all 3 commits
  • Pre-push hook substance arm: warn-only on 4d52a72 (rule-introducing without commit-body §1.7: trailer) — accepted in calibration window through 2026-06-10 per .husky/pre-push:308; precedent: 809d7eb (Commit 2) and 0fd231b (phase-research-coverage §1.10) shipped via PR with §1.7 in PR body using same pattern

Notes for reviewer

  • Origin/main moved 9 commits forward during the orchestrator → reviewer → orchestrator session cycles. Feature branch was rebased onto current origin/main (be348ea) before push — 0 conflicts (file-intersection verified empty before rebase).
  • Pre-existing systemic finding surfaced as observation in commit a56ab5b body: shipped research-patches under docs/meta-factory/research-patches/*.md use 2-level ../.. refs for repo-root paths, which are systematically broken (need 3-level ../../..). This PR's new patch uses correct 3-level paths. Sweep-fix for shipped siblings deliberately NOT bundled here per atomic-umbrella discipline (CLAUDE.md PR strategy); would be separate maintainer-decided PR.
  • DECISION-NEEDED items surfaced in a56ab5b §7 (4 items: resolution path, inventory completeness, §13.x graduation timing, Class self-description mechanism) remain open for maintainer.

artyhoo added 3 commits May 17, 2026 00:15
… evidence

Q3 (when does test run): «every npm test invocation» replaces «nightly +
per-PR scoped» — original recommendation contradicted by evidence probes
(no schedule: triggers in .github/workflows/*.yml; no incremental: true
in packages/core/stryker.config.mjs).

Q5 (warning vs failure): «hard-fail from day one» replaces «2-week
warning grace period» — aligns with principles 08/09 ship precedent;
phase-research-coverage rollout was continuous iterative, not phased.

Q4 capability-count threshold tightened 200 → 150 as early-warning
before hard budget. Cross-reference path fix: 3 broken ../../docs paths
corrected to ../../../docs (matches repo-root pattern at lines 145-149).

Follow-up to 809d7eb (Commit 2 BFR sketch). Evidence source: research-patch
2026-05-16-principle-11-q1q5-evidence.md (landed in dba3e19).

Prior-art: skipped — design sketch refinement post-ship, no new capability (revises Q3+Q4+Q5 only; no new files, no new deps, no new artifact-class definitions)
…chanism)

D1 = C-revise-2 path per maintainer decision 2026-05-16. Adds explicit §5
classification stating Class C status (prose-only, mechanism deferred) and
removes the 1A draft's claim that agents/compliance-verifier.md serves as
the compensating mechanism.

Track 3 §3.3 evidence probe found compliance-verifier.md is scoped to PR
description §1.7 Forward/Backward substance review, NOT to reviewer
role-swap detection or strategy-imperative phrase checking. Pattern: T16
«pattern-matching-on-name» — «compliance verifier» sounds catch-all but is
narrowly scoped.

Path forward when §4 promotion criterion fires (3+ role-swap incidents
in 6 months): C-revise-1 — design a new agents/reviewer-discipline-verifier.md
prompt. Not pre-built; promote on incident evidence, not anticipation.

See also entry for compliance-verifier.md updated from neutral «sub-agent
precedent» to explicit «NOT a reviewer-discipline mechanism per Track 3
§3.3» to prevent future drift.

Cross-reference to research-patches/2026-05-16-readme-absolutism-vs-class-c-practice.md
surfaces the README invariant absolutism vs Class C practice tension for
maintainer-owned resolution.

Prior-art: skipped — doc edit only, reclassifies existing rule from implicit Class to explicit Class C; no new capability, no new dep, no new artifact-class definitions
… gap

Reviewer-mode meta-observation surfaced via maintainer challenge on D1
(Action C path for reviewer-discipline.md reclassification 2026-05-16):
«does C-revise-2 contradict our central thesis "rule = test"?»

Patch quotes README.md:43 verbatim («every rule that governs your codebase
is an executable artifact … that fails when violated, at the earliest
reachable channel») and session-bootstrap.md auto-injected digest, then
enumerates actual current Class C rules (parallel-subwave-isolation,
reviewer-discipline post-D1) — at least 2 prose-only rules with no
executable artifact, contradicting the «every» absolutism.

Observation-only (per reviewer-discipline.md §2 surface-as-decision-needed
pattern): §4 lists three resolution options (A/B/C revise invariant /
time-box Class C / document tension), §7 surfaces 4 DECISION-NEEDED items
(A resolution path; B inventory completeness; C §13.x graduation timing;
D Class-self-description mechanism), §6 runs recursive §1.7 with honest
disclosure of what was NOT probed.

Companion to cea5436 (Commit 3-revised) — provides the evidence and
broader-tension framing that the rule reclassification cites in its §5
recursive self-application note.

Path-correctness note: this patch uses ../../../ (3-level) refs from
research-patches/ to repo root. Pre-existing sibling patches use ../../
(2-level) which are systematically broken. Surfaced as observation for
maintainer-owned sweep decision; not fixed in this commit per atomic-PR
discipline.

Prior-art: skipped — research-patch evidence entry, append-only register per phase-research-coverage.md §3; no new capability, no new dep
@artyhoo
artyhoo merged commit 9e49159 into main May 16, 2026
20 checks passed
artyhoo added a commit that referenced this pull request May 22, 2026
… trigger (§5.3) (#164)

Maintainer-delegated (/orchestrator «N0 decision, го итеративно и автономно»,
2026-05-22). Resolves the three N8 findings §7 decisions:

- D1 cost lever → defer ALL options + arm a trigger. Substrate weatherproof
  by no-paid-llm-in-ci; at ~10 sessions/mo metered spend is ~6.8% of a $200
  credit even unoptimised → building B's router / C's local dispatcher now is
  premature-BUILD. Revisit (→ Option B) at >~50% credit utilisation OR on
  commitment to unattended headless loops.
- D2 R4 local-model bench → NO-GO now (REFERENCE-only, SSOT #67 proposed);
  capability floor INCONCLUSIVE; gated on the same trigger.
- D3 offload priority → decoupled into N8 A-phase (C1 first, correctness ROI).

Open factual gap recorded: interactive→subagent billing boundary is officially
undefined (help-center silent on the hybrid; checked via claude-code-guide). The
armed trigger makes the verdict robust either way.

Single-source: §5.3 is the decision record; niche-roadmap §N0 + §0 table point
to it. Cold-reviewed (1× adversarial pass, 1 BLOCKER + 2 MAJOR + 2 MINOR caught
and fixed before commit).

Prior-art: skipped — decision-record doc edit, no new capability or dependency.
@artyhoo
artyhoo deleted the docs/post-1a-followup-2026-05-16 branch May 22, 2026 18:09
artyhoo added a commit that referenced this pull request May 24, 2026
…p-3 (#202)

* docs(ssot): add row #71 — delegation-vs-decision discipline (round-1 BUILD evidence trail)

ATTN-1 follow-up from round-2 audit (PR #201, commit d212dae Sub-wave B
Invariant 1). Documents the external-prior-art check that justified
round-1's BUILD verdict over ADOPT for the problem class
«delegation-vs-decision discipline in skill priority-tie resolution».

Row #71 records:
- Candidate: Superpowers `using-superpowers` Red Flags table (13-entry
  skill-invocation rationalisation tracker)
- Verdict: REJECT (T16 problem-class non-match — match score ~5%)
- T16 evidence: upstream addresses *whether* to invoke a skill; ours
  addresses *who decides* among ranked priority candidates
- ADAPT credit (internal, no SSOT row per §1 scope): reviewer-discipline
  §2 «Surface-as-decision-needed» 4-step protocol

Format follows the §3 entry template + existing row precedent (#67-#70).
Last reviewed 2026-05-24. Trigger to revisit: Superpowers ships a
delegation-vs-decision skill; OR /meta-orchestrator §2 scope expands to
autonomous-pick-without-confirmation.

Not a capability commit (docs-only — §4 entry table append; no new dep,
no ≥80 LOC under packages/, no ≥50 LOC under packages/core/<new-dir>/).

Prior-art: skipped — append to existing SSOT register (one row, no new
upstream-tool adoption); the row itself IS the prior-art evidence trail
for an already-shipped BUILD decision.

§1.7: forward-check applied — row format complies with
prior-art-evaluations.md §3 entry template (next-ID 71, all 8 columns
populated, rationale cites round-2 commit d212dae + reviewer-discipline
§2 with file:line); T16 problem-class check explicit per
ai-laziness-traps.md §2 T16 (upstream-class vs our-class enumerated with
match-score). Backward-check sweep — extends existing append-only
register; does not edit prior rows; reviewer-discipline.md §2 path
verified (.claude/rules/reviewer-discipline.md exists, §2 «Surface-as-
decision-needed pattern» at line 17 of that file).

* feat(meta-orchestrator): add globs+inject markers per round-2 Invariant 4

ATTN-2 follow-up from round-2 audit (PR #201, commit d212dae Sub-wave B
Invariant 4 «recommend path-scoped injection via inject-matching-rule.sh
+ globs marker. Follow-up annotation»).

Adds <!-- globs: --> and <!-- inject: --> markers to both SKILL.md copies
(.claude/skills/ runtime + skills/ shipped), targeting:
- .claude/orchestrator-prompts/** (kickoff authoring)
- docs/meta-factory/wave-sequencing-plan.md (wave plan edits)

When extended to scan .claude/skills/*/SKILL.md, the existing
inject-matching-rule.sh hook (today scans .claude/rules/*.md per
rule-enforcement-channel-selection.md §4) will JIT-inject the
meta-orchestrator one-liner reminder on the matched edits — narrowing
discoverability from manual recall to per-edit deterministic injection.

Forward-going annotation: the hook does NOT yet scan skills/ — that is
a separate scope expansion (out of round-2 follow-up scope). Markers are
honest annotation pending that extension; the inject summary itself
carries this status note.

Marker format follows the dogfood precedent in
.claude/rules/rule-enforcement-channel-selection.md (the first repo file
to carry <!-- globs: --> / <!-- inject: --> markers).

500-line gate respected: markers placed without surrounding blank lines
(2-line net addition) so .claude/skills/meta-orchestrator/SKILL.md stays
at 500 lines (the gate limit).

Dual-file annotation per dual-implementation-discipline §7: both copies
get markers so consumer installations (via install.sh) inherit them
unchanged when the consumer-side hook supports skills/ scanning.

Not a capability commit (annotations + comments only — no new dep,
no ≥80 LOC under packages/, no ≥50 LOC under packages/core/<new-dir>/).

Prior-art: skipped — annotation-only addition implementing an already-
shipped round-2 audit recommendation (Invariant 4); no new upstream-tool
adoption (the hook itself is the existing ADAPT of OhMyOpencode
`rulesInjector` per SSOT #61).

§1.7: forward-check applied — markers conform to
rule-enforcement-channel-selection.md §4 grammar (globs subset:
prefix/**, exact path; inject summary self-documenting) verified by
re-reading .claude/hooks/inject-matching-rule.sh:53,69 parsing regex;
dual-file addition complies with dual-implementation-discipline.md §3
(consumer-facing artefact, both copies updated atomically); forward-
going annotation discipline follows rule-enforcement-channel-selection.md
§6 «Existing rules — forward-going, not retroactive». Backward-check
sweep — inline note in inject summary prevents future readers from
assuming markers are active (they activate only on hook extension); does
not modify existing § content, See also entries, or section ordering;
extends but does not supersede prior round-2 Sub-wave B Invariant 4
finding.

* fix(meta-orchestrator): plan-currency-check fetches + cross-checks origin/staging

Gap-2 follow-up from round-2 audit (PR #201, §1.5 «plan-currency-check.sh
не cross-check'ит git log origin/<branch> против локального — пропускает
свежие PR'ы»).

Before this fix the helper relied on whatever local copy of
origin/staging the user happened to have — days stale in long sessions
or after a fresh worktree, making fresh merges since last sync
invisible to the §1 plan-currency check that consumes this output.

Adds a fail-soft `git fetch --quiet origin staging` before the JSON
PR-list queries, then surfaces the count of remote-only commits via
`git rev-list HEAD..origin/staging`. If non-zero, the oneline log of
those commits is printed (capped to 10) as «likely merged PRs since
last local sync» — the explicit fresh-PR detector.

Fail-soft contract: offline / auth-failure / no-network → echoed
warning, helper continues to exit 0 (matches existing graceful-
unavailability pattern for `gh` and `git status` blocks at lines 18 /
30 / 38).

Dual-file: both `skills/meta-orchestrator/helpers/plan-currency-check.sh`
(authoring) and `.claude/skills/meta-orchestrator/helpers/plan-currency-check.sh`
(runtime) updated atomically per dual-implementation-discipline §3.

Smoke test verified: helper runs clean (exit 0), new section integrates
between branch + PR-list blocks, current-branch behaviour confirmed
(0 remote-only when synced, lists oneline when stale).

Not a capability commit (helper enhancement — no new dep, no ≥80 LOC
under packages/, no ≥50 LOC under packages/core/<new-dir>/).

Prior-art: skipped — fix to existing helper (shipped #186, audited
#192/#201) addressing a specific stale-data gap; no new upstream-tool
adoption (git rev-list + git fetch are existing capabilities).

§1.7: forward-check applied — fail-soft fetch complies with
no-paid-llm-in-ci.md §1 (deterministic git ops, no API-billed calls),
dual-implementation-discipline.md §3 (both copies updated atomically;
diff -q reports identical post-patch), ai-laziness-traps.md §2 T3
(no-prose-only findings — smoke test verifies exit 0 + correct output
on current branch state above). Backward-check sweep — addition is
between existing sections (not modifying them); the existing left-right
ahead/behind block at lines 22-23 stays unchanged (it benefits from the
fetch immediately above when re-run); does not modify §1 SKILL.md
consumer logic (helper output remains a superset of prior output —
purely additive section), so SKILL.md §1 read of this helper output is
backward-compatible.

* feat(meta-orchestrator): meta-kickoff template ships worktree setup boilerplate

Gap-3 follow-up from round-2 audit (PR #201, §1.5 «worktree symlink slot
в template — каждый worker re-discovers packages/core/node_modules
symlink discipline»).

Adds §4a «Worker worktree setup» between §4 (dispatch instructions) and
§5 (AI-traps). The slot ships the boilerplate every worker dispatched
into a `git worktree add`-created directory needs as the first session
step, otherwise the worker rediscovers (burning Opus) the workspaces /
remark requirement that `git worktree add` does NOT copy from the
primary workdir.

Detection contract uses `git rev-parse --git-dir != --git-common-dir`
(absolute path vs relative `.git`) — the same probe Superpowers
`using-git-worktrees` uses for its nested-worktree skip, per
`parallel-subwave-isolation.md §4`. Idempotent: the `if` body is a
no-op in the primary workdir; symlinks are created only when missing.

Plumbing reconstituted:
- `node_modules` → symlink to primary's `node_modules` (saves an
  `npm install` cycle inside the worktree)
- `packages/core/node_modules` → symlink to `../../node_modules`
  (workspaces hoisting marker — empirically the load-bearing one)

Dual-file: both `skills/meta-orchestrator/templates/meta-kickoff.template.md`
(authoring) and `.claude/skills/meta-orchestrator/templates/meta-kickoff.template.md`
(runtime) updated atomically per dual-implementation-discipline §3;
diff -q reports identical post-patch.

The slot lives in the template (not the helper), so it travels with
every meta-kickoff generated by `/meta-orchestrator` automatically —
the dispatch instructions {{DISPATCH_INSTRUCTIONS}} are sub-wave-
specific, this is universal worker boilerplate that precedes them.

Not a capability commit (template enhancement — no new dep, no ≥80 LOC
under packages/, no ≥50 LOC under packages/core/<new-dir>/).

Prior-art: skipped — template enhancement closing a §1.5-surfaced gap
in an already-shipped artefact (#186 + #192 + #201); no new upstream-
tool adoption (the worktree-detection probe is ADAPT from upstream
Superpowers `using-git-worktrees`, SSOT #65, already in the register).

§1.7: forward-check applied — slot complies with
no-paid-llm-in-ci.md §1 (pure-git deterministic ops, no API-billed
calls), parallel-subwave-isolation.md §4 (REFERENCE — uses the same
GIT_DIR/GIT_COMMON_DIR worktree-detection pattern Superpowers ships),
dual-implementation-discipline.md §3 (both copies updated atomically),
ai-laziness-traps.md §2 T15 (the slot itself self-applies — it codifies
the boilerplate workers were re-discovering; recursive). Backward-check
sweep — addition is purely additive (new §4a section between existing
§4 and §5; no edits to existing sections); meta-kickoff.template.md
consumers (the launch-table-generator + downstream workers reading the
generated kickoff) see the slot as static text post-template-substitution
— no placeholder logic depends on the slot's absence.
artyhoo added a commit that referenced this pull request May 29, 2026
…eep evaluation (#268)

Variant scored: MCP-consumer bridge (handoff_create_task + accept_existing_plan +
WebSocket tail + handoff_sync_status). 7 DeepWiki probes + 2 WebSearch queries +
SSOT #27/#28/#30/#43/#44/#46/#67/#80 consult + SKILL.md:404/429 disambiguation.

Verdict: REFERENCE (not ADOPT). Body-format falsifier PASSES — description field
accepts arbitrary markdown (z.string().optional(), no .max()). Minimum call =
{projectId, title}. BUT full pipeline bridge blocked by three structural issues:
(1) accept_existing_plan requires physical PLAN.md on disk in .ai-factory/ —
filesystem coupling beyond MCP boundary; (2) WebSocket broadcast channel has no
topic filter — client must filter by taskId; (3) aif-handoff Reviewer (autoMode)
conflicts with reviewer-discipline.md §2 strategy-fork-surface gate.

Admission gate §2.4: PR #127/#128 touch packages/runtime/ only — no packages/mcp/
or apps/coordinator/ changes. Gate CLEAR.

SKILL.md:404 vs :429 inconsistency resolved analytically (both consistent — BFR
verdict = REFERENCE for SP skill; operational action = ADOPT SP dispatch template).

Prior-art: prior-art-evaluations.md#44 (DEFER, body-format now confirmed compatible);
prior-art-evaluations.md#30 (DEFER, accept_existing_plan bypass documented);
prior-art-evaluations.md#67 (REJECT unchanged — Variant A is optional layer, not
replacement). Sub-wave D proposes new SSOT row for Variant A bridge vocabulary.
artyhoo added a commit that referenced this pull request May 29, 2026
…k + aif-handoff MCP) REFERENCE (#275)

Verdict per BFR-default §1: REFERENCE — design-vocabulary for dispatch-trigger
optimisation of Variant A; not actionable standalone.

Key findings (2026-05-29 evidence):
- CC PostToolUse hooks expose a purpose-built `mcp_tool` hook type for
  already-connected MCP servers (code.claude.com/docs/en/hooks.md fetched
  2026-05-29) — T-AIF-BRIDGE-B'-1 evades via different shape than originally
  framed.
- aif-handoff MCP server runs standalone without coordinator daemon for task
  creation (DeepWiki ×2 phrasings: «MCP server can be invoked statelessly from
  an arbitrary process» + «MCP HTTP daemon runs independently») —
  T-AIF-BRIDGE-B'-3 evades.
- 4 sub-options each fit <100 LOC bridge target: Option (a') = 0 LOC bash
  (mcp_tool hook config), Option (a) = ~25 LOC bash (command hook + curl),
  Option (b) = ~15 LOC chokidar Node, Option (c) = ~10 LOC fswatch bash.

BUT: B' inherits all 3 of SW-A's ADOPT-blockers verbatim (PLAN.md disk coupling,
WebSocket-broadcast no-topic-filter, autoMode Reviewer vs reviewer-discipline.md
§2 conflict — DN-1=B-constrained applies). B' optimises only the dispatch
trigger; the load-bearing blockers persist. Comparison table vs A and B in §6.

§4 5-criteria: PASS-PASS-PARTIAL-PASS-INHERITED. Match ~35%. Atomicity
INCONCLUSIVE/MITIGABLE (chokidar awaitWriteFinish for Option b; empirical for
hooks).

Falsifier: B' upgrades to ADOPT VOCABULARY iff Sub-wave D greenlights A AND
DN-1=B-constrained adopted.

T-discipline applied per kickoff §6 SW-B2: T1 / T3 / T7 / T11 / T12 / T13 / T15
/ T16 / T17 / T19 (own cold-QA before push) / T20 + T-AIF-BRIDGE-B'-1..5.

Prior-art: SSOT #20 (CC hooks API, ADOPT) + SSOT #27/#28/#30/#43/#44/#46/#67/#80
(aif-handoff rows). Additive note to SSOT #44 proposed (no verdict change).
Proposed new SSOT row at next-available slot #85.
artyhoo added a commit that referenced this pull request May 29, 2026
… Implementer-equivalent only) value-add audit (#276)

R-phase patch for Sub-wave C of the aif-handoff-as-runtime-bridge umbrella.
Evaluates Variant C (kickoff §3 lines 124-145): aif-handoff as Implementer-
equivalent only, bypass Planner+Reviewer cycle, thin CLI wrapper for kickoff
dispatch + kanban status tracking.

Verdict: REJECT (BFR-default §1 ladder). Rationale:
- The kickoff-framed "aif-handoff exec --kickoff <path>" CLI does not exist
  in lee-to/aif-handoff (DeepWiki probes 1+5, 2026-05-29).
- No first-class Implementer-only mode; skipReview:true bypasses Reviewer but
  Planner is mandatory unless accept_existing_plan with on-disk PLAN.md
  (same disk coupling SW-A flagged for Variant A).
- BEFORE/AFTER maintainer-action count: 25% literal / 0% cognitive reduction
  (T-AIF-BRIDGE-C table §4) — below kickoff §8 STOP 30% threshold → verdict
  "Variant C value-add insufficient".
- Pure-tracker pattern (paused:true + autoMode:false + manual state-machine
  transitions) IS shipped but adds zero automation beyond UI tracking;
  Docker+SQLite infra unjustified.

Cites:
- SW-A merged PR #268 (Variant A REFERENCE, 28% match, 3 ADOPT-blockers)
- SW-B merged PR #267 (Variant B REJECT, ~5% match, no dir-watch capability)
- PR #269 follow-up (mechanical corrections, no verdict changes)
- DN-1=B-constrained input consumed in criterion 5 (mooted for Variant C
  which bypasses aif-handoff Reviewer entirely)
- Gate-4 admission re-sweep: PR #127+#128 touch packages/runtime/ only
  (no MCP/coordinator drift in 30-day window)

5 distinct DeepWiki probes + 2 WebSearches + cross-ref to SW-A/SW-B/PR #269
= 19+ evidence channels (T1 floor exceeded 3.8x). §1.7 forward+backward +
§self-application + T-trap walk per ai-laziness-traps.md §3.

Single output file under docs/meta-factory/research-patches/. No code, skill,
agent, install.sh, or .claude/rules/ modifications.

### §1.7 Forward-check applied

build-first-reuse-default.md §1 verdict ladder applied; BFR §3 6-layer search
performed (SSOT rows #27/#28/#29/#30/#43/#44/#46/#67/#80 reviewed at
prior-art-evaluations.md:95-148; DeepWiki >=5 probes; WebSearch >=2 phrasings;
own-stack sweep at .claude/skills/meta-orchestrator/SKILL.md:441 anti-scope +
:404+:429 SP requesting-code-review). no-paid-llm-in-ci.md §1 enforced (all
evidence via subscription-bundled DeepWiki/WebSearch + free gh CLI + bash).
reviewer-discipline.md §2 respected (DN-1=B-constrained consumed as fact, not
re-litigated; verdict is research finding against §8 STOP, not strategy
choice). ai-laziness-traps.md §3 active T-traps applied (T1, T3, T7, T11,
T12, T13, T15, T16, T17, T19, T20, T-AIF-BRIDGE-C MANDATORY BEFORE/AFTER
table at patch §4). Evidence: see patch §8 file:line citations.

### §1.7 Backward-check applied

SSOT #27/#28/#67 receive additive notes (additive-only; no verdict changes).
Original DEFER/DEFER/REJECT rationales reviewed at prior-art-evaluations.md:
95, 96, 135 — consistent with Sub-wave C findings (reinforce existing
classifications, do not re-litigate). No .claude/rules/* modified; no
.claude/skills/* modified; no agents/* modified; no packages/* modified;
no install.sh modified; no kickoff.md modified. Single output file in
docs/meta-factory/research-patches/. Scope strictly bounded to Variant C;
SW-A/SW-B/SW-B2/SW-D out of scope. T15 self-application confirmed in
patch §10. Memory not written (Sub-wave D synthesis is the natural
codification surface). Evidence: see patch §9 file:line citations.
artyhoo added a commit that referenced this pull request May 29, 2026
…verdict (DEFER-all-with-updated-triggers) (#281)

Cross-variant synthesis consolidating Sub-waves A/B/B'/C (merged PRs #267/#268/#275/#276). Per-variant verdicts re-derived independently per T15: A=REFERENCE (28%), B=REJECT (~5%), B'=REFERENCE conditional ADOPT VOCABULARY (~35%), C=REJECT (~22%). Cross-variant recommendation per kickoff §6.5: DEFER all variants with updated SSOT «Trigger to revisit» fields.

Includes 20-cell comparison table (4 variants × 5 criteria, file:line citation per cell), 4-row T16 problem-class match table, DN-1 (B-constrained) + DN-2 (B' is operative B-path) reflections, hook-discipline (Decision 10) analysis (no equipoise → recommend on clearly-better evidence; DECISION-NEEDED NOT warranted), consolidated SSOT additive notes for #27/#28/#30/#44/#67/#80, proposed new SSOT row #85 (next-after-#84 verified).

Prior-art: prior-art-evaluations.md#27, #28, #30, #44, #67, #80 (existing aif-handoff entries, additive-note-only — no verdict changes); SSOT row #85 PROPOSED, not landed.
artyhoo added a commit that referenced this pull request May 31, 2026
…brella done.md (#307)

Closes the companion-reuse-deep-dive umbrella tail (PRs #248-251 already merged):

- SSOT: 3 new append-only rows #88 (aif-handoff autoQueueMode LOGIC, ADOPT
  VOCABULARY + REFERENCE), #89 (omo session-plan-affinity, ADOPT VOCABULARY),
  #90 (Superpowers brainstorming scope-assessment, ADOPT VOCABULARY) — content
  copied from the merged R-phase patches; bare-ID column per principle-08 loader.
  #88 verdict-column normalized to clean `ADOPT VOCABULARY` with the faceted
  `+ REFERENCE` detail moved into the rationale column (principle-11 F2 convention,
  matches faceted rows #86/#87).
- SSOT #67: additive note appended to «Trigger to revisit» only; REJECT verdict
  for the full Kanban runtime unchanged.
- Resolved [next-available-slot] placeholders in the 3 source patches → #88/#89/#90.
  Devin (Sub-wave C) creates no row — its 2 descriptive placeholder mentions left as-is.
- done.md written per CLAUDE.md umbrella-closure schema (Final PR #251).

Verified: principle suite 153 pass / 4 skip; markdownlint clean.

Prior-art: skipped — doc-only edit (SSOT register rows + umbrella done.md + research-patch placeholder resolution); no new capability, dependency, or code.
artyhoo added a commit that referenced this pull request May 31, 2026
… task (Sub-wave A) (#323)

Closes the resolve half of the autonomous question-loop: questions.ts (#318) collects parked tasks; answer.ts pushes the human's answer back and resumes. Source-verified resume (vs lee-to/aif-handoff, design §3.1): request_changes (default) = POST /tasks/:id/comments {message} then POST /tasks/:id/events {request_changes} (done→implementing); approve = events {approve_done} (done→verified); retry = events {retry_from_blocked}. Status is EVENT-only; PUT {status} ignored. Verified 65/65 runtime-bridge tests; matches design §1.2. Live E2E deferred (no parked task yet). Authored by Sub-wave A worker.

Prior-art: BUILD (thin, project-specific). BFR §3 WebSearch 2026-06-01 surfaced no upstream tool that pulls an agent-runtime's parked review-questions into a chat + pushes answers + resumes (hits were resume-screeners, noise); native fetch, no new dependency; sibling of questions.ts #318 under design #315. Adjacent aif-handoff SSOT rows #67/#43/#88 cover aif's own primitives, not this wrapper CLI — no new row, matching the #318 sibling precedent.
artyhoo added a commit that referenced this pull request Jun 1, 2026
…eg (#343)

aif-handoff ends a task at "committed on a local feature branch" with NO push
and NO PR-creation in its autonomous (HANDOFF) path — verified 2026-06-01
against the running containers (zero PR-create / branch-push anywhere in its
autonomous flow; its commit/push lives only in an LLM-driven /aif-commit
runtime). So committed work strands inside aif's checkout, never reaching a
reviewable PR on the trunk. harvest is the missing return leg.

- src/harvest.ts: pure DI'd core harvestTask — guards (terminal status,
  branchName present) BEFORE any side-effect; ordered push then createPr then
  auto-merge, fail-fast (PR error never arms auto-merge).
- src/cli/harvest.ts: real wiring — docker-exec push from aif's container
  (holds the commit + working creds), host PR-create against staging, native
  auto-merge; graceful printed manual-fallback if docker absent.
- test/harvest.test.ts: paired-negative (non-terminal / no-branchName must NOT
  push or PR; PR-fail must NOT arm auto-merge).
- aifHttp.ts: expose branchName on AifTaskFull (read back by harvest).

Zero LLM by construction (plain git+gh+docker) — unlike aif's own commit flow
which spends a paid claude -p query just to run git. Complies with
no-paid-llm-in-ci.md.

Prior-art: prior-art-evaluations.md#27/#28/#30/#67 — aif-handoff's own runtime
(HANDOFF_MODE / paused / Planner-Implementer-Reviewer / Kanban) is the from-side
this leg bridges, NOT an egress tool: verified it has zero push/PR in its
autonomous path, which is exactly why harvest exists. No upstream
harvest-autonomous-agent-branch-to-PR analog; thin deterministic glue over
gh/git/docker, no PR-creation reimplemented. BFR verdict: BUILD (bridge egress leg).
artyhoo added a commit that referenced this pull request Jun 3, 2026
… (Stage 1) (#403)

Adds .claude/skills/dispatcher/SKILL.md (~195 LOC) wiring 4 existing CLI
primitives (dispatch.ts / harvest.ts / questions.ts / answer.ts) into a
dispatch→monitor→Q&A→harvest→Phase-1→stage-gate→advance loop. DN-A = dual
(CC-native primary + portable fallback via capability-check, not brand-name;
@dual-pair: dispatcher-skill). DN-B = Option A behavior: technical forks
resolved autonomously via superpowers:brainstorming on CC; strategic forks
surfaced to operator via questions.ts. Discrimination discipline baked into
prose (ask-question-reminder.sh is operator-internal, not shipped).

Prior-art: prior-art-evaluations.md#111 (BUILD — no upstream covers cross-boundary dispatch→monitor→Q&A→harvest→stage-gate loop; SSOT consult + DeepWiki ≥3 + WebSearch ≥3 in rphase §c; T16 verified vs #64/#67/#88).

§1.7: forward-check applied — BFR=BUILD via all 5 layers (SSOT consult + DeepWiki≥3 + WebSearch≥3, dispatcher-skill-rphase.md:223), dual not cc-only per dual-implementation-discipline.md:3, zero-paid-LLM per no-paid-llm-in-ci.md:1, T16 problem-class X-vs-Y at SKILL.md:189; backward-check sweep — complementary to pipeline/SKILL.md:313 (no supersession), consumes runtime-bridge primitives + park.ts #109, SSOT #111 appended at prior-art-evaluations.md:181.
artyhoo added a commit that referenced this pull request Jun 13, 2026
…+ runtime-bridge (134 commits) (#488)

* feat(hooks): SubagentStop REPORT-schema WARN (non-blocking, #108 candidate-3) (#339)

Ship .claude/hooks/warn-subagent-report.sh — scans the finishing subagent's
output for canonical REPORT sections (VERIFY, Confidence, ATTN); emits a
⚠ stderr warning + exit 0 (non-blocking) when any are missing.

Maintainer chose WARN over block (exit 2) — judgment target, not gateable
(#gate-where-judgment-needed, rule-enforcement-channel-selection.md §1).

Contract verified DUAL-CHANNEL 2026-06-01:
  Channel 1 — WebFetch code.claude.com/docs/en/hooks: SubagentStop fields
    include agent_type; exit 0 = non-blocking; stderr shown to user.
  Channel 2 — DeepWiki anthropics/claude-code: agent_transcript_path +
    last_assistant_message (since CC 2.1.47) confirmed by name + quoted.

Two read paths (B1 — scan-nothing trap avoidance):
  1. last_assistant_message if non-empty.
  2. agent_transcript_path JSONL, reusing end-of-turn-reminder.sh:30-41.
Noise guard: skip Explore agent_type + require standalone REPORT-cue label.

Paired test: 6 cases (positive-A/B + negative + negative-2 Explore +
non-report prose + exit-code invariant). All 6 green. Pre-existing staging
failures (pre-push.test.ts + plan-currency-check.test.ts) unaffected.

settings.json wiring snippet in PR body (maintainer lands, not committed).

Prior-art: prior-art-evaluations.md#108 (SubagentStop REPORT-schema gate — candidate-3 of #108, shipped as WARN per maintainer decision 2026-06-01; block dropped — judgment target, #gate-where-judgment-needed).

* docs(research-patches): satellite-feature-harvest — own-stack-first harvest + reverse-sweep (form B) (#328)

Own-stack-first sweep: Claude Code natively ships the remote/scheduled/parallel-session
cluster (Remote Control, Routines, Channels, agent-view, Slack) that prior SSOT rows
credited to companions. 15 capability clusters triaged → 4 adopt-now (Remote Control,
Routines via /schedule, Channels(Telegram), background agent-view) + 3 defer + 8 skip.
Reverse sweep: 4 criterion-zero relationships, no shipped artefact retired (T-SFH-D —
runtime-bridge questions.ts kept; Channels is session-open-only). +1 SSOT row #100.

Prior-art: skipped — research-patch only, no new capability (the BFR own-stack-first survey is the patch content itself).

* chore(hooks): wire pending CC hooks in settings.json (SubagentStart/Stop + runtime-bridge) (#340)

Activates three already-merged, already-committed hook scripts that were
running locally but never wired in the shared config:
- PostToolUse Write|Edit|MultiEdit -> runtime-bridge-dispatch.sh (#313)
- SubagentStart -> inject-subagent-digest.sh (#108 companion-adoption-iphase)
- SubagentStop -> warn-subagent-report.sh (#108 candidate-3, #339)

All hook scripts already exist in staging; this only activates them.
Config-only wiring, not a capability commit.

* docs(book): SubagentStop block-vs-warn — flip open-node DECISION-NEEDED → решён=WARN (#339) (#341)

#339 (SubagentStop REPORT-schema WARN, non-blocking) merged to staging as
0596a64 — the block-vs-warn decision is resolved in favour of WARN. Hook
remains INERT (no SubagentStop in settings.json) until the maintainer lands
the snippet, so the node stays half-open: decided, not yet wired.

- v1 (technical): chapter XXII + epilogue June-1 open-nodes list — cite #339
- v2/v3 (literary): keep allegory, no PR number — «нрав выбрали, в строй не поставили»

Prior-art: skipped — doc edit only, no new capability (book open-node status sync after #339 merge).

* refactor(hooks): remove end-of-turn factual-claim detector — net-negative sentry, dropped by evidence (#342)

The claim-scan (numeric / file:line / negative-existence → re-verify nudge) in
end-of-turn-reminder.sh measured recall ≈0.43 + precision ≈0.20-0.25 (cry-wolf)
in the instruction-compliance pilot (2026-05-21). A sentry that misses most real
claims and false-fires on ~75% of what it catches is the #discipline-theatre the
project hunts. Maintainer decision 2026-06-01: «не нужен раз не работает».

Same class + outcome as the recommendation-laziness narrow-B stop-scan dropped at
FP 84% (#210): drop on FP evidence, keep the always-on H1 reminder.

Surfaces:
- hook: remove claim-scan block + has_claims/claim_count refs in idle-guard,
  trigger, glance-line, Branch D, append block. Trigger = long_text||asked;
  branches A/B/C only. Recap + question-check survive. bash -n + shellcheck clean.
- tests/hooks/eot-claim-scan.test.sh: deleted (185 LOC, all claim-scan) + CI step.
- packages/core/hooks/end-of-turn-reminder.test.ts: drop Branch-D + code-fence
  precision cases, add paired-negative «short claim turn now silent». 13/13 green.
- research-patch documenting the evidence-based removal (scope annotation, §1.7).
- book epilogue ×3: the «искатель утверждений» debt closed by removal, not fix.

A short factual-report turn with no question now stays silent (was Branch D) —
the intended consequence; that nudge was the cry-wolf.

Prior-art: skipped — removal of an own-built net-negative mechanism, no new capability (cites instruction-compliance-empirical pilot + narrow-b-benchmark #210 precedent in the research-patch).

* feat(runtime-bridge): harvest — deterministic aif-task to PR egress leg (#343)

aif-handoff ends a task at "committed on a local feature branch" with NO push
and NO PR-creation in its autonomous (HANDOFF) path — verified 2026-06-01
against the running containers (zero PR-create / branch-push anywhere in its
autonomous flow; its commit/push lives only in an LLM-driven /aif-commit
runtime). So committed work strands inside aif's checkout, never reaching a
reviewable PR on the trunk. harvest is the missing return leg.

- src/harvest.ts: pure DI'd core harvestTask — guards (terminal status,
  branchName present) BEFORE any side-effect; ordered push then createPr then
  auto-merge, fail-fast (PR error never arms auto-merge).
- src/cli/harvest.ts: real wiring — docker-exec push from aif's container
  (holds the commit + working creds), host PR-create against staging, native
  auto-merge; graceful printed manual-fallback if docker absent.
- test/harvest.test.ts: paired-negative (non-terminal / no-branchName must NOT
  push or PR; PR-fail must NOT arm auto-merge).
- aifHttp.ts: expose branchName on AifTaskFull (read back by harvest).

Zero LLM by construction (plain git+gh+docker) — unlike aif's own commit flow
which spends a paid claude -p query just to run git. Complies with
no-paid-llm-in-ci.md.

Prior-art: prior-art-evaluations.md#27/#28/#30/#67 — aif-handoff's own runtime
(HANDOFF_MODE / paused / Planner-Implementer-Reviewer / Kanban) is the from-side
this leg bridges, NOT an egress tool: verified it has zero push/PR in its
autonomous path, which is exactly why harvest exists. No upstream
harvest-autonomous-agent-branch-to-PR analog; thin deterministic glue over
gh/git/docker, no PR-creation reimplemented. BFR verdict: BUILD (bridge egress leg).

* feat(meta-orch): run-helper.sh completion-barrier wrapper (TDD, stage 1) (#344)

Build .claude/skills/meta-orchestrator/helpers/run-helper.sh — a trivial bash
exec-wrapper that runs a target helper as a child and ALWAYS appends a terminal
END-trailer to stdout:

    === <helper-name>: END rc=<exit-code> (lines=<stdout-line-count>) ===

so a session reading a slow helper's stdout in the background can distinguish
"finished (rc=N)" from "still running / crashed". The trailer is appended by the
parent wrapper, so it fires even when the child exits non-zero or dies
mid-output (a child-side `echo END` would be skipped on `set -e` abort / SIGKILL
/ timeout). Fixes the orchestrator reading a header-only partial file as
"zero results".

HARD CONSTRAINTS satisfied (§2): exit-propagation (capture rc first, exit rc
last — trailer echo never clobbers child status); trailer-on-crash; stdout
verbatim pass-through; `=== `-prefix kept so classify-each-candidate.sh:52
`awk '... && !/^=== /'` strips it (never a spurious candidate).

TDD: paired-negative test at packages/core/skills/run-helper.test.ts (positive
clean-exit + negative exit-1 + SIGKILL crash-mid-output + parse-safety) — 4/4
green. No regression: `git stash -u` A/B shows the 5 neighbouring helper tests
produce an identical pre-existing 18-fail set (env-dependent gh/git harnesses)
with and without this file.

T-BGB-A: the END trailer proves the child FINISHED + its exit code, NOT
semantic content-completeness — kept in test names/comments.

Prior-art: prior-art-evaluations.md — escape hatch: trivial bash exec-wrapper, no upstream analog worth a dependency (BFR BUILD, pre-reasoned). Nearest SSOT neighbour #54 (Aider run_cmd runner) is a different problem-class — exit-code routing in a TS pre-push gate vs. appending a structural completion trailer for a background reader (T16: similar "runner" name, distinct capability).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* bg-helper-completion-barrier-stage2-aif (#345)

* feat(meta-orch): route bg-helper call-sites through run-helper.sh + Layer-1 read-rule (stage 2)

Wire the two background-helper !-fences in meta-orchestrator/SKILL.md
through the already-merged run-helper.sh completion-barrier wrapper:
- §2 Step 1 priority-score.sh
- §2.5 Step 2 dup-detect.sh + inflight-check.sh

Add the Layer-1 read-rule prose after both fences: parse a slow helper's
output only after its task-notification or the `=== <helper>: END rc=<n> ===`
trailer; a header-only read means "still running", not "zero results".
Origin: incident 2026-06-01 (priority-score.sh read at header-only state →
false "zero candidates").

Helper code untouched; the 5 helper tests show identical baseline (18 failed
/ 34 passed both with and without this edit — failures are environmental,
`gh` absent). Wrapped fences valid bash; classify-each-candidate.sh:52 still
strips the `=== `-prefixed trailer.

Prior-art: skipped — SKILL.md call-site wiring only, no new capability (routes existing helpers through the already-merged run-helper.sh wrapper from PR #344).

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

* fix(meta-orch): SKILL.md back to 600 lines — fold read-rule into §2 Step 1 (DRY)

aif's Stage 2 added two verbatim read-rule blockquotes (+4 lines), tipping
SKILL.md from 598 to 604 over the 600-line mechanical-check cap (real CI fail
on #345). Phase -1 reviewer fix: fold the read-rule once into the §2 Step 1
intro with 'applies to every background-helper fence below', drop the §2.5
duplicate. Both run-helper.sh wraps intact; read-rule discipline preserved, now
DRY. Not a capability commit (markdown edit).

Prior-art: skipped — markdown CI-fix (line-cap trim + DRY), no new capability.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(closure): bg-helper-completion-barrier done.md (final PR #345) (#347)

Last-stage merge marker per CLAUDE.md umbrella-closure convention — priority-score.sh
Layer C3 reads this for DONE detection.

Prior-art: skipped — closure marker file, no new capability (convention bookkeeping).

* feat(coordination): symlink-to-canonical cross-worktree sync (SSOT #110) (#346)

Build scripts/link-coordination.sh (per-file symlinks, adopt-then-link,
conflict-loud, seed on empty CANON), wire it into both worktree helpers
replacing the J5 rsync block, add link-coordination.test.ts (7 tests:
symlink, git-clean, conflict, write-back, paired-negative, adopt, seed),
reconcile worktree-setup-hydration.test.ts (drop rsync NON-DESTRUCTIVE,
retarget paired-negative regex to link-coordination.sh call, assert
symlinks), append SSOT row #110.

Umbrella count confirmed: 124 (kickoff said 123 — stale).

Prior-art: prior-art-evaluations.md#110 (cross-worktree gitignored-SSOT sync via symlink-to-canonical, verdict ADAPT) + research-patch 2026-05-17-cross-worktree-coord-doc-sync.md §5 — I-phase implementation of the settled verdict.

* docs(runtime-bridge): per-command CLI reference README (Option B) (#348)

Operator-facing reference manual for the six runtime-bridge CLI commands
(answer, await, dispatch, harvest, park, questions), one section each with
Usage / Flags / Example, derived from each cli/<cmd>.ts header docblock.
Resolves the parked README-structure fork → Option B (per-command reference).
Markdown only, 285 lines (< 600-line cap), no code changes.

Prior-art: skipped — documentation only, no new capability (operator-facing CLI reference derived from existing docblocks)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(discipline): surface genuine forks via AskUserQuestion (autonomous-default, human-gate on ambiguous only) (#349)

Operating model (maintainer decision 2026-06-01): autonomous by default;
the human-gate fires ONLY on a genuine ambiguous fork. A clear call is
decided and reported, not routed through a question.

- recommendation-laziness-discipline.md §3: fork-surfacing companion to the
  evidence rule — ambiguous forks MUST be surfaced via AskUserQuestion, never
  decided by a silent direct action; ask-question-reminder.sh is the
  discriminator; reworded 'default=surface' -> 'autonomous-default, surface
  only genuine forks'.
- recommendation-laziness-discipline.md §5: new anti-pattern
  #fork-decided-by-silent-action (incident: PR #348 battle-test, an
  explicitly-50/50 README fork auto-decided by running answer.ts directly).
  Judgment rule -> injection-only enforcement, never a gate (#gate-where-judgment-needed).
- end-of-turn-reminder.sh Branch-A: backstop reminder for the
  'decided a fork silently' path (the inverse of the existing offload check).

Hook tests 20/20 green. Origin: 2026-06-01 question-loop battle-test dialogue.

§1.7: forward — complies with rule-enforcement-channel-selection (judgment->injection),
no-paid-llm-in-ci (deterministic .sh + prose), doc-authority (no new heading); backward —
new anti-pattern scope = any-session fork behaviour, no existing rule superseded
(reviewer-discipline §2 is reviewer-scoped), enforced by two already-shipped hooks.

* feat(hook): orchestration-mode aware reminders + brainstorm cue (qloop items 2+6) (#350)

* docs(spec): hook-nudge orchestration-mode design (brainstorm item 2+6)

Design for orchestration-mode-aware behaviour of the two reminder hooks:
marker-gated Bug A fix (drop low-precision fork-regex in-mode) + recap
threshold lowering (b) + brainstorm nudge in ask-question-reminder.sh.
Normal mode stays byte-for-byte. Origin: 2026-06-01 qloop battle-test brainstorm.

Prior-art: skipped — design doc only, no new capability (markdown spec under docs/superpowers/specs/, no dependency/code-module).

* docs(plan): hook-nudge orchestration-mode implementation plan (item 2+6, TDD)

Prior-art: skipped — planning doc only, no new capability.

* docs(spec): add §3.4 aif-pull-channel brainstorm nudge (formatHuman footer)

Recursive-self-application gap from maintainer dialogue: ALL aif-parked
questions (not just I-ask-via-AUQ) must get the brainstorm-first nudge.
Footer ships in item 4's questions.ts PR (file-locality).

Prior-art: skipped — design doc only, no new capability.

* feat(hook): orchestration-mode gating — drop fork-regex (Bug A) + lower recap threshold (recap-b)

Marker .claude/orchestration-mode (mtime TTL); normal mode byte-for-byte.
Bug A: decision-MENTIONS stop false-firing the fork-challenge in-mode (regex
gated on orch_mode=false); real Qs (?/AUQ) still caught. recap-b: recap fires
on short structured status in-mode (threshold 500->200) keeping the markdown
gate so chatter stays silent. 7 new tests + 13 pre-existing green (20/20).
Spec: docs/superpowers/specs/2026-06-01-hook-nudge-orchestration-mode-design.md.

Prior-art: skipped — internal CC hook tuning, no new capability or dependency.

* feat(hook): brainstorm cue in ask-question-reminder (item 6)

Design/strategy forks -> superpowers:brainstorming, not a bare AUQ card.
Always-on prose nudge (judgment -> injection, never a gate). 1 new test (8/8).

Prior-art: skipped — internal CC hook tuning, no new capability or dependency.

* fix(runtime-bridge): surface mid-flight park in questions.ts + brainstorm footer (qloop item 4) (#351)

isParked gains the mid-flight-park case: a task whose blockedReason was wiped
by implementing→review still surfaces via the durable conjunction
(paused===true AND the plan carries the OPEN_QUESTION_ANCHOR). New shared
constant openQuestion.ts is the single SSOT for that anchor (writer park.ts,
reader questions.ts) so the wording cannot drift (dual-implementation-discipline
#two-prompts-drift).

formatHuman appends the §3.4 brainstorm-first footer on a non-empty parked list
(aif-pull-channel companion to ask-question-reminder.sh §3.3); empty case
unchanged. Reproduced from the verified container fix (branch
feature/qloop-realfix-d7585d), host-side, per handoff item 4.

Design SSOT: docs/superpowers/specs/2026-06-01-hook-nudge-orchestration-mode-design.md (§3.4).

Prior-art: skipped — bug fix on existing CLI + 17-LOC shared constant, no new capability/dependency.

* feat(runtime-bridge): commit aif rework leg in harvest (qloop item 3) (#352)

aif commits only on its approve_done && commitOnApprove path; the
request_changes→implementing→done rework path leaves the work uncommitted
(dirty tree, branch == base HEAD), so harvest had nothing to push. Extend the
egress: hasUncommittedChanges → commitAll (templated message, ZERO LLM) before
push. No-op on the normal path (tree already clean). Commit failure is fail-fast
— nothing pushed, operator gets the printed fallback. Real dep guards that the
container checkout is on the task branch before committing.

aif-handoff source untouched (foreign runtime, SSOT #27) — fix lives entirely
on our egress leg, matching harvest's graceful-degradation design.

Prior-art: skipped — extends existing harvest CLI, deterministic git only, no new capability/dependency.

* fix(principles): isolate p13 fixtures to tmpdir (kills p10↔p13 race) + exempt qloop-ux-probe probe (p12) (#353)

Two local pre-push false-blocks found by qloop-ux-probe (neither is a real violation):

F1 — principle 13 wrote its synthetic + c3-decoration fixtures into the REAL
docs/meta-factory/research-patches/ dir, then unlinked them. Under vitest's parallel
file run, principle 10's readdirSync globbed the transient file and ENOENT'd when 13
deleted it → a cross-file race (10 alone = 5/5 pass; full run = flaky ENOENT). Fix:
write the fixtures to os.tmpdir() — checkSection reads content only, PATCHES_DIR
membership was never required. Verified race-free across 3 consecutive full-trio runs.

F2 — principle 12 flagged the gitignored qloop-ux-probe kickoff (a 2-question resume
*test fixture*, not a work-delegating orchestration kickoff) for no AI-traps citation,
failing every local push. It already skips in CI (KICKOFFS_AVAILABLE false). Added to
EXEMPT_LIST with documented rationale.

Full principle suite: 157/157.

* fix(runtime-bridge): park.ts resolves API_BASE_URL so agent can park from inside aif container (#354)

park.ts is the only CLI run from inside the aif agent container, which exposes the
service as API_BASE_URL=http://api:3009 and does NOT set RUNTIME_BRIDGE_AIF_URL.
The old localhost-only default was unreachable there (connection refused) -> park()
got 'fetch failed' -> the agent could not park itself, so park-don't-guess (SSOT #109,
meta-orchestrator §4c) was non-functional on the real autonomous path.

New precedence: RUNTIME_BRIDGE_AIF_URL ?? API_BASE_URL ?? http://localhost:3009.
Host orchestrator (sets neither) still gets localhost; container gets api:3009.

Found by qloop-ux-probe Часть 2 live dispatch (taskId 5e32fcb9): agent correctly
surfaced-not-hacked the park failure, but the task slid implement->review->done at
$3.17 having parked nothing. resolveAifBaseUrl() extracted + unit-tested incl. a
negative guard proven to go red on regression.

* fix(runtime-bridge): don't record dedup on ManualBackend fallback + add --force (Finding B) (#355)

dispatch.ts recorded a dedup entry unconditionally after Step 4 — even when the real
backend threw (e.g. dirty_worktree 409) and it fell back to ManualBackend. That manual
entry (which created no autonomous task) then blocked a legitimate real retry for the
full 24h TTL, with no escape. qloop-ux-probe hit exactly this: after fixing the dirty
worktree, the re-dispatch was refused as "already dispatched (backend=manual)".

Fix:
- shouldRecordDedup(backendName): record only for a real backend success, never 'manual'.
- --force: skip the dedup check to re-dispatch the same kickoff deliberately.
- kickoff path resolved as the first non-flag arg, so --force may sit anywhere.

Three pure helpers, unit-tested incl. a negative guard. Full runtime-bridge suite 102 pass.

* fix(runtime-bridge): questions.ts recovers mid-flight-park question from plan anchor (Finding E) (#356)

A mid-flight park (paused:true + OPEN_QUESTION_ANCHOR in plan, blockedReason wiped by
implementing→review) surfaced in the list — but parkedReason() rendered "(no reason
recorded)" because it only read blockedReason + reviewComments, never the question text
park.ts appended under the plan anchor. So the chat channel showed "there is a question"
with no idea WHAT it asks (qloop-ux-probe Finding E, task ccebe39a).

Fix: extractOpenQuestion(plan) pulls the text after the last OPEN_QUESTION_ANCHOR line;
parkedReason precedence is now blockedReason → plan OPEN QUESTION → reviewComments →
"(no reason recorded)". Unit-tested incl. multi-anchor (last wins) + a negative guard.
Full runtime-bridge suite 100 pass.

* fix(runtime-bridge): park.ts probes reachable base URL — agent env scrubs API_BASE_URL (Finding C-2) (#357)

Finding C (#354) made park.ts READ API_BASE_URL, but the qloop-ux-probe live re-run proved
that insufficient: the aif agent runs park.ts in a Bash-tool subprocess whose env is
SCRUBBED of API_BASE_URL (the container's PID-1 env has it; the agent's exec env does not).
So resolveAifBaseUrl() still fell back to localhost:3009 → unreachable inside the container
→ "fetch failed" → the task slid to done at $3.45 without parking, exactly as before.

Fix: resolveReachableBaseUrl() probes candidate URLs and uses the first reachable one —
[RUNTIME_BRIDGE_AIF_URL?, API_BASE_URL?, http://api:3009 (docker service), http://localhost:3009
(host)], de-duplicated. Works from BOTH the agent container (api:3009) and the host
orchestrator (localhost) even when no env survives. main() now awaits the probe.

candidateBaseUrls + resolveReachableBaseUrl unit-tested (injected fetch) incl. a negative
guard proving it skips an unreachable first candidate. Full runtime-bridge suite 117 pass.

* feat(runtime-bridge): bridge-health.sh ($0 container-side preflight) + bridge-cleanup.sh (junk sweep) (#358)

Operator pain: "каждую сессию приходится чинить" + "мусор постоянно остаётся". Both are
structural — the recurring bugs live on the host↔container↔aif boundary that unit/CI
can't cover (a full agent run costs LLM tokens, no-paid-llm-in-ci), so they were only
found live MID-TASK; and probe/smoke runs leave orphan tasks + /tmp files behind.

bridge-health.sh — $0 deterministic CONTAINER-side preflight (docker+curl+grep, no task,
no tokens). Each check maps to a real qloop-ux-probe finding: container checkout clean
(A), park.ts carries the resolveReachableBaseUrl probe (C-2), a park candidate URL is
reachable from inside the container (C/C-2), dedup store has no stale manual entries (B).
Run at session start → "bridge red, fix first" instead of discovering breakage live.
Complements verify-bridge.sh (host-side dispatch smoke). Live-dogfooded — caught + fixed
a false-positive in its own reachability check (000 connection-fail vs real HTTP status).

bridge-cleanup.sh — one-command sweep of test/probe junk: aif tasks matching a test-title
allowlist (UXPROBE/smoke/probe — real work never matched), old /tmp ManualBackend kickoffs
+ dedup backups. Reports a container stash, never drops it (operator's git). --dry-run.

Prior-art: extends own verify-bridge.sh operator-smoke pattern (packages/runtime-bridge/scripts) — no external prior art applies; project-specific aif-bridge container diagnostic + test-task sweep, not a general capability with an upstream analog.

* fix(runtime-bridge): self-cleaning junk producers — junk no longer accumulates (no manual/AI sweep) (#359)

Operator: "придумать как быть с мусором — его не должен чистить каждый раз ИИ". A manual
cleanup script is still "someone cleans each time". The real fix is that each producer
cleans up after itself, automatically, with zero AI/manual involvement.

idempotency.ts — recordDispatch was append-only (file grew forever; a stale manual-fallback
entry blocked retries for the full TTL). Now it PRUNES-ON-WRITE: rewrites the log keeping
only within-TTL entries + the new one. Self-bounding, and stale entries (incl. Finding B's
manual fallback) auto-expire by age — no --force needed after TTL, no sweep.

ManualBackend.ts — dispatch wrote /tmp/runtime-bridge-<id>.md on every fallback and never
cleaned them (days of accumulation). Now each dispatch first prunes its OWN stale artefacts
(runtime-bridge-*.md older than 7d). Scope-guarded: only matches our files, only when stale,
best-effort (never throws into the dispatch path).

Pure cores (pruneStaleEntries / parseEntries / isStaleArtifact) unit-tested incl. negative
guards (stale entry must not survive; unrelated old .md must not be pruned). Full suite 126 pass.

This complements (does not replace) bridge-health.sh; bridge-cleanup.sh stays as a rare
manual "nuke everything" escape hatch, not the routine mechanism.

* fix(runtime-bridge): park.ts refuses to park at status=review (Finding F guard) (#361)

A park that happens AFTER the implement→review transition left the task
status=review, paused=true. On resume, aif runs the review pipeline straight to
`done` WITHOUT re-implementing the injected answer — and the next chain question
is never parked (live: task ba3b4bf6 answered c1 → done, c2 silently lost).
Root cause is upstream-intentional: aif's HUMAN_ACTIONS_BY_STATUS.review = []
(stateMachine.ts) — there is no human re-entry from `review` into implement.

Option B (per 2026-06-01-aif-task-isolation.md §4, maintainer-selected): a cheap
our-side guard. parkTask already GETs the task, so the status is in hand — refuse
the park at status=review and throw a clear message (park before review, or wait
for done and use answer.ts request_changes). Turns the silent loss into a loud,
actionable error. Does NOT add mid-flight re-implement (Option C, deferred).

Paired-negative test: GUARD refuses + issues NO PUT at status=review; CONTROL still
parks normally at a pre-review status (plan_ready). 19→21 tests green.

Prior-art: skipped — bug-fix guard on existing park capability, no new dependency or capability commit.

* docs: R-phase research-patch — aif task-isolation (Findings A + F) (#360)

* docs(runtime-bridge): R-phase research-patch — aif task-isolation Findings A + F

Finding A (dirty_worktree recurs): verdict config-fix. Per-task worktrees are gated by
a 3-condition AND in planner.ts:191-195 — env AIF_TASK_WORKTREES_ENABLED=true is only
gate 1; gate 2 project.parallelEnabled (DB parallel_enabled, web-UI toggle) is 0 and was
never set, so worktrees are never created and the shared checkout is reused in-place →
dirties → next dispatch 409s. Fix: flip parallel_enabled (no restart).

Finding F (mid-flight park resumes review->done, never re-implements): verdict
aif-upstream-issue (intentional design) + our-side-guard. stateMachine.ts:106
HUMAN_ACTIONS_BY_STATUS.review=[] -> no human re-entry into implement; request_changes
only from done. DECISION-NEEDED for I-phase: Option B (park.ts guard rejecting parks at
status=review) vs Option C (auto request_changes loop, ~4h).

R-phase only — no production code changed. Evidence: parallel_enabled=0 (live DB query),
worktree_path null across 10 tasks, reflog >=6 in-place checkout cycles, planner 3-gate +
stateMachine review:[] source-verified. Scope annotation (principle 10) + §1.7 (principle 13).

* docs(runtime-bridge): record Finding F resolution — Option B selected + shipped (#361)

§4.1 + §7.3: DECISION-NEEDED-F resolved 2026-06-01. Maintainer selected the
hard-guard path (surfaced as "Option B"). Records the exact shipped behavior
honestly: park rejects only at status=review (the §4.1 Option-A semantics, NOT
the stricter implementing-only Option B) — pre-implement parks (plan_ready) stay
legitimate. Cross-refs PR #361. Option C deferred.

* feat(runtime-bridge): ensure-parallel guard — self-heal Finding A on any instance (#362)

aif creates a per-task git worktree only when project.parallelEnabled=1 (gate 2
of 3 in planner.ts). That flag is a DB field with NO env/config.yaml knob — only
the web UI or raw DB sets it — so a freshly-provisioned instance has it 0, every
task runs in-place on the shared checkout, and the next dispatch 409s on
dirty_worktree (research-patch 2026-06-01-aif-task-isolation.md §1-§2; the live
config-fix applied to this instance does not propagate to other instances).

ensureParallelEnabled(baseUrl, projectId): GET /projects → if parallelEnabled is
already true, no-op; else PUT /projects/:id with parallelEnabled=true. Wired
best-effort into AifHandoffBackend.dispatch() Step 0 (warns + proceeds on failure,
never blocks dispatch) and shipped as a standalone CLI (--project / env).

Anti-clobber (load-bearing): aif has no targeted parallelEnabled write (only
PATCH /:id/auto-queue-mode), and the full PUT NULLs any omitted *MaxBudgetUsd
(@aif/data updateProject: `x ?? null`). So the guard round-trips the FULL field
set read back from GET — flipping ONLY parallelEnabled — to preserve a UI-set
budget. Paired-negative test pins this: a set budget MUST survive the PUT.

Cleaner long-term fix = an upstream PATCH /projects/:id/parallel-enabled mirroring
the existing auto-queue-mode PATCH (file against lee-to/aif-handoff); this guard
is the our-side stopgap. 6 new tests green; runtime-bridge typecheck clean.

Prior-art: prior-art-evaluations.md#109 (park.ts BUILD — same class: thin our-side runtime-bridge consumer CLI over aif REST where no upstream targeted primitive exists; here parallelEnabled-reconcile, no upstream PATCH beyond auto-queue-mode; cleaner fix REFERENCEd to upstream, this is the stopgap).

* coordination-persistence-fix (#363)

* feat(coordination): link-coordination.sh --on-conflict=canon|worktree|skip (default skip)

Adds --on-conflict flag with three modes resolving the real-file-in-both
conflict deterministically: skip (default, exit 1, never clobber), canon
(canonical wins, relink), worktree (worktree wins, adopt into CANON).
Invalid values exit 2. TDD: 4 tests in link-coordination.test.ts.

Prior-art: skipped — extends existing scripts/link-coordination.sh (SSOT #110), no new capability/dependency; arg-parse + branch logic only, no new file/dep.

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

* feat(coordination): link-coordination.sh shares root _plan-cache.md + _master-backlog-delta.json (Part-2, SSOT #110)

Adds a ROOT-FILE adopt-then-link + link pair so the two root-level
gitignored coordination files (_plan-cache.md, _master-backlog-delta.json)
are shared across worktrees — previously unmatched because the loops only
iterated umbrella subdirs */. Tracked root README.md untouched.
TDD: 3 tests in link-coordination.test.ts.

Prior-art: skipped — extends existing scripts/link-coordination.sh (SSOT #110), no new capability/dependency; mirrors existing umbrella adopt/link loops for root files.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(hooks): i18n reminder payload — en canonical / ru operator (+ principle-12 exempt hygiene) (#364)

* feat(hooks): i18n — split reminder payload into lang packs (en canonical / ru operator)

The two reminder hooks (ask-question-reminder, end-of-turn-reminder) emitted
Russian payload prose inline. Splits logic from payload: hooks keep all logic
and source a language pack (.claude/hooks/lang/{en,ru}.sh) selected by
AIF_HOOK_LANG (default en — canonical, for the public repo). Operator sets
AIF_HOOK_LANG=ru once globally in ~/.claude/settings.json.

- lang/en.sh + lang/ru.sh: aif_msg_* functions (${anchor} resolved at call time
  via dynamic scope) + AIF_RECAP_MARKER (recap heading; guard and message read
  the same var so they stay language-consistent).
- lang/check-parity.sh: deterministic, no-LLM guard against #two-prompts-drift —
  asserts both packs expose the same key set. Local/reviewer step, not a blocking
  gate (hooks are @cc-only, not shipped).
- Tests run the existing cases under AIF_HOOK_LANG=ru (RU-pack contract; Russian
  transcripts + assertions unchanged) + add an en-pack smoke per hook.
- RU payload byte-identical to before; EN is a faithful translation. Behaviour
  preserved (30/30 hook tests green).

Out of scope (surfaced): Russian code comments in the two hooks; other 11 hooks;
questions.ts strings. Spec: docs/superpowers/specs/2026-06-01-hook-lang-i18n-design.md

Prior-art: skipped — i18n refactor of existing internal hooks, no new capability (string externalization to lang packs, no dependency, no packages/ code module)

* test(principle-12): drop stale 'qloop-ux-probe' from EXEMPT_LIST

The qloop-ux-probe question-loop fixture dir (gitignored, added to EXEMPT_LIST
2026-06-01 by Finding F2) is gone — the positive-guard test correctly flagged it
as a stale exempt entry ("exempted but now absent"). Remove it per the test's own
instruction; 'aif-ssot-corrections' remains the sole exempt entry.

Surfaced while unblocking the hook-i18n PR's local pre-push (principle 12 runs on
gitignored kickoffs locally, skips in CI). Maintainer-invited in-session.

Prior-art: skipped — principle-test allowlist hygiene, no new capability (one stale entry removed from EXEMPT_LIST + doc comment)

* fix(runtime-bridge): bridge-cleanup §4 prunes MERGED container git junk (#365)

Enabling per-task worktrees (parallel_enabled, #362) makes aif RETAIN worktrees
post-terminal (research-patch 2026-06-01-aif-task-isolation.md §2.1), and the old
in-place task checkouts had already left 14 stale feature/* branches on the shared
checkout. The session janitor (#358/#359) deliberately did NOT touch container git.

§4 extends it to prune ONLY container git merged into origin/staging: git worktree
prune + remove retained non-main worktrees on merged branches + delete merged
feature/* branches. SAFE BY CONSTRUCTION — `git branch --merged` filtering AND
`git branch -d` (refuses unmerged) double-guard; unmerged in-flight work is never
touched. Also fixes the docker-exec stdin bug (needs -i for `sh -s` heredoc).

Completes the #359 "no manual/AI sweep" principle for container git state. This is
operator/co-located tooling (docker exec); the portable fix is upstream auto-removal
of retained worktrees (worth filing against lee-to/aif-handoff).

Live-verified on the real container: dry-run + real run deleted 7 merged branches
and preserved all 6 unmerged (+ the checked-out one). No unit test — matches the 4
untested sibling janitor scripts; safety is by-construction + live paired-evidence.

Prior-art: skipped — extends an existing janitor script (no new dependency, no new >=80 LOC file, not a capability commit); the parallel-worktree capability it cleans up after is #362/#109.

* feat(audit-self): bash-hook mutation testing — bash.rules + run-bash-mutation.sh (universalmutator ADAPT, local/on-demand) (#366)

Stage 2 B.2 of mutation-discipline-umbrella. ADAPTs universalmutator (MIT,
deterministic regexp engine + analyze_mutants harness — no LLM) to
mutation-test .claude/hooks/*.sh against their paired-negative vitest
tests. The only project-authored artefacts are bash.rules (operators), a
thin wrapper, and the wrapper's own paired-negative test. Delivery =
session-bound / local on-demand (NOT CI), mirroring Stryker-as-devDep;
the original kickoff B.3 CI job is dropped. universalmutator is a dev-time
tool, never consumer-shipped.

Dogfood gate (mandatory) surfaced real, undocumented test gaps:
end-of-turn-reminder 52% / validate-prompt 56% (both below the 60% floor)
— the &&/|| mutation of their suppress/skip conditions survives uncaught.
Recursive bootstrap: the wrapper mutated by its own operators is killed
13/13 by its own test. Found + fixed a /*-in-comment regexp-engine
limitation (bash globs in comments falsely trigger C-block-comment mode)
via a line-count-preserving sanitiser.

Evidence: docs/meta-factory/research-patches/2026-06-02-bash-mutator-b2-shipped.md

Prior-art: prior-art-evaluations.md#91 (universalmutator ADAPT — engine ADOPTed verbatim, only bash.rules operators authored; problem-class ~85% match per B.1 §B.1.5; mutahunter REJECTed on no-paid-llm-in-ci §1).

* feat(coordination): persistence-fix tail — SW-B symlink-aware helpers + G/B/C installer (#368)

* docs(coordination): design — cross-worktree persistence fix (4-channel: git-hook agnostic floor + CC + Superset + skill)

Brainstorm output for coordination-persistence-fix umbrella. T16 corrections:
- channel C substrate = Superset projects/<uuid>/config.json setup-array (rsync = root cause), NOT ~/.superset/hooks/
- adds git post-checkout (.husky) as the harness-agnostic floor per maintainer 'works everywhere' requirement
- Q3 atomicity already satisfied (mktemp+mv verified); SSOT #110 same anchor

Prior-art: skipped — design doc only, no new capability (extends link-coordination.sh SSOT #110).

* docs(coordination): correct §2.4 — helpers atomic but NOT symlink-preserving (mv replaces symlink)

Planning-phase finding (verified empirically): mv tmp <symlink> replaces the
symlink with a real file → Part-2 cross-worktree share lost on first cache write.
SW-B upgraded from 'confirm test' to 'make 3 helpers symlink-aware (write-through
resolved target)'. Atomicity preserved (temp+mv in target dir), symlink preserved.

Prior-art: skipped — design doc correction only, no new capability.

* docs(coordination): implementation plan — 4 sub-waves (A linker / B symlink-aware helpers / C wiring / D self-apply)

Prior-art: skipped — plan doc only, no new capability (implements SSOT #110 extension).

* feat(coordination): one-click install-coordination-wiring.sh (G+B+C, idempotent, self-test)

Applies all 3 wiring channels in one terminal command (maintainer runs from central repo):
  G  .husky/post-checkout            (agnostic floor)
  B  .claude/settings.json SessionStart
  C  ~/.superset/projects/*/config.json setup (replaces rsync root-cause)
--self-test (sandbox) + --dry-run modes; idempotent re-runs. Replaces the manual runbook.

Prior-art: skipped — scripts/ helper, not a capability commit (no dep, not under packages/); wires existing link-coordination.sh SSOT #110.

* fix(coordination): 3 cache/delta helpers symlink-aware (SW-B)

resolve_target() follows a symlink to its real $CANON target so the atomic
temp-then-mv write writes THROUGH the link instead of replacing it. Without this,
the first cache/delta write breaks the cross-worktree share (mv tmp <symlink> →
real file). +3 paired-negative tests (symlink preserved + canon written through);
18/18 green. Done locally (not via aif — container serialized on doc-audit task).

Prior-art: skipped — symlink-preservation fix to existing helpers, no new capability; extends link-coordination.sh SSOT #110 share semantics.

* docs(coordination): drop channel A (skill self-heal) — redundant after G git-hook

B (CC SessionStart) fires at every session start ⊇ 'when meta-orchestrator runs',
and G (git post-checkout) is the real agnostic floor A was standing in for.
Final channel set = G + B + C, wired via install-coordination-wiring.sh.

Prior-art: skipped — design doc scope-reduction, no new capability.

* fix(runtime-bridge): bridge-cleanup §4 skips while aif has live tasks (no ref-lock contention) (#367)

§4 (container git prune, #365) runs git fetch / worktree prune / branch -d in the
SHARED .git. A task running concurrently touches the same ref + packed-refs locks
(amplified by parallel_enabled keeping multiple tasks active) → a collision yields
"cannot lock ref" and can fail the live task's git step.

Guard: GET /tasks, count non-terminal (not done/verified/cancelled); if >0, skip §4
with a clear note ("re-run when idle"). Deterministic, no AI. Fail-open (count unknown
→ 0 → proceed) — §4 is already merged-only safe-by-construction, so this is defence-in-
depth; worst case of a false 0 is a transient lock retry, never corruption or data loss.

Live-verified: with 2 non-terminal tasks running, `--dry-run` §4 printed "skipped — 2 live".

Prior-art: skipped — edits an existing janitor script (no new dependency, no new file, not a capability commit); guards the #365 sweep against the #362 parallel_enabled concurrency window.

* feat(coordination): commit channels G + B (post-checkout + CC SessionStart) (#369)

Makes the two machine-agnostic wiring channels durable + shared (were applied
locally by install-coordination-wiring.sh). Both call link-coordination.sh (SSOT #110):
  G  .husky/post-checkout       — agnostic floor, fires on git worktree add
  B  .claude/settings.json      — CC SessionStart re-heal
Channel C (Superset setup-array, per-UUID) stays installer-only. SW-D liveness:
G verified live — fresh worktree auto-linked 287 files.

Prior-art: skipped — wiring of existing link-coordination.sh SSOT #110 into hook channels, no new capability.

* docs(research-patches): doc-audit-ship-boundary Stage 2 findings + gitignore stryker sandbox (#371)

Autonomous aif audit (task bcb2c6c2): full doc-vs-reality + vs-goal reconciliation,
Stage 2.0 mutation-run fuel, DECISION-NEEDED batch (DN-1..4), §A self-classification.
Audit-only — no maintainer-owned edits landed. Also gitignore packages/core/.stryker-tmp/
so mutation runs never pollute the tree (root cause of PR #370 contamination).

* test(hooks): close mutation gaps in end-of-turn-reminder + validate-prompt (B.2 dogfood follow-up) (#373)

The Stage 2 B.2 bash mutator (#366) surfaced two hook tests below the 60% kill
floor: end-of-turn-reminder (52%) and validate-prompt (56%). Add targeted cases
that kill every NON-equivalent surviving mutant:

- end-of-turn-reminder 52% → 69%: cover the previously-untested idle-suppress
  re-ping guard (hook:135-156) — suppress-on-reping, fire-on-new-question,
  long-answer-overrides-suppress, the B2 "an AskUserQuestion turn is never
  idle-suppressed" contract — and the bare non-question tool-call early exit
  (hook:53-54). The 10 residual survivors are equivalent mutants: 7× `|| true`
  → `&& true` inside `$(…)` command-substitutions (stdout unchanged, exit
  ignored under set -uo, no -e), the transcript-validity guard (both paths exit
  0/empty for the only diverging input), `set -e`→`set +e` (hook never relies on
  errexit aborting), and the inner re-ping AND→OR (divergence requires
  prev==last+recap, which trips the self-recap guard first). All 22 killable
  mutants are killed.
- validate-prompt 56% → 78%: deterministically exercise the tsx-unavailable
  graceful-skip (hook:26-27, isolated-root copy) and the jq-unavailable
  graceful-skip (hook:14-16, fake-bin PATH without jq). The 2 residual survivors
  are gh+validator-coupled (hook:21 off-path-proceeds-to-validator, hook:33
  validator-result) — killable only with a live-gh 404 test, which is
  non-hermetic; left per T-MUT-B rather than shipping a flaky test.

Test-only; no production hook modified. Follow-up to #366
(mutation-discipline-umbrella Stage 2 B.2).

* docs(doc-audit): apply DN-1/2/4 doc-staleness fixes + ship the fixer tooling (#374)

doc-audit-ship-boundary Stage 2 — maintainer decisions 2026-06-02, applied.

Applied (maintainer-directed, DN-1/2/4):
- .claude/rules/rule-enforcement-channel-selection.md: 'Activation pending' →
  'Activation confirmed — settings.json:114' (Class header + §4 prose); the
  PostToolUse Edit|Write hook is wired (verified settings.json:114).
- README.md badges: ?branch=main → ?branch=staging (main=prod, CI runs on staging).
- README.md enforcement chain: drop false 'Stryker' from the CI channel —
  mutation tests are local/session-bound, NOT a CI gate (no workflow runs Stryker).

Tooling shipped alongside:
- scripts/apply-doc-fixes.sh: idempotent, terminal-runnable fixer (re-applies the
  above; --check dry-run). packages/core/hooks/apply-doc-fixes.test.ts: 5 green.
- docs/meta-factory/mutation-run-placement.md: DN-4 placement note (mutation local;
  ps/jq/universalmutator reqs).

Prior-art: skipped — maintainer-directed doc-staleness fixes + their fixer tool +
a placement note; no new runtime capability, no dependency, no packages/ code module.

* test(principle-12): raise population-sentinel bounds 10..100 → 100..300 (#375)

The principle-12 population sentinel capped local kickoff dirs at 100. The project
legitimately accumulated >100 umbrellas of history, mirrored locally by the
coordination-persistence channel (G, .husky/post-checkout → link-coordination.sh),
so the ≤100 guess tripped the pre-push on every worktree. Raise to ≤300 (still
catches a runaway glob) and ≥100 (doubles as a 'mirror present' guard). The
sentinel is skipped in CI (KICKOFFS_AVAILABLE) — it only gates local pre-push.

Maintainer-directed 2026-06-02. Does NOT resolve the separate citation-check vs
symlink-mirror interaction (the broader principle-12-vs-G item) — bound only.

Prior-art: skipped — adjusts a sentinel bound in an existing principle test to
match reality; no new capability, no dependency, no new module.

* test(principle-12): citation check ignores coordination-mirror kickoffs (#376)

Citation check re-ran on every umbrella mirrored in by channel G (post-checkout →
link-coordination.sh symlinks gitignored kickoff.md into $CANON), failing on
historical umbrellas this worktree never authored (principle-12-vs-G). Fix: check
only REAL (non-symlink) kickoff.md = locally authored. Population sentinel still
counts the FULL set as a mirror-present guard. Pairs with #375 (bound→100..300).

Prior-art: skipped — narrows an existing principle-test filter to exclude symlink
mirrors; no new capability, no dependency.

* docs(spec): aif parallel autonomous dispatch — verified model + open test (brainstorm 2026-06-02) (#377)

Captures the full session conclusions so they survive: the depth-2 architecture insight
(subagents don't spawn subagents → quality parallel needs separate top-level sessions, meta-
orchestrator decides), the verified aif model (1 kickoff/meta-launch → 1 task; each task = top-
level session; flat task model; two parallelism layers L1 cross-task worktrees / L2 within-task
use_subagents→implement-coordinator; use_subagents=0 everywhere = why never parallelized;
worktree-skip is documented per docs/configuration.md), the observable test signal
(agent_activity_log 'Subagent: <name> started', subagentQuery.ts:793), the decision tree, the
OPEN question gated on one live test (use_subagents top-level launch), an honest flip-flop
corrections log, and decisions (planner-owns-plan, COORDINATOR_MAX knob, park preserved).

NOT a final spec — gated on the §5 live test on a genuinely-parallel task (D.1-D.5).

* chore(harvest): commit reworked aif task 5767f7df-7425-4a78-a76f-98402c1647d0 — mutation-discipline-stage-c-meta-launch (#378)

* docs(spec): aif parallel dispatch §5 RESOLVED — YES via use_subagents (live proof) + M3-bash timeout fix (#380)

* docs(spec): aif parallel dispatch §5 RESOLVED — YES, self-parallelizes via use_subagents (live 2026-06-02)

Live test (task a37ee2f5): use_subagents=true on a real 5-task plan (mutation
Stage 4 D.1-D.5) → implement-coordinator launched top-level (--agent) → fanned
out 5 concurrent implement-worker subagents, each worktree-isolated. Proof:
5x `Tool: Agent {subagent_type:implement-worker}` spawns + git worktree list
1→6 (5 locked worker worktrees coexisting, ~2min all-5 overlap) + 5 distinct
real test files written simultaneously.

Also corrects §3.7 observable: `Subagent:` log line is SDK-transport-only
(onSubagentStart wired only via SDK SubagentStart hook); on transport=cli it
stays 0 even under full parallelism — a false-negative trap. Valid CLI-transport
observables = git worktree growth + `Tool: Agent` activity entries.

Design consequence = the tiny change: bridge sets use_subagents=true at dispatch
for depth-2-sufficient umbrellas + meta-orchestrator emits plan-structured
kickoffs (independent numbered Task items, no Phase headings).

Prior-art: skipped — design-doc update only, no new capability/dependency/code-module.

* test(principle-02): give M3-bash mutation gate a 60s timeout (was default 5000ms)

The [M3-bash] local/on-demand gate (describe.skipIf(!HAS_UM)) calls
runBashMutator → spawns `npx vitest` once per mutant, ~9.5s on a loaded host.
The default 5000ms vitest timeout false-fails it at pre-push (blocking unrelated
pushes; observed this session). Add an explicit 60_000ms timeout — mirrors the
Stryker precedent (principle 11 testTimeout 5s→30s). No assertion/semantics
change; CI still skips it (no universalmutator).

Prior-art: skipped — test-timeout fix for an existing gate, no new capability/dependency.

* test(mutation-discipline-stage-d): paired-negative tests for 5 remaining .sh helpers (#381)

Stage 4 D of the mutation-discipline umbrella — content-level paired-negative
vitest tests (M.4 pattern) for the .sh files that lacked them:
- priority-score.sh        → priority-score-synthetic.test.ts   (20 it, 53 expect)
- plan-currency-check.sh   → plan-currency-check-kickoff.test.ts ( 6 it, kickoff-existence angle; non-redundant w/ existing)
- launch-table-generator.sh→ launch-table-generator.test.ts     (11 it)
- check-skill-drift.sh     → check-skill-drift.test.ts          ( 6 it)
- pre-push.fallback.sh     → pre-push.fallback.test.ts          (20 it)

Produced by the aif self-parallel-dispatch live test (5 concurrent implement-workers,
use_subagents=true) and verified by an independent 5-way adversarial cold-review
(T19): all real-script-invoked (spawnSync bash on the actual .sh), content-level
assertions (exit code + stdout/stderr, no shape-only .toBeDefined), anti-tautology
confirmed. Fixed one over-reaching T12-compliance comment in priority-score
(claimed 8 surfaces verified; only 5 are — now honest + deferred-gap note).

Known deferred coverage gaps (honestly disclosed, follow-up): launch-table
fallback+no-keyword path; pre-push 2 of 3 discipline-file patterns;
priority-score surfaces (c)/(d)/(h). 52/52 tests green.

Prior-art: skipped — test additions for existing .sh capabilities, no new runtime capability/dependency.

* research(mutation-discipline-d6): verdict on deps-hash-check.sh duplication (#382)

D.6 R-phase (mutation-discipline umbrella). Investigates the two byte-identical
deps-hash-check.sh copies. Verified roles (T3, file:line): packages/core/hooks/
= shipped SOURCE (install.sh:261), .claude/hooks/ = this repo's DOGFOOD copy
(settings.json:74). Key finding: deps-hash-check.test.ts:34 tests the DOGFOOD
copy, not source → silent drift possible (test stays green if source diverges).

Verdict (b) keep-both + drift-check: add @dual-pair markers + a byte-identity
assertion test — REUSE the existing dual-implementation @dual-pair convention
(SSOT #87) rather than BUILD. Symlink (a) rejected (install.sh --force regression
+ Windows). Concrete I-phase fix path + falsifiers included. R-phase only — no
edits to the .sh files / settings.json / install.sh.

Produced autonomously by aif (use_subagents=0, single R-phase task) + cold-reviewed.

Prior-art: skipped — research-patch (markdown), no new capability/dependency/code.

* fix(hooks): drift-check for deps-hash-check.sh source/dogfood pair (D.6 I-phase) (#383)

Implements #382 §6 verdict (b) keep-both + drift-check. Adds
@dual-pair: deps-hash-check-dogfood markers (identical block, preserving
byte-identity) to both the shipped SOURCE (packages/core/hooks/) and this
repo's DOGFOOD copy (.claude/hooks/), plus a byte-identity assertion in
deps-hash-check.test.ts.

Closes the silent-drift hole the D.6 R-phase confirmed: the functional tests
exercise only the dogfood copy (HOOK), so they stayed green even if the source
diverged. Falsifier verified — breaking one copy turns the new test red.

Corrected #382 §6's asymmetric-marker spec (4-line block to dogfood vs 1-line
to source), which would itself have broken the byte-identity the test asserts;
both copies carry the identical block.

Last residual of the mutation-discipline umbrella; closure (done.md + memory)
follows on merge.

Prior-art: prior-art-evaluations.md#87 (worktree-create-setup dual-pair, SSOT BUILD — this commit extends the @dual-pair pattern with a second pair; no new mechanism introduced).

* docs: R-phase — why per-task worktrees never materialize (corrects #360 Finding A) (#372)

* docs(runtime-bridge): R-phase — why per-task worktrees never materialize (corrects #360 Finding A)

Live falsifier of #360 Finding A: 0 tasks ever got a worktree despite parallel_enabled=1.
Root cause (verified source, correct containers): the bridge dispatches via a planner-SKIP —
POST /tasks/:id/events {event:'accept_existing_plan'} — which transitions backlog→plan_ready
SKIPPING the `planning` status (stateMachine.ts case accept_existing_plan, api container).
The coordinator runs runPlanner ONLY for the planning stage (coordinator.ts PIPELINE
from:["planning"], agent container). The ONLY worktree-creation code lives in runPlanner
(planner.ts:191-213). ⇒ bridge tasks never run the planner → never create a worktree,
regardless of parallel_enabled / AIF_TASK_WORKTREES_ENABLED / plannerMode.
Secondary: handleAcceptExistingPlan also persists branchName (taskEvents.ts:236+) so even if
the planner ran, planner branch-2 (in-place restore) would pre-empt branch-3 (worktree).

Verdict: parallel_enabled=1 (#360/#362) is NECESSARY BUT NOT SUFFICIENT. Fix options:
B = drop accept_existing_plan from bridge dispatch + let the coordinator run the planner;
C = accept serial in-place as the operating mode with the existing rollback guard.
Both deferred to a follow-up I-phase (DECISION-NEEDED). gate-3 passes; mode-change is NOT
the fix (server already forces full). Effort + falsifier per finding in the patch.

R-phase only — no production code changed. DeepWiki x3 (converged) + verified file:line in
both aif containers. Scope annotation (principle 10) + §1.7 (principle 13).

* docs(runtime-bridge): §0.1 — worktree-skip is DOCUMENTED aif behaviour (docs/configuration.md), not a trap; no upstream issue

DeepWiki x3 (converged): docs/configuration.md ties worktree creation to full-mode
planning by design; docs/architecture.md documents the serial-forcing. So planner-skip
forgoing the worktree is a documented consequence, not a defect — no upstream issue.
Records the search-coverage lesson: the #360 verdict was avoidable by reading aif's own
config docs. The corrected fix (run the planner) is the documented isolation+parallel path.

* docs(wave-plan): reconcile §0 → 2026-06-02 (#298→#382) + codify how §0 stays current (#384)

Manual status reconciliation per the design loop (detect via /meta-orchestrator,
write by human-directed session — Direction A auto-write rejected at R-phase).

- §0 + Status dates 2026-05-29 → 2026-06-02
- correct misleading aif-handoff DEFER-ALL row: add `runtime-bridge BUILD` row
  (minimal-REST bridge shipped #312/#313 + ecosystem; supersedes-in-practice)
- +8 umbrella rows for work merged since last reconcile (runtime-bridge,
  aif task-isolation, companion adoption, coordination-persistence, qloop,
  mutation-discipline, worktree dual-channel, doc-audit-ship-boundary)
- add "Open frontier" block (live: #372 open, inject-layer-extension,
  one-click-installer, f2-aif-fire-backend) — distinct from ~80 closed candidates
- add "How §0 stays current (by design)" note to Status block so future
  sessions don't try to automate the deliberately-manual reconciliation

Prior-art: skipped — doc-only status reconciliation of an existing planning doc, no new capability or dependency introduced.

* chore(orchestrator): mark mutation-discipline-umbrella DONE (#385)

Umbrella closure per CLAUDE.md "Umbrella closure convention" — Final PR #383
(D.6 drift-check, last residual) merged to staging. All stages shipped:
A audit #219 / B bash-mutator #366+#373 (dogfood gate fired) / C tests-of-tests
#378 / D #381 + D.6 dup R-phase #382 + D.6 drift-check I-phase #383.

done.md is the priority-score.sh Layer C3 completion marker (gitignore:14
un-ignores */done.md).

Prior-art: skipped — completion marker (done.md), no new capability/dependency/code.

* fix(principle-12): skip anti-tautology mutation test when no real (non-mirror) kickoffs exist (#386)

The anti-tautology sub-test mutates a REAL compliant kickoff to verify the
compound-citation detector actually catches absence. After the coordination
symlink migration (#346 + post-checkout link-coordination.sh), every local
kickoff.md is a SYMLINK into $CANON — a coordination mirror that
getNonExemptEntries() deliberately excludes (isCoordinationMirror). With all
kickoffs mirrored, getNonExemptEntries() is empty → `compliant` is undefined →
`expect(compliant).toBeDefined()` failed on every host push (reproduced on
staging HEAD, independent of any feature branch).

The #376 mirror-exclusion fix updated the main check + population sentinel but
missed this meta-test. Guard it with HAS_REAL_NONEXEMPT_KICKOFF: when there is
no real kickoff to mutate, skip — detector correctness is already covered by the
pure-logic anti-tautology tests (blank file / each pattern), which need no files.

Unblocks all host pushes (pre-push runs the principle suite). No behaviour change
to the citation enforcement itself.

* fix(runtime-bridge): dispatch via planner-run so each task gets its own worktree (parallel) (#387)

The bridge dispatched tasks with `accept_existing_plan`, which transitions
backlog -> plan_ready SKIPPING the `planning` stage. runPlanner (planner.ts,
the ONLY code that creates a per-task git worktree) runs only at `planning`,
so 0 tasks ever got a worktree -> all dispatched tasks forced serial. Verified
+ live-proven in #372 (research-patches/2026-06-02-aif-worktree-gap.md).

Fix (Option B, live-verified 2026-06-03):
- Drop the `accept_existing_plan` event. The task stays at `backlog`; the
  auto-queue advances it through `planning` -> runPlanner -> per-task worktree.
- Carry the kickoff in `description` (the planner INPUT spec, planner.ts:246),
  NOT in `plan` (the planner OUTPUT slot @planPath, which it overwrites). The
  planner plans the *how* from our kickoff *what*.

Live acceptance: two tasks dispatched concurrently each got a DISTINCT
worktree and both ran in `planning` simultaneously (N agents x N workspaces,
not within-task subagents). Throwaway probe tasks + worktrees cleaned up.

Tests: rewrote the dispatch sequence test for the 2-step flow (asserts
description=kickoff, no accept_existing_plan, no plan push) and moved the
rollback test's failure point to the unpause step. 8/8 green.

Prior-art: skipped — modifies existing bridge file, no new capability/dependency/module.

* research(aif-operator-asset-access): R-phase — gap verification + A-E verdict + recommended composition (#388)

Five gap rows re-confirmed with file:line evidence. Existing skill-context/ and agents/*.md
mechanisms audited (T16 problem-class check) — none cover orchestrator/reviewer discipline.

Recommended composition: B+D (in-repo agnostic worker discipline, primary) + A (operator
bind-mount, immediate) + C (buildKickoffSpec sibling inlining, follow-on). E rejected.
DN-1/2/3 surfaced; DN-1/2 resolved inline (B scope = minimum viable worker discipline;
reviewer-discipline = separate concern covered by review-sidecar.md).

Prior-art: prior-art-evaluations.md#67 (aif-handoff, ADOPT — this umbrella extends it with
operator-asset bridging); prior-art-evaluations.md#50 (skill-context/aif-review SSOT,
ADOPT channel — D reuses this delivery pattern).

* fix(meta-orchestrator): Stage 2 correctness — C1.1/C1.2/C1.3/M4/F2/F7 (#389)

Six confirmed bugs fixed in the meta-orchestrator skill:

C1.3 — SKILL.md:449: stale repo-root mirror claim removed; replaced
  with "Ships directly from .claude/skills/meta-orchestrator/ via
  install.sh (single source of truth; no repo-root mirror — Item 12
  closure 2026-05-25). Install pattern at install.sh:236-255."

C1.2 — SKILL.md:508: state.md section names corrected from stale
  "§2 Launch-table / §3 Dispatch log" to actual template names
  "§2 Decisions / §3 Phase -1 verdict" (state.md.template:26,35).

C1.1 — master-backlog-delta.md:49-52: "Body owns arrays — inline-jq"
  claim removed (inline jq was removed in F.3 PR #261 2026-05-28);
  delta-write-from-state.sh correctly attributed as array owner.

M4 — SKILL.md:521-525: delta two-helper ordering fixed. update-delta.sh
  (bootstraps schema) now listed first, matching delta-write-from-state.sh:19.

F2 — SKILL.md:71: head -200 raised to head -400; wave-sequencing-plan.md
  is 293 lines so head -200 dropped 93 lines incl. §6 dependency-matrix.

F7 — run-helper.sh:26: timeout wrapped (MO_HELPER_TIMEOUT env, default 120s);
  END trailer still fires on expiry (rc=124). failures.md: F9 added.

Prior-art: skipped — correctness fixes to existing prose/helper, no new capability

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(aif-worker-discipline): portable worker discipline agent + AIF skill-context delivery (#390)

* feat(aif-worker-discipline): portable worker discipline agent + AIF skill-context delivery

Artifacts 1 (B) and 2 (D) from aif-operator-asset-access I-phase.

- agents/orchestrator-worker-discipline.md: portable AI-agnostic worker
  discipline (REPORT schema, park-vs-proceed, stage-gate, §1.7 PR body)
  for aif-dispatched workers. Class B. @dual-pair: aif-orchestrator-discipline.

- packages/core/templates/shared/skill-context/aif-orchestrator-discipline/SKILL.md:
  AIF-native delivery of the same content. YAML from aif-review/SKILL.md (SSOT #50).
  @dual-pair + spec: per dual-implementation-discipline.md §5.

- packages/core/principles/09-doc-authority-hierarchy.ts: added
  aif-orchestrator-discipline/SKILL.md to REQUIRED_HEADER_DOCS (shippedSubset 16→17).
  Upper sentinel 60→65; Wave-4 length sentinel 16→17.

- install.sh: aif-orchestrator-discipline/SKILL.md added to SHIPPED_DOCS.

§1.7: forward — agents/orchestrator-worker-discipline.md:9 authority header per
doc-authority-hierarchy.md §3; install.sh:103 in sync with REQUIRED_HEADER_DOCS
per 09-doc-authority-hierarchy.test.ts:164 Wave 4 invariant. backward —
SKILL.md:10-11 carries @dual-pair + spec: per dual-implementation-discipline.md §7.

Prior-art: prior-art-evaluations.md#50 (skill-context/aif-review, ADOPT channel pattern).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(runtime-bridge): add operator convenience bind-mount section for global skills

Adds '## Operator convenience: mount global skills' section at the end of
docs/runtime-bridge-setup.md documenting how to bind-mount operator-side
global skills (~/.claude/skills/orchestrator/, Superpowers plugins) into
the aif container via docker-compose.override.yml.

Operator-axis only — consumers of the shipped framework are NOT required to
have these paths. The shipped in-repo discipline works without the mount.

Artifact 3 (A-docs) from aif-operator-asset-access I-phase.

Prior-art: skipped — doc addition, no new capability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(meta-orchestrator): add harvest egress step to autonomous dispatch loop (#391)

aif does NOT push or open PRs by design (documented in harvest.ts:11-14).
Nothing in the dispatch loop said "after status=done → call harvest" — this
was the gap that caused the aif-operator-asset-access I-phase to sit stuck
in the container with work done but no PR opened (incident 2026-06-03).

Fix: add egress gate to SKILL.md §5 autonomous dispatch row and to
meta-kickoff.template.md §4c so every generated kickoff carries the
harvest call as a mandatory post-done step.

Anti-pattern #autonomous-done-no-harvest added to SKILL.md §5.

Prior-art: skipped — doc-only change to .claude/skills/ and templates/,
no new capability (refactor only, harvest.ts already shipped).

* chore(orchestrator): mark aif-operator-asset-access DONE (#392)

* docs(meta-orchestrato…
artyhoo added a commit that referenced this pull request Jun 14, 2026
* Promote staging → main — consumer-install-hardening + guard-liveness + runtime-bridge (134 commits) (#488)

* feat(hooks): SubagentStop REPORT-schema WARN (non-blocking, #108 candidate-3) (#339)

Ship .claude/hooks/warn-subagent-report.sh — scans the finishing subagent's
output for canonical REPORT sections (VERIFY, Confidence, ATTN); emits a
⚠ stderr warning + exit 0 (non-blocking) when any are missing.

Maintainer chose WARN over block (exit 2) — judgment target, not gateable
(#gate-where-judgment-needed, rule-enforcement-channel-selection.md §1).

Contract verified DUAL-CHANNEL 2026-06-01:
  Channel 1 — WebFetch code.claude.com/docs/en/hooks: SubagentStop fields
    include agent_type; exit 0 = non-blocking; stderr shown to user.
  Channel 2 — DeepWiki anthropics/claude-code: agent_transcript_path +
    last_assistant_message (since CC 2.1.47) confirmed by name + quoted.

Two read paths (B1 — scan-nothing trap avoidance):
  1. last_assistant_message if non-empty.
  2. agent_transcript_path JSONL, reusing end-of-turn-reminder.sh:30-41.
Noise guard: skip Explore agent_type + require standalone REPORT-cue label.

Paired test: 6 cases (positive-A/B + negative + negative-2 Explore +
non-report prose + exit-code invariant). All 6 green. Pre-existing staging
failures (pre-push.test.ts + plan-currency-check.test.ts) unaffected.

settings.json wiring snippet in PR body (maintainer lands, not committed).

Prior-art: prior-art-evaluations.md#108 (SubagentStop REPORT-schema gate — candidate-3 of #108, shipped as WARN per maintainer decision 2026-06-01; block dropped — judgment target, #gate-where-judgment-needed).

* docs(research-patches): satellite-feature-harvest — own-stack-first harvest + reverse-sweep (form B) (#328)

Own-stack-first sweep: Claude Code natively ships the remote/scheduled/parallel-session
cluster (Remote Control, Routines, Channels, agent-view, Slack) that prior SSOT rows
credited to companions. 15 capability clusters triaged → 4 adopt-now (Remote Control,
Routines via /schedule, Channels(Telegram), background agent-view) + 3 defer + 8 skip.
Reverse sweep: 4 criterion-zero relationships, no shipped artefact retired (T-SFH-D —
runtime-bridge questions.ts kept; Channels is session-open-only). +1 SSOT row #100.

Prior-art: skipped — research-patch only, no new capability (the BFR own-stack-first survey is the patch content itself).

* chore(hooks): wire pending CC hooks in settings.json (SubagentStart/Stop + runtime-bridge) (#340)

Activates three already-merged, already-committed hook scripts that were
running locally but never wired in the shared config:
- PostToolUse Write|Edit|MultiEdit -> runtime-bridge-dispatch.sh (#313)
- SubagentStart -> inject-subagent-digest.sh (#108 companion-adoption-iphase)
- SubagentStop -> warn-subagent-report.sh (#108 candidate-3, #339)

All hook scripts already exist in staging; this only activates them.
Config-only wiring, not a capability commit.

* docs(book): SubagentStop block-vs-warn — flip open-node DECISION-NEEDED → решён=WARN (#339) (#341)

#339 (SubagentStop REPORT-schema WARN, non-blocking) merged to staging as
0596a64 — the block-vs-warn decision is resolved in favour of WARN. Hook
remains INERT (no SubagentStop in settings.json) until the maintainer lands
the snippet, so the node stays half-open: decided, not yet wired.

- v1 (technical): chapter XXII + epilogue June-1 open-nodes list — cite #339
- v2/v3 (literary): keep allegory, no PR number — «нрав выбрали, в строй не поставили»

Prior-art: skipped — doc edit only, no new capability (book open-node status sync after #339 merge).

* refactor(hooks): remove end-of-turn factual-claim detector — net-negative sentry, dropped by evidence (#342)

The claim-scan (numeric / file:line / negative-existence → re-verify nudge) in
end-of-turn-reminder.sh measured recall ≈0.43 + precision ≈0.20-0.25 (cry-wolf)
in the instruction-compliance pilot (2026-05-21). A sentry that misses most real
claims and false-fires on ~75% of what it catches is the #discipline-theatre the
project hunts. Maintainer decision 2026-06-01: «не нужен раз не работает».

Same class + outcome as the recommendation-laziness narrow-B stop-scan dropped at
FP 84% (#210): drop on FP evidence, keep the always-on H1 reminder.

Surfaces:
- hook: remove claim-scan block + has_claims/claim_count refs in idle-guard,
  trigger, glance-line, Branch D, append block. Trigger = long_text||asked;
  branches A/B/C only. Recap + question-check survive. bash -n + shellcheck clean.
- tests/hooks/eot-claim-scan.test.sh: deleted (185 LOC, all claim-scan) + CI step.
- packages/core/hooks/end-of-turn-reminder.test.ts: drop Branch-D + code-fence
  precision cases, add paired-negative «short claim turn now silent». 13/13 green.
- research-patch documenting the evidence-based removal (scope annotation, §1.7).
- book epilogue ×3: the «искатель утверждений» debt closed by removal, not fix.

A short factual-report turn with no question now stays silent (was Branch D) —
the intended consequence; that nudge was the cry-wolf.

Prior-art: skipped — removal of an own-built net-negative mechanism, no new capability (cites instruction-compliance-empirical pilot + narrow-b-benchmark #210 precedent in the research-patch).

* feat(runtime-bridge): harvest — deterministic aif-task to PR egress leg (#343)

aif-handoff ends a task at "committed on a local feature branch" with NO push
and NO PR-creation in its autonomous (HANDOFF) path — verified 2026-06-01
against the running containers (zero PR-create / branch-push anywhere in its
autonomous flow; its commit/push lives only in an LLM-driven /aif-commit
runtime). So committed work strands inside aif's checkout, never reaching a
reviewable PR on the trunk. harvest is the missing return leg.

- src/harvest.ts: pure DI'd core harvestTask — guards (terminal status,
  branchName present) BEFORE any side-effect; ordered push then createPr then
  auto-merge, fail-fast (PR error never arms auto-merge).
- src/cli/harvest.ts: real wiring — docker-exec push from aif's container
  (holds the commit + working creds), host PR-create against staging, native
  auto-merge; graceful printed manual-fallback if docker absent.
- test/harvest.test.ts: paired-negative (non-terminal / no-branchName must NOT
  push or PR; PR-fail must NOT arm auto-merge).
- aifHttp.ts: expose branchName on AifTaskFull (read back by harvest).

Zero LLM by construction (plain git+gh+docker) — unlike aif's own commit flow
which spends a paid claude -p query just to run git. Complies with
no-paid-llm-in-ci.md.

Prior-art: prior-art-evaluations.md#27/#28/#30/#67 — aif-handoff's own runtime
(HANDOFF_MODE / paused / Planner-Implementer-Reviewer / Kanban) is the from-side
this leg bridges, NOT an egress tool: verified it has zero push/PR in its
autonomous path, which is exactly why harvest exists. No upstream
harvest-autonomous-agent-branch-to-PR analog; thin deterministic glue over
gh/git/docker, no PR-creation reimplemented. BFR verdict: BUILD (bridge egress leg).

* feat(meta-orch): run-helper.sh completion-barrier wrapper (TDD, stage 1) (#344)

Build .claude/skills/meta-orchestrator/helpers/run-helper.sh — a trivial bash
exec-wrapper that runs a target helper as a child and ALWAYS appends a terminal
END-trailer to stdout:

    === <helper-name>: END rc=<exit-code> (lines=<stdout-line-count>) ===

so a session reading a slow helper's stdout in the background can distinguish
"finished (rc=N)" from "still running / crashed". The trailer is appended by the
parent wrapper, so it fires even when the child exits non-zero or dies
mid-output (a child-side `echo END` would be skipped on `set -e` abort / SIGKILL
/ timeout). Fixes the orchestrator reading a header-only partial file as
"zero results".

HARD CONSTRAINTS satisfied (§2): exit-propagation (capture rc first, exit rc
last — trailer echo never clobbers child status); trailer-on-crash; stdout
verbatim pass-through; `=== `-prefix kept so classify-each-candidate.sh:52
`awk '... && !/^=== /'` strips it (never a spurious candidate).

TDD: paired-negative test at packages/core/skills/run-helper.test.ts (positive
clean-exit + negative exit-1 + SIGKILL crash-mid-output + parse-safety) — 4/4
green. No regression: `git stash -u` A/B shows the 5 neighbouring helper tests
produce an identical pre-existing 18-fail set (env-dependent gh/git harnesses)
with and without this file.

T-BGB-A: the END trailer proves the child FINISHED + its exit code, NOT
semantic content-completeness — kept in test names/comments.

Prior-art: prior-art-evaluations.md — escape hatch: trivial bash exec-wrapper, no upstream analog worth a dependency (BFR BUILD, pre-reasoned). Nearest SSOT neighbour #54 (Aider run_cmd runner) is a different problem-class — exit-code routing in a TS pre-push gate vs. appending a structural completion trailer for a background reader (T16: similar "runner" name, distinct capability).

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* bg-helper-completion-barrier-stage2-aif (#345)

* feat(meta-orch): route bg-helper call-sites through run-helper.sh + Layer-1 read-rule (stage 2)

Wire the two background-helper !-fences in meta-orchestrator/SKILL.md
through the already-merged run-helper.sh completion-barrier wrapper:
- §2 Step 1 priority-score.sh
- §2.5 Step 2 dup-detect.sh + inflight-check.sh

Add the Layer-1 read-rule prose after both fences: parse a slow helper's
output only after its task-notification or the `=== <helper>: END rc=<n> ===`
trailer; a header-only read means "still running", not "zero results".
Origin: incident 2026-06-01 (priority-score.sh read at header-only state →
false "zero candidates").

Helper code untouched; the 5 helper tests show identical baseline (18 failed
/ 34 passed both with and without this edit — failures are environmental,
`gh` absent). Wrapped fences valid bash; classify-each-candidate.sh:52 still
strips the `=== `-prefixed trailer.

Prior-art: skipped — SKILL.md call-site wiring only, no new capability (routes existing helpers through the already-merged run-helper.sh wrapper from PR #344).

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

* fix(meta-orch): SKILL.md back to 600 lines — fold read-rule into §2 Step 1 (DRY)

aif's Stage 2 added two verbatim read-rule blockquotes (+4 lines), tipping
SKILL.md from 598 to 604 over the 600-line mechanical-check cap (real CI fail
on #345). Phase -1 reviewer fix: fold the read-rule once into the §2 Step 1
intro with 'applies to every background-helper fence below', drop the §2.5
duplicate. Both run-helper.sh wraps intact; read-rule discipline preserved, now
DRY. Not a capability commit (markdown edit).

Prior-art: skipped — markdown CI-fix (line-cap trim + DRY), no new capability.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(closure): bg-helper-completion-barrier done.md (final PR #345) (#347)

Last-stage merge marker per CLAUDE.md umbrella-closure convention — priority-score.sh
Layer C3 reads this for DONE detection.

Prior-art: skipped — closure marker file, no new capability (convention bookkeeping).

* feat(coordination): symlink-to-canonical cross-worktree sync (SSOT #110) (#346)

Build scripts/link-coordination.sh (per-file symlinks, adopt-then-link,
conflict-loud, seed on empty CANON), wire it into both worktree helpers
replacing the J5 rsync block, add link-coordination.test.ts (7 tests:
symlink, git-clean, conflict, write-back, paired-negative, adopt, seed),
reconcile worktree-setup-hydration.test.ts (drop rsync NON-DESTRUCTIVE,
retarget paired-negative regex to link-coordination.sh call, assert
symlinks), append SSOT row #110.

Umbrella count confirmed: 124 (kickoff said 123 — stale).

Prior-art: prior-art-evaluations.md#110 (cross-worktree gitignored-SSOT sync via symlink-to-canonical, verdict ADAPT) + research-patch 2026-05-17-cross-worktree-coord-doc-sync.md §5 — I-phase implementation of the settled verdict.

* docs(runtime-bridge): per-command CLI reference README (Option B) (#348)

Operator-facing reference manual for the six runtime-bridge CLI commands
(answer, await, dispatch, harvest, park, questions), one section each with
Usage / Flags / Example, derived from each cli/<cmd>.ts header docblock.
Resolves the parked README-structure fork → Option B (per-command reference).
Markdown only, 285 lines (< 600-line cap), no code changes.

Prior-art: skipped — documentation only, no new capability (operator-facing CLI reference derived from existing docblocks)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(discipline): surface genuine forks via AskUserQuestion (autonomous-default, human-gate on ambiguous only) (#349)

Operating model (maintainer decision 2026-06-01): autonomous by default;
the human-gate fires ONLY on a genuine ambiguous fork. A clear call is
decided and reported, not routed through a question.

- recommendation-laziness-discipline.md §3: fork-surfacing companion to the
  evidence rule — ambiguous forks MUST be surfaced via AskUserQuestion, never
  decided by a silent direct action; ask-question-reminder.sh is the
  discriminator; reworded 'default=surface' -> 'autonomous-default, surface
  only genuine forks'.
- recommendation-laziness-discipline.md §5: new anti-pattern
  #fork-decided-by-silent-action (incident: PR #348 battle-test, an
  explicitly-50/50 README fork auto-decided by running answer.ts directly).
  Judgment rule -> injection-only enforcement, never a gate (#gate-where-judgment-needed).
- end-of-turn-reminder.sh Branch-A: backstop reminder for the
  'decided a fork silently' path (the inverse of the existing offload check).

Hook tests 20/20 green. Origin: 2026-06-01 question-loop battle-test dialogue.

§1.7: forward — complies with rule-enforcement-channel-selection (judgment->injection),
no-paid-llm-in-ci (deterministic .sh + prose), doc-authority (no new heading); backward —
new anti-pattern scope = any-session fork behaviour, no existing rule superseded
(reviewer-discipline §2 is reviewer-scoped), enforced by two already-shipped hooks.

* feat(hook): orchestration-mode aware reminders + brainstorm cue (qloop items 2+6) (#350)

* docs(spec): hook-nudge orchestration-mode design (brainstorm item 2+6)

Design for orchestration-mode-aware behaviour of the two reminder hooks:
marker-gated Bug A fix (drop low-precision fork-regex in-mode) + recap
threshold lowering (b) + brainstorm nudge in ask-question-reminder.sh.
Normal mode stays byte-for-byte. Origin: 2026-06-01 qloop battle-test brainstorm.

Prior-art: skipped — design doc only, no new capability (markdown spec under docs/superpowers/specs/, no dependency/code-module).

* docs(plan): hook-nudge orchestration-mode implementation plan (item 2+6, TDD)

Prior-art: skipped — planning doc only, no new capability.

* docs(spec): add §3.4 aif-pull-channel brainstorm nudge (formatHuman footer)

Recursive-self-application gap from maintainer dialogue: ALL aif-parked
questions (not just I-ask-via-AUQ) must get the brainstorm-first nudge.
Footer ships in item 4's questions.ts PR (file-locality).

Prior-art: skipped — design doc only, no new capability.

* feat(hook): orchestration-mode gating — drop fork-regex (Bug A) + lower recap threshold (recap-b)

Marker .claude/orchestration-mode (mtime TTL); normal mode byte-for-byte.
Bug A: decision-MENTIONS stop false-firing the fork-challenge in-mode (regex
gated on orch_mode=false); real Qs (?/AUQ) still caught. recap-b: recap fires
on short structured status in-mode (threshold 500->200) keeping the markdown
gate so chatter stays silent. 7 new tests + 13 pre-existing green (20/20).
Spec: docs/superpowers/specs/2026-06-01-hook-nudge-orchestration-mode-design.md.

Prior-art: skipped — internal CC hook tuning, no new capability or dependency.

* feat(hook): brainstorm cue in ask-question-reminder (item 6)

Design/strategy forks -> superpowers:brainstorming, not a bare AUQ card.
Always-on prose nudge (judgment -> injection, never a gate). 1 new test (8/8).

Prior-art: skipped — internal CC hook tuning, no new capability or dependency.

* fix(runtime-bridge): surface mid-flight park in questions.ts + brainstorm footer (qloop item 4) (#351)

isParked gains the mid-flight-park case: a task whose blockedReason was wiped
by implementing→review still surfaces via the durable conjunction
(paused===true AND the plan carries the OPEN_QUESTION_ANCHOR). New shared
constant openQuestion.ts is the single SSOT for that anchor (writer park.ts,
reader questions.ts) so the wording cannot drift (dual-implementation-discipline
#two-prompts-drift).

formatHuman appends the §3.4 brainstorm-first footer on a non-empty parked list
(aif-pull-channel companion to ask-question-reminder.sh §3.3); empty case
unchanged. Reproduced from the verified container fix (branch
feature/qloop-realfix-d7585d), host-side, per handoff item 4.

Design SSOT: docs/superpowers/specs/2026-06-01-hook-nudge-orchestration-mode-design.md (§3.4).

Prior-art: skipped — bug fix on existing CLI + 17-LOC shared constant, no new capability/dependency.

* feat(runtime-bridge): commit aif rework leg in harvest (qloop item 3) (#352)

aif commits only on its approve_done && commitOnApprove path; the
request_changes→implementing→done rework path leaves the work uncommitted
(dirty tree, branch == base HEAD), so harvest had nothing to push. Extend the
egress: hasUncommittedChanges → commitAll (templated message, ZERO LLM) before
push. No-op on the normal path (tree already clean). Commit failure is fail-fast
— nothing pushed, operator gets the printed fallback. Real dep guards that the
container checkout is on the task branch before committing.

aif-handoff source untouched (foreign runtime, SSOT #27) — fix lives entirely
on our egress leg, matching harvest's graceful-degradation design.

Prior-art: skipped — extends existing harvest CLI, deterministic git only, no new capability/dependency.

* fix(principles): isolate p13 fixtures to tmpdir (kills p10↔p13 race) + exempt qloop-ux-probe probe (p12) (#353)

Two local pre-push false-blocks found by qloop-ux-probe (neither is a real violation):

F1 — principle 13 wrote its synthetic + c3-decoration fixtures into the REAL
docs/meta-factory/research-patches/ dir, then unlinked them. Under vitest's parallel
file run, principle 10's readdirSync globbed the transient file and ENOENT'd when 13
deleted it → a cross-file race (10 alone = 5/5 pass; full run = flaky ENOENT). Fix:
write the fixtures to os.tmpdir() — checkSection reads content only, PATCHES_DIR
membership was never required. Verified race-free across 3 consecutive full-trio runs.

F2 — principle 12 flagged the gitignored qloop-ux-probe kickoff (a 2-question resume
*test fixture*, not a work-delegating orchestration kickoff) for no AI-traps citation,
failing every local push. It already skips in CI (KICKOFFS_AVAILABLE false). Added to
EXEMPT_LIST with documented rationale.

Full principle suite: 157/157.

* fix(runtime-bridge): park.ts resolves API_BASE_URL so agent can park from inside aif container (#354)

park.ts is the only CLI run from inside the aif agent container, which exposes the
service as API_BASE_URL=http://api:3009 and does NOT set RUNTIME_BRIDGE_AIF_URL.
The old localhost-only default was unreachable there (connection refused) -> park()
got 'fetch failed' -> the agent could not park itself, so park-don't-guess (SSOT #109,
meta-orchestrator §4c) was non-functional on the real autonomous path.

New precedence: RUNTIME_BRIDGE_AIF_URL ?? API_BASE_URL ?? http://localhost:3009.
Host orchestrator (sets neither) still gets localhost; container gets api:3009.

Found by qloop-ux-probe Часть 2 live dispatch (taskId 5e32fcb9): agent correctly
surfaced-not-hacked the park failure, but the task slid implement->review->done at
$3.17 having parked nothing. resolveAifBaseUrl() extracted + unit-tested incl. a
negative guard proven to go red on regression.

* fix(runtime-bridge): don't record dedup on ManualBackend fallback + add --force (Finding B) (#355)

dispatch.ts recorded a dedup entry unconditionally after Step 4 — even when the real
backend threw (e.g. dirty_worktree 409) and it fell back to ManualBackend. That manual
entry (which created no autonomous task) then blocked a legitimate real retry for the
full 24h TTL, with no escape. qloop-ux-probe hit exactly this: after fixing the dirty
worktree, the re-dispatch was refused as "already dispatched (backend=manual)".

Fix:
- shouldRecordDedup(backendName): record only for a real backend success, never 'manual'.
- --force: skip the dedup check to re-dispatch the same kickoff deliberately.
- kickoff path resolved as the first non-flag arg, so --force may sit anywhere.

Three pure helpers, unit-tested incl. a negative guard. Full runtime-bridge suite 102 pass.

* fix(runtime-bridge): questions.ts recovers mid-flight-park question from plan anchor (Finding E) (#356)

A mid-flight park (paused:true + OPEN_QUESTION_ANCHOR in plan, blockedReason wiped by
implementing→review) surfaced in the list — but parkedReason() rendered "(no reason
recorded)" because it only read blockedReason + reviewComments, never the question text
park.ts appended under the plan anchor. So the chat channel showed "there is a question"
with no idea WHAT it asks (qloop-ux-probe Finding E, task ccebe39a).

Fix: extractOpenQuestion(plan) pulls the text after the last OPEN_QUESTION_ANCHOR line;
parkedReason precedence is now blockedReason → plan OPEN QUESTION → reviewComments →
"(no reason recorded)". Unit-tested incl. multi-anchor (last wins) + a negative guard.
Full runtime-bridge suite 100 pass.

* fix(runtime-bridge): park.ts probes reachable base URL — agent env scrubs API_BASE_URL (Finding C-2) (#357)

Finding C (#354) made park.ts READ API_BASE_URL, but the qloop-ux-probe live re-run proved
that insufficient: the aif agent runs park.ts in a Bash-tool subprocess whose env is
SCRUBBED of API_BASE_URL (the container's PID-1 env has it; the agent's exec env does not).
So resolveAifBaseUrl() still fell back to localhost:3009 → unreachable inside the container
→ "fetch failed" → the task slid to done at $3.45 without parking, exactly as before.

Fix: resolveReachableBaseUrl() probes candidate URLs and uses the first reachable one —
[RUNTIME_BRIDGE_AIF_URL?, API_BASE_URL?, http://api:3009 (docker service), http://localhost:3009
(host)], de-duplicated. Works from BOTH the agent container (api:3009) and the host
orchestrator (localhost) even when no env survives. main() now awaits the probe.

candidateBaseUrls + resolveReachableBaseUrl unit-tested (injected fetch) incl. a negative
guard proving it skips an unreachable first candidate. Full runtime-bridge suite 117 pass.

* feat(runtime-bridge): bridge-health.sh ($0 container-side preflight) + bridge-cleanup.sh (junk sweep) (#358)

Operator pain: "каждую сессию приходится чинить" + "мусор постоянно остаётся". Both are
structural — the recurring bugs live on the host↔container↔aif boundary that unit/CI
can't cover (a full agent run costs LLM tokens, no-paid-llm-in-ci), so they were only
found live MID-TASK; and probe/smoke runs leave orphan tasks + /tmp files behind.

bridge-health.sh — $0 deterministic CONTAINER-side preflight (docker+curl+grep, no task,
no tokens). Each check maps to a real qloop-ux-probe finding: container checkout clean
(A), park.ts carries the resolveReachableBaseUrl probe (C-2), a park candidate URL is
reachable from inside the container (C/C-2), dedup store has no stale manual entries (B).
Run at session start → "bridge red, fix first" instead of discovering breakage live.
Complements verify-bridge.sh (host-side dispatch smoke). Live-dogfooded — caught + fixed
a false-positive in its own reachability check (000 connection-fail vs real HTTP status).

bridge-cleanup.sh — one-command sweep of test/probe junk: aif tasks matching a test-title
allowlist (UXPROBE/smoke/probe — real work never matched), old /tmp ManualBackend kickoffs
+ dedup backups. Reports a container stash, never drops it (operator's git). --dry-run.

Prior-art: extends own verify-bridge.sh operator-smoke pattern (packages/runtime-bridge/scripts) — no external prior art applies; project-specific aif-bridge container diagnostic + test-task sweep, not a general capability with an upstream analog.

* fix(runtime-bridge): self-cleaning junk producers — junk no longer accumulates (no manual/AI sweep) (#359)

Operator: "придумать как быть с мусором — его не должен чистить каждый раз ИИ". A manual
cleanup script is still "someone cleans each time". The real fix is that each producer
cleans up after itself, automatically, with zero AI/manual involvement.

idempotency.ts — recordDispatch was append-only (file grew forever; a stale manual-fallback
entry blocked retries for the full TTL). Now it PRUNES-ON-WRITE: rewrites the log keeping
only within-TTL entries + the new one. Self-bounding, and stale entries (incl. Finding B's
manual fallback) auto-expire by age — no --force needed after TTL, no sweep.

ManualBackend.ts — dispatch wrote /tmp/runtime-bridge-<id>.md on every fallback and never
cleaned them (days of accumulation). Now each dispatch first prunes its OWN stale artefacts
(runtime-bridge-*.md older than 7d). Scope-guarded: only matches our files, only when stale,
best-effort (never throws into the dispatch path).

Pure cores (pruneStaleEntries / parseEntries / isStaleArtifact) unit-tested incl. negative
guards (stale entry must not survive; unrelated old .md must not be pruned). Full suite 126 pass.

This complements (does not replace) bridge-health.sh; bridge-cleanup.sh stays as a rare
manual "nuke everything" escape hatch, not the routine mechanism.

* fix(runtime-bridge): park.ts refuses to park at status=review (Finding F guard) (#361)

A park that happens AFTER the implement→review transition left the task
status=review, paused=true. On resume, aif runs the review pipeline straight to
`done` WITHOUT re-implementing the injected answer — and the next chain question
is never parked (live: task ba3b4bf6 answered c1 → done, c2 silently lost).
Root cause is upstream-intentional: aif's HUMAN_ACTIONS_BY_STATUS.review = []
(stateMachine.ts) — there is no human re-entry from `review` into implement.

Option B (per 2026-06-01-aif-task-isolation.md §4, maintainer-selected): a cheap
our-side guard. parkTask already GETs the task, so the status is in hand — refuse
the park at status=review and throw a clear message (park before review, or wait
for done and use answer.ts request_changes). Turns the silent loss into a loud,
actionable error. Does NOT add mid-flight re-implement (Option C, deferred).

Paired-negative test: GUARD refuses + issues NO PUT at status=review; CONTROL still
parks normally at a pre-review status (plan_ready). 19→21 tests green.

Prior-art: skipped — bug-fix guard on existing park capability, no new dependency or capability commit.

* docs: R-phase research-patch — aif task-isolation (Findings A + F) (#360)

* docs(runtime-bridge): R-phase research-patch — aif task-isolation Findings A + F

Finding A (dirty_worktree recurs): verdict config-fix. Per-task worktrees are gated by
a 3-condition AND in planner.ts:191-195 — env AIF_TASK_WORKTREES_ENABLED=true is only
gate 1; gate 2 project.parallelEnabled (DB parallel_enabled, web-UI toggle) is 0 and was
never set, so worktrees are never created and the shared checkout is reused in-place →
dirties → next dispatch 409s. Fix: flip parallel_enabled (no restart).

Finding F (mid-flight park resumes review->done, never re-implements): verdict
aif-upstream-issue (intentional design) + our-side-guard. stateMachine.ts:106
HUMAN_ACTIONS_BY_STATUS.review=[] -> no human re-entry into implement; request_changes
only from done. DECISION-NEEDED for I-phase: Option B (park.ts guard rejecting parks at
status=review) vs Option C (auto request_changes loop, ~4h).

R-phase only — no production code changed. Evidence: parallel_enabled=0 (live DB query),
worktree_path null across 10 tasks, reflog >=6 in-place checkout cycles, planner 3-gate +
stateMachine review:[] source-verified. Scope annotation (principle 10) + §1.7 (principle 13).

* docs(runtime-bridge): record Finding F resolution — Option B selected + shipped (#361)

§4.1 + §7.3: DECISION-NEEDED-F resolved 2026-06-01. Maintainer selected the
hard-guard path (surfaced as "Option B"). Records the exact shipped behavior
honestly: park rejects only at status=review (the §4.1 Option-A semantics, NOT
the stricter implementing-only Option B) — pre-implement parks (plan_ready) stay
legitimate. Cross-refs PR #361. Option C deferred.

* feat(runtime-bridge): ensure-parallel guard — self-heal Finding A on any instance (#362)

aif creates a per-task git worktree only when project.parallelEnabled=1 (gate 2
of 3 in planner.ts). That flag is a DB field with NO env/config.yaml knob — only
the web UI or raw DB sets it — so a freshly-provisioned instance has it 0, every
task runs in-place on the shared checkout, and the next dispatch 409s on
dirty_worktree (research-patch 2026-06-01-aif-task-isolation.md §1-§2; the live
config-fix applied to this instance does not propagate to other instances).

ensureParallelEnabled(baseUrl, projectId): GET /projects → if parallelEnabled is
already true, no-op; else PUT /projects/:id with parallelEnabled=true. Wired
best-effort into AifHandoffBackend.dispatch() Step 0 (warns + proceeds on failure,
never blocks dispatch) and shipped as a standalone CLI (--project / env).

Anti-clobber (load-bearing): aif has no targeted parallelEnabled write (only
PATCH /:id/auto-queue-mode), and the full PUT NULLs any omitted *MaxBudgetUsd
(@aif/data updateProject: `x ?? null`). So the guard round-trips the FULL field
set read back from GET — flipping ONLY parallelEnabled — to preserve a UI-set
budget. Paired-negative test pins this: a set budget MUST survive the PUT.

Cleaner long-term fix = an upstream PATCH /projects/:id/parallel-enabled mirroring
the existing auto-queue-mode PATCH (file against lee-to/aif-handoff); this guard
is the our-side stopgap. 6 new tests green; runtime-bridge typecheck clean.

Prior-art: prior-art-evaluations.md#109 (park.ts BUILD — same class: thin our-side runtime-bridge consumer CLI over aif REST where no upstream targeted primitive exists; here parallelEnabled-reconcile, no upstream PATCH beyond auto-queue-mode; cleaner fix REFERENCEd to upstream, this is the stopgap).

* coordination-persistence-fix (#363)

* feat(coordination): link-coordination.sh --on-conflict=canon|worktree|skip (default skip)

Adds --on-conflict flag with three modes resolving the real-file-in-both
conflict deterministically: skip (default, exit 1, never clobber), canon
(canonical wins, relink), worktree (worktree wins, adopt into CANON).
Invalid values exit 2. TDD: 4 tests in link-coordination.test.ts.

Prior-art: skipped — extends existing scripts/link-coordination.sh (SSOT #110), no new capability/dependency; arg-parse + branch logic only, no new file/dep.

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

* feat(coordination): link-coordination.sh shares root _plan-cache.md + _master-backlog-delta.json (Part-2, SSOT #110)

Adds a ROOT-FILE adopt-then-link + link pair so the two root-level
gitignored coordination files (_plan-cache.md, _master-backlog-delta.json)
are shared across worktrees — previously unmatched because the loops only
iterated umbrella subdirs */. Tracked root README.md untouched.
TDD: 3 tests in link-coordination.test.ts.

Prior-art: skipped — extends existing scripts/link-coordination.sh (SSOT #110), no new capability/dependency; mirrors existing umbrella adopt/link loops for root files.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(hooks): i18n reminder payload — en canonical / ru operator (+ principle-12 exempt hygiene) (#364)

* feat(hooks): i18n — split reminder payload into lang packs (en canonical / ru operator)

The two reminder hooks (ask-question-reminder, end-of-turn-reminder) emitted
Russian payload prose inline. Splits logic from payload: hooks keep all logic
and source a language pack (.claude/hooks/lang/{en,ru}.sh) selected by
AIF_HOOK_LANG (default en — canonical, for the public repo). Operator sets
AIF_HOOK_LANG=ru once globally in ~/.claude/settings.json.

- lang/en.sh + lang/ru.sh: aif_msg_* functions (${anchor} resolved at call time
  via dynamic scope) + AIF_RECAP_MARKER (recap heading; guard and message read
  the same var so they stay language-consistent).
- lang/check-parity.sh: deterministic, no-LLM guard against #two-prompts-drift —
  asserts both packs expose the same key set. Local/reviewer step, not a blocking
  gate (hooks are @cc-only, not shipped).
- Tests run the existing cases under AIF_HOOK_LANG=ru (RU-pack contract; Russian
  transcripts + assertions unchanged) + add an en-pack smoke per hook.
- RU payload byte-identical to before; EN is a faithful translation. Behaviour
  preserved (30/30 hook tests green).

Out of scope (surfaced): Russian code comments in the two hooks; other 11 hooks;
questions.ts strings. Spec: docs/superpowers/specs/2026-06-01-hook-lang-i18n-design.md

Prior-art: skipped — i18n refactor of existing internal hooks, no new capability (string externalization to lang packs, no dependency, no packages/ code module)

* test(principle-12): drop stale 'qloop-ux-probe' from EXEMPT_LIST

The qloop-ux-probe question-loop fixture dir (gitignored, added to EXEMPT_LIST
2026-06-01 by Finding F2) is gone — the positive-guard test correctly flagged it
as a stale exempt entry ("exempted but now absent"). Remove it per the test's own
instruction; 'aif-ssot-corrections' remains the sole exempt entry.

Surfaced while unblocking the hook-i18n PR's local pre-push (principle 12 runs on
gitignored kickoffs locally, skips in CI). Maintainer-invited in-session.

Prior-art: skipped — principle-test allowlist hygiene, no new capability (one stale entry removed from EXEMPT_LIST + doc comment)

* fix(runtime-bridge): bridge-cleanup §4 prunes MERGED container git junk (#365)

Enabling per-task worktrees (parallel_enabled, #362) makes aif RETAIN worktrees
post-terminal (research-patch 2026-06-01-aif-task-isolation.md §2.1), and the old
in-place task checkouts had already left 14 stale feature/* branches on the shared
checkout. The session janitor (#358/#359) deliberately did NOT touch container git.

§4 extends it to prune ONLY container git merged into origin/staging: git worktree
prune + remove retained non-main worktrees on merged branches + delete merged
feature/* branches. SAFE BY CONSTRUCTION — `git branch --merged` filtering AND
`git branch -d` (refuses unmerged) double-guard; unmerged in-flight work is never
touched. Also fixes the docker-exec stdin bug (needs -i for `sh -s` heredoc).

Completes the #359 "no manual/AI sweep" principle for container git state. This is
operator/co-located tooling (docker exec); the portable fix is upstream auto-removal
of retained worktrees (worth filing against lee-to/aif-handoff).

Live-verified on the real container: dry-run + real run deleted 7 merged branches
and preserved all 6 unmerged (+ the checked-out one). No unit test — matches the 4
untested sibling janitor scripts; safety is by-construction + live paired-evidence.

Prior-art: skipped — extends an existing janitor script (no new dependency, no new >=80 LOC file, not a capability commit); the parallel-worktree capability it cleans up after is #362/#109.

* feat(audit-self): bash-hook mutation testing — bash.rules + run-bash-mutation.sh (universalmutator ADAPT, local/on-demand) (#366)

Stage 2 B.2 of mutation-discipline-umbrella. ADAPTs universalmutator (MIT,
deterministic regexp engine + analyze_mutants harness — no LLM) to
mutation-test .claude/hooks/*.sh against their paired-negative vitest
tests. The only project-authored artefacts are bash.rules (operators), a
thin wrapper, and the wrapper's own paired-negative test. Delivery =
session-bound / local on-demand (NOT CI), mirroring Stryker-as-devDep;
the original kickoff B.3 CI job is dropped. universalmutator is a dev-time
tool, never consumer-shipped.

Dogfood gate (mandatory) surfaced real, undocumented test gaps:
end-of-turn-reminder 52% / validate-prompt 56% (both below the 60% floor)
— the &&/|| mutation of their suppress/skip conditions survives uncaught.
Recursive bootstrap: the wrapper mutated by its own operators is killed
13/13 by its own test. Found + fixed a /*-in-comment regexp-engine
limitation (bash globs in comments falsely trigger C-block-comment mode)
via a line-count-preserving sanitiser.

Evidence: docs/meta-factory/research-patches/2026-06-02-bash-mutator-b2-shipped.md

Prior-art: prior-art-evaluations.md#91 (universalmutator ADAPT — engine ADOPTed verbatim, only bash.rules operators authored; problem-class ~85% match per B.1 §B.1.5; mutahunter REJECTed on no-paid-llm-in-ci §1).

* feat(coordination): persistence-fix tail — SW-B symlink-aware helpers + G/B/C installer (#368)

* docs(coordination): design — cross-worktree persistence fix (4-channel: git-hook agnostic floor + CC + Superset + skill)

Brainstorm output for coordination-persistence-fix umbrella. T16 corrections:
- channel C substrate = Superset projects/<uuid>/config.json setup-array (rsync = root cause), NOT ~/.superset/hooks/
- adds git post-checkout (.husky) as the harness-agnostic floor per maintainer 'works everywhere' requirement
- Q3 atomicity already satisfied (mktemp+mv verified); SSOT #110 same anchor

Prior-art: skipped — design doc only, no new capability (extends link-coordination.sh SSOT #110).

* docs(coordination): correct §2.4 — helpers atomic but NOT symlink-preserving (mv replaces symlink)

Planning-phase finding (verified empirically): mv tmp <symlink> replaces the
symlink with a real file → Part-2 cross-worktree share lost on first cache write.
SW-B upgraded from 'confirm test' to 'make 3 helpers symlink-aware (write-through
resolved target)'. Atomicity preserved (temp+mv in target dir), symlink preserved.

Prior-art: skipped — design doc correction only, no new capability.

* docs(coordination): implementation plan — 4 sub-waves (A linker / B symlink-aware helpers / C wiring / D self-apply)

Prior-art: skipped — plan doc only, no new capability (implements SSOT #110 extension).

* feat(coordination): one-click install-coordination-wiring.sh (G+B+C, idempotent, self-test)

Applies all 3 wiring channels in one terminal command (maintainer runs from central repo):
  G  .husky/post-checkout            (agnostic floor)
  B  .claude/settings.json SessionStart
  C  ~/.superset/projects/*/config.json setup (replaces rsync root-cause)
--self-test (sandbox) + --dry-run modes; idempotent re-runs. Replaces the manual runbook.

Prior-art: skipped — scripts/ helper, not a capability commit (no dep, not under packages/); wires existing link-coordination.sh SSOT #110.

* fix(coordination): 3 cache/delta helpers symlink-aware (SW-B)

resolve_target() follows a symlink to its real $CANON target so the atomic
temp-then-mv write writes THROUGH the link instead of replacing it. Without this,
the first cache/delta write breaks the cross-worktree share (mv tmp <symlink> →
real file). +3 paired-negative tests (symlink preserved + canon written through);
18/18 green. Done locally (not via aif — container serialized on doc-audit task).

Prior-art: skipped — symlink-preservation fix to existing helpers, no new capability; extends link-coordination.sh SSOT #110 share semantics.

* docs(coordination): drop channel A (skill self-heal) — redundant after G git-hook

B (CC SessionStart) fires at every session start ⊇ 'when meta-orchestrator runs',
and G (git post-checkout) is the real agnostic floor A was standing in for.
Final channel set = G + B + C, wired via install-coordination-wiring.sh.

Prior-art: skipped — design doc scope-reduction, no new capability.

* fix(runtime-bridge): bridge-cleanup §4 skips while aif has live tasks (no ref-lock contention) (#367)

§4 (container git prune, #365) runs git fetch / worktree prune / branch -d in the
SHARED .git. A task running concurrently touches the same ref + packed-refs locks
(amplified by parallel_enabled keeping multiple tasks active) → a collision yields
"cannot lock ref" and can fail the live task's git step.

Guard: GET /tasks, count non-terminal (not done/verified/cancelled); if >0, skip §4
with a clear note ("re-run when idle"). Deterministic, no AI. Fail-open (count unknown
→ 0 → proceed) — §4 is already merged-only safe-by-construction, so this is defence-in-
depth; worst case of a false 0 is a transient lock retry, never corruption or data loss.

Live-verified: with 2 non-terminal tasks running, `--dry-run` §4 printed "skipped — 2 live".

Prior-art: skipped — edits an existing janitor script (no new dependency, no new file, not a capability commit); guards the #365 sweep against the #362 parallel_enabled concurrency window.

* feat(coordination): commit channels G + B (post-checkout + CC SessionStart) (#369)

Makes the two machine-agnostic wiring channels durable + shared (were applied
locally by install-coordination-wiring.sh). Both call link-coordination.sh (SSOT #110):
  G  .husky/post-checkout       — agnostic floor, fires on git worktree add
  B  .claude/settings.json      — CC SessionStart re-heal
Channel C (Superset setup-array, per-UUID) stays installer-only. SW-D liveness:
G verified live — fresh worktree auto-linked 287 files.

Prior-art: skipped — wiring of existing link-coordination.sh SSOT #110 into hook channels, no new capability.

* docs(research-patches): doc-audit-ship-boundary Stage 2 findings + gitignore stryker sandbox (#371)

Autonomous aif audit (task bcb2c6c2): full doc-vs-reality + vs-goal reconciliation,
Stage 2.0 mutation-run fuel, DECISION-NEEDED batch (DN-1..4), §A self-classification.
Audit-only — no maintainer-owned edits landed. Also gitignore packages/core/.stryker-tmp/
so mutation runs never pollute the tree (root cause of PR #370 contamination).

* test(hooks): close mutation gaps in end-of-turn-reminder + validate-prompt (B.2 dogfood follow-up) (#373)

The Stage 2 B.2 bash mutator (#366) surfaced two hook tests below the 60% kill
floor: end-of-turn-reminder (52%) and validate-prompt (56%). Add targeted cases
that kill every NON-equivalent surviving mutant:

- end-of-turn-reminder 52% → 69%: cover the previously-untested idle-suppress
  re-ping guard (hook:135-156) — suppress-on-reping, fire-on-new-question,
  long-answer-overrides-suppress, the B2 "an AskUserQuestion turn is never
  idle-suppressed" contract — and the bare non-question tool-call early exit
  (hook:53-54). The 10 residual survivors are equivalent mutants: 7× `|| true`
  → `&& true` inside `$(…)` command-substitutions (stdout unchanged, exit
  ignored under set -uo, no -e), the transcript-validity guard (both paths exit
  0/empty for the only diverging input), `set -e`→`set +e` (hook never relies on
  errexit aborting), and the inner re-ping AND→OR (divergence requires
  prev==last+recap, which trips the self-recap guard first). All 22 killable
  mutants are killed.
- validate-prompt 56% → 78%: deterministically exercise the tsx-unavailable
  graceful-skip (hook:26-27, isolated-root copy) and the jq-unavailable
  graceful-skip (hook:14-16, fake-bin PATH without jq). The 2 residual survivors
  are gh+validator-coupled (hook:21 off-path-proceeds-to-validator, hook:33
  validator-result) — killable only with a live-gh 404 test, which is
  non-hermetic; left per T-MUT-B rather than shipping a flaky test.

Test-only; no production hook modified. Follow-up to #366
(mutation-discipline-umbrella Stage 2 B.2).

* docs(doc-audit): apply DN-1/2/4 doc-staleness fixes + ship the fixer tooling (#374)

doc-audit-ship-boundary Stage 2 — maintainer decisions 2026-06-02, applied.

Applied (maintainer-directed, DN-1/2/4):
- .claude/rules/rule-enforcement-channel-selection.md: 'Activation pending' →
  'Activation confirmed — settings.json:114' (Class header + §4 prose); the
  PostToolUse Edit|Write hook is wired (verified settings.json:114).
- README.md badges: ?branch=main → ?branch=staging (main=prod, CI runs on staging).
- README.md enforcement chain: drop false 'Stryker' from the CI channel —
  mutation tests are local/session-bound, NOT a CI gate (no workflow runs Stryker).

Tooling shipped alongside:
- scripts/apply-doc-fixes.sh: idempotent, terminal-runnable fixer (re-applies the
  above; --check dry-run). packages/core/hooks/apply-doc-fixes.test.ts: 5 green.
- docs/meta-factory/mutation-run-placement.md: DN-4 placement note (mutation local;
  ps/jq/universalmutator reqs).

Prior-art: skipped — maintainer-directed doc-staleness fixes + their fixer tool +
a placement note; no new runtime capability, no dependency, no packages/ code module.

* test(principle-12): raise population-sentinel bounds 10..100 → 100..300 (#375)

The principle-12 population sentinel capped local kickoff dirs at 100. The project
legitimately accumulated >100 umbrellas of history, mirrored locally by the
coordination-persistence channel (G, .husky/post-checkout → link-coordination.sh),
so the ≤100 guess tripped the pre-push on every worktree. Raise to ≤300 (still
catches a runaway glob) and ≥100 (doubles as a 'mirror present' guard). The
sentinel is skipped in CI (KICKOFFS_AVAILABLE) — it only gates local pre-push.

Maintainer-directed 2026-06-02. Does NOT resolve the separate citation-check vs
symlink-mirror interaction (the broader principle-12-vs-G item) — bound only.

Prior-art: skipped — adjusts a sentinel bound in an existing principle test to
match reality; no new capability, no dependency, no new module.

* test(principle-12): citation check ignores coordination-mirror kickoffs (#376)

Citation check re-ran on every umbrella mirrored in by channel G (post-checkout →
link-coordination.sh symlinks gitignored kickoff.md into $CANON), failing on
historical umbrellas this worktree never authored (principle-12-vs-G). Fix: check
only REAL (non-symlink) kickoff.md = locally authored. Population sentinel still
counts the FULL set as a mirror-present guard. Pairs with #375 (bound→100..300).

Prior-art: skipped — narrows an existing principle-test filter to exclude symlink
mirrors; no new capability, no dependency.

* docs(spec): aif parallel autonomous dispatch — verified model + open test (brainstorm 2026-06-02) (#377)

Captures the full session conclusions so they survive: the depth-2 architecture insight
(subagents don't spawn subagents → quality parallel needs separate top-level sessions, meta-
orchestrator decides), the verified aif model (1 kickoff/meta-launch → 1 task; each task = top-
level session; flat task model; two parallelism layers L1 cross-task worktrees / L2 within-task
use_subagents→implement-coordinator; use_subagents=0 everywhere = why never parallelized;
worktree-skip is documented per docs/configuration.md), the observable test signal
(agent_activity_log 'Subagent: <name> started', subagentQuery.ts:793), the decision tree, the
OPEN question gated on one live test (use_subagents top-level launch), an honest flip-flop
corrections log, and decisions (planner-owns-plan, COORDINATOR_MAX knob, park preserved).

NOT a final spec — gated on the §5 live test on a genuinely-parallel task (D.1-D.5).

* chore(harvest): commit reworked aif task 5767f7df-7425-4a78-a76f-98402c1647d0 — mutation-discipline-stage-c-meta-launch (#378)

* docs(spec): aif parallel dispatch §5 RESOLVED — YES via use_subagents (live proof) + M3-bash timeout fix (#380)

* docs(spec): aif parallel dispatch §5 RESOLVED — YES, self-parallelizes via use_subagents (live 2026-06-02)

Live test (task a37ee2f5): use_subagents=true on a real 5-task plan (mutation
Stage 4 D.1-D.5) → implement-coordinator launched top-level (--agent) → fanned
out 5 concurrent implement-worker subagents, each worktree-isolated. Proof:
5x `Tool: Agent {subagent_type:implement-worker}` spawns + git worktree list
1→6 (5 locked worker worktrees coexisting, ~2min all-5 overlap) + 5 distinct
real test files written simultaneously.

Also corrects §3.7 observable: `Subagent:` log line is SDK-transport-only
(onSubagentStart wired only via SDK SubagentStart hook); on transport=cli it
stays 0 even under full parallelism — a false-negative trap. Valid CLI-transport
observables = git worktree growth + `Tool: Agent` activity entries.

Design consequence = the tiny change: bridge sets use_subagents=true at dispatch
for depth-2-sufficient umbrellas + meta-orchestrator emits plan-structured
kickoffs (independent numbered Task items, no Phase headings).

Prior-art: skipped — design-doc update only, no new capability/dependency/code-module.

* test(principle-02): give M3-bash mutation gate a 60s timeout (was default 5000ms)

The [M3-bash] local/on-demand gate (describe.skipIf(!HAS_UM)) calls
runBashMutator → spawns `npx vitest` once per mutant, ~9.5s on a loaded host.
The default 5000ms vitest timeout false-fails it at pre-push (blocking unrelated
pushes; observed this session). Add an explicit 60_000ms timeout — mirrors the
Stryker precedent (principle 11 testTimeout 5s→30s). No assertion/semantics
change; CI still skips it (no universalmutator).

Prior-art: skipped — test-timeout fix for an existing gate, no new capability/dependency.

* test(mutation-discipline-stage-d): paired-negative tests for 5 remaining .sh helpers (#381)

Stage 4 D of the mutation-discipline umbrella — content-level paired-negative
vitest tests (M.4 pattern) for the .sh files that lacked them:
- priority-score.sh        → priority-score-synthetic.test.ts   (20 it, 53 expect)
- plan-currency-check.sh   → plan-currency-check-kickoff.test.ts ( 6 it, kickoff-existence angle; non-redundant w/ existing)
- launch-table-generator.sh→ launch-table-generator.test.ts     (11 it)
- check-skill-drift.sh     → check-skill-drift.test.ts          ( 6 it)
- pre-push.fallback.sh     → pre-push.fallback.test.ts          (20 it)

Produced by the aif self-parallel-dispatch live test (5 concurrent implement-workers,
use_subagents=true) and verified by an independent 5-way adversarial cold-review
(T19): all real-script-invoked (spawnSync bash on the actual .sh), content-level
assertions (exit code + stdout/stderr, no shape-only .toBeDefined), anti-tautology
confirmed. Fixed one over-reaching T12-compliance comment in priority-score
(claimed 8 surfaces verified; only 5 are — now honest + deferred-gap note).

Known deferred coverage gaps (honestly disclosed, follow-up): launch-table
fallback+no-keyword path; pre-push 2 of 3 discipline-file patterns;
priority-score surfaces (c)/(d)/(h). 52/52 tests green.

Prior-art: skipped — test additions for existing .sh capabilities, no new runtime capability/dependency.

* research(mutation-discipline-d6): verdict on deps-hash-check.sh duplication (#382)

D.6 R-phase (mutation-discipline umbrella). Investigates the two byte-identical
deps-hash-check.sh copies. Verified roles (T3, file:line): packages/core/hooks/
= shipped SOURCE (install.sh:261), .claude/hooks/ = this repo's DOGFOOD copy
(settings.json:74). Key finding: deps-hash-check.test.ts:34 tests the DOGFOOD
copy, not source → silent drift possible (test stays green if source diverges).

Verdict (b) keep-both + drift-check: add @dual-pair markers + a byte-identity
assertion test — REUSE the existing dual-implementation @dual-pair convention
(SSOT #87) rather than BUILD. Symlink (a) rejected (install.sh --force regression
+ Windows). Concrete I-phase fix path + falsifiers included. R-phase only — no
edits to the .sh files / settings.json / install.sh.

Produced autonomously by aif (use_subagents=0, single R-phase task) + cold-reviewed.

Prior-art: skipped — research-patch (markdown), no new capability/dependency/code.

* fix(hooks): drift-check for deps-hash-check.sh source/dogfood pair (D.6 I-phase) (#383)

Implements #382 §6 verdict (b) keep-both + drift-check. Adds
@dual-pair: deps-hash-check-dogfood markers (identical block, preserving
byte-identity) to both the shipped SOURCE (packages/core/hooks/) and this
repo's DOGFOOD copy (.claude/hooks/), plus a byte-identity assertion in
deps-hash-check.test.ts.

Closes the silent-drift hole the D.6 R-phase confirmed: the functional tests
exercise only the dogfood copy (HOOK), so they stayed green even if the source
diverged. Falsifier verified — breaking one copy turns the new test red.

Corrected #382 §6's asymmetric-marker spec (4-line block to dogfood vs 1-line
to source), which would itself have broken the byte-identity the test asserts;
both copies carry the identical block.

Last residual of the mutation-discipline umbrella; closure (done.md + memory)
follows on merge.

Prior-art: prior-art-evaluations.md#87 (worktree-create-setup dual-pair, SSOT BUILD — this commit extends the @dual-pair pattern with a second pair; no new mechanism introduced).

* docs: R-phase — why per-task worktrees never materialize (corrects #360 Finding A) (#372)

* docs(runtime-bridge): R-phase — why per-task worktrees never materialize (corrects #360 Finding A)

Live falsifier of #360 Finding A: 0 tasks ever got a worktree despite parallel_enabled=1.
Root cause (verified source, correct containers): the bridge dispatches via a planner-SKIP —
POST /tasks/:id/events {event:'accept_existing_plan'} — which transitions backlog→plan_ready
SKIPPING the `planning` status (stateMachine.ts case accept_existing_plan, api container).
The coordinator runs runPlanner ONLY for the planning stage (coordinator.ts PIPELINE
from:["planning"], agent container). The ONLY worktree-creation code lives in runPlanner
(planner.ts:191-213). ⇒ bridge tasks never run the planner → never create a worktree,
regardless of parallel_enabled / AIF_TASK_WORKTREES_ENABLED / plannerMode.
Secondary: handleAcceptExistingPlan also persists branchName (taskEvents.ts:236+) so even if
the planner ran, planner branch-2 (in-place restore) would pre-empt branch-3 (worktree).

Verdict: parallel_enabled=1 (#360/#362) is NECESSARY BUT NOT SUFFICIENT. Fix options:
B = drop accept_existing_plan from bridge dispatch + let the coordinator run the planner;
C = accept serial in-place as the operating mode with the existing rollback guard.
Both deferred to a follow-up I-phase (DECISION-NEEDED). gate-3 passes; mode-change is NOT
the fix (server already forces full). Effort + falsifier per finding in the patch.

R-phase only — no production code changed. DeepWiki x3 (converged) + verified file:line in
both aif containers. Scope annotation (principle 10) + §1.7 (principle 13).

* docs(runtime-bridge): §0.1 — worktree-skip is DOCUMENTED aif behaviour (docs/configuration.md), not a trap; no upstream issue

DeepWiki x3 (converged): docs/configuration.md ties worktree creation to full-mode
planning by design; docs/architecture.md documents the serial-forcing. So planner-skip
forgoing the worktree is a documented consequence, not a defect — no upstream issue.
Records the search-coverage lesson: the #360 verdict was avoidable by reading aif's own
config docs. The corrected fix (run the planner) is the documented isolation+parallel path.

* docs(wave-plan): reconcile §0 → 2026-06-02 (#298→#382) + codify how §0 stays current (#384)

Manual status reconciliation per the design loop (detect via /meta-orchestrator,
write by human-directed session — Direction A auto-write rejected at R-phase).

- §0 + Status dates 2026-05-29 → 2026-06-02
- correct misleading aif-handoff DEFER-ALL row: add `runtime-bridge BUILD` row
  (minimal-REST bridge shipped #312/#313 + ecosystem; supersedes-in-practice)
- +8 umbrella rows for work merged since last reconcile (runtime-bridge,
  aif task-isolation, companion adoption, coordination-persistence, qloop,
  mutation-discipline, worktree dual-channel, doc-audit-ship-boundary)
- add "Open frontier" block (live: #372 open, inject-layer-extension,
  one-click-installer, f2-aif-fire-backend) — distinct from ~80 closed candidates
- add "How §0 stays current (by design)" note to Status block so future
  sessions don't try to automate the deliberately-manual reconciliation

Prior-art: skipped — doc-only status reconciliation of an existing planning doc, no new capability or dependency introduced.

* chore(orchestrator): mark mutation-discipline-umbrella DONE (#385)

Umbrella closure per CLAUDE.md "Umbrella closure convention" — Final PR #383
(D.6 drift-check, last residual) merged to staging. All stages shipped:
A audit #219 / B bash-mutator #366+#373 (dogfood gate fired) / C tests-of-tests
#378 / D #381 + D.6 dup R-phase #382 + D.6 drift-check I-phase #383.

done.md is the priority-score.sh Layer C3 completion marker (gitignore:14
un-ignores */done.md).

Prior-art: skipped — completion marker (done.md), no new capability/dependency/code.

* fix(principle-12): skip anti-tautology mutation test when no real (non-mirror) kickoffs exist (#386)

The anti-tautology sub-test mutates a REAL compliant kickoff to verify the
compound-citation detector actually catches absence. After the coordination
symlink migration (#346 + post-checkout link-coordination.sh), every local
kickoff.md is a SYMLINK into $CANON — a coordination mirror that
getNonExemptEntries() deliberately excludes (isCoordinationMirror). With all
kickoffs mirrored, getNonExemptEntries() is empty → `compliant` is undefined →
`expect(compliant).toBeDefined()` failed on every host push (reproduced on
staging HEAD, independent of any feature branch).

The #376 mirror-exclusion fix updated the main check + population sentinel but
missed this meta-test. Guard it with HAS_REAL_NONEXEMPT_KICKOFF: when there is
no real kickoff to mutate, skip — detector correctness is already covered by the
pure-logic anti-tautology tests (blank file / each pattern), which need no files.

Unblocks all host pushes (pre-push runs the principle suite). No behaviour change
to the citation enforcement itself.

* fix(runtime-bridge): dispatch via planner-run so each task gets its own worktree (parallel) (#387)

The bridge dispatched tasks with `accept_existing_plan`, which transitions
backlog -> plan_ready SKIPPING the `planning` stage. runPlanner (planner.ts,
the ONLY code that creates a per-task git worktree) runs only at `planning`,
so 0 tasks ever got a worktree -> all dispatched tasks forced serial. Verified
+ live-proven in #372 (research-patches/2026-06-02-aif-worktree-gap.md).

Fix (Option B, live-verified 2026-06-03):
- Drop the `accept_existing_plan` event. The task stays at `backlog`; the
  auto-queue advances it through `planning` -> runPlanner -> per-task worktree.
- Carry the kickoff in `description` (the planner INPUT spec, planner.ts:246),
  NOT in `plan` (the planner OUTPUT slot @planPath, which it overwrites). The
  planner plans the *how* from our kickoff *what*.

Live acceptance: two tasks dispatched concurrently each got a DISTINCT
worktree and both ran in `planning` simultaneously (N agents x N workspaces,
not within-task subagents). Throwaway probe tasks + worktrees cleaned up.

Tests: rewrote the dispatch sequence test for the 2-step flow (asserts
description=kickoff, no accept_existing_plan, no plan push) and moved the
rollback test's failure point to the unpause step. 8/8 green.

Prior-art: skipped — modifies existing bridge file, no new capability/dependency/module.

* research(aif-operator-asset-access): R-phase — gap verification + A-E verdict + recommended composition (#388)

Five gap rows re-confirmed with file:line evidence. Existing skill-context/ and agents/*.md
mechanisms audited (T16 problem-class check) — none cover orchestrator/reviewer discipline.

Recommended composition: B+D (in-repo agnostic worker discipline, primary) + A (operator
bind-mount, immediate) + C (buildKickoffSpec sibling inlining, follow-on). E rejected.
DN-1/2/3 surfaced; DN-1/2 resolved inline (B scope = minimum viable worker discipline;
reviewer-discipline = separate concern covered by review-sidecar.md).

Prior-art: prior-art-evaluations.md#67 (aif-handoff, ADOPT — this umbrella extends it with
operator-asset bridging); prior-art-evaluations.md#50 (skill-context/aif-review SSOT,
ADOPT channel — D reuses this delivery pattern).

* fix(meta-orchestrator): Stage 2 correctness — C1.1/C1.2/C1.3/M4/F2/F7 (#389)

Six confirmed bugs fixed in the meta-orchestrator skill:

C1.3 — SKILL.md:449: stale repo-root mirror claim removed; replaced
  with "Ships directly from .claude/skills/meta-orchestrator/ via
  install.sh (single source of truth; no repo-root mirror — Item 12
  closure 2026-05-25). Install pattern at install.sh:236-255."

C1.2 — SKILL.md:508: state.md section names corrected from stale
  "§2 Launch-table / §3 Dispatch log" to actual template names
  "§2 Decisions / §3 Phase -1 verdict" (state.md.template:26,35).

C1.1 — master-backlog-delta.md:49-52: "Body owns arrays — inline-jq"
  claim removed (inline jq was removed in F.3 PR #261 2026-05-28);
  delta-write-from-state.sh correctly attributed as array owner.

M4 — SKILL.md:521-525: delta two-helper ordering fixed. update-delta.sh
  (bootstraps schema) now listed first, matching delta-write-from-state.sh:19.

F2 — SKILL.md:71: head -200 raised to head -400; wave-sequencing-plan.md
  is 293 lines so head -200 dropped 93 lines incl. §6 dependency-matrix.

F7 — run-helper.sh:26: timeout wrapped (MO_HELPER_TIMEOUT env, default 120s);
  END trailer still fires on expiry (rc=124). failures.md: F9 added.

Prior-art: skipped — correctness fixes to existing prose/helper, no new capability

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat(aif-worker-discipline): portable worker discipline agent + AIF skill-context delivery (#390)

* feat(aif-worker-discipline): portable worker discipline agent + AIF skill-context delivery

Artifacts 1 (B) and 2 (D) from aif-operator-asset-access I-phase.

- agents/orchestrator-worker-discipline.md: portable AI-agnostic worker
  discipline (REPORT schema, park-vs-proceed, stage-gate, §1.7 PR body)
  for aif-dispatched workers. Class B. @dual-pair: aif-orchestrator-discipline.

- packages/core/templates/shared/skill-context/aif-orchestrator-discipline/SKILL.md:
  AIF-native delivery of the same content. YAML from aif-review/SKILL.md (SSOT #50).
  @dual-pair + spec: per dual-implementation-discipline.md §5.

- packages/core/principles/09-doc-authority-hierarchy.ts: added
  aif-orchestrator-discipline/SKILL.md to REQUIRED_HEADER_DOCS (shippedSubset 16→17).
  Upper sentinel 60→65; Wave-4 length sentinel 16→17.

- install.sh: aif-orchestrator-discipline/SKILL.md added to SHIPPED_DOCS.

§1.7: forward — agents/orchestrator-worker-discipline.md:9 authority header per
doc-authority-hierarchy.md §3; install.sh:103 in sync with REQUIRED_HEADER_DOCS
per 09-doc-authority-hierarchy.test.ts:164 Wave 4 invariant. backward —
SKILL.md:10-11 carries @dual-pair + spec: per dual-implementation-discipline.md §7.

Prior-art: prior-art-evaluations.md#50 (skill-context/aif-review, ADOPT channel pattern).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(runtime-bridge): add operator convenience bind-mount section for global skills

Adds '## Operator convenience: mount global skills' section at the end of
docs/runtime-bridge-setup.md documenting how to bind-mount operator-side
global skills (~/.claude/skills/orchestrator/, Superpowers plugins) into
the aif container via docker-compose.override.yml.

Operator-axis only — consumers of the shipped framework are NOT required to
have these paths. The shipped in-repo discipline works without the mount.

Artifact 3 (A-docs) from aif-operator-asset-access I-phase.

Prior-art: skipped — doc addition, no new capability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* docs(meta-orchestrator): add harvest egress step to autonomous dispatch loop (#391)

aif does NOT push or open PRs by design (documented in harvest.ts:11-14).
Nothing in the dispatch loop said "after status=done → call harvest" — this
was the gap that caused the aif-operator-asset-access I-phase to sit stuck
in the container with work done but no PR opened (incident 2026-06-03).

Fix: add egress gate to SKILL.md §5 autonomous dispatch row and to
meta-kickoff.template.md §4c so every generated kickoff carries the
harvest call as a mandatory post-done step.

Anti-pattern #autonomous-done-no-harvest added to SKILL.md §5.

Prior-art: skipped — doc-only change to .claude/skills/ and templates/,
no new capability (refactor only, harvest.ts already shipped).

* chore(orchestrator): mark aif-operator-asset-access DONE (#392)

* docs(m…
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