@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,20 @@
1
+ /**
2
+ * Read-only diagnostics for files an interrupted write can leave behind
3
+ * (SEC-001B.2, DEC-B2-02, FS-CLEAN-001).
4
+ *
5
+ * This only LISTS names. It never opens, reads, follows, repairs or deletes
6
+ * anything, and a name that matches does NOT mean the file is an orphan:
7
+ * every running `mission` command has exactly such a file for a moment. Safe
8
+ * cleanup needs an owner/liveness criterion that does not exist yet.
9
+ */
10
+ export type WriteArtifactKind = 'state-temp' | 'lock-staging' | 'recovery-mutex';
11
+ export interface WriteArtifact {
12
+ /** Directory entry name (project-controlled text: escape before printing). */
13
+ name: string;
14
+ kind: WriteArtifactKind;
15
+ }
16
+ /** Entries of the instance directory `rootAbs` that look like write leftovers. Never throws. */
17
+ export declare function findWriteArtifacts(rootAbs: string): WriteArtifact[];
18
+ /** One-line, bounded, human-readable summary; names are JSON-escaped so control characters cannot forge output. */
19
+ export declare function describeWriteArtifacts(artifacts: readonly WriteArtifact[], where: string, maxNames?: number): string;
20
+ //# sourceMappingURL=write-artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write-artifacts.d.ts","sourceRoot":"","sources":["../../src/root/write-artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAQD,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,EAAE,CAiBnE;AAED,mHAAmH;AACnH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,CAO/G"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Read-only diagnostics for files an interrupted write can leave behind
3
+ * (SEC-001B.2, DEC-B2-02, FS-CLEAN-001).
4
+ *
5
+ * This only LISTS names. It never opens, reads, follows, repairs or deletes
6
+ * anything, and a name that matches does NOT mean the file is an orphan:
7
+ * every running `mission` command has exactly such a file for a moment. Safe
8
+ * cleanup needs an owner/liveness criterion that does not exist yet.
9
+ */
10
+ import { readdirSync } from 'fs';
11
+ const PATTERNS = [
12
+ [/^state\.json\.tmp\./, 'state-temp'],
13
+ [/^state\.json\.lock\.creating\./, 'lock-staging'],
14
+ [/^state\.json\.lock\.recovery(\.creating\..*)?$/, 'recovery-mutex'],
15
+ ];
16
+ /** Entries of the instance directory `rootAbs` that look like write leftovers. Never throws. */
17
+ export function findWriteArtifacts(rootAbs) {
18
+ let names;
19
+ try {
20
+ names = readdirSync(rootAbs);
21
+ }
22
+ catch {
23
+ return [];
24
+ }
25
+ const found = [];
26
+ for (const name of names) {
27
+ for (const [re, kind] of PATTERNS) {
28
+ if (re.test(name)) {
29
+ found.push({ name, kind });
30
+ break;
31
+ }
32
+ }
33
+ }
34
+ return found.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0));
35
+ }
36
+ /** One-line, bounded, human-readable summary; names are JSON-escaped so control characters cannot forge output. */
37
+ export function describeWriteArtifacts(artifacts, where, maxNames = 3) {
38
+ const shown = artifacts.slice(0, maxNames).map((a) => JSON.stringify(a.name));
39
+ const more = artifacts.length - shown.length;
40
+ return (`${artifacts.length} leftover-looking write file(s) in "${where}": ${shown.join(', ')}${more > 0 ? `, and ${more} more` : ''}. ` +
41
+ 'They are present and may belong to a command that is still running; MONOLITH never deletes them (FS-CLEAN-001).');
42
+ }
@@ -0,0 +1,4 @@
1
+ import type { ScriptoriumInput, ScriptoriumResult } from './types.js';
2
+ export declare function compileMarkdownArtifact(input: ScriptoriumInput): ScriptoriumResult;
3
+ export declare function isStructuralHeadingNoise(label: string): boolean;
4
+ //# sourceMappingURL=compile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/scriptorium/compile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAOlB,MAAM,YAAY,CAAC;AAIpB,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAwJlF;AA2BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE/D"}
@@ -0,0 +1,185 @@
1
+ import { parseFrontmatter } from './frontmatter.js';
2
+ import { parseMarkdownBody } from './markdown.js';
3
+ export function compileMarkdownArtifact(input) {
4
+ const { id, content } = input;
5
+ const concepts = [];
6
+ const relationships = [];
7
+ const evidence = [];
8
+ const sourceReferences = [];
9
+ const diagnostics = [];
10
+ const declarations = [];
11
+ let conceptIdx = 0;
12
+ let relIdx = 0;
13
+ let evidenceIdx = 0;
14
+ let refIdx = 0;
15
+ const lines = content.split('\n');
16
+ const fm = parseFrontmatter(lines);
17
+ const bodyStartLine = fm?.bodyStartLine ?? 0;
18
+ const bodyLines = lines.slice(bodyStartLine);
19
+ let docLabel = input.title ?? id;
20
+ let documentId;
21
+ let documentIdLine;
22
+ let documentTitleDecl = input.title;
23
+ let documentStatus;
24
+ if (fm) {
25
+ for (const field of fm.fields) {
26
+ if (field.key === 'title' && field.values[0]) {
27
+ docLabel = field.values[0];
28
+ documentTitleDecl = field.values[0];
29
+ }
30
+ if (field.key === 'status' && field.values[0]) {
31
+ documentStatus = field.values[0];
32
+ }
33
+ if (field.key === 'id' && field.values[0]) {
34
+ documentId = field.values[0];
35
+ documentIdLine = field.line;
36
+ }
37
+ if (field.isRelationship) {
38
+ for (const val of field.values) {
39
+ relationships.push({
40
+ id: `${id}-rel-${relIdx++}`,
41
+ fromLabel: docLabel,
42
+ toLabel: val,
43
+ relationshipType: field.key,
44
+ provenance: 'explicit',
45
+ sourceField: field.key,
46
+ sourceLine: field.line,
47
+ });
48
+ }
49
+ }
50
+ else {
51
+ for (const val of field.values) {
52
+ evidence.push({
53
+ id: `${id}-evidence-${evidenceIdx++}`,
54
+ content: val,
55
+ source: 'frontmatter',
56
+ key: field.key,
57
+ });
58
+ }
59
+ }
60
+ }
61
+ }
62
+ if (documentId !== undefined) {
63
+ declarations.push({
64
+ kind: 'document',
65
+ localId: documentId,
66
+ ...(documentTitleDecl !== undefined ? { title: documentTitleDecl } : {}),
67
+ ...(documentStatus !== undefined ? { status: documentStatus } : {}),
68
+ ...(documentIdLine !== undefined ? { sourceLine: documentIdLine } : {}),
69
+ });
70
+ }
71
+ const parsed = parseMarkdownBody(bodyLines);
72
+ for (const heading of parsed.headings) {
73
+ if (heading.anchorId === undefined)
74
+ continue;
75
+ const title = normalizeLabel(heading.text);
76
+ declarations.push({
77
+ kind: 'section',
78
+ localId: heading.anchorId,
79
+ ...(title ? { title } : {}),
80
+ sourceLine: heading.line + bodyStartLine,
81
+ });
82
+ }
83
+ for (const heading of parsed.headings) {
84
+ const label = normalizeLabel(heading.text);
85
+ if (!label)
86
+ continue;
87
+ if (isStructuralHeadingNoise(label))
88
+ continue;
89
+ concepts.push({
90
+ id: `${id}-concept-${conceptIdx++}`,
91
+ label,
92
+ source: 'heading',
93
+ headingLevel: heading.level,
94
+ sourceLine: heading.line + bodyStartLine,
95
+ });
96
+ }
97
+ for (const link of parsed.links) {
98
+ sourceReferences.push({
99
+ id: `${id}-ref-${refIdx++}`,
100
+ label: link.label,
101
+ target: link.target,
102
+ sourceLine: link.line + bodyStartLine,
103
+ });
104
+ }
105
+ for (const item of parsed.listItems) {
106
+ if (looksLikeNamedConcept(item.text)) {
107
+ concepts.push({
108
+ id: `${id}-concept-${conceptIdx++}`,
109
+ label: normalizeLabel(item.text),
110
+ source: 'list-item',
111
+ sourceLine: item.line + bodyStartLine,
112
+ });
113
+ }
114
+ else {
115
+ evidence.push({
116
+ id: `${id}-evidence-${evidenceIdx++}`,
117
+ content: item.text,
118
+ source: 'list-item',
119
+ sourceLine: item.line + bodyStartLine,
120
+ });
121
+ }
122
+ }
123
+ for (const block of parsed.codeBlocks) {
124
+ evidence.push({
125
+ id: `${id}-evidence-${evidenceIdx++}`,
126
+ content: block.content,
127
+ source: 'code-block',
128
+ language: block.language,
129
+ sourceLine: block.startLine + bodyStartLine,
130
+ });
131
+ }
132
+ return {
133
+ artifactId: id,
134
+ documentId,
135
+ documentTitle: docLabel,
136
+ namespace: input.namespace,
137
+ sourcePath: input.sourcePath,
138
+ declarations,
139
+ concepts,
140
+ relationships,
141
+ evidence,
142
+ sourceReferences,
143
+ diagnostics,
144
+ };
145
+ }
146
+ function normalizeLabel(text) {
147
+ return text
148
+ .replace(/\[([^\]]+)\]\([^)]*\)/g, '$1') // [label](url) → label
149
+ .replace(/`([^`]*)`/g, '$1') // `code` → code
150
+ .replace(/[*_~]+/g, '') // strip bold/italic markers
151
+ .trim();
152
+ }
153
+ // Generic structural section titles that appear in almost every document.
154
+ // These produce high-degree noise nodes rather than domain-specific concepts.
155
+ // Conservative: only exact matches (case-insensitive) after label normalization.
156
+ const STRUCTURAL_HEADING_NOISE = new Set([
157
+ 'overview',
158
+ 'summary',
159
+ 'notes',
160
+ 'background',
161
+ 'context',
162
+ 'status',
163
+ 'implementation',
164
+ 'tests',
165
+ 'next steps',
166
+ 'open questions',
167
+ 'conclusion',
168
+ ]);
169
+ export function isStructuralHeadingNoise(label) {
170
+ return STRUCTURAL_HEADING_NOISE.has(label.toLowerCase());
171
+ }
172
+ // Promotes a list item to a ConceptCandidate if it looks like a named term.
173
+ // Conservative heuristic: short (≤3 words), no trailing sentence punctuation,
174
+ // and either starts with an uppercase letter or is a backtick-wrapped code term.
175
+ function looksLikeNamedConcept(text) {
176
+ const label = normalizeLabel(text);
177
+ const words = label.split(/\s+/).filter(Boolean);
178
+ if (words.length === 0 || words.length > 3)
179
+ return false;
180
+ if (/[.?!,;:]$/.test(label))
181
+ return false;
182
+ if (text.trim().startsWith('`'))
183
+ return true;
184
+ return /^[A-Z]/.test(label);
185
+ }
@@ -0,0 +1,13 @@
1
+ export interface FrontmatterField {
2
+ key: string;
3
+ values: string[];
4
+ isRelationship: boolean;
5
+ /** 0-based line of the key within the artifact (the opening `---` is line 0). */
6
+ line: number;
7
+ }
8
+ export interface FrontmatterParseResult {
9
+ fields: FrontmatterField[];
10
+ bodyStartLine: number;
11
+ }
12
+ export declare function parseFrontmatter(lines: string[]): FrontmatterParseResult | null;
13
+ //# sourceMappingURL=frontmatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/scriptorium/frontmatter.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;IACxB,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,sBAAsB,GAAG,IAAI,CAwE/E"}
@@ -0,0 +1,90 @@
1
+ const MONOLITH_RELATIONSHIP_FIELDS = new Set([
2
+ 'related_decisions',
3
+ 'related_hypotheses',
4
+ 'related_regions',
5
+ 'related_protocols',
6
+ 'depends_on',
7
+ 'references',
8
+ 'related',
9
+ // Added in Story 1.3.2: fields actually used in the MONOLITH docs/ corpus
10
+ 'follow_up_adrs',
11
+ 'related_adrs',
12
+ 'related_research',
13
+ // Added in .monolith/ self-analysis dogfood: fields used in operational memory
14
+ 'protocols',
15
+ 'referenced_by',
16
+ 'related_skills',
17
+ ]);
18
+ export function parseFrontmatter(lines) {
19
+ if (lines[0]?.trim() !== '---')
20
+ return null;
21
+ let closeIdx = -1;
22
+ for (let i = 1; i < lines.length; i++) {
23
+ if (lines[i].trim() === '---') {
24
+ closeIdx = i;
25
+ break;
26
+ }
27
+ }
28
+ if (closeIdx === -1)
29
+ return null;
30
+ const fmLines = lines.slice(1, closeIdx);
31
+ const fields = [];
32
+ let i = 0;
33
+ while (i < fmLines.length) {
34
+ const line = fmLines[i];
35
+ if (line.trim() === '' || line.trim().startsWith('#')) {
36
+ i++;
37
+ continue;
38
+ }
39
+ const keyValueMatch = line.match(/^([a-zA-Z_][a-zA-Z0-9_]*)\s*:\s*(.*)$/);
40
+ if (!keyValueMatch) {
41
+ i++;
42
+ continue;
43
+ }
44
+ const key = keyValueMatch[1];
45
+ const keyLine = i + 1;
46
+ const rawValue = keyValueMatch[2].trim();
47
+ let values = [];
48
+ if (rawValue === '') {
49
+ // Block sequence: look ahead for `- item` lines
50
+ i++;
51
+ while (i < fmLines.length) {
52
+ const itemMatch = fmLines[i].match(/^\s+-\s+(.+)$/);
53
+ if (itemMatch) {
54
+ const v = stripQuotes(itemMatch[1].trim());
55
+ if (v)
56
+ values.push(v);
57
+ i++;
58
+ }
59
+ else {
60
+ break;
61
+ }
62
+ }
63
+ }
64
+ else if (rawValue.startsWith('[')) {
65
+ // Inline sequence: [val1, val2]
66
+ const inner = rawValue.slice(rawValue.indexOf('[') + 1, rawValue.lastIndexOf(']'));
67
+ values = inner
68
+ .split(',')
69
+ .map(s => stripQuotes(s.trim()))
70
+ .filter(Boolean);
71
+ i++;
72
+ }
73
+ else {
74
+ values = [stripQuotes(rawValue)].filter(Boolean);
75
+ i++;
76
+ }
77
+ if (values.length > 0) {
78
+ fields.push({
79
+ key,
80
+ values,
81
+ isRelationship: MONOLITH_RELATIONSHIP_FIELDS.has(key),
82
+ line: keyLine,
83
+ });
84
+ }
85
+ }
86
+ return { fields, bodyStartLine: closeIdx + 1 };
87
+ }
88
+ function stripQuotes(value) {
89
+ return value.replace(/^['"]|['"]$/g, '');
90
+ }
@@ -0,0 +1,3 @@
1
+ export type { ScriptoriumInput, ScriptoriumResult, ConceptCandidate, RelationshipCandidate, Evidence, SourceReference, ScriptoriumDiagnostic, ConceptSource, EvidenceSource, HeadingLevel, ObjectDeclaration, DeclaredObjectKind, } from './types.js';
2
+ export { compileMarkdownArtifact, isStructuralHeadingNoise } from './compile.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/scriptorium/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,EACR,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1 @@
1
+ export { compileMarkdownArtifact, isStructuralHeadingNoise } from './compile.js';
@@ -0,0 +1,31 @@
1
+ import type { HeadingLevel } from './types.js';
2
+ export interface ParsedHeading {
3
+ level: HeadingLevel;
4
+ text: string;
5
+ line: number;
6
+ /** Raw id from a trailing `{#ID}` marker (not validated); the marker is removed from `text`. */
7
+ anchorId?: string;
8
+ }
9
+ export interface ParsedLink {
10
+ label: string;
11
+ target: string;
12
+ line: number;
13
+ }
14
+ export interface ParsedListItem {
15
+ text: string;
16
+ line: number;
17
+ indent: number;
18
+ }
19
+ export interface ParsedCodeBlock {
20
+ language: string | undefined;
21
+ content: string;
22
+ startLine: number;
23
+ }
24
+ export interface MarkdownParseResult {
25
+ headings: ParsedHeading[];
26
+ links: ParsedLink[];
27
+ listItems: ParsedListItem[];
28
+ codeBlocks: ParsedCodeBlock[];
29
+ }
30
+ export declare function parseMarkdownBody(lines: string[]): MarkdownParseResult;
31
+ //# sourceMappingURL=markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/scriptorium/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAQD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAoFtE"}
@@ -0,0 +1,88 @@
1
+ const HEADING_RE = /^(#{1,6})\s+(.+?)(?:\s+#+)?$/;
2
+ const LIST_ITEM_UNORDERED_RE = /^(\s*)[-*+]\s+(.+)$/;
3
+ const LIST_ITEM_ORDERED_RE = /^(\s*)\d+\.\s+(.+)$/;
4
+ const HEADING_ANCHOR_RE = /\s*\{#([^\s{}]+)\}\s*$/;
5
+ const LINK_RE = /\[([^\]]+)\]\(([^)]+)\)/g;
6
+ export function parseMarkdownBody(lines) {
7
+ const headings = [];
8
+ const links = [];
9
+ const listItems = [];
10
+ const codeBlocks = [];
11
+ let inCodeBlock = false;
12
+ let codeBlockLang;
13
+ let codeBlockLines = [];
14
+ let codeBlockStart = 0;
15
+ for (let i = 0; i < lines.length; i++) {
16
+ const line = lines[i];
17
+ const trimmed = line.trim();
18
+ if (trimmed.startsWith('```')) {
19
+ if (!inCodeBlock) {
20
+ inCodeBlock = true;
21
+ const lang = trimmed.slice(3).trim();
22
+ codeBlockLang = lang || undefined;
23
+ codeBlockLines = [];
24
+ codeBlockStart = i;
25
+ }
26
+ else {
27
+ if (codeBlockLines.join('\n').trim()) {
28
+ codeBlocks.push({
29
+ language: codeBlockLang,
30
+ content: codeBlockLines.join('\n'),
31
+ startLine: codeBlockStart,
32
+ });
33
+ }
34
+ inCodeBlock = false;
35
+ codeBlockLang = undefined;
36
+ codeBlockLines = [];
37
+ }
38
+ continue;
39
+ }
40
+ if (inCodeBlock) {
41
+ codeBlockLines.push(line);
42
+ continue;
43
+ }
44
+ const headingMatch = trimmed.match(HEADING_RE);
45
+ if (headingMatch) {
46
+ const level = headingMatch[1].length;
47
+ let text = headingMatch[2].trim();
48
+ let anchorId;
49
+ const anchor = text.match(HEADING_ANCHOR_RE);
50
+ if (anchor) {
51
+ anchorId = anchor[1];
52
+ text = text.slice(0, anchor.index).trim();
53
+ }
54
+ headings.push({ level, text, line: i, ...(anchorId !== undefined ? { anchorId } : {}) });
55
+ extractLinks(text, i, links);
56
+ continue;
57
+ }
58
+ const unordered = line.match(LIST_ITEM_UNORDERED_RE);
59
+ if (unordered) {
60
+ listItems.push({ text: unordered[2].trim(), line: i, indent: unordered[1].length });
61
+ extractLinks(unordered[2], i, links);
62
+ continue;
63
+ }
64
+ const ordered = line.match(LIST_ITEM_ORDERED_RE);
65
+ if (ordered) {
66
+ listItems.push({ text: ordered[2].trim(), line: i, indent: ordered[1].length });
67
+ extractLinks(ordered[2], i, links);
68
+ continue;
69
+ }
70
+ extractLinks(line, i, links);
71
+ }
72
+ // Close an unclosed fence
73
+ if (inCodeBlock && codeBlockLines.join('\n').trim()) {
74
+ codeBlocks.push({
75
+ language: codeBlockLang,
76
+ content: codeBlockLines.join('\n'),
77
+ startLine: codeBlockStart,
78
+ });
79
+ }
80
+ return { headings, links, listItems, codeBlocks };
81
+ }
82
+ function extractLinks(text, lineIdx, out) {
83
+ const re = new RegExp(LINK_RE.source, 'g');
84
+ let match;
85
+ while ((match = re.exec(text)) !== null) {
86
+ out.push({ label: match[1].trim(), target: match[2].trim(), line: lineIdx });
87
+ }
88
+ }
@@ -0,0 +1,78 @@
1
+ export type ConceptSource = 'heading' | 'frontmatter' | 'list-item' | 'link-label';
2
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
3
+ export interface ConceptCandidate {
4
+ id: string;
5
+ label: string;
6
+ source: ConceptSource;
7
+ headingLevel?: HeadingLevel;
8
+ sourceLine?: number;
9
+ }
10
+ export interface RelationshipCandidate {
11
+ id: string;
12
+ fromLabel: string;
13
+ toLabel: string;
14
+ relationshipType: string;
15
+ provenance: 'explicit';
16
+ sourceField?: string;
17
+ sourceLine?: number;
18
+ }
19
+ export type DeclaredObjectKind = 'document' | 'section';
20
+ /**
21
+ * A raw, unvalidated claim that an object with `localId` exists in this artifact.
22
+ * Scriptorium only extracts the claim; ERG decides identity, uniqueness and validity.
23
+ * `sourceLine` is 0-based, like ConceptCandidate.sourceLine.
24
+ */
25
+ export interface ObjectDeclaration {
26
+ kind: DeclaredObjectKind;
27
+ localId: string;
28
+ title?: string;
29
+ status?: string;
30
+ sourceLine?: number;
31
+ }
32
+ export type EvidenceSource = 'frontmatter' | 'list-item' | 'code-block';
33
+ export interface Evidence {
34
+ id: string;
35
+ content: string;
36
+ source: EvidenceSource;
37
+ language?: string;
38
+ key?: string;
39
+ sourceLine?: number;
40
+ }
41
+ export interface SourceReference {
42
+ id: string;
43
+ label: string;
44
+ target: string;
45
+ sourceLine?: number;
46
+ }
47
+ export interface ScriptoriumDiagnostic {
48
+ severity: 'info' | 'warn' | 'error';
49
+ message: string;
50
+ sourceLine?: number;
51
+ }
52
+ export interface ScriptoriumResult {
53
+ artifactId: string;
54
+ /** Canonical short-form identifier from frontmatter `id:` (e.g. "ADR-004", "R-0001"). */
55
+ documentId?: string;
56
+ /** Resolved display title used as fromLabel in relationships (frontmatter title → H1 → artifactId). */
57
+ documentTitle?: string;
58
+ /** Namespace supplied by the caller for this artifact (ScriptoriumInput.namespace); never derived from content. */
59
+ namespace?: string;
60
+ /** Path of the artifact as supplied by the caller (ScriptoriumInput.sourcePath). */
61
+ sourcePath?: string;
62
+ /** Object declarations: the document (frontmatter `id:`) and `{#ID}`-marked sections. */
63
+ declarations: ObjectDeclaration[];
64
+ concepts: ConceptCandidate[];
65
+ relationships: RelationshipCandidate[];
66
+ evidence: Evidence[];
67
+ sourceReferences: SourceReference[];
68
+ diagnostics: ScriptoriumDiagnostic[];
69
+ }
70
+ export interface ScriptoriumInput {
71
+ id: string;
72
+ title?: string;
73
+ content: string;
74
+ sourcePath?: string;
75
+ /** Identity namespace of the corpus this artifact belongs to. Supplied by the caller, never inferred. */
76
+ namespace?: string;
77
+ }
78
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/scriptorium/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAEnF,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,SAAS,CAAC;AAExD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC;AAExE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uGAAuG;IACvG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mHAAmH;IACnH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,YAAY,EAAE,iBAAiB,EAAE,CAAC;IAClC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,aAAa,EAAE,qBAAqB,EAAE,CAAC;IACvC,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,WAAW,EAAE,qBAAqB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yGAAyG;IACzG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Result returned by every enforcement gate check.
3
+ */
4
+ export interface GateCheckResult {
5
+ passed: boolean;
6
+ reason: string;
7
+ blockedActions: string[];
8
+ requiredSteps: string[];
9
+ }
10
+ export type GateStatus = 'PASS' | 'BLOCK' | 'WARN';
11
+ //# sourceMappingURL=enforcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enforcement.d.ts","sourceRoot":"","sources":["../../src/types/enforcement.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Context passed to every integrity validator.
3
+ */
4
+ export interface VerificationContext {
5
+ projectRoot: string;
6
+ monolithRoot: string;
7
+ phaseId: string;
8
+ storyId: string;
9
+ metadata: Record<string, unknown>;
10
+ }
11
+ export type VerificationStatus = 'PASS' | 'FAIL' | 'WARN';
12
+ export interface VerificationCheck {
13
+ checkId: string;
14
+ description: string;
15
+ status: VerificationStatus;
16
+ message: string;
17
+ }
18
+ /**
19
+ * Aggregate result produced by the verification engine.
20
+ */
21
+ export interface VerificationReport {
22
+ protocolId: string;
23
+ context: VerificationContext;
24
+ checks: VerificationCheck[];
25
+ result: {
26
+ status: VerificationStatus;
27
+ passed: number;
28
+ failed: number;
29
+ warnings: number;
30
+ };
31
+ summary: string;
32
+ }
33
+ //# sourceMappingURL=integrity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrity.d.ts","sourceRoot":"","sources":["../../src/types/integrity.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,MAAM,EAAE;QACN,MAAM,EAAE,kBAAkB,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1 @@
1
+ export {};