agent-bios 0.4.0 → 0.5.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/claude/CLAUDE.md +4 -0
- package/claude/guides/learning-flow.md +106 -0
- package/codex/AGENTS.md +4 -0
- package/codex/guides/learning-flow.md +106 -0
- package/config/domains.json +150 -0
- package/config/learning.schema.json +104 -0
- package/package.json +5 -1
- package/scripts/check-learning.py +231 -0
- package/scripts/check-parity.sh +4 -0
- package/scripts/collect-learning.py +557 -0
package/claude/CLAUDE.md
CHANGED
|
@@ -147,3 +147,7 @@
|
|
|
147
147
|
|
|
148
148
|
- For the detailed `IMPLEMENTATION_MAP.html` construction rules and the SVG service-blueprint spec, read and use `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/implementation-map.md` as a scoped extension of this section.
|
|
149
149
|
- In repos with implementation code, when architecture, goals, or roadmap context would help future work, maintain `IMPLEMENTATION_MAP.html` as a current-state dashboard — not a changelog, handoff log, or project diary — and update it before committing, when writing a handoff, or after meaningful architecture, roadmap, risk, decision, or verification changes.
|
|
150
|
+
|
|
151
|
+
## Session Learning
|
|
152
|
+
|
|
153
|
+
- `learn!` — session learning: when the user enters `learn!` in ANY session, capture durable lessons from THIS session for their own next session and the org. Read `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/guides/learning-flow.md` and run its flow (admission bar → type A–G → intended consumption layer → the user's explicit approval), submitting approved learnings ONLY through `scripts/collect-learning.py`, which owns the id/timestamp and writes both the prose and the JSON record. When a Session distill preset run (trigger `distill!`) is active, that mission owns capture — do not also run this; and never manufacture Type-G principles user-side (curator-only).
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
guide_id: learning-flow
|
|
3
|
+
language: en
|
|
4
|
+
status: active
|
|
5
|
+
use_when:
|
|
6
|
+
- the user entered `learn!` in any session (this is the light capture flow)
|
|
7
|
+
- capturing a durable lesson from the current session for reuse + org curation
|
|
8
|
+
- deciding whether a candidate lesson is worth recording, and how it should apply
|
|
9
|
+
core_rules:
|
|
10
|
+
- three gates BEFORE asking the user — admission bar, type, consumption layer
|
|
11
|
+
- the user approves every recorded learning; nothing is written without it
|
|
12
|
+
- submit ONLY through scripts/collect-learning.py; never hand-write the record
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Session learning flow (`learn!`)
|
|
16
|
+
|
|
17
|
+
The **light**, per-user, single-session capture flow: turn a lesson from the
|
|
18
|
+
current session into a **learning** (prose + a JSON record) that (a) applies to
|
|
19
|
+
the user's own next session and (b) reaches the org for curation. This is the
|
|
20
|
+
counterpart of the **heavy** session-distill pipeline (`distill!`), which mines
|
|
21
|
+
many sessions and is curator/power-user only. Terms follow the agent-bios
|
|
22
|
+
`LEXICON.md`; the full routing framework is
|
|
23
|
+
`design/session-distill/PLACEMENT-FRAMEWORK.md` (agent-bios repo).
|
|
24
|
+
|
|
25
|
+
Defer to the preset mission: if this session runs the **Session distill** preset
|
|
26
|
+
(trigger `distill!`), that mission owns capture — do not also run this flow.
|
|
27
|
+
|
|
28
|
+
## When it fires
|
|
29
|
+
|
|
30
|
+
Only on the user's `learn!`. Runs in-conversation on the CURRENT session (no
|
|
31
|
+
Workflow fleets, no subagent mining). **Multiple learnings per invocation are
|
|
32
|
+
allowed** — walk each candidate through the gates independently.
|
|
33
|
+
|
|
34
|
+
## Rigor: three gates BEFORE surfacing anything
|
|
35
|
+
|
|
36
|
+
Establish all three for each candidate; drop candidates that fail. Only
|
|
37
|
+
still-valid candidates are surfaced for the user's approval.
|
|
38
|
+
|
|
39
|
+
1. **Admission bar** (promotion criteria — PLACEMENT-FRAMEWORK): the lesson
|
|
40
|
+
recurred across **≥2 independent sessions**, OR it is a **single event with
|
|
41
|
+
high materiality** (irreversible / verification-corrupting / security). A
|
|
42
|
+
one-off low-stakes observation does not meet the bar — say so and skip it.
|
|
43
|
+
|
|
44
|
+
2. **Type** (typology A–G; classify by root cause, first match wins):
|
|
45
|
+
- **A. Own-tooling defect** — a flaw in a script/tool we own (a repair).
|
|
46
|
+
- **B. Tool gotcha** — counterintuitive external-tool behavior with a
|
|
47
|
+
machine-detectable trigger (command pattern).
|
|
48
|
+
- **C. Recognition principle** — a cross-domain semantic signal → suspicion/action.
|
|
49
|
+
- **D. Domain procedure** — a multi-step method within an already-routed kind of work.
|
|
50
|
+
- **E. Environment fact** — a non-generalizable, decaying specific fact.
|
|
51
|
+
- **F. Unproven** — evidence still below the bar (usually already dropped at gate 1).
|
|
52
|
+
- **G. Principle/direction** — a value ordering shaping many decisions.
|
|
53
|
+
**Not manufactured user-side in v1** (curator-only); record a principle-ish
|
|
54
|
+
observation as an ordinary learning and let curation promote it.
|
|
55
|
+
Prefer *leftward reformulation* when it holds (E→C generalize a fact into a
|
|
56
|
+
principle; B/C/D→A mechanize knowledge into structure) — cheaper and more reliable.
|
|
57
|
+
|
|
58
|
+
3. **Intended consumption layer** (cheapest-that-still-fires wins):
|
|
59
|
+
**enforcement > gate > hook > guide > global > memory** (`incubator` = park
|
|
60
|
+
for later triage). This is recorded as **metadata only** — do NOT build the
|
|
61
|
+
hook/gate/enforcement here; mechanization is deferred to curation.
|
|
62
|
+
|
|
63
|
+
## Domain tagging (the curation join key)
|
|
64
|
+
|
|
65
|
+
Suggest a `domain` from the registered vocabulary in `config/domains.json`
|
|
66
|
+
(domain keys for domain-specific lessons, or a tier name like `core`/`infra`
|
|
67
|
+
for a genuinely cross-cutting lesson); the user **confirms**. If unsure, use
|
|
68
|
+
`unclassified` (never blocks capture — the curator assigns later). If no
|
|
69
|
+
registered domain fits, keep `domain: "unclassified"` and put the model's
|
|
70
|
+
suggested new name in `proposed_domain` (domain creation stays curator authority).
|
|
71
|
+
|
|
72
|
+
## User approval, then submit
|
|
73
|
+
|
|
74
|
+
Surface each surviving candidate compactly — lesson, type, intended layer,
|
|
75
|
+
admission-bar verdict, domain (+ proposed_domain) — and record ONLY what the
|
|
76
|
+
user explicitly approves.
|
|
77
|
+
|
|
78
|
+
Submit each approved learning through the deterministic submit tool. Pass your
|
|
79
|
+
session's `--host` and pipe the **semantic payload only** as one JSON object on
|
|
80
|
+
stdin (set the `supporting_sessions` tool prefix — `claude:` or `codex:` — to
|
|
81
|
+
match your host):
|
|
82
|
+
|
|
83
|
+
echo '{"lesson":"…","domain":"builder-base","supporting_sessions":["<tool>:<session-short-id>"],
|
|
84
|
+
"criteria":["recurrent_error"],
|
|
85
|
+
"classification":{"type":"B","layer":"hook","meets_bar":true}}' \
|
|
86
|
+
| python3 scripts/collect-learning.py --host <claude|codex>
|
|
87
|
+
|
|
88
|
+
The script (capability boundary) owns `learning_id` / `created` / `schema_version`,
|
|
89
|
+
validates against `config/learning.schema.json`, logs the JSON record, and writes
|
|
90
|
+
the lesson prose where THIS host loads it next session:
|
|
91
|
+
- **Claude**: appended to the automation-owned personal learnings file, pulled in
|
|
92
|
+
by the entry file's `@personal/learnings.md` import.
|
|
93
|
+
- **Codex**: appended into a managed `agent-bios:personal-learnings` region of
|
|
94
|
+
`AGENTS.md` (Codex has no import; AGENTS.md is always loaded), kept outside the
|
|
95
|
+
central markers so re-assembly preserves it.
|
|
96
|
+
|
|
97
|
+
**Never** hand-author `learning_id` / `created` / `schema_version`, and never
|
|
98
|
+
write those files directly. If the script REJECTS a record, fix the semantic
|
|
99
|
+
payload — do not work around the validation.
|
|
100
|
+
|
|
101
|
+
## Scope (v1)
|
|
102
|
+
|
|
103
|
+
- Single-session capture only; cross-session mining is `distill!` (curator).
|
|
104
|
+
- Mechanization (hook/gate/enforcement) is deferred to curation — record intent, don't build it.
|
|
105
|
+
- Type-G principle manufacture is curator-only.
|
|
106
|
+
- Transport (upload to the org) lands in Phase 2; Phase 1 writes locally.
|
package/codex/AGENTS.md
CHANGED
|
@@ -148,3 +148,7 @@
|
|
|
148
148
|
|
|
149
149
|
- For the detailed `IMPLEMENTATION_MAP.html` construction rules and the SVG service-blueprint spec, read and use `${CODEX_HOME:-$HOME/.codex}/guides/implementation-map.md` as a scoped extension of this section.
|
|
150
150
|
- In repos with implementation code, when architecture, goals, or roadmap context would help future work, maintain `IMPLEMENTATION_MAP.html` as a current-state dashboard — not a changelog, handoff log, or project diary — and update it before committing, when writing a handoff, or after meaningful architecture, roadmap, risk, decision, or verification changes.
|
|
151
|
+
|
|
152
|
+
## Session Learning
|
|
153
|
+
|
|
154
|
+
- `learn!` — session learning: when the user enters `learn!` in ANY session, capture durable lessons from THIS session for their own next session and the org. Read `${CODEX_HOME:-$HOME/.codex}/guides/learning-flow.md` and run its flow (admission bar → type A–G → intended consumption layer → the user's explicit approval), submitting approved learnings ONLY through `scripts/collect-learning.py`, which owns the id/timestamp and writes both the prose and the JSON record. When a Session distill preset run (trigger `distill!`) is active, that mission owns capture — do not also run this; and never manufacture Type-G principles user-side (curator-only).
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
guide_id: learning-flow
|
|
3
|
+
language: en
|
|
4
|
+
status: active
|
|
5
|
+
use_when:
|
|
6
|
+
- the user entered `learn!` in any session (this is the light capture flow)
|
|
7
|
+
- capturing a durable lesson from the current session for reuse + org curation
|
|
8
|
+
- deciding whether a candidate lesson is worth recording, and how it should apply
|
|
9
|
+
core_rules:
|
|
10
|
+
- three gates BEFORE asking the user — admission bar, type, consumption layer
|
|
11
|
+
- the user approves every recorded learning; nothing is written without it
|
|
12
|
+
- submit ONLY through scripts/collect-learning.py; never hand-write the record
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# Session learning flow (`learn!`)
|
|
16
|
+
|
|
17
|
+
The **light**, per-user, single-session capture flow: turn a lesson from the
|
|
18
|
+
current session into a **learning** (prose + a JSON record) that (a) applies to
|
|
19
|
+
the user's own next session and (b) reaches the org for curation. This is the
|
|
20
|
+
counterpart of the **heavy** session-distill pipeline (`distill!`), which mines
|
|
21
|
+
many sessions and is curator/power-user only. Terms follow the agent-bios
|
|
22
|
+
`LEXICON.md`; the full routing framework is
|
|
23
|
+
`design/session-distill/PLACEMENT-FRAMEWORK.md` (agent-bios repo).
|
|
24
|
+
|
|
25
|
+
Defer to the preset mission: if this session runs the **Session distill** preset
|
|
26
|
+
(trigger `distill!`), that mission owns capture — do not also run this flow.
|
|
27
|
+
|
|
28
|
+
## When it fires
|
|
29
|
+
|
|
30
|
+
Only on the user's `learn!`. Runs in-conversation on the CURRENT session (no
|
|
31
|
+
Workflow fleets, no subagent mining). **Multiple learnings per invocation are
|
|
32
|
+
allowed** — walk each candidate through the gates independently.
|
|
33
|
+
|
|
34
|
+
## Rigor: three gates BEFORE surfacing anything
|
|
35
|
+
|
|
36
|
+
Establish all three for each candidate; drop candidates that fail. Only
|
|
37
|
+
still-valid candidates are surfaced for the user's approval.
|
|
38
|
+
|
|
39
|
+
1. **Admission bar** (promotion criteria — PLACEMENT-FRAMEWORK): the lesson
|
|
40
|
+
recurred across **≥2 independent sessions**, OR it is a **single event with
|
|
41
|
+
high materiality** (irreversible / verification-corrupting / security). A
|
|
42
|
+
one-off low-stakes observation does not meet the bar — say so and skip it.
|
|
43
|
+
|
|
44
|
+
2. **Type** (typology A–G; classify by root cause, first match wins):
|
|
45
|
+
- **A. Own-tooling defect** — a flaw in a script/tool we own (a repair).
|
|
46
|
+
- **B. Tool gotcha** — counterintuitive external-tool behavior with a
|
|
47
|
+
machine-detectable trigger (command pattern).
|
|
48
|
+
- **C. Recognition principle** — a cross-domain semantic signal → suspicion/action.
|
|
49
|
+
- **D. Domain procedure** — a multi-step method within an already-routed kind of work.
|
|
50
|
+
- **E. Environment fact** — a non-generalizable, decaying specific fact.
|
|
51
|
+
- **F. Unproven** — evidence still below the bar (usually already dropped at gate 1).
|
|
52
|
+
- **G. Principle/direction** — a value ordering shaping many decisions.
|
|
53
|
+
**Not manufactured user-side in v1** (curator-only); record a principle-ish
|
|
54
|
+
observation as an ordinary learning and let curation promote it.
|
|
55
|
+
Prefer *leftward reformulation* when it holds (E→C generalize a fact into a
|
|
56
|
+
principle; B/C/D→A mechanize knowledge into structure) — cheaper and more reliable.
|
|
57
|
+
|
|
58
|
+
3. **Intended consumption layer** (cheapest-that-still-fires wins):
|
|
59
|
+
**enforcement > gate > hook > guide > global > memory** (`incubator` = park
|
|
60
|
+
for later triage). This is recorded as **metadata only** — do NOT build the
|
|
61
|
+
hook/gate/enforcement here; mechanization is deferred to curation.
|
|
62
|
+
|
|
63
|
+
## Domain tagging (the curation join key)
|
|
64
|
+
|
|
65
|
+
Suggest a `domain` from the registered vocabulary in `config/domains.json`
|
|
66
|
+
(domain keys for domain-specific lessons, or a tier name like `core`/`infra`
|
|
67
|
+
for a genuinely cross-cutting lesson); the user **confirms**. If unsure, use
|
|
68
|
+
`unclassified` (never blocks capture — the curator assigns later). If no
|
|
69
|
+
registered domain fits, keep `domain: "unclassified"` and put the model's
|
|
70
|
+
suggested new name in `proposed_domain` (domain creation stays curator authority).
|
|
71
|
+
|
|
72
|
+
## User approval, then submit
|
|
73
|
+
|
|
74
|
+
Surface each surviving candidate compactly — lesson, type, intended layer,
|
|
75
|
+
admission-bar verdict, domain (+ proposed_domain) — and record ONLY what the
|
|
76
|
+
user explicitly approves.
|
|
77
|
+
|
|
78
|
+
Submit each approved learning through the deterministic submit tool. Pass your
|
|
79
|
+
session's `--host` and pipe the **semantic payload only** as one JSON object on
|
|
80
|
+
stdin (set the `supporting_sessions` tool prefix — `claude:` or `codex:` — to
|
|
81
|
+
match your host):
|
|
82
|
+
|
|
83
|
+
echo '{"lesson":"…","domain":"builder-base","supporting_sessions":["<tool>:<session-short-id>"],
|
|
84
|
+
"criteria":["recurrent_error"],
|
|
85
|
+
"classification":{"type":"B","layer":"hook","meets_bar":true}}' \
|
|
86
|
+
| python3 scripts/collect-learning.py --host <claude|codex>
|
|
87
|
+
|
|
88
|
+
The script (capability boundary) owns `learning_id` / `created` / `schema_version`,
|
|
89
|
+
validates against `config/learning.schema.json`, logs the JSON record, and writes
|
|
90
|
+
the lesson prose where THIS host loads it next session:
|
|
91
|
+
- **Claude**: appended to the automation-owned personal learnings file, pulled in
|
|
92
|
+
by the entry file's `@personal/learnings.md` import.
|
|
93
|
+
- **Codex**: appended into a managed `agent-bios:personal-learnings` region of
|
|
94
|
+
`AGENTS.md` (Codex has no import; AGENTS.md is always loaded), kept outside the
|
|
95
|
+
central markers so re-assembly preserves it.
|
|
96
|
+
|
|
97
|
+
**Never** hand-author `learning_id` / `created` / `schema_version`, and never
|
|
98
|
+
write those files directly. If the script REJECTS a record, fix the semantic
|
|
99
|
+
payload — do not work around the validation.
|
|
100
|
+
|
|
101
|
+
## Scope (v1)
|
|
102
|
+
|
|
103
|
+
- Single-session capture only; cross-session mining is `distill!` (curator).
|
|
104
|
+
- Mechanization (hook/gate/enforcement) is deferred to curation — record intent, don't build it.
|
|
105
|
+
- Type-G principle manufacture is curator-only.
|
|
106
|
+
- Transport (upload to the org) lands in Phase 2; Phase 1 writes locally.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"tiers": ["core", "domain", "env-personal", "infra"],
|
|
4
|
+
"domains": {
|
|
5
|
+
"builder-base": "Technical-common: coding, verification menus, documentation hygiene, tooling safety, concept economy",
|
|
6
|
+
"llm-pipeline-dev": "LLM pipeline development: capability boundary, structured output, runtime authority",
|
|
7
|
+
"multi-agent-orchestration": "Multi-model/CLI orchestration: spawn policy, prompting guides, cross-family review",
|
|
8
|
+
"visualization-docs": "Visual explanations: HTML/SVG diagrams, implementation map",
|
|
9
|
+
"office-work": "Office artifacts: spreadsheet processing"
|
|
10
|
+
},
|
|
11
|
+
"bullets": [
|
|
12
|
+
{"anchor": "Prefer concise Korean responses", "tier": "env-personal", "domains": []},
|
|
13
|
+
{"anchor": "Keep file changes within the requested scope", "tier": "core", "domains": []},
|
|
14
|
+
{"anchor": "First identify the goal, scope, ambiguities", "tier": "core", "domains": []},
|
|
15
|
+
{"anchor": "Resolve ambiguity from context when safe", "tier": "core", "domains": []},
|
|
16
|
+
{"anchor": "For simple requests, choose the most direct", "tier": "core", "domains": []},
|
|
17
|
+
{"anchor": "For non-trivial requests, compare 2-4 methods", "tier": "core", "domains": []},
|
|
18
|
+
{"anchor": "Mark one default method", "tier": "core", "domains": []},
|
|
19
|
+
{"anchor": "Execute the chosen method accurately", "tier": "core", "domains": []},
|
|
20
|
+
{"anchor": "Return to understanding if a discovery breaks", "tier": "core", "domains": []},
|
|
21
|
+
{"anchor": "Reconsider the method if the selected approach", "tier": "core", "domains": []},
|
|
22
|
+
{"anchor": "Log non-blocking discoveries and continue", "tier": "core", "domains": []},
|
|
23
|
+
{"anchor": "If the same loopback happens twice", "tier": "core", "domains": []},
|
|
24
|
+
{"anchor": "Compare the result with the selected", "tier": "core", "domains": []},
|
|
25
|
+
{"anchor": "Ask decision questions in outcome terms", "tier": "core", "domains": []},
|
|
26
|
+
{"anchor": "When the user may not know the domain", "tier": "core", "domains": []},
|
|
27
|
+
{"anchor": "Present 2-4 meaningful options", "tier": "core", "domains": []},
|
|
28
|
+
{"anchor": "For each option, state what changes", "tier": "core", "domains": []},
|
|
29
|
+
{"anchor": "Translate technical terms into plain consequences", "tier": "core", "domains": []},
|
|
30
|
+
{"anchor": "Ask for the user's goal or constraint", "tier": "core", "domains": []},
|
|
31
|
+
{"anchor": "Evaluate user suggestions for goal fit", "tier": "core", "domains": []},
|
|
32
|
+
{"anchor": "Distinguish implementation feasibility from recommendation", "tier": "core", "domains": []},
|
|
33
|
+
{"anchor": "Do not default to a restrictive lens", "tier": "core", "domains": []},
|
|
34
|
+
{"anchor": "Treat user suggestions, inherited premises, prior diagnoses", "tier": "core", "domains": []},
|
|
35
|
+
{"anchor": "For structured-output, runtime-authority, capability-surface", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
36
|
+
{"anchor": "Use instructions to describe intended work", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
37
|
+
{"anchor": "Use the LLM for semantic work", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
38
|
+
{"anchor": "Use the capability surface for structural constraints", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
39
|
+
{"anchor": "Enforce constraints through the capability surface", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
40
|
+
{"anchor": "Use tools/code for deterministic work", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
41
|
+
{"anchor": "When exactness, freshness, scale, repeatability", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
42
|
+
{"anchor": "Let the LLM design merge, projection", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
43
|
+
{"anchor": "For required structured or machine-consumed outputs", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
44
|
+
{"anchor": "Let tools/code own ids, paths, serialization", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
45
|
+
{"anchor": "Keep deterministic values out of LLM authority", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
46
|
+
{"anchor": "For simple stable explanations or planning", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
47
|
+
{"anchor": "Treat a produced field, flag, signal", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
48
|
+
{"anchor": "Hard-block only deterministically decidable structural", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
49
|
+
{"anchor": "Runtime/code may enforce the contract", "tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
50
|
+
{"anchor": "Keep the concept graph compact by reusing", "tier": "domain", "domains": ["builder-base"]},
|
|
51
|
+
{"anchor": "Treat lasting or shared names as concept", "tier": "domain", "domains": ["builder-base"]},
|
|
52
|
+
{"anchor": "Before adding or changing a concept", "tier": "domain", "domains": ["builder-base"]},
|
|
53
|
+
{"anchor": "Prefer broad, stable concepts with precise", "tier": "domain", "domains": ["builder-base"]},
|
|
54
|
+
{"anchor": "Before fixing a review finding or test failure", "tier": "domain", "domains": ["builder-base"]},
|
|
55
|
+
{"anchor": "Split or promote a concept when it changes", "tier": "domain", "domains": ["builder-base"]},
|
|
56
|
+
{"anchor": "Keep derived values as properties or projections", "tier": "domain", "domains": ["builder-base"]},
|
|
57
|
+
{"anchor": "Keep internal projections and helper outputs internal", "tier": "domain", "domains": ["builder-base"]},
|
|
58
|
+
{"anchor": "Distinguish authority from visibility", "tier": "domain", "domains": ["builder-base"]},
|
|
59
|
+
{"anchor": "Reuse existing enum values, failure kinds", "tier": "domain", "domains": ["builder-base"]},
|
|
60
|
+
{"anchor": "Use fallback paths, compatibility shims", "tier": "domain", "domains": ["builder-base"]},
|
|
61
|
+
{"anchor": "Keep comments and active docs aligned", "tier": "domain", "domains": ["builder-base"]},
|
|
62
|
+
{"anchor": "When a split is necessary, name the parent", "tier": "domain", "domains": ["builder-base"]},
|
|
63
|
+
{"anchor": "In ontology work, check existing entities", "tier": "domain", "domains": ["builder-base"]},
|
|
64
|
+
{"anchor": "In code work, follow existing naming patterns", "tier": "domain", "domains": ["builder-base"]},
|
|
65
|
+
{"anchor": "Let the repository's shape mirror its concept graph", "tier": "domain", "domains": ["builder-base"]},
|
|
66
|
+
{"anchor": "For `.xlsx` editing, generation, reconciliation", "tier": "domain", "domains": ["office-work"]},
|
|
67
|
+
{"anchor": "For meaningful development work, read and use", "tier": "domain", "domains": ["builder-base"]},
|
|
68
|
+
{"anchor": "For mock, fixture, fake, stub, simulated-provider", "tier": "domain", "domains": ["builder-base"]},
|
|
69
|
+
{"anchor": "When the user asks to", "tier": "domain", "domains": ["builder-base"]},
|
|
70
|
+
{"anchor": "Think before coding: state key assumptions", "tier": "domain", "domains": ["builder-base"]},
|
|
71
|
+
{"anchor": "Build the smallest viable functional path", "tier": "domain", "domains": ["builder-base"]},
|
|
72
|
+
{"anchor": "Treat viability as real behavior against", "tier": "domain", "domains": ["builder-base"]},
|
|
73
|
+
{"anchor": "Make surgical changes. Touch only what", "tier": "domain", "domains": ["builder-base"]},
|
|
74
|
+
{"anchor": "Clean up issues introduced by the current", "tier": "domain", "domains": ["builder-base"]},
|
|
75
|
+
{"anchor": "Own the full lifecycle of what you create", "tier": "domain", "domains": ["builder-base"]},
|
|
76
|
+
{"anchor": "Define success criteria before multi-step coding work", "tier": "domain", "domains": ["builder-base"]},
|
|
77
|
+
{"anchor": "For bugs, prefer a reproducing test", "tier": "domain", "domains": ["builder-base"]},
|
|
78
|
+
{"anchor": "Every changed line should trace back", "tier": "domain", "domains": ["builder-base"]},
|
|
79
|
+
{"anchor": "Fix the root cause at its authority", "tier": "domain", "domains": ["builder-base"]},
|
|
80
|
+
{"anchor": "Land risky or behavior-changing work behind", "tier": "domain", "domains": ["builder-base"]},
|
|
81
|
+
{"anchor": "For composing a review request, packet", "tier": "domain", "domains": ["builder-base"]},
|
|
82
|
+
{"anchor": "After every meaningful code, ontology, config", "tier": "domain", "domains": ["builder-base"]},
|
|
83
|
+
{"anchor": "Use static checks broadly: typecheck, lint", "tier": "domain", "domains": ["builder-base"]},
|
|
84
|
+
{"anchor": "Add the narrowest reliable runtime or semantic test", "tier": "domain", "domains": ["builder-base"]},
|
|
85
|
+
{"anchor": "Pick each domain's verification mix", "tier": "domain", "domains": ["builder-base"]},
|
|
86
|
+
{"anchor": "Let the LLM derive scenarios from the diff", "tier": "domain", "domains": ["builder-base"]},
|
|
87
|
+
{"anchor": "Keep E2E stable with deterministic data", "tier": "domain", "domains": ["builder-base"]},
|
|
88
|
+
{"anchor": "Report the checks run, results", "tier": "core", "domains": []},
|
|
89
|
+
{"anchor": "Trust a green check only when it traversed", "tier": "domain", "domains": ["builder-base"]},
|
|
90
|
+
{"anchor": "Make completion criteria falsifiable", "tier": "domain", "domains": ["builder-base"]},
|
|
91
|
+
{"anchor": "Before comparing two of anything", "tier": "domain", "domains": ["builder-base"]},
|
|
92
|
+
{"anchor": "For non-trivial designs or high-risk changes", "tier": "domain", "domains": ["builder-base"]},
|
|
93
|
+
{"anchor": "Proportion verification to cost, risk, and information gain", "tier": "domain", "domains": ["builder-base"]},
|
|
94
|
+
{"anchor": "Trust a green / zero-findings verdict only", "tier": "domain", "domains": ["builder-base"]},
|
|
95
|
+
{"anchor": "For concrete shell/CLI traps", "tier": "domain", "domains": ["builder-base"]},
|
|
96
|
+
{"anchor": "Ambient state — the active shell", "tier": "domain", "domains": ["builder-base"]},
|
|
97
|
+
{"anchor": "Before relying on any model id", "tier": "domain", "domains": ["builder-base"]},
|
|
98
|
+
{"anchor": "Scope destructive actions (kill, rm, force-push", "tier": "domain", "domains": ["builder-base"]},
|
|
99
|
+
{"anchor": "Never accept secrets through transcript- or history-logged channels", "tier": "core", "domains": []},
|
|
100
|
+
{"anchor": "When a secret must be supplied", "tier": "domain", "domains": ["builder-base"]},
|
|
101
|
+
{"anchor": "Treat a coarse runtime signal", "tier": "domain", "domains": ["builder-base"]},
|
|
102
|
+
{"anchor": "Before reasoning about what a branch contains", "tier": "domain", "domains": ["builder-base"]},
|
|
103
|
+
{"anchor": "Standing spawn policy: check the spawn gates", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
104
|
+
{"anchor": "Down-spawns carry a machine-checkable done-when", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
105
|
+
{"anchor": "For work spanning multiple models or CLI agents", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
106
|
+
{"anchor": "For composing a prompt, packet, or tool description", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
107
|
+
{"anchor": "Allocate models by difficulty", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
108
|
+
{"anchor": "dual-provider frontier design drafts", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
109
|
+
{"anchor": "Never retry-storm a live rate limit", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
110
|
+
{"anchor": "On any resumed, cleared, or relocated session", "tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
111
|
+
{"anchor": "Keep runtime code, active docs, and execution-facing", "tier": "domain", "domains": ["builder-base"]},
|
|
112
|
+
{"anchor": "Use comments for non-obvious current behavior", "tier": "domain", "domains": ["builder-base"]},
|
|
113
|
+
{"anchor": "Put backward-compatibility notes, deprecated behavior", "tier": "domain", "domains": ["builder-base"]},
|
|
114
|
+
{"anchor": "Link from active docs or code to isolated notes", "tier": "domain", "domains": ["builder-base"]},
|
|
115
|
+
{"anchor": "Phrase guidelines as desired behavior", "tier": "domain", "domains": ["builder-base"]},
|
|
116
|
+
{"anchor": "Prefer established docs such as", "tier": "domain", "domains": ["builder-base"]},
|
|
117
|
+
{"anchor": "For SVG diagrams, service blueprints", "tier": "domain", "domains": ["visualization-docs"]},
|
|
118
|
+
{"anchor": "When a concept is easier to understand visually", "tier": "domain", "domains": ["visualization-docs"]},
|
|
119
|
+
{"anchor": "Use HTML for comparisons, flows, state changes", "tier": "domain", "domains": ["visualization-docs"]},
|
|
120
|
+
{"anchor": "Keep HTML self-contained, accessible, and minimal", "tier": "domain", "domains": ["visualization-docs"]},
|
|
121
|
+
{"anchor": "Use plain text when it is clearer", "tier": "domain", "domains": ["visualization-docs"]},
|
|
122
|
+
{"anchor": "For the detailed `IMPLEMENTATION_MAP.html` construction rules", "tier": "domain", "domains": ["visualization-docs"]},
|
|
123
|
+
{"anchor": "In repos with implementation code", "tier": "domain", "domains": ["visualization-docs"]},
|
|
124
|
+
{"anchor": "`learn!` — session learning", "tier": "core", "domains": []}
|
|
125
|
+
],
|
|
126
|
+
"guides": {
|
|
127
|
+
"claude-prompting.md": {"tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
128
|
+
"cli-multi-model-workflow.md": {"tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
129
|
+
"coding-staged-workflow.md": {"tier": "domain", "domains": ["builder-base"]},
|
|
130
|
+
"gpt-prompting.md": {"tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
131
|
+
"implementation-map.md": {"tier": "domain", "domains": ["visualization-docs"]},
|
|
132
|
+
"llm-capability-boundary-examples.md": {"tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
133
|
+
"llm-capability-boundary-patterns.md": {"tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
134
|
+
"llm-capability-boundary.md": {"tier": "domain", "domains": ["llm-pipeline-dev"]},
|
|
135
|
+
"mock-realization-boundary.md": {"tier": "domain", "domains": ["builder-base"]},
|
|
136
|
+
"review-request.md": {"tier": "domain", "domains": ["builder-base"]},
|
|
137
|
+
"session-distill-workflow.md": {"tier": "infra", "domains": []},
|
|
138
|
+
"learning-flow.md": {"tier": "infra", "domains": []},
|
|
139
|
+
"svg-visualization-guide.md": {"tier": "domain", "domains": ["visualization-docs"]},
|
|
140
|
+
"tooling-gotchas.md": {"tier": "domain", "domains": ["builder-base"]}
|
|
141
|
+
},
|
|
142
|
+
"hooks": {
|
|
143
|
+
"tooling-gotchas-hook.py": {"tier": "domain", "domains": ["builder-base"], "source_guide": "tooling-gotchas.md"}
|
|
144
|
+
},
|
|
145
|
+
"agents": {
|
|
146
|
+
"frontier.md": {"tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
147
|
+
"sweep.md": {"tier": "domain", "domains": ["multi-agent-orchestration"]},
|
|
148
|
+
"workhorse.md": {"tier": "domain", "domains": ["multi-agent-orchestration"]}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:agent-bios:schema:learning:v1",
|
|
4
|
+
"title": "Learning record",
|
|
5
|
+
"description": "Per-session learning artifact produced by the session learning flow (trigger `learn!`; design/collection-loop/DESIGN.md). This file is the SSOT for the upload payload of POST /api/ingest/learnings and for the curator export; the dashboard mirrors only minimal validation from it. Field names stay ledger-compatible (design/session-distill/ledger.json). Identity is NEVER carried in the payload — the server derives it from X-Hook-Token. `domain` membership (config/domains.json domains ∪ tier names ∪ 'unclassified') is enforced by scripts/check-learning.py, not frozen here, so vocabulary evolution never requires a schema_version bump.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"schema_version",
|
|
10
|
+
"learning_id",
|
|
11
|
+
"lesson",
|
|
12
|
+
"domain",
|
|
13
|
+
"created",
|
|
14
|
+
"supporting_sessions"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"schema_version": {
|
|
18
|
+
"const": 1,
|
|
19
|
+
"description": "Format version of this record (refinement A). v1 records carry exactly 1; the server accepts >=1 tolerantly and stores raw JSON verbatim (refinement C)."
|
|
20
|
+
},
|
|
21
|
+
"learning_id": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
|
|
24
|
+
"description": "Client-generated UUID for this learning, lowercase canonical form (tooling must lowercase, e.g. macOS uuidgen emits uppercase). Owned by scripts/collect-learning.py, never hand-authored. Idempotency key for the pending-learnings.jsonl bounded retry in Phase 2. Distinct from the ledger's `id` (a curator-assigned short id like 'S3-07'); this is the light-flow record's own key.",
|
|
25
|
+
"$comment": "Ledger entries use `id`; the light-flow record's own key is `learning_id` (the artifact is a learning — LEXICON.md — so it is not `distill_id`, which would collide with the heavy session-distill pipeline)."
|
|
26
|
+
},
|
|
27
|
+
"lesson": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 8,
|
|
30
|
+
"maxLength": 2000,
|
|
31
|
+
"description": "The learning as prose — the same text that landed in the user's ~/.claude/personal/learnings.md. Ledger-compatible with entries[].lesson."
|
|
32
|
+
},
|
|
33
|
+
"domain": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
36
|
+
"description": "Curation join key, ledger-compatible: a D6 domain key from config/domains.json for a domain-specific lesson, OR a tier name (core, infra, …) for a cross-cutting lesson (4 real ledger entries carry core/infra), OR 'unclassified' (refinement B — users are never blocked at capture time; the curator assigns later; kept distinct from 'core', which asserts a genuinely cross-cutting lesson). Membership is validated by scripts/check-learning.py against config/domains.json (single source), not frozen in this pattern. When the model proposes a NOT-yet-registered domain, this stays 'unclassified' and the name goes in `proposed_domain`."
|
|
37
|
+
},
|
|
38
|
+
"created": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$",
|
|
41
|
+
"description": "Capture time (the moment the learning was recorded), ISO 8601 with explicit UTC 'Z' or numeric offset. Generated by tooling, not the LLM."
|
|
42
|
+
},
|
|
43
|
+
"supporting_sessions": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"minItems": 1,
|
|
46
|
+
"maxItems": 16,
|
|
47
|
+
"uniqueItems": true,
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"pattern": "^[a-z][a-z0-9-]*:[A-Za-z0-9-]{4,64}$"
|
|
51
|
+
},
|
|
52
|
+
"description": "Provenance in ledger format '<tool>:<session-short-id>' (e.g. 'claude:517fbcea'). The v1 slim flow is single-session, so capture-time records carry exactly one entry; the array shape is the ledger's."
|
|
53
|
+
},
|
|
54
|
+
"criteria": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"maxItems": 8,
|
|
57
|
+
"uniqueItems": true,
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
61
|
+
},
|
|
62
|
+
"description": "Optional why-worth-recording tags in ledger vocabulary (e.g. recurrent_error, quality_lever, rare_high_cost). The vocabulary is owned by design/session-distill/PLACEMENT-FRAMEWORK.md and deliberately not frozen here."
|
|
63
|
+
},
|
|
64
|
+
"classification": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"description": "Optional slim classification block set by the session learning flow (design/collection-loop/DESIGN.md Phase 1 step 2): the type, intended consumption layer, and admission-bar verdict — metadata ONLY (the hook/gate/enforcement is NOT built user-side; curation mechanizes later). Ledger-compatible with entries[].classification, which carries these plus curator-side detail.",
|
|
68
|
+
"properties": {
|
|
69
|
+
"type": {
|
|
70
|
+
"enum": ["A", "B", "C", "D", "E", "F", "G"],
|
|
71
|
+
"description": "Typology letter (design/session-distill/PLACEMENT-FRAMEWORK.md A–G); same vocabulary as the ledger's classification.type."
|
|
72
|
+
},
|
|
73
|
+
"layer": {
|
|
74
|
+
"enum": ["enforcement", "gate", "hook", "guide", "global", "memory", "incubator"],
|
|
75
|
+
"description": "Intended consumption layer (enforcement > gate > hook > guide > global > memory; 'incubator' = parked for later triage). Same vocabulary as the ledger's classification.layer; reuses the routing tree's fixed layers."
|
|
76
|
+
},
|
|
77
|
+
"meets_bar": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"description": "Whether the candidate passed the admission bar (independent-session recurrence ≥2 or single-event high materiality). Maps to the ledger's meets_promotion_bar."
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"proposed_domain": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"pattern": "^[a-z][a-z0-9-]*$",
|
|
86
|
+
"description": "Optional: a NEW domain name the model proposes when no registered domain fits (design/collection-loop/DESIGN.md Phase 1 step 3). Domain creation stays curator authority, so `domain` remains 'unclassified' whenever this is set (enforced by the conditional below)."
|
|
87
|
+
},
|
|
88
|
+
"context": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"maxLength": 4000,
|
|
91
|
+
"description": "Optional one-paragraph evidence / when-it-applies note for the curator; the source session is gone by curation time."
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"if": {
|
|
95
|
+
"required": ["proposed_domain"]
|
|
96
|
+
},
|
|
97
|
+
"then": {
|
|
98
|
+
"properties": {
|
|
99
|
+
"domain": {
|
|
100
|
+
"const": "unclassified"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-bios",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A thin, low-level instruction layer for LLM CLI agents: one set of principles and behavior whichever model you run. Deploys into $HOME by copy via an explicit `agent-bios install`.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"agent-bios": "scripts/install.sh"
|
|
@@ -15,10 +15,14 @@
|
|
|
15
15
|
"codex/agents/",
|
|
16
16
|
"codex/config-additions.toml",
|
|
17
17
|
"config/agent-launch.toml",
|
|
18
|
+
"config/domains.json",
|
|
19
|
+
"config/learning.schema.json",
|
|
18
20
|
"shell/agent-launch.zsh",
|
|
19
21
|
"scripts/agent-launch.py",
|
|
20
22
|
"scripts/check-parity.sh",
|
|
21
23
|
"scripts/check-prompting-targets.sh",
|
|
24
|
+
"scripts/check-learning.py",
|
|
25
|
+
"scripts/collect-learning.py",
|
|
22
26
|
"scripts/codex-run.sh",
|
|
23
27
|
"scripts/codex-helm.sh",
|
|
24
28
|
"scripts/install.sh",
|