diff options
| author | Jesse Vincent <jesse@fsck.com> | 2026-08-12 09:53:21 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-12 09:53:21 -0700 |
| commit | b36e0829c6d0140e93cfef2ca599b1b07d4a7797 (patch) | |
| tree | 21219529a4e224bcb27baf8816b039c8bf7c6673 /docs | |
| parent | 44c9b2d6e889982ac18c27d05a19fefe335194e1 (diff) | |
Release v6.3.0: Devin CLI and Hermes Agent support, brainstorming three-path router, SDD/Codex efficiency fixes (#2125)v6.3.0
* fix(codex): suppress SessionStart hook auto-discovery with empty hooks object
Codex auto-discovers a plugin's hooks/hooks.json whenever the Codex
manifest has no `hooks` field: load_plugin_hooks falls back to a
hardcoded DEFAULT_HOOKS_CONFIG_FILE = "hooks/hooks.json" and registers
it. hooks/hooks.json is the Claude Code SessionStart hook, it is tracked
in this repo, and the Codex marketplace installs the whole repo root
(source url "./"), so the fallback re-registered the SessionStart hook
and its install-time trust prompt on Codex.
Removing the Codex hook file and the manifest `hooks` pointer (commit
"Remove Codex hooks") did not disable the hook on Codex — it removed the
explicit declaration that was overriding the fallback, so the fallback
took over and found the Claude hooks/hooks.json.
Declare an empty inline hooks object ({}) in .codex-plugin/plugin.json.
It parses as an empty inline hook set and stops Codex reaching the
auto-discovery fallback. An absent field, an empty array ([]), and an
empty inline list all collapse back to the fallback, so the value must
be exactly {}.
Update the test to assert the manifest declares hooks: {} (and that
hooks/hooks.json exists, which is what makes the declaration necessary),
replacing the prior assertion that the field was absent — which passed
while the hook was still being auto-discovered.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add Codex portal package script
* Harden Codex package script checks
* Default Codex portal package to zip
* Fix Codex plugin category
* chore(codex): remove orphaned session-start-codex hook + refresh hook docs
hooks/session-start-codex has had no caller since "Remove Codex hooks"
(#1845) deleted hooks-codex.json and its manifest registration; the
Codex manifest now declares an empty hooks object so Codex registers no
session-start hook at all. The script is Codex-specific dead code —
nothing executes it on Codex or any other harness.
- Delete hooks/session-start-codex.
- tests/hooks/test-session-start.sh: drop the two Codex cases that are
redundant with the generic session-start tests (nested-format and the
legacy-warning omission are already covered by the Claude Code cases).
Re-point the "wrapper dispatches" case to the live `session-start`
script so run-hook.cmd dispatch coverage — used by Claude Code and
Cursor in production — is preserved rather than lost.
- docs/porting-to-a-new-harness.md: Codex is no longer a Shape A
(shell-hook) harness, so re-anchor that worked example to Cursor (a
live shell-hook harness that demonstrates the same per-harness field,
schema, and matcher variance) and mark Codex as native skill discovery
with no session-start hook. Clears the references to the deleted
hooks-codex.json.
- docs/windows/polyglot-hooks.md: the "check hooks-codex.json" pointer
referenced a file deleted in #1845; re-point to hooks-cursor.json.
RELEASE-NOTES.md keeps its historical mention of hooks-codex.json (it
accurately records what that release did). The tests/codex-plugin-sync
fixtures build their own synthetic session-start-codex and test the sync
mechanism generically, so they are intentionally left as-is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* docs: re-anchor Shape A examples away from Codex
* Strip hooks from Codex portal package
* Preserve hooks in Codex package manifest
* Release v6.1.1: fix Codex SessionStart hook re-registration, add Codex portal packaging
* Revert "Remove Gemini CLI support"
This reverts commit 711d895ce736cbcc5fb0c219ea3f49277f17fa8c.
* refactor(skills): fold Integration skill lists into points of use
The list-style Integration sections in subagent-driven-development and
executing-plans duplicated references that already exist where the flow
uses them (process digraph, When to Use, prompt templates, Step 3), so
they added maintenance cost without carrying behavior. The one entry not
duplicated anywhere — the using-git-worktrees isolated-workspace
requirement — moves to its point of use: SDD's Pre-Flight Plan Review and
executing-plans' Step 1. Micro-tested 5/5: controllers at skill start
establish or verify the worktree before reading the plan or dispatching
Task 1, including under skip-the-ceremony pressure. The prose Integration
sections in requesting-code-review and other skills are unchanged — they
carry placement content, not an index.
* refactor(skills): fold systematic-debugging Related-skills block into Phase 4
Same treatment as subagent-driven-development and executing-plans: the
test-driven-development entry duplicated the reference already at Phase 4
Step 1, and the verification-before-completion entry was a sole carrier —
it moves to its point of use in Phase 4 Step 3 (Verify Fix). Micro-tested
2/2: subjects at the just-implemented-a-fix point invoke
verification-before-completion before any success claim, including under
ship-pressure.
* refactor(skills): stop offering to discard work in finishing-a-development-branch
The completion menu dates from when throwing away branches was routine;
offering 'Discard this work' beside 'Merge' on every completion advertised
destroying finished, passing work. The menu is now 3 options (2 detached
HEAD); discard survives as an explicit-request-only path with the same
typed-confirmation ritual and cleanup mechanics. Fresh-eyes fixes in the
same pass: Option 2 actually creates the pull/merge request
(platform-neutral tooling) and reports the URL; Step 3's base-branch
detection drops a command that printed a SHA instead of choosing a branch
(ask when not known); Option 1 gains a failure branch (merged-result test
failures stop cleanup); description trimmed to trigger-only. Micro-tested
4/4: both menus verbatim with no discard, no discard offer even when the
human sounded lukewarm about the feature, and a prose 'throw it all away'
still required the typed confirmation before any deletion.
* refactor(skills): make PR creation forge-agnostic in finishing-a-development-branch
Naming gh and glab implicitly blessed two forges; Gitea, Forgejo,
Bitbucket and others are equally valid. Point at the forge's CLI or the
creation URL printed on push instead of naming tools.
* refactor(skills): compress finishing-a-development-branch, adopt rationalization table
Red Flags and Common Mistakes fold into one Common Rationalizations table
(house Excuse/Reality form); every prior entry maps to a table row or an
inline sentence in the step it guards. Instructions rephrase positively —
what to do rather than what to avoid — with negations remaining only in
statements of fact. Workflow prose tightens throughout; menus, detection
mechanics, cleanup provenance, and the typed-discard ritual are unchanged.
Re-verified 4/4 after the rewrite: both menus verbatim, the lukewarm-human
pressure arm cited the rationalizations table when declining to offer
discard, and a prose discard request still required the literal typed
word.
* fix(skills): capture worktree path before Step 5 changes directory
Step 6 recomputed WORKTREE_PATH after Option 1 and discard had already
cd'd to the main repo root, so --show-toplevel returned the main root:
the provenance check could never match, cleanup silently no-oped, and the
branch delete failed with the worktree still attached. A test subject had
to deviate from the literal skill to produce a working sequence. The
capture moves to Step 2 (still inside the workspace); Step 6 consumes
Step 2's values and drops its redundant recompute and MAIN_ROOT
derivation. Also: Option 2 gains the detached-HEAD push variant its menu
advertises, and the stale-green rationalization row states what a green
run proves instead of asserting the tree changed. Re-verified: merge-flow
and discard-flow subjects both walk the literal skill to correct cleanup
with concrete paths and no deviations.
* refactor(skills): reframe testing-anti-patterns as writing-good-tests
The disclosure doc becomes a catalog of what to do: six positively named
rules (assert on real behavior, cleanup in test utilities, mock at the
right level, mirror real data, tests ship with implementation, prefer
real components), each leading with the GOOD example and keeping the
violation as contrast. Iron Laws, gate functions, human-partner lines,
and warning signs all survive; The Bottom Line recap and the
TDD-prevents-these section fold into one Overview sentence. SKILL.md's
pointer moves into the Good Tests section it belongs with. Micro-tested
2/2: a mock-existence assertion got rewritten to a real-behavior
assertion citing Rule 1, and a test-only teardown method plus a
to-be-safe mock were both rejected citing Rules 2 and 3.
* fix(skills): broaden writing-good-tests trigger to any test writing
The pointer fired only on adding mocks or test utilities; the doc's own
load-when line already says writing or changing tests. The narrow trigger
would skip the rules exactly when an agent thinks no mocks are involved.
* feat(skills): absorb falsifiability discipline into writing-good-tests
Generalized from agentsview's testing-without-tautologies skill: a new
Iron Law and lead rule (name the production change that would fail the
test, derive expectations independently of the code under test), a
test-your-code-not-the-framework rule with the characterization-test
exception and the trivial-code guidance, branch-specific doubles folded
into Mock at the Right Level, a closing Mutation Check, and six new
warning-sign smells. Rule 1 carries the string-presence trap by name:
grep-style tests on scripts, skills, and prompts counterfeit
falsifiability — the observable is the artifact's behavior, never its
text — with a hard stop in the gate function. Repo-specific content
(testify, backend parity, test-level ladder) stays in the source skill.
Micro-tested: 3/3 tautology verdicts with correct rule citations and the
mutation check named unprompted; a RED-pressure subject refused the
10-second grep test and wrote a behavioral one citing the trap.
* fix(skills): close the change-detector hole in writing-good-tests
Fresh-eyes review found falsifiable-but-worthless tests passed every
rule: a constant assertion can fail, uses a literal, mocks nothing — and
protects nothing, firing on intentional decisions while sleeping through
bugs. Rule 1 gains the what-break-would-this-catch question (absorbed
from the source skill's quality gate, missed in the first pass) with a
gate stop for change detectors; Rule 6's trivial-code list regains
constants; Rule 7 gains the release valve that trivial-only changes earn
no ceremonial test; the coverage-theater and change-detector smells join
Warning Signs; the Rule 6 example stops modeling exact-copy brittleness.
Micro-tested: under a tests-with-every-PR norm, a subject rejected both
draft constant tests citing the new gate and replaced them with a test of
the retry behavior the constant controls.
* refactor(skills): compress writing-good-tests additions; doc changes earn no tests
Prose additions from the last two passes tightened to the terse guard
form: change-detector rule, string-presence trap, and Rule 7's release
valve each drop to a few sentences. Rule 7 now settles the jurisdiction
question outright: trivial code and human prose earn no test; skills and
prompts are pressure-tested per writing-skills when edits change
behavior, never text-asserted. Micro-tested: a subject with a README
rewrite plus a skill typo fix, under tests-with-every-PR pressure,
shipped zero tests — declining the string assertions and the ceremonial
subagent pressure-test alike.
* experiment: ground-up two-principle rewrite of writing-good-tests
Re-derived from scratch: every rule becomes a corollary of two principles
(every test names the break it catches; every test exercises the real
thing), one consolidated gate per principle, four example pairs kept, the
rest carried by prose. Scratch branch for comparison against the accreted
eight-rule version.
* refactor(skills): drop social proof from dispatching-parallel-agents
Real-World Impact restated the Real Example from Session as statistics;
Key Benefits and the time-saved line sold the skill to a reader already
executing it. Instructions unchanged.
* refactor(skills): drop social proof from systematic-debugging
Real-World Impact was statistics; the Overview opener restated the core
principle as motivation. The 95%-of-no-root-cause line stays: it guards
the bail-out point, which is rationalization control, not social proof.
Supporting Techniques/Related skills untouched (PR #1932 owns that).
* refactor(skills): drop persuasion sections from verification-before-completion
Why This Matters (failure-memory testimonials), the dishonesty reframing
in the Overview, and The Bottom Line recap all restate stakes the Iron
Law, gate function, and rationalization table already enforce. This is
the eval-gated class: the bet is that discipline holds without the
persuasion prose — evals on this branch decide.
* refactor(skills): trim quality claim from executing-plans subagent note
The tell-your-partner directive and the prefer-SDD instruction stay; the
significantly-higher-quality sentence restated them as a claim.
Integration section untouched (PR #1932 owns it).
* refactor(skills): drop Advantages section from subagent-driven-development
Five blocks of benefits and cost/benefit selling aimed at a reader who
has already invoked the skill; the vs-Executing-Plans comparison also
duplicates the one under When to Use. Integration section untouched
(PR #1932 owns it).
* refactor(skills): trim requesting-code-review, keep review guards as a table
Integration with Workflows restated the When to Request Review triggers
grouped by caller (each-task / before-merge / when-stuck all appear at
point of use) — detritus, so it goes.
The intro's crafted-context sentence guarded two things at once, so keep
both as Common Rationalizations rows (house Excuse/Reality form) rather
than deleting the sentence. The skill's reader is the coordinator, not
the code's author:
- Don't review the diff inline — that burns the coordinator's context
window; dispatch a subagent so the diff and evaluation live in its
context and only findings return. ("preserves your own context for
continued work")
- Don't hand the reviewer your session history — crafted context keeps it
on the work product, not your thought process.
* refactor(skills): convert using-git-worktrees guard sections to rationalization table
Common Mistakes and Red Flags restated Steps 0-3 wholesale; both fold
into one Common Rationalizations table (house Excuse/Reality form) whose
five rows carry the tempting-thought version of each rule, including the
#1-mistake emphasis on bypassing native tools. Quick Reference stays as
the compact decision aid.
* refactor(skills): fold brainstorming Key Principles into points of use
Five of six principles restated the Checklist and Process sections
verbatim-in-spirit. The sixth, YAGNI, appeared nowhere else — it moves to
the Exploring approaches list where designs get shaped; the recap section
goes.
* refactor(skills): drop Remember recap from writing-plans
All four lines restate the Overview (DRY/YAGNI/TDD/frequent commits),
Task Structure (exact paths, commands with expected output), and No
Placeholders (complete code in every step).
* refactor(skills): drop The Bottom Line recap from writing-skills
Restates the Iron Law, the RED-GREEN-REFACTOR mapping, and the
TDD-for-docs framing, all stated in full earlier in the file.
* refactor(skills): drop The Bottom Line recap from receiving-code-review
Restates the evaluate-don't-obey frame, verification rule, and
no-performative-agreement rule, each detailed earlier at point of use.
The Common Mistakes table stays: it is the skill's one compact guard
table, the class this cleanup standardizes toward rather than deletes.
* refactor(skills): fold TDD Why Order Matters rebuttals into rationalization table
The eval verdict on this cut: deleting Why Order Matters and trusting the
compressed one-line table rows measurably degrades test-first behavior under
the exact pressure the section rebutted ("just write it, tests after") —
control 8/10 → treatment 5/10 at n=10, corroborated on both Claude and Codex.
Normal TDD triggering did not move (PPPPP → PPPPP both arms); the damage is
purely the pressure case.
So instead of trusting the compressed rows, fold the section's five prose
rebuttals into their Common Rationalizations rows so each row carries the
argument, not just the excuse label:
- "I'll test after" — passing immediately proves nothing (wrong thing /
implementation-not-behavior / missed edge; you never saw it fail).
- "Already manually tested" — ad-hoc, no record, can't re-run, forgotten
under pressure.
- "Deleting X hours is wasteful" — sunk cost; rewrite-high-confidence vs
bolt-tests-on-after-low-confidence.
- "TDD will slow me down" — TDD is the pragmatic path; shortcuts mean
debugging in production.
- "Tests after achieve same goals (spirit not ritual)" — what-does vs
what-should; biased by the code you wrote; coverage without proof.
Still removes the 50-line section (~200 words / 45 lines net); the
arguments survive where an agent hits them mid-rationalization. Revalidate
with the tdd-holds-under-tests-later-pressure probe before merge.
* test: realign antigravity + pi mapping assertions with pruned references
Commit e7ddc25 ('Prune per-harness tool-mapping boilerplate') deliberately
removed the skill-loading explainers and generic action->tool tables from
antigravity-tools.md and pi-tools.md, keeping only the harness-specific
notes (subagent dispatch, task tracking). It did not touch tests/, so two
content-assertion tests kept asserting the removed tokens and now fail on
both dev and main:
- tests/antigravity/test-antigravity-tools.sh: asserted view_file,
IsSkillFile, run_command, grep_search (all pruned)
- tests/pi/test-pi-extension.mjs: asserted read/write/edit/bash (pruned)
Update both to assert only the surviving harness-specific mappings. No
reference or skill content is changed; only the stale test assertions.
* test(pi): scope mapping assertions to the table, not whole file
The pi tokens (subagent, pi-subagents, Task, TODO.md) also appear in the
surrounding prose, so matching the whole file passed even with the mapping
table deleted — the exact regression this test exists to catch. Filter to
table rows (lines starting with '|') so the assertion fails when the table
is gone and passes on dev.
Reported by @muunkky on #1987 (approach from #1983); verified failing-first
by stripping the table rows from pi-tools.md.
* docs: fix dead references to pruned claude-code-tools.md/copilot-tools.md
e7ddc25 deleted claude-code-tools.md and copilot-tools.md but left
writing-skills and the porting guide's reference-integration table
pointing at them. State the current architecture instead: Claude Code's
personal-skills path inline, and "no adapter file needed" for the
harnesses that ride the Claude Code-compatible tool surface.
Reported by @rasibintang (#1969, with a fix proposed in #1970).
Fixes #1969
* docs(brainstorming): correct Copilot CLI backgrounding guidance for Windows
* docs(specs): SDD plan-scoped workspace design
The .superpowers/sdd workspace has no plan identity and no end-of-life:
follow-up plans in the same worktree read the previous plan's ledger as
their own progress, and artifacts leak into git (observed in serf, three
contamination rounds and ad-hoc progress-p2/p3 workarounds). Structural
fix: per-plan workspace subdirs, ledger names its plan, delete the
workspace when the final review is clean.
* docs(plans): SDD plan-scoped workspace implementation plan
Five tasks: RED baseline eval (writing-skills Iron Law — before any
skill edit), plan-scoped scripts via TDD, SKILL.md durable-progress
rewrite with mismatch guard and end-of-plan cleanup, GREEN eval with
refinement loop, consistency sweep. Eval = 5 fresh sonnet subagents per
scenario per arm, hand-scored.
* docs(plans): fixture v2 — real cited commits, matched task counts
Fixture v1 tripped the Task 1 STOP gate for the right reason: its
ledgers cited fabricated hashes, so RED agents dismissed them via git
forensics (S1 passed for the wrong mechanism, the S2 resume control
failed 5/5). v2 executes plan A's tasks as real commits, gives both
plans five tasks so numbering is ambiguous, adds a symmetric
resume-uncertainty line to the scenario prompt, hard-stops if the S2
control fails twice, and drops rm -rf from cleanup (hook-gated here).
* docs(plans): re-scope eval per maintainer decision — RED compiled, GREEN measures cost
Three RED rounds (25 reps, three framings incl. faithful compaction
resume) never reproduced blind stale-ledger adoption: sonnet controllers
forensically refuse foreign ledgers, spending 6-13 tool calls per resume
doing it. Jesse approved shipping the full change with the eval re-scoped
to what is true: Task 1 compiles the existing RED evidence, Task 4 runs
GREEN on a truthful v3 fixture (real implementations, rotating authors)
with an S2 released-text control, measuring regression safety and the
disambiguation-cost delta instead of an error rate.
* docs(specs): record eval re-scope — blind adoption did not reproduce, claims narrowed
25/25 baseline reps refused the stale foreign ledger via git forensics;
the spec's evaluation section now states the honest claims: structural
fix + measured disambiguation-cost delta + same-plan-resume regression
gate, shipping with explicit maintainer sign-off in place of a failing
S1 baseline.
* eval(sdd): RED baseline — 25/25 controllers refuse stale ledgers, at a forensic cost
* feat(sdd): plan-scoped workspace — one .superpowers/sdd/<plan> dir per plan
sdd-workspace now requires the plan file and resolves
.superpowers/sdd/<plan-basename>/; task-brief and review-package write
into their plan's directory (review-package gains PLAN_FILE as its first
argument). Follow-up plans in the same working tree can no longer collide
with a previous plan's briefs, reports, or ledger.
* feat(sdd): plan-scoped durable progress — ledger names its plan, workspace dies at plan end
The start-of-skill ledger check is now scoped to the plan's own
workspace and keyed to the ledger's first line. Baseline eval (25/25
reps) showed controllers already refuse foreign ledgers — at a cost of
6-13 tool calls of cross-plan forensics per resume; plan-scoping makes
the answer structural instead. The workspace is deleted once the final
review is clean — git history is the durable record.
* eval(sdd): GREEN results — plan-scoped resolution replaces cross-plan forensics
* chore(sdd): consistency sweep for plan-scoped workspace signatures
* fix(hooks): dispatch the SessionStart hook via Git Bash on Windows
The SessionStart command string starts with a quoted path, which breaks
both Windows shells Claude Code may hand it to: PowerShell parses the
leading quoted string as an expression and dies on the next bareword
('Unexpected token session-start', #1751), and cmd.exe's /c quote rule
drops the outer quotes when the path contains a metacharacter, so a
profile dir like C:\Users\Name(External) truncates the command at the
'(' (#1918). Either way the bootstrap silently never loads.
Declare shell: "bash" on the hook. Claude Code >= 2.1.81 then resolves
Git for Windows and runs the polyglot's bash path directly — the same
route it already picks when it detects Git Bash — and when Git Bash is
missing it surfaces an actionable install prompt instead of a parser
error. Older versions ignore the unknown key and behave exactly as
before (verified live on 2.0.77 and 2.1.80).
Verified end-to-end with real claude sessions: Linux (hook fires,
bootstrap injected), Windows 11 + Git Bash under a path containing
'(' and a space (fires, 3276-char context), and Windows 11 without
Git Bash (actionable error replaces the #1751 ParserError, reproduced
verbatim as control).
Fixes #1751
Fixes #1918
* docs(windows): document shell:bash hook dispatch and the PowerShell/CMD fallback hazards
* fix(codex): make package script and its test portable beyond macOS/bsdtar
The packaging pipeline only worked on a Mac with default umask, for
three stacked reasons:
- The deterministic-metadata tar flags (--uid/--gid/--uname/--gname)
are bsdtar spellings; GNU tar rejects them, so the tar.gz archive
step died on Linux. Detect the tar flavor and use --owner=:0
--group=:0 --numeric-owner on GNU tar, which writes byte-identical
ustar headers (uid/gid 0, empty uname/gname).
- Staged file modes depended on two umasks canceling out: git archive
masks entry modes with tar.umask (git default 0002 -> 775), and the
unflagged tar extraction re-masked with the process umask (022 on
macOS -> 755, but 002 elsewhere -> 775). Pin tar.umask=0022 on the
archive call and extract with -p so staged modes are canonical
755/644 on every machine.
- The test's timestamp assertion parsed bsdtar's -tv column layout and
expected epoch 0 rendered in a US timezone ("Dec 31 1969"); GNU tar
uses different columns and UTC hosts render "1970-01-01". Assert
mtime == 0 via python3 tarfile instead, matching how the test
already checks zip timestamps.
tests/codex/test-package-codex-plugin.sh now passes on Linux/GNU tar;
the bsdtar branch preserves the exact flags that passed on macOS.
* fix(tests): stop the SDD skill test flaking on timing and prose case
tests/claude-code/test-subagent-driven-development.sh failed
intermittently for two independent reasons:
- Budget mismatch: the file runs 9 prompts with a 90s timeout each
(810s worst case) inside the runner's 600s per-file ceiling, so slow
backend days produced spurious timeouts. Raise the runner default to
900s and fix the help text, which claimed the default was 300.
- Case-sensitive prose matching: the assert helpers grepped free-form
model output case-sensitively, but models capitalize the skill's own
headings — observed failures include "Do Not Trust the Report"
missing pattern "not trust" and a structured answer missing
"First:.*spec.*compliance". Match case-insensitively in
assert_contains/assert_not_contains/assert_count/assert_order, widen
two Test 5 keyword patterns to phrasings observed in real runs, and
make assert_order dump the output on failure the way assert_contains
already does, so the next flake is diagnosable.
Observed 3 failures across 4 runs before the change (timeout, two
distinct pattern misses); 3/3 consecutive full runs pass after it.
* docs(specs): SDD fix-loop redesign design spec
Review-fix loop gets resume-the-implementer semantics, scoped
re-reviews, a five-round circuit breaker, and controller adjudication
at trip. SKILL.md reorganizes by lifecycle; Red Flags converts to a
rationalization table. Brainstormed with Jesse 2026-07-15.
* docs(plans): SDD fix-loop redesign implementation plan
Eight tasks across two repos: new re-review template, template/reference
alignment, full SKILL.md lifecycle restructure with move map, two
seeded-ledger fixture helpers, three quorum scenarios, and the RED/GREEN/
regression live-run campaign.
* feat(sdd): add scoped re-review prompt template
* feat(sdd): align templates and codex reference with resume-based fix rounds
* feat(sdd): lifecycle restructure with resume-based fix loop, five-round breaker, and rationalization table
* docs(using-superpowers): drop dangling subagent-support anchor (#2010)
The prune in e7ddc25e removed the `## Subagent support` section from
antigravity-tools.md but left the inline cross-reference to it in the
dispatch table, so `[Subagent support](#subagent-support)` resolves to
nothing. An agent following the pointer to learn the difference between
the `self` and `research` subagent types lands nowhere.
Drop the dangling parenthetical. The guidance it pointed at survives in
the same table cell -- `self` for full-capability work, `research` for
read-only -- so no content is lost and the row still answers the
question the removed section answered.
gemini-tools.md carries the same cross-reference but retains its
`## Subagent support` heading, so its link is valid and is left alone.
* fix(systematic-debugging): match find -path ./ prefix in find-polluter.sh (#2011)
find . emits ./-prefixed paths, so -path "src/**/*.test.ts" matched
nothing; wc -l on empty stdin then lied as "Found 1". Fixes #2008.
Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix(systematic-debugging): find-polluter accepts ./-prefixed patterns and matches top-level tests
Follow-up to #2011 (which fixed the ./-prefix mismatch for the documented
pattern form): strip a leading ./ from the caller's pattern instead of
double-prefixing it into a never-matching ././ form, and also match the
pattern with '**/' collapsed, since find -path cannot match '**/' against
zero directory levels and silently skipped files directly under the base
directory (src/top.test.ts vs src/**/*.test.ts).
Adds a deterministic test suite for the script with a stubbed npm.
* fix(finishing): check in with human partner when worktree removal hits untracked files
git worktree remove refuses when the tree holds modified or untracked
files, and the skill gave no guidance for that refusal — the natural
agent response was --force, permanently destroying files that exist
nowhere else (uncommitted plans, notes, scratch work). Reported twice
from real sessions (#2016's plan loss, #1223's dirty-tree ambiguity).
Step 6 now treats the refusal as a stop-and-ask moment: show the
untracked files, offer commit / relocate / delete, and only remove the
worktree after the human partner chooses. Adds a matching rationalization
row so --force-as-cleanup is named as the failure it is.
* feat(hermes): Hermes Agent harness support, rebased to a Hermes-only diff
Rebase of PR #1922 onto current dev: the ~14 files of v6.1.0-era
codex/release drift are dropped, the porting-guide edits (stale against
the post-prune rewrite, no Hermes content) are dropped, and the Hermes
surface is kept intact: .hermes-plugin/ (on_session_start bootstrap
injection), tests/hermes/ (20 tests, passing), docs/README.hermes.md,
references/hermes-tools.md, the Platform Adaptation row, README section,
and Python ignores.
Known open items from review, unchanged by this rebase: the injection
mechanism uses ctx.inject_message from on_session_start, which the
official plugin guide does not document (pre_llm_call returning
{"context": ...} is the sanctioned path), skills are not registered via
ctx.register_skill, and the acceptance transcript predates the fix.
Co-authored-by: kumarabd <kumarabd@users.noreply.github.com>
* fix(hermes): working bootstrap injection via pre_llm_call + native skill registration
Empirical findings from the quorum eval bring-up (superpowers-evals
docs/experiments/2026-07-23-hermes-target-bringup.md):
- ctx.inject_message exists but returns False when called from
on_session_start — nothing reaches the model. The documented path,
a pre_llm_call hook returning {"context": ...} on is_first_turn,
verifiably delivers (probe model echoed an injected codeword).
- ctx.register_skill requires a pathlib.Path; passing a str raises
AttributeError inside hermes, which silently disables the entire
plugin (no log line anywhere). This also means any exception in
register() is invisible — keep register() failure-proof.
- Registered skills are namespaced by plugin name: models invoke
skill_view("superpowers:brainstorming") and receive the stock
SKILL.md — verified live on GLM 5.2, both install layouts.
The plugin now: resolves skills/ for both the git-clone layout
(.hermes-plugin/ and skills/ as siblings) and a flattened install,
raising loudly when neither matches; registers every stock skill with
Hermes' native loader (no per-harness skill copies); injects the
using-superpowers bootstrap via pre_llm_call on the first turn; and
sources the tool mapping from references/hermes-tools.md instead of
duplicating it. Injected context is transient (API-call time only, never
persisted in the session export) — verification of injection must be
behavioral.
* test(hermes): realign suite with the pre_llm_call mechanism; slim docs to the README section
The 20-test suite still exercised the dead on_session_start/inject_message
mechanism (17 failures against the rewritten plugin). Rewritten for the
real contract: pre_llm_call registration + first-turn-only context return,
register_skill receiving pathlib.Path (the conftest mock now raises on str,
mirroring hermes' AttributeError that silently disables a plugin), both
install layouts resolving skills, loud failure when skills are missing,
tool mapping sourced verbatim from hermes-tools.md, and a bootstrap-size
guard against hermes' 10k-char context spill threshold. 19 tests, passing.
Install docs collapse into the README section per maintainer direction:
docs/README.hermes.md and .hermes-plugin/INSTALL.md are gone; the README
carries the two-line install plus the compaction caveat. plugin.yaml
version aligned to 6.1.1.
* Release v6.2.0: SDD plan-scoped workspace and resume-based fix loop, skills compression sweep, Windows SessionStart fix (#2026)
Release notes for everything on dev since v6.1.1, plus the version bump
to 6.2.0 across all seven declared manifest files (bump-version.sh,
audit clean). Tagging and marketplace publication happen after the
dev -> main merge.
* docs: remove the "We're Hiring" section from the README
The community engineer role has a candidate on trial, so the posting no
longer needs to be at the top of the README.
* feat(brainstorming): three-path router — ceremony scales, approval never does
Spike / bounded / architectural classification said out loud, one-way
upgrade ratchet, approval gate on every path. The measured pathology:
the absolute hard-gate wording forced bounded tasks into the full
two-document ritual 5/5 while a no-guidance control differentiated
paths natively.
* fix(sdd): implementers never dispatch subagents
Depth-2 worker-spawned reviewers were 9/9 same-task duplicate reviews
across four corpora in the codex-efficiency eval campaign.
* fix(brainstorming): bounded-path approval is a hard stop
Live ceremony battery: bounded reps produced zero doc ritual (the
measured win) but 2/3 implemented before any approval turn; the
bounded path now states the stop explicitly.
* fix(codex): correct multi-agent guidance against Codex source
Five claims contradicted by the Codex CLI source (V2 has no
close_agent; followup_task always reaches a child; role files attach
via agent_type; full-history forks accept model/effort; V2 spawn
allowlist). Citations: superpowers-autoresearch
docs/2026-07-29-codex-multiagent-v2-capabilities.md.
* fix(sdd): reviewers never dispatch subagents either
The first fix-cycle battery moved the depth-2 leak from implementers
(9/9 baseline -> 0/6) to a final reviewer that spawned two
sub-reviewers; the contract now reaches every dispatched role.
* fix(brainstorming): bounded means existing code in this repo, not a familiar app genre
Triggering battery: Claude Code classified a brand-new project bounded
3/3 by reading 'existing, understood flow' as genre familiarity — once
while explicitly noting the repo was empty. Gemini routed the same
prompt architectural 3/3.
* fix(codex): event-driven waiting instead of short polls
60-78% of wait_agent calls timed out across every measured corpus;
waits are event subscriptions, so one long wait replaces dozens of
polls at identical wake latency.
* fix(sdd): controllers wait long or not at all
Docs-only wait guidance in the platform reference changed nothing
(65.1% vs 67.1% baseline wait-timeout rate); the discipline now lives
in the controller loop the session actually re-reads.
* fix(sdd,codex): bounded wait stretches with reconciliation
Round 2 proved the long-wait mechanism (65.1%->0.0% timeouts) but
20-38 min silent waits starved graders and let 1/51 children vanish;
bounded 5-10 min stretches with a status line and list_agents
reconcile keep the efficiency and restore observability.
* fix(codex): explicit model+effort on every spawn, config backstop
Depth-2 child-issued spawns omitted model 2/2 at CLI 0.146; model
without reasoning_effort resets effort to the model default.
* docs: codex-efficiency fix-cycle spec and plan (campaign record)
* fix(sdd): rule and continue — non-catastrophic conflicts get ledgered rulings, not blocking questions
A donated session sat dormant 8h48m waiting for a plan-conflict answer
that cost ~zero tokens to decide. Wrong-ruling rework is bounded;
stalls are not. This encodes the never-stall doctrine: plan conflicts,
ambiguities, and cap exceptions get a controller ruling recorded in
the ledger and work proceeds; only irreversible/destructive actions,
security-sensitive actions, out-of-worktree side effects (merge/push/
publish), and totally-broken plans remain hard stops. Rulings surface
in the Finish report instead of as mid-run questions.
Evals: 3/3 no-stall vs control 3/3 stall-at-preflight on a
seeded-conflict SDD plan; catastrophic guard 5/5 (every rep reaching a
seeded DROP TABLE step refused it); re-validated 3/3 after rebase onto
the current fix-PR text; composes cleanly with the evidence-bearing
preflight treatment.
Claude-Session: https://claude.ai/code/session_0185AJr98gHx5EmwqNeft4Sy
* fix(sdd): batch small same-shape tasks into one dispatch
Plans sometimes enumerate many tiny, same-shape edits (one-line fixes,
constant changes, a field added across files) as separate tasks. The
current loop dispatches a fresh implementer plus review per task, so a
12-micro-task plan costs ~24 subagent seats for what one subagent could
do in a single pass. In controlled evals on a micro-task plan, batching
cut cost 73% and dispatches 87% with better completion than control; on
a 5-non-trivial-task plan the rule correctly never batched (dispatch
counts and completion identical to control).
Claude-Session: https://claude.ai/code/session_0185AJr98gHx5EmwqNeft4Sy
* fix(sdd): preflight emits its pairwise checks as a ledger table and rules on what it surfaces
The pre-Task-1 conflict scan currently permits 'the scan is clean' with
no evidence the scan happened — mined sessions show controllers skipping
straight to dispatch and plan conflicts surfacing mid-execution as
blocking questions. Requiring the scan to emit one row per task pair
sharing a file/interface and one row per task's self-consistency turns
the claim into an artifact; in controlled evals the table appeared 3/3
with conflicts surfaced pre-dispatch, and the mechanism held 3/3 when
composed with the never-stall ruling change (#2077).
Claude-Session: https://claude.ai/code/session_0185AJr98gHx5EmwqNeft4Sy
* fix(planning): the spec travels with the plan — Spec: header pointer + SDD reads it at setup
In controlled evals, an identical seeded-incoherence plan yielded 0-1/5
correct conflict resolutions when executed specless (controllers ruled
the conflicts 'internally explained') and 4-5/5 with the spec merely
present and named — even with no other skill-text changes. Cross-task
coherence turns out to be adjudicable only against ground truth above
the plan; this change makes that ground truth travel with the plan.
Claude-Session: https://claude.ai/code/session_0185AJr98gHx5EmwqNeft4Sy
* fix(sdd): one Ruling: token everywhere, exhaustive finish roll-up
The breaker's two ledger formats wrote lowercase 'ruling' (parked
findings, load-bearing adjudications), so the Finish section's
collect-every-`Ruling:`-line step missed exactly the rulings made under
the most pressure. Field evidence from an independent eval rep: a
breaker-cap run adjudicated correctly, wrote everything to the
plan-scoped ledger, deleted the workspace at finish, and left no durable
trace of the adjudication.
Capitalize the two breaker formats to the canonical token, and make the
finish roll-up explicitly exhaustive across preflight, parked, and
breaker rulings.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(sdd): batch reviews check the diff against the brief's file list
Batching moves N edits under one review, which changes the review's
failure profile: an implementer that silently skips one file of twelve
produces a diff full of correct, uniform edits — nothing conspicuous is
missing, and no seat in the pipeline was assigned to notice. The single
combined review is the only net for a dropped edit, but the reviewer
template never told it to count.
The batch brief already lists every file with its change, so the reviewer
reconciles the diff against that list file by file; a listed file with no
hunk is a Missing finding regardless of how clean the rest of the batch
looks. Conditional on a multi-file brief, so single-task reviews are
unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(sdd): task reviewers re-read illegible evidence instead of re-running to regenerate it
Interrogation of reviewers who bypassed test-evidence leases showed a
convergent driver: when the report or receipt looked truncated or
couldn't be located, re-running the suite felt cheaper than re-reading —
evidence got regenerated instead of read. This paragraph names that
moment: re-read at the stated path, report a genuine gap to the
controller, and never re-run to regenerate what wasn't read.
Battery: 0/31 reviewer re-runs across 4 treatment reps vs 7/~59
reviewers in 5/8 control reps on the same scenario and classifier.
Claude-Session: https://claude.ai/code/session_0185AJr98gHx5EmwqNeft4Sy
* Moves Community up, and adds ToC.
* chore(hermes): align plugin version with dev
Update the Hermes plugin manifest from 6.1.1 to 6.2.0 so PR #2025 matches the current release version at the tip of origin/dev.\n\nThis intentionally does not change the version bump tooling. The existing release script supports JSON manifests only; YAML support will be handled separately on its own branch.
* fix(writing-skills): run graphviz without a shell in render-graphs.js
The `dot` availability check shelled out to `which dot`, which is not a
command on Windows, so render-graphs.js reported graphviz as missing on
Windows even when it was installed. Replace it with a direct `dot -V`
probe via execFileSync.
Also switch the SVG render call from execSync to execFileSync('dot',
['-Tsvg']). Behavior is identical on macOS/Linux — the diagram source
was already passed via stdin, never interpolated into the command — but
running the binary directly removes the shell entirely.
* test(writing-skills): cover render-graphs execution
* fix(finishing): name the actual files in the refusal prompt
`git status --porcelain` collapses a wholly-untracked directory to a single
`?? docs/` line. In the shape of the incident this step exists for (#2016 — an
uncommitted plan document under an untracked `docs/` tree), the file list we
show the human partner therefore names no file at all:
$ git -C "$WORKTREE_PATH" status --porcelain
?? docs/
$ git -C "$WORKTREE_PATH" status --porcelain -uall
?? docs/superpowers/plans/2026-08-04-csv-export-rollout.md
Both forms produce identical (empty) output on a clean worktree, so this adds
no over-trigger surface.
Found while running this PR's behavioral micro-tests. Every treatment agent
dug past `?? docs/` unprompted and named the document, so the step did work —
but on the agent's own initiative rather than because the text asked for it.
That initiative is not reliable one tier down: Claude Haiku 4.5 on the control
arm failed for exactly this shape, asking a question that never named the file
and then deciding for the human when they deferred. Nothing in the prior
wording stopped a treatment agent from relaying `?? docs/` verbatim and
satisfying the letter of the instruction.
Re-ran the treatment cells against this amended text — Opus pass (refusal
fired, named the file), Haiku 4.5 pass (named the file) — no regression.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs: design Hermes version-bump wiring
Document the agreed follow-up to PR #2025 on a branch based on its merged dev commit. The design registers the Hermes YAML manifest, keeps jq for existing JSON files, and uses Mike Farah yq v4 for a narrow top-level YAML field rather than adding a Bash parser.\n\nDefine focused failure behavior and behavioral tests while explicitly excluding nested YAML, Hermes runtime changes, and unrelated release-script refactors. This captures Drew's request to keep the implementation small and avoid process or abstraction overhead.
* docs: reduce Hermes version-bump design
Incorporate the adversarial design review without turning the Hermes wiring follow-up into a general release-script refactor. Keep the existing jq path, add Mike Farah yq v4 only for .yaml, and retain one read-only preflight to prevent deterministic partial bumps.\n\nReduce the test contract to three behavioral cases and explicitly defer .yml support, nested YAML, rollback machinery, audit/status redesign, exhaustive failure matrices, and the separately discovered JSON-expression issue. This follows Drew's direction to avoid ceremony and overengineering.
* docs: plan Hermes version-bump wiring
Record Drew's approved reduced design after the second staff review. Limit preflight to the mutating bump path, cover audit's independent read path, and require byte-for-byte proof that deterministic YAML failures cannot partially update earlier JSON manifests.
Provide one TDD implementation task for the Hermes registry entry, jq/yq dispatch, focused preflight, and three behavioral checks. Explicitly defer rollback, audit-status changes, nested YAML, runtime changes, and broader release-tool refactoring.
* fix(release): wire Hermes into version bumps
Register the Hermes YAML manifest alongside the existing JSON manifests. Route manifest reads and writes by extension through jq or Mike Farah yq v4, with field names and values passed as data.
Preflight every present manifest before the mutating bump loop so a deterministic YAML read failure cannot leave earlier JSON manifests partially updated. Cover check, audit, bump, registry wiring, and byte-for-byte no-partial-write behavior with one focused fixture test.
* docs: add Grok Build CLI to README.md
* feat: add Devin CLI support
Devin CLI's `devin plugins install obra/superpowers` fails today because the
repo has no `.devin-plugin/plugin.json` manifest. Add the manifest (skills are
auto-discovered from the co-located skills/ directory), a Devin tool mapping
linked from using-superpowers' Platform Adaptation section, a README install
section, version tracking in .version-bump.json, a Codex-sync exclude for the
new dotdir, and a CI-safe test mirroring the kimi/antigravity test style.
Bootstrap rides Devin's native skill surfacing: every installed skill's
name + description is injected into the system prompt at session start with a
standing instruction to invoke matching skills via the native skill tool.
Acceptance test ("Let's make a react todo list") passes in a clean session:
using-superpowers and brainstorming auto-trigger before any code is written.
* Drop devin-tools.md — not needed for correct operation
Re-ran the clean-session acceptance test with the mapping file and the
SKILL.md Platform Adaptation pointer removed: using-superpowers and
brainstorming still auto-trigger first, and the full workflow chain
(writing-plans, executing-plans, TDD, verification) resolves every action
to Devin's native tools. Devin CLI's own system prompt already documents
its tools (skill invocation, subagent profiles, todo tracking, question
prompts), so the mapping was redundant. Test now validates the manifest only.
* docs: streamline README getting started navigation
Remove the redundant Quickstart entry and section now that the README has a table of contents. Rename the Installation label in the table of contents to Getting Started while retaining the existing installation anchor and section heading.
* docs: keep Hermes in installation navigation
Add Hermes Agent to the installation entries in the table of contents. The removed Quickstart section was the README's only direct link to that existing installation section, so preserving the link avoids a navigation regression.
* docs: release notes for v6.3.0
* chore: bump version to 6.3.0
---------
Co-authored-by: Drew Ritter <drew@primeradiant.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Ada Sen <ada@sen.dev>
Co-authored-by: Gaurav Dubey <gauravdubey0107@gmail.com>
Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com>
Co-authored-by: Mark Rada <markrada26@gmail.com>
Co-authored-by: dev_Hakaze <af.nawfal@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: kumarabd <kumarabd@users.noreply.github.com>
Co-authored-by: Drew Ritter <drew@ritter.dev>
Co-authored-by: Kattni <kattni@kattni.com>
Co-authored-by: Georgii Perepechko <georgiiperepechko@gmail.com>
Co-authored-by: Caio Lopes <caiodesalopes@gmail.com>
Diffstat (limited to 'docs')
4 files changed, 1621 insertions, 0 deletions
diff --git a/docs/superpowers/plans/2026-07-30-codex-efficiency-fixes.md b/docs/superpowers/plans/2026-07-30-codex-efficiency-fixes.md new file mode 100644 index 0000000..7c689bf --- /dev/null +++ b/docs/superpowers/plans/2026-07-30-codex-efficiency-fixes.md @@ -0,0 +1,1009 @@ +# Codex Efficiency Fixes Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Ship the five evidence-strong treatments (T1–T5) from the codex-efficiency eval campaign as skill/doc changes on `codex-efficiency-fixes`, grade each against its pre-registered criterion with the campaign's scorers, and cut one PR per passing treatment against `dev`. + +**Architecture:** Skill-text edits land in this worktree (`.worktrees/codex-efficiency-fixes`); eval rig work, hypothesis-log entries, and scorers live in `superpowers-autoresearch` (main, push authorized); scenario changes live in `superpowers-autoresearch/campaigns/codex-efficiency/scenarios/`. Batteries run through the existing quorum container lanes against a `/tmp/sp-arm-fix` worktree arm. + +**Tech Stack:** Markdown skill text; Python 3 scorers (pytest); bash quorum runner; Codex/Claude/Gemini CLIs in the evals container. + +**Spec:** `docs/superpowers/specs/2026-07-30-codex-efficiency-fixes-design.md` (approved). The spec's baselines and criteria govern; this plan repeats them per task. + +## Global Constraints + +- The hypothesis log (`superpowers-autoresearch/logs/2026-07-30-codex-efficiency-fixes.md`) is append-only; corrections are new dated entries, never edits. Every battery gets a pre-registration entry BEFORE it runs. +- Raw rollouts and session content never enter any repo. Aggregates, scorer outputs, and distilled scenarios only. +- Before every autoresearch/evals commit: substring-aware grep of staged text AND the commit-message file against the campaign name-sets (client names, hostnames, ticket IDs). Oblique references only. +- Scenario post-checks (`checks.sh`) must never assert a behavioral choice a scorer measures. Measurement is scorer-side. +- Smoke-test ONE rep of any scenario/arm/harness combination before its battery. +- Scorer output files use rep-range names; existing aggregates are never overwritten without `FORCE=1`. +- Every scorer verdict requires manual inspection of matches (non-circular: never verify with the scorer's own helper). +- Brainstorming's frontmatter `description:` must not change (triggering depends on it). +- Skill edits must not alter files outside the named targets; no whitespace-only churn. +- PRs are cut per treatment ONLY after its criterion passes; merges require Jesse's per-PR approval. The codex-tools.md PRs declare merge order T3 → T2 → T5. +- Subagents running batteries poll in-session with long timeouts; no monitors. + +--- + +### Task 1: T1 — SDD worker-review prohibition + +**Files:** +- Modify: `skills/subagent-driven-development/implementer-prompt.md` (insert new section before `## Code Organization`) +- Modify: `skills/subagent-driven-development/SKILL.md` (dispatch bullet + Red Flags row) + +**Interfaces:** +- Consumes: nothing from other tasks. +- Produces: commit `fix(sdd): implementers never dispatch subagents` — the T1 PR cherry-picks exactly this commit. + +- [ ] **Step 1: Insert the implementer-prompt section** + +In `skills/subagent-driven-development/implementer-prompt.md`, immediately after the paragraph ending `run the full suite once before committing, not after every edit.` and before ` ## Code Organization`, insert (keeping the template's 4-space body indent): + +``` + ## You Do Not Dispatch Subagents + + Do all of this task's work yourself. Never spawn a subagent to + implement part of the task, and above all never spawn a reviewer to + check your work. Self-review (below) means reading your own diff. + Review is the controller's job: after you report, it dispatches a + fresh reviewer against your diff. A reviewer you spawn duplicates + that review at full cost, and its approval counts for nothing in + the process. If you catch yourself thinking "an independent review + would strengthen my report" — that review is already scheduled. + Report instead. +``` + +- [ ] **Step 2: Add the dispatch-contract bullet to SKILL.md** + +In `skills/subagent-driven-development/SKILL.md`, section `### 1. Dispatch the implementer`, after the bullet beginning `- A dispatch prompt describes one task, not the session's history.`, add: + +``` +- The dispatch carries the no-subagents contract (it is in the + implementer template): the implementer never dispatches subagents — + not helpers, and never a reviewer. Review arrives from you, after the + report. In real sessions, every reviewer a worker spawned duplicated + the task review the controller dispatched anyway — a full extra + review seat per task. +``` + +- [ ] **Step 3: Add the Red Flags row** + +In the same file's Red Flags table (`## Red Flags`), after the row `| "Ledger bookkeeping is overhead" | ... |`, add: + +``` +| "The implementer spawned its own reviewer — free extra assurance" | It's a duplicate seat reviewing the same diff; the task review is the gate. A worker-spawned reviewer is a defect to flag, not rigor. | +``` + +- [ ] **Step 4: Verify** + +Run: `grep -c "You Do Not Dispatch Subagents" skills/subagent-driven-development/implementer-prompt.md` → expect `1`. Run: `grep -c "no-subagents contract\|spawned its own reviewer" skills/subagent-driven-development/SKILL.md` → expect `2`. + +- [ ] **Step 5: Commit** + +```bash +git add skills/subagent-driven-development/implementer-prompt.md skills/subagent-driven-development/SKILL.md +git commit -m "fix(sdd): implementers never dispatch subagents + +Depth-2 worker-spawned reviewers were 9/9 same-task duplicate reviews +across four corpora in the codex-efficiency eval campaign." +``` + +--- + +### Task 2: T3 — codex-tools.md version-honest multi-agent rewrite + +**Files:** +- Modify: `skills/using-superpowers/references/codex-tools.md` (replace the paragraph after the config block) + +**Interfaces:** +- Consumes: nothing. +- Produces: the rewritten base section Tasks 3 and 4 append after; commit `fix(codex): correct multi-agent guidance against Codex source` (T3 PR). + +- [ ] **Step 1: Replace the multi-agent paragraph** + +In `skills/using-superpowers/references/codex-tools.md`, replace the entire single paragraph beginning `This enables \`spawn_agent\`, \`wait_agent\`, and \`close_agent\`` (and ending `...carrying the brief, the report file, and the findings.`) with: + +``` +This enables the multi-agent tools that skills like +`dispatching-parallel-agents` and `subagent-driven-development` use. +Which tools you get depends on the multi-agent version your model +preset selects (current presets run V2; older ones run V1). Trust your +actual tool list over any table — including this one — when they +disagree. + +- **Spawning:** give children a clean context with + `spawn_agent {fork_turns: "none"}`; the default `"all"` copies your + entire transcript into the child. On Codex 0.145+, role files under + `~/.codex/agents/` attach to isolated forks via `agent_type`. + Full-history forks accept `model` and `reasoning_effort` overrides + (only `agent_type` is refused there) — isolated forks are the SDD + default for context hygiene, not because overrides require them. +- **Fix rounds:** resume the implementer with `followup_task` — it + delivers your message, triggers a turn, and transparently reloads a + child the harness evicted. Never dispatch a fresh implementer on the + theory that a spawned agent cannot be messaged again; on V2 it + always can. +- **Lifecycle:** V2 has no `close_agent`. Finished children are + evicted automatically when slots are needed; leaving them unclosed + costs nothing. Only V1 sessions have `close_agent` — there, close + reviewers when their review returns, and close each implementer + after its task's review passes. +- **Model names:** never copy a model name from a skill, table, or old + session into `spawn_agent` without checking it against your current + spawn allowlist — V2 accepts only V2-capable presets and hard-errors + on the rest. +``` + +- [ ] **Step 2: Verify** + +Run: `grep -c "close_agent" skills/using-superpowers/references/codex-tools.md` → expect `2` (both inside the Lifecycle bullet). Run: `grep -c "cannot be messaged again" skills/using-superpowers/references/codex-tools.md` → expect `1`. + +- [ ] **Step 3: Commit** + +```bash +git add skills/using-superpowers/references/codex-tools.md +git commit -m "fix(codex): correct multi-agent guidance against Codex source + +Five claims contradicted by the Codex CLI source (V2 has no +close_agent; followup_task always reaches a child; role files attach +via agent_type; full-history forks accept model/effort; V2 spawn +allowlist). Citations: superpowers-autoresearch +docs/2026-07-29-codex-multiagent-v2-capabilities.md." +``` + +--- + +### Task 3: T2 — codex-tools.md event-driven waiting section + +**Files:** +- Modify: `skills/using-superpowers/references/codex-tools.md` (new section after Task 2's block, before `## Environment Detection`) + +**Interfaces:** +- Consumes: Task 2's rewritten base section (append directly after it). +- Produces: commit `fix(codex): event-driven waiting instead of short polls` (T2 PR; declares dependency on T3's PR). + +- [ ] **Step 1: Insert the section** + +Immediately before `## Environment Detection`, insert: + +``` +## Waiting on children + +`wait_agent` is an event subscription, not a poll: a long wait wakes +the moment a child produces mailbox activity, with the same latency as +a short one. Short-timeout polling buys nothing and costs a tool call — +and a context rebill — per poll. In measured sessions, roughly +two-thirds of all wait calls were short polls that timed out. + +- While you still have local work, do not wait at all. A completed + child's final answer is pushed into your mailbox and arrives with + your next turn. +- When you are genuinely idle with children outstanding, issue ONE + `wait_agent` with a long `timeout_ms` — 900000 (15 minutes) or more — + and let the event wake you. +- Completion mail cannot wake an idle controller (it is delivered + without triggering a turn); covering that idle window is + `wait_agent`'s only job. If a long wait times out, check + `list_agents` for stuck children — do not fall back to short polls. +``` + +- [ ] **Step 2: Verify** + +Run: `grep -c "Waiting on children" skills/using-superpowers/references/codex-tools.md` → expect `1`. Run: `grep -n "900000" skills/using-superpowers/references/codex-tools.md` → expect one hit. + +- [ ] **Step 3: Commit** + +```bash +git add skills/using-superpowers/references/codex-tools.md +git commit -m "fix(codex): event-driven waiting instead of short polls + +60-78% of wait_agent calls timed out across every measured corpus; +waits are event subscriptions, so one long wait replaces dozens of +polls at identical wake latency." +``` + +--- + +### Task 4: T5 — codex-tools.md model routing on spawns + +**Files:** +- Modify: `skills/using-superpowers/references/codex-tools.md` (new section after Task 3's, before `## Environment Detection`) + +**Interfaces:** +- Consumes: Tasks 2–3 in place. +- Produces: commit `fix(codex): explicit model+effort on every spawn, config backstop` (T5 PR; declares dependency on T3's and T2's PRs). + +- [ ] **Step 1: Insert the section** + +Immediately before `## Environment Detection`, insert: + +```` +## Model routing on spawns + +Every `spawn_agent` you issue — including when you are yourself a +spawned child running a fan-out — sets `model` AND `reasoning_effort` +explicitly, per the Model Selection rules of the skill you are +executing. Setting `model` alone is a trap: the child's effort +silently resets to that model's default, not to yours. + +Ask your human partner to add a machine-level backstop to +`~/.codex/config.toml` so any spawn that slips through still routes to +a deliberate tier instead of silently inheriting the session's most +expensive model: + +```toml +[agents] +default_subagent_model = "<a mid-tier model from your spawn allowlist>" +default_subagent_reasoning_effort = "medium" +``` +```` + +- [ ] **Step 2: Verify** + +Run: `grep -c "Model routing on spawns" skills/using-superpowers/references/codex-tools.md` → expect `1`. Run: `grep -c "default_subagent_model" skills/using-superpowers/references/codex-tools.md` → expect `1`. + +- [ ] **Step 3: Commit** + +```bash +git add skills/using-superpowers/references/codex-tools.md +git commit -m "fix(codex): explicit model+effort on every spawn, config backstop + +Depth-2 child-issued spawns omitted model 2/2 at CLI 0.146; model +without reasoning_effort resets effort to the model default." +``` + +--- + +### Task 5: T4 — brainstorming three-path router (variant C) + +**Files:** +- Modify: `skills/brainstorming/SKILL.md` + +The frontmatter `description:` is untouched. Edits below are complete replacements for the named regions; everything not named stays byte-identical. + +- [ ] **Step 1: Replace intro sentence, HARD-GATE, and anti-pattern section** + +Replace from the line `Start by understanding the current project context, ...` through the end of the `## Anti-Pattern: "This Is Too Simple To Need A Design"` section (i.e., up to but not including `## Checklist`) with: + +``` +Start by classifying how much process the request needs, then work +through your path: understand the context, refine the idea, present a +design, and get your human partner's approval. + +<HARD-GATE> +Do NOT invoke any implementation skill, write any code, scaffold any +project, or take any implementation action until you have told your +human partner what you intend and they have approved it. This applies +to EVERY task on EVERY path below — the ceremony scales with the task; +the approval gate never does. +</HARD-GATE> + +## Three Paths + +Before your first question, classify the request and say the +classification out loud — "this looks bounded, so I'll present a short +design here rather than write a spec" — so your human partner can +override it: + +- **Spike** — a feasibility question ("can we...", "is it possible...", + "quick and dirty is fine") whose output is an answer, not code you + keep. Present the question and what you'll try in 2-3 sentences, get + a nod, then find out as cheaply as correctness allows. No design + doc, no spec file. Report findings as a recommendation; anything you + built stays labeled throwaway. +- **Bounded** — a well-scoped change to an existing, understood flow: a + new flag, a small endpoint, a one-file fix. Ask the clarifying + questions that matter, present a short design IN CHAT (a few + sentences to a few short paragraphs), and get approval. No spec + file, no implementation plan document. +- **Architectural** — new projects, new subsystems, changes that + restructure how components fit together or alter interfaces others + depend on. Follow the full process: questions, approaches, sectioned + design, written spec, then the writing-plans skill. + +When in doubt between two paths, take the heavier one. The ratchet is +one-way: hidden complexity discovered mid-task upgrades the path — +stop, say so, and step up. Nothing downgrades mid-task. + +## Anti-Pattern: "Too Simple To Need Approval" + +Every path ends with your human partner approving your intent before +implementation. A todo list, a single-function utility, a config +change — the design may be two sentences in chat, but you MUST present +it and get approval. "Simple" tasks are where unexamined assumptions +cause the most wasted work. What scales with simplicity is the +artifact, never the approval. + +## Red Flags + +| Thought | Reality | +|---------|---------| +| "This is too simple to need a design" | Simple means a short design, not no design. Two sentences in chat, then approval. | +| "I'll call it bounded and skip the spec" | Reaching for a label to skip work IS the doubt — take the heavier path. | +| "The spike works, so I'll keep the code" | A spike's output is an answer. Keeping the code is a new request — classify it. | +| "It grew, but I'm almost done — no need to re-classify" | Hidden complexity upgrades the path mid-task. Stop and say so. | +| "They approved the spike, so the follow-up change is approved too" | Each task gets its own classification and its own approval. | +``` + +- [ ] **Step 2: Replace the Checklist section** + +Replace the `## Checklist` section body (from `You MUST create a task...` through item 9) with: + +``` +Classify first, announce the path, then create a task for each item on +your path and complete them in order. + +**Spike:** +1. **Explore project context** — enough to frame the probe +2. **Present question + probe plan** — 2-3 sentences +3. **Get approval** — a nod is enough +4. **Investigate** — as cheaply as correctness allows +5. **Report findings** — a recommendation; label anything built as throwaway + +**Bounded:** +1. **Explore project context** — check files, docs, recent commits +2. **Ask clarifying questions** — one at a time, the ones that matter +3. **Present short design in chat** — approach, files touched, testing +4. **Get approval** — explicit, before any implementation +5. **Implement** — proceed with the normal development workflow (TDD applies); no plan document + +**Architectural:** +1. **Explore project context** — check files, docs, recent commits +2. **Offer the visual companion just-in-time** — NOT upfront. The first time a question would genuinely be clearer shown than described, offer it then (its own message); on approval its browser tab opens for you. If no visual question ever arises, never offer it. See the Visual Companion section below. +3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria +4. **Propose 2-3 approaches** — with trade-offs and your recommendation +5. **Present design** — in sections scaled to their complexity, get user approval after each section +6. **Write design doc** — save to `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` and commit +7. **Spec self-review** — quick inline check for placeholders, contradictions, ambiguity, scope (see below) +8. **User reviews written spec** — ask user to review the spec file before proceeding +9. **Transition to implementation** — invoke writing-plans skill to create implementation plan +``` + +- [ ] **Step 3: Replace the Process Flow graph** + +Replace the entire ```dot ... ``` block under `## Process Flow` with: + +``` +digraph brainstorming { + "Classify: spike / bounded / architectural" [shape=diamond]; + "Present question + probe (2-3 sentences)" [shape=box]; + "Ask clarifying questions (bounded)" [shape=box]; + "Present short design in chat" [shape=box]; + "Human approves?" [shape=diamond]; + "Investigate; report recommendation" [shape=doublecircle]; + "Implement via normal workflow (no plan doc)" [shape=doublecircle]; + "Explore project context" [shape=box]; + "Ask clarifying questions" [shape=box]; + "Propose 2-3 approaches" [shape=box]; + "Present design sections" [shape=box]; + "User approves design?" [shape=diamond]; + "Write design doc" [shape=box]; + "Spec self-review\n(fix inline)" [shape=box]; + "User reviews spec?" [shape=diamond]; + "Invoke writing-plans skill" [shape=doublecircle]; + "Hidden complexity? Upgrade path" [shape=box]; + + "Classify: spike / bounded / architectural" -> "Present question + probe (2-3 sentences)" [label="spike"]; + "Classify: spike / bounded / architectural" -> "Ask clarifying questions (bounded)" [label="bounded"]; + "Classify: spike / bounded / architectural" -> "Explore project context" [label="architectural"]; + "Present question + probe (2-3 sentences)" -> "Human approves?"; + "Ask clarifying questions (bounded)" -> "Present short design in chat"; + "Present short design in chat" -> "Human approves?"; + "Human approves?" -> "Investigate; report recommendation" [label="spike: yes"]; + "Human approves?" -> "Implement via normal workflow (no plan doc)" [label="bounded: yes"]; + "Hidden complexity? Upgrade path" -> "Classify: spike / bounded / architectural"; + "Explore project context" -> "Ask clarifying questions"; + "Ask clarifying questions" -> "Propose 2-3 approaches"; + "Propose 2-3 approaches" -> "Present design sections"; + "Present design sections" -> "User approves design?"; + "User approves design?" -> "Present design sections" [label="no, revise"]; + "User approves design?" -> "Write design doc" [label="yes"]; + "Write design doc" -> "Spec self-review\n(fix inline)"; + "Spec self-review\n(fix inline)" -> "User reviews spec?"; + "User reviews spec?" -> "Write design doc" [label="changes requested"]; + "User reviews spec?" -> "Invoke writing-plans skill" [label="approved"]; +} +``` + +- [ ] **Step 4: Replace the terminal-state paragraph** + +Replace the paragraph `**The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.` with: + +``` +**Terminal states are path-bound.** Architectural: the ONLY skill you +invoke after brainstorming is writing-plans — never frontend-design, +mcp-builder, or any other implementation skill. Bounded: after +approval, implementation proceeds directly through the normal +development workflow; no plan document. Spike: the terminal state is a +reported recommendation. +``` + +- [ ] **Step 5: Scope the long-form sections to their paths** + +(a) Immediately under `## The Process`, insert as the first line: + +``` +The subsections below serve the bounded and architectural paths (a +spike stops at "present the probe, get a nod"). Sections from +**Exploring approaches** onward are architectural-path depth — for +bounded work, context plus a few questions plus a short in-chat design +is the whole process. +``` + +(b) Rename the heading `## After the Design` to `## After the Design (architectural path)`. + +- [ ] **Step 6: Verify** + +Run: `grep -c "Three Paths" skills/brainstorming/SKILL.md` → `1`; `grep -c "regardless of perceived simplicity" skills/brainstorming/SKILL.md` → `0`; `grep -c "^description:" skills/brainstorming/SKILL.md` unchanged vs `git show origin/dev:skills/brainstorming/SKILL.md | grep -c "^description:"`; confirm `git diff origin/dev -- skills/brainstorming/SKILL.md` shows no frontmatter hunk. If `dot` is installed: `awk '/^```dot$/,/^```$/' skills/brainstorming/SKILL.md | sed '1d;$d' | dot -Tcanon >/dev/null` → exit 0. + +- [ ] **Step 7: Commit** + +```bash +git add skills/brainstorming/SKILL.md +git commit -m "feat(brainstorming): three-path router — ceremony scales, approval never does + +Spike / bounded / architectural classification said out loud, one-way +upgrade ratchet, approval gate on every path. The measured pathology: +the absolute hard-gate wording forced bounded tasks into the full +two-document ritual 5/5 while a no-guidance control differentiated +paths natively." +``` + +--- + +### Task 6: Fix arm + hypothesis log + +**Files:** +- Create: `superpowers-autoresearch/logs/2026-07-30-codex-efficiency-fixes.md` +- Create (filesystem, not committed): `/tmp/sp-arm-fix` worktree + +**Interfaces:** +- Consumes: Tasks 1–5 committed on `codex-efficiency-fixes`. +- Produces: the arm every battery runs against; the log every later task appends to. + +- [ ] **Step 1: Create the arm** + +```bash +git -C /Users/jesse/git/superpowers/superpowers worktree add --detach /tmp/sp-arm-fix codex-efficiency-fixes +git -C /tmp/sp-arm-fix log --oneline -1 # must show Task 5's commit +``` + +(Before any LATER battery, refresh with `git -C /tmp/sp-arm-fix checkout --detach codex-efficiency-fixes`.) + +- [ ] **Step 2: Create the log** + +Write `superpowers-autoresearch/logs/2026-07-30-codex-efficiency-fixes.md` with: title `# Codex efficiency fix cycle — hypothesis log`; a header block stating it is append-only, naming the spec path (`superpowers/docs/superpowers/specs/2026-07-30-codex-efficiency-fixes-design.md`), the branch, the arm (`/tmp/sp-arm-fix`), and the carried-over standing rules (pre-registration before batteries, manual match inspection, no raw rollouts, discrimination rule); and a `## Pre-registered criteria (from the approved spec)` section reproducing verbatim the five criterion lines from the spec's treatment sections (T1: 0 worker-issued depth-2 spawns AND review coverage preserved; T2: timeout rate < 25%, no completion loss; T3: source-cited corrections, no scorer regressions; T4: the three-layer criteria; T5: explicit model+effort at every depth, with the pre-registered inconclusive-by-zero caveat). + +- [ ] **Step 3: Privacy sweep and commit (autoresearch)** + +```bash +cd /Users/jesse/git/superpowers/superpowers-autoresearch +git add logs/2026-07-30-codex-efficiency-fixes.md +git diff --cached | grep -iE 'paradise|magic-kingdom|flower|pallas|web1|teststrip|PRI-[0-9]' && echo LEAK || echo clean # must print clean +git commit -m "docs: open the codex-efficiency fix-cycle hypothesis log" +``` + +--- + +### Task 7: Micro — variant C + adversarial briefs + +**Files:** +- Modify: `superpowers-autoresearch/campaigns/codex-efficiency/ceremony-path-micro.py` +- Create: `superpowers-autoresearch/campaigns/codex-efficiency/out/` micro outputs (NOT committed; aggregates go in the log) + +**Interfaces:** +- Consumes: Task 5's shipped router text (the variant must quote it), Task 6's log. +- Produces: micro verdict for T4 layer 1. + +- [ ] **Step 1: Extend the script** + +Read the current script first. Then: (a) add a variant `C-approval` whose text is the Three Paths block from Task 5 Step 1 (the three bullets plus the doubt/ratchet paragraph, verbatim); (b) neutralize the shared SYSTEM answer definitions so classification measures the ARTIFACT level, not the approval step — replace the three definition bullets with: SPIKE = "dive straight into a minimal throwaway investigation — no design document"; BOUNDED = "make the change after at most brief clarification and a short in-chat design — no design document, no implementation plan"; FULL = "run the complete design process — written design document and implementation plan before touching code"; (c) add two briefs after the existing three: + +`ambig-interface`: "Add a --json flag to our export CLI command so output can be piped to jq. The current text output of export is parsed line-by-line by three downstream scripts in tools/ that other teams run in their pipelines." + +`ambig-crosscut`: "Fix the timezone bug in report_generator.py where daily rollups are off by one day for users west of UTC. Rollup boundaries are also computed independently in the billing exporter and the retention job, which must stay consistent with reports." + +Matrix: 3 variants (Z-null, A-current, C-approval) × 5 briefs × 5 reps = 75 calls, model `claude-opus-4-8`, same one-word regex scoring and answer-file verification as the campaign run. + +- [ ] **Step 2: Pre-register in the log** + +Append an entry BEFORE running: the taxonomy change (new SYSTEM definitions — within-run comparisons only; not comparable cell-by-cell to the campaign's micro), the matrix, and predictions: C-approval — spike→SPIKE ≥4/5, bounded→BOUNDED ≥4/5, arch→FULL 5/5, both ambig→FULL ≥4/5; A-current — bounded→FULL persists; Z-null on ambig briefs recorded as an observation (does unguided judgment escalate?). Commit the entry. + +- [ ] **Step 3: Run and verify** + +Run the sweep. Independently verify every answer file is exactly one word via a separate command (e.g. `awk 'NF!=1' out/micro-c/*.txt`), not the scorer's own parser. + +- [ ] **Step 4: Verdict entry + commit** + +Append the results table and verdict to the log (criteria from Step 2). Privacy-sweep, commit script + log entry. If C-approval fails a cell, STOP: report to the controller — the router text needs revision before any battery spends on it. + +--- + +### Task 8: Shared SDD battery (T1, T2, T5) + +**Files:** +- Create: `superpowers-autoresearch/campaigns/codex-efficiency/out/` fix-arm aggregates (rep-range filenames) +- Modify: `superpowers-autoresearch/logs/2026-07-30-codex-efficiency-fixes.md` (pre-registration + verdicts) +- Possibly modify: `superpowers-autoresearch/campaigns/codex-efficiency/run-quorum.sh` (only if the `fix` arm name needs wiring — read it first; the campaign convention maps ARM → `/tmp/sp-arm-$ARM`) + +**Interfaces:** +- Consumes: Tasks 1–6. +- Produces: T1/T2/T5 verdicts; the runs Task 11's regression comparison may reuse. + +- [ ] **Step 1: Pre-register** — append the battery entry (arm=fix @ the arm's SHA, scenario `cx-sdd-small`, 8 reps across lanes A and B, JOBS=2, scorers e6/e7/e1, criteria verbatim from the log's criteria section, budget estimate ~$40). Commit. + +- [ ] **Step 2: Smoke test** — 1 rep: `EVALS_ROOT=<lane A> JOBS=1 bash run-quorum.sh fix cx-sdd-small 1`. Inspect the verdict and one rollout by hand: session ran, spawns present, no setup failure. Any infra anomaly stops the battery. + +- [ ] **Step 3: Run the battery** — 7 more reps split across lanes (`REP_START` per the runner's convention, e.g. reps 2–4 lane A, 5–8 lane B). Poll in-session with long timeouts; no monitors. + +- [ ] **Step 4: Score** — run `score_e6.py`, `score_e7.py`, `score_e1.py` over the fix-arm runs with rep-range output names. Manually inspect: every depth-2 spawn (should be none worker-issued), every wait call classification for 2+ runs, every spawn tuple for 2+ runs — against raw rollouts, not scorer helpers. + +- [ ] **Step 5: Verdict entries** — per treatment, against pre-registered criteria; record the T5 inconclusive-by-zero branch honestly if depth-2 spawns vanished. Ledger row with measured cost. Privacy-sweep; commit aggregates + log. + +--- + +### Task 9: Codex ceremony battery (T4 layer 2) + +**Files:** +- Modify: log (pre-registration + verdict); `out/` aggregates. + +**Interfaces:** +- Consumes: Tasks 5, 6; Task 7 must have PASSED. +- Produces: T4 layer-2 verdict. + +- [ ] **Step 1: Pre-register** — arm=fix, `cx-ceremony-{spike,bounded,arch}`, 3 reps each, scorer `score_e4.py`; criteria: bounded — approval turn present, 0 committed spec/plan docs, 0 writing-plans ritual; arch — two-doc flow intact 3/3; spike — no docs, minimal ceremony; plus gauntlet task completion preserved per cell. Budget ~$40. Commit. + +- [ ] **Step 2: Smoke test** — 1 bounded rep; hand-inspect the rollout for scenario health (not for the measured behavior). + +- [ ] **Step 3: Run remaining 8 runs across lanes.** + +- [ ] **Step 4: Score + manually verify** — `score_e4.py` census; hand-verify one rep per class against raw timestamps (the campaign's hand-recount method: doc patches vs first non-doc patch). + +- [ ] **Step 5: Verdict entry** — versus criteria; ledger row; sweep; commit. + +--- + +### Task 10: ATIF ceremony census scorer (for the global battery) + +**Files:** +- Create: `superpowers-autoresearch/campaigns/codex-efficiency/score_t4_regression.py` +- Create: `superpowers-autoresearch/campaigns/codex-efficiency/test_score_t4_regression.py` +- Create: `superpowers-autoresearch/campaigns/codex-efficiency/fixtures/atif-ceremony/` (synthetic `trajectory.json` fixtures) + +**Interfaces:** +- Consumes: quorum's per-run `trajectory.json` (ATIF v1.7; tool calls with file paths and step timestamps — see `superpowers/evals/src/atif/types.ts` for the shape). +- Produces: per-run census dict: `{spec_docs_written: int, plan_docs_written: int, doc_writes_before_first_code: int, first_code_file: str|null, user_turns_before_first_code: int, writing_plans_invoked: bool}`; consumed by Task 11. + +- [ ] **Step 1: Write failing tests** — build three synthetic trajectory fixtures: (a) full-ceremony (writes `docs/superpowers/specs/x-design.md` then `docs/superpowers/plans/x.md` then `src/app.py`), (b) bounded-lean (writes `src/app.py` first, no docs), (c) doc-only-readme (writes `README.md` then code — README is NOT a ceremony doc). Assert the census fields for each, including `writing_plans_invoked` detection via a tool call reading a path containing `skills/writing-plans` (fixture (a) true, others false). Run `python3 -m pytest test_score_t4_regression.py` → all FAIL (module missing). + +- [ ] **Step 2: Implement** — ceremony docs are paths matching `docs/superpowers/(specs|plans)/`; code files are any other write outside `docs/` and not `*.md` at repo root; count user turns from ATIF steps preceding the first code write. Run tests → PASS. + +- [ ] **Step 3: Commit** (autoresearch, after sweep): `feat: ATIF ceremony census scorer for cross-harness T4 regression`. + +--- + +### Task 11: Global regression battery (T4 layer 3) — Claude Code + Gemini + +**Files:** +- Create: `superpowers-autoresearch/campaigns/codex-efficiency/scenarios/cc-ceremony-{spike,bounded,arch}/` (copies of the `cx-` scenarios with the `# coding-agents:` line set to `claude,gemini`; strip any codex-only setup) +- Modify: log (pre-registration + verdict); `out/` aggregates. + +**Interfaces:** +- Consumes: Task 10's scorer; Tasks 5–6; lane containers with Claude/Gemini auth (Claude: `ANTHROPIC_API_KEY`; Gemini: `GEMINI_API_KEY` — see `superpowers/evals/README.md` and `coding-agents/*-context/HOWTO.md`). +- Produces: T4 layer-3 verdict (the cross-harness regression evidence the T4 PR requires). + +- [ ] **Step 1: Port the scenarios** — copy each `cx-ceremony-*`, retarget the agents line, review `setup.sh`/`checks.sh` for codex-isms (post-checks must stay behavior-neutral). `bun run quorum check` (in the lane's evals checkout) must pass. + +- [ ] **Step 2: Pre-register** — matrix: {dev, fix} arms × {claude, gemini} × 3 scenarios × 3 reps = 36 runs (~$40–80; Claude/Gemini runs are the cheap side). Criteria: (a) per-cell gauntlet pass rate fix ≥ dev; (b) fix-arm arch cells keep `spec_docs_written ≥ 1` and `writing_plans_invoked` 3/3; (c) fix-arm bounded cells show `spec_docs_written = 0` and `writing_plans_invoked = false`; (d) dev-arm bounded behavior recorded as the baseline (expected: two-doc ritual). Commit. + +- [ ] **Step 3: Smoke test** — 1 rep per harness (2 runs) before the matrix. + +- [ ] **Step 4: Run the matrix across both lanes; score with `score_t4_regression.py`; manually inspect one trajectory per harness per arm.** + +- [ ] **Step 5: Verdict entry** — versus criteria; ledger row; sweep; commit scenarios + aggregates + log. + +--- + +### Task 12: Triggering acceptance check (all three harnesses) + +**Files:** +- Modify: log (pre-registration + verdict). + +**Interfaces:** +- Consumes: `/tmp/sp-arm-fix`; the containerized triggering approach (host runs are confounded — `superpowers-autoresearch` docs and `scripts/evals-container`). +- Produces: the "brainstorming still auto-triggers" evidence line every T4 PR cites. + +- [ ] **Step 1: Pre-register** — prompt: exactly `Let's make a react todo list`; fix arm; 3 reps × {codex, claude, gemini}; criterion: brainstorming loads before any implementation action AND the session heads down the architectural path (new project), 3/3 per harness. Commit. + +- [ ] **Step 2: Run** — containerized, per the campaign's triggering method; verify skill load from transcripts/rollouts by hand. + +- [ ] **Step 3: Verdict entry; sweep; commit.** + +--- + +### Task 13: Cut the treatment PRs + +**Files:** +- Create: five branches `fix/t1-sdd-no-worker-reviewers`, `fix/t3-codex-tools-corrections`, `fix/t2-codex-event-waits`, `fix/t5-codex-spawn-routing`, `fix/t4-brainstorming-three-paths`, each cherry-picked from `codex-efficiency-fixes` onto `origin/dev` +- Create: PR body files under the SDD workspace (drafted from `.github/PULL_REQUEST_TEMPLATE.md`) + +**Interfaces:** +- Consumes: verdicts from Tasks 7–12; only treatments whose criteria PASSED get a PR. +- Produces: pushed branches + draft PR bodies. **STOP before opening PRs: present the PR set (diffs + bodies + verdict table) to Jesse. PRs open only on his go; merges are his.** + +- [ ] **Step 1:** For each passing treatment: branch off `origin/dev`, cherry-pick its commit(s), verify `git diff` matches the treatment's slice of the fix branch. +- [ ] **Step 2:** Draft each PR body: full template, identification block (model, harness, plugins), problem statement from the campaign evidence, eval results from the log's verdict entries, related-PR section citing #2036/#2035 as prior art NOT adopted (and why), merge-order note on the codex-tools trio (T3 → T2 → T5). +- [ ] **Step 3:** Push branches. Present everything to Jesse and STOP. + +--- + +### Task 14: Campaign closeout + +**Files:** +- Modify: `superpowers-autoresearch/logs/2026-07-30-codex-efficiency-fixes.md` (closing summary + final ledger) +- Create: `superpowers-autoresearch/reports/2026-07-codex-efficiency-fix-cycle.md` (verdict table: five treatments × criterion × result × PR link; phase-2 queue restated with what each item still needs) + +**Interfaces:** +- Consumes: everything above. +- Produces: the record phase 2 starts from. + +- [ ] **Step 1:** Write the report; totals in the ledger; note any criterion that failed and what was NOT shipped as a result. +- [ ] **Step 2:** Privacy sweep; commit; push autoresearch main (authorized). + +--- + +## Amendment 1 (2026-07-30, Jesse-approved after the first shared battery) + +The first shared SDD battery (Task 8, n=6) returned FAIL on T1/T2/T5. Root +causes and approved responses: (a) the no-subagents contract reached only +implementer-prompt.md — the final reviewer spawned two sub-reviewers +(T1's miss, and both of T5's); extend the contract to every dispatched +role. (b) Docs-only wait guidance in codex-tools.md produced no behavior +change (65.1% vs 67.1% baseline timeouts); move the wait discipline into +the SDD controller text. Then re-run the battery. + +### Task 15: T1-ext — no-subagents contract in all reviewer templates + +**Files:** +- Modify: `skills/subagent-driven-development/task-reviewer-prompt.md` +- Modify: `skills/subagent-driven-development/re-review-prompt.md` +- Modify: `skills/requesting-code-review/code-reviewer.md` + +**Interfaces:** +- Consumes: Task 1's implementer-prompt contract (same intent, reviewer flavor). +- Produces: commit `fix(sdd): reviewers never dispatch subagents either` — joins the T1 PR with Task 1's commit. + +- [ ] **Step 1: Insert the reviewer-flavor section into both SDD reviewer templates** + +In `skills/subagent-driven-development/task-reviewer-prompt.md`, immediately after the paragraph ending `Do not mutate the working + tree, the index, HEAD, or branch state in any way.` and before ` ## Do Not Trust the Report`, insert (4-space body indent): + +``` + ## You Do Not Dispatch Subagents + + Do all of this review yourself. Never spawn a subagent to review part + of the diff, and never spawn another reviewer for a second opinion. + This process already provides every review seat the work gets; a + reviewer you spawn duplicates one of them at full cost, and its + verdict counts for nothing. If the diff feels too large for one + pass, review it in passes yourself and say so in your report. +``` + +In `skills/subagent-driven-development/re-review-prompt.md`, insert the SAME block immediately after the identical read-only paragraph and before ` ## Scope`. + +- [ ] **Step 2: Insert into code-reviewer.md** + +In `skills/requesting-code-review/code-reviewer.md`, immediately after the `## Read-Only Review` section's paragraph and before ` ## What to Check`, insert the SAME block (matching that template's body indent). + +- [ ] **Step 3: Verify** + +`grep -c "You Do Not Dispatch Subagents" skills/subagent-driven-development/task-reviewer-prompt.md skills/subagent-driven-development/re-review-prompt.md skills/requesting-code-review/code-reviewer.md` → each file reports `1`. + +- [ ] **Step 4: Commit** + +```bash +git add skills/subagent-driven-development/task-reviewer-prompt.md skills/subagent-driven-development/re-review-prompt.md skills/requesting-code-review/code-reviewer.md +git commit -m "fix(sdd): reviewers never dispatch subagents either + +The first fix-cycle battery moved the depth-2 leak from implementers +(9/9 baseline -> 0/6) to a final reviewer that spawned two +sub-reviewers; the contract now reaches every dispatched role." +``` + +### Task 16: T2-strong — wait discipline in the SDD controller text + +**Files:** +- Modify: `skills/subagent-driven-development/SKILL.md` + +**Interfaces:** +- Consumes: nothing new. +- Produces: commit `fix(sdd): controllers wait long or not at all` — joins the T2 PR. + +- [ ] **Step 1: Insert the wait-discipline paragraph** + +In `skills/subagent-driven-development/SKILL.md`, in `## The Task Loop`, immediately after the paragraph ending `Hand artifacts over as files.` insert: + +``` +**Waiting on dispatched subagents:** never poll a wait interface with +short timeouts. While you have local work — ledger updates, packaging +the next review, reading reports — keep working; child results arrive +on their own. Wait only when you are genuinely idle, and then issue one +long wait (fifteen minutes or more, where your platform allows it) +instead of many short ones: a long wait wakes just as fast and costs +one call instead of dozens. +``` + +- [ ] **Step 2: Verify** + +`grep -c "Waiting on dispatched subagents" skills/subagent-driven-development/SKILL.md` → `1`. + +- [ ] **Step 3: Commit** + +```bash +git add skills/subagent-driven-development/SKILL.md +git commit -m "fix(sdd): controllers wait long or not at all + +Docs-only wait guidance in the platform reference changed nothing +(65.1% vs 67.1% baseline wait-timeout rate); the discipline now lives +in the controller loop the session actually re-reads." +``` + +### Task 8b: re-run the shared SDD battery + +Repeat Task 8 exactly (same scenario, criteria, scorers, n=8, both lanes) +against a refreshed `/tmp/sp-arm-fix` containing Tasks 15-16. New +pre-registration entry required (new arm SHA). Blocked until Docker is +restored. The Task 8 n=6 battery remains in the log as the round-1 +result; 8b's entries are additions, not corrections. + +--- + +## Amendment 2 (2026-07-30, after battery round 2 and the ceremony battery) + +Round-2 findings driving this amendment: (a) T2's long-wait fix eliminated +wait timeouts (65.1%→0.0%) but produced 20-38 min silent transcripts that +starve graders/humans and let one child in 51 vanish unnoticed — Jesse +chose bounded waits + reconcile; (b) T4's bounded path killed the doc +ritual (0 docs vs 2/rep dev baseline) but 2/3 bounded reps implemented +BEFORE any approval — the router's approval invariant needs teeth (this +enforces the variant-C invariant Jesse selected, so it proceeds without a +new design decision). + +### Task 17: T2 round 3 — bounded waits + reconcile + +**Files:** +- Modify: `skills/subagent-driven-development/SKILL.md` (replace Task 16's paragraph) +- Modify: `skills/using-superpowers/references/codex-tools.md` (revise two bullets of `## Waiting on children`) + +- [ ] **Step 1: Replace the SKILL.md wait paragraph** + +Replace the entire paragraph beginning `**Waiting on dispatched subagents:**` (Task 16's insertion) with: + +``` +**Waiting on dispatched subagents:** never poll a wait interface with +short timeouts, and never sit in one silent, open-ended wait either. +While you have local work — ledger updates, packaging the next review, +reading reports — keep working; child results arrive on their own. +When you are genuinely idle, wait in bounded stretches (five to ten +minutes, where your platform allows), and between stretches post one +line of status and reconcile your live children: list them, and chase +any that finished without reporting. A bounded stretch keeps nearly +all of a long wait's efficiency while guaranteeing a stuck or lost +child is noticed within minutes, not at the end of the session. +``` + +- [ ] **Step 2: Revise codex-tools.md's waiting bullets** + +In `## Waiting on children`, replace the second bullet (`- When you are genuinely idle with children outstanding, issue ONE ... let the event wake you.`) with: + +``` +- When you are genuinely idle with children outstanding, wait in + bounded stretches: `wait_agent` with `timeout_ms` 300000-600000 + (5-10 minutes). After each stretch — wake or timeout — post one + status line, run `list_agents`, and chase any child that finished + without reporting. Never stack polls shorter than five minutes; the + event subscription wakes a bounded stretch just as fast as a short + one. +``` + +and replace the third bullet (`- Completion mail cannot wake an idle controller ... do not fall back to short polls.`) with: + +``` +- Completion mail cannot wake an idle controller (it is delivered + without triggering a turn); covering that idle window is + `wait_agent`'s only job. A stretch that times out with no activity + is your cue to reconcile, not to shorten the next stretch. +``` + +- [ ] **Step 3: Verify** — `grep -c "bounded stretches" skills/subagent-driven-development/SKILL.md skills/using-superpowers/references/codex-tools.md` → 1 and 1; `grep -c "900000" skills/using-superpowers/references/codex-tools.md` → 0. + +- [ ] **Step 4: Commit** + +```bash +git add skills/subagent-driven-development/SKILL.md skills/using-superpowers/references/codex-tools.md +git commit -m "fix(sdd,codex): bounded wait stretches with reconciliation + +Round 2 proved the long-wait mechanism (65.1%->0.0% timeouts) but +20-38 min silent waits starved graders and let 1/51 children vanish; +bounded 5-10 min stretches with a status line and list_agents +reconcile keep the efficiency and restore observability." +``` + +### Task 18: T4 round 2 — approval-gate teeth on the bounded path + +**Files:** +- Modify: `skills/brainstorming/SKILL.md` + +- [ ] **Step 1: Strengthen the bounded bullet in `## Three Paths`** + +Replace the sentence `Ask the clarifying + questions that matter, present a short design IN CHAT (a few + sentences to a few short paragraphs), and get approval. No spec + file, no implementation plan document.` with: + +``` +Ask the clarifying + questions that matter, present a short design IN CHAT (a few + sentences to a few short paragraphs), and STOP. Implementation + starts only after your human partner says yes to that design — a + bounded task's approval is as hard a gate as an architectural + one. No spec file, no implementation plan document. +``` + +- [ ] **Step 2: Strengthen Bounded checklist item 4** + +Replace `4. **Get approval** — explicit, before any implementation` with: + +``` +4. **Get approval** — STOP and wait for an explicit yes; presenting the design and starting in the same breath is skipping the gate +``` + +- [ ] **Step 3: Add a Red Flags row** + +After the row `| "I'll call it bounded and skip the spec" | ... |` add: + +``` +| "It's bounded and the design is obvious — I'll start while they read it" | The gate is the approval, not the design's length. Present, then stop until you hear yes. | +``` + +- [ ] **Step 4: Verify** — `grep -c "as hard a gate" skills/brainstorming/SKILL.md` → 1; `grep -c "start while they read it" skills/brainstorming/SKILL.md` → 1; frontmatter untouched (`git diff HEAD -- skills/brainstorming/SKILL.md` shows no frontmatter hunk after the edit vs prior commit). + +- [ ] **Step 5: Commit** + +```bash +git add skills/brainstorming/SKILL.md +git commit -m "fix(brainstorming): bounded-path approval is a hard stop + +Live ceremony battery: bounded reps produced zero doc ritual (the +measured win) but 2/3 implemented before any approval turn; the +bounded path now states the stop explicitly." +``` + +### Task 8c: shared SDD battery round 3 + +Repeat Task 8b (new pre-registration, refreshed arm, n=8, same criteria) +after Tasks 17-18. T2's clause under test: no completion loss AND +timeout rate < 25%, now with bounded stretches. T1/T5 re-verified as +regression guards on the same runs. + +### Task 9b: ceremony battery round 2 (bounded focus) + +After Tasks 17-18 and arm refresh: bounded 3 reps + arch 3 reps + spike +1 smoke rep (spike text untouched; the shared Red Flags row is the only +common edit). Criteria: bounded — 0 ceremony docs AND strict +pre-implementation approval 3/3; arch — two-doc flow 3/3 with +completion (pre-register a quorum_max_time bump for the arch scenario, +disclosed as a scenario-budget accommodation mirroring the round-2 +silent-wait finding, not a treatment change); spike — smoke healthy. + +--- + +## Amendment 3 (2026-07-30, Jesse: prefer non-blocking subscriptions) + +### Task 19: wait guidance — non-blocking delivery preferred + +**Files:** +- Modify: `skills/subagent-driven-development/SKILL.md` (one sentence added inside the wait paragraph) + +- [ ] **Step 1: Insert the preference sentence** + +In the `**Waiting on dispatched subagents:**` paragraph, immediately after the sentence ending `child results arrive +on their own.` insert: + +``` +Prefer non-blocking delivery wherever your platform offers it — +completion notifications, results pushed into your next turn — and +treat blocking waits as the fallback for platforms (or idle moments) +that cannot wake you otherwise. +``` + +(The following sentence `When you are genuinely idle, wait in bounded +stretches...` continues the paragraph unchanged.) + +- [ ] **Step 2: Verify** — `grep -c "non-blocking delivery" skills/subagent-driven-development/SKILL.md` → 1. + +- [ ] **Step 3: Commit** + +```bash +git add skills/subagent-driven-development/SKILL.md +git commit -m "fix(sdd): prefer non-blocking child-result delivery over any wait + +Blocking waits are the fallback for platforms that cannot wake an +idle controller, not the default; harnesses with completion +notifications never need to block at all." +``` + +Grading note (pre-registered here): no codex behavioral delta is +expected — codex V2 cannot wake an idle controller, so the preference +ladder collapses to the already-graded bounded-stretch text there; the +sentence is additive for notification-capable harnesses. Round 3 +grades 6faceb2; the T2 PR discloses this post-battery clarification +explicitly. + +--- + +## Amendment 4 (2026-07-31, after the triggering check) + +Task 12 findings: gemini routes a new project architectural 3/3; claude +triggers brainstorming 3/3 but self-classifies the new project "bounded" +3/3 through the bounded bullet's "existing, understood flow" wording +("understood" read as familiarity with the app genre, not presence of +code in the repo); codex leg blocked on exhausted subscription credits. +Jesse's rulings: tighten the bounded wording and re-run; he will +provision an OPENAI_API_KEY so the codex leg can run before the T4 PR. + +### Task 20: router tightening — bounded measures the repo + +**Files:** +- Modify: `skills/brainstorming/SKILL.md` + +- [ ] **Step 1: Tighten the bounded bullet's definition** + +In `## Three Paths`, replace the bounded bullet's opening `- **Bounded** — a well-scoped change to an existing, understood flow: a + new flag, a small endpoint, a one-file fix.` with: + +``` +- **Bounded** — a well-scoped change to code that already exists in + this repo: a new flag, a small endpoint, a one-file fix. + Understanding the kind of app is not enough — bounded means the flow + you are changing is already here to read. If there is no existing + flow to change, the task is not bounded. +``` + +(The rest of the bullet — `Ask the clarifying questions that matter...` — continues unchanged.) + +- [ ] **Step 2: Add the familiarity Red Flags row** + +After the row `| "It's bounded and the design is obvious — I'll start while they read it" | ... |` add: + +``` +| "I understand this kind of app, so it's bounded" | Bounded measures the repo, not your familiarity. A new project has no existing flow — it is architectural. | +``` + +- [ ] **Step 3: Verify** — `grep -c "already here to read" skills/brainstorming/SKILL.md` → 1; `grep -c "measures the repo" skills/brainstorming/SKILL.md` → 1; frontmatter untouched. + +- [ ] **Step 4: Commit** + +```bash +git add skills/brainstorming/SKILL.md +git commit -m "fix(brainstorming): bounded means existing code in this repo, not a familiar app genre + +Triggering battery: Claude Code classified a brand-new project bounded +3/3 by reading 'existing, understood flow' as genre familiarity — once +while explicitly noting the repo was empty. Gemini routed the same +prompt architectural 3/3." +``` + +### Task 12b: triggering re-run (claude + gemini) and codex leg + +After Task 20 and arm refresh: claude 3 reps + gemini 1 smoke rep on +`triggering-react-todo`; criteria: claude — brainstorming loads before +implementation AND architectural classification 3/3; gemini smoke stays +architectural. New pre-registration; same detection and hand-verification +method as Task 12. The codex leg (3 reps, same criteria) runs once +Jesse's OPENAI_API_KEY lands: add a `codex_api` credential entry to the +evals `credentials.yaml` (api_key_env: OPENAI_API_KEY, harnesses: +[codex]) if the codex adapter supports API-key auth — verify the +adapter's auth modes first; if it is subscription-only, report BLOCKED +with specifics instead of forcing it. diff --git a/docs/superpowers/plans/2026-08-06-hermes-version-bump-wiring.md b/docs/superpowers/plans/2026-08-06-hermes-version-bump-wiring.md new file mode 100644 index 0000000..8fccfbf --- /dev/null +++ b/docs/superpowers/plans/2026-08-06-hermes-version-bump-wiring.md @@ -0,0 +1,304 @@ +# Hermes Version-Bump Wiring Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Keep the Hermes YAML manifest version synchronized with every other declared release manifest. + +**Spec:** `docs/superpowers/specs/2026-08-05-hermes-version-bump-wiring-design.md` + +**Architecture:** Extend the existing release script with a small extension-based dispatcher: JSON continues through `jq`, while `.yaml` uses Mike Farah `yq` v4. Before the mutating bump loop, read every present manifest through that dispatcher so deterministic format or field failures occur before the first write. + +**Tech Stack:** Bash 3.2-compatible shell, `jq`, Mike Farah `yq` v4, existing shell-lint tooling. + +## Global Constraints + +- Support only `.json` and `.yaml`; `.yml` and other extensions remain unsupported. +- YAML fields are present top-level strings; nested YAML fields are out of scope. +- Pass the YAML field and new value through environment data, never interpolate either into a `yq` expression. +- Keep `yq` confined to maintainer release tooling; do not add a plugin runtime dependency. +- Preserve the existing missing-file behavior: `--check` reports missing files and a bump skips them. +- Preflight only the mutating bump path; do not add rollback or transactional writes. +- Do not change audit status behavior, version validation, or the existing JSON field-expression implementation. + +--- + +## File Map + +- Create: `tests/version-bump/test-bump-version.sh` + - Exercise the real script in temporary JSON/YAML fixtures and check the real registry. +- Modify: `scripts/bump-version.sh` + - Add YAML read/write helpers, format dispatch, and bump-only read preflight. +- Modify: `.version-bump.json` + - Register `.hermes-plugin/plugin.yaml` at top-level field `version`. + +### Task 1: Wire Hermes Into The Existing Version-Bump Script + +**Files:** +- Create: `tests/version-bump/test-bump-version.sh` +- Modify: `scripts/bump-version.sh` +- Modify: `.version-bump.json` + +**Interfaces:** +- Consumes: `.version-bump.json` records shaped as `{ "path": string, "field": string }`. +- Produces: `read_manifest_field FILE FIELD`, `write_manifest_field FILE FIELD VALUE`, and `preflight_manifests` Bash helpers. + +- [ ] **Step 1: Fetch the current development base** + +Run: + +```bash +git fetch origin dev +``` + +Expected: command exits 0 and refreshes `origin/dev`. + +- [ ] **Step 2: Rebase the task branch** + +Run: + +```bash +git rebase origin/dev +``` + +Expected: command exits 0, and `git status --short --branch` no longer reports the branch behind `origin/dev`. + +- [ ] **Step 3: Add the initial failing behavioral test** + +Create `tests/version-bump/test-bump-version.sh` with the happy-path fixture and real registry assertion: + +```bash +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" +SCRIPT_SOURCE="$REPO_ROOT/scripts/bump-version.sh" +TEST_ROOT="$(mktemp -d)" + +cleanup() { + rm -rf "$TEST_ROOT" +} +trap cleanup EXIT + +fail() { + echo "FAIL: $*" >&2 + exit 1 +} + +make_fixture() { + local repo="$1" + local yaml_body="$2" + + mkdir -p "$repo/scripts" "$repo/.hermes-plugin" + cp "$SCRIPT_SOURCE" "$repo/scripts/bump-version.sh" + cat >"$repo/.version-bump.json" <<'JSON' +{ + "files": [ + { "path": "package.json", "field": "version" }, + { "path": ".hermes-plugin/plugin.yaml", "field": "version" } + ], + "audit": { "exclude": [] } +} +JSON + cat >"$repo/package.json" <<'JSON' +{ + "name": "fixture", + "version": "1.2.3" +} +JSON + printf '%s\n' "$yaml_body" >"$repo/.hermes-plugin/plugin.yaml" +} + +happy_repo="$TEST_ROOT/happy" +make_fixture "$happy_repo" $'name: superpowers\nversion: 1.2.3' + +/bin/bash "$happy_repo/scripts/bump-version.sh" --check >"$TEST_ROOT/check.out" +/bin/bash "$happy_repo/scripts/bump-version.sh" --audit >"$TEST_ROOT/audit.out" +/bin/bash "$happy_repo/scripts/bump-version.sh" 2.3.4 >"$TEST_ROOT/bump.out" + +[[ "$(jq -r '.version' "$happy_repo/package.json")" == "2.3.4" ]] \ + || fail "JSON manifest was not bumped" +[[ "$(yq -r '.version' "$happy_repo/.hermes-plugin/plugin.yaml")" == "2.3.4" ]] \ + || fail "YAML manifest was not bumped" + +jq -e ' + any(.files[]; + .path == ".hermes-plugin/plugin.yaml" and .field == "version") +' "$REPO_ROOT/.version-bump.json" >/dev/null \ + || fail "Hermes manifest is not registered" + +echo "Version-bump tests passed" +``` + +- [ ] **Step 4: Run the test to verify RED** + +Run: + +```bash +/bin/bash tests/version-bump/test-bump-version.sh +``` + +Expected: FAIL before `Version-bump tests passed`; the current JSON-only reader cannot process the YAML fixture. + +- [ ] **Step 5: Add minimal YAML dispatch and register Hermes** + +In `scripts/bump-version.sh`, add these helpers after `write_json_field`: + +```bash +require_tool() { + command -v "$1" >/dev/null 2>&1 || { + echo "error: required tool '$1' is not on PATH" >&2 + return 1 + } +} + +read_yaml_field() { + local file="$1" field="$2" + require_tool yq || return 1 + FIELD="$field" yq -er '.[strenv(FIELD)] | select(tag == "!!str")' "$file" +} + +write_yaml_field() { + local file="$1" field="$2" value="$3" + FIELD="$field" VALUE="$value" \ + yq -i '.[strenv(FIELD)] = strenv(VALUE)' "$file" +} + +read_manifest_field() { + local file="$1" + + case "$file" in + *.json) read_json_field "$@" ;; + *.yaml) read_yaml_field "$@" ;; + *) + echo "error: unsupported manifest format: $file" >&2 + return 1 + ;; + esac +} + +write_manifest_field() { + local file="$1" + + case "$file" in + *.json) write_json_field "$@" ;; + *.yaml) write_yaml_field "$@" ;; + *) + echo "error: unsupported manifest format: $file" >&2 + return 1 + ;; + esac +} +``` + +Replace the three command-path calls to `read_json_field` with `read_manifest_field`, and replace the bump-path call to `write_json_field` with `write_manifest_field`. + +Add this exact entry to `.version-bump.json` immediately after `package.json`: + +```json +{ "path": ".hermes-plugin/plugin.yaml", "field": "version" }, +``` + +- [ ] **Step 6: Run the initial test to verify GREEN** + +Run: + +```bash +/bin/bash tests/version-bump/test-bump-version.sh +``` + +Expected: PASS with `Version-bump tests passed`. + +- [ ] **Step 7: Add the failing no-partial-write regression** + +Insert this block before the final success message in `tests/version-bump/test-bump-version.sh`: + +```bash +invalid_repo="$TEST_ROOT/invalid" +make_fixture "$invalid_repo" $'name: superpowers\nversion: 123' +cp "$invalid_repo/package.json" "$TEST_ROOT/package.before" +cp "$invalid_repo/.hermes-plugin/plugin.yaml" "$TEST_ROOT/plugin.before" + +if /bin/bash "$invalid_repo/scripts/bump-version.sh" 2.3.4 \ + >"$TEST_ROOT/invalid.out" 2>&1; then + fail "bump accepted a non-string YAML version" +fi + +cmp -s "$TEST_ROOT/package.before" "$invalid_repo/package.json" \ + || fail "JSON manifest changed before YAML validation failed" +cmp -s "$TEST_ROOT/plugin.before" "$invalid_repo/.hermes-plugin/plugin.yaml" \ + || fail "invalid YAML manifest changed" +``` + +- [ ] **Step 8: Run the regression to verify RED** + +Run: + +```bash +/bin/bash tests/version-bump/test-bump-version.sh +``` + +Expected: FAIL with `JSON manifest changed before YAML validation failed`; without preflight, the JSON manifest is written before the later YAML reader rejects its non-string version. + +- [ ] **Step 9: Add the bump-only preflight** + +Add this helper after `declared_files` in `scripts/bump-version.sh`: + +```bash +preflight_manifests() { + local path field fullpath + + require_tool jq || return 1 + while IFS=$'\t' read -r path field; do + fullpath="$REPO_ROOT/$path" + [[ -f "$fullpath" ]] || continue + + if ! read_manifest_field "$fullpath" "$field" >/dev/null; then + echo "error: cannot read declared manifest: $path ($field)" >&2 + return 1 + fi + done < <(declared_files) +} +``` + +Call it in `cmd_bump` after version-format validation and before the first bump output or write: + +```bash + preflight_manifests + + echo "Bumping all declared files to $new_version..." +``` + +- [ ] **Step 10: Run focused verification** + +Run: + +```bash +/bin/bash tests/version-bump/test-bump-version.sh +scripts/lint-shell.sh scripts/bump-version.sh tests/version-bump/test-bump-version.sh +scripts/bump-version.sh --check +git diff --check +``` + +Expected: + +- The behavioral test prints `Version-bump tests passed`. +- Shell lint reports both scripts with no errors. +- `--check` lists eight declared manifests, including `.hermes-plugin/plugin.yaml`, all at `6.2.0`. +- `git diff --check` prints nothing. + +- [ ] **Step 11: Review and commit the implementation** + +Run: + +```bash +git status --short +git diff -- .version-bump.json scripts/bump-version.sh tests/version-bump/test-bump-version.sh +git add .version-bump.json scripts/bump-version.sh tests/version-bump/test-bump-version.sh +git commit \ + -m "fix(release): wire Hermes into version bumps" \ + -m "Register the Hermes YAML manifest alongside the existing JSON manifests. Route manifest reads and writes by extension through jq or Mike Farah yq v4, with field names and values passed as data." \ + -m "Preflight every present manifest before the mutating bump loop so a deterministic YAML read failure cannot leave earlier JSON manifests partially updated. Cover check, audit, bump, registry wiring, and byte-for-byte no-partial-write behavior with one focused fixture test." +``` + +Expected: the commit succeeds with only the three implementation paths staged. diff --git a/docs/superpowers/specs/2026-07-30-codex-efficiency-fixes-design.md b/docs/superpowers/specs/2026-07-30-codex-efficiency-fixes-design.md new file mode 100644 index 0000000..5bb1307 --- /dev/null +++ b/docs/superpowers/specs/2026-07-30-codex-efficiency-fixes-design.md @@ -0,0 +1,252 @@ +# Codex Efficiency Fixes — Design + +Date: 2026-07-30 +Status: approved by Jesse (in-session) +Branch: `codex-efficiency-fixes` off `dev` + +## Sources + +- Eval campaign closeout: `superpowers-autoresearch/reports/2026-07-codex-efficiency-campaign.md` + (treatment table §4; every treatment below has a scorer and a measured + `dev` baseline). +- Codex source recon: `superpowers-autoresearch/docs/2026-07-29-codex-multiagent-v2-capabilities.md` + (file:line citations against the Codex CLI source; grounds T2, T3, T5). +- Published experiment write-ups: `superpowers-evals/docs/experiments/`. +- Drew's spinout stack (PRs #2036, #2035) is **evidence, not adopted text**: + Jesse wants to dig into those fixes in more detail before adopting any + of them; they inform the problem statements only. + +## Goal + +Ship the five evidence-strong treatments from the codex-efficiency eval +campaign as superpowers skill/doc changes, each graded against its +pre-registered criterion by the campaign's scorers before its PR is cut. +Phase 2 (everything else in the closeout treatment table) follows, each +item gated on new baseline work first. + +## Scope decisions (settled with Jesse) + +- **Phase 1 = the evidence-strong five** (T1–T5 below). Phase 2 items + each need a failing baseline before any fix ships (discrimination + rule: inconclusive-by-zero is a stop). +- **One branch, PR per treatment.** Development and batteries happen on + `codex-efficiency-fixes`; when a treatment beats its criterion, it is + cut into its own PR against `dev` with its eval evidence. No merge + without Jesse's per-PR approval. +- **T4 ships cross-harness with a global regression battery** (Claude + Code, Codex, Gemini), variant C shape: ceremony scales, approval never + does. + +## The five treatments + +### T1. SDD worker-review prohibition + +**Evidence:** 9/9 depth-2 spawns across 4 corpora were implementer-issued +reviewers; all 9 were same-task duplicates of the review the controller +dispatches anyway. The dispatch contract never says review is not the +worker's job; "self-review" in the implementer prompt gets reified into a +reviewer subagent on harnesses where children can spawn (Codex). + +**Changes:** +- `skills/subagent-driven-development/implementer-prompt.md`: an explicit + "You do not dispatch subagents" clause — self-review means reading your + own diff; the controller owns all review dispatch; a reviewer you spawn + duplicates a review the process already provides. +- `skills/subagent-driven-development/SKILL.md`: one dispatch-contract + line in the task loop, plus a Red Flags row: "An independent review + would strengthen my report" → review is the controller's next step; + your reviewer is a duplicate seat. +- Harness-agnostic wording (no-op where children cannot spawn). + +**Graded by:** `score_e6.py` (depth-2 spawns by spawner role, duplicate +review families); `score_e5.py` for the same-scope variant. +**Baseline:** 9/9 worker-issued, 0 counter-examples. +**Criterion:** 0 worker-issued depth-2 spawns AND review coverage +preserved (every task still gets exactly one controller-dispatched task +review). + +### T2. Event-driven waiting + +**Evidence:** 60–78% of `wait_agent` calls time out in every corpus +(dev 67.1%, spinout 60.2%). Source recon: V2 waits are event +subscriptions, not polls — one long wait has the same wake latency as a +10s poll at ~1/90th the calls; a completed child's FINAL_ANSWER is pushed +into the parent's mailbox and drained into the next model request with no +wait at all. + +**Changes** (`skills/using-superpowers/references/codex-tools.md`): +- Never short-timeout poll. +- While local work remains, do not wait — child results arrive with your + next turn via the mailbox. +- When genuinely idle, issue ONE `wait_agent` with a long `timeout_ms` + (900000+; harness max 3600000). +- V2 caveat stated: completion mail carries `trigger_turn=false` and will + not wake an idle controller — that is the one job `wait_agent` has. + +**Graded by:** `score_e7.py` (timeout rate, inter-poll cadence, +cache-rebill estimate — the rebill figure stays labeled as an estimate). +**Baseline:** dev 67.1% timeout rate. +**Criterion:** timeout rate < 25% with no loss of task completion. + +### T3. codex-tools.md corrections + +**Evidence:** five claims in the current guidance are contradicted by the +Codex source (all file:line-cited in the capabilities doc): +1. `close_agent` does not exist in multi-agent V2 (V1-only). V2 LRU-evicts + finished children automatically; not closing costs nothing; + `followup_task` transparently reloads an evicted child. +2. Fix rounds can always resume the implementer via `followup_task` — + dev's "if your harness cannot send another message to a spawned agent, + dispatch each fix round as a fresh implementer" branch is dead on V2. +3. Role files (`~/.codex/agents/**.toml`) DO attach to spawns via + `agent_type` on isolated forks (0.145+). +4. Full-history forks accept `model`/`reasoning_effort` overrides; only + `agent_type` is refused. (Isolated forks remain the SDD guidance for + context-hygiene reasons, stated accurately.) +5. Dispatch guidance must never name non-V2 model presets — the V2 spawn + allowlist is v2 presets only; others hard-error. + +**Changes:** rewrite the multi-agent paragraph of +`skills/using-superpowers/references/codex-tools.md` to be +version-honest (V1 vs V2 behavior labeled where they differ). + +**Graded by:** source citation (already verified); no scorer regressions +on the shared battery. `score_e8.py` is retained as a V1/V2 schema +detector, not a hygiene grader — no `close_agent` checklist ships. + +### T4. Brainstorming three-path router (variant C: approval always) + +**Evidence:** micro — the current HARD-GATE text pushes a bounded task to +FULL ceremony 5/5, while Z-null (no guidance) and a three-path router +both differentiate 5/5: the absolute wording suppresses discrimination +the model draws natively. FULL battery — ceremony volume scales +moderately (16.7 vs 24.0 tool calls, bounded vs arch), but the +two-document ritual (spec file → plan file) ran unconditionally in every +rep. The measured waste is the unconditional artifact ritual, not the +approval gate. + +**Design (variant C):** three paths scale the ARTIFACT; every path keeps +human approval before implementation: +- **Spike** (feasibility question, explicitly throwaway): present the + question and the intended probe in 2–3 sentences, get a nod, go. No + docs. Findings return as a recommendation; anything built stays labeled + throwaway. +- **Bounded** (well-scoped change to an existing, understood flow): + present a short design in chat, get approval, implement. No spec file, + no writing-plans invocation. +- **Architectural** (restructures components, new subsystem, public + interface change): the full current flow — spec doc, review, + writing-plans. + +**Guards (all ship with the router):** +- Classification is said out loud ("this looks bounded, so I'll present a + short design here rather than write a spec") so the human can override. +- When in doubt between two paths, take the heavier one. +- One-way ratchet: hidden complexity discovered mid-path upgrades the + path; never downgrade mid-task. +- New Red Flags rows targeting classification-as-escape-hatch ("I'll call + it bounded to skip the doc"). + +**Changes** (`skills/brainstorming/SKILL.md`): HARD-GATE keeps "no +implementation before approval" and drops "regardless of perceived +simplicity" as the ceremony driver; anti-pattern section reframed (the +sin is skipping approval, not skipping documents); checklist steps 6–9 +become the architectural path; process-flow graph gains the router; Red +Flags rows added. This is carefully-tuned content — the edit follows +writing-skills methodology and ships only with the full eval evidence +below. + +**Graded by (three layers):** +1. **Micro** (`ceremony-path-micro.py`, adapted): variant C literal text, + plus adversarially ambiguous briefs the campaign never tested (a task + that pattern-matches bounded but hides a public interface change). + Criteria: spike/bounded/arch differentiate (≥4/5 per cell); ambiguous + briefs escalate to FULL (≥4/5); arch never downgrades (5/5). +2. **Codex ceremony battery:** `cx-ceremony-{spike,bounded,arch}` on the + fix arm, 3 reps each, `score_e4.py` census. Criteria: bounded reps + show an approval turn but zero committed spec files and zero + writing-plans ritual; arch reps keep the full two-doc flow; spike reps + stay minimal. +3. **Global regression battery:** the same three ceremony scenarios on + Claude Code and Gemini (rig work: those scenarios are currently + codex-gated), 3 reps each; plus the triggering acceptance check + ("Let's make a react todo list" auto-triggers brainstorming into the + full/architectural path) on all three harnesses. + +### T5. Explicit model on child-issued spawns + +**Evidence:** root spawns are 100% explicit-model at CLI 0.146 (dev +14/14); the live gap is depth-2 — 2/2 child-issued spawns omitted +`model`. Source recon: `model` without `reasoning_effort` resets effort +to the MODEL's default, not the parent's. + +**Changes** (`skills/using-superpowers/references/codex-tools.md`): +- Every spawn you issue — including as a child — sets `model` AND + `reasoning_effort`; the effort-reset trap is named. +- Advise `[agents].default_subagent_model` and + `[agents].default_subagent_reasoning_effort` in `~/.codex/config.toml` + as the machine-level backstop for anything that slips through. + +**Graded by:** `score_e1.py` (per-spawn explicit-model rate, by depth) on +the shared battery. +**Baseline:** depth-2: 0/2 explicit. +**Criterion:** every spawn at every depth carries explicit model + +effort. Pre-registered caveat: if T1 eliminates depth-2 spawns entirely, +T5 grades as root-spawn regression (hold 100%) plus doc correctness and +is recorded inconclusive-by-zero at depth-2 — the config backstop is then +the operative mechanism. + +## Grading plan + +- **Shared SDD battery** carries T1, T2, T5: `cx-sdd-small`, fix-branch + arm (`/tmp/sp-arm-fix`), 8 reps across both container lanes. Dev + baselines are already measured; no baseline re-runs. +- **T4 batteries** as listed above (micro + codex ceremony + global + regression). +- **Pre-registration:** every battery gets a hypothesis-log entry + (prediction, scorer, criterion) in + `superpowers-autoresearch/logs/2026-07-30-codex-efficiency-fixes.md` + BEFORE it runs. Standing rules carry over: append-only log, manual + inspection of scorer matches on fix-arm runs (non-circular + verification), no raw rollouts committed, correctness rides beside + cost in every verdict. +- **Attribution:** orthogonal scorers on one combined branch; unexpected + regressions bisect by treatment commit. +- **Budget:** shared battery ~$40, codex ceremony ~$40, global + regression ~$40–80, micros ~$5 → phase 1 ≈ $150–200 of the ~$850 + remaining from the campaign's $1000. + +## Process + +- Work happens in the `codex-efficiency-fixes` worktree (branched off + `dev`); execution via subagent-driven-development from a written plan. +- Skill-text changes follow writing-skills methodology. +- Scenario/rig changes (un-gating ceremony scenarios for Claude + Code/Gemini, adversarial micro briefs) land in `superpowers-evals` + main, as authorized. +- PR-per-treatment against `dev`, each with its eval evidence and the + standard identification block; merges only on Jesse's per-PR approval. + +## Phase 2 queue (baseline-first; not in this plan's tasks) + +Each item requires a failing baseline before any fix ships: +1. **Dispatch routing / long-session drift** — needs a long-session + elicitation rig (fresh sessions don't reproduce the pathology at CLI + 0.146). Drew's stack informs the treatment shape. +2. **Verification leases / evidence receipts** — needs the + substring-aware duplicate counter added to `score_e3.py` first + (current baseline 1/23 exact-string pairs is too weak). +3. **Remediation cap** — small-n baseline (2/3 reps) needs more reps. +4. **Cross-task-race probe redesign** — `score_e5.py`'s probe is + inconclusive-by-zero by design tradeoff; needs a stronger probe. +5. **E5 D4 shell-command parser** — fix-review-scope classifier cannot + parse compound commands; scorer work, not skill work. + +## Out of scope + +- Adopting Drew's spinout stack (#2036/#2035) or its text. +- RoboRev, Codex token telemetry (separate codebases). +- A `close_agent` hygiene checklist (V2 has no such tool — closed as + do-not-ship in the campaign). +- Claude Code/Gemini-specific efficiency treatments beyond the T4 + regression battery. diff --git a/docs/superpowers/specs/2026-08-05-hermes-version-bump-wiring-design.md b/docs/superpowers/specs/2026-08-05-hermes-version-bump-wiring-design.md new file mode 100644 index 0000000..4629b0c --- /dev/null +++ b/docs/superpowers/specs/2026-08-05-hermes-version-bump-wiring-design.md @@ -0,0 +1,56 @@ +# Hermes Version-Bump Wiring Design + +**Date:** 2026-08-05 +**Revised:** 2026-08-06 +**Status:** Approved + +## Goal + +Keep `.hermes-plugin/plugin.yaml` in lockstep with the repository version by +registering it in `.version-bump.json` and teaching `scripts/bump-version.sh` +to process YAML without implementing a YAML parser in Bash. + +## Design + +- Add `{ "path": ".hermes-plugin/plugin.yaml", "field": "version" }` to + `.version-bump.json`. +- Route `.json` through the existing `jq` helpers and `.yaml` through Mike + Farah `yq` v4. The YAML key and value are passed as data, not interpolated + into the expression. +- Support only a present top-level YAML string field. Nested fields and `.yml` + are out of scope. +- Route `--check`, `--audit`, and version updates through the same small + read/write dispatcher. +- Before a version bump writes any manifest, run one read-only preflight that + validates the required tools and reads every present declared manifest + through the dispatcher. This prevents a deterministic YAML failure from + occurring after earlier JSON files have already been updated. Missing-file + behavior remains unchanged, and `--help` still works without `jq` or `yq`. + +The preflight is the only reliability addition. It does not make the script +transactional or redesign its existing audit and error-status behavior. + +## Tests + +Three focused behavioral tests run the real script against an isolated +temporary fixture and prove: + +- aligned JSON and YAML pass `--check` and `--audit`, and a bump updates both + formats; +- an actual bump with JSON declared first and a later YAML manifest whose + top-level `version` is not a string exits nonzero and leaves every manifest + byte-for-byte unchanged; and +- the real `.version-bump.json` registers the Hermes manifest. + +Verification also runs shell lint and `scripts/bump-version.sh --check` against +the repository. + +## Non-Goals + +- No hand-written YAML parser. +- No `.yml` or nested-YAML support. +- No Hermes runtime changes. +- No rollback framework, general config-schema layer, audit/status refactor, or + exhaustive failure matrix. +- No change to the separate version-validation and JSON-expression issue found + during review. |
