agent-bios 0.18.0 → 0.19.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 (53) hide show
  1. package/DEPENDENCIES.md +236 -80
  2. package/INSTALL.md +112 -0
  3. package/README.md +184 -524
  4. package/claude/CLAUDE.md +1 -1
  5. package/claude/guides/cli-multi-model-workflow.md +1 -1
  6. package/claude/guides/learning-flow.md +23 -12
  7. package/claude/guides/session-distill-workflow.md +22 -12
  8. package/codex/AGENTS.md +1 -1
  9. package/codex/guides/cli-multi-model-workflow.md +1 -1
  10. package/codex/guides/learning-flow.md +23 -12
  11. package/codex/guides/session-distill-workflow.md +22 -12
  12. package/compose/app_bridge/SKILL.md +75 -0
  13. package/compose/app_bridge/agents/openai.yaml +2 -0
  14. package/compose/app_bridge/scripts/bridge.py +76 -0
  15. package/compose/bootstrap/SKILL.md +12 -1
  16. package/compose/corpus.py +31 -9
  17. package/compose/corpus_app.py +456 -0
  18. package/compose/corpus_import.py +529 -0
  19. package/compose/corpus_install.py +196 -18
  20. package/compose/corpus_session.py +27 -0
  21. package/compose/corpus_setup.py +674 -0
  22. package/compose/corpus_setup_cli.py +582 -0
  23. package/compose/corpus_setup_i18n.py +318 -0
  24. package/compose/corpus_setup_ui.py +633 -0
  25. package/compose/corpus_store.py +167 -29
  26. package/compose/corpus_transaction.py +43 -10
  27. package/compose/corpus_ui_runtime.py +278 -0
  28. package/compose/setup/START.md +147 -0
  29. package/compose/ui_runtime/linkify_it_py-2.2.0-py3-none-any.whl +0 -0
  30. package/compose/ui_runtime/manifest.json +238 -0
  31. package/compose/ui_runtime/markdown_it_py-4.2.0-py3-none-any.whl +0 -0
  32. package/compose/ui_runtime/mdit_py_plugins-0.6.1-py3-none-any.whl +0 -0
  33. package/compose/ui_runtime/mdurl-0.1.2-py3-none-any.whl +0 -0
  34. package/compose/ui_runtime/platformdirs-4.11.8-py3-none-any.whl +0 -0
  35. package/compose/ui_runtime/pygments-2.21.0-py3-none-any.whl +0 -0
  36. package/compose/ui_runtime/rich-15.0.0-py3-none-any.whl +0 -0
  37. package/compose/ui_runtime/textual-8.2.8-py3-none-any.whl +0 -0
  38. package/compose/ui_runtime/typing_extensions-4.16.0-py3-none-any.whl +0 -0
  39. package/docs/advanced-launch.md +131 -0
  40. package/docs/assets/corpus-studio.svg +227 -0
  41. package/docs/corpus.md +117 -0
  42. package/docs/recovery.md +201 -0
  43. package/docs/session-model.md +120 -0
  44. package/docs/setup.md +190 -0
  45. package/docs/understand.md +40 -0
  46. package/install.sh +75 -46
  47. package/launch/agent-launch.py +91 -47
  48. package/launch/provision-venv.sh +44 -13
  49. package/learn/collect-learning.py +14 -5
  50. package/learn/learning.schema.json +2 -2
  51. package/package.json +14 -2
  52. package/provenance.json +1 -1
  53. package/wrappers/claude-run.sh +10 -13
package/README.md CHANGED
@@ -1,553 +1,213 @@
1
1
  # agent-bios
2
2
 
3
- Single source of truth for the instructions and scoped guides that an explicit
4
- agent-bios launch supplies to Claude Code or Codex. Edit once; the private corpus
5
- compiler projects the selected content for each activated session.
3
+ **A personal instruction layer for Claude Code and Codex.**
6
4
 
7
- A deployable instruction corpus for coding agents, plus the CLI that
8
- installs, verifies, and evolves it. The npm package ships the corpus; `install.sh` is both the
9
- `agent-bios` CLI entry and the deployer.
5
+ Build an instruction library you can inspect, edit, and reuse. Choose what each
6
+ CLI session or Codex app task uses, while preserving your existing global instruction files.
10
7
 
11
- Korean reference: [`ko/`](ko/) mirrors every doc below reference only, never installed or loaded.
8
+ [Quick start](#quick-start) · [Corpus Studio](#your-instruction-library) · [How it works](#how-sessions-work) · [Understand!](#understand-the-reasoning) · [Documentation](#documentation) · [한국어](ko/README.md)
12
9
 
13
- ## Model
10
+ ![Corpus Studio showing a guide-linked rule and an unapplied on/off choice](docs/assets/corpus-studio.svg)
14
11
 
15
- Two authored layers:
12
+ *Actual 0.18.0 Studio UI, captured with Textual enabled and the bundled corpus
13
+ in an isolated test environment.*
16
14
 
17
- - **Always-in-an-activated-session instructions** `claude/CLAUDE.md` is the English canonical and `codex/AGENTS.md` its generated host projection. They hold compact invariants, decision principles, and guide pointers. A clean private install does not copy either file into a host's global discovery path; `compose/corpus_catalog.py` inventories their registered items and compiles the selected rules into an immutable session snapshot.
18
- - **Scoped guides** — `claude/guides/`, with generated Codex mirrors. The snapshot compiler copies selected guides to private generation-qualified paths and emits their router. Procedures, tables, numbers, and environment-specific content live here.
15
+ ## Make your instructions your own
19
16
 
20
- ## Principles
17
+ agent-bios ships a starting library of rules, guides, and procedures, called a
18
+ **corpus**. You decide which parts belong in your working environment.
21
19
 
22
- The `slide-writing` guide is selected through `office-work` and
23
- `visualization-docs`. Its primary guide supplies the semantic criteria for every
24
- slide or presentation task. Its companion runbook and scripts are used only for
25
- an explicitly applicable static HTML/PDF job: preparation derives a job-local
26
- criteria copy and `ORACLE.json`, then freezes them with the job inputs and runtime
27
- version. Jobs stay outside immutable corpus snapshots; preparation and result
28
- acceptance need Python, while rendering uses the optional dependencies listed in
29
- `DEPENDENCIES.md`. Native presentation formats remain the user's choice; the
30
- supplied renderer's mechanical checks apply only to its static HTML/PDF path.
20
+ | What you want to do | What agent-bios provides |
21
+ | --- | --- |
22
+ | See what your instructions say | Browse and search documents in Corpus Studio; follow a rule's links to its guides. |
23
+ | Adapt them to your work | Edit supplied items, create personal ones, and choose their delivery method. |
24
+ | Choose what a session uses | Switch individual items on or off without deleting their content or edits. |
25
+ | Recover the starting point | Restore supplied content, recover personal items, or preview a full reset. |
31
26
 
32
- - **Rule bodies never name concrete models or tools** — only role slots and tiers. Bindings live in each guide's `Environment Binding` (dated; expire ~8 weeks or on a newer model). New model → update that row + date; leave rules alone. Declared exceptions: sections whose subject is a concrete tool surface (the cli guide's Codex direct-drive section) and optional-capability names inventoried in `DEPENDENCIES.md` (e.g. the `spreadsheet-processing` skill) — the Adopting checklist below covers swapping both.
33
- - **The Codex tree is generated, not mirrored by hand** — `gates/emit-mirrors.py` projects `claude/` → `codex/` and `ko/claude/` → `ko/codex/`, differing only in title and config-home variable (`$CLAUDE_CONFIG_DIR` ↔ `$CODEX_HOME`), plus one declared Codex-only standing-dispatch authorization required by Codex's trigger contract, inserted at a pinned position. It owns the projection rule; `gates/check-parity.sh` runs its `--check` and adds pointer resolvability, frontmatter, shared anchor phrases on the global↔guide restatement pairs that remain, and Codex role-binding / wrapper-default projections. Parity enforces content synchronization only; it does not guarantee both harnesses respond to the same wording with the same strength.
34
- - **The always surface is a per-activated-session token budget** — every selected rule is supplied to that session and can be inherited by its children, so each added bullet dilutes the rest. A new always rule must name the bullet it displaces (or why none does); procedures, tables, numbers, and worked examples belong in guides.
35
- - **Installation is storage, not activation** — `install` and `onboard` copy a validated immutable release into agent-bios-owned state and record a baseline plus selection. `verify` proves those stored bytes, the catalog, the baseline, and the owned launcher projection; it deliberately reports activation as unverified. Only a configured `agent-launch` resolves a snapshot and calls a host adapter.
36
- - **The default installer leaves native host state alone** — it does not seed global `AGENTS.md`/`CLAUDE.md`, host skill/agent directories, hook settings, or shell interception. Existing installations keep their old global projection until `agent-bios migrate` previews and, with explicit apply confirmation, removes only proven legacy-owned material. `AGENT_BIOS_LEGACY_INSTALL=1` exists only for compatibility and migration regression coverage.
37
- - **Source, snapshot, and session have separate lifetimes** — `CorpusStore` revision-checks private authoring, compiles content-addressed snapshots, and preserves prior snapshots. `corpus_session.py` records a host-observed session id before a pin counts as resumable; reset and later edits affect future snapshots, not an existing pin.
38
- - **Learning evidence stays immutable** — capture events are host-qualified private JSONL records. A local edit is an overlay for later snapshots; promotion suppresses only an exact source revision when its replacement is proven in that snapshot. Local reset, removal, or migration makes no claim that an uploaded record was deleted.
39
- - **`Evidence Base` (per guide) is the single owner of numbers.** Measure with `session-cost.py` (`agent-bios cost` on an installed package).
40
- - **English is canonical and shipped; Korean (`ko/`) is reference only.** The private catalog and snapshot compiler consume the fixed-name English sources.
27
+ This is an instruction and launch layer, not a replacement for either host CLI.
28
+ It does not train the model or guarantee that the model follows every instruction.
41
29
 
42
- ## Layout
30
+ ## Quick start
43
31
 
44
- | Path | Role |
45
- | --- | --- |
46
- | `claude/CLAUDE.md`, `codex/AGENTS.md` | canonical and generated always-surface sources (en); shipped privately and selected into activated snapshots, never installed into native global files by default |
47
- | `claude/guides/*.md`, `codex/guides/*.md` | scoped-guide sources copied to immutable private snapshots when selected |
48
- | `codex/agents/*.toml` | Codex role-template sources retained in the private release; agent-item activation remains separately evidenced |
49
- | `ko/**` | Korean mirror of every doc above + this README + DEPENDENCIES (reference only) |
50
- | `launch/` | launch profile and preflight TUI; `agent-launch.py` resolves a private snapshot for configured sessions, keeps Software Engineer / Vanilla bare, and routes resume through the recorded pin. The old shell interception remains only on the legacy compatibility path |
51
- | `compose/` | corpus authority and clients: `corpus_catalog.py` inventory/compiler, `corpus_store.py` baseline/overlay/plan/snapshot store, `corpus.py` + `corpus_ui.py` machine/numbered/rich clients, `corpus_install.py` private install and migration, `corpus_session.py` host delivery and pins, and the immutable private management bootstrap |
52
- | `learn/` | the collection loop — capture, record schema and its validator, curation intake, promotion manifest, redistribution, and the secret-redaction floor |
53
- | `session-distill/` | the heavy curator pipeline that mines many sessions into corpus-grade items |
54
- | `wrappers/` | internal host/review adapters carried by the private release; the default install does not populate native host bin directories |
55
- | `gates/` | author-side verification (mirror generation, parity, lexicon, payload, assembler scenarios) — reachable only from a repo checkout, and `check-package.sh` fails if any of it enters the npm payload |
56
- | `ontology/` | what a change obliges elsewhere — entities, obligation edges, and the service's routes, held against real source by `check-ontology.py`. `instances/graph.json` is canonical; `LEXICON.md`, the RDF views, the HTML map, and the competency/extension docs are generated from it |
57
- | `install.sh`, `session-cost.py` | the `agent-bios` command dispatcher/private installer entry and the cost meter |
58
- | `decisions/` | the decision record for developing this repo — what was decided and which alternative it closed; author-side, never shipped |
59
- | `packages/` | authored corpus packages, organized by package identity rather than by concept home |
60
- | `.githooks/` | the pre-commit hook that runs the gates against the index, enabled per clone with `core.hooksPath` |
61
- | `SURFACES.md` | where knowledge and tools reach a model, and what each place admits — every entry names the code that realizes it |
62
- | `FINDINGS.md` | open implementation defects, live; closing one deletes its entry |
63
- | `design/`, `benchmarks/` | design records and the instruction-behavior benchmark |
64
- | `research/` | corpus research (the 12,749-file AGENTS.md/CLAUDE.md classification): reports, scripts, labeling record; bulk data stays local by `.gitignore` rule |
65
- | `DEPENDENCIES.md` | external tools / host CLIs / model providers + verified versions |
66
-
67
- `config.toml`, `settings.json`, and `hooks.json` are machine-specific (trust lists, hook paths, secrets) and intentionally untracked.
68
-
69
- ## Guides
70
-
71
- | Guide | Scope |
72
- | --- | --- |
73
- | `cli-multi-model-workflow` | multi-model CLI workflow: Default Frame, role slots/tiers, delegation mechanics, driving Codex CLI directly, cache economy, unattended-batch safety, halt/resume, handoff contract, Environment Binding |
74
- | `coding-staged-workflow` | staged development: design → process → implement, lightweight path, review loop, severity contract, stop conditions |
75
- | `verification-discipline` | verification depth and per-domain mix (owns the Verification Menus), case space, what a green result is worth |
76
- | `concept-economy` | concept-surface economy: reuse / extend / rename / split, split triggers, migration compatibility |
77
- | `documentation-hygiene` | where comments, history, and handoffs belong; how to phrase rules others follow |
78
- | `llm-capability-boundary` (+ `-patterns`, `-examples`) | LLM/tool/code authority boundary: field authority, accepted output channels, structural enforcement, worked examples |
79
- | `mock-realization-boundary` | mock/fixture realization vs product semantic path |
80
- | `svg-visualization-guide` | SVG diagram / service-blueprint spec |
81
- | `implementation-map` | IMPLEMENTATION_MAP.html current-state dashboard |
82
-
83
- The table names the load-bearing guides; the full inventory and its per-domain
84
- classification live in `compose/domains.json`, which the domains gate holds against the
85
- tree.
86
-
87
- ## Edit workflow
88
-
89
- 1. Edit the English canonical (`claude/`), and the Korean canonical (`ko/claude/`) when the change is user-facing.
90
- 2. `python3 gates/emit-mirrors.py` — regenerates `codex/` and `ko/codex/` from those two canonicals. Never hand-edit the Codex side: it is a generated projection, and `--check` (which the parity gate runs) fails on any file that is not exactly what the generator emits.
91
- 3. `./gates/check-parity.sh` must pass.
92
- 4. Commit, then deploy: `agent-bios install` (or `agent-bios update` from a clone).
93
-
94
- ## Install and activate
95
-
96
- The npm package and command are both named `agent-bios`. Installation is always
97
- explicit—never a package-manager postinstall side effect—and the default path stores
98
- an immutable release and baseline under agent-bios-owned state. It installs the
99
- `agent-launch` entrypoint and its own profile/catalog files, but does not change native
100
- Claude/Codex globals, discovery directories, settings, hooks, or shell command
101
- resolution unless the user explicitly restores the optional shell connection.
32
+ Use the terminal installer or set up through a Codex app conversation. Both offer
33
+ language, dependency, corpus and optional app/import choices.
34
+ See [setup and prerequisites](docs/setup.md).
35
+
36
+ ### In a terminal
37
+
38
+ You need **macOS or Linux**, **Bash**, **Python 3.11+**, and **Node.js 18+ with npm**
39
+ for package installation. Run:
102
40
 
103
41
  ```bash
104
- npm install -g agent-bios
105
- agent-bios install # store an immutable private release and baseline
106
- agent-bios onboard --domains builder-base,multi-agent-orchestration
107
- agent-bios verify # verify stored bytes/catalog/baseline; not host activation
108
- agent-bios status # show the private release, baseline, conflicts, and evidence state
109
- agent-bios corpus # rich Corpus Studio in a TTY; list in a non-TTY
110
- agent-launch claude # open the launch TUI for Claude
111
- agent-launch codex # open the launch TUI for Codex
112
- agent-bios shell restore # opt in: bare claude/codex opens the TUI
113
- agent-bios shell remove # remove only that optional shell connection
114
- agent-bios reset # preview reset; keep sources, snapshots, and pins
115
- agent-bios reset --apply --yes --expected-revision REV # use the revision returned by preview
116
- agent-bios migrate # preview legacy global cleanup; --apply --yes performs it
117
- agent-bios update # git pull + reinstall (clone), or print the npm update line
118
- agent-bios uninstall # remove owned runtime entries; retain user corpus and pinned sessions
42
+ npm install -g agent-bios@0.19.0
43
+ agent-bios install
119
44
  ```
120
45
 
121
- From a clone, `bash install.sh install` is the same default path. The release lives
122
- under `~/.local/share/agent-bios/runtime/releases/`; baseline tuples and transaction
123
- journals live under that runtime root, immutable snapshots and pins under
124
- `~/.local/share/agent-bios/sessions/`, and user packages, overlays, tombstones,
125
- learnings, history, and trash under `~/.config/agent-bios/corpus/`. The corresponding
126
- `AGENT_BIOS_STATE_DIR` and `AGENT_BIOS_CORPUS_DIR` environment variables relocate
127
- those private roots; `AGENT_LAUNCH_VENV` relocates the optional Textual runtime.
128
- The owned `agent-launch` entrypoint exports `AGENT_BIOS_PRIVATE_CORPUS=1` and the
129
- immutable `AGENT_BIOS_PACKAGE_ROOT`; the launcher also recognizes the private install
130
- record when the explicit marker is absent. These select the private runtime and do not
131
- claim that any host session has loaded a snapshot.
132
-
133
- `install`, `onboard`, `reset`, `migrate`, and `uninstall` expose dry-run or preview
134
- paths appropriate to their mutations. A pre-existing owned launcher/profile path whose
135
- bytes no longer match the recorded copy is reported as an owned-path conflict rather than
136
- overwritten. `migrate` is the separate recovery-backed operation for a legacy global
137
- installation: preview is the default, applying requires `--apply --yes`, ambiguous
138
- ownership refuses the apply, and later private operations do not fall through to a
139
- global writer. Setting `AGENT_BIOS_LEGACY_INSTALL=1` selects the old deployer only for
140
- compatibility and migration regression work; it is not the user default.
141
-
142
- The legacy compatibility deployer preserves guide paths named only by a previous
143
- manifest when the current source no longer establishes their ownership. It names
144
- these remnants for manual inspection and leaves them out of the new ownership
145
- manifest, so later uninstall does not claim them. Current source-owned members
146
- retain normal backup and selection cleanup; private snapshot installation uses its
147
- own authoritative inventory.
148
-
149
- After updating a legacy global installation, run `agent-bios migrate` before the
150
- first private `install`. Its preview identifies exact managed regions, legacy
151
- manifest paths and learning sources. `agent-bios migrate --apply --yes` backs up
152
- the originals, transfers and verifies learning records, retires the legacy paths,
153
- then installs the private release. A central-only Codex file and the unmodified
154
- empty Claude learning seed do not require a learning JSONL file; actual learning
155
- content without its source still requires attention.
156
-
157
- An interrupted migration is visible in `status` and blocks configuration readers
158
- and unrelated writes. Re-run `agent-bios migrate --apply --yes` to resume its
159
- pinned release and recorded path versions. A completed private installation is
160
- not repeated, and later cleanup cannot delete its replacement launcher/profile.
161
- Intervening edits are preserved and reported instead of overwritten. Older
162
- incomplete journals without replay evidence require reconciliation from their
163
- backups rather than a guessed replay. Existing private-session replay retains the
164
- previous confirmed release until migration completes.
165
-
166
- Before applying or resuming, stop the old global collectors that can still append a native
167
- learning JSONL or rewrite its native prose/entry file. The migration checks the
168
- recorded native state immediately before commit, but no filesystem check can make
169
- a noncooperating writer atomic after that final observation. If it reports a
170
- changed native target, preserve only the affected paths and restore only those
171
- paths to the journal's recorded `after` state before resuming the old migration.
172
- Do not replace a whole native directory or edit the journal.
173
-
174
- For a validated late-input recovery, set `JOURNAL` to the one `NEEDS_RECOVERY`
175
- migration journal and pass only the specific changed JSONL, prose, or entry paths
176
- that its error named. This makes a new durable copy under that journal's existing
177
- `backup_root`, verifies the copy, and then restores a changed target from its
178
- recorded `after` bytes/existence/mode or an input-only path to its recorded
179
- unchanged existence. It rejects a path absent from the journal, symlinks, and
180
- non-regular files before writing any backup. New private journals retain exact
181
- bytes for input-only native files, so the command can restore an originally
182
- present input while preserving its current mode (or using `0600` if it is
183
- absent). Historic digest-only journals still need an external byte-identical
184
- backup; the command refuses to invent their missing bytes.
185
-
186
- ```sh
187
- JOURNAL="${AGENT_BIOS_STATE_DIR:-$HOME/.local/share/agent-bios}/runtime/migrations/<migration-id>/journal.json"
188
- python3 - "$JOURNAL" \
189
- "$HOME/.codex/personal/learnings.jsonl" <<'PY'
190
- import base64, hashlib, json, os, sys, tempfile
191
- from pathlib import Path
192
-
193
- journal = Path(sys.argv[1])
194
- data = json.loads(journal.read_text(encoding="utf-8"))
195
- backup_root = Path(data.get("backup_root", ""))
196
- if data.get("kind") != "migrate" or data.get("state") != "NEEDS_RECOVERY" or backup_root != journal.parent / "backup":
197
- raise SystemExit("expected one validated NEEDS_RECOVERY migration journal")
198
- targets = {Path(entry["path"]): entry for entry in data["paths"]}
199
- inputs = {Path(path): version for path, version in data["inputs"].items()}
200
- selected = [Path(value).expanduser() for value in sys.argv[2:]]
201
- unknown = [str(path) for path in selected if path not in targets and path not in inputs]
202
- if not selected or unknown:
203
- raise SystemExit("name one or more exact journal paths; unknown: " + ", ".join(unknown))
204
-
205
- planned = []
206
- for path in selected:
207
- entry = targets.get(path)
208
- version = entry["after"] if entry is not None else inputs[path]
209
- if path.is_symlink() or (path.exists() and not path.is_file()):
210
- raise SystemExit(f"refusing unsafe native path: {path}")
211
- root = next((parent for parent in (path.parent, *path.parents)
212
- if parent.name in {".claude", ".codex"}), None)
213
- if root is None or root.is_symlink():
214
- raise SystemExit(f"recovery supports an exact Claude/Codex native path, not: {path}")
215
- current = root
216
- for part in path.relative_to(root).parts:
217
- current /= part
218
- if current.is_symlink():
219
- raise SystemExit(f"refusing symlink ancestor: {current}")
220
- planned.append((path, entry, version))
221
-
222
- if backup_root.is_symlink() or (backup_root.exists() and not backup_root.is_dir()):
223
- raise SystemExit(f"refusing unsafe recovery root: {backup_root}")
224
- backup_root.mkdir(parents=True, exist_ok=True, mode=0o700)
225
- recovery = Path(tempfile.mkdtemp(prefix="recovery-before-resume-", dir=backup_root)) / "files"
226
- for path, entry, version in planned:
227
- if path.exists():
228
- saved = recovery / str(path).lstrip("/")
229
- saved.parent.mkdir(parents=True, exist_ok=True)
230
- before = path.read_bytes()
231
- saved.write_bytes(before)
232
- saved.chmod(path.stat().st_mode & 0o777)
233
- if saved.read_bytes() != before:
234
- raise SystemExit(f"backup did not verify: {saved}")
235
- if not version["exists"]:
236
- path.unlink(missing_ok=True)
237
- continue
238
- encoded = version.get("bytes_b64")
239
- if not isinstance(encoded, str):
240
- raise SystemExit(f"journal records only a digest for existing input; restore it from an exact external backup: {path}")
241
- body = base64.b64decode(encoded.encode("ascii"), validate=True)
242
- if hashlib.sha256(body).hexdigest() != version["sha256"]:
243
- raise SystemExit(f"journal after bytes are invalid: {path}")
244
- descriptor, temporary = tempfile.mkstemp(prefix=f".{path.name}.", dir=path.parent)
245
- try:
246
- with os.fdopen(descriptor, "wb") as output:
247
- output.write(body)
248
- output.flush()
249
- os.fsync(output.fileno())
250
- mode = entry["mode"] if entry is not None else (path.stat().st_mode & 0o777 if path.exists() else 0o600)
251
- os.chmod(temporary, mode)
252
- os.replace(temporary, path)
253
- finally:
254
- Path(temporary).unlink(missing_ok=True)
255
- print(recovery)
256
- PY
257
- ```
46
+ The installer opens a guided terminal UI with English, Korean and Japanese. Its
47
+ verified Textual bundle is included; a separate UI installation is unnecessary.
48
+ Choose only the dependencies and corpus you want. [Full setup options →](docs/setup.md)
258
49
 
259
- Resume the old journal with `agent-bios migrate --apply --yes`. After it commits,
260
- restore only the preserved late record (`B`) from the printed recovery directory
261
- to its original native path, then run a fresh `agent-bios migrate` preview and
262
- `agent-bios migrate --apply --yes`. The new migration imports `B` through the
263
- normal learning-id deduplication path. Leave every other recovery copy in place
264
- as evidence; it is not an instruction to restore all saved native files.
265
-
266
- ```sh
267
- RECOVERY_BACKUP='<the directory printed above>'
268
- B="$HOME/.codex/personal/learnings.jsonl" # the one path you deliberately preserved
269
- cp "$RECOVERY_BACKUP/${B#/}" "$B"
270
- agent-bios migrate
271
- agent-bios migrate --apply --yes
50
+ To launch a CLI session, install and authenticate that host CLI, then run this from
51
+ your project:
52
+
53
+ ```bash
54
+ "$HOME/.local/bin/agent-launch" claude
272
55
  ```
273
56
 
274
- Corpus Studio and the machine CLI are views over the same `CorpusStore`. The CLI
275
- provides `list`, `search`, `show`, `history`, `status`, and `snapshot`; mutations are
276
- semantic JSON passed to `plan`, followed by `apply PLAN --expected-revision REV`.
277
- Implemented operations are create, update (including consumption surface), remove,
278
- installed-item restore, personal-item recover, selection, reset, and rollback. Stable
279
- `CorpusRef` identities survive those changes. The current `ContentRef` hashes the
280
- baseline, resolved selection, authoring/item/learning/promotion digests, catalog and
281
- store implementation digests, and management bootstrap. There is not yet a standalone undo command,
282
- arbitrary package authoring/import, automatic semantic conflict resolution, or verified
283
- native skill-menu registration; those design stages must not be inferred from the
284
- library UI.
285
-
286
- Studio marks rules containing explicit `guides/*.md` references with **→ GUIDE**
287
- and the guide names in the library. Their **Guide pointer** section links to exact
288
- guide members in the same package and shows each target's current consumption surface
289
- and state. Missing or ambiguous targets are disclosed rather than guessed. These
290
- are display-only references, not new dependencies or proof of loading: rule bodies,
291
- IDs, ordering, selection, and delivery remain unchanged. Personal body edits are
292
- reflected when the library refreshes; ordinary rules are not classified by meaning.
293
-
294
- Moving the library cursor to an item immediately displays its document; Enter is
295
- not required. Group rows show group guidance and disable item-specific actions.
296
- Cursor events cannot retarget an open editor or a prepared change preview.
297
-
298
- Arrow keys also navigate the reading controls: **Search ↓ buttons ↓ library →
299
- document**, with **←/→** between neighboring buttons and **↑** back toward search.
300
- At the end of search text, **→** focuses the view selector; within text, the caret
301
- moves normally. **←** from a closed view selector returns to search. Open menus
302
- keep their native arrow selection. The library keeps normal **↑/↓** item movement;
303
- at its top, **↑** returns to controls. In the document, arrows scroll until an
304
- edge: **←** returns to the library, **↑** reaches the controls/member selector,
305
- and **↓** at the bottom reaches pending on/off buttons when present. Disabled or
306
- hidden buttons are skipped. TextArea editing, modal boundaries, and Tab remain intact.
307
-
308
- In the library, **Space** toggles an item's use in future activated sessions:
309
- `[x]` is on, `[ ]` is off, `[-]` is removed, and `*` marks an unapplied change.
310
- The Available group means retained authoring items, not that every item is on.
311
- Stage several choices, then use **Preview on/off → Apply**, or **Discard on/off**.
312
- Text inputs keep normal spaces; Space on a group still expands or collapses it.
313
- Unapplied choices require discard confirmation on exit and cannot be mixed with
314
- content edits. A stale authoring revision refuses the preview or apply.
315
-
316
- Per-item choices override domain and explicit launch selections, including core
317
- and infrastructure defaults. Turning an item off does not delete its body, edits,
318
- or identity, and old snapshots and session pins remain intact. Choices survive
319
- updates and content restoration; full reset returns to installed defaults.
320
- Enabling a removed item requires Restore/Recover first. A guide switched off is
321
- marked in its referring rule, without automatically changing that rule. Native
322
- hook/agent opt-in, trust, host support, and promotion rules still apply: a checked
323
- item is a projection choice, not proof of execution. This does not block host
324
- global/project instructions or a tool from opening a file independently.
325
-
326
- The same revision-checked manager accepts `{"operation":"enable","items":{"@agent-bios/core:rule-003":false}}`
327
- through `corpus plan`; `true` forces inclusion, `false` excludes, and `null`
328
- removes that override so the normal selection applies. `list` reports `enabled`,
329
- `enabled_override`, and the captured authoring `revision`; pass that revision as
330
- `expected_revision` when planning a batch from the displayed inventory.
331
-
332
- New personal identities are allocated once in the creation plan and remain stable
333
- on retry; reset and history rollback do not make retired identities reusable.
334
- Member files are the content authority: `primary_member` identifies the main file,
335
- and `body` is its view or edit alias. The manager applies a body edit to that file
336
- for all clients. Divergent older body/member values stay visible until an explicit
337
- content choice reconciles them; old immutable snapshots are not rewritten.
338
-
339
- Installation and rollback validate the target baseline and personal field/member
340
- changes together. Conflicts preserve the current selection rather than dropping
341
- items from a successful snapshot. Installation publishes a complete corpus/config
342
- association under the same lock used by readers. Pending publication is disclosed
343
- by status and prevents a new configured launch from reading mixed state; bare and
344
- pinned replay can use the last confirmed immutable release.
345
-
346
- Full reset returns an `expected_revision` in its preview. Pass that value with
347
- `--apply --yes`; a changed preview is refused. Retry the accepted revision to finish
348
- an interrupted reset, or review and accept a fresh revision to replace a stale
349
- reset intent. Later user changes and replacement credentials are not overwritten
350
- by the old intent. Nonsecret settings are archived; token bytes never are.
351
-
352
- Native corpus consumption is default-off. `agent-bios corpus snapshot --host codex
353
- --native --json` (or `--host claude`) composes a preview; `agent-launch --corpus-native`
354
- opts one configured session into selected corpus hooks. Both hosts use the same
355
- installed Python carrier and typed `event`/`matcher` binding. Authoring accepts the
356
- combined event vocabulary; compilation reports an event unsupported by the selected
357
- host without changing its name or executing it through another event.
358
-
359
- Claude receives a namespaced plugin per CorpusRef through `--plugin-dir`. Codex
360
- receives inline `hooks.<Event>` config through per-session `-c` arguments. Existing
361
- user, project and session hooks remain present, and resume retains the pin's exact
362
- registrations. Neither adapter installs global hooks. Codex hook enablement and native
363
- trust still apply: new or changed definitions need review in `/hooks`. Discovery is
364
- checked before launch, but discovery alone does not establish execution. Hooks use the
365
- host's command permissions; opting in permits the selected carrier to run. Editing an
366
- event binding does not rewrite the Python carrier's input/output contract.
367
-
368
- Native corpus agents currently use Claude plugins and retain authored frontmatter and
369
- plugin-qualified names, distinct from launcher's bare tier agents. A Codex agent
370
- projection still needs to translate agent-specific model and tool restrictions; this
371
- does not limit shared hook delivery. Arbitrary prose promoted to `event` or `delegated`
372
- cannot become executable, and hidden discovery/config members are refused.
373
-
374
- Tier defaults come from the launch profile and the guides' Environment Binding
375
- tables. Claude Haiku 4.5 has no effort parameter: its tier entry, native agent
376
- definition and projected call omit it. SWEEP is one-rule-per-item read-only work.
377
- As a main seat it disables child delegation and requires review off (for example,
378
- Solo); a requested review needs a HELM or WORKHORSE main instead. Codex SWEEP mains
379
- use a read-only sandbox; Claude SWEEP mains use restricted Read/Glob/Grep tools
380
- and an empty, strict MCP configuration. Other main roles retain their selected
381
- policies, and explicit personal model/effort overrides remain available.
382
-
383
- The private install does not replace the `codex` or `claude` shell commands by default. Run
384
- `agent-launch claude` or `agent-launch codex` explicitly to open the preflight, or pass `--preset NAME HOST` for a
385
- configured non-interactive launch. Software Engineer / Vanilla structurally projects
386
- no agent-bios snapshot, launch contract, tier binding, or permission flag. After a
387
- fresh private install—or after an explicit legacy migration—the native CLI therefore
388
- receives no automatic agent-bios content; the user's own native global and project
389
- instructions still follow the host's normal loading rules. `--resume-session ID`
390
- loads the recorded host/session pin rather than resolving current defaults.
391
-
392
- **Shell connection** in the root TUI offers **Restore connection** and **Remove
393
- connection**, with confirmation before writing. The same owner is available as
394
- `agent-bios shell` (status), `agent-bios shell restore`, and `agent-bios shell remove`;
395
- `--dry-run` previews either action. Restore backs up existing files and adds one
396
- managed block to `${ZDOTDIR:-$HOME}/.zshrc`, plus a managed `shell.zsh`. Open a new
397
- terminal or source that `.zshrc` to load it. Interactive, argument-free `claude` and
398
- `codex` then open the TUI; argument-bearing and non-TTY calls go to the original CLI
399
- without added permission flags. Removal preserves other shell text and withdraws
400
- loaded managed wrappers on the next shell command. An edited managed file or block
401
- is preserved and reported for reconciliation, not overwritten. Backups remain private
402
- under `runtime/shell-backups/`; `ZDOTDIR` must match the connection's recorded path.
403
- Updates preserve an opted-in connection; reset and uninstall remove it. This setting
404
- never edits global `AGENTS.md`/`CLAUDE.md`, project files, or corpus content. Ordinary
405
- private installation also leaves those globals alone; explicit `migrate` can remove
406
- the old agent-bios-managed regions and imports while preserving user-authored text.
407
- First opt-in records ownership before publishing shell wiring, so interrupted restores
408
- remain recoverable. Reset and uninstall also detect receipt-less managed scripts from
409
- older interrupted restores. Install repairs a missing or non-executable owned launcher;
410
- an unavailable launcher falls back to the native CLI. Recovery rechecks path ancestors
411
- before writing and refuses redirected symlink targets.
412
-
413
- ### Understand a corpus bundle
414
-
415
- Choose **Understand!** in the root TUI, or run:
57
+ Use `codex` instead of `claude` for a Codex CLI session.
58
+
59
+ 1. Choose a Builder preset or **Custom**.
60
+ 2. Review the model, review setup, and permissions. **Some presets request
61
+ permission bypass**; select settings appropriate for your project.
62
+ 3. Start the session. Choose **Software Engineer / Vanilla** to use the host's
63
+ native setup without an agent-bios corpus snapshot.
64
+
65
+ Open **Corpus Studio** from the launcher or run `agent-bios corpus` to inspect the
66
+ library. `agent-bios status` shows the installed private release and its location.
67
+
68
+ <details>
69
+ <summary>Install from source instead</summary>
70
+
71
+ Use this repository's **Code** menu to copy its clone command or download its
72
+ source. From the obtained repository folder, run:
416
73
 
417
74
  ```bash
418
- agent-bios understand list
419
- agent-bios understand show core-purpose
420
- agent-launch --understand core-purpose claude # or codex
75
+ bash install.sh install
421
76
  ```
422
77
 
423
- The selection is a coherent bundle, not an individual file: core groups cover goals
424
- and scope, decision support, adaptation, evidence/safety, and retained learning;
425
- domain and personal bundles come from the effective corpus. A session freezes its
426
- selected source references and edited content. The tutor explains the purpose,
427
- background, mechanisms, tradeoffs, and limits, distinguishing documented rationale
428
- from inference. Each active learning turn ends with one goal-relevant question and
429
- waits for the user. Incidental ambiguity does not force a detour; pause and stop
430
- requests end the questioning. `understand!` also works through the shared skill in
431
- an activated session. Learning excerpts are data, not permission to run their commands.
432
-
433
- A meaningful flaw or alternative first introduced by the user can unlock a persistent
434
- pixel trophy. Tutor-originated ideas, leading hints, and echoes do not qualify. The
435
- discovery flow binds the native human session, checks recorded turn provenance and
436
- ordering, and asks for a later exact save confirmation. Unsupported provenance leaves
437
- the award pending, without blocking learning. Significance and semantic originality
438
- remain explicit tutor/user judgments; transcript validation does not prove them or
439
- authenticate against an owner who can edit local files. Only a successfully saved
440
- requested-only personal corpus note can unlock the trophy. The CLI prints it, and the
441
- TUI shows it when there is room. Retries do not duplicate the note; updates and note
442
- deletion retain the trophy. Full reset archives the active unlock generation and clears
443
- the display; older discovery records cannot reactivate it. Native global files and
444
- corpus source rules are not rewritten by learning.
445
-
446
- Activated sessions include the user's global instruction documents by default.
447
- **Custom → My global instruction files** can exclude them, or use
448
- `agent-launch --preset balanced --exclude-global-instructions claude`. The CLI flag
449
- sets Custom's initial choice; the final visible choice is what gets saved and run.
450
- The choice is retained by managed resume, which cannot change it through a new flag.
451
-
452
- Exclusion currently supports Claude Code 2.1.263 and newer: a per-call
453
- `claudeMdExcludes` setting omits the global `CLAUDE.md`, its imports, and user
454
- `rules/`. Project instructions and project memory remain, as do native settings,
455
- authentication, tool registrations, and permissions. No global file is rewritten.
456
- An existing CLI `--settings` argument, ambiguous relative/empty configuration home,
457
- symlinks, glob characters in the configuration path, or a project/global file alias
458
- is refused rather than replaced or silently included. Current Codex exclusion is
459
- unavailable; its native loader has no selective global-document switch. Vanilla
460
- and ordinary CLI launches retain their native loading behavior.
461
- This controls automatic instruction loading, not file access or memory erasure:
462
- tools can still open files, and project memory or prior conversation content can
463
- contain instructions independently of the excluded documents.
464
-
465
- The preflight keeps the current setup above each choice, supports the configured model
466
- catalog and **Other**, and offers Builder presets, Software Engineer / Vanilla,
467
- Session distill, Custom, Language, and **Corpus Studio**. Studio is the same backend as
468
- `agent-bios corpus`: it searches and renders the library, edits Markdown and
469
- consumption surface, and requires Preview then revision-bound Apply. In environments
470
- without Textual, the corpus client and launcher retain numbered fallbacks; the corpus
471
- editor uses `$VISUAL`/`$EDITOR` when available. Interface catalogs change only human
472
- UI text; model-consumed corpus remains English.
473
-
474
- Every arrow-key TUI selection screen keeps the complete current setup in a fixed top
475
- panel, followed by the highlighted option's description and the option list. Custom
476
- opens a persistent settings hub for the main tier, review setup, host policy, global instruction files, and tier
477
- bindings. Every edit returns to that hub; **Start with these settings** is the final
478
- launch confirmation, while **Exit without launching** cancels it. In the numbered
479
- launcher fallback, `b` is the back command. These controls configure an explicit
480
- agent-bios launch; they do not restore global instruction installation. Optional
481
- shell wiring is controlled separately from the root **Shell connection** menu.
482
-
483
- Review runs cross-family by default (`review_family`, default `cross`; `same` restores today's same-family projection): because the main's tiers are one model family, every dispatchable review route — native and the deep route — runs on the opposite family. The exception is `slash-review`, the host's own built-in review command (`/code-review` on Claude, with `ultra` for its deep multi-agent pass; `/review` on Codex): it needs no dependency and always resolves, but being the main's own command it cannot be dispatched cross-family, so under `cross` it runs as the same-family floor and its verdicts are labeled PROPOSED. A Claude main dispatches gpt/codex review (native via the `codex-run` reviewer wrapper resolved under `$CODEX_HOME/bin`, deep via plain `codex exec -m <frontier model> -c model_reasoning_effort="ultra"` with a self-contained packet on stdin — `-c service_tier="fast"` is the explicit faster, shallower opt-in); a Codex main dispatches Anthropic/Claude review (native via `claude -p --permission-mode plan`, deep via the `claude` CLI headless with the keyword `ultracode` in the prompt, which is what opens Claude Code's dynamic workflow for that turn). The concrete reviewer command, resolved absolute path, and opposite-family tier bindings are named in the injected session-start contract; cross-family reviewers are dispatched as read-only subprocesses, not CLI-native subagents, since neither CLI hosts the other family as a native subagent. When a cross-family route is unavailable at launch or unauthenticated at use time it degrades to same-family native subagent review labeled PROPOSED (family collapse) rather than blocking; a requested non-none review with no cross-family route and no same-family fallback (delegation off) stays fail-closed. A reviewer this launcher has never seen is yours to add: **Register another reviewer…** in the review editor asks for the descriptor a method needs, proves the candidate by running it through the real config reader before a byte is written, and appends it to `review-methods.local.toml` beside your config — a file the installer never deploys, verifies, or overwrites, whose entries face exactly the validation a shipped one does and whose name may not shadow a shipped method. A refusal shows the reader's own message and leaves that file byte-identical. Review setup means configured/requested; this launcher does not claim that review completed, and unavailable runtimes such as Ultrawork are not offered until integrated.
484
-
485
- Both the legacy shell adapter and the optional private shell connection preserve
486
- argument-bearing and non-TTY calls as direct backend invocations. The private
487
- connection adds no permission flags on that path. Without opting in, the private
488
- default installs no shell functions; an explicit `agent-launch` call projects a
489
- launch profile or corpus snapshot.
490
-
491
- Direct `agent-launch` calls still require a valid profile to resolve the backend command and its default arguments. `--preset`, `--custom`, or `--dry-run` select the configured-launch path even when non-TTY or combined with `--no-tui`; a non-TTY bare `--dry-run` deterministically uses Balanced, and a custom profile without that preset must pass `--preset NAME`. Forwarded backend arguments are appended verbatim after the projected defaults; one that would override a projected option (the seat, the contract, delegation, policy) is refused at launch so the contract keeps describing the run, and the summary discloses forwarded arguments when present. For scripted configured launches, call `$HOME/.local/bin/agent-launch --preset NAME --yes HOST -- ...` or add `$HOME/.local/bin` to `PATH`. The summary goes to stderr so backend stdout stays machine-consumable.
492
-
493
- When the internal Codex wrappers are available to a configured route, `codex-helm` follows the local CLI default and launches the HELM main with `--dangerously-bypass-approvals-and-sandbox`; an explicit `--sandbox MODE` disables bypass for that run regardless of flag order. `AGENTS.md` gives root/main local Codex sessions standing ordinary-subagent authorization when the delegation gates fire. A non-Ultra HELM main sets native multi-agent off by default and instructs HELM to send tiered dispatch through the internal `codex-run` adapter, where the selected model, effort, and sandbox are pinned; native multi-agent defaults on only when the HELM main itself is explicitly Ultra. FRONTIER is instructed to run as a separate `gpt-6-astra` root that is always read-only, at max by default, Ultra for genuinely divisible complex work, or a lower supported effort when cost or latency dominates. Because the HELM main has bypass authority and arbitrary expert `-c` by design, this dispatch route is an instruction-backed, live-E2E-verified default rather than a security boundary. Keep `codex-run` as the low-level internal adapter, not as a user-facing policy boundary. Both wrappers accept `-c key=value` as an expert override, and that override may intentionally change wrapper defaults for a single run. The private installer keeps wrapper files in its immutable release rather than populating `$CODEX_HOME/bin`; a route that still names a native-home wrapper is unavailable until its adapter path is resolved.
494
-
495
- `claude-run` is the Claude-side review adapter carried by the release, and it takes `--model` and `--effort` to pin the seat. Omitting either warns and dispatches anyway, matching `codex-run`: refusing outright turned "the review ran unpinned" into "the review did not run", which is the worse of the two. The honest signal is downstream instead — an unpinned dispatch can name no seat, so it emits no receipt and the method adjudicates to UNKNOWN rather than to a clean pass. Its default denies the mutating tools, which is not the OS-level sandbox its Codex twin gets — do not read the two defaults as equivalent guarantees.
496
-
497
- **Review receipts.** A launch reports what it *projected*, because at launch no review has run — so a clean verdict without a receipt is PROPOSED, never ACHIEVED. Given `REVIEW_RECEIPT_DIR`, both adapters record what they observed of the dispatch they just performed: exit status, a hash of the packet fed in, a hash of the bytes returned, and the seat actually sent. Unset, they behave exactly as they would otherwise and write nothing. `agent-launch --fold-receipts DIR PACKET MAIN_DISPATCH_ID` folds a run into a `ReviewReceipts/v1` bundle — several passes of one method become the one record it is judged on — and `agent-launch --verify-receipts PLAN BUNDLE` adjudicates it, exiting non-zero unless every selected method verified. Adapting another tool needs no change here: call `agent-launch --emit-receipt` from your adapter and prove it conforms with `agent-launch --check-adapter SEAT -- CMD`, which is adjudicated by the same code that credits a real review. A receipt is still written by whoever ran the review, so this buys drift rather than honesty: what it stops is a reviewer that quietly never ran, returned nothing, or exited non-zero reading as a clean pass.
498
-
499
- `agent-bios verify` checks the recorded immutable release file-by-file, reloads a
500
- non-empty catalog from that release, matches the store's last successful baseline to
501
- the install record, and verifies the owned launcher/profile/status projections. Its
502
- result says `activation: unverified`: neither stored bytes nor a dry-run argv proves a
503
- host loaded the snapshot.
504
-
505
- Corpus selection seeds future activated sessions, not plain CLI/Vanilla. A one-off
506
- `--corpus-domains` selection applies only to that launch. The store composes an
507
- immutable `ContentRef`; Codex startup preserves the effective native developer
508
- instructions, injects the private corpus and dynamic launch contract, creates and
509
- reads back a durable host thread, then records its pin. Claude uses the per-call
510
- append and requested session id and records a pin only after observing that id in the
511
- native session log. Real-host probes cover Codex and Claude first-turn delivery,
512
- including corpus propagation to a launcher-generated Claude workhorse. Claude
513
- resume restores the pin's exact environment provenance rather than changing an unset
514
- config-home variable into an explicit default. Post-fix authenticated resume remains
515
- unverified. Snapshot pin integrity alone does
516
- not establish that a resumed model request succeeded.
517
-
518
- The native Claude plugin bootstrap has advertised selected plugin roots and
519
- qualified corpus agents. An edited corpus `SessionStart` hook ran automatically
520
- through its generated plugin. Codex 0.153.4 discovery retains user, project and session
521
- hooks alongside the selected corpus. A real-host test with a local transport verifies
522
- that a generated `SessionStart` hook runs and injects context after its exact definition
523
- is trusted; the untrusted control does neither. This test uses no external model.
524
- Authenticated corpus-agent execution and native skill-menu registration remain
525
- unverified; they are separate from hook delivery and launcher-tier child evidence.
526
-
527
- Pins preserve environment provenance rather than reconstructing it: the host's
528
- config-home variable, and `HOME` when needed for default lookup, retain their
529
- recorded unset, set, or explicitly empty state. A relative native home is resolved
530
- from the recorded canonical cwd. Pins lacking that context fail explicitly at resume;
531
- it is never inferred from the caller's environment.
532
-
533
- Named native Codex profiles (`--profile` / `-p`) are not supported for private
534
- activation by the verified 0.153.4 adapter: that host exposes profiles on runtime
535
- commands but not its effective-config app-server surface. The launcher refuses
536
- this combination before creating a session rather than substituting base settings.
537
- Plain CLI/Vanilla profile use is unchanged.
538
-
539
- Every activated snapshot retains the immutable private management bootstrap and puts
540
- its exact path in the injected startup text, so `$corpus` has private procedure access
541
- even without native skill discovery. Selected requested procedures are exposed the same
542
- way. This is not a claim that either host registered them in its native skill menu;
543
- native skill registration remains unverified.
78
+ This route needs Bash and Python 3.11+; Node/npm are not acquisition prerequisites.
79
+ Keep using `bash install.sh <command>` from that source for management. A global
80
+ `agent-bios` command can belong to a different npm version.
81
+
82
+ </details>
83
+
84
+ Ordinary `claude` and `codex` commands do not automatically receive agent-bios
85
+ content. An optional zsh [shell connection](docs/advanced-launch.md#optional-shell-connection)
86
+ can route bare interactive commands through the launcher. If you have an older
87
+ global installation, read [migration](docs/recovery.md#ownership-and-legacy-migration)
88
+ before changing it.
89
+
90
+ ### In the Codex app
91
+
92
+ Open a local task on the machine you want to configure and send:
93
+
94
+ ```text
95
+ Install https://github.com/kangminlee-maker/agent-bios
96
+ ```
97
+
98
+ The agent follows [INSTALL.md](INSTALL.md), obtains a fixed source revision, and
99
+ asks for English, 한국어 or 日本語. Choose dependencies, no active corpus or specific
100
+ corpus, and optional app connection or instruction-file capture. Review the effects
101
+ before Apply. You do not need to supply a local path or install Codex CLI.
102
+
103
+ Once the registered command appears in the app, use `$agent-bios` for setup or management.
104
+ To add corpus to a task, explicitly ask it to use your chosen corpus there.
105
+ Installation and opening Corpus Studio do not activate task context.
106
+ [App use, off, and personal instruction import →](docs/setup.md#use-corpus-in-a-codex-app-task)
107
+
108
+ ## Your instruction library
109
+
110
+ Open **Corpus Studio** in the launcher, or run `agent-bios corpus`.
111
+ In the app, `$agent-bios` can manage the same library through conversation.
112
+
113
+ - **Read as you navigate.** Arrow keys move between reading controls and update
114
+ the document as the library cursor moves; Enter is not required to read an item.
115
+ - **Recognize guide pointers.** Rules with explicit guide references show
116
+ **→ GUIDE** and link to the guide, its delivery method, and its current state.
117
+ - **Switch items on or off.** Press **Space** in the library. `[x]` is on,
118
+ `[ ]` is off, and `*` means the choice is not yet applied.
119
+ - **Apply deliberately.** Stage several choices, then use
120
+ **Preview on/off Apply**. Ordinary edits also use a revision-checked preview.
121
+
122
+ An item's **use** and its **delivery method** are separate. A selected rule may
123
+ be `always`, a guide `relevant`, or a procedure `requested`. Native hooks and
124
+ agents use separate opt-in adapters. Putting a guide next to its trigger does
125
+ not change either one's delivery.
126
+
127
+ Individual on/off choices take precedence over default domain/core selections.
128
+ Off is not deletion: content and edits remain available, including for learning.
129
+ Updates retain those choices; a full reset returns to installed defaults.
130
+
131
+ [Corpus controls, keyboard navigation, delivery methods, and included guides →](docs/corpus.md)
132
+
133
+ ## How sessions work
134
+
135
+ **Library your selection and edits fixed snapshot → configured session**
136
+
137
+ Installation stores a release and its baseline in agent-bios-owned locations.
138
+ A configured launch compiles the selected content for its host. Later edits
139
+ affect future snapshots; managed CLI resume resolves the session's recorded snapshot.
140
+ App tasks use a separately selected snapshot returned through their tool/context path.
141
+ Turning app delivery off cannot erase text already present in the conversation.
142
+
143
+ Your own global instructions are **also loaded by default** in activated
144
+ sessions. Not overwriting them is different from excluding them. Supported Claude
145
+ versions offer selective global-document exclusion; the current Codex adapter
146
+ does not. Project instructions and prior conversation content are separate.
147
+
148
+ [Storage, session pins, and verification limits →](docs/session-model.md)
149
+
150
+ ## Understand the reasoning
151
+
152
+ Choose **Understand!** in the launcher to explore why the corpus is written the
153
+ way it is. Select a coherent learning bundle rather than memorizing separate files.
154
+
155
+ The tutor explains purposes, background, tradeoffs, and limits. Each active
156
+ learning turn ends with a relevant question, then waits for your answer. It
157
+ distinguishes documented reasons from inference and respects pause or stop requests.
158
+
159
+ For example, a discussion of clarification might ask:
160
+ *“What would change in your next action if this ambiguity were resolved?”*
161
+
162
+ The aim is understanding when a rule helps—and where it stops helping.
163
+ This is learning for the person, not model training. Saving a personal discovery
164
+ requires your confirmation.
165
+
166
+ [Learning sessions and personal discoveries →](docs/understand.md)
167
+
168
+ ## Stay in control
169
+
170
+ - **No default global rewrite.** Private installation leaves native instruction
171
+ files, discovery directories, and hook settings alone. Explicit legacy
172
+ migration is a separate operation.
173
+ - **Separate selection from permission.** Turning an item on does not bypass
174
+ native hook/agent opt-in, host trust, or execution permissions.
175
+ - **Know what is verified.** `agent-bios verify` checks stored content and owned
176
+ projections. `activation: unverified` is deliberate; it does not certify model
177
+ consumption. Authenticated resume and some native integrations remain
178
+ [incompletely verified](docs/session-model.md#verification-and-limits).
179
+ - **Inspect recovery before applying it.** Migration and reset have previews.
180
+ Conflicting user-owned paths are reported, not permission to delete them.
181
+
182
+ ## Documentation
183
+
184
+ | When you need more detail | Read |
185
+ | --- | --- |
186
+ | Install, connect the app, or import existing instructions | [Setup](docs/setup.md) |
187
+ | Author, enable, restore, or inspect corpus items | [Corpus](docs/corpus.md) |
188
+ | Understand snapshots, storage, and session evidence | [Session model](docs/session-model.md) |
189
+ | Migrate, reset, or resolve installation conflicts | [Recovery](docs/recovery.md) |
190
+ | Configure presets, globals, shell connection, native hooks, or review | [Advanced launch](docs/advanced-launch.md) |
191
+ | Learn the corpus and preserve a discovery | [Understand!](docs/understand.md) |
192
+ | Check prerequisites and optional tools | [Dependencies](DEPENDENCIES.md) |
193
+ | Develop this repository | [Contributing](CONTRIBUTING.md) — requires a checkout |
194
+
195
+ Use `agent-bios help` and `agent-bios corpus --help` for command discovery.
196
+ Source references: [delivery surfaces](SURFACES.md), [network contract](ENDPOINTS.md),
197
+ and [terminology](LEXICON.md).
544
198
 
545
199
  ## Adopting elsewhere
546
200
 
547
- 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.
201
+ Review the `(private)` bindings and environment-specific dependencies before
202
+ adopting the defaults. Keep personal adjustments in Corpus Studio, or follow
203
+ [the source-authoring workflow](CONTRIBUTING.md#adopting-elsewhere) when changing
204
+ what the package ships.
548
205
 
549
206
  ## Scope
550
207
 
551
- The repository and npm package contain corpus sources and private runtime machinery,
552
- not a user's authoring state, learning events, snapshots, pins, activation journals,
553
- credentials, native settings, or generated temporary files.
208
+ The package contains instruction sources and runtime machinery, not your
209
+ personal corpus state, learning events, session pins, credentials, or native settings.
210
+
211
+ ## License
212
+
213
+ [MIT](LICENSE).