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
@@ -0,0 +1,131 @@
1
+ # Launch configuration
2
+
3
+ [← Overview](../README.md) · [Setup](setup.md) · [Corpus](corpus.md) · [Sessions](session-model.md) · [Recovery](recovery.md) · [Launch](advanced-launch.md) · [Understand!](understand.md)
4
+
5
+ Inspect settings before launching. Some Builder and internal-wrapper defaults use permission bypass. A configured review or registered hook is not evidence that it ran.
6
+
7
+ ## Preflight and settings
8
+
9
+ The preflight keeps the current setup above each choice, supports the configured model
10
+ catalog and **Other**, and offers Builder presets, Software Engineer / Vanilla,
11
+ Session distill, Custom, Language, and **Corpus Studio**. Studio is the same backend as
12
+ `agent-bios corpus`: it searches and renders the library, edits Markdown and
13
+ consumption surface, and requires Preview then revision-bound Apply. Packaged
14
+ entrypoints validate and temporarily extract their included UI bundle before loading
15
+ Rich/Textual. A missing or corrupt bundle fails explicitly; no preinstalled Textual
16
+ environment is required. Interface catalogs change only human UI text;
17
+ model-consumed corpus remains English.
18
+
19
+ Every arrow-key TUI selection screen keeps the complete current setup in a fixed top
20
+ panel, followed by the highlighted option's description and the option list. Custom
21
+ opens a persistent settings hub for the main tier, review setup, host policy, global instruction files, and tier
22
+ bindings. Every edit returns to that hub; **Start with these settings** is the final
23
+ launch confirmation, while **Exit without launching** cancels it. When the numbered
24
+ launcher flow is selected with `--no-tui`, `b` is the back command. These controls configure an explicit
25
+ agent-bios launch; they do not restore global instruction installation. Optional
26
+ shell wiring is controlled separately from the root **Shell connection** menu.
27
+
28
+ ## Tiers and restricted seats
29
+
30
+ Tier defaults come from the launch profile and the guides' Environment Binding
31
+ tables. Claude Haiku 4.5 has no effort parameter: its tier entry, native agent
32
+ definition and projected call omit it. SWEEP is one-rule-per-item read-only work.
33
+ As a main seat it disables child delegation and requires review off (for example,
34
+ Solo); a requested review needs a HELM or WORKHORSE main instead. Codex SWEEP mains
35
+ use a read-only sandbox; Claude SWEEP mains use restricted Read/Glob/Grep tools
36
+ and an empty, strict MCP configuration. Other main roles retain their selected
37
+ policies, and explicit personal model/effort overrides remain available.
38
+
39
+ ## Global instruction files
40
+
41
+ Activated sessions include the user's global instruction documents by default.
42
+ **Custom → My global instruction files** can exclude them, or use
43
+ `agent-launch --preset balanced --exclude-global-instructions claude`. The CLI flag
44
+ sets Custom's initial choice; the final visible choice is what gets saved and run.
45
+ The choice is retained by managed resume, which cannot change it through a new flag.
46
+
47
+ Exclusion currently supports Claude Code 2.1.263 and newer: a per-call
48
+ `claudeMdExcludes` setting omits the global `CLAUDE.md`, its imports, and user
49
+ `rules/`. Project instructions and project memory remain, as do native settings,
50
+ authentication, tool registrations, and permissions. No global file is rewritten.
51
+ An existing CLI `--settings` argument, ambiguous relative/empty configuration home,
52
+ symlinks, glob characters in the configuration path, or a project/global file alias
53
+ is refused rather than replaced or silently included. Current Codex exclusion is
54
+ unavailable; its native loader has no selective global-document switch. Vanilla
55
+ and ordinary CLI launches retain their native loading behavior.
56
+ This controls automatic instruction loading, not file access or memory erasure:
57
+ tools can still open files, and project memory or prior conversation content can
58
+ contain instructions independently of the excluded documents.
59
+
60
+ ## Native hooks and agents
61
+
62
+ Native corpus consumption is default-off. `agent-bios corpus snapshot --host codex
63
+ --native --json` (or `--host claude`) composes a preview; `agent-launch --corpus-native`
64
+ opts one configured session into selected corpus hooks. Both hosts use the same
65
+ installed Python carrier and typed `event`/`matcher` binding. Authoring accepts the
66
+ combined event vocabulary; compilation reports an event unsupported by the selected
67
+ host without changing its name or executing it through another event.
68
+
69
+ Claude receives a namespaced plugin per CorpusRef through `--plugin-dir`. Codex
70
+ receives inline `hooks.<Event>` config through per-session `-c` arguments. Existing
71
+ user, project and session hooks remain present, and resume retains the pin's exact
72
+ registrations. Neither adapter installs global hooks. Codex hook enablement and native
73
+ trust still apply: new or changed definitions need review in `/hooks`. Discovery is
74
+ checked before launch, but discovery alone does not establish execution. Hooks use the
75
+ host's command permissions; opting in permits the selected carrier to run. Editing an
76
+ event binding does not rewrite the Python carrier's input/output contract.
77
+
78
+ Native corpus agents currently use Claude plugins and retain authored frontmatter and
79
+ plugin-qualified names, distinct from launcher's bare tier agents. A Codex agent
80
+ projection still needs to translate agent-specific model and tool restrictions; this
81
+ does not limit shared hook delivery. Arbitrary prose promoted to `event` or `delegated`
82
+ cannot become executable, and hidden discovery/config members are refused.
83
+
84
+ ## Optional shell connection
85
+
86
+ **Shell connection** in the root TUI offers **Restore connection** and **Remove
87
+ connection**, with confirmation before writing. The same owner is available as
88
+ `agent-bios shell` (status), `agent-bios shell restore`, and `agent-bios shell remove`;
89
+ `--dry-run` previews either action. Restore backs up existing files and adds one
90
+ managed block to `${ZDOTDIR:-$HOME}/.zshrc`, plus a managed `shell.zsh`. Open a new
91
+ terminal or source that `.zshrc` to load it. Interactive, argument-free `claude` and
92
+ `codex` then open the TUI; argument-bearing and non-TTY calls go to the original CLI
93
+ without added permission flags. Removal preserves other shell text and withdraws
94
+ loaded managed wrappers on the next shell command. An edited managed file or block
95
+ is preserved and reported for reconciliation, not overwritten. Backups remain private
96
+ under `runtime/shell-backups/`; `ZDOTDIR` must match the connection's recorded path.
97
+ Updates preserve an opted-in connection; reset and uninstall remove it. This setting
98
+ never edits global `AGENTS.md`/`CLAUDE.md`, project files, or corpus content. Ordinary
99
+ private installation also leaves those globals alone; explicit `migrate` can remove
100
+ the old agent-bios-managed regions and imports while preserving user-authored text.
101
+ First opt-in records ownership before publishing shell wiring, so interrupted restores
102
+ remain recoverable. Reset and uninstall also detect receipt-less managed scripts from
103
+ older interrupted restores. Install repairs a missing or non-executable owned launcher;
104
+ an unavailable launcher falls back to the native CLI. Recovery rechecks path ancestors
105
+ before writing and refuses redirected symlink targets.
106
+
107
+ ## Scripted launches and forwarded arguments
108
+
109
+ Both the legacy shell adapter and the optional private shell connection preserve
110
+ argument-bearing and non-TTY calls as direct backend invocations. The private
111
+ connection adds no permission flags on that path. Without opting in, the private
112
+ default installs no shell functions; an explicit `agent-launch` call projects a
113
+ launch profile or corpus snapshot.
114
+
115
+ 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.
116
+
117
+ ## Review routing
118
+
119
+ Review runs cross-family by default (`review_family`, default `cross`; `same` selects 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.
120
+
121
+ ## Internal adapters and permission boundaries
122
+
123
+ 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.
124
+
125
+ `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.
126
+
127
+ ## Review receipts
128
+
129
+ **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.
130
+
131
+ See [verification and limits](session-model.md#verification-and-limits) for the evidence boundary, authenticated resume, and unsupported native named profiles.