contextos-agents 1.7.0 → 2.0.0-beta.3

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 (313) hide show
  1. package/.agents/AGENTS.md +16 -50
  2. package/.agents/adapters/aider/export.js +117 -99
  3. package/.agents/adapters/claude/export.js +68 -26
  4. package/.agents/adapters/copilot/export.js +90 -53
  5. package/.agents/adapters/cursor/export.js +100 -104
  6. package/.agents/adapters/drift-detector.js +196 -0
  7. package/.agents/adapters/gemini/export.js +76 -45
  8. package/.agents/adapters/pure-compiler.js +443 -0
  9. package/.agents/adapters/zed/export.js +104 -96
  10. package/.agents/compiled/registry.v2.json +504 -0
  11. package/.agents/compiled/registry.v2.sha256 +1 -0
  12. package/.agents/compiler/manifest-compiler.js +963 -0
  13. package/.agents/compiler/vendor/yaml.LICENSE.txt +13 -0
  14. package/.agents/compiler/vendor/yaml.SBOM.json +6 -0
  15. package/.agents/compiler/vendor/yaml.js +139 -0
  16. package/.agents/core/profiles/init.yaml +25 -0
  17. package/.agents/core/skills/context-manager/skill.yaml +3 -5
  18. package/.agents/core/skills/context-os/SKILL.md +3 -6
  19. package/.agents/core/skills/context-os/skill.yaml +3 -8
  20. package/.agents/core/skills/engineering-workflow/skill.yaml +1 -7
  21. package/.agents/core/skills/gemini-precision/skill.yaml +1 -6
  22. package/.agents/core/skills/gstack-roles/skill.yaml +3 -6
  23. package/.agents/core/skills/ponytail-mindset/skill.yaml +1 -7
  24. package/.agents/core/skills/security/skill.yaml +15 -3
  25. package/.agents/ctx.js +537 -112
  26. package/.agents/customization-dx.js +282 -0
  27. package/.agents/doctor.js +855 -66
  28. package/.agents/filesystem/index.js +71 -0
  29. package/.agents/filesystem/journaled-transaction.js +451 -0
  30. package/.agents/filesystem/lockfile-v2.js +275 -0
  31. package/.agents/filesystem/platform-hardening.js +222 -0
  32. package/.agents/filesystem/project-lock.js +218 -0
  33. package/.agents/filesystem/safe-path.js +256 -0
  34. package/.agents/generated/claude/skills/context-os/SKILL.md +1 -1
  35. package/.agents/generated/gemini/skills/context-os/SKILL.md +2 -2
  36. package/.agents/plugins/contextos/plugin.json +1 -1
  37. package/.agents/plugins.js +278 -64
  38. package/.agents/profiles.js +486 -51
  39. package/.agents/resolver/canonical-resolver.js +1348 -0
  40. package/.agents/resolver.js +50 -534
  41. package/.agents/rules/rule-catalog.js +525 -0
  42. package/.agents/schemas/attestation.review.v1.json +111 -0
  43. package/.agents/schemas/attestation.verification.v1.json +85 -0
  44. package/.agents/schemas/lockfile.v2.schema.json +134 -0
  45. package/.agents/schemas/profile.v2.schema.json +114 -0
  46. package/.agents/schemas/runtime.thread.v1.json +192 -0
  47. package/.agents/schemas/skill.manifest.v2.json +177 -0
  48. package/.agents/schemas/verification.spec.v1.json +39 -0
  49. package/.agents/schemas/workspace.graph.schema.json +106 -0
  50. package/.agents/skills-index.json +6 -166
  51. package/.agents/stats.js +9 -9
  52. package/.agents/transaction-core/event-store.js +288 -0
  53. package/.agents/transaction-core/idempotency.js +129 -0
  54. package/.agents/transaction-core/ipc-lock.js +311 -0
  55. package/.agents/transaction-core/plugin-supply-chain-bundle.js +436 -0
  56. package/.agents/validate.js +44 -1
  57. package/.agents/watch.js +354 -102
  58. package/.agents/workspace/workspace-graph.js +778 -0
  59. package/README.md +59 -387
  60. package/benchmarks/v2/analysis/statistics.js +140 -0
  61. package/benchmarks/v2/analysis/stats.js +69 -0
  62. package/benchmarks/v2/arms/arm-definitions.js +79 -0
  63. package/benchmarks/v2/dataset.schema.json +34 -0
  64. package/benchmarks/v2/evaluators/index.js +25 -0
  65. package/benchmarks/v2/evaluators/verified-success.js +116 -0
  66. package/benchmarks/v2/harness/runner.js +88 -0
  67. package/benchmarks/v2/pilot-tasks.json +392 -0
  68. package/bin/commands/recover.js +88 -0
  69. package/bin/commands/update.js +80 -17
  70. package/bin/commands.js +62 -25
  71. package/bin/index.js +138 -81
  72. package/bin/lib/lockfile.js +5 -3
  73. package/bin/lib/safe-writer.js +34 -3
  74. package/package.json +87 -72
  75. package/registry.json +2 -2
  76. package/registry.v2.schema.json +86 -0
  77. package/.agents/core/profiles/backend.yaml +0 -47
  78. package/.agents/core/profiles/enterprise.yaml +0 -46
  79. package/.agents/core/profiles/frontend.yaml +0 -46
  80. package/.agents/core/profiles/hackathon.yaml +0 -45
  81. package/.agents/core/profiles/mvp.yaml +0 -44
  82. package/.agents/core/profiles/startup.yaml +0 -48
  83. package/.agents/core/skills/adapters/EXAMPLES.md +0 -19
  84. package/.agents/core/skills/adapters/SKILL.md +0 -105
  85. package/.agents/core/skills/adapters/TROUBLESHOOTING.md +0 -7
  86. package/.agents/core/skills/adapters/VALIDATION.json +0 -12
  87. package/.agents/core/skills/adapters/skill.yaml +0 -16
  88. package/.agents/core/skills/architecture-diagrams/SKILL.md +0 -108
  89. package/.agents/core/skills/architecture-diagrams/VALIDATION.json +0 -12
  90. package/.agents/core/skills/architecture-diagrams/skill.yaml +0 -12
  91. package/.agents/core/skills/brutalist-design/SKILL.md +0 -150
  92. package/.agents/core/skills/brutalist-design/VALIDATION.json +0 -12
  93. package/.agents/core/skills/brutalist-design/skill.yaml +0 -12
  94. package/.agents/core/skills/database/EXAMPLES.md +0 -74
  95. package/.agents/core/skills/database/SKILL.md +0 -101
  96. package/.agents/core/skills/database/TROUBLESHOOTING.md +0 -18
  97. package/.agents/core/skills/database/VALIDATION.json +0 -11
  98. package/.agents/core/skills/database/skill.yaml +0 -31
  99. package/.agents/core/skills/ddd/EXAMPLES.md +0 -42
  100. package/.agents/core/skills/ddd/SKILL.md +0 -247
  101. package/.agents/core/skills/ddd/TROUBLESHOOTING.md +0 -19
  102. package/.agents/core/skills/ddd/VALIDATION.json +0 -12
  103. package/.agents/core/skills/ddd/ddd.md +0 -178
  104. package/.agents/core/skills/ddd/skill.yaml +0 -17
  105. package/.agents/core/skills/decisions/EXAMPLES.md +0 -35
  106. package/.agents/core/skills/decisions/SKILL.md +0 -90
  107. package/.agents/core/skills/decisions/TROUBLESHOOTING.md +0 -13
  108. package/.agents/core/skills/decisions/VALIDATION.json +0 -12
  109. package/.agents/core/skills/decisions/skill.yaml +0 -16
  110. package/.agents/core/skills/docker/EXAMPLES.md +0 -56
  111. package/.agents/core/skills/docker/SKILL.md +0 -63
  112. package/.agents/core/skills/docker/TROUBLESHOOTING.md +0 -18
  113. package/.agents/core/skills/docker/VALIDATION.json +0 -11
  114. package/.agents/core/skills/docker/skill.yaml +0 -29
  115. package/.agents/core/skills/fastapi/EXAMPLES.md +0 -36
  116. package/.agents/core/skills/fastapi/SKILL.md +0 -148
  117. package/.agents/core/skills/fastapi/TROUBLESHOOTING.md +0 -19
  118. package/.agents/core/skills/fastapi/VALIDATION.json +0 -12
  119. package/.agents/core/skills/fastapi/fastapi.md +0 -112
  120. package/.agents/core/skills/fastapi/skill.yaml +0 -17
  121. package/.agents/core/skills/generators/EXAMPLES.md +0 -19
  122. package/.agents/core/skills/generators/SKILL.md +0 -112
  123. package/.agents/core/skills/generators/TROUBLESHOOTING.md +0 -7
  124. package/.agents/core/skills/generators/VALIDATION.json +0 -12
  125. package/.agents/core/skills/generators/skill.yaml +0 -25
  126. package/.agents/core/skills/generators/templates/API.md +0 -77
  127. package/.agents/core/skills/generators/templates/ARCHITECTURE.md +0 -70
  128. package/.agents/core/skills/generators/templates/DATABASE.md +0 -42
  129. package/.agents/core/skills/generators/templates/DECISION.md +0 -46
  130. package/.agents/core/skills/generators/templates/PRD.md +0 -67
  131. package/.agents/core/skills/generators/templates/PROJECT_GRAPH.md +0 -56
  132. package/.agents/core/skills/generators/templates/ROADMAP.md +0 -51
  133. package/.agents/core/skills/generators/templates/TASKS.md +0 -43
  134. package/.agents/core/skills/generators/templates/UI.md +0 -73
  135. package/.agents/core/skills/graphify/EXAMPLES.md +0 -73
  136. package/.agents/core/skills/graphify/SKILL.md +0 -130
  137. package/.agents/core/skills/graphify/VALIDATION.json +0 -12
  138. package/.agents/core/skills/graphify/skill.yaml +0 -18
  139. package/.agents/core/skills/impeccable-design/EXAMPLES.md +0 -26
  140. package/.agents/core/skills/impeccable-design/SKILL.md +0 -201
  141. package/.agents/core/skills/impeccable-design/TROUBLESHOOTING.md +0 -19
  142. package/.agents/core/skills/impeccable-design/VALIDATION.json +0 -12
  143. package/.agents/core/skills/impeccable-design/skill.yaml +0 -20
  144. package/.agents/core/skills/interview-me/SKILL.md +0 -97
  145. package/.agents/core/skills/interview-me/VALIDATION.json +0 -12
  146. package/.agents/core/skills/interview-me/skill.yaml +0 -12
  147. package/.agents/core/skills/microservices/EXAMPLES.md +0 -38
  148. package/.agents/core/skills/microservices/SKILL.md +0 -164
  149. package/.agents/core/skills/microservices/TROUBLESHOOTING.md +0 -19
  150. package/.agents/core/skills/microservices/VALIDATION.json +0 -12
  151. package/.agents/core/skills/microservices/microservices.md +0 -119
  152. package/.agents/core/skills/microservices/skill.yaml +0 -17
  153. package/.agents/core/skills/minimalist-design/SKILL.md +0 -113
  154. package/.agents/core/skills/minimalist-design/VALIDATION.json +0 -12
  155. package/.agents/core/skills/minimalist-design/skill.yaml +0 -12
  156. package/.agents/core/skills/nestjs/EXAMPLES.md +0 -40
  157. package/.agents/core/skills/nestjs/SKILL.md +0 -139
  158. package/.agents/core/skills/nestjs/TROUBLESHOOTING.md +0 -19
  159. package/.agents/core/skills/nestjs/VALIDATION.json +0 -12
  160. package/.agents/core/skills/nestjs/nestjs.md +0 -103
  161. package/.agents/core/skills/nestjs/skill.yaml +0 -17
  162. package/.agents/core/skills/nextjs/EXAMPLES.md +0 -40
  163. package/.agents/core/skills/nextjs/SKILL.md +0 -163
  164. package/.agents/core/skills/nextjs/TROUBLESHOOTING.md +0 -19
  165. package/.agents/core/skills/nextjs/VALIDATION.json +0 -12
  166. package/.agents/core/skills/nextjs/nextjs.md +0 -67
  167. package/.agents/core/skills/nextjs/skill.yaml +0 -17
  168. package/.agents/core/skills/node/EXAMPLES.md +0 -80
  169. package/.agents/core/skills/node/SKILL.md +0 -128
  170. package/.agents/core/skills/node/TROUBLESHOOTING.md +0 -19
  171. package/.agents/core/skills/node/VALIDATION.json +0 -12
  172. package/.agents/core/skills/node/node.md +0 -87
  173. package/.agents/core/skills/node/skill.yaml +0 -17
  174. package/.agents/core/skills/performance/EXAMPLES.md +0 -30
  175. package/.agents/core/skills/performance/SKILL.md +0 -75
  176. package/.agents/core/skills/performance/TROUBLESHOOTING.md +0 -19
  177. package/.agents/core/skills/performance/VALIDATION.json +0 -12
  178. package/.agents/core/skills/performance/performance.md +0 -52
  179. package/.agents/core/skills/performance/skill.yaml +0 -17
  180. package/.agents/core/skills/react/EXAMPLES.md +0 -79
  181. package/.agents/core/skills/react/SKILL.md +0 -132
  182. package/.agents/core/skills/react/TROUBLESHOOTING.md +0 -19
  183. package/.agents/core/skills/react/VALIDATION.json +0 -12
  184. package/.agents/core/skills/react/react.md +0 -93
  185. package/.agents/core/skills/react/skill.yaml +0 -17
  186. package/.agents/core/skills/react-best-practices/SKILL.md +0 -155
  187. package/.agents/core/skills/react-best-practices/VALIDATION.json +0 -12
  188. package/.agents/core/skills/react-best-practices/skill.yaml +0 -14
  189. package/.agents/core/skills/redesign-audit/SKILL.md +0 -117
  190. package/.agents/core/skills/redesign-audit/VALIDATION.json +0 -12
  191. package/.agents/core/skills/redesign-audit/skill.yaml +0 -12
  192. package/.agents/core/skills/soft-design/SKILL.md +0 -108
  193. package/.agents/core/skills/soft-design/VALIDATION.json +0 -12
  194. package/.agents/core/skills/soft-design/skill.yaml +0 -12
  195. package/.agents/core/skills/state-management/EXAMPLES.md +0 -56
  196. package/.agents/core/skills/state-management/SKILL.md +0 -48
  197. package/.agents/core/skills/state-management/TROUBLESHOOTING.md +0 -18
  198. package/.agents/core/skills/state-management/VALIDATION.json +0 -11
  199. package/.agents/core/skills/state-management/skill.yaml +0 -28
  200. package/.agents/core/skills/subagent-orchestrator/SKILL.md +0 -117
  201. package/.agents/core/skills/subagent-orchestrator/VALIDATION.json +0 -12
  202. package/.agents/core/skills/subagent-orchestrator/skill.yaml +0 -12
  203. package/.agents/core/skills/system-design/EXAMPLES.md +0 -75
  204. package/.agents/core/skills/system-design/SKILL.md +0 -419
  205. package/.agents/core/skills/system-design/TROUBLESHOOTING.md +0 -19
  206. package/.agents/core/skills/system-design/VALIDATION.json +0 -12
  207. package/.agents/core/skills/system-design/skill.yaml +0 -20
  208. package/.agents/core/skills/system-design/system-design.md +0 -112
  209. package/.agents/core/skills/testing/EXAMPLES.md +0 -71
  210. package/.agents/core/skills/testing/SKILL.md +0 -70
  211. package/.agents/core/skills/testing/TROUBLESHOOTING.md +0 -18
  212. package/.agents/core/skills/testing/VALIDATION.json +0 -11
  213. package/.agents/core/skills/testing/skill.yaml +0 -32
  214. package/.agents/core/skills/typescript/EXAMPLES.md +0 -64
  215. package/.agents/core/skills/typescript/SKILL.md +0 -112
  216. package/.agents/core/skills/typescript/TROUBLESHOOTING.md +0 -19
  217. package/.agents/core/skills/typescript/VALIDATION.json +0 -12
  218. package/.agents/core/skills/typescript/skill.yaml +0 -17
  219. package/.agents/core/skills/typescript/typescript.md +0 -71
  220. package/.agents/core/skills/ui-design/EXAMPLES.md +0 -21
  221. package/.agents/core/skills/ui-design/SKILL.md +0 -124
  222. package/.agents/core/skills/ui-design/TROUBLESHOOTING.md +0 -19
  223. package/.agents/core/skills/ui-design/VALIDATION.json +0 -12
  224. package/.agents/core/skills/ui-design/skill.yaml +0 -17
  225. package/.agents/core/skills/ui-design/ui.md +0 -88
  226. package/.agents/core/skills/ui-ux-pro/EXAMPLES.md +0 -62
  227. package/.agents/core/skills/ui-ux-pro/SKILL.md +0 -375
  228. package/.agents/core/skills/ui-ux-pro/TROUBLESHOOTING.md +0 -19
  229. package/.agents/core/skills/ui-ux-pro/VALIDATION.json +0 -12
  230. package/.agents/core/skills/ui-ux-pro/skill.yaml +0 -19
  231. package/.agents/core/skills/ux-design/EXAMPLES.md +0 -36
  232. package/.agents/core/skills/ux-design/SKILL.md +0 -116
  233. package/.agents/core/skills/ux-design/TROUBLESHOOTING.md +0 -19
  234. package/.agents/core/skills/ux-design/VALIDATION.json +0 -12
  235. package/.agents/core/skills/ux-design/skill.yaml +0 -17
  236. package/.agents/core/skills/ux-design/ux.md +0 -80
  237. package/.agents/core/skills/vercel-optimize/SKILL.md +0 -83
  238. package/.agents/core/skills/vercel-optimize/VALIDATION.json +0 -12
  239. package/.agents/core/skills/vercel-optimize/scripts/collect-signals.mjs +0 -131
  240. package/.agents/core/skills/vercel-optimize/scripts/gate-investigations.mjs +0 -142
  241. package/.agents/core/skills/vercel-optimize/scripts/merge-signals.mjs +0 -143
  242. package/.agents/core/skills/vercel-optimize/scripts/scan-codebase.mjs +0 -174
  243. package/.agents/core/skills/vercel-optimize/skill.yaml +0 -18
  244. package/.agents/core/skills/web-accessibility/EXAMPLES.md +0 -39
  245. package/.agents/core/skills/web-accessibility/SKILL.md +0 -170
  246. package/.agents/core/skills/web-accessibility/TROUBLESHOOTING.md +0 -19
  247. package/.agents/core/skills/web-accessibility/VALIDATION.json +0 -12
  248. package/.agents/core/skills/web-accessibility/accessibility.md +0 -63
  249. package/.agents/core/skills/web-accessibility/skill.yaml +0 -17
  250. package/.agents/generated/claude/skills/adapters/SKILL.md +0 -126
  251. package/.agents/generated/claude/skills/architecture-diagrams/SKILL.md +0 -101
  252. package/.agents/generated/claude/skills/brutalist-design/SKILL.md +0 -145
  253. package/.agents/generated/claude/skills/database/SKILL.md +0 -191
  254. package/.agents/generated/claude/skills/ddd/SKILL.md +0 -305
  255. package/.agents/generated/claude/skills/decisions/SKILL.md +0 -134
  256. package/.agents/generated/claude/skills/docker/SKILL.md +0 -135
  257. package/.agents/generated/claude/skills/fastapi/SKILL.md +0 -200
  258. package/.agents/generated/claude/skills/generators/SKILL.md +0 -133
  259. package/.agents/generated/claude/skills/graphify/SKILL.md +0 -198
  260. package/.agents/generated/claude/skills/impeccable-design/SKILL.md +0 -241
  261. package/.agents/generated/claude/skills/interview-me/SKILL.md +0 -90
  262. package/.agents/generated/claude/skills/microservices/SKILL.md +0 -218
  263. package/.agents/generated/claude/skills/minimalist-design/SKILL.md +0 -108
  264. package/.agents/generated/claude/skills/nestjs/SKILL.md +0 -195
  265. package/.agents/generated/claude/skills/nextjs/SKILL.md +0 -219
  266. package/.agents/generated/claude/skills/node/SKILL.md +0 -224
  267. package/.agents/generated/claude/skills/performance/SKILL.md +0 -121
  268. package/.agents/generated/claude/skills/react/SKILL.md +0 -227
  269. package/.agents/generated/claude/skills/react-best-practices/SKILL.md +0 -146
  270. package/.agents/generated/claude/skills/redesign-audit/SKILL.md +0 -112
  271. package/.agents/generated/claude/skills/soft-design/SKILL.md +0 -103
  272. package/.agents/generated/claude/skills/state-management/SKILL.md +0 -120
  273. package/.agents/generated/claude/skills/subagent-orchestrator/SKILL.md +0 -110
  274. package/.agents/generated/claude/skills/system-design/SKILL.md +0 -507
  275. package/.agents/generated/claude/skills/testing/SKILL.md +0 -157
  276. package/.agents/generated/claude/skills/typescript/SKILL.md +0 -192
  277. package/.agents/generated/claude/skills/ui-design/SKILL.md +0 -161
  278. package/.agents/generated/claude/skills/ui-ux-pro/SKILL.md +0 -451
  279. package/.agents/generated/claude/skills/ux-design/SKILL.md +0 -168
  280. package/.agents/generated/claude/skills/vercel-optimize/SKILL.md +0 -76
  281. package/.agents/generated/claude/skills/web-accessibility/SKILL.md +0 -225
  282. package/.agents/generated/gemini/skills/adapters/SKILL.md +0 -135
  283. package/.agents/generated/gemini/skills/architecture-diagrams/SKILL.md +0 -107
  284. package/.agents/generated/gemini/skills/brutalist-design/SKILL.md +0 -151
  285. package/.agents/generated/gemini/skills/database/SKILL.md +0 -200
  286. package/.agents/generated/gemini/skills/ddd/SKILL.md +0 -314
  287. package/.agents/generated/gemini/skills/decisions/SKILL.md +0 -143
  288. package/.agents/generated/gemini/skills/docker/SKILL.md +0 -144
  289. package/.agents/generated/gemini/skills/fastapi/SKILL.md +0 -209
  290. package/.agents/generated/gemini/skills/generators/SKILL.md +0 -142
  291. package/.agents/generated/gemini/skills/graphify/SKILL.md +0 -205
  292. package/.agents/generated/gemini/skills/impeccable-design/SKILL.md +0 -250
  293. package/.agents/generated/gemini/skills/interview-me/SKILL.md +0 -96
  294. package/.agents/generated/gemini/skills/microservices/SKILL.md +0 -227
  295. package/.agents/generated/gemini/skills/minimalist-design/SKILL.md +0 -114
  296. package/.agents/generated/gemini/skills/nestjs/SKILL.md +0 -204
  297. package/.agents/generated/gemini/skills/nextjs/SKILL.md +0 -298
  298. package/.agents/generated/gemini/skills/node/SKILL.md +0 -323
  299. package/.agents/generated/gemini/skills/performance/SKILL.md +0 -185
  300. package/.agents/generated/gemini/skills/react/SKILL.md +0 -332
  301. package/.agents/generated/gemini/skills/react-best-practices/SKILL.md +0 -152
  302. package/.agents/generated/gemini/skills/redesign-audit/SKILL.md +0 -118
  303. package/.agents/generated/gemini/skills/soft-design/SKILL.md +0 -109
  304. package/.agents/generated/gemini/skills/state-management/SKILL.md +0 -129
  305. package/.agents/generated/gemini/skills/subagent-orchestrator/SKILL.md +0 -116
  306. package/.agents/generated/gemini/skills/system-design/SKILL.md +0 -631
  307. package/.agents/generated/gemini/skills/testing/SKILL.md +0 -166
  308. package/.agents/generated/gemini/skills/typescript/SKILL.md +0 -275
  309. package/.agents/generated/gemini/skills/ui-design/SKILL.md +0 -170
  310. package/.agents/generated/gemini/skills/ui-ux-pro/SKILL.md +0 -460
  311. package/.agents/generated/gemini/skills/ux-design/SKILL.md +0 -177
  312. package/.agents/generated/gemini/skills/vercel-optimize/SKILL.md +0 -82
  313. package/.agents/generated/gemini/skills/web-accessibility/SKILL.md +0 -300
@@ -0,0 +1,525 @@
1
+ /**
2
+ * .agents/rules/rule-catalog.js
3
+ * ContextOS — Rule Catalog, Instruction Inventory & Enforcement Engine (Milestone 9)
4
+ *
5
+ * Implements:
6
+ * - Comprehensive rule inventory tracking (id, skill, summary, level, enforcement, checker)
7
+ * - Automated checker registry (runtime, linter, scanner, compiler)
8
+ * - Enforcement levels: ENFORCED, PARTIALLY_ENFORCED, PROMPT_GUIDANCE, REFERENCE, EXAMPLE
9
+ * - Invariant check: "A rule existing only in Markdown is NOT ENFORCED (requires automated checker)"
10
+ * - Rule explanation formatting for `ctx explain`
11
+ * - Parity with compiled registry and manifest declarations
12
+ */
13
+
14
+ 'use strict';
15
+
16
+ const fs = require('fs');
17
+ const path = require('path');
18
+
19
+ /**
20
+ * Standard enforcement levels
21
+ */
22
+ const ENFORCEMENT_LEVELS = {
23
+ ENFORCED: 'ENFORCED', // Backed by deterministic runtime/linter checker
24
+ PARTIALLY_ENFORCED: 'PARTIALLY_ENFORCED', // Heuristic checker or partial automated guard
25
+ PROMPT_GUIDANCE: 'PROMPT_GUIDANCE', // Normative natural language prompt instruction
26
+ REFERENCE: 'REFERENCE', // Architecture reference or pattern guide
27
+ EXAMPLE: 'EXAMPLE', // Code snippet or reference illustration
28
+ };
29
+
30
+ /**
31
+ * Normalizes enforcement strings to standard uppercase ENFORCEMENT_LEVELS
32
+ */
33
+ function normalizeEnforcement(val) {
34
+ if (!val) return ENFORCEMENT_LEVELS.PROMPT_GUIDANCE;
35
+ const s = String(val).trim().toUpperCase().replace(/-/g, '_');
36
+ if (s === 'RUNTIME' || s === 'LINTER' || s === 'ENFORCED') return ENFORCEMENT_LEVELS.ENFORCED;
37
+ if (s === 'PARTIAL' || s === 'PARTIALLY_ENFORCED') return ENFORCEMENT_LEVELS.PARTIALLY_ENFORCED;
38
+ if (s === 'PROMPT' || s === 'PROMPT_GUIDANCE' || s === 'GUIDANCE') return ENFORCEMENT_LEVELS.PROMPT_GUIDANCE;
39
+ if (s === 'REFERENCE' || s === 'DOCS') return ENFORCEMENT_LEVELS.REFERENCE;
40
+ if (s === 'EXAMPLE') return ENFORCEMENT_LEVELS.EXAMPLE;
41
+ return ENFORCEMENT_LEVELS.PROMPT_GUIDANCE;
42
+ }
43
+
44
+ /**
45
+ * Registered automated checkers in ContextOS
46
+ */
47
+ const AUTOMATED_CHECKERS = {
48
+ 'workspace-path-policy-v2': {
49
+ id: 'workspace-path-policy-v2',
50
+ name: 'Workspace Path Policy Guard v2',
51
+ description: 'Enforces directory containment, blocks traversal, NUL-bytes, and symlink escapes in safe-path.js',
52
+ type: 'runtime',
53
+ module: '.agents/filesystem/safe-path.js',
54
+ },
55
+ 'project-mutation-lock': {
56
+ id: 'project-mutation-lock',
57
+ name: 'Project Mutation Lock Engine',
58
+ description: 'Enforces cross-process advisory mutation locking preventing concurrent write corruption',
59
+ type: 'runtime',
60
+ module: '.agents/filesystem/project-lock.js',
61
+ },
62
+ 'journaled-transaction-recovery': {
63
+ id: 'journaled-transaction-recovery',
64
+ name: 'Journaled Transaction & Rollback Recovery',
65
+ description: 'Atomically stages file mutations with write-ahead intent log and rollback crash recovery',
66
+ type: 'runtime',
67
+ module: '.agents/filesystem/journaled-transaction.js',
68
+ },
69
+ 'lockfile-cas-integrity': {
70
+ id: 'lockfile-cas-integrity',
71
+ name: 'Lockfile v2 CAS Integrity Checker',
72
+ description: 'Cryptographically verifies Content Addressable Storage hashes for all managed project artifacts',
73
+ type: 'runtime',
74
+ module: '.agents/filesystem/lockfile-v2.js',
75
+ },
76
+ 'secret-scanner': {
77
+ id: 'secret-scanner',
78
+ name: 'Automated Secret & Credential Scanner',
79
+ description: 'Pre-commit and doctor scan detecting private keys, AWS/GCP/OpenAI credentials, and tokens',
80
+ type: 'scanner',
81
+ module: 'scripts/check-secrets.js',
82
+ },
83
+ 'adapter-drift-detector': {
84
+ id: 'adapter-drift-detector',
85
+ name: 'Adapter Output Provenance & Drift Detector',
86
+ description: 'Detects unauthorized manual modifications and upstream drift in generated agent adapter configs',
87
+ type: 'runtime',
88
+ module: '.agents/adapters/drift-detector.js',
89
+ },
90
+ 'manifest-schema-validator': {
91
+ id: 'manifest-schema-validator',
92
+ name: 'Skill Manifest Schema v2 Compiler Validator',
93
+ description: 'Fails closed on schema violations, invalid paths, and frontmatter divergence',
94
+ type: 'compiler',
95
+ module: '.agents/compiler/manifest-compiler.js',
96
+ },
97
+ 'skill-frontmatter-validator': {
98
+ id: 'skill-frontmatter-validator',
99
+ name: 'Skill Frontmatter & COSTAR Quality Validator',
100
+ description: 'Verifies YAML frontmatter integrity, minimum content sizes, and COSTAR formatting in SKILL.md',
101
+ type: 'linter',
102
+ module: '.agents/validate.js',
103
+ },
104
+ 'profile-integrity-validator': {
105
+ id: 'profile-integrity-validator',
106
+ name: 'Profile Integrity & Exclusion Validator',
107
+ description: 'Validates profile definitions, required skills, exclusions, and scoped package configurations',
108
+ type: 'compiler',
109
+ module: '.agents/profiles.js',
110
+ },
111
+ 'watch-coalescing-guard': {
112
+ id: 'watch-coalescing-guard',
113
+ name: 'Watch Event Coalescing & Race Guard',
114
+ description: 'Coalesces rapid file modification bursts and synchronizes compilations under project lock',
115
+ type: 'runtime',
116
+ module: '.agents/watch.js',
117
+ },
118
+ };
119
+
120
+ /**
121
+ * Built-in core normative rules inventory
122
+ */
123
+ const BUILTIN_RULES = [
124
+ {
125
+ id: 'SEC-001',
126
+ sourceSkill: 'security',
127
+ level: 'must',
128
+ enforcement: 'prompt-guidance',
129
+ summary: 'Always validate and sanitize all user input and untrusted external payloads before processing',
130
+ applicability: ['api', 'controllers', 'forms', 'inputs'],
131
+ priority: 90,
132
+ tokenCost: 45,
133
+ duplicates: ['SEC-AGENT-006'],
134
+ conflicts: [],
135
+ },
136
+ {
137
+ id: 'SEC-002',
138
+ sourceSkill: 'security',
139
+ level: 'must',
140
+ enforcement: 'runtime',
141
+ checker: 'secret-scanner',
142
+ summary: 'Zero plaintext credentials, private keys, or API tokens committed to repository',
143
+ applicability: ['all'],
144
+ priority: 100,
145
+ tokenCost: 35,
146
+ duplicates: [],
147
+ conflicts: [],
148
+ },
149
+ {
150
+ id: 'SEC-003',
151
+ sourceSkill: 'security',
152
+ level: 'must',
153
+ enforcement: 'prompt-guidance',
154
+ summary: 'Enforce authentication and authorization checks prior to accessing sensitive resources or data',
155
+ applicability: ['routes', 'services', 'database'],
156
+ priority: 95,
157
+ tokenCost: 40,
158
+ duplicates: [],
159
+ conflicts: [],
160
+ },
161
+ {
162
+ id: 'FS-001',
163
+ sourceSkill: 'filesystem',
164
+ level: 'must',
165
+ enforcement: 'runtime',
166
+ checker: 'workspace-path-policy-v2',
167
+ summary: 'Restrict all filesystem mutations strictly inside project root; prevent directory traversal',
168
+ applicability: ['filesystem', 'adapters', 'init'],
169
+ priority: 100,
170
+ tokenCost: 35,
171
+ duplicates: [],
172
+ conflicts: [],
173
+ },
174
+ {
175
+ id: 'FS-002',
176
+ sourceSkill: 'filesystem',
177
+ level: 'must',
178
+ enforcement: 'runtime',
179
+ checker: 'project-mutation-lock',
180
+ summary: 'Cross-process write operations must acquire project mutation lock to prevent concurrent races',
181
+ applicability: ['cli', 'adapters', 'watch', 'init'],
182
+ priority: 95,
183
+ tokenCost: 35,
184
+ duplicates: [],
185
+ conflicts: [],
186
+ },
187
+ {
188
+ id: 'FS-003',
189
+ sourceSkill: 'filesystem',
190
+ level: 'must',
191
+ enforcement: 'runtime',
192
+ checker: 'journaled-transaction-recovery',
193
+ summary: 'Multi-file modifications must execute within journaled transaction with atomic rollback capability',
194
+ applicability: ['adapters', 'init', 'update'],
195
+ priority: 95,
196
+ tokenCost: 40,
197
+ duplicates: [],
198
+ conflicts: [],
199
+ },
200
+ {
201
+ id: 'ADAPT-001',
202
+ sourceSkill: 'adapters',
203
+ level: 'must',
204
+ enforcement: 'runtime',
205
+ checker: 'adapter-drift-detector',
206
+ summary: 'Adapter compiler must produce deterministic output with provenance headers and detect drift',
207
+ applicability: ['adapters', 'export'],
208
+ priority: 90,
209
+ tokenCost: 40,
210
+ duplicates: [],
211
+ conflicts: [],
212
+ },
213
+ {
214
+ id: 'LOCK-001',
215
+ sourceSkill: 'filesystem',
216
+ level: 'must',
217
+ enforcement: 'runtime',
218
+ checker: 'lockfile-cas-integrity',
219
+ summary: 'Managed files in lockfile must match SHA-256 CAS content hashes with fail-closed integrity',
220
+ applicability: ['lockfile', 'doctor'],
221
+ priority: 95,
222
+ tokenCost: 35,
223
+ duplicates: [],
224
+ conflicts: [],
225
+ },
226
+ {
227
+ id: 'ARCH-001',
228
+ sourceSkill: 'system-design',
229
+ level: 'must',
230
+ enforcement: 'prompt-guidance',
231
+ summary: 'Business domain logic must never reside directly inside API route handlers or UI components',
232
+ applicability: ['routes', 'api', 'controllers'],
233
+ priority: 85,
234
+ tokenCost: 40,
235
+ duplicates: [],
236
+ conflicts: [],
237
+ },
238
+ {
239
+ id: 'ARCH-002',
240
+ sourceSkill: 'decisions',
241
+ level: 'should',
242
+ enforcement: 'reference',
243
+ summary: 'Record significant architectural choices and trade-offs in Architecture Decision Records (docs/decisions/)',
244
+ applicability: ['architecture', 'docs'],
245
+ priority: 70,
246
+ tokenCost: 30,
247
+ duplicates: [],
248
+ conflicts: [],
249
+ },
250
+ {
251
+ id: 'WORK-001',
252
+ sourceSkill: 'engineering-workflow',
253
+ level: 'must',
254
+ enforcement: 'runtime',
255
+ checker: 'manifest-schema-validator',
256
+ summary: 'All skill manifests must strictly conform to schema v2 with fail-closed validation',
257
+ applicability: ['skills', 'manifests'],
258
+ priority: 95,
259
+ tokenCost: 35,
260
+ duplicates: [],
261
+ conflicts: [],
262
+ },
263
+ {
264
+ id: 'WORK-002',
265
+ sourceSkill: 'engineering-workflow',
266
+ level: 'must',
267
+ enforcement: 'prompt-guidance',
268
+ summary: 'Follow risk-based workflows: routine tasks fast-track, standard plan, high requires spec & review',
269
+ applicability: ['workflow', 'all'],
270
+ priority: 90,
271
+ tokenCost: 50,
272
+ duplicates: [],
273
+ conflicts: [],
274
+ },
275
+ {
276
+ id: 'TEST-001',
277
+ sourceSkill: 'testing',
278
+ level: 'must',
279
+ enforcement: 'runtime',
280
+ checker: 'skill-frontmatter-validator',
281
+ summary: 'Zero unverified claims: mandatory proof-of-work with automated test suite and validator execution',
282
+ applicability: ['all'],
283
+ priority: 100,
284
+ tokenCost: 45,
285
+ duplicates: [],
286
+ conflicts: [],
287
+ },
288
+ {
289
+ id: 'PON-001',
290
+ sourceSkill: 'ponytail-mindset',
291
+ level: 'must',
292
+ enforcement: 'prompt-guidance',
293
+ summary: 'Surgical blast radius: modify only files planned for the task; zero unnecessary boilerplate',
294
+ applicability: ['all'],
295
+ priority: 90,
296
+ tokenCost: 35,
297
+ duplicates: [],
298
+ conflicts: [],
299
+ },
300
+ ];
301
+
302
+ /**
303
+ * Class representing the Rule Catalog and Instruction Inventory
304
+ */
305
+ class RuleCatalog {
306
+ constructor(options = {}) {
307
+ this.rootDir = options.rootDir || process.cwd();
308
+ this.checkers = { ...AUTOMATED_CHECKERS, ...(options.customCheckers || {}) };
309
+ this.rules = new Map();
310
+
311
+ // Register builtin rules
312
+ for (const rule of BUILTIN_RULES) {
313
+ this.registerRule(rule);
314
+ }
315
+ }
316
+
317
+ /**
318
+ * Registers a rule in the catalog, validating the enforcement invariant.
319
+ */
320
+ registerRule(rule) {
321
+ if (!rule || !rule.id) {
322
+ throw new Error('Rule registration requires a valid rule object with an "id" property.');
323
+ }
324
+
325
+ const enforcement = normalizeEnforcement(rule.enforcement);
326
+
327
+ // INVARIANT (Section 14.1): A rule existing only in Markdown cannot be ENFORCED.
328
+ if (enforcement === ENFORCEMENT_LEVELS.ENFORCED) {
329
+ if (!rule.checker) {
330
+ throw new Error(`Rule '${rule.id}' cannot be marked ENFORCED without a registered automated checker.`);
331
+ }
332
+ if (!this.checkers[rule.checker]) {
333
+ throw new Error(`Rule '${rule.id}' references unknown checker '${rule.checker}'. Registered checkers: ${Object.keys(this.checkers).join(', ')}`);
334
+ }
335
+ }
336
+
337
+ const normalized = {
338
+ id: rule.id,
339
+ sourceSkill: rule.sourceSkill || 'core',
340
+ level: rule.level || 'must',
341
+ enforcement,
342
+ checker: enforcement === ENFORCEMENT_LEVELS.ENFORCED ? rule.checker : (rule.checker || null),
343
+ summary: rule.summary || '',
344
+ applicability: Array.isArray(rule.applicability) ? rule.applicability : ['all'],
345
+ priority: typeof rule.priority === 'number' ? rule.priority : 50,
346
+ tokenCost: typeof rule.tokenCost === 'number' ? rule.tokenCost : 40,
347
+ duplicates: Array.isArray(rule.duplicates) ? rule.duplicates : [],
348
+ conflicts: Array.isArray(rule.conflicts) ? rule.conflicts : [],
349
+ };
350
+
351
+ this.rules.set(normalized.id, normalized);
352
+ return normalized;
353
+ }
354
+
355
+ /**
356
+ * Loads rules declared inside compiled registry or skills directory
357
+ */
358
+ loadFromRegistry(registry) {
359
+ if (!registry || !registry.skills) return;
360
+
361
+ for (const [skillId, skill] of Object.entries(registry.skills)) {
362
+ if (Array.isArray(skill.rules)) {
363
+ for (const r of skill.rules) {
364
+ try {
365
+ this.registerRule({
366
+ ...r,
367
+ sourceSkill: skillId,
368
+ });
369
+ } catch (err) {
370
+ // Log warning on invalid manifest rule
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+
377
+ /**
378
+ * Retrieves a rule by ID
379
+ */
380
+ getRule(id) {
381
+ return this.rules.get(id) || null;
382
+ }
383
+
384
+ /**
385
+ * Returns all rules as an array
386
+ */
387
+ getAllRules() {
388
+ return Array.from(this.rules.values());
389
+ }
390
+
391
+ /**
392
+ * Returns all registered automated checkers
393
+ */
394
+ getAllCheckers() {
395
+ return Object.values(this.checkers);
396
+ }
397
+
398
+ /**
399
+ * Formats detailed explanation for a single rule
400
+ */
401
+ explainRule(id) {
402
+ const rule = this.getRule(id);
403
+ if (!rule) {
404
+ return `Rule '${id}' not found in catalog. Run 'contextos explain --rules' to list all rules.`;
405
+ }
406
+
407
+ const lines = [];
408
+ lines.push('\n══════════════════════════════════════════');
409
+ lines.push(` ContextOS — Rule Explanation: ${rule.id}`);
410
+ lines.push('══════════════════════════════════════════\n');
411
+ lines.push(` Rule ID : ${rule.id}`);
412
+ lines.push(` Source Skill : ${rule.sourceSkill}`);
413
+ lines.push(` Level : ${rule.level.toUpperCase()}`);
414
+ lines.push(` Enforcement : ${rule.enforcement}`);
415
+
416
+ if (rule.enforcement === ENFORCEMENT_LEVELS.ENFORCED) {
417
+ const checker = this.checkers[rule.checker];
418
+ lines.push(` Active Checker : [ENFORCED] ${rule.checker}`);
419
+ if (checker) {
420
+ lines.push(` Checker Module : ${checker.module}`);
421
+ lines.push(` Checker Purpose : ${checker.description}`);
422
+ }
423
+ } else {
424
+ lines.push(` Enforcement Note : Governed via agent prompt guidelines (No runtime checker)`);
425
+ }
426
+
427
+ lines.push(` Summary : ${rule.summary}`);
428
+ lines.push(` Applicability : ${rule.applicability.join(', ')}`);
429
+ lines.push(` Estimated Cost : ~${rule.tokenCost} tokens`);
430
+ lines.push(` Priority : ${rule.priority} / 100`);
431
+
432
+ if (rule.duplicates.length > 0) {
433
+ lines.push(` Known Duplicates : ${rule.duplicates.join(', ')} (consolidated)`);
434
+ }
435
+ if (rule.conflicts.length > 0) {
436
+ lines.push(` Conflicts With : ${rule.conflicts.join(', ')}`);
437
+ }
438
+
439
+ lines.push('\n──────────────────────────────────────────\n');
440
+ return lines.join('\n');
441
+ }
442
+
443
+ /**
444
+ * Formats explanation of all rules within a skill
445
+ */
446
+ explainSkill(skillId) {
447
+ const skillRules = this.getAllRules().filter(r => r.sourceSkill === skillId);
448
+ const lines = [];
449
+ lines.push('\n══════════════════════════════════════════');
450
+ lines.push(` ContextOS — Skill Rules: ${skillId}`);
451
+ lines.push('══════════════════════════════════════════\n');
452
+
453
+ if (skillRules.length === 0) {
454
+ lines.push(` No individual rule IDs declared for '${skillId}'.`);
455
+ lines.push(` All guidance is delivered as comprehensive skill instructions.`);
456
+ } else {
457
+ lines.push(` Found ${skillRules.length} declared rule(s):\n`);
458
+ for (const r of skillRules) {
459
+ const checkStr = r.checker ? ` [Checker: ${r.checker}]` : '';
460
+ lines.push(` • ${r.id} (${r.level.toUpperCase()}) — ${r.enforcement}${checkStr}`);
461
+ lines.push(` "${r.summary}" (~${r.tokenCost} tokens)`);
462
+ }
463
+ }
464
+
465
+ lines.push('\n──────────────────────────────────────────\n');
466
+ return lines.join('\n');
467
+ }
468
+
469
+ /**
470
+ * Formats a summary table of all rules
471
+ */
472
+ formatRulesSummary() {
473
+ const lines = [];
474
+ lines.push('\n══════════════════════════════════════════════════════════════════════════════════');
475
+ lines.push(' ContextOS — Instruction Inventory & Rule Enforcement Catalog');
476
+ lines.push('══════════════════════════════════════════════════════════════════════════════════\n');
477
+ lines.push(' RULE ID | SKILL | LEVEL | ENFORCEMENT | CHECKER');
478
+ lines.push(' ──────────┼──────────────┼───────┼─────────────────┼────────────────────────────');
479
+
480
+ for (const r of this.getAllRules()) {
481
+ const id = r.id.padEnd(10);
482
+ const skill = r.sourceSkill.slice(0, 12).padEnd(12);
483
+ const level = r.level.toUpperCase().padEnd(5);
484
+ const enf = r.enforcement.slice(0, 15).padEnd(15);
485
+ const checker = r.checker ? r.checker.slice(0, 26) : '— (prompt guidance)';
486
+ lines.push(` ${id}| ${skill} | ${level} | ${enf} | ${checker}`);
487
+ }
488
+
489
+ lines.push('\n Total rules: ' + this.rules.size);
490
+ const enforcedCount = this.getAllRules().filter(r => r.enforcement === ENFORCEMENT_LEVELS.ENFORCED).length;
491
+ lines.push(` Enforced via code checkers : ${enforcedCount}`);
492
+ lines.push(` Governed via prompt : ${this.rules.size - enforcedCount}`);
493
+ lines.push('\n──────────────────────────────────────────────────────────────────────────────────\n');
494
+ return lines.join('\n');
495
+ }
496
+
497
+ /**
498
+ * Formats summary of automated checkers
499
+ */
500
+ formatCheckersSummary() {
501
+ const lines = [];
502
+ lines.push('\n══════════════════════════════════════════════════════════════════════════════════');
503
+ lines.push(' ContextOS — Registered Automated Enforcement Checkers');
504
+ lines.push('══════════════════════════════════════════════════════════════════════════════════\n');
505
+
506
+ for (const ch of this.getAllCheckers()) {
507
+ lines.push(` • ${ch.id} [${ch.type.toUpperCase()}]`);
508
+ lines.push(` Name : ${ch.name}`);
509
+ lines.push(` Module : ${ch.module}`);
510
+ lines.push(` Role : ${ch.description}\n`);
511
+ }
512
+
513
+ lines.push(` Total active checkers: ${Object.keys(this.checkers).length}`);
514
+ lines.push('──────────────────────────────────────────────────────────────────────────────────\n');
515
+ return lines.join('\n');
516
+ }
517
+ }
518
+
519
+ module.exports = {
520
+ RuleCatalog,
521
+ ENFORCEMENT_LEVELS,
522
+ AUTOMATED_CHECKERS,
523
+ BUILTIN_RULES,
524
+ normalizeEnforcement,
525
+ };
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "ContextOS Review Attestation v1",
4
+ "type": "object",
5
+ "required": [
6
+ "schemaVersion",
7
+ "status",
8
+ "subject",
9
+ "implementerExecutionId",
10
+ "reviewerExecutionId",
11
+ "provider",
12
+ "model",
13
+ "independenceLevel",
14
+ "rawOutputDigest",
15
+ "retries"
16
+ ],
17
+ "additionalProperties": false,
18
+ "properties": {
19
+ "schemaVersion": {
20
+ "type": "integer",
21
+ "const": 1
22
+ },
23
+ "status": {
24
+ "type": "string",
25
+ "enum": [
26
+ "NOT_CONFIGURED",
27
+ "PENDING",
28
+ "RUNNING",
29
+ "PASS",
30
+ "FAIL",
31
+ "ERROR",
32
+ "TIMEOUT",
33
+ "UNAVAILABLE",
34
+ "MALFORMED",
35
+ "STALE"
36
+ ]
37
+ },
38
+ "subject": {
39
+ "type": "object",
40
+ "required": [
41
+ "repositoryFingerprint",
42
+ "baseSha",
43
+ "headSha",
44
+ "diffSha256",
45
+ "scopeSha256"
46
+ ],
47
+ "properties": {
48
+ "repositoryFingerprint": { "type": "string" },
49
+ "baseSha": { "type": "string" },
50
+ "headSha": { "type": "string" },
51
+ "diffSha256": { "type": "string" },
52
+ "scopeSha256": { "type": "string" }
53
+ },
54
+ "additionalProperties": false
55
+ },
56
+ "implementerExecutionId": { "type": "string" },
57
+ "reviewerExecutionId": { "type": "string" },
58
+ "provider": { "type": "string" },
59
+ "model": { "type": "string" },
60
+ "independenceLevel": {
61
+ "type": "string",
62
+ "enum": [
63
+ "same_process",
64
+ "separate_process",
65
+ "isolated_container",
66
+ "external_evaluator"
67
+ ]
68
+ },
69
+ "rawOutputDigest": { "type": "string" },
70
+ "staticFindings": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "required": ["ruleId", "severity", "message"],
75
+ "properties": {
76
+ "ruleId": { "type": "string" },
77
+ "severity": {
78
+ "type": "string",
79
+ "enum": ["low", "medium", "high", "critical"]
80
+ },
81
+ "message": { "type": "string" },
82
+ "file": { "type": "string" },
83
+ "line": { "type": "integer" }
84
+ },
85
+ "additionalProperties": false
86
+ }
87
+ },
88
+ "llmVerdict": {
89
+ "type": "object",
90
+ "required": ["specCompliance", "codeQuality", "summary"],
91
+ "properties": {
92
+ "specCompliance": {
93
+ "type": "string",
94
+ "enum": ["PASS", "FAIL", "UNCERTAIN"]
95
+ },
96
+ "codeQuality": {
97
+ "type": "string",
98
+ "enum": ["PASS", "FAIL", "NEEDS_WORK"]
99
+ },
100
+ "summary": { "type": "string" }
101
+ },
102
+ "additionalProperties": false
103
+ },
104
+ "retries": {
105
+ "type": "integer",
106
+ "minimum": 0
107
+ },
108
+ "startedAt": { "type": "number" },
109
+ "completedAt": { "type": "number" }
110
+ }
111
+ }