agent-bios 0.14.0 → 0.16.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 (60) hide show
  1. package/DEPENDENCIES.md +35 -12
  2. package/README.md +346 -31
  3. package/claude/CLAUDE.md +2 -2
  4. package/claude/agents/frontier.md +1 -1
  5. package/claude/agents/sweep.md +3 -3
  6. package/claude/agents/workhorse.md +2 -2
  7. package/claude/guides/claude-prompting.md +119 -34
  8. package/claude/guides/cli-multi-model-workflow.md +33 -15
  9. package/claude/guides/gpt-prompting.md +148 -28
  10. package/claude/guides/review-request.md +27 -0
  11. package/claude/guides/session-distill-workflow.md +54 -2
  12. package/claude/guides/slide-writing/RUNBOOK.md +137 -0
  13. package/claude/guides/slide-writing/scripts/pair.py +979 -0
  14. package/claude/guides/slide-writing/scripts/render.mjs +82 -0
  15. package/claude/guides/slide-writing.md +195 -0
  16. package/claude/guides/svg-visualization-guide.md +9 -0
  17. package/claude/guides/verification-discipline.md +5 -1
  18. package/claude/hooks/tooling-gotchas-hook.py +7 -5
  19. package/codex/AGENTS.md +2 -2
  20. package/codex/agents/frontier.toml +2 -1
  21. package/codex/agents/reviewer.toml +1 -1
  22. package/codex/agents/sweep.toml +3 -3
  23. package/codex/agents/workhorse.toml +1 -1
  24. package/codex/config-additions.toml +1 -1
  25. package/codex/guides/claude-prompting.md +119 -34
  26. package/codex/guides/cli-multi-model-workflow.md +33 -15
  27. package/codex/guides/gpt-prompting.md +148 -28
  28. package/codex/guides/review-request.md +27 -0
  29. package/codex/guides/session-distill-workflow.md +54 -2
  30. package/codex/guides/slide-writing/RUNBOOK.md +137 -0
  31. package/codex/guides/slide-writing/scripts/pair.py +979 -0
  32. package/codex/guides/slide-writing/scripts/render.mjs +82 -0
  33. package/codex/guides/slide-writing.md +195 -0
  34. package/codex/guides/svg-visualization-guide.md +9 -0
  35. package/codex/guides/verification-discipline.md +5 -1
  36. package/compose/assemble.py +290 -14
  37. package/compose/bootstrap/SKILL.md +119 -0
  38. package/compose/check-domains.py +102 -9
  39. package/compose/corpus-state.py +1174 -0
  40. package/compose/corpus.py +387 -0
  41. package/compose/corpus_catalog.py +882 -0
  42. package/compose/corpus_install.py +1617 -0
  43. package/compose/corpus_session.py +726 -0
  44. package/compose/corpus_store.py +1414 -0
  45. package/compose/corpus_transaction.py +236 -0
  46. package/compose/corpus_ui.py +644 -0
  47. package/compose/domains.json +101 -100
  48. package/compose/write-update-cache.py +53 -0
  49. package/install.sh +174 -24
  50. package/launch/agent-launch.py +1327 -184
  51. package/launch/agent-launch.toml +12 -16
  52. package/launch/i18n/en.toml +113 -7
  53. package/launch/i18n/ja.toml +113 -7
  54. package/launch/i18n/ko.toml +113 -7
  55. package/learn/collect-learning.py +46 -19
  56. package/learn/migrate-learnings.py +10 -1
  57. package/package.json +13 -3
  58. package/provenance.json +1 -1
  59. package/session-cost.py +22 -2
  60. package/wrappers/codex-helm.sh +3 -3
@@ -109,6 +109,33 @@ Ask only for what must change in this target now. Anything the reviewer would
109
109
  phrase as "carry forward", "watch", or "document later" costs tokens to produce,
110
110
  tokens to read, and is discarded — say that up front so it is never written.
111
111
 
112
+ ## Stop the loop on provenance, not on count
113
+
114
+ A review loop's finding count says nothing about whether to run another round. What decides
115
+ it is where the findings came from: a finding that a previous round's **fix** created is a
116
+ different animal from one that was always there.
117
+
118
+ Classify each finding three ways, not two: **caused** by the last fix, **surfaced** by it (the
119
+ fix made someone look there, but the defect reproduces on a path the fix never touched), or
120
+ pre-existing. The split is a revert rule, not a taxonomy: reverting removes a caused defect and merely
121
+ hides a surfaced one. Collapsing them is how someone reverts a design change, counts the
122
+ findings cleared, and leaves the surfaced ones live. The test that separates them is whether
123
+ the defect reproduces on a path the fix never touched. Then read the caused share across rounds. A rising share means the fixes are generating the work, which is the
124
+ signature of an undecided design question being patched at its consequences. Stop reviewing
125
+ and take the design as its own task.
126
+
127
+ The mechanism is the one Concept Economy already names: a fix that adds a lasting concept —
128
+ a field, a member, a contract, a failure mode, a new error status — is a design change no
129
+ matter how small the diff, and the next round finds its consequences. A fix that *removes*
130
+ a concept is the healthy shape.
131
+
132
+ When you stop, split the tree rather than leaving a half-designed mechanism in place: keep
133
+ the pure defect fixes, revert the design change, and record the gap where it will be read.
134
+
135
+ Source: an external 13-round campaign on a local API adapter, where rounds 12 and 13 ran 3-of-6
136
+ and 6-of-10 caused-by, all traceable to one two-line fix that introduced a new namespace. One
137
+ campaign, not a measured rate — the mechanism is the transferable part, not a threshold.
138
+
112
139
  ## Say what the target is, and what absence means
113
140
 
114
141
  The most common thing reviewers report they lacked is the stage context: they
@@ -6,9 +6,10 @@ audience: author
6
6
  use_when:
7
7
  - a session was launched with the Session distill preset (mission-injected)
8
8
  - the launcher nudge says enough sessions accumulated for a mining window
9
- - mining local Claude/Codex sessions for learnings absent from the corpus
9
+ - learning from LLM work sessions to improve the corpus and its application
10
10
  - promoting, incubating, or retiring items in the session-distill ledger
11
11
  core_rules:
12
+ - read Goal and desired outcomes before state files or pipeline work; use it to judge the run and its delegated work
12
13
  - the ledger is the SSOT for state; read it before touching the pipeline
13
14
  - placement follows PLACEMENT-FRAMEWORK.md, never ad-hoc judgment
14
15
  - every promotion passes an explicit user-approval gate
@@ -18,6 +19,56 @@ core_rules:
18
19
 
19
20
  # Session-Distill Workflow
20
21
 
22
+ ## Goal and desired outcomes — read first
23
+
24
+ Learn from the user's directly handled LLM work sessions so that
25
+ the user and future agents can correctly understand and explain what was learned,
26
+ apply it in relevant situations, and improve work quality, reliability, time,
27
+ and cost in line with the user's goals and priorities.
28
+
29
+ This goal applies across LLM providers and tools, including future integrations.
30
+ The collection sources currently supported are described under Stage 1.
31
+
32
+ Useful learning includes successful approaches, mistakes and corrections,
33
+ recurring friction, consequential exceptions, and the reasoning behind choices.
34
+ Compare it with existing knowledge: add what is missing, clarify or correct what
35
+ is inaccurate, improve what is not being applied, and preserve what works.
36
+ The novelty-focused screeners provide inputs to this broader goal; use the
37
+ retained session evidence for questions their candidate lists do not answer.
38
+
39
+ A run should produce:
40
+
41
+ 1. **Grounded learnings.** Explain what happened, what was learned, why the
42
+ evidence supports it, and its limits. Keep observed facts, interpretation,
43
+ and unresolved uncertainty distinguishable, with traceable session evidence.
44
+ 2. **Understandable, reusable content.** State the lesson, its rationale,
45
+ application conditions and boundaries. For a decision principle, explain the
46
+ competing values and the user's priority between them. Preserve concrete
47
+ facts or procedures where generalization would lose useful meaning.
48
+ 3. **Assessment of both meaning and application.** Check whether the lesson is
49
+ correctly explained and supported, and whether relevant decisions or actions
50
+ apply it appropriately. Assess expected benefit and unwanted effects;
51
+ preserving an already-correct decision can be a good result. Use checks
52
+ proportionate to the evidence and consequence, and distinguish observed or
53
+ tested effects from proposed ones. An untested candidate may remain for
54
+ review; neither a fluent explanation nor one suitable action proves both.
55
+ 4. **Reviewable recommendations.** Show the relationship to existing rules, the
56
+ proposed disposition and canonical home, the intended consumer, the expected
57
+ benefit and cost, and the verification still needed. Give the user enough
58
+ context to adopt, revise, retain, incubate, or retire the learning.
59
+ 5. **Durable, verified application of approved changes.** Route accepted work
60
+ through the placement framework into the guide, principle, memory, tool fix,
61
+ gate, or other existing mechanism that reaches its consumer. Keep evidence
62
+ and decisions in the ledger; report what was applied and verified and what
63
+ remains open. A review-ready proposal and an applied change are distinct
64
+ outcomes, and promotion still requires explicit user approval.
65
+
66
+ Judge success by useful, justified learning and its appropriate application.
67
+ Candidate counts and added text measure output volume. A supported decision to
68
+ keep existing content, or a clearly bounded unresolved finding, is also useful.
69
+ Carry this goal and the relevant outcome criteria into delegated work, then
70
+ assess its results against them before presenting the run as complete.
71
+
21
72
  **Requires an agent-bios checkout.** This runbook edits the corpus itself, so it
22
73
  names repo paths and runs repo scripts. On a packaged install those do not exist:
23
74
  say so and stop rather than following steps you cannot execute.
@@ -26,7 +77,7 @@ Runbook for a session-distill run: mine recent main-context sessions,
26
77
  verify candidates, place them through the framework, and apply with the user.
27
78
  Everything durable lives in the agent-bios repo.
28
79
 
29
- ## Read first (SSOT)
80
+ ## Read next (SSOT)
30
81
 
31
82
  1. `design/session-distill/ledger.json` — the initiative's state. Every item
32
83
  carries its status (placed / incubating / incubating-G / absorbed /
@@ -41,6 +92,7 @@ Everything durable lives in the agent-bios repo.
41
92
 
42
93
  ## Stage 1 — Mine (pipeline in `session-distill/`)
43
94
 
95
+ The current collectors read Claude Code and Codex session histories.
44
96
  Run in order; each stage reads the previous stage's `out/`:
45
97
 
46
98
  1. `census.py --end YYYY-MM-DD` — enumerate from both providers'
@@ -0,0 +1,137 @@
1
+ # Paired static HTML/PDF authoring and review
2
+
3
+ This companion is an opt-in execution procedure for a requested static HTML/PDF
4
+ job. The sibling [slide-writing guide](../slide-writing.md) owns the semantic
5
+ criteria and is the default for every slide or presentation task. All role
6
+ requests in this path receive its same criterion text.
7
+
8
+ Use this runbook only when the requested output and review can actually use its
9
+ static `section.slide` HTML/PDF path. Preserve a requested native presentation
10
+ format; if this renderer cannot bind that format, apply the primary guide with
11
+ the appropriate authoring tool and disclose which runtime checks were not run.
12
+ Do not substitute an HTML deliverable or claim that unrelated screenshots passed
13
+ this paired runtime.
14
+
15
+ Use `<runbook-root>` for the directory containing this file and its `scripts/`
16
+ directory, and `<job>` for a new directory outside the immutable corpus bundle.
17
+ The runtime refuses an existing job directory; revised inputs or output use a
18
+ new job revision. In every command, `--base` names the companion directory. The
19
+ criteria source is its sibling, `<runbook-root>/../slide-writing.md`.
20
+
21
+ ## Prepare
22
+
23
+ Provide the source text, a JSON work specification, and any local assets. Record
24
+ format and presentation values in that specification according to the criteria.
25
+ The HTML runtime requires static `section.slide` elements, equal page dimensions,
26
+ and print page breaks. An explicit positive integer `pages` in the specification
27
+ is checked against the actual render.
28
+
29
+ ```bash
30
+ python3 -B "<runbook-root>/scripts/pair.py" --base "<runbook-root>" check
31
+ python3 -B "<runbook-root>/scripts/pair.py" --base "<runbook-root>" prepare \
32
+ --source "<source.md>" \
33
+ --spec "<work-spec.json>" \
34
+ --asset "<optional-local-asset>" \
35
+ --job "<job>"
36
+ ```
37
+
38
+ Omit `--asset` when no assets are needed; repeat it for additional files. Asset
39
+ basenames must be unique. They are copied to `input/assets/<name>`, so URLs from
40
+ `output/deck.html` use `../input/assets/<name>`.
41
+
42
+ `check` parses and validates the primary criteria source without writing to the
43
+ guide bundle. `prepare` derives `<job>/input/slide-writing.md` and the job-only
44
+ `<job>/input/ORACLE.json`, then freezes them with the source, specification,
45
+ assets, and runtime version. The guide bundle has no source `ORACLE.json` and no
46
+ build command. Give the actual writer `writer.md` and the frozen inputs it names,
47
+ and save its result to `<job>/output/deck.html`. Keep the actual invocation
48
+ record. Request files alone do not establish that a writer consumed them.
49
+
50
+ ## Render the submitted HTML
51
+
52
+ Resolve the Node executable, the Playwright module file, and the browser executable
53
+ in the current environment, then pass those paths explicitly.
54
+
55
+ ```bash
56
+ python3 -B "<runbook-root>/scripts/pair.py" --base "<runbook-root>" render \
57
+ --job "<job>" \
58
+ --node "<node-executable>" \
59
+ --playwright "<playwright-module-file>" \
60
+ --browser "<chromium-browser-executable>"
61
+ ```
62
+
63
+ The runtime seals the HTML and assets and invokes its renderer on that copy.
64
+ The renderer blocks network requests and file requests outside the sealed root.
65
+ It injects no slide styles. It creates the PDF, page images, and measurements and
66
+ checks PDF/HTML page counts and dimensions before registration. Arbitrary supplied
67
+ images are not a substitute for this renderer invocation.
68
+
69
+ `font_px` records computed CSS size. Glyph bounds, transforms, font loading, and
70
+ the actual image remain separate evidence. A render error leaves no completed
71
+ render; keep its diagnostics and use a new job for a corrected attempt.
72
+
73
+ ## Freeze a screen reading
74
+
75
+ Give a separate review context `reader.md` and its listed rendered artifacts.
76
+ Do not supply source/specification contents or the writer's explanation during
77
+ this first observation stage. The generated request provides the response
78
+ contract and typed template.
79
+
80
+ ```bash
81
+ python3 -B "<runbook-root>/scripts/pair.py" --base "<runbook-root>" observe \
82
+ --job "<job>" \
83
+ --request "<job>/reader-request.json" \
84
+ --payload "<observations-proposal.json>"
85
+ ```
86
+
87
+ The accepted observation is stored in `observations.json` with its request binding.
88
+ Only then does the runtime generate `judge.md` and `judge-request.json`, containing
89
+ the frozen source, specification, observations, and the same common criteria.
90
+ Packet separation does not create an operating-system read jail. Record the
91
+ actual review context and visual inspection performed.
92
+
93
+ ## Compare and submit
94
+
95
+ Give the judge the generated judge request and the artifacts it names. Return the
96
+ semantic fields in that request's emitted contract; do not invent a parallel
97
+ response schema or translate rejected values into accepted ones.
98
+
99
+ ```bash
100
+ python3 -B "<runbook-root>/scripts/pair.py" --base "<runbook-root>" submit \
101
+ --job "<job>" \
102
+ --request "<job>/judge-request.json" \
103
+ --payload "<judgment-proposal.json>"
104
+ ```
105
+
106
+ The runtime rejects missing/duplicate criteria, mismatched page coverage,
107
+ unsupported evidence references, stale inputs, and the wrong request. It writes
108
+ `review.json` and derives `review.md` from the accepted record. Do not edit either
109
+ result independently. Apply the semantic criteria when interpreting those
110
+ results; structural acceptance is not a quality verdict.
111
+
112
+ ## Verify or revise
113
+
114
+ ```bash
115
+ python3 -B "<runbook-root>/scripts/pair.py" --base "<runbook-root>" verify --job "<job>"
116
+ ```
117
+
118
+ Every consuming command also performs its own preflight checks. An edit becomes
119
+ available to the next activated corpus snapshot and the next prepared job. An
120
+ existing job verifies against its original immutable corpus snapshot, frozen
121
+ criterion source, derived oracle, and runtime version. Mutating the guide or code
122
+ path recorded by that job instead of using its original snapshot invalidates the
123
+ binding, as do changes to its source document, specification, assets, HTML,
124
+ requests, or registered render/results. Preserve the old job as evidence of that
125
+ revision; prepare a new job rather than modifying its state or hashes to make it
126
+ current.
127
+
128
+ The immutable guide bundle is read-only input. Keep all job data outside it. Do
129
+ not repair an installed snapshot in place. A local experiment with different
130
+ criteria is a separate explicitly identified authoring copy, not an update to the
131
+ shared guide.
132
+
133
+ The protocol has no provider dispatcher or automatic publishing step. Use the
134
+ available authorized authoring/review tools, preserve their actual invocation
135
+ evidence, and disclose any unexecuted or uncertain checks. It verifies shared
136
+ criteria and bindings; model interpretation and visual-detection accuracy require
137
+ their own evidence.