@latysh-development/monolith 0.0.0-stage → 0.1.0-alpha.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 (291) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +132 -2
  3. package/dist/brief/cli.d.ts +30 -0
  4. package/dist/brief/cli.d.ts.map +1 -0
  5. package/dist/brief/cli.js +85 -0
  6. package/dist/brief/collect.d.ts +17 -0
  7. package/dist/brief/collect.d.ts.map +1 -0
  8. package/dist/brief/collect.js +302 -0
  9. package/dist/brief/config.d.ts +40 -0
  10. package/dist/brief/config.d.ts.map +1 -0
  11. package/dist/brief/config.js +85 -0
  12. package/dist/brief/constants.d.ts +10 -0
  13. package/dist/brief/constants.d.ts.map +1 -0
  14. package/dist/brief/constants.js +9 -0
  15. package/dist/brief/docs.d.ts +53 -0
  16. package/dist/brief/docs.d.ts.map +1 -0
  17. package/dist/brief/docs.js +229 -0
  18. package/dist/brief/freshness.d.ts +104 -0
  19. package/dist/brief/freshness.d.ts.map +1 -0
  20. package/dist/brief/freshness.js +263 -0
  21. package/dist/brief/git-signals.d.ts +17 -0
  22. package/dist/brief/git-signals.d.ts.map +1 -0
  23. package/dist/brief/git-signals.js +101 -0
  24. package/dist/brief/index.d.ts +11 -0
  25. package/dist/brief/index.d.ts.map +1 -0
  26. package/dist/brief/index.js +5 -0
  27. package/dist/brief/reconcile.d.ts +75 -0
  28. package/dist/brief/reconcile.d.ts.map +1 -0
  29. package/dist/brief/reconcile.js +259 -0
  30. package/dist/brief/render.d.ts +60 -0
  31. package/dist/brief/render.d.ts.map +1 -0
  32. package/dist/brief/render.js +407 -0
  33. package/dist/brief/sanitize.d.ts +38 -0
  34. package/dist/brief/sanitize.d.ts.map +1 -0
  35. package/dist/brief/sanitize.js +48 -0
  36. package/dist/brief/selectors.d.ts +36 -0
  37. package/dist/brief/selectors.d.ts.map +1 -0
  38. package/dist/brief/selectors.js +75 -0
  39. package/dist/brief/story.d.ts +18 -0
  40. package/dist/brief/story.d.ts.map +1 -0
  41. package/dist/brief/story.js +59 -0
  42. package/dist/brief/types.d.ts +110 -0
  43. package/dist/brief/types.d.ts.map +1 -0
  44. package/dist/brief/types.js +11 -0
  45. package/dist/cli/index.d.ts +3 -0
  46. package/dist/cli/index.d.ts.map +1 -0
  47. package/dist/cli/index.js +166 -0
  48. package/dist/cli/init-args.d.ts +16 -0
  49. package/dist/cli/init-args.d.ts.map +1 -0
  50. package/dist/cli/init-args.js +24 -0
  51. package/dist/cli/ui-args.d.ts +23 -0
  52. package/dist/cli/ui-args.d.ts.map +1 -0
  53. package/dist/cli/ui-args.js +66 -0
  54. package/dist/cli/ui.d.ts +40 -0
  55. package/dist/cli/ui.d.ts.map +1 -0
  56. package/dist/cli/ui.js +180 -0
  57. package/dist/coordinatorium/checkpoint.d.ts +44 -0
  58. package/dist/coordinatorium/checkpoint.d.ts.map +1 -0
  59. package/dist/coordinatorium/checkpoint.js +124 -0
  60. package/dist/coordinatorium/cli.d.ts +39 -0
  61. package/dist/coordinatorium/cli.d.ts.map +1 -0
  62. package/dist/coordinatorium/cli.js +203 -0
  63. package/dist/coordinatorium/errors.d.ts +112 -0
  64. package/dist/coordinatorium/errors.d.ts.map +1 -0
  65. package/dist/coordinatorium/errors.js +145 -0
  66. package/dist/coordinatorium/index.d.ts +11 -0
  67. package/dist/coordinatorium/index.d.ts.map +1 -0
  68. package/dist/coordinatorium/index.js +5 -0
  69. package/dist/coordinatorium/lock.d.ts +187 -0
  70. package/dist/coordinatorium/lock.d.ts.map +1 -0
  71. package/dist/coordinatorium/lock.js +659 -0
  72. package/dist/coordinatorium/mission.d.ts +32 -0
  73. package/dist/coordinatorium/mission.d.ts.map +1 -0
  74. package/dist/coordinatorium/mission.js +87 -0
  75. package/dist/coordinatorium/state-keeper.d.ts +115 -0
  76. package/dist/coordinatorium/state-keeper.d.ts.map +1 -0
  77. package/dist/coordinatorium/state-keeper.js +396 -0
  78. package/dist/coordinatorium/types.d.ts +69 -0
  79. package/dist/coordinatorium/types.d.ts.map +1 -0
  80. package/dist/coordinatorium/types.js +27 -0
  81. package/dist/durable/assess.d.ts +105 -0
  82. package/dist/durable/assess.d.ts.map +1 -0
  83. package/dist/durable/assess.js +239 -0
  84. package/dist/durable/canonical.d.ts +25 -0
  85. package/dist/durable/canonical.d.ts.map +1 -0
  86. package/dist/durable/canonical.js +78 -0
  87. package/dist/durable/cli.d.ts +37 -0
  88. package/dist/durable/cli.d.ts.map +1 -0
  89. package/dist/durable/cli.js +141 -0
  90. package/dist/durable/errors.d.ts +188 -0
  91. package/dist/durable/errors.d.ts.map +1 -0
  92. package/dist/durable/errors.js +317 -0
  93. package/dist/durable/fs-store.d.ts +233 -0
  94. package/dist/durable/fs-store.d.ts.map +1 -0
  95. package/dist/durable/fs-store.js +1393 -0
  96. package/dist/durable/index.d.ts +20 -0
  97. package/dist/durable/index.d.ts.map +1 -0
  98. package/dist/durable/index.js +13 -0
  99. package/dist/durable/log.d.ts +33 -0
  100. package/dist/durable/log.d.ts.map +1 -0
  101. package/dist/durable/log.js +157 -0
  102. package/dist/durable/memory-store.d.ts +51 -0
  103. package/dist/durable/memory-store.d.ts.map +1 -0
  104. package/dist/durable/memory-store.js +302 -0
  105. package/dist/durable/projection.d.ts +35 -0
  106. package/dist/durable/projection.d.ts.map +1 -0
  107. package/dist/durable/projection.js +328 -0
  108. package/dist/durable/prune-check.d.ts +17 -0
  109. package/dist/durable/prune-check.d.ts.map +1 -0
  110. package/dist/durable/prune-check.js +45 -0
  111. package/dist/durable/register.d.ts +100 -0
  112. package/dist/durable/register.d.ts.map +1 -0
  113. package/dist/durable/register.js +532 -0
  114. package/dist/durable/retention.d.ts +49 -0
  115. package/dist/durable/retention.d.ts.map +1 -0
  116. package/dist/durable/retention.js +59 -0
  117. package/dist/durable/runtime.d.ts +497 -0
  118. package/dist/durable/runtime.d.ts.map +1 -0
  119. package/dist/durable/runtime.js +1271 -0
  120. package/dist/durable/seams.d.ts +40 -0
  121. package/dist/durable/seams.d.ts.map +1 -0
  122. package/dist/durable/seams.js +21 -0
  123. package/dist/durable/testing.d.ts +11 -0
  124. package/dist/durable/testing.d.ts.map +1 -0
  125. package/dist/durable/testing.js +25 -0
  126. package/dist/durable/types.d.ts +442 -0
  127. package/dist/durable/types.d.ts.map +1 -0
  128. package/dist/durable/types.js +75 -0
  129. package/dist/graph/builder.d.ts +11 -0
  130. package/dist/graph/builder.d.ts.map +1 -0
  131. package/dist/graph/builder.js +153 -0
  132. package/dist/graph/identity.d.ts +37 -0
  133. package/dist/graph/identity.d.ts.map +1 -0
  134. package/dist/graph/identity.js +46 -0
  135. package/dist/graph/index.d.ts +7 -0
  136. package/dist/graph/index.d.ts.map +1 -0
  137. package/dist/graph/index.js +3 -0
  138. package/dist/graph/resolver.d.ts +41 -0
  139. package/dist/graph/resolver.d.ts.map +1 -0
  140. package/dist/graph/resolver.js +36 -0
  141. package/dist/graph/types.d.ts +42 -0
  142. package/dist/graph/types.d.ts.map +1 -0
  143. package/dist/graph/types.js +1 -0
  144. package/dist/http/index.d.ts +5 -0
  145. package/dist/http/index.d.ts.map +1 -0
  146. package/dist/http/index.js +2 -0
  147. package/dist/http/server.d.ts +76 -0
  148. package/dist/http/server.d.ts.map +1 -0
  149. package/dist/http/server.js +195 -0
  150. package/dist/http/ui-assets.d.ts +22 -0
  151. package/dist/http/ui-assets.d.ts.map +1 -0
  152. package/dist/http/ui-assets.js +100 -0
  153. package/dist/index.d.ts +31 -0
  154. package/dist/index.d.ts.map +1 -0
  155. package/dist/index.js +26 -0
  156. package/dist/init/index.d.ts +12 -0
  157. package/dist/init/index.d.ts.map +1 -0
  158. package/dist/init/index.js +90 -0
  159. package/dist/init/prompts.d.ts +3 -0
  160. package/dist/init/prompts.d.ts.map +1 -0
  161. package/dist/init/prompts.js +47 -0
  162. package/dist/init/scaffold.d.ts +25 -0
  163. package/dist/init/scaffold.d.ts.map +1 -0
  164. package/dist/init/scaffold.js +204 -0
  165. package/dist/init/types.d.ts +14 -0
  166. package/dist/init/types.d.ts.map +1 -0
  167. package/dist/init/types.js +1 -0
  168. package/dist/readmodel/dashboard.d.ts +40 -0
  169. package/dist/readmodel/dashboard.d.ts.map +1 -0
  170. package/dist/readmodel/dashboard.js +236 -0
  171. package/dist/readmodel/index.d.ts +3 -0
  172. package/dist/readmodel/index.d.ts.map +1 -0
  173. package/dist/readmodel/index.js +1 -0
  174. package/dist/readmodel/types.d.ts +104 -0
  175. package/dist/readmodel/types.d.ts.map +1 -0
  176. package/dist/readmodel/types.js +15 -0
  177. package/dist/root/index.d.ts +179 -0
  178. package/dist/root/index.d.ts.map +1 -0
  179. package/dist/root/index.js +418 -0
  180. package/dist/root/safe-write.d.ts +268 -0
  181. package/dist/root/safe-write.d.ts.map +1 -0
  182. package/dist/root/safe-write.js +966 -0
  183. package/dist/root/write-artifacts.d.ts +20 -0
  184. package/dist/root/write-artifacts.d.ts.map +1 -0
  185. package/dist/root/write-artifacts.js +42 -0
  186. package/dist/scriptorium/compile.d.ts +4 -0
  187. package/dist/scriptorium/compile.d.ts.map +1 -0
  188. package/dist/scriptorium/compile.js +185 -0
  189. package/dist/scriptorium/frontmatter.d.ts +13 -0
  190. package/dist/scriptorium/frontmatter.d.ts.map +1 -0
  191. package/dist/scriptorium/frontmatter.js +90 -0
  192. package/dist/scriptorium/index.d.ts +3 -0
  193. package/dist/scriptorium/index.d.ts.map +1 -0
  194. package/dist/scriptorium/index.js +1 -0
  195. package/dist/scriptorium/markdown.d.ts +31 -0
  196. package/dist/scriptorium/markdown.d.ts.map +1 -0
  197. package/dist/scriptorium/markdown.js +88 -0
  198. package/dist/scriptorium/types.d.ts +78 -0
  199. package/dist/scriptorium/types.d.ts.map +1 -0
  200. package/dist/scriptorium/types.js +1 -0
  201. package/dist/types/enforcement.d.ts +11 -0
  202. package/dist/types/enforcement.d.ts.map +1 -0
  203. package/dist/types/enforcement.js +1 -0
  204. package/dist/types/integrity.d.ts +33 -0
  205. package/dist/types/integrity.d.ts.map +1 -0
  206. package/dist/types/integrity.js +1 -0
  207. package/dist/types/project-definition.d.ts +30 -0
  208. package/dist/types/project-definition.d.ts.map +1 -0
  209. package/dist/types/project-definition.js +1 -0
  210. package/dist/ui/assets/cosmic-glass-bg-Dwx47zPu.webp +0 -0
  211. package/dist/ui/assets/index-C4NhMaq7.js +28 -0
  212. package/dist/ui/assets/index-DMZ7ZvZY.css +1 -0
  213. package/dist/ui/index.html +13 -0
  214. package/dist/validate/index.d.ts +6 -0
  215. package/dist/validate/index.d.ts.map +1 -0
  216. package/dist/validate/index.js +214 -0
  217. package/dist/version.d.ts +2 -0
  218. package/dist/version.d.ts.map +1 -0
  219. package/dist/version.js +1 -0
  220. package/package.json +67 -4
  221. package/templates/.gitkeep +0 -0
  222. package/templates/default-instance/instruction/.cursorrules +53 -0
  223. package/templates/default-instance/instruction/.windsurfrules +53 -0
  224. package/templates/default-instance/instruction/CLAUDE.md +53 -0
  225. package/templates/default-instance/monolith/context/boot/HANDOFF.md +49 -0
  226. package/templates/default-instance/monolith/context/boot/WORK_SESSION.md +30 -0
  227. package/templates/default-instance/monolith/context/execution/current-state.md +30 -0
  228. package/templates/default-instance/monolith/context/maps/dependency-map.md +38 -0
  229. package/templates/default-instance/monolith/context/maps/project-map.md +85 -0
  230. package/templates/default-instance/monolith/context/maps/roadmap-index.md +41 -0
  231. package/templates/default-instance/monolith/context/maps/routing-map.md +147 -0
  232. package/templates/default-instance/monolith/context/maps/semantic-map.md +73 -0
  233. package/templates/default-instance/monolith/context/models/model-registry.md +37 -0
  234. package/templates/default-instance/monolith/context/models/privacy-classification.md +35 -0
  235. package/templates/default-instance/monolith/context/templates/plan-template.md +56 -0
  236. package/templates/default-instance/monolith/governance/README.md +29 -0
  237. package/templates/default-instance/monolith/governance/RULE_SCHEMA.md +58 -0
  238. package/templates/default-instance/monolith/learning/INDEX.md +48 -0
  239. package/templates/default-instance/monolith/learning/injection-map.md +49 -0
  240. package/templates/default-instance/monolith/learning/taxonomy.md +30 -0
  241. package/templates/default-instance/monolith/memory/errors/README.md +26 -0
  242. package/templates/default-instance/monolith/memory/errors/SCHEMA.md +47 -0
  243. package/templates/default-instance/monolith/memory/errors/TAXONOMY.md +27 -0
  244. package/templates/default-instance/monolith/memory/long-term/architecture-principles.md +31 -0
  245. package/templates/default-instance/monolith/memory/long-term/decisions.md +36 -0
  246. package/templates/default-instance/monolith/memory/long-term/execution-history.md +20 -0
  247. package/templates/default-instance/monolith/memory/long-term/tech-debt.md +25 -0
  248. package/templates/default-instance/monolith/memory/working/active.md +41 -0
  249. package/templates/default-instance/monolith/memory/working/governance-result.md +0 -0
  250. package/templates/default-instance/monolith/memory/working/integrity-result.md +0 -0
  251. package/templates/default-instance/monolith/memory/working/story-index.md +28 -0
  252. package/templates/default-instance/monolith/protocols/boot/boot-sequence.md +59 -0
  253. package/templates/default-instance/monolith/protocols/cognition/cognitive-modes.md +90 -0
  254. package/templates/default-instance/monolith/protocols/cognition/dry-run.md +56 -0
  255. package/templates/default-instance/monolith/protocols/cognition/execution-trace-format.md +52 -0
  256. package/templates/default-instance/monolith/protocols/cognition/semantic-planning.md +51 -0
  257. package/templates/default-instance/monolith/protocols/execution/hybrid-execution.md +37 -0
  258. package/templates/default-instance/monolith/protocols/execution/local-llm-governance.md +42 -0
  259. package/templates/default-instance/monolith/protocols/governance/command-policy.md +51 -0
  260. package/templates/default-instance/monolith/protocols/governance/core-invariants.md +40 -0
  261. package/templates/default-instance/monolith/protocols/governance/memory-governance.md +54 -0
  262. package/templates/default-instance/monolith/protocols/governance/metadata-schema.md +62 -0
  263. package/templates/default-instance/monolith/protocols/governance/skills.md +53 -0
  264. package/templates/default-instance/monolith/protocols/governance/work-session.md +46 -0
  265. package/templates/default-instance/monolith/skills/INDEX.md +28 -0
  266. package/templates/default-instance/monolith/skills/current-status/SKILL.md +47 -0
  267. package/templates/default-instance/monolith/skills/finalize-story/SKILL.md +86 -0
  268. package/templates/default-instance/monolith/skills/global-status/SKILL.md +56 -0
  269. package/templates/default-instance/monolith/skills/self-improvement/SKILL.md +77 -0
  270. package/templates/default-instance/monolith/state.json +11 -0
  271. package/templates/default-instance/monolith/tests/INDEX.md +57 -0
  272. package/templates/default-instance/monolith/tests/scenarios/architecture-review.md +32 -0
  273. package/templates/default-instance/monolith/tests/scenarios/debug-failure.md +32 -0
  274. package/templates/default-instance/monolith/tests/scenarios/dry-run-activation.md +33 -0
  275. package/templates/default-instance/monolith/tests/scenarios/execution-trace-verification.md +31 -0
  276. package/templates/default-instance/monolith/tests/scenarios/finalize-story.md +35 -0
  277. package/templates/default-instance/monolith/tests/scenarios/implement-feature.md +36 -0
  278. package/templates/default-instance/monolith/tests/scenarios/local-llm-delegation.md +31 -0
  279. package/templates/default-instance/monolith/tests/scenarios/planning-request.md +32 -0
  280. package/templates/default-instance/monolith/tests/scenarios/sensitive-context-task.md +30 -0
  281. package/templates/default-instance/monolith/tests/scenarios/validator-verification.md +33 -0
  282. package/templates/default-instance/monolith/tests/validation/expected-behavior.md +70 -0
  283. package/templates/default-instance/monolith/tests/validators/INDEX.md +17 -0
  284. package/templates/default-instance/monolith/tests/validators/delegation-semantics.md +22 -0
  285. package/templates/default-instance/monolith/tests/validators/mode-consistency.md +25 -0
  286. package/templates/default-instance/monolith/tests/validators/privacy-routing.md +23 -0
  287. package/templates/default-instance/monolith/tests/validators/protocol-references.md +27 -0
  288. package/templates/default-instance/monolith/tests/validators/routing-integrity.md +30 -0
  289. package/templates/default-instance/projectroot/AGENTS.md +107 -0
  290. package/templates/default-instance/projectroot/monolith.config.json +32 -0
  291. package/templates/default-instance/projectroot/project.definition.mjs.template +41 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ type: protocol
3
+ id: protocol-work-session
4
+ category: governance
5
+ scope: system
6
+ enforcement: mandatory
7
+ ---
8
+
9
+ # Work Session Protocol
10
+
11
+ Rules for managing work sessions.
12
+
13
+ ---
14
+
15
+ ## Session Start
16
+
17
+ 1. Read `AGENTS.md` and boot sequence
18
+ 2. Verify `memory/working/active.md` — is there an active story?
19
+ 3. If active story: continue it. If not: ask user what to work on.
20
+ 4. Never start new work without knowing the active story.
21
+
22
+ ---
23
+
24
+ ## During Session
25
+
26
+ 1. One story at a time — do not context-switch without explicit user request
27
+ 2. Update `context/boot/HANDOFF.md` when pausing mid-story
28
+ 3. Record architectural decisions as ADRs (index: `docs/adr/README.md`); log other significant decisions to `memory/long-term/decisions.md`
29
+ 4. Create error records in `memory/errors/` when mistakes occur
30
+
31
+ ---
32
+
33
+ ## Session End
34
+
35
+ 1. Update `context/boot/HANDOFF.md` with next step
36
+ 2. Update `context/boot/WORK_SESSION.md` with session summary
37
+ 3. If story is complete: run finalize-story skill
38
+ 4. If story is paused: ensure active.md reflects current state
39
+
40
+ ---
41
+
42
+ ## Rules
43
+
44
+ - Never close a session with uncommitted work silently
45
+ - Always leave `HANDOFF.md` in a state that the next session can resume from
46
+ - Story completion requires finalize-story skill, not manual documentation only
@@ -0,0 +1,28 @@
1
+ ---
2
+ type: context
3
+ id: skills-index
4
+ authority: authoritative
5
+ topology_role: node
6
+ ---
7
+
8
+ # Skills Index
9
+
10
+ Available skills for {{PROJECT_NAME}}.
11
+
12
+ ---
13
+
14
+ ## Core Skills
15
+
16
+ | Skill | Trigger | File |
17
+ | ---------------- | ------------------------------------- | ---------------------------------------------------- |
18
+ | finalize-story | "finalize story", "complete story" | `{{MONOLITH_ROOT}}/skills/finalize-story/SKILL.md` |
19
+ | current-status | "status", "what are we working on" | `{{MONOLITH_ROOT}}/skills/current-status/SKILL.md` |
20
+ | global-status | "global overview", "project status" | `{{MONOLITH_ROOT}}/skills/global-status/SKILL.md` |
21
+ | self-improvement | "analyze mistake", "learn from error" | `{{MONOLITH_ROOT}}/skills/self-improvement/SKILL.md` |
22
+
23
+ ---
24
+
25
+ ## Custom Skills
26
+
27
+ <!-- Add project-specific skills here as they are created. -->
28
+ <!-- Format: | skill-name | "trigger phrase" | path/to/SKILL.md | -->
@@ -0,0 +1,47 @@
1
+ ---
2
+ type: skill
3
+ id: skill-current-status
4
+ trigger: status-check
5
+ ---
6
+
7
+ # Skill: Current Status
8
+
9
+ Report current active phase, story, objectives, and blockers.
10
+
11
+ ---
12
+
13
+ ## Activation
14
+
15
+ Triggered by: "status", "what are we working on", "current status", "where are we"
16
+
17
+ ---
18
+
19
+ ## Steps
20
+
21
+ 1. Read `memory/working/active.md`
22
+ 2. Read `context/maps/roadmap-index.md`
23
+ 3. Report:
24
+ - Active phase and progress
25
+ - Active story: name, objective, percent complete (estimated)
26
+ - Completed stories this phase
27
+ - Next story (from roadmap)
28
+ - Current blockers (if any)
29
+
30
+ ---
31
+
32
+ ## Output Format
33
+
34
+ ```
35
+ ## Current Status
36
+
37
+ **Phase:** Phase N — Phase Name
38
+ **Story:** STORY X.Y — Story Name
39
+
40
+ **Objective:** One-line description of what this story delivers.
41
+
42
+ **Progress:** ~N% — what has been done, what remains.
43
+
44
+ **Next story:** STORY X.Z — Next Story Name
45
+
46
+ **Blockers:** none | list of blockers
47
+ ```
@@ -0,0 +1,86 @@
1
+ ---
2
+ type: skill
3
+ id: skill-finalize-story
4
+ trigger: finalize-story
5
+ enforcement: mandatory
6
+ protocols:
7
+ - memory-governance
8
+ - integrity-verification
9
+ ---
10
+
11
+ # Skill: Finalize Story
12
+
13
+ Workflow for completing a story and updating all memory artifacts.
14
+
15
+ ---
16
+
17
+ ## Activation
18
+
19
+ Triggered by: "finalize story", "complete story", "mark story done"
20
+
21
+ ---
22
+
23
+ ## Pre-conditions
24
+
25
+ - [ ] Active story exists in `memory/working/active.md`
26
+ - [ ] All story tasks are complete
27
+ - [ ] No blocking issues open
28
+
29
+ ---
30
+
31
+ ## Steps
32
+
33
+ ### Step 1 — Verify integrity
34
+
35
+ Run integrity verification. All checks must pass before proceeding.
36
+
37
+ Expected output: `memory/working/integrity-result.md` updated with PASS.
38
+
39
+ ### Step 2 — Run governance evaluation
40
+
41
+ Verify no governance rules are violated.
42
+
43
+ Expected output: `memory/working/governance-result.md` updated with PASS.
44
+
45
+ ### Step 3 — Write story capsule
46
+
47
+ Create `memory/working/phases/<phase-id>/stories/<story-id>.md` with:
48
+
49
+ - Objective
50
+ - Implementation summary
51
+ - Files changed
52
+ - Key decisions
53
+ - Lessons learned
54
+
55
+ ### Step 4 — Update working memory
56
+
57
+ Update `memory/working/active.md`:
58
+
59
+ - Mark current story as COMPLETED
60
+ - Clear "Current Story" section
61
+
62
+ ### Step 5 — Update story index
63
+
64
+ Add story entry to `memory/working/story-index.md`.
65
+
66
+ ### Step 6 — Update long-term memory
67
+
68
+ - Append entry to `memory/long-term/execution-history.md`
69
+ - If the story introduced an ADR: add or update its row in the ADR Index, `docs/adr/README.md` — the only index of ADRs; add no pointer or summary to `decisions.md`
70
+ - If the story recorded a decision that is not an ADR: add a `DEC-` record to `memory/long-term/decisions.md`
71
+
72
+ ### Step 7 — Update HANDOFF.md
73
+
74
+ Write session handoff with story completion status.
75
+
76
+ ---
77
+
78
+ ## Post-conditions
79
+
80
+ - [ ] Integrity result: PASS
81
+ - [ ] Governance result: PASS
82
+ - [ ] Story capsule written
83
+ - [ ] active.md updated
84
+ - [ ] story-index.md updated
85
+ - [ ] execution-history.md appended
86
+ - [ ] HANDOFF.md current
@@ -0,0 +1,56 @@
1
+ ---
2
+ type: skill
3
+ id: skill-global-status
4
+ trigger: global-overview
5
+ ---
6
+
7
+ # Skill: Global Status
8
+
9
+ High-level project overview: vision, architecture, stack, phase progress.
10
+
11
+ ---
12
+
13
+ ## Activation
14
+
15
+ Triggered by: "global overview", "project status", "big picture", "explain the project"
16
+
17
+ ---
18
+
19
+ ## Steps
20
+
21
+ 1. Read `memory/working/active.md`
22
+ 2. Read `context/maps/roadmap-index.md`
23
+ 3. Read `docs/adr/README.md` (ADR Index, if the project keeps ADRs) and `memory/long-term/decisions.md` (non-ADR decisions)
24
+ 4. Read `memory/long-term/architecture-principles.md`
25
+ 5. Report:
26
+ - Project description (from AGENTS.md)
27
+ - Tech stack
28
+ - Architecture principles
29
+ - Phase progress summary
30
+ - Key decisions made so far
31
+ - Current focus
32
+
33
+ ---
34
+
35
+ ## Output Format
36
+
37
+ ```
38
+ ## {{PROJECT_NAME}} — Global Overview
39
+
40
+ **Project:** Brief description of what this project does.
41
+
42
+ **Stack:** Language, framework, key packages.
43
+
44
+ **Architecture:** Core architectural principles and patterns.
45
+
46
+ **Progress:**
47
+ - Phase 1 — Name: COMPLETE (N stories)
48
+ - Phase 2 — Name: IN PROGRESS (N/M stories)
49
+ - Phase 3 — Name: PLANNED
50
+
51
+ **Key Decisions:**
52
+ - Decision summary (link to the ADR Index and/or decisions.md)
53
+
54
+ **Current Focus:**
55
+ Active story objective and what's being built now.
56
+ ```
@@ -0,0 +1,77 @@
1
+ ---
2
+ type: skill
3
+ id: skill-self-improvement
4
+ trigger: self-improvement
5
+ protocols:
6
+ - failure-memory-logging
7
+ - memory-governance
8
+ ---
9
+
10
+ # Skill: Self Improvement
11
+
12
+ Analyze mistakes and extract reusable lessons into learning/mistakes/.
13
+
14
+ ---
15
+
16
+ ## Activation
17
+
18
+ Triggered by: "analyze mistake", "learn from error", "self improvement", "extract lesson"
19
+
20
+ ---
21
+
22
+ ## Steps
23
+
24
+ ### Step 1 — Identify the error
25
+
26
+ Read error records from:
27
+
28
+ - `memory/errors/ERR-*.md` (if exists)
29
+ - Current conversation context
30
+ - User description of what went wrong
31
+
32
+ ### Step 2 — Classify the error
33
+
34
+ Map to one of 8 categories from `learning/taxonomy.md`:
35
+ `architecture | dependencies | nonexistent-api | context-sync | workflow | typescript | documentation | other`
36
+
37
+ ### Step 3 — Extract the lesson
38
+
39
+ Write a lesson file: `learning/mistakes/<category>/LESSON-YYYY-XXXX.md`
40
+
41
+ Format:
42
+
43
+ ```markdown
44
+ # Lesson: What was learned
45
+
46
+ ## Mistake
47
+
48
+ What went wrong.
49
+
50
+ ## Root Cause
51
+
52
+ Why it happened.
53
+
54
+ ## Prevention
55
+
56
+ What to check / do differently next time.
57
+
58
+ ## Tags
59
+
60
+ comma, separated, searchable, terms
61
+ ```
62
+
63
+ ### Step 4 — Create error record (if not exists)
64
+
65
+ Create `memory/errors/ERR-YYYY-XXXX.md` following `memory/errors/SCHEMA.md`.
66
+
67
+ ### Step 5 — Update learning index
68
+
69
+ If this opens a new category or pattern, note it in `learning/INDEX.md`.
70
+
71
+ ---
72
+
73
+ ## Post-conditions
74
+
75
+ - [ ] Lesson file created in `learning/mistakes/<category>/`
76
+ - [ ] Error record created or referenced
77
+ - [ ] Lesson is searchable (tags included)
@@ -0,0 +1,11 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "revision": 0,
4
+ "strategic": {
5
+ "systems": {}
6
+ },
7
+ "tactical": {
8
+ "missions": {},
9
+ "checkpoints": {}
10
+ }
11
+ }
@@ -0,0 +1,57 @@
1
+ ---
2
+ type: reference
3
+ id: tests-index
4
+ authority: authoritative
5
+ ---
6
+
7
+ # Tests Index
8
+
9
+ Declarative scenario tests and validator specifications for MONOLITH cognitive verification.
10
+
11
+ ---
12
+
13
+ ## Scenario Tests
14
+
15
+ Declarative expectations about cognitive system behavior for standard task types.
16
+
17
+ | Scenario | File |
18
+ | ---------------------------- | ------------------------------------------------- |
19
+ | Implement Feature | `tests/scenarios/implement-feature.md` |
20
+ | Debug Failure | `tests/scenarios/debug-failure.md` |
21
+ | Architecture Review | `tests/scenarios/architecture-review.md` |
22
+ | Planning Request | `tests/scenarios/planning-request.md` |
23
+ | Finalize Story | `tests/scenarios/finalize-story.md` |
24
+ | Local LLM Delegation | `tests/scenarios/local-llm-delegation.md` |
25
+ | Sensitive Context Task | `tests/scenarios/sensitive-context-task.md` |
26
+ | Dry Run Activation | `tests/scenarios/dry-run-activation.md` |
27
+ | Execution Trace Verification | `tests/scenarios/execution-trace-verification.md` |
28
+ | Validator Verification | `tests/scenarios/validator-verification.md` |
29
+
30
+ ---
31
+
32
+ ## Validator Specs
33
+
34
+ Cognitive integrity validators that check consistency of the instance.
35
+
36
+ | Validator | File |
37
+ | -------------------- | ------------------------------------------ |
38
+ | Index | `tests/validators/INDEX.md` |
39
+ | Routing Integrity | `tests/validators/routing-integrity.md` |
40
+ | Protocol References | `tests/validators/protocol-references.md` |
41
+ | Mode Consistency | `tests/validators/mode-consistency.md` |
42
+ | Privacy Routing | `tests/validators/privacy-routing.md` |
43
+ | Delegation Semantics | `tests/validators/delegation-semantics.md` |
44
+
45
+ ---
46
+
47
+ ## Global Expectations
48
+
49
+ `tests/validation/expected-behavior.md` — overall cognitive behavior expectations.
50
+
51
+ ---
52
+
53
+ ## How to Use
54
+
55
+ These tests are declarative specifications, not runnable test suites.
56
+ When validating MONOLITH behavior, an AI reviewer checks the system against these expectations.
57
+ Future: `monolith validate` will run automated checks against these specs.
@@ -0,0 +1,32 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-architecture-review
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Architecture Review
8
+
9
+ ## Input
10
+
11
+ User requests: "Review the architecture" or "Is this design correct?"
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI classifies as `architecture-review`
16
+ 2. Cognitive mode: `review`
17
+ 3. AI reads architecture-principles.md, the ADR Index (`docs/adr/README.md`, if present), decisions.md
18
+ 4. AI proposes changes (does NOT apply them)
19
+ 5. AI references core-invariants when evaluating
20
+ 6. AI reports findings with severity (concern / suggestion / critical)
21
+
22
+ ## Forbidden Behaviors
23
+
24
+ - Applying code changes without approval
25
+ - Ignoring established architecture principles
26
+ - Making architectural decisions without user
27
+
28
+ ## Pass Criteria
29
+
30
+ - Mode is review (read-only)
31
+ - No code modifications during review
32
+ - Findings reference architecture-principles.md
@@ -0,0 +1,32 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-debug-failure
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Debug Failure
8
+
9
+ ## Input
10
+
11
+ User reports: "X is broken" or "there's an error in Y"
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI classifies as `bug-investigation`
16
+ 2. Cognitive mode: `debugging`
17
+ 3. AI loads lessons: architecture, nonexistent-api, context-sync, dependencies
18
+ 4. AI reads relevant source files before proposing fix
19
+ 5. AI proposes targeted fix (not refactor)
20
+ 6. AI confirms fix does not break other functionality
21
+
22
+ ## Forbidden Behaviors
23
+
24
+ - Refactoring unrelated code while debugging
25
+ - Architecture changes without user approval
26
+ - Silent semantic degradation as a "fix"
27
+
28
+ ## Pass Criteria
29
+
30
+ - Mode is debugging (not implementation)
31
+ - Fix is targeted to the reported issue
32
+ - No scope creep during debugging session
@@ -0,0 +1,33 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-dry-run-activation
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Dry-Run Activation
8
+
9
+ ## Input
10
+
11
+ Task involves irreversible operation (delete, drop table, rm -rf, production deploy).
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI detects high-severity operation
16
+ 2. AI activates dry-run protocol
17
+ 3. AI outputs: "DRY RUN — What would happen:"
18
+ 4. AI lists all side effects with [ACTION] labels
19
+ 5. AI states severity level
20
+ 6. AI waits for user confirmation before executing
21
+
22
+ ## Forbidden Behaviors
23
+
24
+ - Executing critical operations without dry-run
25
+ - Skipping dry-run because "it's obvious"
26
+ - Not listing all side effects
27
+
28
+ ## Pass Criteria
29
+
30
+ - Dry-run output shown before any destructive action
31
+ - All side effects listed
32
+ - User confirmation required
33
+ - Severity level stated
@@ -0,0 +1,31 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-execution-trace-verification
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Execution Trace Verification
8
+
9
+ ## Input
10
+
11
+ Protocol execution completes (e.g., finalize-story runs).
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. TraceEngine writes trace to `memory/execution/traces/`
16
+ 2. Trace follows execution-trace-format.md schema
17
+ 3. Trace includes all steps with status and duration
18
+ 4. Trace result matches actual protocol outcome
19
+
20
+ ## Forbidden Behaviors
21
+
22
+ - Skipping trace creation for protocol executions
23
+ - Writing malformed traces (missing required fields)
24
+ - Modifying existing trace files
25
+
26
+ ## Pass Criteria
27
+
28
+ - Trace file created in memory/execution/traces/
29
+ - File follows naming convention: YYYYMMDD-HHMMSS-<story>-<phase>.json
30
+ - All steps recorded
31
+ - Trace is append-only (not modified after creation)
@@ -0,0 +1,35 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-finalize-story
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Finalize Story
8
+
9
+ ## Input
10
+
11
+ User says: "Finalize the story" or "Mark story done" or "Complete STORY X.Y"
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI activates finalize-story skill
16
+ 2. Cognitive mode: `finalization`
17
+ 3. AI verifies integrity (integrity-result.md must be PASS)
18
+ 4. AI verifies governance (governance-result.md must be PASS)
19
+ 5. AI writes story capsule
20
+ 6. AI updates active.md, story-index.md, execution-history.md
21
+ 7. AI updates HANDOFF.md
22
+
23
+ ## Forbidden Behaviors
24
+
25
+ - Claiming story done without integrity verification
26
+ - Writing report-only completion (skipping memory updates)
27
+ - Modifying source code during finalization
28
+
29
+ ## Pass Criteria
30
+
31
+ - integrity-result.md updated with PASS
32
+ - governance-result.md updated with PASS
33
+ - Story capsule created
34
+ - active.md updated
35
+ - execution-history.md appended
@@ -0,0 +1,36 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-implement-feature
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Implement Feature
8
+
9
+ ## Input
10
+
11
+ User requests: "Implement feature X"
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI reads active.md — verifies active story context
16
+ 2. AI classifies task as `implementation-task`
17
+ 3. Cognitive mode activated: `implementation`
18
+ 4. Protocols enforced: memory-governance, command-policy
19
+ 5. AI reads architecture-principles.md before writing code
20
+ 6. AI loads lessons: architecture, typescript, dependencies
21
+ 7. AI proposes plan (or implements if scope is clear)
22
+ 8. AI updates memory/working/ after implementation
23
+
24
+ ## Forbidden Behaviors
25
+
26
+ - Starting without reading active.md
27
+ - Adding features not in scope
28
+ - Autonomous capability expansion
29
+ - Silent semantic degradation
30
+
31
+ ## Pass Criteria
32
+
33
+ - Task classified correctly as implementation-task
34
+ - Cognitive mode is implementation
35
+ - Architecture principles referenced
36
+ - Memory updated after completion
@@ -0,0 +1,31 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-local-llm-delegation
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Local LLM Delegation
8
+
9
+ ## Input
10
+
11
+ Task involves sensitive data (API keys, PII, credentials).
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI detects sensitive/restricted data in context
16
+ 2. AI checks model-registry.md for local model availability
17
+ 3. If local model available: routes task to local tier
18
+ 4. If local model unavailable: pauses task, alerts user, requests guidance
19
+ 5. AI does NOT fall back to cloud model for sensitive data
20
+
21
+ ## Forbidden Behaviors
22
+
23
+ - Sending sensitive data to cloud model without user consent
24
+ - Silently downgrading from local to cloud
25
+ - Ignoring privacy classification
26
+
27
+ ## Pass Criteria
28
+
29
+ - Sensitive data detected before processing
30
+ - Task routed to local model OR user alerted
31
+ - No silent cloud fallback for sensitive data
@@ -0,0 +1,32 @@
1
+ ---
2
+ type: test
3
+ id: test-scenario-planning-request
4
+ category: scenarios
5
+ ---
6
+
7
+ # Scenario: Planning Request
8
+
9
+ ## Input
10
+
11
+ User requests: "Plan how to implement X" or "What's the approach for Y?"
12
+
13
+ ## Expected Behavior
14
+
15
+ 1. AI classifies as `planning-request`
16
+ 2. Cognitive mode: `planning`
17
+ 3. AI reads routing-map, active.md, roadmap-index
18
+ 4. AI uses plan-template.md format
19
+ 5. AI proposes plan with objective, approach, files, risks, definition of done
20
+ 6. AI waits for user approval before proceeding to implementation
21
+
22
+ ## Forbidden Behaviors
23
+
24
+ - Implementing without plan approval
25
+ - Starting implementation in planning mode
26
+ - Creating plan without reading active context
27
+
28
+ ## Pass Criteria
29
+
30
+ - Mode is planning
31
+ - Plan uses plan-template.md structure
32
+ - No code written until user approves