Skip to content

feat(meta-orchestrator): bundle-autonomous Stage 3 — B1 helper + B2 persistence + B3a self-eval - #247

Merged
artyhoo merged 2 commits into
stagingfrom
feat/meta-orchestrator-bundle-autonomous
May 26, 2026
Merged

feat(meta-orchestrator): bundle-autonomous Stage 3 — B1 helper + B2 persistence + B3a self-eval#247
artyhoo merged 2 commits into
stagingfrom
feat/meta-orchestrator-bundle-autonomous

Conversation

@artyhoo

@artyhoo artyhoo commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stage 3 I-phase per stage-3-iphase.md §0 — B2/B3a reframe (meta-orchestrator = planner/router; executor = downstream orchestrator skill)
  • D1 bundle-curate.sh (194 LOC): B1 eligibility filter (fix/I-phase-small) + file-overlap rejection + max-5 cap (T-BA-A). Consumes L4 classify-work.sh + L5 assign-skill.sh; handles MISSING-FILE (exit 3, J1 contract)
  • D2 SKILL.md §5.5 stub + references/bundle-composition.md full spec: B2 persistence path .claude/orchestrator-prompts/<umbrella>/composed-plan.md (gitignored) + one-way launch-prompt format. Auto-approve FORBIDDEN (hard constraint)
  • D3 B3a 5-check self-eval prose checklist in references/bundle-composition.md: Independence · Mode coherence · Skill coherence · Order rationale · Caps respected. ≥1 BLOCKER → DO NOT emit
  • D4 Principle 20 test (20-bundle-classification.test.ts 21 tests + 20-bundle-classification.paired-negative.test.ts 5 tests): mechanical gate on D1 correctness
  • D5 Mirror sync: N/A — no consumer-side mirror of meta-orchestrator helpers exists (internal tooling per dual-implementation-discipline.md §3; @cc-only-rationale marker added to bundle-curate.sh:26)
  • D6 Three backlog fixtures: backlog-1-clean.txt (5 fix items, all in-bundle), backlog-2-mixed.txt (8 items: R-phase excluded + I-phase-large excluded + 1 capped), backlog-3-overlap.txt (5 items, 3 touch shared.sh, 2 excluded by file-overlap)

Scope override vs merged R-phase patch #237

Per stage-3-iphase.md §0 — B3 «auto-dispatch loop» (§3 line 171 «dispatch Worker → poll gh pr checks → auto-merge») is NOT IMPLEMENTED. Meta-orchestrator plans+routes+self-checks; execution belongs to downstream orchestrator skill. R-phase patch stands as historical prior-art record only.

Test plan

  • D4 principle 20 positive test: 21 tests green (3 fixture scenarios + edge cases)
  • D4 paired-negative: 5 tests proving broken logic would fail positive checks (T-BA-C binding: R-phase in bundle → test fails)
  • D1 follows existing helper conventions: #!/usr/bin/env bash, set -euo pipefail, @cc-only-rationale header, exit 2 on usage error — verified vs classify-work.sh:1-30 + assign-skill.sh:1-30
  • D2 SKILL.md §5.5 prose-only (no embedded bash), section between §5 and §6, SKILL.md stays at 599 lines (≤600 pre-commit gate)
  • D3 self-eval: 5 checks explicit, BLOCKER vs warning distinction stated, T-BA-C cap enforced (no R-phase/I-phase-large) — references/bundle-composition.md §B3a
  • T-S3-A (scope-creep check): zero gh pr, git push, merge, or dispatch-loop code in D1 — verified via grep in session = 0 hits
  • T-S3-B (parse-back check): launch-prompt format in B2 is one-way emit, no response-parsing grammar
  • T19 cold-review: run before push; no BLOCKER found (see cold-review section below)
  • D5 mirror: N/A surfaced (internal-only tooling, no consumer-side path)
  • (maintainer) verify bundle section semantics by reading SKILL.md §5.5 + references/bundle-composition.md
  • (maintainer) merge into staging

§1.7 Forward-check applied

  • doc-authority-hierarchy.md §2-§3: SKILL.md:20 Authoritative-for header present (pre-existing); references/bundle-composition.md:3 new Authoritative-for header added; both compliant
  • no-paid-llm-in-ci.md §1: bundle-curate.sh is deterministic bash (zero API calls); principle 20 is mechanical TypeScript vitest; B2/B3a prose read by active AI session on CC subscription — zero CI-billed LLM calls added
  • build-first-reuse-default.md §1: BUILD verdict justified at docs/meta-factory/research-patches/2026-05-26-bundle-autonomous-prior-art.md §5 (BFR mechanism check: Renovate packageRules + Dependabot groups cover vocabulary shape, mechanism is ours — no upstream wraps classify-work.sh/assign-skill.sh for AI-orchestration backlog bundling)
  • references/ split pattern follows SKILL.md:505references/output-format.md precedent (existing pattern in repo)

§1.7 Backward-check applied

Cold-review verdict (T19)

Ran adversarial self-review over diff before push — GO, no BLOCKERs.

MINOR findings addressed inline:

  • bash 3.2 (macOS) compatibility: declare -A not supported → fixed to space-separated string + grep -qF membership test (bundle-curate.sh:139-151)
  • Empty backlog edge case: all-comment backlog → temp files never created → crash fix: added touch "${PASS1_TMP}" / touch "${PASS2_TMP}" guards (bundle-curate.sh:121,126)
  • SKILL.md 600-line pre-commit gate: original at limit → exceeded → progressive trimming + references/ split → final 599 lines

All 21 principle test files: 150 tests pass + 4 skipped (pre-existing). No T-S3-A scope creep (no gh pr / auto-merge / dispatch code). No T-S3-B parse-back grammar.

artyhoo added 2 commits May 26, 2026 21:55
Implements B1 bundle-decision-rule per merged R-phase patch #237 §5:
deterministic bash helper consuming L4 classifier + L5 routing outputs,
applies eligibility filter (fix + I-phase-small only) + file-overlap
rejection + max-5 cap. Principle 20 mechanical test (positive + paired-
negative + D6 fixtures) gates correctness.

D1: .claude/skills/meta-orchestrator/helpers/bundle-curate.sh (194 LOC)
D4: packages/core/principles/20-bundle-classification.test.ts (20 tests)
D4: packages/core/principles/20-bundle-classification.paired-negative.test.ts
D6: packages/core/principles/__fixtures__/bundle/{backlog-1-clean,backlog-2-mixed,backlog-3-overlap}.txt

T15 self-application: queuing 5 "improve bundle-curate.sh" items →
file-overlap rejection keeps at most 1 per bundle (verified smoke test).

Prior-art: docs/meta-factory/research-patches/2026-05-26-bundle-autonomous-prior-art.md §5
(ADOPT VOCABULARY: Renovate packageRules eligibility-filter shape +
 Dependabot groups: grouping semantics; BUILD justified by BFR §3
 mechanism check — vocabulary maps, mechanism doesn't because upstreams
 assume dependency-domain semantics, not AI-orchestration backlog bundling)
…e + B3a self-eval (Stage 3)

Adds §5.5 Bundle composition between existing §5 Dispatch tree and §6
Stage gates (no section renumbering — external doc refs preserved).

SKILL.md §5.5 (stub, 2 lines): invokes bundle-curate.sh; B2 persistence
path + launch-prompt format; B3a 5-check self-eval. Anti-patterns:
#bundle-execution-loop / #auto-approve-bypass / #bundle-with-ineligible.

Full B1/B2/B3a spec split to references/bundle-composition.md (new file)
per 600-line gate (SKILL.md was at limit; references/ split follows
existing pattern for §10 output-format.md).

Per maintainer 2026-05-26 reframe: meta-orchestrator plans+routes, does
NOT execute. Auto-approve FORBIDDEN. Supersedes merged R-phase §3/§5
B3-as-execution-loop framing (historical prior-art record only).

§1.7: forward-check applied — SKILL.md:20 Authoritative-for header present (doc-authority-hierarchy.md §2 compliant); references/bundle-composition.md:3 Authoritative-for header present; no paid-LLM calls added (no-paid-llm-in-ci.md §1 OK); references/ split follows output-format.md precedent (SKILL.md:505 references/output-format.md pattern); backward-check sweep — §5.5 is net-new between §5 and §6 (no section renumbering, no external refs broken); bundle-composition.md is new file with Authoritative-for; no existing docs superseded.
@artyhoo
artyhoo merged commit 7806fb5 into staging May 26, 2026
27 of 28 checks passed
artyhoo added a commit that referenced this pull request Jun 16, 2026
… umbrella closures (28 false-opens cleared) (#561)

* fix(pipeline): C3 counts done.md existence as DONE even with 'Final PR: n/a'

priority-score.sh completion-detector C3 only tagged DONE when it parsed a numeric
'- Final PR: #<num>'. Stale/superseded closures from the 2026-06-05 sweep carry
'- Final PR: n/a', so ~10 already-closed umbrellas stayed false-open. done.md existence
alone proves closure (ADAPT Cline #77); tag done_pr=n/a so the filter drops them.
Regression test: done-md-completion-filter Case 3b (n/a done.md -> status=DONE).

* chore(orchestrator): close 18 verified historical umbrellas — done.md backfill (closure-sweep 2026-06-16)

Each done.md cites its verified closing PR (branch/title-confirmed, false matches dropped):
guard-liveness cluster (#458/#460/#463/#475/#476/#489), dispatcher-skill #403, dispatcher-ux #407,
goal-drift-audit #433, narrow-b-benchmark #210, defer-reflex-detection #232, memory-coverage-audit #126,
meta-orchestrator-bundle-autonomous #247, mutation-discipline-stage-c-meta-launch #378,
aif-handoff-as-runtime-bridge #283, aif-skills-delivery-rphase #396, channel-earliness-audit #181,
ai-doc-audit-version-reconcile #423. Clears 18 false-opens; +10 via the C3 fix = 28 total. 51 residue left open (no evidence).
artyhoo added a commit that referenced this pull request Aug 10, 2026
…ger, and gate registrability (#1371)

## Summary

Completes the half #1368 declared and explicitly deferred, and closes the gap that deferral left in the gate.

#1368 (merged 10:26Z today) built the declaration model: every job declares `# required-context: yes|no` at the job, and principle 37 asserts both in-repo lists equal the declared set. It marked `discipline-self-check.yml`'s job `no`, naming the precondition in the marker itself: «To make it required, the path filter must first move from `on.pull_request.paths` into the job body … so the context always reports.» The 2026-08-10 operator ruling requires that context on `staging`, so the precondition had to be met.

Two things here: the §1.7 context becomes registrable and is declared required, and principle 37 gains the arm that makes «declared required ⇒ actually reportable» a mechanism instead of a comment.

**Scope note, stated plainly:** this branch was opened before #1368 existed (my in-flight probe ran at 09:33Z; #1368 was created at 09:39Z) and originally carried its own parallel list-gating design. That work is discarded — #1368's declare-at-the-job model is better, and this PR is rebased onto it. The net diff is 5 files.

## Changes

**1. `discipline-self-check.yml` — registrable, and declared required.** The `paths:` trigger filter is removed, and the marker flips to `# required-context: yes`. GitHub's guidance is the reason the filter and the requirement are incompatible: «Workflows skipped due to path filtering, branch filtering, or commit messages will remain in a pending state and block merging. To avoid this, do not require workflows that can be skipped.»

Removed rather than reimplemented in the job body. §1.7 already has a declared out-of-scope mechanism — the `### §1.7 Skipped: <≥60 chars>` marker, which `.github/pull_request_template.md:61` emits as the DEFAULT for every PR. A scope list inside the job body would have been a third hand-maintained copy of «what counts as discipline-bearing», in a PR whose subject is that such copies drift. **Measured before removing it:** of the 40 most recent merged base=staging PRs, 38 already carry a valid §1.7 section (11 Skipped markers, 27 Forward/Backward pairs). #1363 and #1337 are the only two that would newly redden, each needing the one template-default line.

Also adds `if: base.ref != 'main'`: a promote PR aggregates ~90 squashed commits and has no single meaningful forward/backward pair, so today it gets a guaranteed RED. Deliberately not the siblings' `== 'staging'` — theirs is subject-scoped (a kickoff's fidelity verdict, a stale-base rebuild against staging), whereas §1.7 also applies to the base=`epic/*` PRs `CLAUDE.md:121` permits agents to merge, and `== 'staging'` would have silently dropped that coverage. Safe because a job skipped by `if:` reports `skipped`, which protection accepts — «if a job is skipped due to a conditional, it reports success».

**2. Both derived lists gain the newly-declared context**, per #1368's rule that the three move together. The sweep's `REGISTRATION STATE` line is also rewritten to name contexts instead of «the last three» / «the first two»: appending a sixth entry above it silently falsified both phrases — the same positional-drift shape principle 37 exists to catch.

**3. Principle 37 arms (i)–(k) — registrability.** The existing arms assert the declared set is *restated consistently*. None asserts a declared entry is *safe to register at all*: `hasPullRequestTrigger` (`:112`) checks only that a `pull_request:` trigger EXISTS, never that it is unfiltered. So flipping any marker to `yes` inside a `paths:`-filtered workflow passes every existing arm and then freezes every PR matching none of the filter. That is exactly the hazard #1368 wrote into the `discipline-self-check.yml` marker and deferred — and prose is not a mechanism (`.claude/rules/attention-is-not-a-mechanism.md:1`).

- **(i)** every `required-context: yes` job sits behind an unfiltered `pull_request:` trigger (no trigger at all is equally an offender).
- **(j)** paired negative — re-adding the removed filter must be detected.
- **(k)** parser scope: `pull_request:` only (`workflow-integrity.yml` filters *both* `push:` and `pull_request:`, so a file-wide scan would look identical here); inline `on: [push, pull_request]` resolves to `[]` rather than a false «no trigger» RED; job-level `if:` is never flagged, because flagging it would forbid the promote-flow guards all three PR-body gates rely on.

Added to principle 37 rather than shipped as a parallel principle: that file already owns the declaration model and its parsers, so a second principle would have had to duplicate them.

## Operator action required

**Order matters — register only AFTER this merges.** `discipline-self-check.yml` on `staging` is still `paths:`-filtered until then; registering its context first deadlocks every non-matching PR.

Live state re-read 2026-08-10: `{"strict":false,"checks":[{"app_id":15368,"context":"ci-success"},{"app_id":15368,"context":"fidelity-verdict-in-pr-body"},{"app_id":15368,"context":"stale-revert-in-pr-diff"}]}` — three registered against six now declared.

```bash
gh api -X PATCH repos/artyhoo/getff/branches/staging/protection/required_status_checks --input - <<'JSON'
{
  "strict": false,
  "checks": [
    {"context": "Template render probes — P1/P4/P6 (deterministic)", "app_id": 15368},
    {"context": "capability PR carries Prior-art line in PR body (squash-survival)", "app_id": 15368},
    {"context": "ci-success", "app_id": 15368},
    {"context": "fidelity-verdict-in-pr-body", "app_id": 15368},
    {"context": "stale-revert-in-pr-diff", "app_id": 15368},
    {"context": "§1.7 forward+backward sections present in PR description", "app_id": 15368}
  ]
}
JSON
```

- Payload generated from the declared set, not retyped; `strict: false` + `app_id: 15368` reproduce the current pinning. Passing bare `contexts[]=` would drop the app pinning.
- This registers all six declared contexts, including the two #1368 left declared-but-unregistered. Register a subset if you want them staged separately — but every unregistered declared context is one that can go red while the PR merges.
- **PRs open at registration time will not report the new checks until they get a fresh PR event** (a push or a body edit — all the relevant workflows carry `types: [… edited …]`).
- Verify: `gh api repos/artyhoo/getff/branches/staging/protection --jq '.required_status_checks.contexts[]'` → 6 lines.

**Effect on the 6 currently-open PRs, measured (`gh pr list --state open`):** #1366 carries a valid §1.7 section. The other five — #1331 plus four Dependabot bumps (#1230, #1217, #1216, #1149) — do not, and will show a red §1.7 once this merges. This does **not** create a new blocked class: those four are *already* blocked by an existing required check — `gh pr checks 1230` shows `fidelity-verdict-in-pr-body  fail` today, because Dependabot's body carries no `## Fidelity verdict` either, and Dependabot cannot edit its own body. Whatever already handles that for these PRs handles this too. Worth an explicit decision eventually; out of scope here.

## Test plan

- [x] `npx vitest run packages/core/principles/37-required-context-completeness.test.ts` → 11/11 (8 pre-existing + 3 new).
- [x] **Paired-negative on disk, not just in-parser.** The `paths:` filter was re-added to the real `discipline-self-check.yml` and the suite re-run: arms (i) and (j) both RED, with the deadlock message naming the job. Restored → 11/11 green.
- [x] `npm --prefix packages/core run test:principles` → 40 files, 381 passed, 1 skipped, 0 failed.
- [x] `bash scripts/run-local-ci-sweep.test.sh` → ALL PASS (the sweep's own paired-negative, after editing its header block).
- [x] `actionlint` on both changed workflows → clean; `bash -n scripts/run-local-ci-sweep.sh` → clean; `npm run format:check` → clean.
- [x] Full `bash scripts/run-local-ci-sweep.sh` on the pre-merge tree: PASS through `vitest-composition`; `format-check`, `rule-index-check`, `alwayson-budget`, `test:render`, `test:ir` also green individually.
- [x] Live branch protection re-read before writing the operator command.

**Pre-existing failures on this host, NOT introduced here** (both reproduced on a clean `staging` checkout, so out of scope per CLAUDE.md «PR strategy»):

- `packages/core/hooks/getff-work.test.ts` — 3 failures (`CC-DEFERRAL`, `NON-CC-PRINT`, `NO-LAUNCH-FLAG`, all `expected 1 to be +0`). Verified identical on `/Users/art/code/rules-as-tests-aif` at `staging`.
- `packages/core/principles/20-bundle-classification.test.ts` — one 30 s timeout under full-suite parallel load; passes in isolation in 45 s (~3.3 s/test), and green in the 40-file run above. Same spawn-heavy class #1363 addressed.

## Provenance

n/a — not a stage PR. Direct implementation of the 2026-08-10 operator ruling, rebased onto #1368 after that PR merged mid-flight.

## Review findings

n/a — not a stage PR. Three findings came from this branch's own pre-handoff self-review and were fixed before handoff: the `!= 'main'` guard scoping (`== 'staging'` would have dropped epic/* coverage); the inline `on: [push, pull_request]` grammar in the arm-(i) parser (an unhandled inline form would have false-REDded the one unconditionally safe shape); and the sweep's positional «last three» claim, which this PR's own sixth list entry falsified.

**Also surfaced, not fixed** (no drive-by, per CLAUDE.md «PR strategy»): `origin/staging` currently carries **two** principle-37 files — `37-make-target-claim-liveness.test.ts` (#1366) and `37-required-context-completeness.test.ts` (#1368) — merged within minutes of each other. Nothing asserts principle-slot uniqueness, which is the same missing-mechanism class as everything else in this PR.

## Fidelity verdict

FIDELITY: skipped — no kickoff or spec governs this change; it implements a direct operator ruling recorded in the task brief, not a stage of a planned umbrella.

## Parked questions

n/a — not a stage PR.

## §1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)

### §1.7 Forward-check applied

**`no-paid-llm-in-ci.md §2`** — arms (i)–(k) are `readFileSync` + regex, zero API-billed calls; the workflow edits remove a trigger filter and add no step (`packages/core/principles/37-required-context-completeness.test.ts:71` imports only `node:fs`/`node:path`/`node:url`). **`ci-tool-pinning.md §1`** — no bare `run:` tool install added or altered; `.github/workflows/discipline-self-check.yml:79` still has no install step. **`attention-is-not-a-mechanism.md §1`** — this is the rule's own case: the deferred fix lived as a prose marker comment on a job, i.e. detection resting on someone reading it; arm (i) replaces it with a deterministic gate, and the surviving best-effort job at `workflow-integrity.yml:32` stays explicitly labelled non-load-bearing. **`rule-enforcement-channel-selection.md §3`** — mechanically detectable → gate; a principle test is the earliest firing channel (`packages/core/hooks/pre-push.ts:1269` runs `test:principles` at pre-push, CI as backstop). **`build-first-reuse-default.md §3`** — DeepWiki `rhysd/actionlint` + context7 `/github/docs` ×3 phrasings + WebSearch ×2 ran before the BUILD verdict; recorded as SSOT #247 in `docs/meta-factory/prior-art-evaluations.md:319` and cited by the commit trailer. The same rule drove the *shape*: the arms were folded into the existing principle 37 rather than shipped as a parallel principle, reusing its declaration model and parsers instead of duplicating them. **`language-discipline.md §1`** — all added comments, test prose and commit bodies are English. **CLAUDE.md capability-commit gate** — the diff adds no new file ≥80 LOC and no dependency; the trailer cites the SSOT entry anyway, since the capability is real even though the artifact is an extension.

### §1.7 Backward-check applied

Delegated cold to `agents/backward-sweep-auditor.md` per T21 — handed only the two class predicates, never the diff, branch or PR, so it could not restate this change. (Dispatched against the pre-merge tree; both classes are structural and unaffected by the rebase, and finding B-2 below is about files this PR does touch, so it was re-checked by hand against the merged state.)

**Class A — «a hand-maintained list whose correct contents are determined by a population declared elsewhere, with nothing asserting the mirror».** Population 13, all reached. SWEPT-CLEAN: `packages/core/principles/27-*` (install.sh copy-list ⊇ import graph), `.claude/rules/00-rule-index.md` + AGENTS.md (`scripts/render-rule-index.mjs --check`, `packages/core/hooks/pre-push.ts:1253`), agents/rules/skills header coverage (`packages/core/principles/09-doc-authority-hierarchy.ts:228`), `tests/agnosticism` probes (`run-audit.sh:14` globs, no hand list), `.claude/hooks/**` channel markers. **Six GAP-FOUND, none in this diff:** (1) the Tier-0 core set exists in three copies — `packages/core/principles/31-rule-channel-declaration.ts:58` (3 entries) vs `scripts/render-rule-index.mjs:56` and `scripts/render-rule-channels.mjs:75` (2 each), the latter's comment at `:70` claiming a «verbatim» mirror while differing, and `--check` regenerates *from* the stale copy so it stays green; (2) `packages/core/principles/09-doc-authority-hierarchy.ts:28` `REQUIRED_HEADER_DOCS` is static, and 5 `docs/meta-factory/*.md` carry no header; (3) `tests/install-sh/meta-all-wired.test.sh:23` loops only `tests/install-sh/*.test.sh`, leaving 29 of 127 tracked `*.test.sh` unasserted, 13 invoked by nothing; (4) `setup.d/LAYERS.md:3` declares itself authoritative for the layer list but carries 13 rows against 16 globbed by `install.sh:1142`; (5) `setup.d/10-skills.sh:108` names 12 of 14 skills, in sync but unasserted; (6) `scripts/run-local-ci-sweep.sh:123` gate table (low severity — a stale row yields a false LOCAL green and gates no merge).

**Class B — «a declared gate whose channel cannot fire where it is relied upon».** Population 9, all reached. SWEPT-CLEAN: `guard-liveness-fullsweep.yml:20`, `pr-body-prior-art.yml:28`, `audit-self.yml:549` lychee vacuity guard, `audit-self.yml:1058` toolchain non-vacuity, `scripts/host-verify-coverage.sh:4`. `workflow-integrity.yml`'s own `paths:` filter is clean precisely because it is declared `required-context: no` — which arm (i) now asserts rather than assumes. **Three GAP-FOUND:** (1) 113 of 262 `packages/core` test files execute at no channel — `packages/core/vitest.config.ts:9` allowlists 22 dirs, pre-push runs 4 `test:*` scripts and CI 7, so `validator/gate-conflict.test.ts` and six other self-described gates never run; `audit-self.yml:389` states the class in the repo's own words and `:394` defers it; (2) all three PR-body required gates skip on base=`epic/*` while `CLAUDE.md:121` permits agents to merge there; (3) changed-markdown link integrity is pre-push-only and degrades to a warning when lychee is absent (`packages/core/hooks/pre-push.ts:1499`), while `link-checker.yml:26` is paths-filtered to `lychee.toml`.

**Acted on within scope:** B-2 is the one finding this PR's own files carry, and it is fixed here for the §1.7 gate — `discipline-self-check.yml:77` uses `!= 'main'`, so base=`epic/*` stays covered. The cold agent reached that defect independently, on the two sibling gates, without seeing the diff; the two siblings keep `== 'staging'` and are **not** changed here, since narrowing them is a different subject with a recorded prior decision (`docs/superpowers/specs/2026-07-23-acceptance-contour-design.md:161`). The other eight findings are sibling surfaces outside this umbrella and are surfaced, not fixed — the Tier-0 three-copy set is the closest structural twin of what principles 36 and 37 each fixed once.

Prior-art: prior-art-evaluations.md#247 (actionlint RuleGlob / zizmor / poseidon/wait-for-status-checks / blend/require-conditional-status-checks / GitHub-native required_status_checks API — verdict BUILD, narrow complement to #245. actionlint validates `paths:` glob SYNTAX but per DeepWiki on `rhysd/actionlint`, 2026-08-10, «does not analyze the implications for branch protection» and «does not have a feature to cross-check a list of status-check context strings against job `name:` fields»; the marketplace answers to skipped-but-required are RUNTIME waiters that add a job to wait on other jobs, never a static assertion that a declaration is registrable.)
artyhoo added a commit that referenced this pull request Aug 10, 2026
…ort-worthiness rule, severity-contract arm (§8 items 2/2b/3/4/5/11) (#1374)

## Summary

Landing PR for the ratified advisor-pattern design spec ([docs/superpowers/specs/2026-08-10-advisor-pattern-design.md](docs/superpowers/specs/2026-08-10-advisor-pattern-design.md), operator gate word recorded in §11d). Ships the §8 landing obligations billed to this PR — item 2 (ratified-doc transfers), 2b (the ONE permitted `packages/` edit: `pr-body-fidelity` severity-contract arm), 3 (reviewer-discipline §6 + fidelity-auditor grammar), 4 (new Class C rule `effort-worthiness.md` + 4 skill-embeds + rule-index regen), 5 (prior-art pass folded into the rule), 11 (§1.7 self-reflection below). Items 6/6b/7-numbers/8/9/10 are post-landing per §8 and deliberately absent.

## Changes

- Spec `2026-08-10-advisor-pattern-design.md` (600 lines, two cold two-altitude reviews at cap, operator-ratified) + session-1 handoff `2026-08-10-arch-prep-advisor-pattern.md`.
- v2 `session-bus-v2.md`: five-verb table append-only (ASK added, ANSWERED un-frozen), `:276-279` stale clause fixed, §9 claim-1 re-scoped to the new grep pattern, §14c disposition rows, §9 degradation rows.
- ADR `2026-08-09-pipeline-chips-session-bus-design.md`: Part-2/D5 superseded-in-part pointer.
- Choreography surfaces: dispatcher §3 ask-cells; night-mode items 1+8 + «night-decided asks» morning-report line; arch §1 spec-template obligation (premise register + falsifiers) + §2 ESCALATED/Failure-scenario grammar + §4 review-ESCALATED intake; pipeline Phase -1 scenario-bearing verdict condition.
- `reviewer-discipline.md` §6 (operating SSOT for the severity contract + ESCALATED grammar); `agents/fidelity-auditor.md` findings grammar; `agents/reviewer-discipline.md` + `agents/review-sidecar.md` (+ byte-identical plugin twin) contract pointers.
- NEW `.claude/rules/effort-worthiness.md` (Class C; six-layer effort-worthiness loop; prior-art fold-in §4) + skill-embeds at the four choreography owners + rule-index regen (bytes freed first: 4092/4096).
- `pr-body-fidelity.ts` severity-contract arm: a BLOCKER/MAJOR `## Review findings` entry must carry a `Failure-scenario:` line (+11 tests, suite 45/45; sidecar bare-tally shape exempt; heading-wrapped paste = recorded fail-open).
- SSOT duplicate ID #247#248 renumber (cross-PR race #1370 × #1371 both minted 247 on staging; principle-08 uniqueness gate red on merge-forward without it).
- staging merged forward first, so the cited review-effort-theatre patch (#1369) resolves on-branch.
- 8 js-family install-sh fingerprint baselines regenerated (the audited agent-file edits changed installed bytes; `SNAPSHOT_MODE=compare` 15/0 post-regen).

## Prior-art consult

- [x] Capability commits in this PR carry a `Prior-art:` trailer — d4663d4 (`skipped — extension of the existing pr-body-fidelity check; no new dependency, directory, or capability`), 4c7d947 (`skipped — prose discipline rule + doc embeds; the rule IS the prior-art fold-in`). PR range itself is non-capability (added files are all markdown; zero new `packages/` files; no dependency changes).
- [x] No new capability area surfaced — the §8 item 5 pass folded into the rule body instead (`.claude/rules/effort-worthiness.md` §4: Conventional Comments, Google eng-practices nit culture, Bezos Type-1/2 reversibility, CBR indexing problem, WIP limits, ADR / spec-kit SDD / Kiro EARS); verdicts warranted no SSOT adoption entry.
- [x] Existing entries: none matched; the only SSOT touch is the #247#248 duplicate-ID renumber.
- [x] context7 (≥3 phrasings) + WebSearch run during the §8 item 5 pass; results cited in `effort-worthiness.md` §4 and commit 4c7d947 body.

## Test plan

- [x] §1.7-свод lands in squash-body (`gh pr merge --squash --body "$(gh pr view <N> --json body -q .body)"`)
- [x] `npm test --workspace=@rules-as-tests/core --run` — pr-body-fidelity suite 45/45 re-verified by the cold fidelity seat; 3 local `getff-work.test.ts` fails are worktree-from-worktree env artifacts, green in CI
- [x] `make self-audit` / `npm run --prefix packages/core test:principles` — principle-08 uniqueness green after the #247#248 renumber; full pre-push substance sweep green at push of a4cfeb6
- [x] Hook check code touched (`pr-body-fidelity.ts`): its vitest suite green; `prior-art-trailer-hook` untouched
- [x] Manual smoke: `render-rule-index.mjs --check` green at 4092/4096 bytes; v2 §9 claim-1 grep pattern re-run live (0 hits under `packages/` beyond the known doc pointer); plugin twin byte-identity verified

## Provenance

kickoff/spec: docs/superpowers/specs/2026-08-10-advisor-pattern-design.md §8 (landing work list) · base SHA: 6d8c517 · substrate: in-session (worktree gracious-chatelet-a1be5d, branch claude/advisor-pattern-consultation-86f49b; design sessions 1-3 + landing-tail session) · models: Fable 5 (design + landing), cold seats Fable 5 subagents (2 spec reviews at cap + fidelity r1 + backward sweep) + Sonnet (r2 narrow delta) · fidelity Rounds 1-2 (r2 = scope-neutral delta refresh after baselines regen).

## Review findings

Cold two-altitude spec reviews (cap 2, ESCALATED rung available per the spec's own §6 — first consumer): r1 top-down REVISE (8 MAJOR / 6 minor / 2 ESCALATED), r1 bottom-up STOP (BLOCKER: verb table re-typed from memory — repaired; the append-only clause in §8 item 2 is its codification), r2 verify REVISE (2 MAJOR / 6 minor) — all repaired at cap (commits 672dede18e5c57). ESCALATED fired live twice; both resolved at the operator gate (spec §11c: Э-1 dissolved — role decoupled from session lifetime; Э-2 — no numeric target, kernel-v2 starts immediately after landing).

Cold backward sweep (class-only input, agents/backward-sweep-auditor.md): 6 GAPs — 4 surfaces fixed in-branch (agents/reviewer-discipline.md:37, agents/review-sidecar.md:158 + plugin twin, pipeline SKILL:458+471, arch §2 re-scope), consumer templates deferred to §8 item 9 (recorded, never a silent copy), operator-global `/reviewer` command = hand-apply patch (parked below).

Cold fidelity audit r1 (dialogue-blind, scoped to §8 items 2/2b/3/4/5/11): GO — verdict block below. Notes lane (recorded, no round): commit a4cfeb6 subject arithmetic «5 of 6» vs 4-fixed+2-deferred reconciles only counting agent+plugin twin as two surfaces; item 5's context7/WebSearch invocation is a process claim (INCONCLUSIVE-needs-human) while the artifact-side fold-in is complete; SSOT renumber is `extra` outside billed items — forced CI repair surfaced by the mandated merge-forward.

### Watch-list

| id  | criterion | why | defect site | reintroduction tell |
| --- | --- | --- | --- | --- |
| W-1 | spec §2/§8 item 2 — v2 §7 ratified verb rows are append-only, never re-typed | the r1 BU BLOCKER corrupted all three rows in one from-memory hop | none — preventive (rows verified untouched as diff context) | any future diff hunk touching the PARKED/REBIND/NUDGE lines at `docs/superpowers/specs/2026-08-09-session-bus-v2.md:241-243` |
| W-2 | §8 item 2 — claim-1 re-cut pattern GREEN live (0 hits for `AIF-BUS`/`AIF_BUS` and `session-bus/` under `packages/`; bare `session-bus` hits only the :1168 doc pointer) | the arm's error text or a future packages/ edit could embed a verb literal and re-RED the claim | none — preventive | any grep hit for the verb literals or the path segment under `packages/` beyond `end-of-turn-reminder.test.ts:1168` |
| W-3 | §8 item 4 — rule-index at 4092/4096 bytes, 4 free | the trim was a precondition, not a check; any Fires-line growth re-breaches silently at the next regen | `.claude/rules/00-rule-index.md:21` | `wc -c` > 4096 or `render-rule-index.mjs --check` failing on an unrelated rule edit |
| W-4 | 2b arm — FINDING_COUNT_RE exempts ONLY bare digit tallies; the heading-wrapped-paste fail-open is RECORDED, not fixed | widening the exemption (or deleting the recorded fail-open note) would gut the deterministic arm while tests stay green | `packages/core/hooks/checks/pr-body-fidelity.ts:110-117` | a prose-led `- MAJOR: <text>` passing the gate, or the fail-open NOTE comment removed |
| W-5 | sweep GAPs (3)(4) — shipped consumer templates deferred to §8 item 9, «never a silent copy» | a later round pasting the severity contract into `packages/core/templates/**` without the item-9 review would ship an unreviewed consumer surface | none — preventive (deferral recorded in commit a4cfeb6) | Failure-scenario/ESCALATED text appearing under `packages/core/templates/**` with no consumer-delivery-stage review record |

Round 1: W-1 CLEAN · W-2 CLEAN · W-3 CLEAN · W-4 CLEAN · W-5 CLEAN

Round 2: W-1 CLEAN · W-2 CLEAN · W-3 CLEAN · W-4 CLEAN · W-5 CLEAN

Round 2 was a narrow cold delta refresh (cold-seat-economy §1) after the scope-neutral baselines-regen commit d116a95 (8 fingerprint files, 16 hash-swap lines, zero hunks outside `tests/install-sh/baselines/**`): fresh cold seat, incremental diff + scope sections + round-1 watch-list inlined; verdict GO, no findings. Round-1 fidelity: GO on a4cfeb6 with KICKOFF-AMBIGUOUS (spec §6 «disposition vocabulary» sub-item has no landing home — parked below) and two notes-lane MINORs (recorded above).

## Fidelity verdict

FIDELITY: GO
Basis: docs/superpowers/specs/2026-08-10-advisor-pattern-design.md#§8 (items 2/2b/3/4/5/11)
Round: 2
Audited-SHA: d116a95
Evidence: tests/install-sh/baselines/react-native/greenfield.fingerprint:17 (delta's own hunk — hash-line swap for `.claude/agents/fidelity-auditor.md`; kept for human traceability, extension length exempts it from FILE_LINE_RE) · carried-forward round-1 standing evidence, unchanged by this delta (confirmed: zero hunks outside `tests/install-sh/baselines/**`), relayed per coordinator — not re-opened this round: `.claude/rules/effort-worthiness.md:1`, `packages/core/hooks/checks/pr-body-fidelity.ts:126`, `.claude/rules/reviewer-discipline.md:56`, `agents/fidelity-auditor.md:82`
Findings: none — mechanical snapshot regen closing a byte-identical-compare CI red caused by round-1's own audited item-3 edits (agents/fidelity-auditor.md, agents/review-sidecar.md content changes); no new deliverable, no new permitted-file class, no descope touched, no packages/ or spec/rule surface reopened. Round-1 findings history (KICKOFF-AMBIGUOUS + two notes-lane MINORs) recorded under `## Review findings` and `## Parked questions`.

## Parked questions

- KICKOFF-AMBIGUOUS (fidelity r1): spec §6's «disposition vocabulary gains ESCALATED» sub-item has no existing artifact home (no repo file defines the ACCEPTED/DISSOLVED vocabulary outside the two specs) — routes to the kernel-v2 /arch contour (§8 item 8) as a surface-list re-design input, not rework here.
- GAP-6 residue: operator-global `~/.claude/commands/reviewer.md` still carries the pre-§6 triple grammar; agent-uncommittable — hand-apply patch delivered to the operator in the landing-session summary (repo-side claim already re-scoped at arch SKILL §2).
- Sweep GAPs 3-4: shipped consumer templates (aif-review, aif-orchestrator-discipline) intentionally NOT patched — deferred to the ratified consumer-delivery stage (§8 item 9) with its own review.
- lychee scope: `lychee.toml` excludes `docs/superpowers/`, so broken citations inside specs are caught by nothing (surfaced by the r1 MINOR both seats); widening is a separate small item, not landed here (spec §8 item 2 wording).
- Gate-owner observation from the r2 delta seat: a baselines-regen commit structurally CANNOT self-cite through the fidelity gate's FILE_LINE_RE — the `.fingerprint` extension exceeds the regex's ≤6-letter cap (packages/core/hooks/checks/pr-body-fidelity.ts:57), so any future delta round whose diff is baselines-only must carry forward standing evidence; recorded as an observation, out of this PR's billed scope.

## §1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)

### §1.7 Forward-check applied

New/extended disciplines (effort-worthiness rule, reviewer-discipline §6, severity-contract arm) checked against every active layer: channel selection per rule-enforcement-channel-selection.md — Class C prose + skill-embed channel, embeds live at .claude/skills/dispatcher/SKILL.md:326, .claude/skills/night-mode/SKILL.md:39, .claude/skills/arch/SKILL.md:91 (principle 31 skill-embed liveness green); doc-authority header present at .claude/rules/effort-worthiness.md:10 per doc-authority-hierarchy.md §3; capability-commit gate — both flagged commits carry trailers (d4663d4, 4c7d947), 2b amendment «zero NEW capability code» honoured (no new deps/dirs/files under packages/); no-paid-llm-in-ci — the arm is deterministic-half only, the semantic judge stays session-side (packages/core/hooks/checks/pr-body-fidelity.ts:122); attention-is-not-a-mechanism §1(a) — the severity contract got a deterministic gate at the earliest reachable channel (pr-body-fidelity.ts:126), not bare reviewer attention; 600-line markdown gate — spec lands at exactly 600 lines; rule-index 4096-byte ceiling — bytes freed BEFORE the new row (.claude/rules/00-rule-index.md at 4092/4096, `render-rule-index.mjs --check` green).

### §1.7 Backward-check applied

Class = artifacts stating reviewer finding-grammar / round-triggering rules. Sweep delegated to the cold backward-sweep-auditor (class-only input, per T21), which enumerated ~30 surface groups; per surface: agents/reviewer-discipline.md:37 GAP-FOUND → FIXED (§6 contract at its run-moment channel); agents/review-sidecar.md:158 + plugin/agents/review-sidecar.md GAP-FOUND → FIXED (byte-identical twin, principle 24d green; arm exempts the sidecar bare-tally shape that live-fired as a false positive); .claude/skills/pipeline/SKILL.md:458+471 GAP-FOUND → FIXED (Phase -1 verdict + REVISE routing gain the scenario condition); .claude/skills/arch/SKILL.md:91 GAP-FOUND → re-scoped (cross-boundary claim about the global /reviewer command); packages/core/templates/** (aif-review + aif-orchestrator-discipline) GAP-FOUND → DEFERRED to §8 item 9 consumer-delivery stage with its own review (recorded in commit a4cfeb6, never a silent copy); ~/.claude/commands/reviewer.md GAP-FOUND → operator hand-apply (agent-uncommittable, parked above); all remaining enumerated surfaces SWEPT-CLEAN. Exemption mechanism: the arm's FINDING_COUNT_RE bare-tally carve-out is itself meta-tested (packages/core/hooks/checks/pr-body-fidelity.test.ts:1 — exemption-preserves-intent + mutation arms in the +11 tests).
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