dna-sdk 0.1.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 (240) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/dist/adapters/embedding/onnx.d.ts +32 -0
  4. package/dist/adapters/embedding/onnx.js +51 -0
  5. package/dist/adapters/filesystem/cache.d.ts +16 -0
  6. package/dist/adapters/filesystem/cache.js +113 -0
  7. package/dist/adapters/filesystem/index.d.ts +2 -0
  8. package/dist/adapters/filesystem/index.js +2 -0
  9. package/dist/adapters/filesystem/source.d.ts +82 -0
  10. package/dist/adapters/filesystem/source.js +357 -0
  11. package/dist/adapters/postgres/index.d.ts +2 -0
  12. package/dist/adapters/postgres/index.js +2 -0
  13. package/dist/adapters/postgres/migrations.d.ts +14 -0
  14. package/dist/adapters/postgres/migrations.js +88 -0
  15. package/dist/adapters/postgres/source.d.ts +172 -0
  16. package/dist/adapters/postgres/source.js +569 -0
  17. package/dist/adapters/resolvers/github.d.ts +12 -0
  18. package/dist/adapters/resolvers/github.js +47 -0
  19. package/dist/adapters/resolvers/http.d.ts +22 -0
  20. package/dist/adapters/resolvers/http.js +145 -0
  21. package/dist/adapters/resolvers/index.d.ts +3 -0
  22. package/dist/adapters/resolvers/index.js +3 -0
  23. package/dist/adapters/resolvers/local.d.ts +24 -0
  24. package/dist/adapters/resolvers/local.js +132 -0
  25. package/dist/adapters/search/driver.d.ts +45 -0
  26. package/dist/adapters/search/driver.js +138 -0
  27. package/dist/adapters/search/migrations.d.ts +26 -0
  28. package/dist/adapters/search/migrations.js +58 -0
  29. package/dist/adapters/search/rrf.d.ts +23 -0
  30. package/dist/adapters/search/rrf.js +42 -0
  31. package/dist/adapters/search/sqlite-vec.d.ts +66 -0
  32. package/dist/adapters/search/sqlite-vec.js +294 -0
  33. package/dist/bootstrap.d.ts +45 -0
  34. package/dist/bootstrap.js +134 -0
  35. package/dist/extensions/agentskills/DOCS.md +18 -0
  36. package/dist/extensions/agentskills.d.ts +28 -0
  37. package/dist/extensions/agentskills.js +252 -0
  38. package/dist/extensions/agentsmd/DOCS.md +18 -0
  39. package/dist/extensions/agentsmd.d.ts +22 -0
  40. package/dist/extensions/agentsmd.js +170 -0
  41. package/dist/extensions/audit/kinds/audit-log.kind.yaml +148 -0
  42. package/dist/extensions/audit.d.ts +25 -0
  43. package/dist/extensions/audit.js +62 -0
  44. package/dist/extensions/automation/kinds/automation.kind.yaml +296 -0
  45. package/dist/extensions/automation/query.d.ts +49 -0
  46. package/dist/extensions/automation/query.js +77 -0
  47. package/dist/extensions/automation/write-guards.d.ts +59 -0
  48. package/dist/extensions/automation/write-guards.js +153 -0
  49. package/dist/extensions/automation.d.ts +41 -0
  50. package/dist/extensions/automation.js +54 -0
  51. package/dist/extensions/collab.d.ts +16 -0
  52. package/dist/extensions/collab.js +79 -0
  53. package/dist/extensions/doc/kinds/doc.kind.yaml +118 -0
  54. package/dist/extensions/doc.d.ts +25 -0
  55. package/dist/extensions/doc.js +10 -0
  56. package/dist/extensions/eval/kinds/eval-baseline.kind.yaml +65 -0
  57. package/dist/extensions/eval/kinds/eval-case.kind.yaml +140 -0
  58. package/dist/extensions/eval/kinds/eval-run.kind.yaml +134 -0
  59. package/dist/extensions/eval/kinds/eval-suite.kind.yaml +87 -0
  60. package/dist/extensions/eval.d.ts +24 -0
  61. package/dist/extensions/eval.js +31 -0
  62. package/dist/extensions/evidence/kinds/evidence.kind.yaml +92 -0
  63. package/dist/extensions/evidence.d.ts +17 -0
  64. package/dist/extensions/evidence.js +94 -0
  65. package/dist/extensions/federation.d.ts +22 -0
  66. package/dist/extensions/federation.js +173 -0
  67. package/dist/extensions/guardrails/DOCS.md +20 -0
  68. package/dist/extensions/guardrails.d.ts +31 -0
  69. package/dist/extensions/guardrails.js +228 -0
  70. package/dist/extensions/helix/DOCS-Actor.md +20 -0
  71. package/dist/extensions/helix/DOCS-Agent.md +20 -0
  72. package/dist/extensions/helix/DOCS-UseCase.md +20 -0
  73. package/dist/extensions/helix/layers.d.ts +12 -0
  74. package/dist/extensions/helix/layers.js +18 -0
  75. package/dist/extensions/helix/write-guards.d.ts +70 -0
  76. package/dist/extensions/helix/write-guards.js +172 -0
  77. package/dist/extensions/helix.d.ts +29 -0
  78. package/dist/extensions/helix.js +963 -0
  79. package/dist/extensions/helix_extras.d.ts +124 -0
  80. package/dist/extensions/helix_extras.js +328 -0
  81. package/dist/extensions/hooks.d.ts +31 -0
  82. package/dist/extensions/hooks.js +247 -0
  83. package/dist/extensions/kinddef/DOCS.md +24 -0
  84. package/dist/extensions/kinddef.d.ts +40 -0
  85. package/dist/extensions/kinddef.js +171 -0
  86. package/dist/extensions/lesson.d.ts +6 -0
  87. package/dist/extensions/lesson.js +194 -0
  88. package/dist/extensions/modelreg/kinds/model-profile.kind.yaml +155 -0
  89. package/dist/extensions/modelreg.d.ts +30 -0
  90. package/dist/extensions/modelreg.js +38 -0
  91. package/dist/extensions/recognizer.d.ts +34 -0
  92. package/dist/extensions/recognizer.js +272 -0
  93. package/dist/extensions/research.d.ts +32 -0
  94. package/dist/extensions/research.js +292 -0
  95. package/dist/extensions/safety.d.ts +33 -0
  96. package/dist/extensions/safety.js +230 -0
  97. package/dist/extensions/sdlc/kinds/adr.kind.yaml +136 -0
  98. package/dist/extensions/sdlc/kinds/archive-proposal.kind.yaml +107 -0
  99. package/dist/extensions/sdlc/kinds/changelog.kind.yaml +108 -0
  100. package/dist/extensions/sdlc/kinds/cognitive-policy.kind.yaml +470 -0
  101. package/dist/extensions/sdlc/kinds/forecast.kind.yaml +125 -0
  102. package/dist/extensions/sdlc/kinds/insight.kind.yaml +87 -0
  103. package/dist/extensions/sdlc/kinds/kaizen.kind.yaml +106 -0
  104. package/dist/extensions/sdlc/kinds/lesson-learned.kind.yaml +270 -0
  105. package/dist/extensions/sdlc/kinds/narrative.kind.yaml +189 -0
  106. package/dist/extensions/sdlc/kinds/pattern-insight.kind.yaml +204 -0
  107. package/dist/extensions/sdlc/kinds/postmortem.kind.yaml +168 -0
  108. package/dist/extensions/sdlc/kinds/pre-mortem.kind.yaml +145 -0
  109. package/dist/extensions/sdlc/kinds/prompt-template.kind.yaml +109 -0
  110. package/dist/extensions/sdlc/kinds/retrospective.kind.yaml +186 -0
  111. package/dist/extensions/sdlc/kinds/risk-register.kind.yaml +178 -0
  112. package/dist/extensions/sdlc/kinds/saved-view.kind.yaml +127 -0
  113. package/dist/extensions/sdlc/kinds/status-report.kind.yaml +129 -0
  114. package/dist/extensions/sdlc/kinds/synthesis-run.kind.yaml +279 -0
  115. package/dist/extensions/sdlc/kinds/synthesizer-state.kind.yaml +196 -0
  116. package/dist/extensions/sdlc/kinds/workflow-event.kind.yaml +195 -0
  117. package/dist/extensions/sdlc.d.ts +32 -0
  118. package/dist/extensions/sdlc.js +1318 -0
  119. package/dist/extensions/soulspec/DOCS.md +19 -0
  120. package/dist/extensions/soulspec.d.ts +22 -0
  121. package/dist/extensions/soulspec.js +287 -0
  122. package/dist/extensions/tenant.d.ts +6 -0
  123. package/dist/extensions/tenant.js +291 -0
  124. package/dist/extensions/testkit.d.ts +24 -0
  125. package/dist/extensions/testkit.js +211 -0
  126. package/dist/index.d.ts +80 -0
  127. package/dist/index.js +102 -0
  128. package/dist/kernel/_text.d.ts +28 -0
  129. package/dist/kernel/_text.js +42 -0
  130. package/dist/kernel/bundle-handle.d.ts +83 -0
  131. package/dist/kernel/bundle-handle.js +184 -0
  132. package/dist/kernel/capabilities.d.ts +157 -0
  133. package/dist/kernel/capabilities.js +109 -0
  134. package/dist/kernel/collaborator-ports.d.ts +91 -0
  135. package/dist/kernel/collaborator-ports.js +1 -0
  136. package/dist/kernel/composition-resolver.d.ts +215 -0
  137. package/dist/kernel/composition-resolver.js +558 -0
  138. package/dist/kernel/composition.d.ts +10 -0
  139. package/dist/kernel/composition.js +1 -0
  140. package/dist/kernel/descriptor-loader.d.ts +13 -0
  141. package/dist/kernel/descriptor-loader.js +48 -0
  142. package/dist/kernel/document.d.ts +43 -0
  143. package/dist/kernel/document.js +71 -0
  144. package/dist/kernel/embedding.d.ts +28 -0
  145. package/dist/kernel/embedding.js +78 -0
  146. package/dist/kernel/errors.d.ts +62 -0
  147. package/dist/kernel/errors.js +82 -0
  148. package/dist/kernel/events.d.ts +6 -0
  149. package/dist/kernel/events.js +21 -0
  150. package/dist/kernel/evidence-capture.d.ts +69 -0
  151. package/dist/kernel/evidence-capture.js +138 -0
  152. package/dist/kernel/fs.d.ts +20 -0
  153. package/dist/kernel/fs.js +128 -0
  154. package/dist/kernel/generic-rw.d.ts +33 -0
  155. package/dist/kernel/generic-rw.js +235 -0
  156. package/dist/kernel/hooks.d.ts +172 -0
  157. package/dist/kernel/hooks.js +256 -0
  158. package/dist/kernel/index.d.ts +624 -0
  159. package/dist/kernel/index.js +1638 -0
  160. package/dist/kernel/instance.d.ts +211 -0
  161. package/dist/kernel/instance.js +487 -0
  162. package/dist/kernel/kind-registry.d.ts +183 -0
  163. package/dist/kernel/kind-registry.js +710 -0
  164. package/dist/kernel/kind_base.d.ts +106 -0
  165. package/dist/kernel/kind_base.js +244 -0
  166. package/dist/kernel/layer-resolver.d.ts +48 -0
  167. package/dist/kernel/layer-resolver.js +284 -0
  168. package/dist/kernel/lock-manager.d.ts +21 -0
  169. package/dist/kernel/lock-manager.js +43 -0
  170. package/dist/kernel/lock.d.ts +38 -0
  171. package/dist/kernel/lock.js +115 -0
  172. package/dist/kernel/meta.d.ts +135 -0
  173. package/dist/kernel/meta.js +817 -0
  174. package/dist/kernel/models.d.ts +3089 -0
  175. package/dist/kernel/models.js +764 -0
  176. package/dist/kernel/navigator.d.ts +36 -0
  177. package/dist/kernel/navigator.js +132 -0
  178. package/dist/kernel/port-surface.d.ts +33 -0
  179. package/dist/kernel/port-surface.js +180 -0
  180. package/dist/kernel/preview.d.ts +60 -0
  181. package/dist/kernel/preview.js +54 -0
  182. package/dist/kernel/prompt-budget.d.ts +39 -0
  183. package/dist/kernel/prompt-budget.js +43 -0
  184. package/dist/kernel/prompt-builder.d.ts +25 -0
  185. package/dist/kernel/prompt-builder.js +237 -0
  186. package/dist/kernel/protocols.d.ts +751 -0
  187. package/dist/kernel/protocols.js +493 -0
  188. package/dist/kernel/reports.d.ts +26 -0
  189. package/dist/kernel/reports.js +215 -0
  190. package/dist/kernel/resolver.d.ts +146 -0
  191. package/dist/kernel/resolver.js +232 -0
  192. package/dist/kernel/resource.d.ts +57 -0
  193. package/dist/kernel/resource.js +97 -0
  194. package/dist/kernel/runtime.d.ts +16 -0
  195. package/dist/kernel/runtime.js +18 -0
  196. package/dist/kernel/safety-scanner.d.ts +38 -0
  197. package/dist/kernel/safety-scanner.js +228 -0
  198. package/dist/kernel/serialize-to-files.d.ts +29 -0
  199. package/dist/kernel/serialize-to-files.js +23 -0
  200. package/dist/kernel/spec-access.d.ts +23 -0
  201. package/dist/kernel/spec-access.js +40 -0
  202. package/dist/kernel/studio_ui.d.ts +88 -0
  203. package/dist/kernel/studio_ui.js +135 -0
  204. package/dist/kernel/templates.d.ts +77 -0
  205. package/dist/kernel/templates.js +116 -0
  206. package/dist/kernel/tool-registry.d.ts +52 -0
  207. package/dist/kernel/tool-registry.js +89 -0
  208. package/dist/kernel/write-pipeline.d.ts +65 -0
  209. package/dist/kernel/write-pipeline.js +271 -0
  210. package/dist/kernel/writer-helpers.d.ts +24 -0
  211. package/dist/kernel/writer-helpers.js +42 -0
  212. package/dist/memory/decay.d.ts +31 -0
  213. package/dist/memory/decay.js +97 -0
  214. package/dist/memory/ecphory.d.ts +25 -0
  215. package/dist/memory/ecphory.js +178 -0
  216. package/dist/memory/encodingContext.d.ts +21 -0
  217. package/dist/memory/encodingContext.js +62 -0
  218. package/dist/memory/index.d.ts +23 -0
  219. package/dist/memory/index.js +23 -0
  220. package/dist/memory/memoryType.d.ts +7 -0
  221. package/dist/memory/memoryType.js +24 -0
  222. package/dist/memory/policy.d.ts +35 -0
  223. package/dist/memory/policy.js +35 -0
  224. package/dist/memory/retrieval.d.ts +21 -0
  225. package/dist/memory/retrieval.js +145 -0
  226. package/dist/testing/index.d.ts +8 -0
  227. package/dist/testing/index.js +8 -0
  228. package/dist/testing/recordSearchConformance.d.ts +43 -0
  229. package/dist/testing/recordSearchConformance.js +147 -0
  230. package/dist/viz/ascii.d.ts +7 -0
  231. package/dist/viz/ascii.js +60 -0
  232. package/dist/viz/health.d.ts +8 -0
  233. package/dist/viz/health.js +161 -0
  234. package/dist/viz/index.d.ts +10 -0
  235. package/dist/viz/index.js +10 -0
  236. package/dist/viz/matrix.d.ts +8 -0
  237. package/dist/viz/matrix.js +84 -0
  238. package/dist/viz/mermaid.d.ts +38 -0
  239. package/dist/viz/mermaid.js +706 -0
  240. package/package.json +82 -0
@@ -0,0 +1,125 @@
1
+ # Forecast — falseable forward-looking prediction (record plane).
2
+ # would_change predictions are verified at outcome_check_at by the
3
+ # cognitive/verification.py loop. Pair: SynthesisRun (oneiric, non-falseable).
4
+ #
5
+ # F3 lote-2 (spec 2026-06-10-kinds-descriptor-f3): synthesized from this
6
+ # descriptor; the hand-written class twins were deleted. PARITY-CRITICAL
7
+ # package data — byte-identical mirror under packages/sdk-{py,ts};
8
+ # tests/test_descriptor_hash_parity.py enforces. Equivalence vs the extinct
9
+ # class frozen in tests/test_lote2_descriptor_equivalence.py (golden:
10
+ # tests/goldens/lote2/Forecast.golden.json). Deltas intencionais (semântica
11
+ # canônica = port): summary curado substitui o eco whole-spec do KindBase
12
+ # default (list endpoints não usam kp.summary()); parse valida contra o
13
+ # schema (classe era pass-through); to_card morto não migrado.
14
+ apiVersion: github.com/ruinosus/dna/core/v1
15
+ kind: KindDefinition
16
+ metadata:
17
+ name: forecast
18
+ spec:
19
+ target_api_version: github.com/ruinosus/dna/sdlc/v1
20
+ target_kind: Forecast
21
+ alias: sdlc-forecast
22
+ origin: github.com/ruinosus/dna/sdlc
23
+ tenant_scope: global
24
+ plane: record
25
+ prompt_target: false
26
+ flatten_in_context: false
27
+ prompt_target_priority: 0
28
+ storage:
29
+ type: bundle
30
+ container: forecasts
31
+ marker: FORECAST.md
32
+ body_field: body
33
+ schema:
34
+ type: object
35
+ required:
36
+ - forecaster
37
+ - timeframe
38
+ - scope_ref
39
+ - scenario
40
+ - would_change
41
+ - evidence_from_present
42
+ - status
43
+ - outcome_check_at
44
+ properties:
45
+ forecaster:
46
+ type: string
47
+ description: Author — oracle slug or 'user'.
48
+ timeframe:
49
+ type: string
50
+ enum:
51
+ - in-7d
52
+ - in-30d
53
+ - in-90d
54
+ - in-1y
55
+ scope_ref:
56
+ type: string
57
+ lens:
58
+ type: string
59
+ description: Optional perspective tag (optimism|risk|friction|opportunity|neutral).
60
+ scenario:
61
+ type: string
62
+ maxLength: 2000
63
+ description: Prose framing of the hypothesis.
64
+ would_change:
65
+ type: array
66
+ items:
67
+ type: object
68
+ required:
69
+ - metric
70
+ - from
71
+ - to
72
+ properties:
73
+ metric:
74
+ type: string
75
+ from: {}
76
+ to: {}
77
+ by:
78
+ type: string
79
+ minItems: 1
80
+ description: Predictions checked by verification.py.
81
+ evidence_from_present:
82
+ type: array
83
+ items:
84
+ type: string
85
+ default: []
86
+ status:
87
+ type: string
88
+ enum:
89
+ - drafted
90
+ - observing
91
+ - fulfilled
92
+ - refuted
93
+ - expired
94
+ outcome_check_at:
95
+ type: string
96
+ format: date-time
97
+ drafted_at:
98
+ type: string
99
+ format: date-time
100
+ resolved_at:
101
+ type: string
102
+ format: date-time
103
+ verifications:
104
+ type: array
105
+ items:
106
+ type: object
107
+ default: []
108
+ description: Audit trail appended by verification loop.
109
+ generated_by:
110
+ type: string
111
+ source_oracle:
112
+ type: string
113
+ summary:
114
+ forecaster: ''
115
+ lens: null
116
+ status: ''
117
+ graph_style:
118
+ fill: '#60A5FA'
119
+ stroke: '#2563EB'
120
+ text_color: '#fff'
121
+ ascii_icon: 📊
122
+ display_label: Forecasts
123
+ docs: Forecast = falseable hypothesis. would_change predictions are verified at
124
+ outcome_check_at by the cognitive/verification.py loop. Authored by oracles or
125
+ user. Pair with SynthesisRun (oneiric artefact, non-falseable processing).
@@ -0,0 +1,87 @@
1
+ # Insight — SLIM metadata binding a perpetual question to a target UA
2
+ # (record plane; s-insight-slim-refactor). The UA owns persona + heuristics
3
+ # + LLM config; the runner iterates active Insights and dispatches each.
4
+ #
5
+ # F3 lote-2 (spec 2026-06-10-kinds-descriptor-f3): synthesized from this
6
+ # descriptor; the hand-written class twins were deleted. PARITY-CRITICAL
7
+ # package data — byte-identical mirror under packages/sdk-{py,ts};
8
+ # tests/test_descriptor_hash_parity.py enforces. Equivalence vs the extinct
9
+ # class frozen in tests/test_lote2_descriptor_equivalence.py (golden:
10
+ # tests/goldens/lote2/Insight.golden.json). Deltas intencionais (semântica
11
+ # canônica = port): summary curado substitui o eco whole-spec do KindBase
12
+ # default (list endpoints não usam kp.summary()); parse valida contra o
13
+ # schema (classe era pass-through); to_card morto não migrado.
14
+ apiVersion: github.com/ruinosus/dna/core/v1
15
+ kind: KindDefinition
16
+ metadata:
17
+ name: insight
18
+ spec:
19
+ target_api_version: github.com/ruinosus/dna/sdlc/v1
20
+ target_kind: Insight
21
+ alias: sdlc-insight
22
+ origin: github.com/ruinosus/dna/sdlc
23
+ tenant_scope: global
24
+ plane: record
25
+ prompt_target: false
26
+ flatten_in_context: false
27
+ prompt_target_priority: 0
28
+ storage:
29
+ type: bundle
30
+ container: insights
31
+ marker: INSIGHT.md
32
+ body_field: description
33
+ schema:
34
+ type: object
35
+ required:
36
+ - question
37
+ - target_ua
38
+ properties:
39
+ question:
40
+ type: string
41
+ description: The perpetual question this oracle pursues.
42
+ target_ua:
43
+ type: string
44
+ description: Slug of the Agent that runs this oracle (e.g. 'oracle-health').
45
+ The UA owns the persona, tools, and LLM config — Insight only points.
46
+ icon:
47
+ type: string
48
+ description: Single emoji shown next to the oracle.
49
+ cadence_hours:
50
+ type: integer
51
+ minimum: 0
52
+ default: 24
53
+ description: How often the runner re-dispatches the target_ua. 0 disables
54
+ auto-run (manual only via /agent endpoint).
55
+ evidence_kinds:
56
+ type: array
57
+ items:
58
+ type: string
59
+ description: Hint of which Kinds the target_ua should read. Informational
60
+ — the UA itself decides via its tools.
61
+ active:
62
+ type: boolean
63
+ default: true
64
+ description: False to disable without deleting.
65
+ tags:
66
+ type: array
67
+ items:
68
+ type: string
69
+ description:
70
+ type: string
71
+ description: Optional 1-2 sentence human description of what this oracle answers.
72
+ The INSIGHT.md body.
73
+ summary:
74
+ question: ''
75
+ target_ua: ''
76
+ icon: ''
77
+ active: true
78
+ graph_style:
79
+ fill: '#7C3AED'
80
+ stroke: '#5B21B6'
81
+ text_color: '#fff'
82
+ ascii_icon: 🔮
83
+ display_label: Insights
84
+ docs: An Insight binds a perpetual question to a target UA (oracle-X). The UA owns
85
+ the persona + heuristics + LLM selection. The runner iterates active Insights
86
+ and dispatches each to its target_ua, which emits an StatusReport via create_status_report
87
+ tool.
@@ -0,0 +1,106 @@
1
+ # Kaizen — a continuous-improvement observation, first-class (record plane).
2
+ #
3
+ # The kaizen discipline (skill .claude/skills/kaizen): while working on ANY
4
+ # task, noticing something improvable — a code smell, flow friction, a
5
+ # repeated manual step, something hardcoded, a missing test/doc — and
6
+ # flagging it WITHOUT derailing the current task. Historically these lived
7
+ # only as `kaizen` timeline events on work items (`dna sdlc kaizen <wi>
8
+ # --body`) — visible in the FOCUS feed but not queryable/searchable as docs.
9
+ #
10
+ # s-kaizen-kind: each observation is ALSO a Kaizen doc, so the backlog of
11
+ # noticed-but-not-yet-routed improvements is queryable (kernel.query),
12
+ # embeddable (semantic search), and auditable. Arc: observed (noticed) →
13
+ # routed (an Issue/Story tracks the fix) → resolved (fix shipped).
14
+ #
15
+ # F3 P2 pilot (spec 2026-06-10-kinds-descriptor-f3): first builtin Kind
16
+ # expressed as a descriptor instead of twin Py/TS classes. PARITY-CRITICAL
17
+ # package data — the byte-identical mirror lives at
18
+ # packages/sdk-{py,ts}/{dna/extensions,src/extensions}/sdlc/kinds/
19
+ # kaizen.kind.yaml; edit one side, copy to the other byte-for-byte
20
+ # (tests/test_descriptor_hash_parity.py enforces).
21
+ apiVersion: github.com/ruinosus/dna/core/v1
22
+ kind: KindDefinition
23
+ metadata:
24
+ name: kaizen
25
+ spec:
26
+ target_api_version: github.com/ruinosus/dna/sdlc/v1
27
+ target_kind: Kaizen
28
+ alias: sdlc-kaizen
29
+ origin: github.com/ruinosus/dna/sdlc
30
+ # SDLC primitives are project-level, not per-tenant.
31
+ tenant_scope: global
32
+ # Record plane — pure typed document: cacheless writes, never composes
33
+ # into agent prompts.
34
+ plane: record
35
+ prompt_target: false
36
+ flatten_in_context: false
37
+ prompt_target_priority: 0
38
+ storage:
39
+ type: yaml
40
+ container: kaizens
41
+ # `work_item` is intentionally NOT here: it's a polymorphic "Kind/slug"
42
+ # string (Story/s-x, Issue/i-1, Spike/...) and dep_filters can only
43
+ # target ONE kind. `issue` is the routed-fix tracker and is an Issue
44
+ # slug by convention.
45
+ dep_filters:
46
+ issue: sdlc-issue
47
+ schema:
48
+ type: object
49
+ required: [body, status]
50
+ properties:
51
+ body:
52
+ type: string
53
+ description: The kaizen observation (what could be better).
54
+ work_item:
55
+ type: string
56
+ description: "Kind/slug of the work item where this was observed (polymorphic — Story/Spike/Issue)."
57
+ issue:
58
+ type: string
59
+ description: Issue/Story slug tracking the fix.
60
+ status:
61
+ type: string
62
+ enum: [observed, routed, resolved]
63
+ default: observed
64
+ description: "Observation arc: observed (flagged) → routed (fix tracked in `issue`) → resolved (fix shipped)."
65
+ actor:
66
+ type: string
67
+ description: Who flagged it.
68
+ labels:
69
+ type: array
70
+ items:
71
+ type: string
72
+ description: Free-form theme tags (weighted into semantic-search source text).
73
+ created_at:
74
+ type: string
75
+ format: date-time
76
+ updated_at:
77
+ type: string
78
+ format: date-time
79
+ # Strict (s-strict-schema-lint ratchet): new Kinds ship
80
+ # additionalProperties:false — schema is a contract.
81
+ additionalProperties: false
82
+ # List-endpoint projection ({field: default}).
83
+ summary:
84
+ status: observed
85
+ work_item: ""
86
+ issue: ""
87
+ actor: ""
88
+ labels: []
89
+ # Embedding source text (D4 derivation): essence is the observation body
90
+ # + labels (free-form tags like "dx", "hardcoded"). work_item/issue are
91
+ # slugs, not topical signal — found via refs, not embedding.
92
+ embed: [body, labels]
93
+ graph_style:
94
+ fill: "#10B981"
95
+ stroke: "#047857"
96
+ text_color: "#fff"
97
+ ascii_icon: "♻️"
98
+ display_label: Kaizens
99
+ docs: >-
100
+ A Kaizen is a continuous-improvement observation noticed while
101
+ working on something else — a smell, friction, a manual step, a
102
+ missing test — captured as a first-class doc WITHOUT derailing
103
+ the task at hand. Arc: observed → routed (an Issue/Story tracks
104
+ the fix) → resolved (fix shipped). Twin of the `kaizen` timeline
105
+ event on the originating work item (which carries a ref back to
106
+ this doc).
@@ -0,0 +1,270 @@
1
+ # LessonLearned — affective recall artifact (record plane; memory triad).
2
+ #
3
+ # Surfaces unbidden when the current cycle resembles a past one in the same
4
+ # area. Authored by the Sage oracle during the deep-sleep ritual (mostly) or
5
+ # manually. Body prose lives in the bundle marker (LESSON_LEARNED.md);
6
+ # structured fields in the YAML frontmatter. Studio surface label is
7
+ # enterprise pt-BR ("Lições Aprendidas" — s-sdlcv2-memorias-market-viz).
8
+ #
9
+ # F3 lote-1 (spec 2026-06-10-kinds-descriptor-f3): synthesized from this
10
+ # descriptor; the twin LessonLearnedKind classes (Py+TS) were deleted.
11
+ # PARITY-CRITICAL package data — byte-identical mirror under
12
+ # packages/sdk-{py,ts}; tests/test_descriptor_hash_parity.py enforces.
13
+ # O descriptor cura um drift real Py↔TS: a classe TS era strict e NÃO tinha
14
+ # affect_reason/affect_evidence_refs/encoding extras — o canônico é a
15
+ # superfície Py (o que kinds-api serve em produção). A classe Py tinha um
16
+ # to_card morto (zero consumidores) — não migrado de propósito.
17
+ # `embed:` substitui o branch hardcoded de source_text_for + a entrada no
18
+ # frozenset legado EMBEDDABLE_KINDS (F3 D4) — mesmos campos, mesmo join.
19
+ apiVersion: github.com/ruinosus/dna/core/v1
20
+ kind: KindDefinition
21
+ metadata:
22
+ name: lesson-learned
23
+ spec:
24
+ target_api_version: github.com/ruinosus/dna/sdlc/v1
25
+ target_kind: LessonLearned
26
+ alias: sdlc-lesson-learned
27
+ origin: github.com/ruinosus/dna/sdlc
28
+ tenant_scope: global
29
+ plane: record
30
+ prompt_target: false
31
+ flatten_in_context: false
32
+ prompt_target_priority: 0
33
+ scope_inheritable: false
34
+ storage:
35
+ type: bundle
36
+ container: lessons-learned
37
+ marker: LESSON_LEARNED.md
38
+ body_field: body
39
+ schema:
40
+ type: object
41
+ required:
42
+ - area
43
+ - surface_when
44
+ - source_refs
45
+ - affect
46
+ - summary
47
+ properties:
48
+ area:
49
+ type: string
50
+ description: 'Scoped target: Feature/X, Epic/Y, or Roadmap/Z. The LessonLearned
51
+ surfaces when this area is touched.'
52
+ surface_when:
53
+ type: array
54
+ items:
55
+ type: string
56
+ enum:
57
+ - feature_touched
58
+ - cycle_open
59
+ - session_start
60
+ - oracle_consult
61
+ minItems: 1
62
+ description: Triggers that surface this LessonLearned. Mirrors how human
63
+ recall fires unbidden in context.
64
+ source_refs:
65
+ type: array
66
+ items:
67
+ type: string
68
+ minItems: 1
69
+ description: Pointers to source artifacts (Narrative/X, WorkflowEvent/Y,
70
+ etc.) that this memory derives from.
71
+ affect:
72
+ type: string
73
+ enum:
74
+ - triumph
75
+ - regret
76
+ - surprise
77
+ - wistful
78
+ - ominous
79
+ description: 'Emotional tone. Evocative palette (Spec §15 decision): triumph,
80
+ regret, surprise, wistful, ominous.'
81
+ affect_reason:
82
+ type: string
83
+ minLength: 20
84
+ description: Story s-remembrance-affect-reason-required. Concrete justification
85
+ for the chosen affect — names specific slugs/SHAs/AC counts/state. NOT
86
+ generic ('Story closed', 'shipped successfully'). Validator rejects writes
87
+ that lack reason OR have boilerplate. Required for high-stakes affects
88
+ (regret/ominous/surprise); optional for triumph/wistful but encouraged.
89
+ affect_evidence_refs:
90
+ type: array
91
+ items:
92
+ type: string
93
+ description: Concrete refs (rem-X, verdict-Y, Story/s-Z) that back the affect
94
+ choice. Required for high-stakes affects so the LLM's claim is auditable
95
+ against actual artifacts in the manifest.
96
+ summary:
97
+ type: string
98
+ maxLength: 280
99
+ description: 1-2 sentence 'Lembre-se de...' — the recalled essence.
100
+ relevance_decay_seed:
101
+ type: number
102
+ default: 0.95
103
+ description: Multiplicative decay factor applied per 24h. Default 0.95 (~30%
104
+ relevance after 14 days).
105
+ last_surfaced:
106
+ type: string
107
+ format: date-time
108
+ description: Auto-stamped on each surfacing; null until first surface.
109
+ surface_count:
110
+ type: integer
111
+ default: 0
112
+ description: Increments on each surface. Damps re-surfacing via scoring
113
+ formula in retrieval.py.
114
+ confidence_score:
115
+ type: number
116
+ default: 1.0
117
+ description: Semon engram intensity. Multiplies BM25 score in retrieval.
118
+ Bumps when homophonic LessonsLearned (same area) are filed — engrams reinforce
119
+ each other. Decays with surface_count for hygiene.
120
+ cues_history:
121
+ type: array
122
+ items:
123
+ type: object
124
+ properties:
125
+ at:
126
+ type: string
127
+ format: date-time
128
+ cue:
129
+ type: string
130
+ actor:
131
+ type: string
132
+ default: []
133
+ description: Semon ecforia trace. Each time the LessonLearned is surfaced
134
+ via remember(), the cue (query + actor + timestamp) is appended. History
135
+ of WHY this memory kept getting recalled.
136
+ revisions:
137
+ type: array
138
+ items:
139
+ type: object
140
+ properties:
141
+ at:
142
+ type: string
143
+ format: date-time
144
+ by:
145
+ type: string
146
+ delta:
147
+ type: string
148
+ default: []
149
+ description: Reconsolidation log (Nader 2000 / neo-Semon). Append-only when
150
+ a recall reawakens the engram and the consumer updates the summary.
151
+ tags:
152
+ type: array
153
+ items:
154
+ type: string
155
+ default: []
156
+ owner:
157
+ type: string
158
+ description: 'ATTRIBUTION: which agent authored this memory (e.g. claude-code,
159
+ jarvis). Orthogonal to scope + to tenant (tenant separates USERS, owner
160
+ separates AGENTS). Recall AUDIENCE is governed by `visibility`, NOT by
161
+ owner (s-agent-memory-phase-0-bridge, 2026-06-02 — supersedes the 2026-05-17
162
+ owner-implies-private semantics). When absent: an unowned/project lesson
163
+ (shared).'
164
+ visibility:
165
+ type: string
166
+ enum:
167
+ - shared
168
+ - private
169
+ - pinned
170
+ - archived
171
+ default: shared
172
+ description: 'Recall audience (the customization axis): shared = all agents
173
+ in scope recall it (cross-agent knowledge, default); private = only `owner`
174
+ recalls it (an agent''s raw working memory); pinned = always injected
175
+ into working memory at bootstrap, bypassing recall scoring (the Letta
176
+ ''memory block''); archived = retained + auditable but excluded from default
177
+ recall (soft-forget). Humans audit ALL regardless of visibility (audit
178
+ != recall). Phase 0 (2026-06-02).'
179
+ memory_type:
180
+ type: string
181
+ enum:
182
+ - episodic
183
+ - semantic
184
+ - procedural
185
+ description: 'CoALA taxonomy — ORTHOGONAL to the Semon EngramState (type
186
+ vs state): episodic = what happened (instance/sequence); semantic = a
187
+ generalized fact about the world/user; procedural = how to act (a skill/rule).
188
+ Absent = untyped (legacy).'
189
+ valid_from:
190
+ type: string
191
+ format: date-time
192
+ description: 'World-time validity start (Zep bi-temporal). Default: created_at.'
193
+ valid_to:
194
+ type: string
195
+ format: date-time
196
+ description: World-time validity end. Set when superseded/contradicted —
197
+ the memory is INVALIDATED, never hard-deleted. Default recall excludes
198
+ valid_to<now.
199
+ superseded_by_memory:
200
+ type: string
201
+ description: Name of the memory that invalidated this one (not `superseded_by`
202
+ — that's an ADR dep_filter token). Pairs with valid_to for point-in-time
203
+ audit.
204
+ encoding_context:
205
+ type: object
206
+ description: Snapshot of the conditions at engraphy. semon-recaller scores
207
+ ecphory candidates by partial-match against this dict.
208
+ properties:
209
+ area:
210
+ type: string
211
+ affect:
212
+ type: string
213
+ co_topics:
214
+ type: array
215
+ items:
216
+ type: string
217
+ description: Last 3-5 topic tags active at engraphy.
218
+ source_refs:
219
+ type: array
220
+ items:
221
+ type: string
222
+ time_of_day:
223
+ type: string
224
+ description: morning|afternoon|evening|night — coarse temporal cue.
225
+ day_of_week:
226
+ type: string
227
+ engraphed_by:
228
+ type: string
229
+ description: Agent slug that decided to engraph (semon-scribe by default).
230
+ additionalProperties: true
231
+ homophonic_links:
232
+ type: array
233
+ description: Semon homophony — engrams sharing substrate features. Each
234
+ link records target + resonance score + basis. semon-recaller propagates
235
+ a small strength boost (+0.02) to neighbors on ecphory (resonance).
236
+ items:
237
+ type: object
238
+ properties:
239
+ target_name:
240
+ type: string
241
+ resonance_score:
242
+ type: number
243
+ minimum: 0
244
+ maximum: 1
245
+ basis:
246
+ type: string
247
+ description: co-area | co-affect | co-temporal | semantic | manual
248
+ required:
249
+ - target_name
250
+ default: []
251
+ # Curated list/tree projection. DELTA INTENCIONAL vs a classe extinta: o
252
+ # KindBase default ecoava o spec INTEIRO no navigator — gordo demais. Os
253
+ # campos abaixo são a essência que a classe TS (summary) e o to_card morto
254
+ # já elegiam. List endpoints (/docs/{kind}) não usam summary() — payloads
255
+ # de produção inalterados (pinado no teste de equivalência).
256
+ summary:
257
+ area: ''
258
+ affect: ''
259
+ summary: ''
260
+ surface_count: 0
261
+ owner: null
262
+ embed:
263
+ - summary
264
+ - body
265
+ graph_style:
266
+ fill: '#FBBF24'
267
+ stroke: '#D97706'
268
+ text_color: '#fff'
269
+ ascii_icon: 💭
270
+ display_label: Lições Aprendidas