agent-bios 0.19.3 → 0.20.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 +62 -20
- package/INSTALL.md +1 -1
- package/README.md +16 -21
- package/claude/agents/frontier.md +1 -1
- package/claude/agents/sweep.md +2 -1
- package/claude/agents/workhorse.md +2 -2
- package/claude/guides/claude-prompting.md +494 -167
- package/claude/guides/cli-multi-model-workflow.md +8 -7
- package/claude/guides/gpt-prompting.md +241 -111
- package/claude/guides/session-distill-workflow.md +93 -43
- package/claude/guides/tooling-gotchas.md +3 -1
- package/codex/agents/reviewer.toml +2 -2
- package/codex/agents/sweep.toml +1 -1
- package/codex/agents/workhorse.toml +2 -2
- package/codex/guides/claude-prompting.md +494 -167
- package/codex/guides/cli-multi-model-workflow.md +8 -7
- package/codex/guides/gpt-prompting.md +241 -111
- package/codex/guides/session-distill-workflow.md +93 -43
- package/codex/guides/tooling-gotchas.md +3 -1
- package/compose/assemble.py +4 -1
- package/compose/canary.sh +8 -6
- package/compose/host_platform.py +158 -15
- package/compose/instructions-state.py +183 -41
- package/compose/instructions_app.py +2 -2
- package/compose/instructions_install.py +222 -27
- package/compose/instructions_session.py +250 -75
- package/compose/instructions_setup.py +6 -6
- package/compose/instructions_setup_cli.py +2 -36
- package/compose/instructions_setup_i18n.py +3 -3
- package/compose/instructions_store.py +160 -3
- package/compose/instructions_transaction.py +29 -5
- package/compose/instructions_ui_runtime.py +2 -2
- package/compose/setup/START.md +1 -1
- package/docs/advanced-launch.md +4 -0
- package/docs/releases/0.19.4.md +99 -0
- package/docs/releases/0.20.0.md +102 -0
- package/docs/setup.md +4 -4
- package/install.sh +54 -20
- package/launch/agent-launch.py +171 -22
- package/launch/agent-launch.toml +64 -29
- package/launch/agent-launch.zsh +104 -13
- package/launch/claude_subcommands.py +179 -0
- package/launch/provision-venv.sh +1 -1
- package/launch/shell_integration.py +7 -1
- package/learn/collect-learning.py +60 -9
- package/learn/migrate-learnings.py +70 -4
- package/learn/redact.py +2 -1
- package/package.json +37 -4
- package/provenance.json +1 -1
- package/session-cost.py +141 -18
- package/session-distill/coverage.json +6 -0
- package/session-distill/distill.py +2575 -0
- package/session-distill/grammar/__init__.py +0 -0
- package/session-distill/grammar/owner_lines.py +874 -0
- package/session-distill/originators.json +9 -0
- package/session-distill/packets/cross_review.md +31 -0
- package/session-distill/packets/form.md +86 -0
- package/session-distill/packets/judge.md +81 -0
- package/session-distill/packets/placement_contract.md +90 -0
- package/session-distill/packets/propose.md +124 -0
- package/session-distill/packets/read.md +57 -0
- package/session-distill/packets/reconsider.md +53 -0
- package/session-distill/packets/s7b.md +65 -0
- package/session-distill/packets/s9b.md +39 -0
- package/session-distill/packets/stitch.md +35 -0
- package/session-distill/packets/sweep.md +33 -0
- package/session-distill/runlib/__init__.py +0 -0
- package/session-distill/runlib/bound.py +1102 -0
- package/session-distill/runlib/breaker.py +467 -0
- package/session-distill/runlib/census.py +2347 -0
- package/session-distill/runlib/claims.py +420 -0
- package/session-distill/runlib/controls.py +902 -0
- package/session-distill/runlib/coverage.py +881 -0
- package/session-distill/runlib/declare.py +888 -0
- package/session-distill/runlib/delivery_evidence.py +1145 -0
- package/session-distill/runlib/derive.py +812 -0
- package/session-distill/runlib/destinations.py +3072 -0
- package/session-distill/runlib/dispatch.py +7939 -0
- package/session-distill/runlib/drift.py +1077 -0
- package/session-distill/runlib/entry.py +401 -0
- package/session-distill/runlib/evidence.py +890 -0
- package/session-distill/runlib/exposure.py +1162 -0
- package/session-distill/runlib/gate.py +2727 -0
- package/session-distill/runlib/gitread.py +79 -0
- package/session-distill/runlib/inventory.py +19624 -0
- package/session-distill/runlib/journal.py +1919 -0
- package/session-distill/runlib/ledger.py +3210 -0
- package/session-distill/runlib/ledger_compat.py +101 -0
- package/session-distill/runlib/ledger_migration.py +190 -0
- package/session-distill/runlib/lifecycle_intake.py +693 -0
- package/session-distill/runlib/lineage.py +454 -0
- package/session-distill/runlib/measures.py +249 -0
- package/session-distill/runlib/monitor.py +1180 -0
- package/session-distill/runlib/operations.py +522 -0
- package/session-distill/runlib/packet.py +838 -0
- package/session-distill/runlib/placement.py +1769 -0
- package/session-distill/runlib/projection.py +4090 -0
- package/session-distill/runlib/ranking.py +740 -0
- package/session-distill/runlib/receipts.py +200 -0
- package/session-distill/runlib/records.py +1965 -0
- package/session-distill/runlib/search.py +249 -0
- package/session-distill/runlib/sequencing.py +829 -0
- package/session-distill/runlib/sources.py +641 -0
- package/session-distill/runlib/stage_adjudicate.py +845 -0
- package/session-distill/runlib/stage_apply.py +1378 -0
- package/session-distill/runlib/stage_approvals.py +758 -0
- package/session-distill/runlib/stage_close.py +1220 -0
- package/session-distill/runlib/stage_confirm.py +929 -0
- package/session-distill/runlib/stage_delivery.py +3080 -0
- package/session-distill/runlib/stage_form.py +2576 -0
- package/session-distill/runlib/stage_judge.py +4248 -0
- package/session-distill/runlib/stage_propose.py +3307 -0
- package/session-distill/runlib/stage_read.py +5179 -0
- package/session-distill/runlib/stage_render.py +2739 -0
- package/session-distill/runlib/stage_retrieve.py +924 -0
- package/session-distill/runlib/stage_review_korean.py +1002 -0
- package/session-distill/runlib/stage_review_proposals.py +1292 -0
- package/session-distill/runlib/stagelock.py +412 -0
- package/session-distill/runlib/stop.py +1061 -0
- package/session-distill/runlib/targets.py +809 -0
- package/session-distill/runlib/usage.py +280 -0
- package/session-distill/runlib/validate.py +319 -0
- package/session-distill/runlib/views.py +4327 -0
- package/session-distill/schemas/adjudication.schema.json +35 -0
- package/session-distill/schemas/approval.schema.json +35 -0
- package/session-distill/schemas/census.schema.json +128 -0
- package/session-distill/schemas/checks.schema.json +207 -0
- package/session-distill/schemas/claim.schema.json +16 -0
- package/session-distill/schemas/confirmation.schema.json +24 -0
- package/session-distill/schemas/coverage.schema.json +66 -0
- package/session-distill/schemas/cross_review.schema.json +24 -0
- package/session-distill/schemas/event.schema.json +20 -0
- package/session-distill/schemas/evidence.schema.json +20 -0
- package/session-distill/schemas/expected_observation.schema.json +18 -0
- package/session-distill/schemas/form.schema.json +103 -0
- package/session-distill/schemas/intake.schema.json +71 -0
- package/session-distill/schemas/inventory.schema.json +872 -0
- package/session-distill/schemas/judge.schema.json +77 -0
- package/session-distill/schemas/ledger.schema.json +313 -0
- package/session-distill/schemas/observation.schema.json +16 -0
- package/session-distill/schemas/propose.schema.json +555 -0
- package/session-distill/schemas/read.schema.json +76 -0
- package/session-distill/schemas/reconsider.schema.json +122 -0
- package/session-distill/schemas/run.schema.json +150 -0
- package/session-distill/schemas/s7b.schema.json +200 -0
- package/session-distill/schemas/s9b.schema.json +28 -0
- package/session-distill/schemas/stitch.schema.json +25 -0
- package/session-distill/schemas/sweep.schema.json +25 -0
- package/session-distill/seats.json +149 -0
- package/session-distill/tables/allowed_pairs.json +257 -0
- package/session-distill/tables/controls.json +30 -0
- package/session-distill/tables/delivery_evidence.json +36 -0
- package/session-distill/tables/delivery_evidence_fixtures.json +731 -0
- package/session-distill/tables/destinations.json +684 -0
- package/session-distill/tables/drift_layers.json +68 -0
- package/session-distill/tables/exposure_rules.json +192 -0
- package/session-distill/tables/placement_rules.json +148 -0
- package/session-distill/tables/propose_fixtures.json +154 -0
- package/session-distill/tables/ranking.json +194 -0
- package/session-distill/tables/redundancy.json +10 -0
- package/session-distill/tables/structural_rules.json +44 -0
- package/session-distill/tables/transition_fixtures.json +398 -0
- package/session-distill/tables/transitions.json +69 -0
- package/session-distill/tables/unit_outcome.json +67 -0
- package/session-distill/tables/unit_outcome_fixtures.json +2364 -0
- package/wrappers/claude-run.sh +481 -33
- package/wrappers/claude_hermetic_evidence.py +1423 -0
- package/wrappers/codex-helm.sh +44 -13
- package/wrappers/codex-run.sh +183 -20
- package/wrappers/codex_frame_filter.py +1199 -0
- package/wrappers/codex_protocol.py +737 -0
- package/wrappers/jsonl_lines.py +65 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Reading one side of a commit, once.
|
|
3
|
+
|
|
4
|
+
The driver's ledger check compares the ledger in the index with the ledger at a base revision, and
|
|
5
|
+
`gates/check-global-file.py` compares the global instruction file the same way. Both need the same
|
|
6
|
+
three answers from git — the bytes of a blob, the bytes at a revision, the bytes the index or the
|
|
7
|
+
working tree holds — and both need the same distinction, which is the reason this is one module and
|
|
8
|
+
not two copies:
|
|
9
|
+
|
|
10
|
+
* **absent** is a measurement. A revision that does not hold the path, or an index that does not,
|
|
11
|
+
measures as empty, because a deletion is a reduction rather than an unknown.
|
|
12
|
+
* **None** is no measurement at all. Git could not resolve the revision, could not read the tree, or
|
|
13
|
+
the disk refused the file. A caller may not treat it as empty.
|
|
14
|
+
|
|
15
|
+
It lives in the driver, which ships, and the author-side gate imports it from here. The direction is
|
|
16
|
+
fixed by AGENTS.md: author-side imports shipped, never the reverse. Before this module the driver
|
|
17
|
+
loaded the gate's file by path (`importlib` over `gates/check-global-file.py`), which made shipped
|
|
18
|
+
code depend on a tree a packaged user does not have.
|
|
19
|
+
|
|
20
|
+
Nothing here reads a path of its own choosing: every call names its repository and its relative path,
|
|
21
|
+
so one function serves a ledger under a state root and a file inside a checkout alike.
|
|
22
|
+
"""
|
|
23
|
+
import pathlib
|
|
24
|
+
import subprocess
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def git_blob(repo, spec):
|
|
28
|
+
"""The bytes of `REV:path` (or `:path`, the index), or None when git cannot read it."""
|
|
29
|
+
done = subprocess.run(["git", "-C", str(repo), "cat-file", "blob", spec],
|
|
30
|
+
capture_output=True)
|
|
31
|
+
return done.stdout if done.returncode == 0 else None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def base_blob(repo, base, rel):
|
|
35
|
+
"""(bytes, absent) for `rel` at `base`. A revision that lacks the path is absent and
|
|
36
|
+
measures as empty. Bytes are None only when git cannot resolve the revision or read the
|
|
37
|
+
tree, which is no measurement at all."""
|
|
38
|
+
resolved = subprocess.run(["git", "-C", str(repo), "rev-parse", "--verify", "--quiet",
|
|
39
|
+
f"{base}^{{commit}}"], capture_output=True)
|
|
40
|
+
if resolved.returncode != 0:
|
|
41
|
+
return None, False
|
|
42
|
+
listing = subprocess.run(["git", "-C", str(repo), "ls-tree", "--full-tree", "-z",
|
|
43
|
+
resolved.stdout.strip().decode(), "--", rel], capture_output=True)
|
|
44
|
+
if listing.returncode != 0:
|
|
45
|
+
return None, False
|
|
46
|
+
entries = [e for e in listing.stdout.split(b"\0") if e]
|
|
47
|
+
if not entries:
|
|
48
|
+
return b"", True
|
|
49
|
+
mode, kind, oid = entries[0].split(b"\t", 1)[0].split(b" ")
|
|
50
|
+
return (git_blob(repo, oid.decode()) if kind == b"blob" else None), False
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def current_blob(repo, rel, worktree):
|
|
54
|
+
"""(bytes, absent). A path the index (or disk) lacks is absent and measures as empty — a
|
|
55
|
+
deletion is a reduction. Bytes are None only when git or the disk cannot answer, which
|
|
56
|
+
is no measurement at all."""
|
|
57
|
+
if worktree:
|
|
58
|
+
try:
|
|
59
|
+
return (pathlib.Path(repo) / rel).read_bytes(), False
|
|
60
|
+
except FileNotFoundError:
|
|
61
|
+
return b"", True
|
|
62
|
+
except OSError:
|
|
63
|
+
return None, False
|
|
64
|
+
listing = subprocess.run(["git", "-C", str(repo), "ls-files", "--stage", "-z", "--", rel],
|
|
65
|
+
capture_output=True)
|
|
66
|
+
if listing.returncode != 0:
|
|
67
|
+
return None, False
|
|
68
|
+
entries = [e for e in listing.stdout.split(b"\0") if e]
|
|
69
|
+
if not entries:
|
|
70
|
+
return b"", True
|
|
71
|
+
if any(e.split(b"\t", 1)[0].split(b" ")[2] != b"0" for e in entries):
|
|
72
|
+
return None, False
|
|
73
|
+
return git_blob(repo, f":{rel}"), False
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def lines_of(raw):
|
|
77
|
+
"""The lines of `raw`, without a trailing empty line for a file ending in a newline."""
|
|
78
|
+
text = raw.decode("utf-8", "replace").split("\n")
|
|
79
|
+
return text[:-1] if text[-1] == "" else text
|