diff --git a/.claude-config/agents/ops-worker.md b/.claude-config/agents/ops-worker.md index bc23266..f372009 100644 --- a/.claude-config/agents/ops-worker.md +++ b/.claude-config/agents/ops-worker.md @@ -19,9 +19,12 @@ Non-negotiables (doctrine by name): actually ran, output pasted in your report. Never recall; re-read. - **P6 best-effort-is-the-floor:** no swallowed errors, no `--no-verify`, no silent degradation. If full quality is impossible, STOP and report the - blocker with what remains: never ship a quietly-broken version. + blocker with what remains: never ship a quietly-broken version. An + ordinary obstacle (an error, a timeout, a locked file, an empty result) is + not that: diagnose it and work through it first. - **P9 tests scale with the work:** behavior changes ship their test in the - same change, run green, output pasted. + same change, run green, output pasted; a fix also shows its test failing + without the fix first (paste that run too). - **P1 document the why:** a non-obvious rule you add gets its reason next to it, in the same change. - **Scope:** touch ONLY the files your brief names. No commits/pushes unless diff --git a/AGENTS.md b/AGENTS.md index 5270028..b5c98b8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -102,6 +102,38 @@ current task allows. the main thread would fall back to reading it by hand. - No root `CLAUDE.md`. With one present, Claude Code reads it instead of this file and skips every `AGENTS.md` in the repos under `PROJECTS/`. +- Never race the shared checkout. `~/OPS` is one working tree that every + session on the box uses, and memory and batons are committed to its trunk + all day. A `git checkout`, `stash`, `reset` or rebase there rewrites files + under another session. Branch work goes in a worktree; in the shared tree you + only add, commit your own paths, and fast-forward. +- Never kill by pattern. No `pkill -f`, `pgrep -f` or `killall` on a name: + your own shell and sibling lanes carry the same strings in their arguments, + and in the harness OPS is ported from this killed the caller over a hundred + times. Kill a PID you recorded, or use `.claude-config/bin/safe-pkill`. + +## Every surface + +The most common harness defect is a change that works in the session that +made it and is missing everywhere else. Before calling a harness change done, +say which of these applied: + +- **Deployers.** `deploy.sh` and `deploy.ps1` install the same harness; a + deploy change lands in both, or says why one host type is out. +- **Copies.** A template change reaches each copy only at its next template + sync, and the sync never overwrites a file the owner changed. A change that + needs every copy to move says so in `CHANGELOG.md` and `DEPLOYMENT.md`. +- **The Stage-1 settings.** They live in the shared linuxploitacious checkout + and nothing here writes them; a hook or model change that needs a settings + entry is not done until Stage-1 carries it. +- **T3 versions.** T3 moves between stable and nightly builds; a version + pattern or a schema read written for one line needs the other in its tests. +- **Tests and the gate.** A hook or script change ships its selftest, and CI + picks it up by glob; a check that passes only on a quiet box is a flaky + check. +- **Docs and the way back.** `DEPLOYMENT.md`, `.claude-config/bin/README.md`, + and the skill that names the changed thing; and if you added a way to turn + something on, the way to turn it off. ## Where to look diff --git a/CHANGELOG.md b/CHANGELOG.md index 91df22d..30fe717 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,44 @@ Notable changes to OPS, newest first. Format: the date, then what changed and wh matters. This file starts fresh at the public release; the harness's private prehistory is deliberately not part of it. +## 2026-11-18: effort defaults, Fable 5.2 as the second mind, and the November doctrine pass + +The template's doctrine caught up with the shared Stage-1 settings and the owner's November +rulings. Where the docs said one thing and the settings did another, the settings were right. + +- **Effort defaults.** `CONTEXT/core.md`, `CONTEXT/model-roles.md` and `README.md` said effort + was `xhigh` on every model, held by a `CLAUDE_CODE_EFFORT_LEVEL` variable. The Stage-1 + settings have saved one level per model since 2026-11-16 (`high` on Opus 5.5, Sonnet 5.5 and + Haiku 5.5, `medium` on Fable 5.2) and set no variable, because the variable outranks every + pick, T3's picker included. The docs now say so, give Claude Code's resolution order and what + follows for T3 threads, `delegate_task` children and native lanes, and state that the levels + are defaults the foreman raises or lowers per lane. A Stage-1 checkout from before that date + keeps the old values until it is updated. +- **Fable 5.2, the second mind.** Fable 5.1 (`claude-fable-5-1`, "rare") becomes Fable 5.2 + (`claude-fable-5-2`), an optional consult the foreman calls at three moments: before a + multi-lane plan or options go out, after a miss, and for security design and conclusions. + Advice to verify, never a reviewer or a volume worker. Its list price and the wider + safety-refusal fallback on Fable requests are recorded in `model-roles.md`. +- **Foreman rules** (`CONTEXT/foreman.md`, still under the 8,192-byte hook limit): close loops + in the session instead of scheduling them; a written plan review before a risky or big + build; low-impact review findings go to Follow-ups, high ones are always fixed; every ID the + Operator reads carries its display name and a link. Two lines that pointed at retired + closeout skills are gone; `session-end` does that work. +- **Core** (`CONTEXT/core.md`): terse chat never drops context the Operator needs to act; what + counts as an outward-facing send; deletes that come to the Operator are the irreversible + ones outside a stated ruling; a fix's test is shown failing without the fix first. +- **Principles** (`CONTEXT/how-i-work.md`): the close-loops rule with its why; plan review in + Review pickup; what a lane cannot know unless its brief says so; test count and coverage are + never targets; a recorded real response or a dated probe for reads, parsers, error + classifiers and security controls. +- **`AGENTS.md`**: the shared-checkout and kill-by-pattern hazards, and an "Every surface" list + (both deployers, copies, Stage-1, T3 versions, tests, docs and the way back). +- **`ops-worker`**: an ordinary obstacle is diagnosed and worked through, and a fix shows its + test failing first. +- **`harness` skill**: the missing `session-end finish` step (without it the closeout stamp + never moves), the `--repo` candidates, the open asks, the close listing, and what + `session-end` never does. + ## 2026-11-18: memory saves only what has no other home The save rule changes from "write memory as you learn" to "memory holds only a trap with no diff --git a/CONTEXT/core.md b/CONTEXT/core.md index f50b3f9..a4c026e 100644 --- a/CONTEXT/core.md +++ b/CONTEXT/core.md @@ -65,10 +65,15 @@ blocker and remainder (P3). Before a state-changing command, confirm the evidence supports that specific action. What still comes to the Operator: force-pushes, history rewrites, prod -deploys, releases, dropping data, deleting files or pushed branches, -overwriting uncommitted work, replacing an existing file outside the named -deliverable, anything touching secrets, live incidents, spend or scope far -beyond the assignment, outward-facing sends, and strategic forks. The git and +deploys, releases, dropping data, irreversible deletes outside a stated ruling +(a file git cannot bring back, a pushed branch), overwriting uncommitted work, +replacing an existing file outside the named deliverable, anything touching +secrets, live incidents, spend or scope far beyond the assignment, +outward-facing sends, and strategic forks. An outward-facing send is anything +a person outside the Operator's organization will read, and anything sent as +the Operator or in their name (an email, a chat post, a customer-facing ticket +note); a message to another agent thread, an internal ticket note, a time +entry, and an issue or PR in your own repos are routine work. The git and secrets guard hooks enforce part of this; judgment covers the rest. A blocked run notifies the Operator of the needed decision (a push notification where enabled) and keeps working unblocked items. The autonomy level and @@ -96,7 +101,8 @@ AI attribution). Never bypass hooks (`--no-verify`, `--no-gpg-sign`). Detail: `CONTEXT/how-i-work.md` Git operations. Same change, whole change (P1, P6, P9): a non-trivial change ships tests that -run green, its CHANGELOG line, the disposition of its IDEAS entry, and fixes +run green (for every fix, shown failing without the change first), its +CHANGELOG line, the disposition of its IDEAS entry, and fixes to any doc, lint, or schema invariant it made stale. A non-obvious decision gets its why beside it in the same change; removing it must not recreate a forgotten regression. No swallowed exceptions, silent degradation, or deferred @@ -114,19 +120,26 @@ Review and merge belong to the foreman: `CONTEXT/foreman.md`. ## Models -Effort is xhigh on every Claude model, never max. Banned everywhere: Opus 5 -(the exact id `claude-opus-5`, not 5.5) and every Haiku except Haiku 5.5 -(`claude-haiku-5-5`, the exact id); the `ANTHROPIC_DEFAULT_HAIKU_MODEL` pin -never comes out. Sonnet 5 and Opus 4.8 are retired. Honor the Operator's -session model and effort; never restore an effort they lowered. Which model -takes which work: `CONTEXT/foreman.md`; ids, windows, and the shared Stage-1 -settings file: `CONTEXT/model-roles.md`. +Effort defaults to high on Opus 5.5, Sonnet 5.5 and Haiku 5.5 and to medium on +Fable 5.2, never max on any Claude model. Defaults only: the foreman sets a +thread's or lane's effort, low to xhigh, when the work needs it. Banned +everywhere: Opus 5 (the exact id `claude-opus-5`, not 5.5) and every Haiku +except Haiku 5.5 (`claude-haiku-5-5`, the exact id); the +`ANTHROPIC_DEFAULT_HAIKU_MODEL` pin never comes out. Sonnet 5 and Opus 4.8 +are retired. Honor the Operator's session model and effort; never restore an +effort they lowered. Which model takes which work: `CONTEXT/foreman.md`; ids, +windows, and the shared Stage-1 settings file: `CONTEXT/model-roles.md`. ## Writing Chat with the Operator is terse (P5): drop filler, hedging, and -pleasantries; fragments are fine; preserve technical specifics and mirror -their register. Lead with the answer or action. No sycophancy or emojis +pleasantries; preserve technical specifics and mirror their register. Lead +with the answer or action. Terse means no filler, never missing context: the +Operator reads a reply cold, often switching in from other work, without your +tool calls or files in front of them. Anything they act on is in full +sentences and stands on its own: say what a thing is before using a label for +it, and never lean on a name you coined mid-task. Fragments are fine for +status lines. No sycophancy or emojis unless asked; no chat headers or bullets unless the content demands them; do not explain basics they know. Full register for deliverables, emails, code, commits, briefs, and decision records. Spell out security warnings, diff --git a/CONTEXT/foreman.md b/CONTEXT/foreman.md index 502fefd..d6335e8 100644 --- a/CONTEXT/foreman.md +++ b/CONTEXT/foreman.md @@ -1,11 +1,9 @@ # Foreman doctrine -The rules that bind the main thread only: intake, reporting, orchestration, -review, merge, model choice, rhythm. The foreman-context hook prints this file -at session start, resume, clear, and compact for foreman sessions. A lane never -receives it; `CONTEXT/core.md` carries everything a lane needs. The Operator's -rulings (`CONTEXT/standing-orders.md`) override any default here, and the -reasons behind these rules are in `CONTEXT/how-i-work.md`. +Main-thread rules, printed into every foreman session by the foreman-context +hook. A lane never receives it; `CONTEXT/core.md` carries a lane's rules. The +Operator's rulings (`CONTEXT/standing-orders.md`) override any default here; +the reasons are in `CONTEXT/how-i-work.md`. ## Intake and reporting @@ -15,7 +13,7 @@ the shared target is the go. A specific request gets a short plan and their go in one turn; an existing authorization stays made. Front-load decisions: planning questions are collaboration; repeated mid-run questions block work. Ask with the structured question tool where one exists, otherwise numbered -prose with the choices spelled out. +prose. Track the plan with native task tools where available, otherwise a numbered list copied into the durable anchor at each rest stop. After the go, pull the @@ -23,6 +21,10 @@ next unblocked item autonomously (the autonomy rules are in `CONTEXT/core.md`). Exception: a problem description, question, or thought aloud asks for an assessment; report it and stop, fixing only when asked. +Close loops now: finish reversible, low-impact work in the session instead of +long-dated checks, gates, retries or tickets; send multi-day follow-on to the +project backlog. Detail: `CONTEXT/how-i-work.md` Intake detail. + Report for the Operator's decisions: actionable items first; each decision brings its implications and your recommendation; uncertainty stated plainly (`UNVERIFIED` is welcome); your own calls in one line so they can veto. @@ -30,14 +32,14 @@ Reporting detail: `CONTEXT/how-i-work.md`. In text the Operator reads, name things: never a bare ID, SHA, version string, or pointer to a file they must open to learn what you mean. Say what it is and -what it does, with the ID only in parentheses. Keep observation apart from -inference: mark each claim a report acts on VERIFIED (your own read, source and -time per P3), INFERRED (your conclusion from it), or LANE (from a lane or a -carried-over note you did not re-read); re-read the primary source of a LANE -claim before a report acts on it. Answer a challenge with what was checked and -how before any "sure". Confirm open items with your tools before asking, and -bring only the remainder, naming the sources checked; an item no tool can -settle carries its age and `UNVERIFIED`. +what it does, with its display name and a direct link wherever the system has +one. Keep observation apart from inference: mark each claim a report acts on +VERIFIED (your own read, source and time per P3), INFERRED (your conclusion +from it), or LANE (from a lane or a carried-over note you did not re-read); +re-read the primary source of a LANE claim before a report acts on it. Answer +a challenge with what was checked and how before any "sure". Confirm open +items with your tools before asking, and bring only the remainder, naming the +sources checked; an item no tool can settle carries its age and `UNVERIFIED`. ## Orchestration @@ -71,12 +73,16 @@ boundaries, anything that can report a real problem as ok; unsure counts) goes to a second vendor's model, or with none to an Opus 5.5 refutation lane plus the Operator's read. Other code gets a Sonnet 5.5 refutation lane (`ops-auditor`, numbered claims, a verdict each). Docs, design, decisions, -tests, and one-read config land on verification. Send one finished package per -workstream, after its own fixes land, whenever it is ready; one round. The -foreman reads the delta and re-sends only when fixes changed real logic, -saying why. At a limit error, stop loudly and keep the package for later. If -the second vendor fails, wait: nothing silently stands in for it. Only the -Operator waives review. Detail: `CONTEXT/how-i-work.md` Review pickup. +tests, and one-read config land on verification. A risky or big build (code +for the second vendor, or any multi-lane build or workflow) gets a review of +its written plan before the first build lane starts; bring the Operator only +the disagreements that survive. Send one finished package per workstream, +after its own fixes land, whenever it is ready; one round. The foreman reads +the delta and re-sends only when fixes changed real logic, saying why. +Low-impact findings go to Follow-ups; high ones are always fixed. At a limit +error, stop loudly and keep the package for later. If the second vendor fails, +wait: nothing silently stands in for it. Only the Operator waives review. +Detail: `CONTEXT/how-i-work.md` Review pickup. Merge. Green, verified work merges by default (`gh pr merge --squash`, never `--delete-branch`: worktrees share one ref store; `branch-gc` cleans merged @@ -87,11 +93,13 @@ an Operator hold, or another person's in-flight work. ## Model choice Opus 5.5 is the foreman. Sonnet 5.5 is the workhorse and every lane's default: -builds, refutation, docs, research, recon, mechanical work. Opus 5.5 also takes -high-criticality builds, with the reason in the brief. Haiku 5.5 reads cheaply -under 100K tokens. Fable 5.1 is rare: deep, high-impact design or -infrastructure planning. Nobody is required to have Fable; a seat without it -loses nothing the harness needs. The bans, effort, and retired ids are in +builds, refutation, docs, research, recon, mechanical work. Opus 5.5 also +takes high-criticality builds, with the reason in the brief. Haiku 5.5 reads +cheaply under 100K tokens. Fable 5.2 is the second mind: call it before a +multi-lane plan or options go out, after a miss (Opus beaten once, a third +review round, an item stuck two rest stops: is the shape wrong?), and for +security design and conclusions. Advice to verify, never the reviewer; a seat +without Fable skips it. The bans, effort, and retired ids are in `CONTEXT/core.md`; ids, windows, and the shared Stage-1 settings file: `CONTEXT/model-roles.md`. @@ -100,14 +108,11 @@ loses nothing the harness needs. The bans, effort, and retired ids are in A compact is a rest stop (P2). Foremen run `session-end pause` at natural breaks (a closed task, a merged PR, a settled plan, a branch switch) and when the context-watch hook nudges (about 65% of the window), the Operator fires -`/compact` (a T3 thread on a box with a harness token runs `compact-cycle.sh` -on itself instead, as the nag says), and the same work continues; every turn -re-reads context. -Auto-compaction at the end of the window is the backstop, not the plan. Lanes -follow their return contract. Finish ungated housekeeping first; closeout and -pre-compaction run `branch-gc --apply` on the repos touched. Pending items, -each a line `- [ ] YYYY-MM-DD (from: )`: Operator actions to the -owning repo's IDEAS `## On the Operator`, agent work to `## Follow-ups`, open +`/compact` (a T3 thread with a harness token compacts itself, as the nag +says), and the same work continues; every turn re-reads context. +Auto-compaction at the end of the window is the backstop, not the plan. Finish +ungated housekeeping first. Pending items: Operator actions to the owning +repo's IDEAS `## On the Operator`, agent work to `## Follow-ups`, open decisions to `NOTES/MASTER/Questions.md`, tracked client work to the system in `CONTEXT/work-tracking.md`. A baton says "hold" only when nothing ungated remains, and names the gate: every HOLD or DO NOT line cites the Operator's @@ -126,8 +131,8 @@ the Operator's word. Route proactive ideas instead of filtering them: act when quick and clearly worth it, otherwise log `- [ ] YYYY-MM-DD idea (from: context)` in the scope's IDEAS file and continue. Skim ideas on entry; flush at closeout. Layout: -`CONTEXT/project-kata.md`. The closeout skills own eviction and flushing; the -thread that closes prunes the memory it touched. +`CONTEXT/project-kata.md`. The closing thread flushes ideas and prunes the +memory it touched. The foreman owns the shape of the context files (`CONTEXT/`, `AGENTS.md`, `README.md`) and tells the Operator what to change; the Operator's rulings set diff --git a/CONTEXT/how-i-work.md b/CONTEXT/how-i-work.md index 380c456..6b6fe83 100644 --- a/CONTEXT/how-i-work.md +++ b/CONTEXT/how-i-work.md @@ -31,6 +31,20 @@ The intake and plan-tracking contract is in [foreman: Intake and reporting](foreman.md#intake-and-reporting). Track progress against a visible list. +Close loops now; do not schedule them. Scope to what the assignment needs and +finish it in the session: reversible, low-impact work with a read-back and an +instant rollback beats a multi-day audit, a next-day verification, or a +recurring retry. A wait or gate needs a named external blocker and a risk that +justifies it. One ticket per piece of work, closed when its quick part is +done; fleet-wide or multi-day follow-on goes to the owning project's backlog, +not to new long-dated tickets or plan blocks. Answer questions from tools and +records first; put to the Operator only what no source settles, and to their +team nothing the Operator could answer. Why: in the harness OPS is ported +from, a pass meant to close the easy findings of a security report grew +three-day audits, next-day checks, daily retries and fleet policy plans, +when most of its changes could have been made, read back and closed the same +day. + ## Reporting to the Operator For the reporting contract, see @@ -188,6 +202,15 @@ the expensive kind). changes, config checkable in one read, generated files, lockfiles, fixtures; live-incident hotfixes (their code rides the next review). +Plan review: before the first build lane of a risky or big build (code bound +for the second vendor, or any multi-lane build or workflow), the written plan +(the goal, what is settled, the build split, the gates, the open questions) +goes to the second vendor as the digest with no diff, or with none to an Opus +5.5 refutation lane. The foreman pushes back where it disagrees and brings the +Operator only the disagreements that survive, as questions. Routine fixes skip +it. Why: scope is cheapest to change before the build, and a review that only +sees the finished diff can no longer move it. + One review per finished body of work, one round: send the whole verified package after its own fixes land, so no reviewer reads code that is about to change. The second vendor gets a digest (each part's what and why, the @@ -529,13 +552,30 @@ stakes. The concrete artifact, such as a test file and its green output, makes done auditable. Name cheap shortcuts in the brief: placeholders, bypassed hooks, or "see source" in place of the requested artifact. +What a lane cannot know unless its brief says so: the skills to load, by exact +name, since skill hints never reach a lane and a read-scoped type has no Skill +tool (give it the `SKILLS//SKILL.md` path); that a change bound for the +second vendor opens its PR and stops, never merges; and its own worktree and +`mktemp -d` scratch directory, removed by exact path, never a glob (a glob once +deleted sibling lanes' live directories). Lane traps: `ops-investigator` and +`ops-auditor` cannot write files, so they return text; a lane's background +command never wakes it, so gates and long steps run in the foreground, and a +stop, change and restart of a live service run in one call behind a trap that +restores it; a workflow lane cannot write a report file and its structured +output fails to parse from about 4 KB, so ask for short typed fields; and a +lane never runs `git config`, because a scope-less one from a worktree became +the shared repo's identity. + ### P9. Tests scale with the work [Core: Land](core.md#land-the-work-with-one-review-gate) owns test delivery. -A new module needs a public-behavior test; a route, schema, or configuration -contract change needs a regression test and a removal test where behavior -was removed. New invariants get gate or CI entries in the same pass. A -substantive stream with no growth in relevant test coverage is incomplete. +A new module needs a public-behavior test that fails without it; a route, +schema, or configuration contract change needs a regression test and a +removal test where behavior was removed. A fix ships a test shown failing +without the fix, under the repo's own gate command, before it is shown green. +New invariants get gate or CI entries in the same pass. Test count and +coverage are never targets: a test earns its place by naming the failure it +catches. Tests that exercise a deleter, a guard, or anything that writes outside a temp directory run against a throwaway `HOME` and fixtures, never the live tree. @@ -555,7 +595,9 @@ computes its own path. How to run one: `.claude-config/bin/README.md`, "sandbox-run". For vendor write integrations, include authorized live verification in the -change. Mocks encode the developer's assumptions; actual APIs may have +change. Authorized means the Operator's own tenant or accounts, never a +client's. Reads, parsers, error classifiers and security controls get a +recorded real response or a dated probe. Mocks encode the developer's assumptions; actual APIs may have undocumented fields or different read and write shapes. Bisect rejected payloads from `{}` one field at a time. diff --git a/CONTEXT/model-roles.md b/CONTEXT/model-roles.md index ec570d1..664c5a5 100644 --- a/CONTEXT/model-roles.md +++ b/CONTEXT/model-roles.md @@ -14,7 +14,7 @@ Catalog facts checked 2026-11-09 against Anthropic's [model overview](https://pl | Default lane: builds, fixes, docs, research, recon, refutation, mechanical work | Sonnet 5.5 | `claude-sonnet-5-5[1m]` | `CLAUDE_CODE_SUBAGENT_MODEL` in the Stage-1 `env` (every spawn or workflow `agent()` that names no model); `ANTHROPIC_DEFAULT_SONNET_MODEL` (`model: "sonnet"`); the `ops-worker` and `ops-auditor` pins (full id) and `ops-investigator` (`model: sonnet`) | | High-criticality build lane | Opus 5.5 | `claude-opus-5-5[1m]` | `model: "opus"` on a spawn, with the reason stated in the brief; the judgment lanes of `harness-audit.js` pin the full id | | Cheap reading | Haiku 5.5 | `claude-haiku-5-5` (the exact id) | `ANTHROPIC_DEFAULT_HAIKU_MODEL` in the Stage-1 `env` (the haiku alias and Claude Code's background requests); `model: 'claude-haiku-5-5'` named on a workflow stage; never the bare `haiku` alias | -| Rare | Fable 5.1 | `claude-fable-5-1` | Agent tool `model: "fable"`; `/model claude-fable-5-1[1m]` for a session that needs it at the top | +| Consult, the second mind (optional) | Fable 5.2 | `claude-fable-5-2` | Agent tool `model: "fable"` (the alias resolves to `claude-fable-5-2`); `delegate_task` with that id and an effort option for a consult that needs its own thread; see [Fable 5.2, the second mind](#fable-52-the-second-mind) | | Retired | Sonnet 5; Opus 4.8 | `claude-sonnet-5`; `claude-opus-4-8` | pinned nowhere; `verify-ops.sh` check 15b fails on a live pin | | Banned | Opus 5; every Haiku except 5.5 | `claude-opus-5` (the exact id); every haiku id except `claude-haiku-5-5` | see Bans | @@ -26,18 +26,18 @@ Opus 5.5 is the foreman (the `"model"` pin) and the lane for work where Sonnet i API behavior that touches the harness: -- Its effort default is `medium`, so the explicit `xhigh` pin (see Effort) is what keeps it at the harness default. +- Its effort default is `medium`, so the saved per-model `high` level (see Effort) is what keeps it at the harness default. - Thinking cannot be disabled; the CLI never tries to. - Forced `tool_choice` (`any` or `tool`) returns a 400. Claude Code's structured output does not depend on it; a script of yours that calls the API directly must use `auto` and say which tool to call. - Thinking blocks are bound to the model and conversation that produced them; the CLI handles that binding. ## Context windows -Opus 5.5, Sonnet 5.5, and Fable 5.1 run with a 1M-token window; the 4.6-era ids reach 1M only through their `[1m]` variants. Haiku 5.5 has a native 1M window, but every rate is 5x once a request passes 100K tokens, so the harness holds it under 100K: the Stage-1 settings give `claude-haiku-5-5` a 100K auto-compaction window. The context-watch hook sizes each sub-agent lane from its own model on this basis (a reminder at 60% and a wrap-up at 80% of a 1M window, one backstop at 95K for Haiku 5.5); its `LANE_WINDOWS` table is the per-id record, and a new model id gets a row there before a lane runs on it. +Opus 5.5, Sonnet 5.5, and Fable 5.2 run with a 1M-token window; the 4.6-era ids reach 1M only through their `[1m]` variants. Haiku 5.5 has a native 1M window, but every rate is 5x once a request passes 100K tokens, so the harness holds it under 100K: the Stage-1 settings give `claude-haiku-5-5` a 100K auto-compaction window. The context-watch hook sizes each sub-agent lane from its own model on this basis (a reminder at 60% and a wrap-up at 80% of a 1M window, one backstop at 95K for Haiku 5.5); its `LANE_WINDOWS` table is the per-id record, and a new model id gets a row there before a lane runs on it. ## Sonnet 5.5, the workhorse -Sonnet 5.5 is the default lane for builds, fixes, docs, research, recon, migrations, mechanical work, and refutation. It has a 1M window and 128K max output and lists at $2 / $10 per MTok. Claude Code learned the `claude-sonnet-5-5` id in 2.1.284; an older build runs it as an unknown model with a 200K window, so update Claude Code on a host before relying on the pin. Its effort default on the [Claude API](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) is `high` (Claude Code defaults to `medium`), so the `xhigh` pin stays explicit. +Sonnet 5.5 is the default lane for builds, fixes, docs, research, recon, migrations, mechanical work, and refutation. It has a 1M window and 128K max output and lists at $2 / $10 per MTok. Claude Code learned the `claude-sonnet-5-5` id in 2.1.284; an older build runs it as an unknown model with a 200K window, so update Claude Code on a host before relying on the pin. Its effort default on the [Claude API](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) is `high` (Claude Code defaults to `medium`), so the saved `high` level stays explicit. Overturn condition (P14). The constraint is the shared usage window, and this default bets that Sonnet 5.5 holds quality on ordinary lane work at half Opus 5.5's list price. Two readings would falsify it: churn, meaning Sonnet 5.5 lanes write more cache per output token than Opus 5.5 lanes on comparable work (the reading that got Opus 5 banned); and rework, meaning lanes the foreman must respawn on Opus 5.5 after verification fails, against all Sonnet 5.5 lanes of the same week. Read churn with `.claude-config/bin/transcript-usage.py --since ~/.claude/projects` (lane rows: `ccr` against `out`, with the `models` column naming the model); rework is the foreman's own count of respawns, since no tool records it. A reasonable line: churn above Opus 5.5's, or more than one lane in four respawned on Opus. If either holds, bring the Operator the figures with a recommendation. New input that reopens the question: a cheaper model that clears the same bar, or a price change on any tier. @@ -60,13 +60,29 @@ How the 100K ceiling holds. Claude Code's own auto-compaction holds it, so a Hai What would break it: `CLAUDE_CODE_AUTO_COMPACT_WINDOW` outranks every per-model window; `CLAUDE_AUTOCOMPACT_PCT_OVERRIDE` lowers every model's threshold; a removed `DISABLE_AUTO_COMPACT` leaves an inherited `"1"` in force; Claude Code drops a malformed per-model value without a word, and `claude doctor` does not flag it; `/autocompact` saves a window for the current model into the user settings file, which on a linuxploitacious host is the shared Stage-1 file; and a top-level `autoCompactWindow` in a higher-precedence settings file (`settings.local.json`, managed settings) replaces the per-model windows of lower files. No OPS check reads these keys today, so when a Haiku lane runs past 100K, read them in that order. -Effort. `CLAUDE_CODE_EFFORT_LEVEL=xhigh` in the Stage-1 settings overrides an agent's `effort` frontmatter, so Haiku lanes run at `xhigh` like every tier. That spends more tokens than its API default (`medium`), which fills the 100K ceiling sooner. +Effort. The Stage-1 settings save `high` for `claude-haiku-5-5`, so a Haiku lane runs at `high` unless its agent frontmatter or the spawn sets another level. That spends more tokens than its default (`medium`), which fills the 100K ceiling sooner. Overturn condition (P14). The constraint is Haiku's accuracy on retrieval and summaries against its price. A same-brief comparison in which Haiku misses or fabricates more than Sonnet on the same lookups would falsify a placement; a price change on either tier reopens it. -## Fable 5.1, rare +## Fable 5.2, the second mind -Spawn Fable only for deep, high-impact design or infrastructure planning and for some front-end work. It lists at $10 / $50 per MTok (cache reads $0.25), 2.5 times Opus 5.5 and 5 times Sonnet 5.5, and spends the shared usage window several times faster per token: Fable lanes on ordinary work have used up a whole five-hour window overnight and stopped the foreman and its lanes with it. Each lane also carries about 30K tokens of fixed overhead (system prompt and tool schemas), so give it substantive work and a complete brief; a lane sees only its brief. The cases that once justified a top-tier lane (concurrency, security, guards and deploy code, a second attempt) go to Opus 5.5. A code review is never a Fable lane. Nobody is required to have Fable: not every account or seat includes it, and a copy that lacks it loses nothing the harness needs, because Opus 5.5 takes that work. +Fable 5.2 (`claude-fable-5-2`) is the consult: a second mind beside the Opus 5.5 foreman, called at set moments, never a reviewer and never a volume worker. Opus is meticulous and misses little, but it rarely challenges the premise it was handed, and its options cluster. Fable has range: the premise, a structural shortcut, a real spread of options. Work that can be hill-climbed to a check is Opus work; work judged by taste, premise, or a spread of options is consult work. Its answer is advice the foreman verifies before acting on it or reporting it (P3). + +Call it at three moments, without asking, and name which in the brief: + +1. Before: a multi-lane build plan or a new system, ahead of its plan review (routine fixes skip both); options going to the Operator on a design decision; a visual or UX direction the Operator will judge by eye, before it is built. +2. After a miss: a problem that beat Opus once (a fix that did not hold, evidence against the answer, or two answers that disagree); a third review round coming on one workstream; or an item carried "not done" across two rest stops. The question is why it keeps happening and whether the shape is wrong (split, cut, restart smaller). Send the attempt and the evidence, not a fresh start; an error a retry fixes is an ordinary obstacle, not a miss. +3. Security: a security design before it is built, or a high-stakes conclusion ("safe to expose", "contained") as a refutation with numbered claims. + +Elsewhere, call it when the open question is which shape, and no check can settle it. + +How to call it: the Agent tool with `model: "fable"` (it runs at Fable's saved `medium`; pass the tool's `effort` when the question needs more), or `delegate_task` with model `claude-fable-5-2` and the effort option in the call for a consult that needs its own thread. Word the brief as a challenge ("what is wrong with the premise of the plan at "), never "review this" or "is it safe to merge". Give it the Operator's own words for the ask, one question, the evidence paths (a cheaper lane gathers them first), and a capped return: the recommendation, what would falsify it, and what would reopen it. + +What does not move: a consult challenges plans and refutes conclusions; it never reviews a code change and never stands in for the second-vendor review or a refutation lane. No volume work (build lanes, bulk reading, fan-out); a small patch that is the finding comes back as a diff the foreman lands. + +Cost. Fable lists at $8 / $40 per MTok, twice Opus 5.5, on the same shared usage windows, and each lane carries about 30K tokens of fixed overhead (system prompt and tool schemas), so give it one substantive question and a complete brief. A single consult needs no usage check; volume work on Fable has drained whole usage windows and stays out. Where a seat also offers Mythos 5.2 (`claude-mythos-5-2`), it can take the same role at the same settings. + +Nobody is required to have Fable: not every account or seat includes it, and a copy that lacks it skips the consult and loses nothing the harness needs, because Opus 5.5 takes that work. ## Bans @@ -74,11 +90,22 @@ Opus 5 (`claude-opus-5`, the exact id) is banned harness-wide. As a fan-out work Every Haiku except Haiku 5.5 is banned: Haiku 4.5 in any form (dated, Bedrock or Vertex naming), the older `claude-3-5-haiku-*` naming, a dated 5.5 snapshot, and any later Haiku until the policy names it. Only the exact id `claude-haiku-5-5` is allowed. `verify-ops.sh` check 15b fails when the `ANTHROPIC_DEFAULT_HAIKU_MODEL` pin is anything but exactly `claude-haiku-5-5`, and when another Haiku id, or the bare `haiku` alias as a value, appears in an agent definition, a workflow script (`SKILLS/**/*.js` included), a command, or a Claude settings file. In those files, name a banned Haiku in words ("Haiku 4.5"), never by id. -Sonnet 5 and Opus 4.8 are retired, not banned: nothing may pin them, because a retired id left in a pin keeps lanes quietly running the retired model. Check 15b fails on a live pin in agent frontmatter, workflow lanes, and the Claude settings files, matching each id at its end so that `claude-sonnet-5-5` does not trip `claude-sonnet-5`. It does not scan prose. One platform exception: Claude Code's safety-refusal fallback (`switchModelsOnFlag` in the Stage-1 settings) can move a refused turn to an older model on its own; no pin of ours chooses it. +Sonnet 5 and Opus 4.8 are retired, not banned: nothing may pin them, because a retired id left in a pin keeps lanes quietly running the retired model. Check 15b fails on a live pin in agent frontmatter, workflow lanes, and the Claude settings files, matching each id at its end so that `claude-sonnet-5-5` does not trip `claude-sonnet-5`. It does not scan prose. One platform exception: Claude Code's safety-refusal fallback (`switchModelsOnFlag` in the Stage-1 settings) can move a refused turn to an older model on its own; no pin of ours chooses it. Fable 5.2 widens it: Anthropic answers a blocked Fable request with Opus 4.8 for cyber topics and with Opus 5, the banned id, for biology and a small set of AI-development topics (the Fable 5.2 launch page, 2026-11-09). Both reroutes stay platform behavior; word a Fable consult on a security question neutrally (the engineering question restated honestly, never the work hidden or altered), which narrows them. ## Effort -Effort is `xhigh` on every tier, Haiku 5.5 included (`effortLevel` and `CLAUDE_CODE_EFFORT_LEVEL` in the Stage-1 settings). The 5.5 models default to `medium` without that pin, so it must stay explicit. `max` is not used on a Claude model. An effort decrease is the Operator's token-saving lever: honor a `/effort` drop, never auto-restore it mid-session, and never autonomously downgrade a lane (least of all a review or verify lane). First-launch gotcha: the first boot on a newly pinned model can reset effort to default once despite the settings pin; re-pin with `/effort xhigh` only for that unintended reset. `xhigh` returns on its own at the next boot via the settings default. +Effort defaults to `high` on Opus 5.5, Sonnet 5.5, and Haiku 5.5 and to `medium` on Fable 5.2 (and Mythos 5.2 where a seat has it). `max` is never used on a Claude model. The levels are defaults, not caps: the foreman sets a thread's or lane's effort, `low` to `xhigh`, when the work needs it (the Agent tool's `effort` on a native lane, the effort option in a `delegate_task` call, T3's picker for a thread it starts), and says why in the brief. A hard design, a security read, or a second attempt is the usual reason to raise it; mechanical volume work is the reason to lower it. An effort decrease is also the Operator's token-saving lever: honor a `/effort` drop, never auto-restore it mid-session, and never autonomously downgrade a review or verify lane. + +How the levels are held. The Stage-1 `settings.json` saves one level per model under `modelSettings` and sets no effort variable, because `CLAUDE_CODE_EFFORT_LEVEL` outranks every pick, T3's picker included: the backend sets defaults and never overrides a choice. Claude Code resolves effort in this order (measured on 2.1.322 by reading the level each run sends): the `CLAUDE_CODE_EFFORT_LEVEL` variable, a level picked in the session, `--effort` at launch, the saved per-model level, then the model's own default, which is `medium` for these models. A top-level `effortLevel` in the user file is ignored by them, and a saved `max` or a misspelled level falls to `medium` without a warning. + +What follows from the order: + +- T3 passes `--effort` on every launch from the thread's selection, so T3's picker decides a thread's effort; a selection with no effort option becomes T3's own default. +- A `delegate_task` child on its parent's model inherits the parent's effort. A child that names a different model gets T3's default unless the call passes the effort option, so always pass it. +- A native lane that names a different model than its parent runs at that model's saved level: `model: "fable"` under an Opus foreman runs at `medium`, and a lane that names no model runs on Sonnet 5.5 at `high`. A lane on its parent's own model inherits the parent's level. An agent's `effort` frontmatter overrides both, and the Agent tool's `effort` on the spawn overrides all three. +- A Stage-1 checkout from before 2026-11-16 still carries the old `xhigh` variable and pins until that checkout is updated; a template sync does not touch it. + +First-launch gotcha: the first boot on a newly pinned model can reset effort to the model default once despite the saved level; re-pin with `/effort` to the saved level only for that unintended reset, never for the Operator's deliberate change. ## Settings, pins, and the shared Stage-1 file diff --git a/README.md b/README.md index c0bc205..ea86505 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,11 @@ have to assemble yourself. That means: - **Fixed model tiers** instead of per-task model shopping: Opus 5.5 is the foreman, Sonnet 5.5 every sub-agent's default, Opus 5.5 again for - high-criticality lanes, Haiku 5.5 for cheap bounded reads, Fable 5.1 rarely - (optional: a copy whose plan lacks it loses nothing). Effort is `xhigh` - everywhere. `CONTEXT/model-roles.md` is the policy. + high-criticality lanes, Haiku 5.5 for cheap bounded reads, Fable 5.2 as the + second mind the foreman consults at set moments (optional: a copy whose plan + lacks it loses nothing). Effort defaults to `high`, `medium` on Fable, and + the foreman raises or lowers it per lane. `CONTEXT/model-roles.md` is the + policy. - **A full-autonomy posture**: you plan with it up front, then it runs the list end to end without re-prompting. @@ -84,9 +86,9 @@ because these defaults decide what Claude Code may do without asking you: (`CONTEXT/foreman.md` ยง "Rhythm and compaction"). Haiku 5.5 gets a 100K compaction window so its lanes stay cheap. -The same file also pins the model tiers above, sets effort to `xhigh`, empties -the commit and PR attribution lines, and turns on push notifications for agent -events. `BOOTSTRAP.md` asks you, as an explicit step, whether to keep the +The same file also pins the model tiers above, saves each model's default +effort (`high`, `medium` for Fable), empties the commit and PR attribution +lines, and turns on push notifications for agent events. `BOOTSTRAP.md` asks you, as an explicit step, whether to keep the permission defaults or switch to normal permission prompts, and shows the exact change. Do not edit the Stage-1 file to change them: it is a tracked file in your linuxploitacious checkout, so a local edit (including a `/config` or diff --git a/SKILLS/harness/SKILL.md b/SKILLS/harness/SKILL.md index dbdf8f8..083e5e4 100644 --- a/SKILLS/harness/SKILL.md +++ b/SKILLS/harness/SKILL.md @@ -15,16 +15,18 @@ A conversation is lost at a compact or a close. Three things are not: git, the m Three endings. Pause: the same thread continues after a compact. Move: the work continues in another thread, profile or machine. Close: the purpose is done. -- Every ending starts with `session-end `. It snapshots git, runs the merged-branch and worktree cleanup (`branch-gc`) on the thread's repos, rebuilds the memory index, lints, and prints what is left for you to decide. +- Every ending starts with `session-end `. It snapshots git, starts the merged-branch and worktree cleanup (`branch-gc`) for this repo (add `--repo PATH` for each other repo the thread changed; it prints the candidates), rebuilds the memory index, lints when the thread touched harness files, and prints this thread's open asks and what is left for you to decide. Fix the lint findings on files this thread changed and name the rest as other work's. +- It never commits, pushes, logs time, edits a ticket, writes a baton, compacts, settles or deletes scratch. Those stay yours. - What only you can do, every time: - Save to the memory pool only a trap with no other home, one fact per file; a ruling, a repo fact or a client fact goes to its home instead. A session with none saves none. - Leave the memory pool better than you found it: correct an entry this thread proved wrong, merge duplicates you touched, move a lesson that belongs in a repo's docs. The closing thread owns this; nothing else tidies the pool (`verify-ops.sh` only warns when one outgrows its budget). - Put knowledge where the next person will look. A client or technical fact goes to its page in the documentation system, a repo fact to that repo's docs, a decision to the changelog. Fix any document this thread made untrue. - Write the resume note at the top of the anchor or baton: NEXT ACTION (one step), VERIFY FIRST, DO NOT (with who said so), DEAD ENDS, ASK THE OWNER. +- Then run `session-end finish`. After a close it needs `--logged N` (time entries created and read back; 0 when entries already on the ticket cover the work) or `--declined REASON`. Skip it and the closeout stamp never moves, so the next ending redoes this one's work. - Pause: `session-end pause` prints the compact line. On T3, with the box's harness token, the thread compacts itself (`compact-cycle.sh`); without the token the cycle stops with `ERR_T3API` before it sends anything, and the owner fires `/compact`. Never compact over an unanswered question. - Move: the baton is `/.claude-handoffs/pending/.md`, key from `key.sh`. One pending baton per project; never overwrite an unread one. Commit and push it, or the other machine never sees it. -- Close: only on the owner's word; a thread never closes itself. Also remove what this thread made (scratch files, containers, temporary worktrees), never another thread's. Then settle the way `session-end close` prints it (T3's own settle tool; `t3-api.sh settle-when-idle` only where that tool is missing), and print the receipt first, because nothing after the settle reaches the owner. -- Time: when this thread worked a ticket, log its time before closing. `active-minutes` measures it; read what is already on the ticket first so nothing is billed twice. Ending a thread never changes a ticket's status. Closing a ticket follows `CONTEXT/work-tracking.md` (or your organization's platform skill, when this copy has it), and it does not end the thread. +- Close: only on the owner's word; a thread never closes itself. `session-end close` lists what this thread made (scratch files, containers, temporary worktrees): remove them yourself by exact path or id, never another thread's and never one it marks as ownership unknown. Then settle the way `session-end close` prints it (T3's own settle tool; `t3-api.sh settle-when-idle` only where that tool is missing), and print the receipt first, because nothing after the settle reaches the owner. +- Time: when this thread worked a ticket, log its time before closing. `session-end close` prints the measured minutes (`active-minutes` is the tool); read what is already on the ticket first so nothing is billed twice. Ending a thread never changes a ticket's status. Closing a ticket follows `CONTEXT/work-tracking.md` (or your organization's platform skill, when this copy has it), and it does not end the thread. ## Talking to the owner