agent-bios 0.17.1 → 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.
- package/DEPENDENCIES.md +236 -80
- package/INSTALL.md +112 -0
- package/README.md +184 -486
- package/claude/CLAUDE.md +1 -1
- package/claude/guides/cli-multi-model-workflow.md +1 -1
- package/claude/guides/learning-flow.md +23 -12
- package/claude/guides/session-distill-workflow.md +22 -12
- package/codex/AGENTS.md +1 -1
- package/codex/guides/cli-multi-model-workflow.md +1 -1
- package/codex/guides/learning-flow.md +23 -12
- package/codex/guides/session-distill-workflow.md +22 -12
- package/compose/app_bridge/SKILL.md +75 -0
- package/compose/app_bridge/agents/openai.yaml +2 -0
- package/compose/app_bridge/scripts/bridge.py +76 -0
- package/compose/bootstrap/SKILL.md +23 -2
- package/compose/corpus.py +31 -9
- package/compose/corpus_app.py +456 -0
- package/compose/corpus_import.py +529 -0
- package/compose/corpus_install.py +196 -18
- package/compose/corpus_session.py +27 -0
- package/compose/corpus_setup.py +674 -0
- package/compose/corpus_setup_cli.py +582 -0
- package/compose/corpus_setup_i18n.py +318 -0
- package/compose/corpus_setup_ui.py +633 -0
- package/compose/corpus_store.py +236 -34
- package/compose/corpus_transaction.py +43 -10
- package/compose/corpus_ui.py +279 -8
- package/compose/corpus_ui_runtime.py +278 -0
- package/compose/corpus_understand.py +6 -1
- package/compose/setup/START.md +147 -0
- package/compose/ui_runtime/linkify_it_py-2.2.0-py3-none-any.whl +0 -0
- package/compose/ui_runtime/manifest.json +238 -0
- package/compose/ui_runtime/markdown_it_py-4.2.0-py3-none-any.whl +0 -0
- package/compose/ui_runtime/mdit_py_plugins-0.6.1-py3-none-any.whl +0 -0
- package/compose/ui_runtime/mdurl-0.1.2-py3-none-any.whl +0 -0
- package/compose/ui_runtime/platformdirs-4.11.8-py3-none-any.whl +0 -0
- package/compose/ui_runtime/pygments-2.21.0-py3-none-any.whl +0 -0
- package/compose/ui_runtime/rich-15.0.0-py3-none-any.whl +0 -0
- package/compose/ui_runtime/textual-8.2.8-py3-none-any.whl +0 -0
- package/compose/ui_runtime/typing_extensions-4.16.0-py3-none-any.whl +0 -0
- package/docs/advanced-launch.md +131 -0
- package/docs/assets/corpus-studio.svg +227 -0
- package/docs/corpus.md +117 -0
- package/docs/recovery.md +201 -0
- package/docs/session-model.md +120 -0
- package/docs/setup.md +190 -0
- package/docs/understand.md +40 -0
- package/install.sh +75 -46
- package/launch/agent-launch.py +91 -47
- package/launch/provision-venv.sh +44 -13
- package/learn/collect-learning.py +14 -5
- package/learn/learning.schema.json +2 -2
- package/package.json +14 -2
- package/provenance.json +1 -1
- package/wrappers/claude-run.sh +10 -13
package/docs/recovery.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Installation, migration, and recovery
|
|
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
|
+
Start with `agent-bios status`. Commands use the installed `agent-bios@0.19.0` CLI;
|
|
6
|
+
from a source checkout use `bash install.sh <command>`. For first installation and app
|
|
7
|
+
setup recovery, see [Setup](setup.md). Commands below are **operation references, not a sequence to paste and run**. Preview the specific action you need; do not delete an ownership conflict just to make installation succeed.
|
|
8
|
+
|
|
9
|
+
## Command reference
|
|
10
|
+
|
|
11
|
+
The npm package and command are both named `agent-bios`. Installation is always
|
|
12
|
+
explicit—never a package-manager postinstall side effect—and the default path stores
|
|
13
|
+
an immutable release and baseline under agent-bios-owned state. It installs the
|
|
14
|
+
`agent-launch` entrypoint and its own profile/catalog files, but does not change native
|
|
15
|
+
Claude/Codex globals, settings or hooks. Optional app registration adds only its
|
|
16
|
+
owned discovery link, and optional shell connection changes only its owned startup
|
|
17
|
+
wiring. Neither activates corpus in a task.
|
|
18
|
+
|
|
19
|
+
| Command | Purpose |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `npm install -g agent-bios@0.19.0` | install the CLI package; private setup is a separate explicit command |
|
|
22
|
+
| `agent-bios install` | open the guided installation UI |
|
|
23
|
+
| `agent-bios install --non-interactive --corpus none` | store runtime with no active corpus |
|
|
24
|
+
| `agent-bios onboard --non-interactive --domains builder-base,multi-agent-orchestration` | store the named domains with compatibility core/infra selection |
|
|
25
|
+
| `agent-bios setup status --review-id ID` / `resume --review-id ID` | inspect the setup receipt / prepare a safe continuation without executing it |
|
|
26
|
+
| `agent-bios verify` | verify stored bytes/catalog/baseline; not host activation |
|
|
27
|
+
| `agent-bios status` | show the private release, baseline, conflicts, and evidence state |
|
|
28
|
+
| `agent-bios corpus` | rich Corpus Studio in a TTY; list in a non-TTY |
|
|
29
|
+
| `agent-launch claude` | open the launch TUI for Claude |
|
|
30
|
+
| `agent-launch codex` | open the launch TUI for Codex |
|
|
31
|
+
| `agent-bios shell restore` | opt in: bare claude/codex opens the TUI |
|
|
32
|
+
| `agent-bios shell remove` | remove only that optional shell connection |
|
|
33
|
+
| `agent-bios reset` | preview reset; keep sources, snapshots, and pins |
|
|
34
|
+
| `agent-bios reset --apply --yes --expected-revision REV` | use the revision returned by preview |
|
|
35
|
+
| `agent-bios migrate` | preview legacy global cleanup; --apply --yes performs it |
|
|
36
|
+
| `agent-bios update` | git pull + reinstall (clone), or print the npm update line |
|
|
37
|
+
| `agent-bios uninstall` | remove owned runtime entries; retain user corpus and pinned sessions |
|
|
38
|
+
|
|
39
|
+
`agent-launch` examples assume `~/.local/bin` is on `PATH`; otherwise use `"$HOME/.local/bin/agent-launch"`. From a checkout, deploy with `bash install.sh install` at its root, not the globally installed CLI. A blocked npm postinstall message does not deploy the corpus; the explicit `install` command remains necessary.
|
|
40
|
+
|
|
41
|
+
## Ownership and legacy migration
|
|
42
|
+
|
|
43
|
+
`install`, `onboard`, `reset`, `migrate`, and `uninstall` expose dry-run or preview
|
|
44
|
+
paths appropriate to their mutations. A pre-existing owned launcher/profile path whose
|
|
45
|
+
bytes no longer match the recorded copy is reported as an owned-path conflict rather than
|
|
46
|
+
overwritten. `migrate` is the separate recovery-backed operation for a legacy global
|
|
47
|
+
installation: preview is the default, applying requires `--apply --yes`, ambiguous
|
|
48
|
+
ownership refuses the apply, and later private operations do not fall through to a
|
|
49
|
+
global writer. Setting `AGENT_BIOS_LEGACY_INSTALL=1` selects the old deployer only for
|
|
50
|
+
compatibility and migration regression work; it is not the user default.
|
|
51
|
+
|
|
52
|
+
The legacy compatibility deployer preserves guide paths named only by a previous
|
|
53
|
+
manifest when the current source no longer establishes their ownership. It names
|
|
54
|
+
these remnants for manual inspection and leaves them out of the new ownership
|
|
55
|
+
manifest, so later uninstall does not claim them. Current source-owned members
|
|
56
|
+
retain normal backup and selection cleanup; private snapshot installation uses its
|
|
57
|
+
own authoritative inventory.
|
|
58
|
+
|
|
59
|
+
After updating a legacy global installation, run `agent-bios migrate` before the
|
|
60
|
+
first private `install`. Its preview identifies exact managed regions, legacy
|
|
61
|
+
manifest paths and learning sources. `agent-bios migrate --apply --yes` backs up
|
|
62
|
+
the originals, transfers and verifies learning records, retires the legacy paths,
|
|
63
|
+
then installs the private release. A central-only Codex file and the unmodified
|
|
64
|
+
empty Claude learning seed do not require a learning JSONL file; actual learning
|
|
65
|
+
content without its source still requires attention.
|
|
66
|
+
|
|
67
|
+
An interrupted migration is visible in `status` and blocks configuration readers
|
|
68
|
+
and unrelated writes. Re-run `agent-bios migrate --apply --yes` to resume its
|
|
69
|
+
pinned release and recorded path versions. A completed private installation is
|
|
70
|
+
not repeated, and later cleanup cannot delete its replacement launcher/profile.
|
|
71
|
+
Intervening edits are preserved and reported instead of overwritten. Older
|
|
72
|
+
incomplete journals without replay evidence require reconciliation from their
|
|
73
|
+
backups rather than a guessed replay. Existing private-session replay retains the
|
|
74
|
+
previous confirmed release until migration completes.
|
|
75
|
+
|
|
76
|
+
Before applying or resuming, stop the old global collectors that can still append a native
|
|
77
|
+
learning JSONL or rewrite its native prose/entry file. The migration checks the
|
|
78
|
+
recorded native state immediately before commit, but no filesystem check can make
|
|
79
|
+
a noncooperating writer atomic after that final observation. If it reports a
|
|
80
|
+
changed native target, preserve only the affected paths and restore only those
|
|
81
|
+
paths to the journal's recorded `after` state before resuming the old migration.
|
|
82
|
+
Do not replace a whole native directory or edit the journal.
|
|
83
|
+
|
|
84
|
+
For a validated late-input recovery, set `JOURNAL` to the one `NEEDS_RECOVERY`
|
|
85
|
+
migration journal and pass only the specific changed JSONL, prose, or entry paths
|
|
86
|
+
that its error named. This makes a new durable copy under that journal's existing
|
|
87
|
+
`backup_root`, verifies the copy, and then restores a changed target from its
|
|
88
|
+
recorded `after` bytes/existence/mode or an input-only path to its recorded
|
|
89
|
+
unchanged existence. It rejects a path absent from the journal, symlinks, and
|
|
90
|
+
non-regular files before writing any backup. New private journals retain exact
|
|
91
|
+
bytes for input-only native files, so the command can restore an originally
|
|
92
|
+
present input while preserving its current mode (or using `0600` if it is
|
|
93
|
+
absent). Historic digest-only journals still need an external byte-identical
|
|
94
|
+
backup; the command refuses to invent their missing bytes.
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
JOURNAL="${AGENT_BIOS_STATE_DIR:-$HOME/.local/share/agent-bios}/runtime/migrations/<migration-id>/journal.json"
|
|
98
|
+
python3 - "$JOURNAL" \
|
|
99
|
+
"$HOME/.codex/personal/learnings.jsonl" <<'PY'
|
|
100
|
+
import base64, hashlib, json, os, sys, tempfile
|
|
101
|
+
from pathlib import Path
|
|
102
|
+
|
|
103
|
+
journal = Path(sys.argv[1])
|
|
104
|
+
data = json.loads(journal.read_text(encoding="utf-8"))
|
|
105
|
+
backup_root = Path(data.get("backup_root", ""))
|
|
106
|
+
if data.get("kind") != "migrate" or data.get("state") != "NEEDS_RECOVERY" or backup_root != journal.parent / "backup":
|
|
107
|
+
raise SystemExit("expected one validated NEEDS_RECOVERY migration journal")
|
|
108
|
+
targets = {Path(entry["path"]): entry for entry in data["paths"]}
|
|
109
|
+
inputs = {Path(path): version for path, version in data["inputs"].items()}
|
|
110
|
+
selected = [Path(value).expanduser() for value in sys.argv[2:]]
|
|
111
|
+
unknown = [str(path) for path in selected if path not in targets and path not in inputs]
|
|
112
|
+
if not selected or unknown:
|
|
113
|
+
raise SystemExit("name one or more exact journal paths; unknown: " + ", ".join(unknown))
|
|
114
|
+
|
|
115
|
+
planned = []
|
|
116
|
+
for path in selected:
|
|
117
|
+
entry = targets.get(path)
|
|
118
|
+
version = entry["after"] if entry is not None else inputs[path]
|
|
119
|
+
if path.is_symlink() or (path.exists() and not path.is_file()):
|
|
120
|
+
raise SystemExit(f"refusing unsafe native path: {path}")
|
|
121
|
+
root = next((parent for parent in (path.parent, *path.parents)
|
|
122
|
+
if parent.name in {".claude", ".codex"}), None)
|
|
123
|
+
if root is None or root.is_symlink():
|
|
124
|
+
raise SystemExit(f"recovery supports an exact Claude/Codex native path, not: {path}")
|
|
125
|
+
current = root
|
|
126
|
+
for part in path.relative_to(root).parts:
|
|
127
|
+
current /= part
|
|
128
|
+
if current.is_symlink():
|
|
129
|
+
raise SystemExit(f"refusing symlink ancestor: {current}")
|
|
130
|
+
planned.append((path, entry, version))
|
|
131
|
+
|
|
132
|
+
if backup_root.is_symlink() or (backup_root.exists() and not backup_root.is_dir()):
|
|
133
|
+
raise SystemExit(f"refusing unsafe recovery root: {backup_root}")
|
|
134
|
+
backup_root.mkdir(parents=True, exist_ok=True, mode=0o700)
|
|
135
|
+
recovery = Path(tempfile.mkdtemp(prefix="recovery-before-resume-", dir=backup_root)) / "files"
|
|
136
|
+
for path, entry, version in planned:
|
|
137
|
+
if path.exists():
|
|
138
|
+
saved = recovery / str(path).lstrip("/")
|
|
139
|
+
saved.parent.mkdir(parents=True, exist_ok=True)
|
|
140
|
+
before = path.read_bytes()
|
|
141
|
+
saved.write_bytes(before)
|
|
142
|
+
saved.chmod(path.stat().st_mode & 0o777)
|
|
143
|
+
if saved.read_bytes() != before:
|
|
144
|
+
raise SystemExit(f"backup did not verify: {saved}")
|
|
145
|
+
if not version["exists"]:
|
|
146
|
+
path.unlink(missing_ok=True)
|
|
147
|
+
continue
|
|
148
|
+
encoded = version.get("bytes_b64")
|
|
149
|
+
if not isinstance(encoded, str):
|
|
150
|
+
raise SystemExit(f"journal records only a digest for existing input; restore it from an exact external backup: {path}")
|
|
151
|
+
body = base64.b64decode(encoded.encode("ascii"), validate=True)
|
|
152
|
+
if hashlib.sha256(body).hexdigest() != version["sha256"]:
|
|
153
|
+
raise SystemExit(f"journal after bytes are invalid: {path}")
|
|
154
|
+
descriptor, temporary = tempfile.mkstemp(prefix=f".{path.name}.", dir=path.parent)
|
|
155
|
+
try:
|
|
156
|
+
with os.fdopen(descriptor, "wb") as output:
|
|
157
|
+
output.write(body)
|
|
158
|
+
output.flush()
|
|
159
|
+
os.fsync(output.fileno())
|
|
160
|
+
mode = entry["mode"] if entry is not None else (path.stat().st_mode & 0o777 if path.exists() else 0o600)
|
|
161
|
+
os.chmod(temporary, mode)
|
|
162
|
+
os.replace(temporary, path)
|
|
163
|
+
finally:
|
|
164
|
+
Path(temporary).unlink(missing_ok=True)
|
|
165
|
+
print(recovery)
|
|
166
|
+
PY
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Resume the old journal with `agent-bios migrate --apply --yes`. After it commits,
|
|
170
|
+
restore only the preserved late record (`B`) from the printed recovery directory
|
|
171
|
+
to its original native path, then run a fresh `agent-bios migrate` preview and
|
|
172
|
+
`agent-bios migrate --apply --yes`. The new migration imports `B` through the
|
|
173
|
+
normal learning-id deduplication path. Leave every other recovery copy in place
|
|
174
|
+
as evidence; it is not an instruction to restore all saved native files.
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
RECOVERY_BACKUP='<the directory printed above>'
|
|
178
|
+
B="$HOME/.codex/personal/learnings.jsonl" # the one path you deliberately preserved
|
|
179
|
+
cp "$RECOVERY_BACKUP/${B#/}" "$B"
|
|
180
|
+
agent-bios migrate
|
|
181
|
+
agent-bios migrate --apply --yes
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Installation and rollback
|
|
185
|
+
|
|
186
|
+
Installation and rollback validate the target baseline and personal field/member
|
|
187
|
+
changes together. Conflicts preserve the current selection rather than dropping
|
|
188
|
+
items from a successful snapshot. Installation publishes a complete corpus/config
|
|
189
|
+
association under the same lock used by readers. Pending publication is disclosed
|
|
190
|
+
by status and prevents a new configured launch from reading mixed state; bare and
|
|
191
|
+
pinned replay can use the last confirmed immutable release.
|
|
192
|
+
|
|
193
|
+
## Full reset
|
|
194
|
+
|
|
195
|
+
Full reset returns an `expected_revision` in its preview. Pass that value with
|
|
196
|
+
`--apply --yes`; a changed preview is refused. Retry the accepted revision to finish
|
|
197
|
+
an interrupted reset, or review and accept a fresh revision to replace a stale
|
|
198
|
+
reset intent. Later user changes and replacement credentials are not overwritten
|
|
199
|
+
by the old intent. Nonsecret settings are archived; token bytes never are.
|
|
200
|
+
|
|
201
|
+
Reset also clears individual on/off overrides and the active trophy display generation. It is not a deletion of uploaded learning records. See [corpus controls](corpus.md) and [learning discoveries](understand.md).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Sessions, storage, and verification
|
|
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
|
+
**Library → selection and edits → immutable snapshot → configured session**
|
|
6
|
+
|
|
7
|
+
## Corpus ownership
|
|
8
|
+
|
|
9
|
+
Single source of truth for the instructions and scoped guides supplied to activated
|
|
10
|
+
Claude Code or Codex CLI sessions, or explicitly chosen Codex app tasks. Edit once;
|
|
11
|
+
the private corpus compiler projects the selected content through the chosen delivery route.
|
|
12
|
+
|
|
13
|
+
A deployable instruction corpus for coding agents, plus the CLI that
|
|
14
|
+
installs, verifies, and evolves it. The npm package ships the corpus; `install.sh` is both the
|
|
15
|
+
`agent-bios` CLI entry and the deployer.
|
|
16
|
+
|
|
17
|
+
## Authored layers
|
|
18
|
+
|
|
19
|
+
Two authored layers:
|
|
20
|
+
|
|
21
|
+
- **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.
|
|
22
|
+
- **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.
|
|
23
|
+
|
|
24
|
+
## Activation and Vanilla
|
|
25
|
+
|
|
26
|
+
The private install does not replace the `codex` or `claude` shell commands by default. Run
|
|
27
|
+
`agent-launch claude` or `agent-launch codex` explicitly to open the preflight, or pass `--preset NAME HOST` for a
|
|
28
|
+
configured non-interactive launch. Software Engineer / Vanilla structurally projects
|
|
29
|
+
no agent-bios snapshot, launch contract, tier binding, or permission flag. After a
|
|
30
|
+
fresh private install—or after an explicit legacy migration—the native CLI therefore
|
|
31
|
+
receives no automatic agent-bios content; the user's own native global and project
|
|
32
|
+
instructions still follow the host's normal loading rules. `--resume-session ID`
|
|
33
|
+
loads the recorded host/session pin rather than resolving current defaults.
|
|
34
|
+
|
|
35
|
+
Per-item on/off overrides take precedence over default-mode launch-domain selection.
|
|
36
|
+
No-corpus mode emits no corpus. Explicit selected mode keeps inclusion within its
|
|
37
|
+
targets; disabled items stay excluded and unrelated enabled overrides do not leak in.
|
|
38
|
+
Imported items also respect their host/project scope. See [corpus selection](corpus.md#manage-the-library). Existing host globals are loaded by default; [selective exclusion](advanced-launch.md#global-instruction-files) is a separate host-specific option.
|
|
39
|
+
|
|
40
|
+
## Codex app tasks
|
|
41
|
+
|
|
42
|
+
App tasks have an explicit [use/off workflow](setup.md#use-corpus-in-a-codex-app-task).
|
|
43
|
+
Use returns a selected snapshot through the tool/context path and records a
|
|
44
|
+
`returned-as-context` receipt separately from native CLI pins. Stored registration
|
|
45
|
+
and returned text do not prove native app discovery or model reading. Off stops
|
|
46
|
+
further managed use, but cannot retract earlier context; a new task is needed for
|
|
47
|
+
clean exclusion. Management and instruction capture do not activate task context.
|
|
48
|
+
|
|
49
|
+
## Storage layout
|
|
50
|
+
|
|
51
|
+
From a clone, `bash install.sh install` is the same default path. The release lives
|
|
52
|
+
under `~/.local/share/agent-bios/runtime/releases/`; baseline tuples and transaction
|
|
53
|
+
journals live under that runtime root, immutable snapshots and pins under
|
|
54
|
+
`~/.local/share/agent-bios/sessions/`, and user packages, overlays, tombstones,
|
|
55
|
+
learnings, history, and trash under `~/.config/agent-bios/corpus/`. The corresponding
|
|
56
|
+
`AGENT_BIOS_STATE_DIR` and `AGENT_BIOS_CORPUS_DIR` environment variables relocate
|
|
57
|
+
those private roots; `AGENT_LAUNCH_VENV` relocates the managed dependency environment.
|
|
58
|
+
The UI entrypoints use their verified process-temporary bundle without
|
|
59
|
+
requiring a preinstalled Textual runtime.
|
|
60
|
+
The owned `agent-launch` entrypoint exports `AGENT_BIOS_PRIVATE_CORPUS=1` and the
|
|
61
|
+
immutable `AGENT_BIOS_PACKAGE_ROOT`; the launcher also recognizes the private install
|
|
62
|
+
record when the explicit marker is absent. These select the private runtime and do not
|
|
63
|
+
claim that any host session has loaded a snapshot.
|
|
64
|
+
|
|
65
|
+
## Verification and limits
|
|
66
|
+
|
|
67
|
+
`agent-bios verify` checks the recorded immutable release file-by-file, reloads a
|
|
68
|
+
non-empty catalog from that release, matches the store's last successful baseline to
|
|
69
|
+
the install record, and verifies the owned launcher/profile/status projections. Its
|
|
70
|
+
result says `activation: unverified`: neither stored bytes nor a dry-run argv proves a
|
|
71
|
+
host loaded the snapshot.
|
|
72
|
+
|
|
73
|
+
Corpus selection seeds future activated sessions, not plain CLI/Vanilla. A one-off
|
|
74
|
+
`--corpus-domains` selection applies only to that launch. The store composes an
|
|
75
|
+
immutable `ContentRef`; Codex startup preserves the effective native developer
|
|
76
|
+
instructions, injects the private corpus and dynamic launch contract, creates and
|
|
77
|
+
reads back a durable host thread, then records its pin. Claude uses the per-call
|
|
78
|
+
append and requested session id and records a pin only after observing that id in the
|
|
79
|
+
native session log. Real-host probes cover Codex and Claude first-turn delivery,
|
|
80
|
+
including corpus propagation to a launcher-generated Claude workhorse. Claude
|
|
81
|
+
resume restores the pin's exact environment provenance rather than changing an unset
|
|
82
|
+
config-home variable into an explicit default. Post-fix authenticated resume remains
|
|
83
|
+
unverified. Snapshot pin integrity alone does
|
|
84
|
+
not establish that a resumed model request succeeded.
|
|
85
|
+
|
|
86
|
+
The native Claude plugin bootstrap has advertised selected plugin roots and
|
|
87
|
+
qualified corpus agents. An edited corpus `SessionStart` hook ran automatically
|
|
88
|
+
through its generated plugin. Codex 0.153.4 discovery retains user, project and session
|
|
89
|
+
hooks alongside the selected corpus. A real-host test with a local transport verifies
|
|
90
|
+
that a generated `SessionStart` hook runs and injects context after its exact definition
|
|
91
|
+
is trusted; the untrusted control does neither. This test uses no external model.
|
|
92
|
+
Authenticated corpus-agent execution and native skill-menu registration remain
|
|
93
|
+
unverified; they are separate from hook delivery and launcher-tier child evidence.
|
|
94
|
+
|
|
95
|
+
Pins preserve environment provenance rather than reconstructing it: the host's
|
|
96
|
+
config-home variable, and `HOME` when needed for default lookup, retain their
|
|
97
|
+
recorded unset, set, or explicitly empty state. A relative native home is resolved
|
|
98
|
+
from the recorded canonical cwd. Pins lacking that context fail explicitly at resume;
|
|
99
|
+
it is never inferred from the caller's environment.
|
|
100
|
+
|
|
101
|
+
Named native Codex profiles (`--profile` / `-p`) are not supported for private
|
|
102
|
+
activation by the verified 0.153.4 adapter: that host exposes profiles on runtime
|
|
103
|
+
commands but not its effective-config app-server surface. The launcher refuses
|
|
104
|
+
this combination before creating a session rather than substituting base settings.
|
|
105
|
+
Plain CLI/Vanilla profile use is unchanged. Activated private Codex sessions also
|
|
106
|
+
refuse native `--cd`/`-C` cwd overrides before delivery; change to the target project
|
|
107
|
+
first so snapshot scope and native execution agree. Ordinary CLI/Vanilla forwarding
|
|
108
|
+
keeps its native behavior.
|
|
109
|
+
|
|
110
|
+
Snapshots outside no-corpus mode retain the immutable private management bootstrap
|
|
111
|
+
and put its exact path in the injected startup text, so `$agent-bios` has private
|
|
112
|
+
procedure access even without native skill discovery. Selected requested procedures are exposed the same
|
|
113
|
+
way. This is not a claim that either host registered them in its native skill menu;
|
|
114
|
+
native skill registration remains unverified.
|
|
115
|
+
|
|
116
|
+
## Scope
|
|
117
|
+
|
|
118
|
+
The repository and npm package contain corpus sources and private runtime machinery,
|
|
119
|
+
not a user's authoring state, learning events, snapshots, pins, activation journals,
|
|
120
|
+
credentials, native settings, or generated temporary files.
|
package/docs/setup.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Setup, app connection, and personal instructions
|
|
2
|
+
|
|
3
|
+
[← Overview](../README.md) · [Corpus](corpus.md) · [Sessions](session-model.md) · [Recovery](recovery.md)
|
|
4
|
+
|
|
5
|
+
Install `agent-bios@0.19.0` through the [README quick start](../README.md#quick-start)
|
|
6
|
+
to use the guided installer, conversation setup, app bridge and instruction import.
|
|
7
|
+
Commands below use the installed `agent-bios` CLI. From a source checkout, run
|
|
8
|
+
`bash install.sh <command>` at its root instead.
|
|
9
|
+
|
|
10
|
+
## Choose where to start
|
|
11
|
+
|
|
12
|
+
| Route | Requirements | Interface |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Codex app | A local task with command/file access on the intended machine, Bash, Python 3.11+ | Questions and effect review in the conversation; no extra Codex CLI or model login |
|
|
15
|
+
| Terminal | macOS or Linux, Bash, Python 3.11+, an input/output terminal; Node.js 18+/npm for package installation | Included Textual wizard |
|
|
16
|
+
| Automation | Bash, Python 3.11+, explicit machine commands | JSON inspection, review and results |
|
|
17
|
+
|
|
18
|
+
Host CLIs and their authentication are needed when you choose to launch them.
|
|
19
|
+
Node/npm are needed to obtain the npm package and for any selected capability that
|
|
20
|
+
uses them. Source acquisition through the app does not require npm. The app and
|
|
21
|
+
storage routes do not require every host CLI. Full versions,
|
|
22
|
+
purposes and provisioning boundaries are in [Dependencies](../DEPENDENCIES.md).
|
|
23
|
+
|
|
24
|
+
For first installation in the app, use the one-line request in the README. The
|
|
25
|
+
agent follows [INSTALL.md](../INSTALL.md), asks for English, 한국어 or 日本語, and
|
|
26
|
+
obtains one fixed source revision. It handles the local paths. Downloads and
|
|
27
|
+
retained acquisition artifacts are disclosed before setup Apply. If that revision
|
|
28
|
+
lacks the required setup files, the agent reports this instead of invoking an
|
|
29
|
+
older installation mode.
|
|
30
|
+
|
|
31
|
+
## Guided terminal installation
|
|
32
|
+
|
|
33
|
+
Install the exact package version, then start setup:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g agent-bios@0.19.0
|
|
37
|
+
agent-bios install
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For the source alternative, obtain the repository through its Code menu and run
|
|
41
|
+
`bash install.sh install` at its root.
|
|
42
|
+
|
|
43
|
+
`install` and `onboard` open the wizard by default. After the language choice,
|
|
44
|
+
four stages collect the choices:
|
|
45
|
+
|
|
46
|
+
1. **Corpus:** no active corpus, all available corpus, selected packages/domains,
|
|
47
|
+
or saved policy on an existing installation. App registration is optional.
|
|
48
|
+
2. **Personal instructions:** optionally add project folders and select detected
|
|
49
|
+
global/project instruction files for capture. This is independent of corpus use.
|
|
50
|
+
3. **Dependencies:** inspect the full inventory and select supported installation
|
|
51
|
+
recipes. Leaving them unselected installs none.
|
|
52
|
+
4. **Review:** inspect the effects and, when useful, expand exact commands and
|
|
53
|
+
paths before Apply.
|
|
54
|
+
|
|
55
|
+
The fresh wizard starts with no active corpus. Reinstalling keeps saved choices
|
|
56
|
+
unless you change them. No active corpus retains the library privately but delivers
|
|
57
|
+
no corpus instruction text or management bootstrap. Explicit selected mode includes
|
|
58
|
+
only its targets within applicable host/project scope; it does not add unrelated
|
|
59
|
+
enabled items or implicit core content.
|
|
60
|
+
|
|
61
|
+
The installer, launcher and Corpus Studio use a verified UI bundle without downloading or installing
|
|
62
|
+
Textual. Its extraction is temporary and removed on exit. Missing or damaged
|
|
63
|
+
bundled UI fails explicitly. Language changes presentation, not corpus text,
|
|
64
|
+
identifiers or host settings.
|
|
65
|
+
|
|
66
|
+
Back preserves your choices. Cancelling before Apply performs no planned setup
|
|
67
|
+
effects. During Apply, cancellation requests a stop at an execution boundary;
|
|
68
|
+
completed package installations remain and are reported. A dependency, runtime,
|
|
69
|
+
app-registration or capture failure can leave completed effects. Review the result
|
|
70
|
+
before retrying rather than assuming everything rolled back.
|
|
71
|
+
|
|
72
|
+
Selection flags seed the wizard; they do not skip it:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
agent-bios install --corpus none
|
|
76
|
+
agent-bios install --corpus selected --select '@agent-bios/core/builder-base'
|
|
77
|
+
agent-bios install --dry-run
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`--dry-run` permits review but no Apply. A non-TTY caller must explicitly use a
|
|
81
|
+
machine route. Direct storage-only examples are:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
agent-bios install --non-interactive --corpus none
|
|
85
|
+
agent-bios install --non-interactive --corpus all
|
|
86
|
+
agent-bios install --non-interactive --corpus selected --select '@agent-bios/core/builder-base'
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Those direct commands do not collect dependency, app or import choices. Use the
|
|
90
|
+
shared conversation protocol below for a complete machine setup plan. The legacy
|
|
91
|
+
`--domains` flag requires `--non-interactive` and retains its implicit core/infra
|
|
92
|
+
meaning; `--domains none` is different from `--corpus none`.
|
|
93
|
+
|
|
94
|
+
## Setup through conversation or automation
|
|
95
|
+
|
|
96
|
+
The app asks questions and displays the review using its available controls. It
|
|
97
|
+
does not require a custom settings panel or a terminal UI. The same controller
|
|
98
|
+
validates and executes terminal and conversation choices.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
agent-bios setup start
|
|
102
|
+
agent-bios setup inspect --language ko
|
|
103
|
+
agent-bios setup discover --project-root /absolute/project
|
|
104
|
+
agent-bios setup plan --language ko --input setup-choices.json > reviewed-setup.json
|
|
105
|
+
agent-bios setup apply --input reviewed-setup.json --review-id REVIEW_ID --yes
|
|
106
|
+
agent-bios setup status --review-id REVIEW_ID
|
|
107
|
+
agent-bios setup resume --review-id REVIEW_ID
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`start` returns the supported languages, execution target and guide without
|
|
111
|
+
dependency probes or private setup writes. Choose the language before `inspect`.
|
|
112
|
+
The agent produces the six choice fields from your answers and saves the entire
|
|
113
|
+
engine-issued review. It shows the selected commands, destinations, corpus policy,
|
|
114
|
+
app change and capture sources before applying authorized effects. The engine
|
|
115
|
+
rejects a changed source, environment, plan or state; `--yes` alone is not evidence
|
|
116
|
+
that the effects were reviewed.
|
|
117
|
+
|
|
118
|
+
Status and resume are read-only. An old completed receipt describes that attempt;
|
|
119
|
+
current runtime/helper readiness is reported separately. A running operation can
|
|
120
|
+
defer readiness checks and return null fields while still showing recorded progress.
|
|
121
|
+
Resume returns a fresh nested review only when remaining effects can be determined;
|
|
122
|
+
it does not replay uncertain operations. The agent follows the full procedure in
|
|
123
|
+
[START.md](../compose/setup/START.md), including exact review preservation and verified
|
|
124
|
+
entrypoint handoff. Source and reviewed artifacts remain available for recovery.
|
|
125
|
+
|
|
126
|
+
## Use corpus in a Codex app task
|
|
127
|
+
|
|
128
|
+
Choose app registration during setup, or explicitly run:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
agent-bios app register --dry-run
|
|
132
|
+
agent-bios app register
|
|
133
|
+
agent-bios app status --json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Registration creates the owned `~/.agents/skills/agent-bios` discovery link to a
|
|
137
|
+
private immutable helper. Implicit invocation is disabled. An unrelated or edited
|
|
138
|
+
entry is preserved. Registration on disk does not prove the app discovered it;
|
|
139
|
+
setup can return a usable helper path to continue before discovery refreshes.
|
|
140
|
+
|
|
141
|
+
Once discovered, use `$agent-bios` in the chosen task. Ask it to manage the library,
|
|
142
|
+
change setup, show task status, or explicitly use selected corpus in this task.
|
|
143
|
+
A setup or management request does not activate content. Each task starts with
|
|
144
|
+
managed delivery off and requires its own explicit use.
|
|
145
|
+
|
|
146
|
+
Use previews a `ContentRef` and then returns the exact snapshot's
|
|
147
|
+
`instruction_text` through the task's tool/context path. The receipt says
|
|
148
|
+
`returned-as-context`; it proves neither native startup injection nor model reading.
|
|
149
|
+
Session operations require the real task ID, normally `CODEX_THREAD_ID`. Setup and
|
|
150
|
+
management do not require that ID. App use enables no hooks, agents or permissions.
|
|
151
|
+
|
|
152
|
+
Ask `$agent-bios` to turn corpus delivery off to stop consulting it in subsequent
|
|
153
|
+
work. Text already returned cannot be erased; a fresh task is needed for clean
|
|
154
|
+
exclusion. A resumed or forked conversation can carry earlier content independently
|
|
155
|
+
of the new task's receipt. Native global/project instructions still follow host rules.
|
|
156
|
+
|
|
157
|
+
`agent-bios app unregister` removes only the owned discovery link. It does not erase
|
|
158
|
+
prior task context or personal corpus data. Corpus Studio can also run in the app's
|
|
159
|
+
integrated terminal; editing it changes future snapshots, not current task context.
|
|
160
|
+
|
|
161
|
+
## Import existing instructions
|
|
162
|
+
|
|
163
|
+
Setup can capture selected native global/project files for later model review.
|
|
164
|
+
You can also use the explicit import workflow:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
agent-bios import discover --project /absolute/project --json
|
|
168
|
+
agent-bios import capture --project /absolute/project --path /absolute/project/AGENTS.md --json
|
|
169
|
+
agent-bios import prompt CAPTURE_ID
|
|
170
|
+
agent-bios import plan --input reviewed-import.json --json
|
|
171
|
+
agent-bios import apply PLAN_ID --expected-revision REV --json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Discovery checks known global locations and fixed filenames in chosen project
|
|
175
|
+
roots. It does not crawl the home directory or follow instruction references.
|
|
176
|
+
Capture preserves originals and stores redacted evidence with source digests
|
|
177
|
+
privately. It is pending review, not an automatically optimized personal corpus.
|
|
178
|
+
|
|
179
|
+
In an app task, ask `$agent-bios` to review the returned capture ID. The agent
|
|
180
|
+
proposes content, `always`/`relevant`/`requested` placement, rationale, and source-line
|
|
181
|
+
coverage or exclusions. The runtime checks the evidence and structure, and Apply
|
|
182
|
+
requires the reviewed revision. Changed originals or conflicting edits require
|
|
183
|
+
fresh review. Project-scoped imports remain limited to their recorded root and
|
|
184
|
+
applicable hosts, even when all corpus or an enable override is selected.
|
|
185
|
+
|
|
186
|
+
Native hosts may still read the untouched originals. Importing a procedure as
|
|
187
|
+
requested content does not suppress the same rule in a native file, and changing
|
|
188
|
+
placement is not a guarantee of optimal model behavior. Review duplication and
|
|
189
|
+
tradeoffs as part of the proposal. Installation, capture, import and task activation
|
|
190
|
+
have separate outcomes; the result tells you which actually completed.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Understand why the corpus works this way
|
|
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
|
+
Understand! is learning for the person using the corpus, not model training. It explores reasons and limits through a conversation rather than asking you to memorize files.
|
|
6
|
+
|
|
7
|
+
## Start a learning session
|
|
8
|
+
|
|
9
|
+
Choose **Understand!** in the root TUI, or run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
agent-bios understand list
|
|
13
|
+
agent-bios understand show core-purpose
|
|
14
|
+
agent-launch --understand core-purpose claude # or codex
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The selection is a coherent bundle, not an individual file: core groups cover goals
|
|
18
|
+
and scope, decision support, adaptation, evidence/safety, and retained learning;
|
|
19
|
+
domain and personal bundles come from the effective corpus. A session freezes its
|
|
20
|
+
selected source references and edited content. The tutor explains the purpose,
|
|
21
|
+
background, mechanisms, tradeoffs, and limits, distinguishing documented rationale
|
|
22
|
+
from inference. Each active learning turn ends with one goal-relevant question and
|
|
23
|
+
waits for the user. Incidental ambiguity does not force a detour; pause and stop
|
|
24
|
+
requests end the questioning. `understand!` also works through the shared skill in
|
|
25
|
+
an activated session. Learning excerpts are data, not permission to run their commands.
|
|
26
|
+
|
|
27
|
+
A meaningful flaw or alternative first introduced by the user can unlock a persistent
|
|
28
|
+
pixel trophy. Tutor-originated ideas, leading hints, and echoes do not qualify. The
|
|
29
|
+
discovery flow binds the native human session, checks recorded turn provenance and
|
|
30
|
+
ordering, and asks for a later exact save confirmation. Unsupported provenance leaves
|
|
31
|
+
the award pending, without blocking learning. Significance and semantic originality
|
|
32
|
+
remain explicit tutor/user judgments; transcript validation does not prove them or
|
|
33
|
+
authenticate against an owner who can edit local files. Only a successfully saved
|
|
34
|
+
requested-only personal corpus note can unlock the trophy. The CLI prints it, and the
|
|
35
|
+
TUI shows it when there is room. Retries do not duplicate the note; updates and note
|
|
36
|
+
deletion retain the trophy. Full reset archives the active unlock generation and clears
|
|
37
|
+
the display; older discovery records cannot reactivate it. Native global files and
|
|
38
|
+
corpus source rules are not rewritten by learning.
|
|
39
|
+
|
|
40
|
+
Turning an item off for ordinary activated sessions does not remove it from the learning library. On/off preferences and the inventory read revision are not learning content, so they do not repin otherwise unchanged learning bundles.
|