@warpgogol/forge 9.0.0 → 9.1.1

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 (388) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +15 -8
  3. package/README.uk.md +15 -8
  4. package/bin/cli.ts +3 -2
  5. package/dist/bin/cli.js +3 -2
  6. package/dist/bin/cli.js.map +1 -1
  7. package/dist/os/agent/handlers/agent-tiers-validate.d.ts.map +1 -1
  8. package/dist/os/agent/handlers/agent-tiers-validate.js +5 -1
  9. package/dist/os/agent/handlers/agent-tiers-validate.js.map +1 -1
  10. package/dist/os/agent/index.d.ts.map +1 -1
  11. package/dist/os/agent/index.js +4 -0
  12. package/dist/os/agent/index.js.map +1 -1
  13. package/dist/os/authority/handlers/delegate.d.ts.map +1 -1
  14. package/dist/os/authority/handlers/delegate.js +2 -1
  15. package/dist/os/authority/handlers/delegate.js.map +1 -1
  16. package/dist/os/authority/index.d.ts.map +1 -1
  17. package/dist/os/authority/index.js +2 -1
  18. package/dist/os/authority/index.js.map +1 -1
  19. package/dist/os/checks/checks.module.d.ts.map +1 -1
  20. package/dist/os/checks/checks.module.js +5 -1
  21. package/dist/os/checks/checks.module.js.map +1 -1
  22. package/dist/os/checks/handlers/contribution-report.d.ts.map +1 -1
  23. package/dist/os/checks/handlers/contribution-report.js +5 -4
  24. package/dist/os/checks/handlers/contribution-report.js.map +1 -1
  25. package/dist/os/checks/handlers/counters-export.d.ts.map +1 -1
  26. package/dist/os/checks/handlers/counters-export.js +4 -0
  27. package/dist/os/checks/handlers/counters-export.js.map +1 -1
  28. package/dist/os/checks/handlers/counters-journal.d.ts.map +1 -1
  29. package/dist/os/checks/handlers/counters-journal.js +2 -1
  30. package/dist/os/checks/handlers/counters-journal.js.map +1 -1
  31. package/dist/os/checks/handlers/counters-validate.d.ts.map +1 -1
  32. package/dist/os/checks/handlers/counters-validate.js +5 -1
  33. package/dist/os/checks/handlers/counters-validate.js.map +1 -1
  34. package/dist/os/checks/index.d.ts.map +1 -1
  35. package/dist/os/checks/index.js +11 -0
  36. package/dist/os/checks/index.js.map +1 -1
  37. package/dist/os/compass/handlers/compass-docs-scaffold.js +1 -1
  38. package/dist/os/compass/handlers/compass-header-scaffold.d.ts.map +1 -1
  39. package/dist/os/compass/handlers/compass-header-scaffold.js +6 -1
  40. package/dist/os/compass/handlers/compass-header-scaffold.js.map +1 -1
  41. package/dist/os/compass/handlers/compass-invariants-generate.d.ts.map +1 -1
  42. package/dist/os/compass/handlers/compass-invariants-generate.js +3 -2
  43. package/dist/os/compass/handlers/compass-invariants-generate.js.map +1 -1
  44. package/dist/os/context/context.module.d.ts.map +1 -1
  45. package/dist/os/context/context.module.js +6 -1
  46. package/dist/os/context/context.module.js.map +1 -1
  47. package/dist/os/context/handlers/context-assemble.d.ts.map +1 -1
  48. package/dist/os/context/handlers/context-assemble.js +5 -1
  49. package/dist/os/context/handlers/context-assemble.js.map +1 -1
  50. package/dist/os/context/handlers/context-slate-eval.d.ts.map +1 -1
  51. package/dist/os/context/handlers/context-slate-eval.js +4 -0
  52. package/dist/os/context/handlers/context-slate-eval.js.map +1 -1
  53. package/dist/os/context/handlers/index-build.d.ts.map +1 -1
  54. package/dist/os/context/handlers/index-build.js +8 -5
  55. package/dist/os/context/handlers/index-build.js.map +1 -1
  56. package/dist/os/context/index.d.ts.map +1 -1
  57. package/dist/os/context/index.js +11 -0
  58. package/dist/os/context/index.js.map +1 -1
  59. package/dist/os/gate/handlers/gate-probe-catalog.d.ts.map +1 -1
  60. package/dist/os/gate/handlers/gate-probe-catalog.js +4 -0
  61. package/dist/os/gate/handlers/gate-probe-catalog.js.map +1 -1
  62. package/dist/os/gate/handlers/gate-probe.d.ts.map +1 -1
  63. package/dist/os/gate/handlers/gate-probe.js +4 -0
  64. package/dist/os/gate/handlers/gate-probe.js.map +1 -1
  65. package/dist/os/gate/index.d.ts.map +1 -1
  66. package/dist/os/gate/index.js +11 -0
  67. package/dist/os/gate/index.js.map +1 -1
  68. package/dist/os/instructions/instructions.module.d.ts.map +1 -1
  69. package/dist/os/instructions/instructions.module.js +2 -1
  70. package/dist/os/instructions/instructions.module.js.map +1 -1
  71. package/dist/os/knowledge/handlers/knowledge-authz-probe.d.ts.map +1 -1
  72. package/dist/os/knowledge/handlers/knowledge-authz-probe.js +7 -3
  73. package/dist/os/knowledge/handlers/knowledge-authz-probe.js.map +1 -1
  74. package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.d.ts +11 -0
  75. package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.d.ts.map +1 -0
  76. package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.js +428 -0
  77. package/dist/os/knowledge/handlers/knowledge-conflicts-resolve.js.map +1 -0
  78. package/dist/os/knowledge/handlers/knowledge-rebuild.d.ts.map +1 -1
  79. package/dist/os/knowledge/handlers/knowledge-rebuild.js +4 -0
  80. package/dist/os/knowledge/handlers/knowledge-rebuild.js.map +1 -1
  81. package/dist/os/knowledge/index.d.ts +1 -0
  82. package/dist/os/knowledge/index.d.ts.map +1 -1
  83. package/dist/os/knowledge/index.js +13 -0
  84. package/dist/os/knowledge/index.js.map +1 -1
  85. package/dist/os/knowledge/knowledge.module.d.ts.map +1 -1
  86. package/dist/os/knowledge/knowledge.module.js +35 -1
  87. package/dist/os/knowledge/knowledge.module.js.map +1 -1
  88. package/dist/os/queue/manifest.d.ts.map +1 -1
  89. package/dist/os/queue/manifest.js +8 -7
  90. package/dist/os/queue/manifest.js.map +1 -1
  91. package/dist/os/resolver/resolver.module.d.ts.map +1 -1
  92. package/dist/os/resolver/resolver.module.js +2 -1
  93. package/dist/os/resolver/resolver.module.js.map +1 -1
  94. package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts +1 -0
  95. package/dist/os/rfc/handlers/implement-stamp-deviations.d.ts.map +1 -1
  96. package/dist/os/rfc/handlers/implement-stamp-deviations.js +3 -0
  97. package/dist/os/rfc/handlers/implement-stamp-deviations.js.map +1 -1
  98. package/dist/os/rfc/handlers/implement-stamp-origin.d.ts.map +1 -1
  99. package/dist/os/rfc/handlers/implement-stamp-origin.js +10 -2
  100. package/dist/os/rfc/handlers/implement-stamp-origin.js.map +1 -1
  101. package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts +2 -0
  102. package/dist/os/rfc/handlers/implement-stamp-outcome.d.ts.map +1 -1
  103. package/dist/os/rfc/handlers/implement-stamp-outcome.js +2 -0
  104. package/dist/os/rfc/handlers/implement-stamp-outcome.js.map +1 -1
  105. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  106. package/dist/os/rfc/handlers/implement-stamp.js +176 -59
  107. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  108. package/dist/os/rfc/handlers/lifecycle.d.ts.map +1 -1
  109. package/dist/os/rfc/handlers/lifecycle.js +13 -6
  110. package/dist/os/rfc/handlers/lifecycle.js.map +1 -1
  111. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  112. package/dist/os/rfc/handlers/list-create.js +28 -2
  113. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  114. package/dist/os/rfc/reachable-symbol.d.ts.map +1 -1
  115. package/dist/os/rfc/reachable-symbol.js +4 -2
  116. package/dist/os/rfc/reachable-symbol.js.map +1 -1
  117. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  118. package/dist/os/rfc/rfc.module.js +23 -7
  119. package/dist/os/rfc/rfc.module.js.map +1 -1
  120. package/dist/os/rfc/types.d.ts +22 -2
  121. package/dist/os/rfc/types.d.ts.map +1 -1
  122. package/dist/os/rfc/types.js +18 -2
  123. package/dist/os/rfc/types.js.map +1 -1
  124. package/dist/os/rfc/verifier/rfc-1391/support.d.ts.map +1 -1
  125. package/dist/os/rfc/verifier/rfc-1391/support.js +4 -0
  126. package/dist/os/rfc/verifier/rfc-1391/support.js.map +1 -1
  127. package/dist/os/session/handlers/save.d.ts.map +1 -1
  128. package/dist/os/session/handlers/save.js +5 -2
  129. package/dist/os/session/handlers/save.js.map +1 -1
  130. package/dist/os/session/handlers/session-audit-report.d.ts.map +1 -1
  131. package/dist/os/session/handlers/session-audit-report.js +4 -0
  132. package/dist/os/session/handlers/session-audit-report.js.map +1 -1
  133. package/dist/os/session/handlers/session-audit.d.ts.map +1 -1
  134. package/dist/os/session/handlers/session-audit.js +4 -0
  135. package/dist/os/session/handlers/session-audit.js.map +1 -1
  136. package/dist/os/trajectory/handlers/journal-io.d.ts +9 -0
  137. package/dist/os/trajectory/handlers/journal-io.d.ts.map +1 -1
  138. package/dist/os/trajectory/handlers/journal-io.js +20 -2
  139. package/dist/os/trajectory/handlers/journal-io.js.map +1 -1
  140. package/dist/os/trajectory/handlers/outcome-record.d.ts.map +1 -1
  141. package/dist/os/trajectory/handlers/outcome-record.js +4 -1
  142. package/dist/os/trajectory/handlers/outcome-record.js.map +1 -1
  143. package/dist/os/trajectory/handlers/trajectory-index.d.ts.map +1 -1
  144. package/dist/os/trajectory/handlers/trajectory-index.js +30 -8
  145. package/dist/os/trajectory/handlers/trajectory-index.js.map +1 -1
  146. package/dist/os/trajectory/handlers/trajectory-recall.d.ts.map +1 -1
  147. package/dist/os/trajectory/handlers/trajectory-recall.js +7 -4
  148. package/dist/os/trajectory/handlers/trajectory-recall.js.map +1 -1
  149. package/dist/os/trajectory/index.d.ts.map +1 -1
  150. package/dist/os/trajectory/index.js +11 -0
  151. package/dist/os/trajectory/index.js.map +1 -1
  152. package/dist/os/trajectory/trajectory.module.d.ts.map +1 -1
  153. package/dist/os/trajectory/trajectory.module.js +16 -9
  154. package/dist/os/trajectory/trajectory.module.js.map +1 -1
  155. package/dist/os/werkstatt/handlers/session-close.d.ts.map +1 -1
  156. package/dist/os/werkstatt/handlers/session-close.js +3 -0
  157. package/dist/os/werkstatt/handlers/session-close.js.map +1 -1
  158. package/dist/os/werkstatt/handlers/session-engine.d.ts.map +1 -1
  159. package/dist/os/werkstatt/handlers/session-engine.js +3 -0
  160. package/dist/os/werkstatt/handlers/session-engine.js.map +1 -1
  161. package/dist/os/werkstatt/handlers/session-open.d.ts.map +1 -1
  162. package/dist/os/werkstatt/handlers/session-open.js +3 -0
  163. package/dist/os/werkstatt/handlers/session-open.js.map +1 -1
  164. package/dist/os/werkstatt/handlers/session-status.d.ts.map +1 -1
  165. package/dist/os/werkstatt/handlers/session-status.js +3 -0
  166. package/dist/os/werkstatt/handlers/session-status.js.map +1 -1
  167. package/dist/os/yaml/handlers/scalars-validate.d.ts +28 -0
  168. package/dist/os/yaml/handlers/scalars-validate.d.ts.map +1 -0
  169. package/dist/os/yaml/handlers/scalars-validate.js +311 -0
  170. package/dist/os/yaml/handlers/scalars-validate.js.map +1 -0
  171. package/dist/os/yaml/index.d.ts +4 -0
  172. package/dist/os/yaml/index.d.ts.map +1 -0
  173. package/dist/os/yaml/index.js +15 -0
  174. package/dist/os/yaml/index.js.map +1 -0
  175. package/dist/os/yaml/yaml.module.d.ts +3 -0
  176. package/dist/os/yaml/yaml.module.d.ts.map +1 -0
  177. package/dist/os/yaml/yaml.module.js +58 -0
  178. package/dist/os/yaml/yaml.module.js.map +1 -0
  179. package/dist/src/authority/delegations.d.ts.map +1 -1
  180. package/dist/src/authority/delegations.js +5 -4
  181. package/dist/src/authority/delegations.js.map +1 -1
  182. package/dist/src/cli-flags.d.ts.map +1 -1
  183. package/dist/src/cli-flags.js +1 -5
  184. package/dist/src/cli-flags.js.map +1 -1
  185. package/dist/src/compass/invariant-parser.d.ts.map +1 -1
  186. package/dist/src/compass/invariant-parser.js +2 -1
  187. package/dist/src/compass/invariant-parser.js.map +1 -1
  188. package/dist/src/config/forge-config.d.ts +17 -0
  189. package/dist/src/config/forge-config.d.ts.map +1 -1
  190. package/dist/src/config/forge-config.js +33 -10
  191. package/dist/src/config/forge-config.js.map +1 -1
  192. package/dist/src/formal/exhaustive.d.ts.map +1 -1
  193. package/dist/src/formal/exhaustive.js +3 -2
  194. package/dist/src/formal/exhaustive.js.map +1 -1
  195. package/dist/src/formal/index.d.ts.map +1 -1
  196. package/dist/src/formal/index.js +4 -0
  197. package/dist/src/formal/index.js.map +1 -1
  198. package/dist/src/formal/proof-runner.d.ts.map +1 -1
  199. package/dist/src/formal/proof-runner.js +4 -3
  200. package/dist/src/formal/proof-runner.js.map +1 -1
  201. package/dist/src/formal/proof-spec.d.ts.map +1 -1
  202. package/dist/src/formal/proof-spec.js +3 -2
  203. package/dist/src/formal/proof-spec.js.map +1 -1
  204. package/dist/src/index.d.ts +1 -1
  205. package/dist/src/index.d.ts.map +1 -1
  206. package/dist/src/index.js +1 -1
  207. package/dist/src/index.js.map +1 -1
  208. package/dist/src/knowledge/index.d.ts +2 -2
  209. package/dist/src/knowledge/index.d.ts.map +1 -1
  210. package/dist/src/knowledge/index.js +4 -3
  211. package/dist/src/knowledge/index.js.map +1 -1
  212. package/dist/src/knowledge/parse.d.ts +1 -0
  213. package/dist/src/knowledge/parse.d.ts.map +1 -1
  214. package/dist/src/knowledge/parse.js +20 -18
  215. package/dist/src/knowledge/parse.js.map +1 -1
  216. package/dist/src/knowledge/schema.d.ts.map +1 -1
  217. package/dist/src/knowledge/schema.js +5 -4
  218. package/dist/src/knowledge/schema.js.map +1 -1
  219. package/dist/src/knowledge/sync.d.ts +61 -0
  220. package/dist/src/knowledge/sync.d.ts.map +1 -1
  221. package/dist/src/knowledge/sync.js +202 -7
  222. package/dist/src/knowledge/sync.js.map +1 -1
  223. package/dist/src/onboarding/agents-generate.js +1 -1
  224. package/dist/src/onboarding/compass-docs/semantic-layer-block.js +1 -1
  225. package/dist/src/onboarding/doctor.d.ts +2 -0
  226. package/dist/src/onboarding/doctor.d.ts.map +1 -1
  227. package/dist/src/onboarding/doctor.js +166 -26
  228. package/dist/src/onboarding/doctor.js.map +1 -1
  229. package/dist/src/onboarding/nested-agents-generate.js +1 -1
  230. package/dist/src/onboarding/nested-agents-templates.js +1 -1
  231. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  232. package/dist/src/onboarding/upgrade.js +18 -10
  233. package/dist/src/onboarding/upgrade.js.map +1 -1
  234. package/dist/src/reachability/command-mentions.d.ts.map +1 -1
  235. package/dist/src/reachability/command-mentions.js +4 -2
  236. package/dist/src/reachability/command-mentions.js.map +1 -1
  237. package/dist/src/registry.d.ts +20 -0
  238. package/dist/src/registry.d.ts.map +1 -1
  239. package/dist/src/registry.js +129 -67
  240. package/dist/src/registry.js.map +1 -1
  241. package/dist/src/validators/skill-validate.d.ts +5 -0
  242. package/dist/src/validators/skill-validate.d.ts.map +1 -1
  243. package/dist/src/validators/skill-validate.js +34 -8
  244. package/dist/src/validators/skill-validate.js.map +1 -1
  245. package/docs/maintainers/publishing.md +11 -5
  246. package/docs/reference/cli.md +128 -0
  247. package/docs/reference/profiles.md +1 -0
  248. package/os/agent/handlers/agent-tiers-validate.ts +5 -1
  249. package/os/agent/index.ts +4 -0
  250. package/os/authority/handlers/delegate.ts +2 -1
  251. package/os/authority/index.ts +2 -1
  252. package/os/checks/checks.module.ts +5 -1
  253. package/os/checks/handlers/contribution-report.test.ts +6 -0
  254. package/os/checks/handlers/contribution-report.ts +5 -4
  255. package/os/checks/handlers/counters-export.test.ts +6 -0
  256. package/os/checks/handlers/counters-export.ts +4 -0
  257. package/os/checks/handlers/counters-journal.test.ts +6 -0
  258. package/os/checks/handlers/counters-journal.ts +2 -1
  259. package/os/checks/handlers/counters-validate.test.ts +6 -0
  260. package/os/checks/handlers/counters-validate.ts +5 -1
  261. package/os/checks/handlers/variant-candidates.test.ts +6 -0
  262. package/os/checks/index.ts +12 -0
  263. package/os/compass/handlers/compass-docs-scaffold.ts +1 -1
  264. package/os/compass/handlers/compass-header-scaffold.ts +6 -1
  265. package/os/compass/handlers/compass-invariants-generate.ts +3 -2
  266. package/os/context/context.module.ts +6 -1
  267. package/os/context/handlers/context-assemble.test.ts +6 -0
  268. package/os/context/handlers/context-assemble.ts +5 -1
  269. package/os/context/handlers/context-slate-eval.test.ts +6 -0
  270. package/os/context/handlers/context-slate-eval.ts +4 -0
  271. package/os/context/handlers/index-build.test.ts +33 -0
  272. package/os/context/handlers/index-build.ts +8 -5
  273. package/os/context/handlers/no-model-deps.test.ts +6 -0
  274. package/os/context/handlers/slate-fill.test.ts +6 -0
  275. package/os/context/index.ts +12 -0
  276. package/os/gate/handlers/gate-probe-catalog.test.ts +6 -0
  277. package/os/gate/handlers/gate-probe-catalog.ts +4 -0
  278. package/os/gate/handlers/gate-probe.test.ts +6 -0
  279. package/os/gate/handlers/gate-probe.ts +4 -0
  280. package/os/gate/index.ts +12 -0
  281. package/os/instructions/budget.test.ts +6 -0
  282. package/os/instructions/instructions.module.ts +2 -1
  283. package/os/knowledge/handlers/knowledge-authz-probe.test.ts +21 -0
  284. package/os/knowledge/handlers/knowledge-authz-probe.ts +7 -3
  285. package/os/knowledge/handlers/knowledge-conflicts-resolve.ts +571 -0
  286. package/os/knowledge/handlers/knowledge-rebuild.test.ts +6 -0
  287. package/os/knowledge/handlers/knowledge-rebuild.ts +4 -0
  288. package/os/knowledge/index.ts +14 -0
  289. package/os/knowledge/knowledge.module.ts +36 -1
  290. package/os/queue/decision-ledger.test.ts +32 -1
  291. package/os/queue/manifest.ts +8 -7
  292. package/os/resolver/handlers/resolver-doors-audit.test.ts +3 -0
  293. package/os/resolver/resolver.module.ts +2 -1
  294. package/os/rfc/handlers/implement-stamp-deviations.ts +4 -1
  295. package/os/rfc/handlers/implement-stamp-origin.ts +10 -2
  296. package/os/rfc/handlers/implement-stamp-outcome.ts +4 -2
  297. package/os/rfc/handlers/implement-stamp-stale.test.ts +2 -1
  298. package/os/rfc/handlers/implement-stamp.ts +188 -58
  299. package/os/rfc/handlers/lifecycle.test.ts +59 -1
  300. package/os/rfc/handlers/lifecycle.ts +25 -15
  301. package/os/rfc/handlers/list-create.test.ts +81 -0
  302. package/os/rfc/handlers/list-create.ts +34 -2
  303. package/os/rfc/handlers/validate-rules-rfc1334.test.ts +2 -1
  304. package/os/rfc/handlers/validate-rules-rfc1453.test.ts +2 -1
  305. package/os/rfc/handlers/validate-rules-rfc1454.test.ts +2 -1
  306. package/os/rfc/handlers/validate-rules-rfc1455.test.ts +2 -1
  307. package/os/rfc/reachable-symbol.ts +4 -2
  308. package/os/rfc/rfc-0000-template.md +16 -0
  309. package/os/rfc/rfc.module.ts +26 -7
  310. package/os/rfc/types.ts +32 -2
  311. package/os/rfc/verifier/rfc-1333/imp12-binding.acceptance.test.ts +12 -0
  312. package/os/rfc/verifier/rfc-1333/imp12-gate.acceptance.test.ts +12 -0
  313. package/os/rfc/verifier/rfc-1333/skills-and-types.acceptance.test.ts +12 -0
  314. package/os/rfc/verifier/rfc-1333/verify-workspace.acceptance.test.ts +12 -0
  315. package/os/rfc/verifier/rfc-1391/fixtures/no-report.proof.test.ts +4 -0
  316. package/os/rfc/verifier/rfc-1391/fixtures/small-domain.proof.test.ts +4 -0
  317. package/os/rfc/verifier/rfc-1391/support.ts +4 -0
  318. package/os/session/handlers/save.ts +5 -2
  319. package/os/session/handlers/session-audit-detectors.test.ts +6 -0
  320. package/os/session/handlers/session-audit-report.test.ts +6 -0
  321. package/os/session/handlers/session-audit-report.ts +4 -0
  322. package/os/session/handlers/session-audit.test.ts +6 -0
  323. package/os/session/handlers/session-audit.ts +4 -0
  324. package/os/trajectory/handlers/extract-units.test.ts +7 -1
  325. package/os/trajectory/handlers/journal-io.ts +20 -2
  326. package/os/trajectory/handlers/outcome-record.test.ts +6 -0
  327. package/os/trajectory/handlers/outcome-record.ts +4 -1
  328. package/os/trajectory/handlers/producer-trust.test.ts +6 -0
  329. package/os/trajectory/handlers/trajectory-index.test.ts +29 -0
  330. package/os/trajectory/handlers/trajectory-index.ts +31 -8
  331. package/os/trajectory/handlers/trajectory-recall.test.ts +27 -0
  332. package/os/trajectory/handlers/trajectory-recall.ts +7 -4
  333. package/os/trajectory/handlers/trajectory.test.ts +6 -0
  334. package/os/trajectory/handlers/verdict-binding.test.ts +40 -0
  335. package/os/trajectory/index.ts +12 -0
  336. package/os/trajectory/trajectory.module.ts +16 -9
  337. package/os/werkstatt/handlers/session-close.ts +3 -0
  338. package/os/werkstatt/handlers/session-engine.ts +3 -0
  339. package/os/werkstatt/handlers/session-open.ts +3 -0
  340. package/os/werkstatt/handlers/session-status.ts +3 -0
  341. package/os/yaml/handlers/scalars-validate.ts +343 -0
  342. package/os/yaml/index.ts +23 -0
  343. package/os/yaml/scalars.test.ts +152 -0
  344. package/os/yaml/yaml.module.ts +61 -0
  345. package/package.json +17 -1
  346. package/skills/fo/fo-knowledge-distill/SKILL.md +6 -5
  347. package/skills/fo/fo-memory-sync/SKILL.md +3 -0
  348. package/skills/fo/fo-memory-sync/fix-patterns.md +65 -0
  349. package/skills/fo/fo-memory-sync/learned-principles.md +10 -0
  350. package/skills/fo/fo-memory-sync/qa-log.md +30 -0
  351. package/skills/fo/fo-session-save/SKILL.md +2 -0
  352. package/skills/shared/grilling/SKILL.md +3 -0
  353. package/skills/shared/writing-great-skills/SKILL.md +12 -9
  354. package/src/authority/delegations.ts +5 -4
  355. package/src/cli-flags.ts +1 -5
  356. package/src/compass/invariant-parser.ts +2 -1
  357. package/src/config/forge-config.ts +40 -14
  358. package/src/formal/exhaustive.ts +3 -2
  359. package/src/formal/index.ts +4 -0
  360. package/src/formal/proof-runner.ts +4 -3
  361. package/src/formal/proof-spec.ts +3 -2
  362. package/src/index.ts +1 -0
  363. package/src/knowledge/index.ts +11 -2
  364. package/src/knowledge/parse.ts +20 -17
  365. package/src/knowledge/schema.ts +5 -4
  366. package/src/knowledge/sync.ts +281 -7
  367. package/src/onboarding/agents-generate.ts +1 -1
  368. package/src/onboarding/compass-docs/semantic-layer-block.ts +1 -1
  369. package/src/onboarding/doctor.ts +184 -26
  370. package/src/onboarding/nested-agents-generate.ts +1 -1
  371. package/src/onboarding/nested-agents-templates.ts +1 -1
  372. package/src/onboarding/upgrade.ts +18 -10
  373. package/src/reachability/command-mentions.ts +4 -2
  374. package/src/registry.ts +153 -74
  375. package/src/tests/cli-flags.test.ts +1 -1
  376. package/src/tests/discover-pack-skills.test.ts +26 -0
  377. package/src/tests/doctor-autonomy.test.ts +144 -0
  378. package/src/tests/doctor-dist-freshness.test.ts +24 -0
  379. package/src/tests/doctor-knowledge-conflicts.test.ts +135 -0
  380. package/src/tests/doctor-nested-agents.test.ts +30 -1
  381. package/src/tests/implement-stamp.test.ts +191 -8
  382. package/src/tests/knowledge-conflicts-resolve.pbt.test.ts +38 -0
  383. package/src/tests/knowledge-conflicts-resolve.test.ts +648 -0
  384. package/src/tests/knowledge-parse.test.ts +26 -1
  385. package/src/tests/session-handlers.test.ts +47 -0
  386. package/src/tests/skill-validate-knowledge.test.ts +93 -2
  387. package/src/tests/upgrade.test.ts +38 -0
  388. package/src/validators/skill-validate.ts +37 -9
@@ -56,3 +56,68 @@ status: active
56
56
  **Situation:** Memory or session content contains API keys, passwords, or PII.
57
57
 
58
58
  **Action:** Redact before importing. Replace with `<redacted>` placeholder. Never import raw secrets.
59
+
60
+ ### K-0005: Combine compaction-chain sessions into one record
61
+
62
+ ```knowledge-entry
63
+ id: K-0005
64
+ layer: L1
65
+ created: 2026-10-18
66
+ status: active
67
+ ```
68
+
69
+ **Situation:** Two or more session transcripts form a continuation chain (context compaction, resume, same opening prompt with timestamps that abut, or an explicit task handoff where one session spawns another), or a completed session has a still-live continuation.
70
+
71
+ **Action:** Offer them as one combined `docs/sessions/` record covering the whole arc, naming each session id in `source.sessions`. If the tail session is live, import the completed portion with an explicit "in progress" marker and let the next sync pick up the rest — a later sync that finds new content in an already-imported session **updates that record in place**, it does not create a second file for the same session id (confirmed 2026-10-19: 5e2a513c continuation appended to its existing record; closed out 2026-10-23). Operator chose combined records four times (2026-10-15: 4fb22aac+2c9fbefe; 2026-10-18: 871402ac+e6120a13; 2026-10-18: 5e2a513c+446544ee task-handoff; 2026-10-23: de15db2f+503603ee+8b6dafa1 via `source.sessions` on the parent's self-saved record).
72
+
73
+ ### K-0006: Check for self-saved transcripts before importing
74
+
75
+ ```knowledge-entry
76
+ id: K-0006
77
+ layer: L1
78
+ created: 2026-10-23
79
+ status: active
80
+ ```
81
+
82
+ **Situation:** A Claude Code session ran the session-end protocol (`saveSessions: true` → `session.save` / `fo-session-retro` step 0) and already wrote its own `docs/sessions/<date>-<hash>.md` record — typically with `summary: ""` and no `source:` block.
83
+
84
+ **Action:** Do NOT create a second record. Identify the self-saved record by matching its transcript content, commits, or the session's own "транскрипт сохранён: <path>" closing line against `docs/sessions/*.md`. Annotate it in place: add `source: {tool: claude-code, sessions: [<ids>]}` (include spawned children for chains per K-0005), fill `summary`, adjust `types`, and append any transcript tail the self-save missed (e.g. the closing-protocol output itself).
85
+
86
+ ### K-0007: Recover compaction-lost arcs into the self-saved record
87
+
88
+ ```knowledge-entry
89
+ id: K-0007
90
+ layer: L1
91
+ created: 2026-10-27
92
+ status: active
93
+ ```
94
+
95
+ **Situation:** A self-saved `docs/sessions/` record (K-0006) does not cover the session's whole arc because Claude Code context compactions discarded the earlier portion before `session.save` ran — the record's first transcript entry starts mid-session.
96
+
97
+ **Action:** Recover the missing arc from the session JSONL itself: each compaction writes a "continued from a previous conversation" summary message listing requests, commits, and files. Insert the recovered portion into the existing record's Transcript before its first entry, prefixed by a `>` blockquote noting it was reconstructed from compaction summaries, update `commits`/`relatedArtifacts`/`decisions`/`date`/`duration` to cover the full arc. Do not create a second record (confirmed 2026-10-27: 19b39511's pre-09:00 arc — expert-audit plans + m000210 fixes + glossary-generator fix — prepended to 0ac736).
98
+
99
+ ### K-0008: Verify claimed state in memory notes before importing
100
+
101
+ ```knowledge-entry
102
+ id: K-0008
103
+ layer: L1
104
+ created: 2026-10-27
105
+ status: active
106
+ ```
107
+
108
+ **Situation:** A memory note of `type: project` describes work-in-progress state ("drafted, implementation pending") for artifacts that live in the repo (RFCs, plans, missions).
109
+
110
+ **Action:** Check the repo before proposing import: if the described artifacts already reached their terminal state (RFC `implemented` + archived, plan executed), the note is stale — list in "Filtered out" with reason "stale — <artifacts> already <state>". Do not offer to import stale notes into `.agents/memory/daily/`; operator declined when asked (2026-10-27, formal-invariant-verification-batch vs implemented RFC-1390..1394; re-confirmed 2026-10-30, same note).
111
+
112
+ ### K-0009: Self-save created after the sync record exists
113
+
114
+ ```knowledge-entry
115
+ id: K-0009
116
+ layer: L1
117
+ created: 2026-10-30
118
+ status: active
119
+ ```
120
+
121
+ **Situation:** The mirror image of K-0006 — a session ran its own `session.save` (creating a raw self-saved `docs/sessions/` record with `summary: ""` and no `source:` block) AFTER a fo-memory-sync run already created the annotated record for the same session id.
122
+
123
+ **Action:** The sync record stays canonical (it is richer: `source` block, summary, combined chain sessions). Merge any unique content from the self-save into the sync record if the operator asks for tail coverage, then delete the self-save as a duplicate — one record per session id (confirmed 2026-10-30: self-save 2026-10-26-08-00-00-27f385.md deleted, canonical 2026-10-26-11-15-00-a67dda.md kept; operator declined the tail merge. Re-confirmed 2026-10-30: cc3673 merged into canonical 9c753b WITH the tail — merge is wanted when the tail carries real new content like fixes and new RFC drafts; also delete the self-save's `.metrics.yaml` sibling).
@@ -5,3 +5,13 @@
5
5
  # Learned Principles
6
6
 
7
7
  <!-- Format: - principle: <text> | confirmations: N | project: <path-or-remote-or-all> -->
8
+
9
+ - principle: Sessions forming a compaction/resume/task-handoff chain are imported as one combined docs/sessions record, not one file per session id | confirmations: 5 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
10
+ - principle: A session that self-saved its transcript (session.save at session end) gets the existing record annotated with source tool/session ids + summary — never a duplicate import record | confirmations: 3 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
11
+ - principle: Operator imports the full relevant set (all sessions + memory notes) rather than cherry-picking — present everything, let them deselect | confirmations: 5 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
12
+ - principle: A self-saved record created after the sync record exists for the same session is a duplicate — merge its unique tail into the canonical sync record and delete the self-save (incl. its .metrics.yaml); skip the merge only when the tail is already durable elsewhere | confirmations: 2 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
13
+ - principle: When an imported record's "in progress" tail session has finished and the record already covers the file end, update the stale marker rather than re-importing | confirmations: 3 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
14
+ - principle: A memory note of type feedback encoding a repo-hygiene/incident rule routes to AGENTS.md (K-0003); operator-workflow preferences route to .agents/operator-profile.md | confirmations: 1 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
15
+ - principle: New content in an already-imported live session extends that record in place with an in-progress marker — never a second file for the same session id | confirmations: 2 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
16
+ - principle: A self-saved record missing its pre-compaction arc gets the missing portion recovered from in-JSONL compaction summaries and inserted before its first transcript entry — never a second record | confirmations: 1 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
17
+ - principle: A memory note describing pending work whose artifacts already reached terminal state in the repo is stale — skip it entirely, including the daily-memory fallback | confirmations: 2 | project: /home/syrokomskyi/projects/warpgogol/werkstatt
@@ -4,3 +4,33 @@
4
4
  # Q&A Log
5
5
 
6
6
  <!-- Entries are appended by the skill during runs. Do not hand-edit. -->
7
+
8
+ [2026-10-15] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import session records for the two Claude Code onboarding-rethink sessions (4fb22aac, 2c9fbefe) into docs/sessions/? All artifacts already committed. A: one combined record → docs/sessions/2026-10-14-23-41-00-4fb22a.md
9
+
10
+ [2026-10-15] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Also scan the Claude session from the sibling pipelines repo (possible W1a response context)? A: skip — scope stays on this repository
11
+
12
+ [2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code? A: all sessions + memory — four docs/sessions records (0fc16e30, 8c92b044, fa620bee, 871402ac+e6120a13) and forge-document-first note → .agents/operator-profile.md
13
+
14
+ [2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: How to handle live session e6120a13 (idle, still running)? A: combine with completed 871402ac into one record marked "in progress" — second time operator chooses combined records for a compaction chain
15
+
16
+ [2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import the task-handoff chain 5e2a513c → 446544ee (debate/papers analysis → RFC-1330..1334 drafts) as one or two records? A: one combined record → docs/sessions/2026-10-18-12-20-00-5e2a51.md — third time operator chooses combined records for a session chain
17
+
18
+ [2026-10-18] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Update the stale "still live" marker in 2026-10-16-15-26-00-871402 (e6120a13 since completed, no new content)? A: yes — flipped to "completed"; coverage already reached the file end
19
+
20
+ [2026-10-19] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Where to import memory note "never-export-git-dir-for-tests" (repo-hygiene rule + 2026-10-18 incident)? A: root AGENTS.md "Agent foot-gun hardening" section — first memory note routed to AGENTS.md instead of operator-profile
21
+
22
+ [2026-10-19] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: How to cover the new arc of still-live session 5e2a513c (pipeline + major publish + GIT_DIR incident)? A: extend the existing record 2026-10-18-12-20-00-5e2a51.md in place with an "in progress" section — do not create a second file for the same session id
23
+
24
+ [2026-10-23] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (5 new sessions + 5e2a513c tail)? A: all — new record for ebf9bab8 (2026-10-19-15-11-00-ebf9ba.md); 5e2a51 extended to "completed"; de15db2f+503603ee+8b6dafa1 and 0ad25410 turned out to have SELF-SAVED transcripts (session.save at session end) — annotated existing records 2026-10-18-09-00-00-245a5c.md and 2026-10-21-09-40-00-80a372.md with source/summary instead of creating duplicates
25
+
26
+ [2026-10-27] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (4 new sessions + 1 new memory note)? A: all three session actions — annotate 06edbb (9f417d7d), extend 0ac736 (19b39511) with the compaction-lost first arc recovered from in-session summaries, new combined record 2026-10-26-11-15-00-a67dda.md (a67ddad8 + spawned 67d135e5). Memory note formal-invariant-verification-batch SKIPPED as stale (claimed "implementation pending" but RFC-1390..1394 all implemented+archived) — verify claimed state against repo before import
27
+
28
+ [2026-10-27] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Save stale memory note to .agents/memory/daily anyway? A: no — skip entirely; stale pending-state notes mislead
29
+
30
+ [2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (1 new session 9c753bf4, a67ddad8 retro tail, duplicate self-save 27f385)? A: new record for 9c753bf4 only; a67ddad8 tail update declined (retro artifacts already durable in AGENTS.md/frictions.yaml); self-save 27f385 deleted — reverse K-0006: self-save created after the sync record exists, sync record stays canonical
31
+
32
+ [2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Re-add forge-document-first note to operator-profile (lost in the 10-30 rewrite)? A: no — knowledge already covered by PREFERENCES.md §Skill invocation tracking + AGENTS.md
33
+
34
+ [2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Append the 2026-10-29 retro tail to record a67dda (stale "ретро-протокол не выполнялся" line) after initially declining? A: yes — appended tail (F-0020..23, .env rule, 33ce96cbe, K-0009 dedupe note); stale record-state lines get fixed when surfaced
35
+
36
+ [2026-10-30] project:/home/syrokomskyi/projects/warpgogol/werkstatt Q: Import which items from Claude Code (ddbbfb0c self-save, 9f80dc66, 9c753bf4 tail + cc3673 self-save)? A: all three — annotated 940b47 (source/summary/types/retro tail); 9f80dc66 turned out to have self-saved as d3940c — annotated in place instead of a new record (K-0006 again); cc3673 merged into canonical 9c753b (new arc: switcher fix 00a314a4e/8e324799f, RFC-1453..1455, retro F-0042..44) then deleted with its metrics — K-0009 second confirmation, this time WITH the tail merge (operator declined it earlier only because that tail was already durable elsewhere)
@@ -24,6 +24,7 @@ triggerPhrases: ["save this session", "enhance session transcript with annotatio
24
24
  <item>RFC-1097: sweep — SKILL.md headers + classification fixes
25
25
 
26
26
  Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
27
+ <item>RFC-1481: sync namespaces, rollout, and verification guidance</item>
27
28
  </CHANGE_SUMMARY>
28
29
  -->
29
30
 
@@ -74,6 +75,7 @@ Enhance saved session transcripts with semantic annotations, summaries, and qual
74
75
  - `qa-log.md`: Log any questions asked and operator answers.
75
76
  - `learned-principles.md`: New principles learned across sessions.
76
77
  - `fix-patterns.md`: Patterns of errors in auto-extraction and their fixes.
78
+ - In a consumer workspace, allocate new local entries as `L-K-NNNN` (max existing local ordinal + 1); Forge source entries remain `K-NNNN`.
77
79
 
78
80
  8. **Report** what was annotated/changed.
79
81
 
@@ -27,6 +27,7 @@ Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from
27
27
  recommended answers, no interview).</item>
28
28
  <item>RFC-1455: fixed inputs bound to outcome probes — V-50/V-51 + skills</item>
29
29
  <item>RFC-1460: recurring frictions escalate to mechanical measures — FRICTION-06/07/08, registry flips, session-retro escalation</item>
30
+ <item>RFC-1481: sync namespaces, rollout, and verification guidance</item>
30
31
  </CHANGE_SUMMARY>
31
32
  -->
32
33
 
@@ -43,6 +44,8 @@ Mode trigger: `emit` activates only when the invoking skill passes a queue manif
43
44
 
44
45
  Read `learned-principles.md` (L2) at the start of each session to improve recommended answers. Apply only entries with `status: active`; skip entries with `status: stale`, `superseded`, or `archived`. Principles with `confirmations >= 3` may be applied autonomously — but re-evaluate if context changes.
45
46
 
47
+ When writing consumer-local knowledge entries, use the next `L-K-NNNN` ID (max existing local ordinal + 1). Upstream Forge source entries keep `K-NNNN`; do not hand-renumber collision cases — preview and use `forge knowledge.conflicts.resolve`.
48
+
46
49
  Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
47
50
 
48
51
  Ask the questions one at a time, waiting for feedback on each question before continuing. Asking multiple questions at once is bewildering.
@@ -20,6 +20,7 @@ languagePolicy: ref(PREFERENCES.md)
20
20
 
21
21
  Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from frontmatter description). Fix non-skill-markdown exclusion to check filename not workspace-relative path (packages/AGENTS.md escaped it). Add .coverage to ignoredDirs.</item>
22
22
  <item>RFC-1247: close RFC-1247 review r2 — CHANGE_SUMMARY items on six touched skills, fo-handoff in AGENTS enumeration, glossary applied-instance pointer, recorded per-skill phrase split</item>
23
+ <item>RFC-1481: sync namespaces, rollout, and verification guidance</item>
23
24
  </CHANGE_SUMMARY>
24
25
  -->
25
26
 
@@ -135,15 +136,17 @@ Not every skill needs all three. `grilling` uses L0 and L2 only (no fix patterns
135
136
 
136
137
  In addition to the three skill-local layers, there is a fourth tier: the **shared knowledge layer** at `packages/forge/skills/shared/knowledge/learned-principles.md`. This file holds promoted cross-skill principles with `shared/K-NNNN` identifiers.
137
138
 
139
+ In a consumer workspace, Forge-authored upstream entries retain `K-NNNN`; consumer-authored entries use `L-K-NNNN`, including entries in the consumer's shared-knowledge copy. `forge.skill.validate` accepts both for consumer pack skills and rejects `L-K-NNNN` in Forge source. `forge knowledge.conflicts.resolve` is the explicit remediation path for existing collisions.
140
+
138
141
  - **Detection**: `doctor` reports cross-skill duplicate L2 entries via normalized-title matching (exact and bounded containment).
139
- - **Promotion**: `fo-knowledge-distill` executes promotions under operator grilling — the principle moves to the shared layer with summed confirmations and `promotedFrom` provenance; each skill-local copy is rewritten to a pointer entry (`promotedTo: shared/K-NNNN`, `status: superseded`).
140
- - **Consumption**: knowledge-adopting skills read the shared layer at run start and cite shared principles as `shared/K-NNNN`.
142
+ - **Promotion**: `fo-knowledge-distill` executes promotions under operator grilling — the principle moves to the shared layer with summed confirmations and `promotedFrom` provenance; each skill-local copy is rewritten to a pointer entry (`promotedTo: shared/<entry-id>`, `status: superseded`).
143
+ - **Consumption**: knowledge-adopting skills read the shared layer at run start and cite the canonical upstream or consumer-local shared ID.
141
144
  - **Validation**: `doctor` validates the shared layer file for schema validity and id uniqueness (it is not inside a skill directory, so `skill.validate` does not reach it).
142
145
  - **npm portability**: the shared layer ships as an empty template — accumulated promotions are project-specific.
143
146
 
144
147
  ### Entry format
145
148
 
146
- Each knowledge entry is a `### K-NNNN: title` heading followed by a `knowledge-entry` YAML metadata block and a markdown body:
149
+ Each knowledge entry is a `### K-NNNN: title` heading followed by a `knowledge-entry` YAML metadata block and a markdown body. Consumer-local entries use `### L-K-NNNN: title`:
147
150
 
148
151
  ````markdown
149
152
  ### K-0001: Skip non-project sessions
@@ -165,15 +168,15 @@ status: active
165
168
 
166
169
  | Field | Type | Required | Layers | Meaning |
167
170
  | --- | --- | --- | --- | --- |
168
- | `id` | `K-NNNN` | all | all | Unique 4-digit identifier within the file |
171
+ | `id` | `K-NNNN` upstream; `L-K-NNNN` consumer-local | all | all | Unique 4-digit identifier within the file |
169
172
  | `layer` | `L0` \| `L1` \| `L2` | all | all | Knowledge layer |
170
173
  | `created` | `YYYY-MM-DD` | all | all | Date the entry was first written |
171
174
  | `lastConfirmedAt` | `YYYY-MM-DD` \| `null` | L2 only | L2 | Date of last operator confirmation |
172
175
  | `confirmations` | integer ≥ 0 | L2 only | L2 | Confirmation counter for autonomous application |
173
176
  | `expiresAt` | `YYYY-MM-DD` \| `null` | optional | all | Date after which the entry is stale |
174
- | `supersedes` | `K-NNNN[]` | optional | all | Entries this one replaces (must resolve in same file) |
175
- | `promotedTo` | `shared/K-NNNN` \| `null` | optional | all | Cross-file promotion target |
176
- | `promotedFrom` | `<skill>/K-NNNN[]` | optional | shared | Provenance — which skill-local entries were promoted into this shared entry |
177
+ | `supersedes` | `K-NNNN[]` or `L-K-NNNN[]` | optional | all | Entries this one replaces (must resolve in same file) |
178
+ | `promotedTo` | `shared/K-NNNN` or `shared/L-K-NNNN` \| `null` | optional | all | Cross-file promotion target |
179
+ | `promotedFrom` | `<skill>/K-NNNN[]` or `<skill>/L-K-NNNN[]` | optional | shared | Provenance — which skill-local entries were promoted into this shared entry |
177
180
  | `status` | `active` \| `stale` \| `superseded` \| `archived` | all | all | Lifecycle state |
178
181
 
179
182
  #### Layer-specific rules
@@ -184,13 +187,13 @@ status: active
184
187
 
185
188
  #### Knowledge-adjacent files
186
189
 
187
- Files declared in `knowledge:` frontmatter that do not use `### K-NNNN:` headings and have no `<!-- knowledge-layer: ... -->` preamble are **knowledge-adjacent** — they are exempt from SKILL-19/SKILL-20. Examples: `forge-about.md`, `operator-profile-template.md`, `project-narrative-template.md`.
190
+ Files declared in `knowledge:` frontmatter that do not use `### K-NNNN:` or `### L-K-NNNN:` headings and have no `<!-- knowledge-layer: ... -->` preamble are **knowledge-adjacent** — they are exempt from SKILL-19/SKILL-20. Examples: `forge-about.md`, `operator-profile-template.md`, `project-narrative-template.md`.
188
191
 
189
192
  #### Validation
190
193
 
191
194
  `skill.validate` enforces:
192
195
  - **SKILL-19**: entry metadata schema validity (errors) and legacy section warnings (migration window).
193
- - **SKILL-20**: identifier uniqueness (`K-NNNN` format, no duplicates, `supersedes` references resolve, `promotedTo` format).
196
+ - **SKILL-20**: identifier uniqueness (K or consumer-local L-K format, no duplicates, `supersedes` references resolve, `promotedTo` format, and local IDs are forbidden in Forge-authored source).
194
197
  - **SKILL-21**: hot (L2) and warm (L1) layer character budget warnings — warnings only, never build gates. Defaults: hot=4096, warm=8192. Override in `forge.yaml` under `bindings.knowledge.budgets`.
195
198
 
196
199
  `doctor` reports legacy section counts and knowledge budget summaries as informational warnings.
@@ -12,12 +12,11 @@ policy plus audit evidence — not a cryptographic security boundary.</purpose>
12
12
  </non-goals>
13
13
  </MODULE_CONTRACT>
14
14
  <KEY_DECISIONS>
15
- <item>Registry absence is tolerance-neutral — ENOENT yields an empty registry; consumers treat "no file" and "no grant" identically (RFC-1336 unchanged-behavior rule).</item>
16
- <item>DelegationQuery carries an optional grantedBy — consumers that already know the deciding human (e.g. bordbuch.append --delegated-by) bind the query to the grantor so delegatedBy provenance cannot be fabricated against a different human's grant.</item>
17
- <item>sites: "workspace" covers every site; an explicit id list bounds site scope. Site-scoped queries with no site never match a site-listed grant.</item>
15
+ <item>Registry absence is tolerance-neutral — ENOENT yields an empty registry; "no file" and "no grant" are identical.</item>
16
+ <item>DelegationQuery's optional grantedBy binds the query to the deciding human — provenance cannot be fabricated cross-grant.</item>
17
+ <item>sites: "workspace" covers every site; explicit id lists bound scope — site-scoped queries never match site-less grants.</item>
18
18
  </KEY_DECISIONS>
19
19
  <CHANGE_SUMMARY>
20
- <item>RFC-1400/AMD-014: DELEGABLE_SCOPES gains translation.contract.approve — an operator-confirmed agent may approve a site translation contract under delegation.</item>
21
20
  <item>RFC-1336: initial module — schema, scope catalog, loader, resolver, serializer.</item>
22
21
  <item>RFC-1336: step 1: forge authority module — delegation registry schema + resolver, four authority.* commands, optional Ed25519 signing</item>
23
22
  <item>RFC-1336: delegated editorial sign-off (RFC-1336 step 3)
@@ -32,6 +31,8 @@ delegate — a journaled no-op with no delegation, so the operator path is
32
31
  unchanged. certify/promote precondition remediation now names an active
33
32
  delegation when one covers the site.</item>
34
33
  <item>RFC-1336: delegated rfc.decision/version.major/onboarding.decision + docs (RFC-1336 steps 4-5)</item>
34
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
35
+ <history>RFC-1400</history>
35
36
  </CHANGE_SUMMARY>
36
37
  */
37
38
 
package/src/cli-flags.ts CHANGED
@@ -11,13 +11,9 @@ with `TypeError: targetId.toLowerCase is not a function`.</purpose>
11
11
  </non-goals>
12
12
  </MODULE_CONTRACT>
13
13
  <CHANGE_SUMMARY>
14
- <item>Standalone port of kernel argv resolution for the forge CLI (RFC-0260 lineage): strict KERNEL-FLAG-01/02/03 + KERNEL-ARG-01 diagnostics for schema-carrying commands, legacy heuristic parse (with KERNEL-ARG-01) for schema-less commands; repeated single-value string flags diagnose instead of silently promoting to an array that crashes handlers; indexOf-based inline-value split preserves values containing "=" that split("=", 2) silently truncated.</item>
15
- <item>Session-retro 2026-10-08: string[] flags greedily consume consecutive
16
- bare tokens until the next --flag (`--files a b` → ["a","b"]), matching the
17
- kernel argv parser; bare positionals without a preceding string[] flag still
18
- emit KERNEL-ARG-01.</item>
19
14
  <item>RFC-1389 (port of RFC-1381): bare `-m` rewrites to `--message` when the merged schema declares `message` — other `-x` tokens stay KERNEL-ARG-01, now with honest hints (a known declared short alias, the command's single unsatisfied required non-boolean flag, or a truthful see-`--help` fallback) instead of the fabricated `--id <token>` template; alias-shaped tokens are never consumed as flag values.</item>
20
15
  <item>RFC-1395: port --output → --json alias into forge CLI parser</item>
16
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
21
17
  </CHANGE_SUMMARY>
22
18
  */
23
19
 
@@ -13,7 +13,7 @@ cross-package consumers (e.g. werkstatt-site TEST-WEAKEN-10) via
13
13
  </MODULE_CONTRACT>
14
14
  <KEY_DECISIONS>
15
15
  <item>A marker must open the comment payload — a mid-comment `@ai-invariant` mention is prose, not a declaration.</item>
16
- <item>The statement runs over contiguous comment lines until a code line, blank comment line, delimiter run, markup/annotation line, or a fresh marker; the `(checked-by: …)` tail wraps the same way.</item>
16
+ <item>The statement runs over contiguous comment lines until code, blank, delimiter, or a fresh marker; `(checked-by: …)` wraps likewise.</item>
17
17
  <item>Statement identity is sha256 over whitespace-normalized text — re-indentation and reflow are not weakening; word changes are.</item>
18
18
  </KEY_DECISIONS>
19
19
  <CHANGE_SUMMARY>
@@ -28,6 +28,7 @@ numeric bound), bound @ai-invariant removed-reworded-unbound via the new
28
28
  covers implementation files and proof specs. Warn-only until the census
29
29
  is operator-accepted — TEST_WEAKEN_ENFORCED keeps {01..06}; EC-22 records
30
30
  advisory rules in the Test-Weakened trailer.</item>
31
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
31
32
  </CHANGE_SUMMARY>
32
33
  */
33
34
 
@@ -6,7 +6,6 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>RFC-1332: step 1 — verifyReproduction binding key; drop platform ids from pipeline skill text (SKILL-17)</item>
10
9
  <item>RFC-1365: step 1 — contractProducers schema + conformance execution path</item>
11
10
  <item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
12
11
  <item>RFC-1391: close RFC-1391 review r1 findings — evidence freshness, config classification, contract guards
@@ -18,7 +17,8 @@ required in formal.tools.command; spec/entry paths are confined to the
18
17
  workspace; the exhaustive entry dispatches per packageManager; proved runs
19
18
  record log, counterexample stays the refuted-path record.</item>
20
19
  <item>RFC-1453: executed outcome probes, IMP-14 surface gate, outcome.serve + V-47/V-48</item>
21
- <history>RFC-0391, RFC-0393, RFC-0537, RFC-0538, RFC-0539, RFC-0540, RFC-0543, RFC-0546, RFC-0639, RFC-0640, RFC-0643, RFC-0661, RFC-0662, RFC-0704, RFC-1097, RFC-1224</history>
20
+ <item>RFC-1481: close REVIEW-CODE-2026-11-01-11 findings on resolver safety, IO boundaries, and reporting</item>
21
+ <history>RFC-0391, RFC-0393, RFC-0537, RFC-0538, RFC-0539, RFC-0540, RFC-0543, RFC-0546, RFC-0639, RFC-0640, RFC-0643, RFC-0661, RFC-0662, RFC-0704, RFC-1097, RFC-1224, RFC-1332</history>
22
22
  </CHANGE_SUMMARY>
23
23
  */
24
24
 
@@ -498,16 +498,13 @@ export function defaultForgeConfig(projectName: string, packageManager?: string)
498
498
  // Loader
499
499
  // ---------------------------------------------------------------------------
500
500
 
501
- export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: string): ForgeConfig {
502
- const configPath = path.join(workspaceRoot, "forge.yaml");
503
-
504
- if (!fs.existsSync(configPath)) {
505
- throw new Error(
506
- `forge.yaml not found at ${configPath}. Run 'forge create' to create project configuration.`,
507
- );
508
- }
509
-
510
- const raw = fs.readFileSync(configPath, "utf8");
501
+ /**
502
+ * Parse and schema-validate a forge.yaml document — the pure part of
503
+ * `loadForgeConfig` shared with WorkspaceIO-backed readers that must not touch
504
+ * the ambient filesystem. Recovers the declared profile id (RFC-1118) but does
505
+ * not resolve the profile catalog; callers set `profileResolution` themselves.
506
+ */
507
+ export function parseForgeConfigDocument(raw: string, configPath: string): ForgeConfig {
511
508
  let parsed: unknown;
512
509
  try {
513
510
  parsed = parseYaml(raw);
@@ -536,6 +533,24 @@ export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: strin
536
533
  ? String((rawProfile as { id: unknown }).id)
537
534
  : undefined;
538
535
 
536
+ const config = { ...rawData } as unknown as ForgeConfig;
537
+ config.profileDeclaredId = profileId;
538
+ return config;
539
+ }
540
+
541
+ export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: string): ForgeConfig {
542
+ const configPath = path.join(workspaceRoot, "forge.yaml");
543
+
544
+ if (!fs.existsSync(configPath)) {
545
+ throw new Error(
546
+ `forge.yaml not found at ${configPath}. Run 'forge create' to create project configuration.`,
547
+ );
548
+ }
549
+
550
+ const raw = fs.readFileSync(configPath, "utf8");
551
+ const config = parseForgeConfigDocument(raw, configPath);
552
+ const profileId = config.profileDeclaredId;
553
+
539
554
  // RFC-0643: load stack profile when `profile` field is present in forge.yaml
540
555
  let loadedProfile: StackProfile | undefined;
541
556
  let catalogAvailable = false;
@@ -555,9 +570,7 @@ export function loadForgeConfig(workspaceRoot: string, forgeRootOverride?: strin
555
570
  }
556
571
  }
557
572
 
558
- const config = { ...rawData } as unknown as ForgeConfig;
559
573
  // RFC-1118: preserve the declared id and its resolution status — never silently drop it
560
- config.profileDeclaredId = profileId;
561
574
  config.profileResolution = !profileId
562
575
  ? "absent"
563
576
  : loadedProfile
@@ -654,6 +667,19 @@ export function resolveForgeRoot(workspaceRoot: string): string {
654
667
  );
655
668
  }
656
669
 
670
+ /**
671
+ * True when `forgeRoot` is a development checkout (monorepo `packages/forge`,
672
+ * or the forge repo itself) rather than an npm-installed package. The
673
+ * published tarball ships `src/` and `os/` via the `files` field, so source
674
+ * dirs alone cannot distinguish the two — the `node_modules` path segment
675
+ * can, because npm layouts always resolve through it. Source-scanning
676
+ * checks (autonomy-guard, dist-freshness) gate on this: an installed
677
+ * package's source is immutable, so violations are not actionable there.
678
+ */
679
+ export function isForgeSourceCheckout(forgeRoot: string): boolean {
680
+ return !forgeRoot.split(/[\\/]/).includes("node_modules");
681
+ }
682
+
657
683
  /**
658
684
  * Resolve the forge package root from inside the package's own modules.
659
685
  * Handles both source layout (`src/<dir>/` → package root is two levels up)
@@ -14,8 +14,8 @@ caller derives the verdict from the report — never from an exit code alone.
14
14
  </non-goals>
15
15
  </MODULE_CONTRACT>
16
16
  <KEY_DECISIONS>
17
- <item>Two-pass enumeration: a domain that cannot be iterated twice with equal counts is non-deterministic (one-shot generator, seeded source) and is refused — exhaustive proof requires reproducible coverage.</item>
18
- <item>Report mode suppresses the throw so a refuted run still writes its counterexample report instead of dying as an unparseable test crash.</item>
17
+ <item>Two-pass enumeration: a domain not iterable twice with equal counts is non-deterministic and refused.</item>
18
+ <item>Report mode suppresses the throw — a refuted run still writes its counterexample report.</item>
19
19
  </KEY_DECISIONS>
20
20
  <CHANGE_SUMMARY>
21
21
  <item>RFC-1391: exhaustive runner + exhaustiveVerdict count/failure gate.</item>
@@ -28,6 +28,7 @@ config is error not unavailable, and both surfaces share one path; {entry} is
28
28
  required in formal.tools.command; spec/entry paths are confined to the
29
29
  workspace; the exhaustive entry dispatches per packageManager; proved runs
30
30
  record log, counterexample stays the refuted-path record.</item>
31
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
31
32
  </CHANGE_SUMMARY>
32
33
  */
33
34
 
@@ -1,10 +1,14 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
3
  <purpose>RFC-1391: public surface of @warpgogol/forge/formal — proof-spec schema, verdict types, and the built-in exhaustive runner.</purpose>
4
+ <non-goals>
5
+ <item>TODO(compass): record the boundary this file must not take on.</item>
6
+ </non-goals>
4
7
  </MODULE_CONTRACT>
5
8
  <CHANGE_SUMMARY>
6
9
  <item>RFC-1391: initial formal-tier export.</item>
7
10
  <item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
11
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
8
12
  </CHANGE_SUMMARY>
9
13
  */
10
14
 
@@ -14,12 +14,11 @@ surfaces share one verdict path.
14
14
  </non-goals>
15
15
  </MODULE_CONTRACT>
16
16
  <KEY_DECISIONS>
17
- <item>specSha256/entrySha256 are computed whenever the files are readable — evidence binds to bytes for every verdict, including error/unavailable.</item>
18
- <item>`exhaustive` runs the entry through vitest with FORGE_PROOF_REPORT — the report file, not the exit code, carries the verdict so an incidental co-located test failure cannot masquerade as a refutation.</item>
17
+ <item>specSha256/entrySha256 are computed whenever readable — evidence binds to bytes for every verdict.</item>
18
+ <item>`exhaustive` runs via vitest with FORGE_PROOF_REPORT — the report file, not the exit code, carries the verdict.</item>
19
19
  <item>External tools map exit 0 → proved, non-zero → refuted (captured output persisted), ENOENT → unavailable, version-regex miss/mismatch → error.</item>
20
20
  </KEY_DECISIONS>
21
21
  <CHANGE_SUMMARY>
22
- <item>RFC-1391: shared runProofCheck execution path (tool resolution, version pin, report parsing, log persistence).</item>
23
22
  <item>RFC-1391: make the formal verification tier checker-bound (RFC-1391)</item>
24
23
  <item>RFC-1391: close RFC-1391 review r1 findings — evidence freshness, config classification, contract guards
25
24
 
@@ -43,6 +42,8 @@ REVIEW-CODE-2026-10-24-06 (approved): log is now asserted on the exhaustive
43
42
  refuted and no-report tests; external-tool timedOut persists partial output
44
43
  as log (symmetric with exhaustive); log doc comments updated to reflect
45
44
  all-post-spawn-verdicts attachment.</item>
45
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
46
+ <history>RFC-1391</history>
46
47
  </CHANGE_SUMMARY>
47
48
  */
48
49
 
@@ -14,8 +14,8 @@ boundary; evidence binds to the spec and entry bytes via sha256.
14
14
  <KEY_DECISIONS>
15
15
  <item>`.strict()` — unknown keys are rejected: a proof spec is evidence, so silent stripping would hide author typos.</item>
16
16
  <item>`domain.cardinality` stays schema-optional (external checkers need no declared domain); the `exhaustive` runner errors on its absence.</item>
17
- <item>`assumptions`, `trustedBase`, and `unverifiedBoundaries` are each `.min(1)` — a spec claiming to prove the whole system is refused by shape, not review.</item>
18
- <item>`tool` is the closed ProofTool enum — the set grows only by RFC, so a spec can never name a runner nobody implemented.</item>
17
+ <item>`assumptions`, `trustedBase`, `unverifiedBoundaries` are `.min(1)` — prove-everything specs are refused by shape.</item>
18
+ <item>`tool` is the closed ProofTool enum — the set grows only by RFC.</item>
19
19
  </KEY_DECISIONS>
20
20
  <CHANGE_SUMMARY>
21
21
  <item>RFC-1391: forge/proof-spec@1 schema, ProofSpec/ProofTool/ProofVerdict/ProofCheckResult types.</item>
@@ -34,6 +34,7 @@ REVIEW-CODE-2026-10-24-06 (approved): log is now asserted on the exhaustive
34
34
  refuted and no-report tests; external-tool timedOut persists partial output
35
35
  as log (symmetric with exhaustive); log doc comments updated to reflect
36
36
  all-post-spawn-verdicts attachment.</item>
37
+ <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
37
38
  </CHANGE_SUMMARY>
38
39
  */
39
40
 
package/src/index.ts CHANGED
@@ -81,6 +81,7 @@ export {
81
81
  defaultForgeConfig,
82
82
  loadForgeConfig,
83
83
  resolveForgeRoot,
84
+ isForgeSourceCheckout,
84
85
  resolveBinding,
85
86
  resolveTerminology,
86
87
  FORGE_CLI_BINDING_DEFAULTS,
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  <MODULE_CONTRACT>
3
- <purpose>Barrel export for the knowledge module — parser, serializer, schema, and types (RFC-0660).</purpose>
3
+ <purpose>Barrel export for the knowledge module — parser, serializer, schema, lifecycle operations, and explicit conflict resolution.</purpose>
4
4
  <non-goals>
5
5
  <item>Do not re-export from @warpgogol/* — forge src/ is portable.</item>
6
6
  </non-goals>
@@ -8,10 +8,11 @@
8
8
  <CHANGE_SUMMARY>
9
9
  <item>RFC-0660: initial knowledge module barrel export.</item>
10
10
  <item>RFC-0663: added promote.ts exports for cross-skill duplicate detection and promotion planning.</item>
11
+ <item>RFC-1481: export content parsing, conflict planning, local-ID allocation, and explicit-IO resolution.</item>
11
12
  </CHANGE_SUMMARY>
12
13
  */
13
14
 
14
- export { parseKnowledgeFile } from "./parse.ts";
15
+ export { parseKnowledgeContent, parseKnowledgeFile } from "./parse.ts";
15
16
  export { serializeKnowledgeFile } from "./serialize.ts";
16
17
  export {
17
18
  knowledgeEntryMetaSchema,
@@ -53,7 +54,15 @@ export {
53
54
  } from "./promote.ts";
54
55
  export {
55
56
  planKnowledgeSync,
57
+ planKnowledgeConflictResolution,
58
+ resolveKnowledgeConflicts,
59
+ allocateLocalKnowledgeId,
56
60
  syncKnowledgeFile,
61
+ type KnowledgeConflictResolution,
62
+ type KnowledgeConflictResolutionPlan,
63
+ type KnowledgeConflictIssue,
64
+ type KnowledgeConflictUnresolvedReason,
65
+ type KnowledgeReferenceRemap,
57
66
  type KnowledgeSyncAction,
58
67
  type KnowledgeSyncResult,
59
68
  type KnowledgeSyncPlan,
@@ -8,6 +8,7 @@
8
8
  </MODULE_CONTRACT>
9
9
  <CHANGE_SUMMARY>
10
10
  <item>RFC-0660: initial tolerant parser for structured knowledge entries.</item>
11
+ <item>RFC-1481: parse both upstream K-NNNN and consumer-local L-K-NNNN headings from explicit content.</item>
11
12
  </CHANGE_SUMMARY>
12
13
  */
13
14
 
@@ -24,7 +25,7 @@ import {
24
25
  type ParsedKnowledgeFile,
25
26
  } from "./schema.ts";
26
27
 
27
- const ENTRY_HEADING_PATTERN = /^###\s+(K-\d{4})\s*:\s*(.+)$/;
28
+ const ENTRY_HEADING_PATTERN = /^###\s+((?:L-)?K-\d{4})\s*:\s*(.+)$/;
28
29
  const KNOWLEDGE_ENTRY_FENCE = "knowledge-entry";
29
30
  const LAYER_COMMENT_PATTERN = /<!--\s*knowledge-layer:\s*(L[012])\s*-->/;
30
31
 
@@ -42,22 +43,7 @@ function detectLayer(content: string, fileName: string): KnowledgeLayer | null {
42
43
  return FILENAME_LAYER_MAP[fileName] ?? null;
43
44
  }
44
45
 
45
- export function parseKnowledgeFile(filePath: string): ParsedKnowledgeFile {
46
- let content: string;
47
- try {
48
- content = fs.readFileSync(filePath, "utf-8");
49
- } catch {
50
- // File read errors (EISDIR, ENOENT, etc.) — return empty result
51
- return {
52
- path: filePath,
53
- layer: null,
54
- preamble: "",
55
- entries: [],
56
- legacySections: [],
57
- parseIssues: [],
58
- isKnowledgeAdjacent: true,
59
- };
60
- }
46
+ export function parseKnowledgeContent(content: string, filePath: string): ParsedKnowledgeFile {
61
47
  const fileName = path.basename(filePath);
62
48
  const lines = content.split(/\r?\n/);
63
49
  const layer = detectLayer(content, fileName);
@@ -225,3 +211,20 @@ export function parseKnowledgeFile(filePath: string): ParsedKnowledgeFile {
225
211
  isKnowledgeAdjacent: false,
226
212
  };
227
213
  }
214
+
215
+ export function parseKnowledgeFile(filePath: string): ParsedKnowledgeFile {
216
+ try {
217
+ return parseKnowledgeContent(fs.readFileSync(filePath, "utf-8"), filePath);
218
+ } catch {
219
+ // File read errors (EISDIR, ENOENT, etc.) — return empty result
220
+ return {
221
+ path: filePath,
222
+ layer: null,
223
+ preamble: "",
224
+ entries: [],
225
+ legacySections: [],
226
+ parseIssues: [],
227
+ isKnowledgeAdjacent: true,
228
+ };
229
+ }
230
+ }
@@ -10,6 +10,7 @@
10
10
  <item>RFC-0660: initial knowledge entry metadata schema with L0/L1/L2 layer-specific refinements.</item>
11
11
  <item>RFC-0663: added promotedFrom field for shared-layer provenance tracking.</item>
12
12
  <item>RFC-1468: bind authz-relevant knowledge to authoritative sources — knowledge.rebuild + knowledge.authz.probe, KAUTHZ-01..03</item>
13
+ <item>RFC-1481: accept upstream K-NNNN and consumer-local L-K-NNNN entry IDs and references.</item>
13
14
  </CHANGE_SUMMARY>
14
15
  */
15
16
 
@@ -18,12 +19,12 @@ import { z } from "zod";
18
19
  export type KnowledgeLayer = "L0" | "L1" | "L2";
19
20
  export type KnowledgeEntryStatus = "active" | "stale" | "superseded" | "archived";
20
21
 
21
- const ENTRY_ID_PATTERN = /^K-\d{4}$/;
22
- const PROMOTED_TO_PATTERN = /^shared\/K-\d{4}$/;
23
- const PROMOTED_FROM_PATTERN = /^[a-z0-9-]+\/K-\d{4}$/;
22
+ const ENTRY_ID_PATTERN = /^(?:L-)?K-\d{4}$/;
23
+ const PROMOTED_TO_PATTERN = /^shared\/(?:L-)?K-\d{4}$/;
24
+ const PROMOTED_FROM_PATTERN = /^[a-z0-9-]+\/(?:L-)?K-\d{4}$/;
24
25
 
25
26
  const baseMetaSchema = z.object({
26
- id: z.string().regex(ENTRY_ID_PATTERN, "id must match ^K-\\d{4}$"),
27
+ id: z.string().regex(ENTRY_ID_PATTERN, "id must match ^(?:L-)?K-\\d{4}$"),
27
28
  layer: z.enum(["L0", "L1", "L2"]),
28
29
  created: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "created must be YYYY-MM-DD"),
29
30
  lastConfirmedAt: z.union([z.string().regex(/^\d{4}-\d{2}-\d{2}$/), z.null()]).optional(),