agent-bios 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +2 -2
  2. package/claude/CLAUDE.md +8 -8
  3. package/claude/guides/claude-prompting.md +59 -7
  4. package/claude/guides/cli-multi-model-workflow.md +6 -1
  5. package/claude/guides/coding-staged-workflow.md +12 -0
  6. package/claude/guides/gpt-prompting.md +60 -4
  7. package/claude/guides/learning-flow.md +4 -1
  8. package/claude/guides/llm-capability-boundary-patterns.md +8 -0
  9. package/claude/guides/review-request.md +13 -0
  10. package/claude/guides/session-distill-workflow.md +21 -9
  11. package/claude/guides/tooling-gotchas.md +181 -14
  12. package/claude/guides/verification-discipline.md +71 -3
  13. package/claude/hooks/tooling-gotchas-hook.py +50 -0
  14. package/codex/AGENTS.md +8 -8
  15. package/codex/guides/claude-prompting.md +59 -7
  16. package/codex/guides/cli-multi-model-workflow.md +6 -1
  17. package/codex/guides/coding-staged-workflow.md +12 -0
  18. package/codex/guides/gpt-prompting.md +60 -4
  19. package/codex/guides/learning-flow.md +4 -1
  20. package/codex/guides/llm-capability-boundary-patterns.md +8 -0
  21. package/codex/guides/review-request.md +13 -0
  22. package/codex/guides/session-distill-workflow.md +21 -9
  23. package/codex/guides/tooling-gotchas.md +181 -14
  24. package/codex/guides/verification-discipline.md +71 -3
  25. package/compose/corpus-state.py +1170 -0
  26. package/compose/write-update-cache.py +53 -0
  27. package/install.sh +198 -11
  28. package/launch/agent-launch.py +112 -6
  29. package/launch/agent-launch.zsh +109 -6
  30. package/launch/i18n/en.toml +1 -0
  31. package/launch/i18n/ja.toml +1 -0
  32. package/launch/i18n/ko.toml +1 -0
  33. package/learn/collect-learning.py +593 -62
  34. package/learn/redact.py +2 -1
  35. package/package.json +4 -2
  36. package/provenance.json +1 -1
package/README.md CHANGED
@@ -35,7 +35,7 @@ Two layers:
35
35
  | `claude/guides/*.md`, `codex/guides/*.md` | scoped guides (en) — installed |
36
36
  | `codex/agents/*.toml` | Codex custom subagent role templates — installed |
37
37
  | `ko/**` | Korean mirror of every doc above + this README + DEPENDENCIES (reference only) |
38
- | `launch/` | launch profile, preflight TUI, zero-argument shell interception, the managed Textual venv, and the prompting-target check that guards the profile's model bindings |
38
+ | `launch/` | launch profile, preflight TUI, zero-argument shell interception (reasserted at `preexec`: a terminal that redefines `claude` at its prompt hook is redefined back before the command runs — one that redefines it in a later `preexec`, or through an alias for the command already parsed, is recorded, not fought), the managed Textual venv, and the prompting-target check that guards the profile's model bindings |
39
39
  | `compose/` | corpus classification and per-selection assembly — domain manifest and its gate, assembler, package identity, hook registration, activation canary, deployed-corpus state |
40
40
  | `learn/` | the collection loop — capture, record schema and its validator, curation intake, promotion manifest, redistribution, and the secret-redaction floor |
41
41
  | `session-distill/` | the heavy curator pipeline that mines many sessions into corpus-grade items |
@@ -111,7 +111,7 @@ Add `$CODEX_DIR/bin` to `PATH` or invoke the wrappers by absolute path. `codex-h
111
111
 
112
112
  ## Adopting elsewhere
113
113
 
114
- Keep the rule layers. Swap checklist: each guide's `Environment Binding` (`(private)` entries are the author's examples); the response-language preference and the "설계" design-trigger word in the global file; skill/MCP names inventoried in `DEPENDENCIES.md` (the `spreadsheet-processing` skill, the review MCP). Then re-measure `Evidence Base` numbers in your environment before tuning.
114
+ Keep the rule layers. Swap checklist: every line carrying the `(private)` private-binding marker — today the global file's response-language preference; guides' `Environment Binding` author examples adopt the marker as they are touched — plus the "설계" design-trigger word in the global file and the skill/MCP names inventoried in `DEPENDENCIES.md` (the `spreadsheet-processing` skill, the review MCP). The other direction is enforced, not asked: `gates/check-hygiene.py` refuses org identifiers anywhere in the shipped distribution and author identifiers outside marked lines or per-reason exemptions. Then re-measure `Evidence Base` numbers in your environment before tuning.
115
115
 
116
116
  ## Scope
117
117
 
package/claude/CLAUDE.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Global Preferences
4
4
 
5
- - Prefer concise Korean responses with polite speech unless the user asks otherwise.
5
+ - Prefer concise Korean responses with polite speech unless the user asks otherwise. (private)
6
6
  - Keep file changes within the requested scope.
7
7
 
8
8
  ## Problem Solving
@@ -10,7 +10,7 @@
10
10
  - First identify the goal, scope, ambiguities, and likely completion condition.
11
11
  - Resolve ambiguity from context when safe; ask only when ambiguity blocks progress or creates risky outcomes.
12
12
  - For simple requests, choose the most direct low-risk method and proceed.
13
- - For non-trivial requests, compare 2-4 methods by goal fit, time, cost, risk, benefit, and "done when".
13
+ - For non-trivial requests, compare 2-4 methods by goal fit, time, cost, risk, benefit, and "done when", and portability — take a host-, model-, or tool-specific mechanism (hook, skill, host-owned directory) only after a portable route is shown absent and its per-host cost is judged worth it.
14
14
  - Mark one default method. If the user is silent and the default is safe, proceed with it.
15
15
  - Execute the chosen method accurately and stay within scope.
16
16
  - Return to understanding if a discovery breaks the user's premise.
@@ -21,7 +21,7 @@
21
21
 
22
22
  ## Decision Framing
23
23
 
24
- - Ask decision questions in outcome terms, not jargon terms.
24
+ - Ask decision questions in outcome terms, not jargon terms: before ending a turn on a decision request, check that it gives the situation in one plain sentence, what changes for the user under each option, and a default — and where a structured question channel exists, route the ask through it so its fields force that shape.
25
25
  - When the user may not know the domain, explain choices by resulting behavior, tradeoffs, time, cost, risk, reversibility, and recommended default.
26
26
  - Present 2-4 meaningful options. Ask about implementation details only when they directly affect the decision.
27
27
  - For each option, state what changes for the user or product, what it costs, what risk it carries, and when it is the right choice.
@@ -29,7 +29,7 @@
29
29
  - Ask for the user's goal or constraint when that determines the answer; otherwise choose the safest default and proceed.
30
30
  - Evaluate user suggestions for goal fit, risk, complexity, and verification before turning them into implementation plans; if a suggestion does not fit the user's goal, say so clearly and recommend a better path.
31
31
  - Distinguish implementation feasibility from recommendation.
32
- - Do not default to a restrictive lens (security, masking, capability limits) when the system's purpose is sharing or utilization; confirm the purpose framing first, and restrict only on concrete, named risk.
32
+ - Do not default to a restrictive lens (security, masking, capability limits) when the system's purpose is sharing or utilization; confirm the purpose framing first, and restrict only on concrete, named risk — and size every control (gate, cap, rule, review lens, success criterion, clarifying question) to that risk: a target is a direction, not an absolute, and prefer a warning plus a recovery path over a prohibition.
33
33
  - Treat user suggestions, inherited premises, prior diagnoses, handoff and design claims, reviewer findings, and your own earlier conclusions as hypotheses, not facts; re-derive each load-bearing claim from real code or data before building on it, and record a dated correction in the source doc or memory when a finding overturns it.
34
34
 
35
35
  ## LLM And Capability Boundary
@@ -53,7 +53,7 @@
53
53
  ## Concept Economy
54
54
 
55
55
  - When adding, changing, renaming, splitting, or exposing anything lasting or shared — a feature, entity, type, field, config key, CLI flag, enum value, failure kind, artifact, or documentation term — read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/concept-economy.md` as a scoped extension of this section.
56
- - Before fixing a review finding or test failure, classify the fix as reducing, preserving, or increasing the active concept surface.
56
+ - Before fixing a review finding or test failure, name its cause — a finding is a symptom — then classify the fix as reducing, preserving, or increasing the active concept surface, and fix the cause completely now: a scope-minimal patch that leaves the cause in place is not a fix.
57
57
 
58
58
  ## Coding Guidelines
59
59
 
@@ -61,7 +61,7 @@
61
61
  - For development work, read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/coding-staged-workflow.md` as a scoped extension of these Coding Guidelines — a change too narrow to need it is what its lightweight path decides, not a reason to skip the read.
62
62
  - For mock, fixture, fake, stub, simulated-provider, or test-realization design, read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/mock-realization-boundary.md` as a scoped extension of these Coding Guidelines.
63
63
  - Own the full lifecycle of what you create — spawned processes and handles through teardown, artifacts out of tool-managed temp locations into a durable home — and keep differently-owned state separate: never colocate deploy-managed and user-owned data in one overwrite-managed file.
64
- - Land risky or behavior-changing work behind a default-off path that preserves current behavior when off (proven by diff) and is enabled by an explicit opt-in, so the change stays reversible and the on/off difference is isolated. When a request would weaken a security or authority posture — removing or loosening an authentication/authorization check or access scope, or lowering a protective value such as session/token lifetime, password/crypto strength, rate limit, lockout threshold, or audit retention — treat it as a decision, not a rote edit, even when it is a one-line change and nothing in the code labels the value as security-relevant: state the consequence and at least one safer path to the real goal, and do not apply the weakening in the same turn — proceed only after the user confirms they accept the tradeoff.
64
+ - Land risky or behavior-changing work behind a default-off path that preserves current behavior when off (proven by diff) and is enabled by an explicit opt-in, so the change stays reversible and the on/off difference is isolated — the switch lands a fix reversibly and never substitutes for one. When a request would weaken a security or authority posture — removing or loosening an authentication/authorization check or access scope, or lowering a protective value such as session/token lifetime, password/crypto strength, rate limit, lockout threshold, or audit retention — treat it as a decision, not a rote edit, even when it is a one-line change and nothing in the code labels the value as security-relevant: state the consequence and at least one safer path to the real goal, and do not apply the weakening in the same turn — proceed only after the user confirms they accept the tradeoff.
65
65
 
66
66
  ## Verification Discipline
67
67
 
@@ -77,14 +77,14 @@
77
77
  - For concrete shell/CLI traps — pipe exit codes, output rendering, git range/pull semantics, config and managed-service pitfalls — read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/tooling-gotchas.md` as a scoped extension of this section.
78
78
  - Ambient state — the active shell, cloud CLI project/context, command-name resolution, 'latest'-style pointers, version-bearing paths — drifts silently; where an outcome depends on it, pin it explicitly (a pinned interpreter, --project/--context flags, exact handles, resolved paths) instead of trusting the environment.
79
79
  - Before relying on any model id, tool flag, API capability, dependency version, or runtime constraint, confirm it empirically against the live or installed artifact (a minimal probe, the binary's registered options, the installed package version) rather than docs, memory, or a version string.
80
- - Scope destructive actions (kill, rm, force-push, reset --hard) to targets you own, identified by PID, path, or ancestry — never a broad command-line substring or blanket match — and diagnose the actual state before any irreversible git, remote, or process operation; snapshot the last good state before any in-place resume or overwrite of a completed run, and gate irreversible identity-tied actions (revoke, delete, grant, consent) on a live identity check — never auto-open a browser for a non-default identity (hand the operator the URL).
80
+ - Scope destructive actions (kill, rm, force-push, reset --hard) to targets you own, by PID, path, or ancestry — never a broad command-line substring or blanket match — and diagnose actual state before any irreversible git, remote, or process operation; snapshot the last good state before any in-place resume or overwrite of a completed run, and gate irreversible identity-tied actions (revoke, delete, grant, consent, account-bound creation) on a live identity check — never auto-open a browser for a non-default identity (hand the operator the URL).
81
81
  - Never accept secrets through transcript- or history-logged channels.
82
82
  - When a secret must be supplied, provide a gitignored env slot, read the value only from the environment, verify its presence and format without echoing it, and advise rotating anything already pasted; assume a resource-creating call may echo the secret back in its success output — suppress or discard the response body, and treat an echoed secret as pasted (rotate).
83
83
  - Treat a coarse runtime signal — a failure label, a `ps`/process-inspection result, idle CPU with no output — as a hypothesis, and confirm the cause against the authoritative low-level evidence the mechanism emits before attributing blame or intervening: read the raw provider/skill log payload (e.g. `input_tokens:0` proves a pre-dispatch rejection that exonerates your content and your change), and confirm a config/env toggle reached a subprocess via a cheap artifact the gated branch emits rather than an unreliable `ps` env read. A multi-minute LLM or subprocess call at ~0% CPU with an output gap is the normal signature of I/O wait, not a hang — check process state and the call trace's in-flight duration before acting, so you do not abort healthy long-running work.
84
84
 
85
85
  ## Multi-Model Workflow
86
86
 
87
- - Standing spawn policy: check the spawn gates at every work-unit boundary — judgment latitude applies inside a gate, never to whether the gates are checked. Independence: verifying or reviewing your own work always spawns. Parallelism: two or more independent items spawn in parallel — SWEEP when each item applies one explicit rule and returns ambiguity as an exception, else WORKHORSE. Residual context: work whose log dwarfs the conclusion the main needs spawns with a bounded report contract. Escalation: an irreversible or authority-changing action ahead, two failed attempts, or two persisting design alternatives spawns a bounded FRONTIER judgment with a blind packet (evidence, constraints, rubric, neutral alternatives — never your draft conclusion) and a pre-noted change condition. Specifiability/de-minimis: work needing your live context, or whose verification would repeat the reasoning, or whose packet outweighs the work, stays inline.
87
+ - Standing spawn policy: check the spawn gates at every work-unit boundary — judgment latitude applies inside a gate, never to whether the gates are checked. Independence: verifying or reviewing your own work always spawns, and you raise it yourself — before presenting a load-bearing conclusion or taking an irreversible step, propose the cross-check unprompted; the user should never have to ask for it. Parallelism: two or more independent items spawn in parallel — SWEEP when each item applies one explicit rule and returns ambiguity as an exception, else WORKHORSE. Residual context: work whose log dwarfs the conclusion the main needs spawns with a bounded report contract. Escalation: an irreversible or authority-changing action ahead, two failed attempts, or two persisting design alternatives spawns a bounded FRONTIER judgment with a blind packet (evidence, constraints, rubric, neutral alternatives — never your draft conclusion) and a pre-noted change condition. Specifiability/de-minimis: work needing your live context, or whose verification would repeat the reasoning, or whose packet outweighs the work, stays inline.
88
88
  - Down-spawns carry a machine-checkable done-when on decision-complete work with staged output (no external irreversible actions) and briefing-plus-verifying clearly cheaper than doing. Record one line per gate decision — `SpawnGate: <gate> <tier> spawn|inline — <why>` — and for FRONTIER record the disposition afterward (what changed, or why nothing did). A launch contract's `Delegation=off` lifts the spawn obligation, not the records; explicit user no-fan-out always wins.
89
89
  - For work spanning multiple models or CLI agents, context resets and handoffs, unattended LLM batches (including orchestrated subagent fleets), or parallel worktree branches, read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/cli-multi-model-workflow.md` as a scoped extension of this section.
90
90
  - For composing a prompt, packet, or tool description aimed at a specific model family — including cross-family review dispatch, porting a prompt written for an older model, or choosing a reasoning-effort level for a model family — read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/gpt-prompting.md` for gpt-family targets and `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/claude-prompting.md` for claude-family targets as scoped extensions of this section.
@@ -15,6 +15,14 @@ core_rules:
15
15
  - make tool descriptions prescriptive about when to call, not only what the tool does
16
16
  - require progress claims to be audited against a tool result from the same session
17
17
  - name the boundary explicitly — what to do without asking, and what to stop and ask about
18
+ derived_at: 2026-09-01
19
+ source_pins:
20
+ - doc: prompting-claude-opus-5
21
+ sha256: 65be3e0b437cbe23cc41bb4f9b7a5031c5a71cd49ab91ec4d19c62738762b086
22
+ pinned_at: 2026-09-01
23
+ - doc: claude-prompting-best-practices
24
+ sha256: 476ddc2744812dced0b520c8f628aecb52df52babdaf82ee5a0b10f25f5bcbdb
25
+ pinned_at: 2026-09-01
18
26
  targets:
19
27
  - claude-fable-5
20
28
  - claude-opus-5
@@ -68,7 +76,12 @@ pick the path.
68
76
  - Delegation: say when *not* to delegate, and cap the spawn count. The helm
69
77
  binding reaches for subagents readily — the reverse of the binding it replaced
70
78
  — and every spawn rebuilds context, reports back, and is then re-read, so
71
- unbounded delegation multiplies cost and latency. File-based memory and custom
79
+ unbounded delegation multiplies cost and latency. Where the harness offers
80
+ deterministic caps, prefer them to prose: under Claude Code and the Agent SDK
81
+ these are `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`,
82
+ `CLAUDE_CODE_MAX_CONCURRENT_SUBAGENTS`, and the SDK's `max_budget_usd` — a
83
+ limit the model cannot talk itself past. Confirm the harness version supports
84
+ them before relying on it. File-based memory and custom
72
85
  tools are the opposite case: they still need an explicit when-to-use trigger.
73
86
  - Autonomous runs with no human watching: say so. Otherwise it asks permission
74
87
  it does not need and blocks. Grant autonomy on minor choices (naming,
@@ -107,7 +120,9 @@ pick the path.
107
120
  treating a quiet call as a hang.
108
121
  - Do not add "summarize every N tool calls" scaffolding — this tier narrates on
109
122
  its own. If it narrates too much for a coding agent, set a silence default
110
- instead: text only on a finding, a direction change, or a blocker.
123
+ instead: text only on a finding, a direction change, or a blocker. Describe the
124
+ cadence you want by example; a positive description of the style outperforms a
125
+ list of what not to do.
111
126
  - Length is a prompting lever, not an effort lever. This tier writes longer
112
127
  answers and longer files than its predecessors, and lowering `effort` does not
113
128
  reliably shorten visible output — only an explicit instruction does. Calibrate
@@ -121,6 +136,36 @@ pick the path.
121
136
  work they did not watch. Lead with the outcome; drop the working shorthand.
122
137
  - Do not show a remaining-context countdown. This tier can start conserving and
123
138
  suggest a fresh session instead of finishing.
139
+ - Re-validate prompt-side vision workarounds carried from older bindings; this
140
+ tier is strong on charts, documents, diagrams, and UI replication, and the
141
+ workaround may now be the thing costing quality. Tools that let it crop and
142
+ visually verify beat thinking alone here.
143
+ - Instruction following stays consistent across the full context window, so a
144
+ rule does not need restating near the end to survive a long session.
145
+
146
+ ## Running with thinking disabled
147
+
148
+ Disabling thinking is accepted only at `high` effort or below, and it is usually
149
+ the wrong lever: thinking on at `low` effort generally beats thinking off at
150
+ comparable cost. Reach for lower effort before reaching for the switch.
151
+
152
+ Two artifacts appear when it is off, and both are prompt-fixable:
153
+
154
+ - A tool call written as **user-facing text** instead of a structured call. The
155
+ turn completes, the call never runs, and in an agentic loop the leaked text
156
+ stays in history and contaminates later turns. Most common on tool-heavy work.
157
+ - Internal XML tags leaking into the visible response.
158
+
159
+ One instruction mitigates both — permission to speak before a call, an out when
160
+ no tool fits, and a general ban on internal tags:
161
+
162
+ > When you use a tool, you may say a brief sentence first. If no tool can express
163
+ > what the user asked for, say so instead of guessing. Do not include internal or
164
+ > system XML tags in your response.
165
+
166
+ Two traps. Naming the tags specifically is **less** effective than the general
167
+ form. And if a prompt anywhere tells this tier not to think or not to reason,
168
+ delete it: that instruction increases tag leakage rather than suppressing it.
124
169
 
125
170
  ## Prompt assembly checklist
126
171
 
@@ -134,8 +179,15 @@ pick the path.
134
179
 
135
180
  ## Sources
136
181
 
137
- Derived from the vendor's published guidance for the `targets` models above.
138
- When a `targets` model changes, re-derive this guide from current vendor
139
- guidance rather than editing around the old rules prompting guidance is
140
- version-bound. `launch/check-prompting-targets.sh` fails when the launch config
141
- binds a model this guide does not list.
182
+ Derived from the vendor's `prompting-claude-opus-5` and
183
+ `claude-prompting-best-practices` documents, at the exact bytes whose hashes are
184
+ recorded in `source_pins` above. The pin is what makes a later vendor edit
185
+ detectable rather than remembered.
186
+
187
+ Prompting guidance is version-bound — this generation inverted advice the last one
188
+ gave — so when a `targets` model changes, re-derive from the current documents
189
+ rather than editing around the old rules.
190
+ `launch/check-prompting-targets.sh` fails when the launch config binds a model
191
+ this guide does not list; that check is about **naming**, and a model added to
192
+ `targets:` satisfies it forever. Whether the guidance was actually re-derived is
193
+ not decidable and is gated nowhere.
@@ -106,7 +106,7 @@ Instruction/config reach is per invocation. A rule in AGENTS.md cannot bind a he
106
106
  - Run deterministic gates before LLM review. Funnel SWEEP finders → WORKHORSE judgments → FRONTIER triage/verdicts.
107
107
  - On family collapse, record the downgrade and label clean verdicts PROPOSED until diversity is restored.
108
108
  - A silent/dead lens is incomplete, never clean. Confirm liveness from usage/error/report evidence; rerun, swap provider, or report PROPOSED.
109
- - Kind labels do not guarantee distinct backends: wrappers and rate-limit fallbacks can silently route two "different-kind" verifiers to the same model/provider. Before trusting diversity on a high-stakes verdict, confirm each verifier's actual backing model from live process or usage evidence; on collapse, treat the pair as one kind and label PROPOSED.
109
+ - Kind labels do not guarantee distinct backends: wrappers and rate-limit fallbacks can silently route two "different-kind" verifiers to the same model/provider. Before trusting diversity on a high-stakes verdict, confirm each verifier's actual backing model from live process or usage evidence; on collapse, treat the pair as one kind and label PROPOSED. Runners recording what ran need the same read: identity taken from the target at execution time, never a runner-side literal, and asserted equal to what was requested — fallback seats pass existence checks.
110
110
 
111
111
  ### Review Independence
112
112
 
@@ -124,6 +124,7 @@ How much independence a review actually bought, as an ordinal grade per reviewer
124
124
  - The floor still requires **at least two distinct perspectives**; one pass on the main's own seat is self-review with extra steps.
125
125
  - Multiple ready methods are **coverage, not diversity**. Distinct labels do not prove the perspectives differed.
126
126
  - **Achieved is not available.** What can be projected before a review runs is `projected`; a clean verdict without a receipt evidencing a fresh dispatch, the declared packet, a non-empty result and the exact seat is `PROPOSED`, never ACHIEVED. A model echo is not a receipt.
127
+ - **Evidence access is its own axis.** When every reviewer saw only the blind packet, convergence — even across providers — is evidence about the packet's framing, omissions included. Before adopting a converged verdict resting on a code seat, a measured fact, or a constraint list, route one seat with live read access to falsify those facts: a lone dissent citing a real constraint outweighs a blind majority, and the missing fact returns to the packet. It sits beside the ladder, not on it.
127
128
 
128
129
  ## Dual-Provider Design Drafts
129
130
 
@@ -136,11 +137,14 @@ How much independence a review actually bought, as an ordinal grade per reviewer
136
137
  - The parent owns per-item completion and a **code-level circuit breaker**. For dispatchers you do not control, verify equivalent protection or attend the run.
137
138
  - Default breaker: halt after 3 consecutive cross-item provider limit/auth/transport failures after bounded backoff. Persist undone items and alert or swap provider.
138
139
  - Item-specific failures are poison items: cap at 2–3 attempts, then dead-letter them as complete-with-failure. Resume only unfinished/invalid items; whole-batch reruns require cheap idempotence.
140
+ - An enumeration run is done only when its collected count is asserted against the source's own reported total for the same filter. Classify retriable failures by class — any server-side transient — rather than an enumerated code list, since an omitted code drops items silently; persist which batches failed and reconcile them before declaring completion; and treat a mismatch, or a total from a differently scoped population, as a defect rather than a footnote. A declared partial or sampled scope is outside this.
139
141
  - Persist per-item outcome, token, and cost records for recalibration.
142
+ - Before releasing a metered batch past its first item, use that item to probe the batch machinery, not the item logic: run it end to end through the real runner to its side effect, then confirm every value the later analysis depends on — treatment knob, run identity, cost — reached the persisted record through the expected channel. On the first failures read raw run logs, not the runner's status classifier, which infers causes from missing outputs. A cheap idempotent batch needs no gate.
140
143
 
141
144
  ## Halt And Resume
142
145
 
143
146
  - Resume-first from artifacts that parse, pass schema, and match their recorded source/config/HEAD fingerprint; unverifiable means invalid.
147
+ - A cache-hit or fingerprint predicate must cover every value that shapes the artifact's content — the upstream input's content identity, caps, templates, model ids, config — never existence, mtime, or size alone; when adding a new output-shaping value, inspect the key's pre-image in the same change and assert the key moves when the value moves. Before re-running because an upstream input changed, invalidate intermediates whose predicate omits that input's identity: a regenerate over existence-keyed caches re-derives from the old input.
144
148
  - Resubmit one invalid unit unless failures are broadly correlated, which is structural and halts the run.
145
149
  - Treat halt→continue as normal operation.
146
150
  - Treat tool-managed temp/cache output locations as ephemeral — they are garbage-collected on the tool's own schedule. Copy any artifact a pending or handed-off decision depends on into a project-owned durable path before relying on it later.
@@ -150,6 +154,7 @@ How much independence a review actually bought, as an ordinal grade per reviewer
150
154
 
151
155
  - Sessions bind to their starting directory. Use the CLI's native relocation/resume mechanism; never copy transcript files.
152
156
  - For a new worktree, relocate natively or write a handoff and start fresh. Re-integrate branches serially and re-verify after each merge.
157
+ - A conflict-free merge with a green build is evidence about text, not placement. When the base side restructured the surrounding code — regrouped sections, split modules, new per-variant containers — locate each merged addition in the new structure and confirm its scope still matches its container's: a global setting must not sit inside a variant-specific container, and no duplicate or orphaned copy may remain. A merge onto an unchanged layout needs only the ordinary green-state check.
153
158
  - Mark superseded worktrees/handoffs dead so later resume cannot select them.
154
159
  - After resume/clear/relocation, verify pwd, branch, and HEAD against the pinned handoff before acting.
155
160
  - Attribute a parallel session's action (commit, branch, resource) by execution evidence in that session's own transcript, never by token mentions — shared handoff/memory files inject the same tokens into every session's context.
@@ -75,6 +75,18 @@ patching downstream: compensating code keeps accumulating around bad inputs, and
75
75
  another instance of the same defect. The first says go upstream to where the value is produced.
76
76
  The second says the instances are a class — single-source the value and fix the class, because
77
77
  patching them one at a time is a queue that refills.
78
+ **Supplying a missing shared dependency wakes every consumer, not just the one you are fixing.** When
79
+ a repair supplies a value many paths read and that was absent — a secret, a packaged file —
80
+ enumerate those consumers and say what each starts doing: metered calls, external writes,
81
+ user-visible output. Where that onset exceeds the feature under repair, hand the list to the owner
82
+ as a decision, not a line in the fix. Consumers that are all read-only and free need no gate.
83
+
84
+ **Measure a flip before you design its activation.** When a version bump, default change, or
85
+ severity re-mapping is coming, flip it, run the full suite, classify every failure (cascade,
86
+ pinned control, true detection, real regression), and restore — that count is the activation's
87
+ blast radius. Re-mapping a level obliges enumerating every reader of that field, since one level
88
+ commonly gates shipping, repair, retry, and display at once. A deferred defect is pinned as a
89
+ strict expected failure, never a silent pass.
78
90
 
79
91
  ## Review Loop
80
92
 
@@ -15,6 +15,14 @@ core_rules:
15
15
  - replace blanket ALWAYS/NEVER with decision rules naming the condition each choice applies under
16
16
  - fix the prompt before raising effort — weak output usually means a missing success criterion, dependency rule, tool-routing rule, or verification loop
17
17
  - prompting habits carried from older gpt models cost tokens and can cost accuracy
18
+ derived_at: 2026-09-01
19
+ source_pins:
20
+ - doc: prompt-guidance-gpt-5p6
21
+ sha256: 46181efec9fd1160ef537b0379282a14c1ba32380f2f8149a805128253c1115a
22
+ pinned_at: 2026-09-01
23
+ - doc: latest-model
24
+ sha256: 48f61f648eab971334f6076bc61478d0f2bcd7a50111064722eba267a0f98d61
25
+ pinned_at: 2026-09-01
18
26
  targets:
19
27
  - gpt-5.6-sol
20
28
  - gpt-5.6-terra
@@ -85,9 +93,50 @@ Compose in this order; omit any block that would not change the artifact.
85
93
  - Prefer a self-contained packet over resuming a long history: it is cheaper to
86
94
  reason about and cheaper to cache.
87
95
 
96
+ ## Programmatic tool calling
97
+
98
+ A bounded stage where code processes several tool results and returns a much smaller
99
+ structured result. The qualifier is **reduction**, not parallelism: multiple, parallel,
100
+ or dependent calls alone do not justify it.
101
+
102
+ - Use it for filtering, joining, sorting, ranking, deduplication and aggregation;
103
+ batching across many similar records; repeated deterministic validation; and large
104
+ structured results reducible to a compact schema.
105
+ - Prefer direct calls when one call suffices, when intermediate outputs are already
106
+ small, when each result may change the next decision, when an action needs approval,
107
+ when the answer must preserve citations or native artifacts, or when semantic
108
+ judgment sits between calls.
109
+ - A generic "use programmatic tool calling efficiently" does nothing. State the bounded
110
+ stage, the eligible tools, the output schema, the retry limit, the stop condition, and
111
+ the handoff back to direct judgment. If both routes are needed, define one handoff and
112
+ say not to switch routes or repeat completed work.
113
+ - **Test both outputs.** The program's result and the final assistant message are
114
+ separate; a program can return the right records while the message drops a required
115
+ field, citation, or caveat.
116
+ - Compare the two routes on the same tasks, and count lower token/latency/cost as an
117
+ improvement only when the response still passes the existing evals.
118
+
88
119
  ## Working rules
89
120
 
90
121
  - One clear task per run, with an explicit output contract.
122
+ - **Read the assembled prompt for contradictions.** This tier follows a prompt contract
123
+ closely, so two rules that disagree destabilize it more than a missing rule does —
124
+ the opposite of the intuition that more instruction is safer.
125
+ - State each authority rule once. Repeating "ask first", "do not mutate", or "wait for
126
+ approval" produces approval requests for safe, expected actions.
127
+ - Name the current layer of work — research, design, implementation, review, external
128
+ coordination — on long-running tasks, so the model does not move between layers
129
+ silently.
130
+ - Persisted reasoning is not a free optimization. It helps while the objective and
131
+ priorities hold; once they move, stale reasoning adds tokens and anchors the model to
132
+ a superseded approach. Compact at milestones, not every turn, and treat compacted
133
+ items as opaque.
134
+ - Set the default detail level through the API (`text.verbosity`) and keep the prompt
135
+ for task-specific length and structure; a prompt-only length rule has to be restated
136
+ everywhere.
137
+ - Preserve explicit user values. Where the right value is implicit, give decision
138
+ criteria and let the model reason from context or schema rather than installing
139
+ universal defaults or keyword maps.
91
140
  - Keep reusable prefixes stable and avoid churn in large system prompts. Add
92
141
  explicit cache breakpoints only where they measurably improve cache behavior —
93
142
  a cache write costs 1.25× the uncached input rate, so read the cached-token
@@ -110,9 +159,16 @@ Compose in this order; omit any block that would not change the artifact.
110
159
 
111
160
  ## Sources
112
161
 
113
- Derived from the vendor's published prompting guidance for the `targets` models
114
- above. When a `targets` model changes, re-derive this guide from current vendor
115
- guidance rather than editing around the old rules prompting guidance is
116
- version-bound, and the previous generation's advice inverted on this one.
162
+ Derived from the vendor's `prompt-guidance-gpt-5p6` and `latest-model`
163
+ documents, at the exact bytes whose hashes are recorded in `source_pins` above.
164
+ The pin is what makes a later vendor edit detectable rather than remembered.
165
+
166
+ Prompting guidance is version-bound and the previous generation's advice inverted
167
+ on this one, so when a `targets` model changes, re-derive from the current
168
+ documents rather than editing around the old rules.
169
+ `launch/check-prompting-targets.sh` fails when the launch config binds a model
170
+ this guide does not list; that check is about **naming**, and a model added to
171
+ `targets:` satisfies it forever. Whether the guidance was actually re-derived is
172
+ not decidable and is gated nowhere.
117
173
  `launch/check-prompting-targets.sh` fails when the launch config binds a model
118
174
  this guide does not list.
@@ -103,4 +103,7 @@ payload — do not work around the validation.
103
103
  - Single-session capture only; cross-session mining is `distill!` (curator).
104
104
  - Mechanization (hook/gate/enforcement) is deferred to curation — record intent, don't build it.
105
105
  - Type-G principle manufacture is curator-only.
106
- - Transport (upload to the org) lands in Phase 2; Phase 1 writes locally.
106
+ - Transport (upload to the org) is best-effort after the local write: it runs only
107
+ when the `~/.config/agent-bios/{ingest-url,token}` slot is set, which is the
108
+ only source there is. A default install sets nothing, so nothing leaves the
109
+ machine; an org fills the slot through its own wrapper.
@@ -314,6 +314,14 @@ Retries are safe for pure generation and validation. They are not automatically
314
314
  safe for external side effects. Use idempotency keys, locks, duplicate detection,
315
315
  or compensation plans where needed.
316
316
 
317
+ A stage that can re-run on the same record must not read the field it writes.
318
+ On a re-run (reclassification, backfill, retry) an input field that is also
319
+ its output feeds the model its prior answer, and the value drifts from the
320
+ source silently. Keep the captured original immutable, write derived values to
321
+ their own field, and treat `original ?? current` as migration, not design.
322
+ Audit its siblings: one harmless only because its selection rule skips
323
+ overwritten rows is a latent instance.
324
+
317
325
  ## Single Source Of Truth And Schema Evolution
318
326
 
319
327
  Hybrid enforcement creates drift risk. A single constraint can appear in prompt
@@ -122,6 +122,12 @@ design; do not treat missing implementation as a defect." A session given exactl
122
122
  that instruction returned zero findings and proved it had looked, anchored on
123
123
  both sides of the comparison. A session not given it filed unimplemented code as
124
124
  blockers, and the user caught it manually.
125
+ The target also has a revision. Name the commit or content hash the packet
126
+ was dispatched on, and hold the artifact still until every reviewer on
127
+ that revision has returned. When a fix must land while a lens is still in
128
+ flight, map the returned findings against the pinned revision before
129
+ counting them: a finding whose anchor text no longer exists is stale,
130
+ closed by that mapping rather than re-fixed, and never tallied as open.
125
131
 
126
132
  ## Bundle the consumer, not just the artifact
127
133
 
@@ -226,6 +232,13 @@ Two consequences for anyone consuming a review:
226
232
  count was scoped to the material section, at which point 16% of the same
227
233
  findings turned out to have reached the reader explicitly flagged
228
234
  non-material. Read the verdict field, not the mention.
235
+ - Count the emitted item list against every total the harness reports —
236
+ findings count, verdict tally, per-item decision log — before triaging.
237
+ Zero findings is only the extreme case: any shortfall means items were
238
+ dropped in aggregation, and the dropped set is not random, since a merge
239
+ or filter tends to lose a whole class. Recover the difference from the
240
+ raw per-item record and triage the union; with no raw record the
241
+ deliverable is incomplete, not clean.
229
242
 
230
243
  ## Trust an empty result only when it cites what it checked
231
244
 
@@ -49,15 +49,27 @@ Run in order; each stage reads the previous stage's `out/`:
49
49
  Claude sidechain/sdk-cli/agentId).
50
50
  2. `digest.py` — one secret-redacted digest per session with deterministic
51
51
  6-criteria signals. Screen ALL digests; triage orders, never drops.
52
- 3. Provider-affine screening against the concatenated live baseline
53
- (CLAUDE.md + guides): `screen-claude.js` (Claude sessions) and
54
- `screen-codex.js` (Codex sessions), both dynamic-workflow scripts.
55
- Novelty is judged against real baseline text, not memory.
56
- 4. `consolidate.js`dedup + independent novelty verification. Rank by
57
- strength (recurrence × materiality), never by self-reported confidence.
58
- 5. `bundle_final.py` tiered bundle. Merge new candidates into
59
- `ledger.json` by cluster identity so recurrence accumulates across
60
- windows (incubated items promote when they re-occur).
52
+ 3. `batch.py` the baseline blob (`claude/CLAUDE.md` + every guide, the
53
+ repo's canonical corpus) and per-provider batches; writes
54
+ `out/batch_index.json`, which the screeners take as their `args`.
55
+ 4. Provider-affine screening against that baseline: `screen-claude.js`
56
+ (Claude sessions; a Workflow script pass the index as `args`, one
57
+ WORKHORSE screener per batch) and `screen-codex.py` (Codex sessions;
58
+ one hermetic read-only `codex exec` per batch, packet on stdin). Novelty
59
+ is judged against real baseline text, not memory. Then `collect.py`
60
+ unions the two outputs into `out/candidates-all.json` and fails when a
61
+ provider's screened set is smaller than its batch.
62
+ 5. `consolidate.js` (Workflow; `args` = baseline, candidates path, count,
63
+ and the ledger's `{id, lesson}` list) — dedup + independent novelty
64
+ verification, then a match pass naming which survivor recurs an
65
+ existing ledger entry. Rank by strength (recurrence × materiality),
66
+ never by self-reported confidence. Save its return value as
67
+ `out/consolidated.json`.
68
+ 6. `bundle_final.py` — tiered bundle. `merge-ledger.py --window-end <date>`
69
+ (dry-run; `--apply` writes) merges survivors into `ledger.json`: a
70
+ recurrence gains the window's sessions under `recurrence`, a new lesson
71
+ becomes a `candidate` entry — so recurrence accumulates across windows
72
+ and incubated items promote when they re-occur.
61
73
 
62
74
  ## Stage 2 — Review with the user
63
75