agent-bios 0.19.4 → 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.
Files changed (158) hide show
  1. package/DEPENDENCIES.md +19 -5
  2. package/README.md +14 -19
  3. package/claude/agents/frontier.md +1 -1
  4. package/claude/guides/claude-prompting.md +475 -234
  5. package/claude/guides/cli-multi-model-workflow.md +4 -3
  6. package/claude/guides/gpt-prompting.md +235 -136
  7. package/claude/guides/session-distill-workflow.md +93 -43
  8. package/claude/guides/tooling-gotchas.md +3 -1
  9. package/codex/guides/claude-prompting.md +475 -234
  10. package/codex/guides/cli-multi-model-workflow.md +4 -3
  11. package/codex/guides/gpt-prompting.md +235 -136
  12. package/codex/guides/session-distill-workflow.md +93 -43
  13. package/codex/guides/tooling-gotchas.md +3 -1
  14. package/compose/assemble.py +4 -1
  15. package/compose/canary.sh +8 -6
  16. package/compose/host_platform.py +158 -15
  17. package/compose/instructions-state.py +183 -41
  18. package/compose/instructions_install.py +222 -27
  19. package/compose/instructions_session.py +250 -75
  20. package/compose/instructions_setup_cli.py +2 -36
  21. package/compose/instructions_store.py +160 -3
  22. package/compose/instructions_transaction.py +29 -5
  23. package/docs/advanced-launch.md +4 -0
  24. package/docs/releases/0.20.0.md +102 -0
  25. package/install.sh +42 -14
  26. package/launch/agent-launch.py +152 -18
  27. package/launch/agent-launch.toml +17 -7
  28. package/launch/agent-launch.zsh +104 -13
  29. package/launch/claude_subcommands.py +179 -0
  30. package/launch/shell_integration.py +7 -1
  31. package/learn/collect-learning.py +60 -9
  32. package/learn/migrate-learnings.py +70 -4
  33. package/learn/redact.py +2 -1
  34. package/package.json +36 -3
  35. package/provenance.json +1 -1
  36. package/session-cost.py +80 -9
  37. package/session-distill/coverage.json +6 -0
  38. package/session-distill/distill.py +2575 -0
  39. package/session-distill/grammar/__init__.py +0 -0
  40. package/session-distill/grammar/owner_lines.py +874 -0
  41. package/session-distill/originators.json +9 -0
  42. package/session-distill/packets/cross_review.md +31 -0
  43. package/session-distill/packets/form.md +86 -0
  44. package/session-distill/packets/judge.md +81 -0
  45. package/session-distill/packets/placement_contract.md +90 -0
  46. package/session-distill/packets/propose.md +124 -0
  47. package/session-distill/packets/read.md +57 -0
  48. package/session-distill/packets/reconsider.md +53 -0
  49. package/session-distill/packets/s7b.md +65 -0
  50. package/session-distill/packets/s9b.md +39 -0
  51. package/session-distill/packets/stitch.md +35 -0
  52. package/session-distill/packets/sweep.md +33 -0
  53. package/session-distill/runlib/__init__.py +0 -0
  54. package/session-distill/runlib/bound.py +1102 -0
  55. package/session-distill/runlib/breaker.py +467 -0
  56. package/session-distill/runlib/census.py +2347 -0
  57. package/session-distill/runlib/claims.py +420 -0
  58. package/session-distill/runlib/controls.py +902 -0
  59. package/session-distill/runlib/coverage.py +881 -0
  60. package/session-distill/runlib/declare.py +888 -0
  61. package/session-distill/runlib/delivery_evidence.py +1145 -0
  62. package/session-distill/runlib/derive.py +812 -0
  63. package/session-distill/runlib/destinations.py +3072 -0
  64. package/session-distill/runlib/dispatch.py +7939 -0
  65. package/session-distill/runlib/drift.py +1077 -0
  66. package/session-distill/runlib/entry.py +401 -0
  67. package/session-distill/runlib/evidence.py +890 -0
  68. package/session-distill/runlib/exposure.py +1162 -0
  69. package/session-distill/runlib/gate.py +2727 -0
  70. package/session-distill/runlib/gitread.py +79 -0
  71. package/session-distill/runlib/inventory.py +19624 -0
  72. package/session-distill/runlib/journal.py +1919 -0
  73. package/session-distill/runlib/ledger.py +3210 -0
  74. package/session-distill/runlib/ledger_compat.py +101 -0
  75. package/session-distill/runlib/ledger_migration.py +190 -0
  76. package/session-distill/runlib/lifecycle_intake.py +693 -0
  77. package/session-distill/runlib/lineage.py +454 -0
  78. package/session-distill/runlib/measures.py +249 -0
  79. package/session-distill/runlib/monitor.py +1180 -0
  80. package/session-distill/runlib/operations.py +522 -0
  81. package/session-distill/runlib/packet.py +838 -0
  82. package/session-distill/runlib/placement.py +1769 -0
  83. package/session-distill/runlib/projection.py +4090 -0
  84. package/session-distill/runlib/ranking.py +740 -0
  85. package/session-distill/runlib/receipts.py +200 -0
  86. package/session-distill/runlib/records.py +1965 -0
  87. package/session-distill/runlib/search.py +249 -0
  88. package/session-distill/runlib/sequencing.py +829 -0
  89. package/session-distill/runlib/sources.py +641 -0
  90. package/session-distill/runlib/stage_adjudicate.py +845 -0
  91. package/session-distill/runlib/stage_apply.py +1378 -0
  92. package/session-distill/runlib/stage_approvals.py +758 -0
  93. package/session-distill/runlib/stage_close.py +1220 -0
  94. package/session-distill/runlib/stage_confirm.py +929 -0
  95. package/session-distill/runlib/stage_delivery.py +3080 -0
  96. package/session-distill/runlib/stage_form.py +2576 -0
  97. package/session-distill/runlib/stage_judge.py +4248 -0
  98. package/session-distill/runlib/stage_propose.py +3307 -0
  99. package/session-distill/runlib/stage_read.py +5179 -0
  100. package/session-distill/runlib/stage_render.py +2739 -0
  101. package/session-distill/runlib/stage_retrieve.py +924 -0
  102. package/session-distill/runlib/stage_review_korean.py +1002 -0
  103. package/session-distill/runlib/stage_review_proposals.py +1292 -0
  104. package/session-distill/runlib/stagelock.py +412 -0
  105. package/session-distill/runlib/stop.py +1061 -0
  106. package/session-distill/runlib/targets.py +809 -0
  107. package/session-distill/runlib/usage.py +280 -0
  108. package/session-distill/runlib/validate.py +319 -0
  109. package/session-distill/runlib/views.py +4327 -0
  110. package/session-distill/schemas/adjudication.schema.json +35 -0
  111. package/session-distill/schemas/approval.schema.json +35 -0
  112. package/session-distill/schemas/census.schema.json +128 -0
  113. package/session-distill/schemas/checks.schema.json +207 -0
  114. package/session-distill/schemas/claim.schema.json +16 -0
  115. package/session-distill/schemas/confirmation.schema.json +24 -0
  116. package/session-distill/schemas/coverage.schema.json +66 -0
  117. package/session-distill/schemas/cross_review.schema.json +24 -0
  118. package/session-distill/schemas/event.schema.json +20 -0
  119. package/session-distill/schemas/evidence.schema.json +20 -0
  120. package/session-distill/schemas/expected_observation.schema.json +18 -0
  121. package/session-distill/schemas/form.schema.json +103 -0
  122. package/session-distill/schemas/intake.schema.json +71 -0
  123. package/session-distill/schemas/inventory.schema.json +872 -0
  124. package/session-distill/schemas/judge.schema.json +77 -0
  125. package/session-distill/schemas/ledger.schema.json +313 -0
  126. package/session-distill/schemas/observation.schema.json +16 -0
  127. package/session-distill/schemas/propose.schema.json +555 -0
  128. package/session-distill/schemas/read.schema.json +76 -0
  129. package/session-distill/schemas/reconsider.schema.json +122 -0
  130. package/session-distill/schemas/run.schema.json +150 -0
  131. package/session-distill/schemas/s7b.schema.json +200 -0
  132. package/session-distill/schemas/s9b.schema.json +28 -0
  133. package/session-distill/schemas/stitch.schema.json +25 -0
  134. package/session-distill/schemas/sweep.schema.json +25 -0
  135. package/session-distill/seats.json +149 -0
  136. package/session-distill/tables/allowed_pairs.json +257 -0
  137. package/session-distill/tables/controls.json +30 -0
  138. package/session-distill/tables/delivery_evidence.json +36 -0
  139. package/session-distill/tables/delivery_evidence_fixtures.json +731 -0
  140. package/session-distill/tables/destinations.json +684 -0
  141. package/session-distill/tables/drift_layers.json +68 -0
  142. package/session-distill/tables/exposure_rules.json +192 -0
  143. package/session-distill/tables/placement_rules.json +148 -0
  144. package/session-distill/tables/propose_fixtures.json +154 -0
  145. package/session-distill/tables/ranking.json +194 -0
  146. package/session-distill/tables/redundancy.json +10 -0
  147. package/session-distill/tables/structural_rules.json +44 -0
  148. package/session-distill/tables/transition_fixtures.json +398 -0
  149. package/session-distill/tables/transitions.json +69 -0
  150. package/session-distill/tables/unit_outcome.json +67 -0
  151. package/session-distill/tables/unit_outcome_fixtures.json +2364 -0
  152. package/wrappers/claude-run.sh +481 -33
  153. package/wrappers/claude_hermetic_evidence.py +1423 -0
  154. package/wrappers/codex-helm.sh +38 -7
  155. package/wrappers/codex-run.sh +183 -20
  156. package/wrappers/codex_frame_filter.py +1199 -0
  157. package/wrappers/codex_protocol.py +737 -0
  158. package/wrappers/jsonl_lines.py +65 -0
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$comment": "design §6.2 (S6), §6.4, §7.5; plan WP-11; lead decisions D11 (D-20261111-f3d39c: the consequence classes are owned here), D12 (D-20261111-f174ea: a judgment is keyed per candidate, unit and seat; the first call of a candidate judges its requirements, class, matching units and ledger relations and every unit, a later reference point's call only the units whose key is new), D14 (D-20261111-1aa1b3: two judgments and a one-line reason for every unit, a quote only where the situation or the action matches). Every unit, quote and ledger entry is named by the packet's own label (n, q, e); code turns labels back into stored ids, checks that every unit is judged once, that a quote is a span of its unit and is present exactly where a match is yes, and that every matching unit has its following and contribution (stage_judge.answer_problems). This schema holds the shape.",
4
+ "title": "S6 judgment",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["requirements", "consequence_class", "no_longer_arises", "units", "matching_units", "ledger_relations"],
8
+ "properties": {
9
+ "requirements": {"$ref": "#/$defs/requirements"},
10
+ "consequence_class": {"$ref": "#/$defs/consequence_class"},
11
+ "no_longer_arises": {"$ref": "#/$defs/no_longer_arises"},
12
+ "units": {"$ref": "#/$defs/units"},
13
+ "matching_units": {"type": "array", "items": {"$ref": "#/$defs/matching_unit"}},
14
+ "ledger_relations": {"type": "array", "items": {"$ref": "#/$defs/ledger_relation"}}
15
+ },
16
+ "$defs": {
17
+ "text": {"type": "string", "minLength": 1},
18
+ "unit_label": {"type": "string", "pattern": "^n[1-9][0-9]*(?![\\s\\S])"},
19
+ "quote_ids": {"type": "array", "uniqueItems": true, "items": {"type": "string", "pattern": "^q[1-9][0-9]*(?![\\s\\S])"}},
20
+ "mark": {"type": "string", "enum": ["met", "unmet", "uncertain"]},
21
+ "match": {"type": "string", "enum": ["yes", "no"]},
22
+ "requirement": {
23
+ "type": "object", "additionalProperties": false, "required": ["mark", "reason"],
24
+ "properties": {"mark": {"$ref": "#/$defs/mark"}, "reason": {"$ref": "#/$defs/text"}}
25
+ },
26
+ "requirements": {
27
+ "$comment": "D-20261020-71699d: the eight admission requirements, each judged met, unmet or uncertain with its reason (§6.4 admission)",
28
+ "type": "object", "additionalProperties": false,
29
+ "required": ["observed_event", "consequence", "causal_support", "recognizable_in_advance", "actionable", "bounded", "positioned", "audience"],
30
+ "properties": {
31
+ "observed_event": {"$ref": "#/$defs/requirement"}, "consequence": {"$ref": "#/$defs/requirement"},
32
+ "causal_support": {"$ref": "#/$defs/requirement"}, "recognizable_in_advance": {"$ref": "#/$defs/requirement"},
33
+ "actionable": {"$ref": "#/$defs/requirement"}, "bounded": {"$ref": "#/$defs/requirement"},
34
+ "positioned": {"$ref": "#/$defs/requirement"}, "audience": {"$ref": "#/$defs/requirement"}
35
+ }
36
+ },
37
+ "consequence_class": {
38
+ "$comment": "D11: the one owner of the consequence classes (§7.5's six); tables/unit_outcome.json's promotion row and the ranking read this enum",
39
+ "type": "string", "enum": ["irreversible", "security", "verification-corrupting", "cost", "quality", "none"]
40
+ },
41
+ "no_longer_arises": {
42
+ "$comment": "§6.4 obsolete: evidence that the situation no longer arises, which a lifecycle candidate needs; false with no evidence otherwise",
43
+ "type": "object", "additionalProperties": false, "required": ["value", "reason", "evidence_ids"],
44
+ "properties": {"value": {"type": "boolean"}, "reason": {"type": "string"}, "evidence_ids": {"$ref": "#/$defs/quote_ids"}}
45
+ },
46
+ "unit_judgment": {
47
+ "$comment": "§6.2 per unit: situation match, action match, a one-line reason, and (D14) a quote of the unit only where either match is yes, empty otherwise",
48
+ "type": "object", "additionalProperties": false, "required": ["unit", "situation", "action", "reason", "quote"],
49
+ "properties": {
50
+ "unit": {"$ref": "#/$defs/unit_label"}, "situation": {"$ref": "#/$defs/match"}, "action": {"$ref": "#/$defs/match"},
51
+ "reason": {"$ref": "#/$defs/text"}, "quote": {"type": "string"}
52
+ }
53
+ },
54
+ "units": {"type": "array", "items": {"$ref": "#/$defs/unit_judgment"}},
55
+ "matching_unit": {
56
+ "$comment": "§6.2 per candidate, for each matching unit: its following and its contribution to the outcome, each with evidence ids, kept apart from the event's consequence",
57
+ "type": "object", "additionalProperties": false,
58
+ "required": ["unit", "following", "following_evidence_ids", "contribution", "contribution_evidence_ids"],
59
+ "properties": {
60
+ "unit": {"$ref": "#/$defs/unit_label"},
61
+ "following": {"type": "string", "enum": ["followed", "not_followed", "unknown"]},
62
+ "following_evidence_ids": {"$ref": "#/$defs/quote_ids"},
63
+ "contribution": {"type": "string", "enum": ["helped", "harmed", "neutral", "unknown"]},
64
+ "contribution_evidence_ids": {"$ref": "#/$defs/quote_ids"}
65
+ }
66
+ },
67
+ "ledger_relation": {
68
+ "$comment": "§6.2: the relation to each retrieved ledger entry",
69
+ "type": "object", "additionalProperties": false, "required": ["entry", "relation", "reason"],
70
+ "properties": {
71
+ "entry": {"type": "string", "pattern": "^e[1-9][0-9]*(?![\\s\\S])"},
72
+ "relation": {"type": "string", "enum": ["recurrence", "revision", "contradiction", "retired_relation", "none"]},
73
+ "reason": {"$ref": "#/$defs/text"}
74
+ }
75
+ }
76
+ }
77
+ }
@@ -0,0 +1,313 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$comment": "design §12.1 (entry fields, decisions[] elements), §12.2 (kept fields and legacy elements), §12.4 (windows[]); expected_observation mirrors schemas/expected_observation.schema.json (design §7.3) plus resolutions[] (design §11)",
4
+ "title": "Session distill ledger, schema 2",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schema", "framework", "windows", "entries"],
8
+ "properties": {
9
+ "schema": {"const": 2},
10
+ "framework": {"type": "string", "minLength": 1},
11
+ "windows": {"type": "array", "items": {"$ref": "#/$defs/window"}},
12
+ "entries": {"type": "array", "items": {"$ref": "#/$defs/entry"}}
13
+ },
14
+ "$defs": {
15
+ "date": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
16
+ "moment": {"type": ["string", "null"], "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}(T.+)?$"},
17
+ "entry_kind": {
18
+ "$comment": "design §7.2: the closed vocabulary of an entry's kind",
19
+ "enum": ["misfire", "gap", "not delivered", "confirmed", "obsolete", "already resolved", "unclassified"]
20
+ },
21
+ "entry_diagnosis": {
22
+ "$comment": "design §7.2: the closed vocabulary of an entry's diagnosis",
23
+ "enum": ["covered", "wrong or insufficient", "trigger problem", "gap", "redundant", "unknown"]
24
+ },
25
+ "disposition": {
26
+ "$comment": "design §7.2: the closed vocabulary of an entry and of every decision a run makes",
27
+ "enum": ["place", "correct", "re-deliver", "keep", "reduce", "incubate", "drop", "none"]
28
+ },
29
+ "legacy_disposition": {
30
+ "$comment": "design §7.2 plus the two values design §12.2 gives the elements it migrates; runlib/ledger.py rejects them on any decision that is not a legacy element (DISPOSITION_NOT_CURRENT)",
31
+ "enum": ["place", "correct", "re-deliver", "keep", "reduce", "incubate", "drop", "none", "unknown", "revival"]
32
+ },
33
+ "window": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["start", "end", "run_id", "kind", "commit", "accounted", "fully_read"],
37
+ "properties": {
38
+ "start": {"type": ["string", "null"], "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"},
39
+ "end": {"$ref": "#/$defs/date"},
40
+ "run_id": {"type": "string", "minLength": 1},
41
+ "kind": {"enum": ["periodic", "targeted", "legacy"]},
42
+ "commit": {"type": ["string", "null"]},
43
+ "accounted": {"type": ["boolean", "null"]},
44
+ "fully_read": {"type": ["boolean", "null"]}
45
+ }
46
+ },
47
+ "layer_split": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["layer", "mechanism"],
51
+ "properties": {"layer": {"type": "string"}, "mechanism": {"type": "string"}}
52
+ },
53
+ "classification": {
54
+ "type": ["object", "null"],
55
+ "additionalProperties": false,
56
+ "required": ["type"],
57
+ "properties": {
58
+ "type": {"enum": ["A", "B", "C", "D", "E", "F", "G"]},
59
+ "layer": {"type": ["string", "null"]},
60
+ "mechanism": {"type": "string"},
61
+ "meets_promotion_bar": {"type": "boolean"},
62
+ "proposed": {"type": "boolean"},
63
+ "proposed_text": {"type": ["string", "null"]},
64
+ "underlying_value": {"type": "string"},
65
+ "reformulation": {"type": ["string", "null"]},
66
+ "token_est": {"type": "integer"},
67
+ "consumer_note": {"type": ["string", "null"]},
68
+ "split": {"type": ["array", "null"], "items": {"$ref": "#/$defs/layer_split"}},
69
+ "verification": {"type": "string"},
70
+ "basis": {"type": "string"},
71
+ "closest_corpus_text": {"type": "string"},
72
+ "forbids": {"type": "string"},
73
+ "gap_kind": {"type": "string"},
74
+ "surface": {"type": "string"}
75
+ }
76
+ },
77
+ "recurrence_record": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["window"],
81
+ "properties": {
82
+ "window": {"$ref": "#/$defs/date"},
83
+ "sessions": {"type": "array", "items": {"type": "string"}},
84
+ "strength": {"type": "integer"},
85
+ "verdict": {"type": "string"},
86
+ "lesson_as_seen": {"type": "string"},
87
+ "principle": {"type": "string"},
88
+ "reason": {"type": "string"},
89
+ "note": {"type": "string"},
90
+ "correction": {"type": "string"},
91
+ "decision": {"type": "string"},
92
+ "evidence": {"type": "string"},
93
+ "kind": {"type": "string"},
94
+ "measure": {"type": "string"},
95
+ "placement": {"type": "string"}
96
+ }
97
+ },
98
+ "destination": {
99
+ "type": ["object", "null"],
100
+ "additionalProperties": false,
101
+ "required": ["implementation", "anchor", "package_id"],
102
+ "properties": {
103
+ "implementation": {"type": ["string", "array", "null"], "items": {"type": "string"}},
104
+ "anchor": {"type": ["string", "null"]},
105
+ "package_id": {"type": ["string", "null"]}
106
+ }
107
+ },
108
+ "evidence_item": {
109
+ "$comment": "design §12.1, evidence[]: a claim id with its evidence id, or the explicit unavailable form design §12.2 gives a legacy supporting session; runlib/ledger.py requires exactly one of the two forms (EVIDENCE_FORM)",
110
+ "type": "object",
111
+ "additionalProperties": false,
112
+ "minProperties": 2,
113
+ "dependentRequired": {"claim_id": ["evidence_id"], "evidence_id": ["claim_id"], "locator": ["session"], "session": ["locator"]},
114
+ "properties": {
115
+ "claim_id": {"type": "string", "minLength": 1},
116
+ "evidence_id": {"type": "string", "minLength": 1},
117
+ "locator": {"const": "unavailable"},
118
+ "session": {"type": "string", "minLength": 1}
119
+ }
120
+ },
121
+ "consequence": {
122
+ "type": "object",
123
+ "additionalProperties": false,
124
+ "required": ["kinds"],
125
+ "properties": {"kinds": {"type": "array", "items": {"type": "string", "minLength": 1}}}
126
+ },
127
+ "coverage": {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": ["basis"],
131
+ "properties": {"basis": {"enum": ["source", "view", "unavailable"]}}
132
+ },
133
+ "keep_record": {
134
+ "$comment": "A standing keep: the units it protects and, optionally, why. The rationale lives HERE rather than on the entry (F-34, D-20261111): an entry forbids additional properties, schema 1 carried the rationale as an entry-level `reason`, and a reader that kept reading the entry read a field schema 2 cannot hold.",
135
+ "type": ["object", "null"],
136
+ "additionalProperties": false,
137
+ "required": ["units"],
138
+ "properties": {"units": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}},
139
+ "reason": {"type": ["string", "null"]}}
140
+ },
141
+ "relations": {
142
+ "type": "object",
143
+ "additionalProperties": false,
144
+ "properties": {"instance_of": {"type": "string", "minLength": 1}}
145
+ },
146
+ "operation": {
147
+ "type": "object",
148
+ "additionalProperties": false,
149
+ "required": ["operation_id", "type", "target"],
150
+ "properties": {
151
+ "operation_id": {"type": "string", "minLength": 1},
152
+ "type": {"enum": ["create", "edit", "delete", "merge", "route"]},
153
+ "target": {"type": "string", "minLength": 1}
154
+ }
155
+ },
156
+ "applied": {
157
+ "type": ["object", "null"],
158
+ "additionalProperties": false,
159
+ "required": ["commit", "paths", "operations", "delivery"],
160
+ "properties": {
161
+ "commit": {"type": ["string", "null"]},
162
+ "paths": {"type": "array", "items": {"type": "string", "minLength": 1}},
163
+ "operations": {"type": "array", "items": {"$ref": "#/$defs/operation"}},
164
+ "delivery": {"enum": ["verified", "failed", "unverified", "not_applicable"]},
165
+ "before": {"$ref": "#/$defs/before_row"}
166
+ }
167
+ },
168
+ "before_row": {
169
+ "$comment": "the owner's decision of 2026-10-21 (design/session-distill/2026-10-21T1545--b324de5--writer-holds-the-transaction.md): for every row field this application changed, the value the row held immediately before it. `fields` carries the values, `absent` names the fields the row had none of, and runlib/ledger.py restores exactly this when the owner reverts the application. A decision design §12.2 migrated carries none",
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["fields", "absent"],
173
+ "properties": {
174
+ "fields": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "properties": {
178
+ "lesson": {"type": "string", "minLength": 1},
179
+ "principle": {"type": "string"},
180
+ "rationale": {"type": "string"},
181
+ "note": {"type": "string"},
182
+ "domain": {"type": "string"},
183
+ "absorbed_by": {"type": "string", "minLength": 1},
184
+ "retired": {"$ref": "#/$defs/date"},
185
+ "retire_reason": {"type": "string"},
186
+ "destination": {"$ref": "#/$defs/destination"},
187
+ "keep": {"$ref": "#/$defs/keep_record"},
188
+ "classification": {"$ref": "#/$defs/classification"},
189
+ "relations": {"$ref": "#/$defs/relations"},
190
+ "kind": {"$ref": "#/$defs/entry_kind"},
191
+ "diagnosis": {"$ref": "#/$defs/entry_diagnosis"}
192
+ }
193
+ },
194
+ "absent": {
195
+ "type": "array",
196
+ "uniqueItems": true,
197
+ "items": {"enum": ["lesson", "principle", "rationale", "note", "domain", "absorbed_by", "retired", "retire_reason",
198
+ "destination", "keep", "classification", "relations", "kind", "diagnosis"]}
199
+ }
200
+ }
201
+ },
202
+ "tests": {
203
+ "type": ["object", "null"],
204
+ "additionalProperties": false,
205
+ "required": ["results_sha", "summary", "attribution"],
206
+ "properties": {
207
+ "results_sha": {"type": "string", "minLength": 1},
208
+ "summary": {"type": "string"},
209
+ "attribution": {"type": "string"}
210
+ }
211
+ },
212
+ "counts": {
213
+ "type": "object",
214
+ "additionalProperties": false,
215
+ "required": ["eligible", "observed", "not_observed", "exposure_unknown"],
216
+ "properties": {
217
+ "eligible": {"type": "integer", "minimum": 0},
218
+ "observed": {"type": "integer", "minimum": 0},
219
+ "not_observed": {"type": "integer", "minimum": 0},
220
+ "exposure_unknown": {"type": "integer", "minimum": 0}
221
+ }
222
+ },
223
+ "resolution": {
224
+ "type": "object",
225
+ "additionalProperties": false,
226
+ "required": ["run", "window", "resolution", "basis", "counts", "occasions"],
227
+ "properties": {
228
+ "run": {"type": "string", "minLength": 1},
229
+ "window": {"$ref": "#/$defs/date"},
230
+ "resolution": {"enum": ["observed", "not_observed", "no_occasion", "pending"]},
231
+ "basis": {"enum": ["source", "view", "incomplete"]},
232
+ "counts": {"$ref": "#/$defs/counts"},
233
+ "occasions": {"type": "array", "items": {"type": "string", "minLength": 1}}
234
+ }
235
+ },
236
+ "expected_observation": {
237
+ "type": ["object", "null"],
238
+ "additionalProperties": false,
239
+ "required": ["occasion_criteria", "exposure_rule", "expected_behavior", "retrieval_terms", "expiry", "resolutions"],
240
+ "dependentRequired": {"counter": ["threshold"], "threshold": ["counter"]},
241
+ "properties": {
242
+ "occasion_criteria": {"type": "string", "minLength": 1},
243
+ "exposure_rule": {"type": "string", "minLength": 1},
244
+ "expected_behavior": {"type": "string", "minLength": 1},
245
+ "retrieval_terms": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
246
+ "expiry": {"type": "string", "minLength": 1},
247
+ "counter": {"type": "string", "minLength": 1},
248
+ "threshold": {"type": "number"},
249
+ "resolutions": {"type": "array", "items": {"$ref": "#/$defs/resolution"}}
250
+ }
251
+ },
252
+ "decision": {
253
+ "$comment": "design §12.1: the eight required keys. Everything optional below is contracted, with its reader and its reason, by design/session-distill/2026-10-21T0820--9b42df2--plan-addendum-wp13.md: at, field, legacy_text, legacy_placed, legacy_status, status_note and the three legacy kinds are design §12.2's metadata of a migrated element; reason is the reason design §7.3 and §12.3 ask of a keep, a drop and an awaiting-R record; kind revert marks the decision design §12.3 appends when the owner reverts an application",
254
+ "type": "object",
255
+ "additionalProperties": false,
256
+ "required": ["run", "disposition", "approval_id", "adjudication_id", "confirmation", "applied", "tests", "expected_observation"],
257
+ "properties": {
258
+ "run": {"type": "string", "minLength": 1},
259
+ "disposition": {"$ref": "#/$defs/legacy_disposition"},
260
+ "approval_id": {"type": "string", "minLength": 1},
261
+ "adjudication_id": {"type": ["string", "null"]},
262
+ "confirmation": {"type": ["string", "null"]},
263
+ "applied": {"$ref": "#/$defs/applied"},
264
+ "tests": {"$ref": "#/$defs/tests"},
265
+ "expected_observation": {"$ref": "#/$defs/expected_observation"},
266
+ "at": {"$comment": "design §12.2, a migrated element only", "$ref": "#/$defs/moment"},
267
+ "field": {"$comment": "design §12.2, a migrated element only", "type": "string", "minLength": 1},
268
+ "legacy_text": {"$comment": "design §12.2, a migrated element only", "type": "string"},
269
+ "legacy_placed": {"$comment": "design §12.2, a migrated element only", "$ref": "#/$defs/date"},
270
+ "legacy_status": {"$comment": "design §12.2, a migrated element only", "enum": ["incubating", "placed", "adopted-no-text", "absorbed", "retired"]},
271
+ "kind": {"$comment": "the three legacy kinds mark a migrated element; revert marks a decision a run made (design §12.3)", "enum": ["legacy_application", "legacy_retirement", "legacy_migration", "revert"]},
272
+ "status_note": {"$comment": "design §12.2, a migrated element only", "type": "string"},
273
+ "reason": {"$comment": "design §7.3 and §12.3: a keep, a drop and an awaiting-R record carry theirs", "type": "string", "minLength": 1},
274
+ "resolves": {"$comment": "design §7.1: a later decision names the incubate decision of the same entry it resolves, as <entry id>@<run>; contracted by the record FIELD_RECORDS names (WP-09 commit 3)", "type": "string", "pattern": "^[A-Z]+[0-9]*-[0-9]+@.+$"}
275
+ }
276
+ },
277
+ "entry": {
278
+ "type": "object",
279
+ "additionalProperties": false,
280
+ "required": ["id", "lesson", "status", "classification", "window", "kind", "diagnosis", "disposition", "destination", "evidence", "independent_lineages", "consequence", "coverage", "keep", "relations", "decisions"],
281
+ "properties": {
282
+ "id": {"type": "string", "pattern": "^[A-Z]+[0-9]*-[0-9]+$"},
283
+ "lesson": {"type": "string", "minLength": 1},
284
+ "principle": {"type": "string"},
285
+ "rationale": {"type": "string"},
286
+ "status": {"enum": ["incubating", "placed", "adopted-no-text", "absorbed", "retired"]},
287
+ "surfaced": {"$ref": "#/$defs/date"},
288
+ "domain": {"type": "string"},
289
+ "source": {"type": "string"},
290
+ "note": {"type": "string"},
291
+ "learning_id": {"type": "string", "minLength": 1},
292
+ "baseline_ref": {"type": "string"},
293
+ "window": {"type": "string", "pattern": "^([0-9]{4}-[0-9]{2}-[0-9]{2}|unknown)$"},
294
+ "classification": {"$ref": "#/$defs/classification"},
295
+ "recurrence": {"type": "array", "items": {"$ref": "#/$defs/recurrence_record"}},
296
+ "absorbed_by": {"type": "string", "minLength": 1},
297
+ "retired": {"$ref": "#/$defs/date"},
298
+ "retire_reason": {"type": "string"},
299
+ "kind": {"$ref": "#/$defs/entry_kind"},
300
+ "diagnosis": {"$ref": "#/$defs/entry_diagnosis"},
301
+ "disposition": {"$ref": "#/$defs/disposition"},
302
+ "destination": {"$ref": "#/$defs/destination"},
303
+ "evidence": {"type": "array", "items": {"$ref": "#/$defs/evidence_item"}},
304
+ "independent_lineages": {"type": ["integer", "string"], "minimum": 0, "pattern": "^unavailable$"},
305
+ "consequence": {"$ref": "#/$defs/consequence"},
306
+ "coverage": {"$ref": "#/$defs/coverage"},
307
+ "keep": {"$ref": "#/$defs/keep_record"},
308
+ "relations": {"$ref": "#/$defs/relations"},
309
+ "decisions": {"type": "array", "items": {"$ref": "#/$defs/decision"}}
310
+ }
311
+ }
312
+ }
313
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$comment": "design §11 (one instance: an occasion found and judged), with basis from design §5.4 set by code over the claim's scope; the field list is the implementation plan's WP-08 artifacts",
4
+ "title": "Observation instance",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["expected_id", "occasion_locator", "exposure", "verdict", "basis", "evidence_ids"],
8
+ "properties": {
9
+ "expected_id": {"type": "string", "minLength": 1},
10
+ "occasion_locator": {"type": "string", "minLength": 1},
11
+ "exposure": {"type": "string", "enum": ["eligible", "exposure_unknown"]},
12
+ "verdict": {"type": "string", "enum": ["observed", "not_observed"]},
13
+ "basis": {"type": "string", "enum": ["incomplete", "view", "source"]},
14
+ "evidence_ids": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}}
15
+ }
16
+ }