@warpgogol/forge 9.4.0 → 9.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +4 -2
  3. package/README.uk.md +10 -8
  4. package/bin/cli.ts +152 -11
  5. package/dist/bin/cli.js +125 -5
  6. package/dist/bin/cli.js.map +1 -1
  7. package/dist/os/flow/dirty-classify.d.ts +11 -1
  8. package/dist/os/flow/dirty-classify.d.ts.map +1 -1
  9. package/dist/os/flow/dirty-classify.js +13 -0
  10. package/dist/os/flow/dirty-classify.js.map +1 -1
  11. package/dist/os/flow/flow.module.d.ts.map +1 -1
  12. package/dist/os/flow/flow.module.js +29 -3
  13. package/dist/os/flow/flow.module.js.map +1 -1
  14. package/dist/os/flow/handlers/flow-check.d.ts.map +1 -1
  15. package/dist/os/flow/handlers/flow-check.js +9 -9
  16. package/dist/os/flow/handlers/flow-check.js.map +1 -1
  17. package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
  18. package/dist/os/flow/handlers/flow-cut.js +22 -8
  19. package/dist/os/flow/handlers/flow-cut.js.map +1 -1
  20. package/dist/os/flow/handlers/flow-integrate.d.ts +6 -0
  21. package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
  22. package/dist/os/flow/handlers/flow-integrate.js +155 -44
  23. package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
  24. package/dist/os/flow/handlers/flow-open.d.ts.map +1 -1
  25. package/dist/os/flow/handlers/flow-open.js +14 -19
  26. package/dist/os/flow/handlers/flow-open.js.map +1 -1
  27. package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
  28. package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
  29. package/dist/os/flow/handlers/flow-peers.js +99 -0
  30. package/dist/os/flow/handlers/flow-peers.js.map +1 -0
  31. package/dist/os/flow/index.d.ts +3 -0
  32. package/dist/os/flow/index.d.ts.map +1 -1
  33. package/dist/os/flow/index.js +9 -4
  34. package/dist/os/flow/index.js.map +1 -1
  35. package/dist/os/flow/ops-registry.d.ts +33 -0
  36. package/dist/os/flow/ops-registry.d.ts.map +1 -0
  37. package/dist/os/flow/ops-registry.js +177 -0
  38. package/dist/os/flow/ops-registry.js.map +1 -0
  39. package/dist/os/flow/preflight.d.ts +70 -3
  40. package/dist/os/flow/preflight.d.ts.map +1 -1
  41. package/dist/os/flow/preflight.js +545 -49
  42. package/dist/os/flow/preflight.js.map +1 -1
  43. package/dist/os/flow/registry.d.ts +2 -2
  44. package/dist/os/flow/standalone-invoke.d.ts +11 -0
  45. package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
  46. package/dist/os/flow/standalone-invoke.js +75 -0
  47. package/dist/os/flow/standalone-invoke.js.map +1 -0
  48. package/dist/os/gate-run/detach.d.ts +27 -0
  49. package/dist/os/gate-run/detach.d.ts.map +1 -0
  50. package/dist/os/gate-run/detach.js +85 -0
  51. package/dist/os/gate-run/detach.js.map +1 -0
  52. package/dist/os/gate-run/gate-run.module.d.ts +3 -0
  53. package/dist/os/gate-run/gate-run.module.d.ts.map +1 -0
  54. package/dist/os/gate-run/gate-run.module.js +23 -0
  55. package/dist/os/gate-run/gate-run.module.js.map +1 -0
  56. package/dist/os/gate-run/index.d.ts +7 -0
  57. package/dist/os/gate-run/index.d.ts.map +1 -0
  58. package/dist/os/gate-run/index.js +5 -0
  59. package/dist/os/gate-run/index.js.map +1 -0
  60. package/dist/os/gate-run/record.d.ts +47 -0
  61. package/dist/os/gate-run/record.d.ts.map +1 -0
  62. package/dist/os/gate-run/record.js +157 -0
  63. package/dist/os/gate-run/record.js.map +1 -0
  64. package/dist/os/gate-run/status.d.ts +41 -0
  65. package/dist/os/gate-run/status.d.ts.map +1 -0
  66. package/dist/os/gate-run/status.js +142 -0
  67. package/dist/os/gate-run/status.js.map +1 -0
  68. package/dist/os/gate-run/types.d.ts +47 -0
  69. package/dist/os/gate-run/types.d.ts.map +1 -0
  70. package/dist/os/gate-run/types.js +24 -0
  71. package/dist/os/gate-run/types.js.map +1 -0
  72. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  73. package/dist/os/mission/handlers/archive.js +12 -8
  74. package/dist/os/mission/handlers/archive.js.map +1 -1
  75. package/dist/os/mission/importer-block.d.ts +19 -0
  76. package/dist/os/mission/importer-block.d.ts.map +1 -0
  77. package/dist/os/mission/importer-block.js +124 -0
  78. package/dist/os/mission/importer-block.js.map +1 -0
  79. package/dist/os/mission/lockfile.d.ts +17 -0
  80. package/dist/os/mission/lockfile.d.ts.map +1 -1
  81. package/dist/os/mission/lockfile.js +38 -0
  82. package/dist/os/mission/lockfile.js.map +1 -1
  83. package/dist/os/rfc/evidence-annotation.d.ts +26 -0
  84. package/dist/os/rfc/evidence-annotation.d.ts.map +1 -0
  85. package/dist/os/rfc/evidence-annotation.js +52 -0
  86. package/dist/os/rfc/evidence-annotation.js.map +1 -0
  87. package/dist/os/rfc/handlers/fixed-inputs.d.ts.map +1 -1
  88. package/dist/os/rfc/handlers/fixed-inputs.js +7 -1
  89. package/dist/os/rfc/handlers/fixed-inputs.js.map +1 -1
  90. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  91. package/dist/os/rfc/handlers/implement-stamp.js +21 -28
  92. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  93. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  94. package/dist/os/rfc/handlers/list-create.js +25 -3
  95. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  96. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  97. package/dist/os/rfc/handlers/validate-rules.js +127 -7
  98. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  99. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  100. package/dist/os/rfc/rfc.module.js +3 -2
  101. package/dist/os/rfc/rfc.module.js.map +1 -1
  102. package/dist/os/rfc/types.d.ts +9 -2
  103. package/dist/os/rfc/types.d.ts.map +1 -1
  104. package/dist/os/rfc/types.js +2 -2
  105. package/dist/os/rfc/types.js.map +1 -1
  106. package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
  107. package/dist/os/system/handlers/system-task-collect.js +11 -5
  108. package/dist/os/system/handlers/system-task-collect.js.map +1 -1
  109. package/dist/src/cli-flags.d.ts.map +1 -1
  110. package/dist/src/cli-flags.js +6 -0
  111. package/dist/src/cli-flags.js.map +1 -1
  112. package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
  113. package/dist/src/onboarding/prettierignore.js +2 -0
  114. package/dist/src/onboarding/prettierignore.js.map +1 -1
  115. package/dist/src/types.d.ts +7 -0
  116. package/dist/src/types.d.ts.map +1 -1
  117. package/dist/src/types.js +2 -8
  118. package/dist/src/types.js.map +1 -1
  119. package/os/flow/dirty-classify.ts +21 -0
  120. package/os/flow/flow.module.ts +31 -3
  121. package/os/flow/handlers/flow-check.ts +17 -18
  122. package/os/flow/handlers/flow-cut.ts +28 -11
  123. package/os/flow/handlers/flow-integrate.ts +229 -62
  124. package/os/flow/handlers/flow-open.ts +24 -31
  125. package/os/flow/handlers/flow-peers.ts +142 -0
  126. package/os/flow/index.ts +10 -8
  127. package/os/flow/ops-registry.ts +194 -0
  128. package/os/flow/preflight.ts +608 -55
  129. package/os/flow/standalone-invoke.ts +85 -0
  130. package/os/flow/tests/dirty-classify.test.ts +139 -4
  131. package/os/flow/tests/flow-cut.test.ts +21 -0
  132. package/os/flow/tests/flow-integrate.preflight.test.ts +34 -9
  133. package/os/flow/tests/flow-integrate.test.ts +433 -17
  134. package/os/flow/tests/lockfile-induced.test.ts +328 -0
  135. package/os/flow/tests/ops-registry.test.ts +136 -0
  136. package/os/gate-run/detach.ts +106 -0
  137. package/os/gate-run/gate-run.module.ts +25 -0
  138. package/os/gate-run/index.ts +16 -0
  139. package/os/gate-run/record.ts +194 -0
  140. package/os/gate-run/status.ts +168 -0
  141. package/os/gate-run/tests/gate-run-detach.test.ts +144 -0
  142. package/os/gate-run/tests/gate-run-record.test.ts +200 -0
  143. package/os/gate-run/types.ts +73 -0
  144. package/os/mission/handlers/archive.ts +22 -14
  145. package/os/mission/importer-block.ts +119 -0
  146. package/os/mission/lockfile.ts +41 -0
  147. package/os/rfc/evidence-annotation.ts +61 -0
  148. package/os/rfc/handlers/fixed-inputs.test.ts +70 -0
  149. package/os/rfc/handlers/fixed-inputs.ts +11 -1
  150. package/os/rfc/handlers/implement-stamp.ts +25 -28
  151. package/os/rfc/handlers/list-create.test.ts +58 -5
  152. package/os/rfc/handlers/list-create.ts +30 -3
  153. package/os/rfc/handlers/validate-evidence-shape.test.ts +218 -0
  154. package/os/rfc/handlers/validate-probe-meta.test.ts +71 -0
  155. package/os/rfc/handlers/validate-rules.ts +169 -17
  156. package/os/rfc/handlers/validate-transient-probes.test.ts +222 -0
  157. package/os/rfc/rfc-0000-template.md +10 -10
  158. package/os/rfc/rfc.module.ts +3 -2
  159. package/os/rfc/types.ts +5 -2
  160. package/os/system/handlers/system-task-collect.ts +11 -5
  161. package/os/system/tests/system-task-collect.test.ts +16 -0
  162. package/package.json +17 -1
  163. package/skills/fo/fo-session-retro/SKILL.md +12 -4
  164. package/src/cli-flags.ts +7 -0
  165. package/src/onboarding/prettierignore.ts +2 -0
  166. package/src/tests/prettierignore-manage.test.ts +11 -0
  167. package/src/types.ts +9 -8
@@ -12,12 +12,12 @@ verification evidence, and atomically mutates RFC frontmatter.
12
12
  </non-goals>
13
13
  </MODULE_CONTRACT>
14
14
  <CHANGE_SUMMARY>
15
- <item>RFC-1454: review deviations recorded in the RFC — IMP-15 gate, V-49 provenance, skill contract</item>
16
15
  <item>RFC-1483: self-sufficient implement stamp — default repair pass, ordered remediation checklist, --no-repair</item>
17
16
  <item>RFC-1504: step 4 — shared stamp lock for rfc and adr stamp handlers</item>
18
17
  <item>RFC-1504: review fixes — legacy acquiredAt fallback, atomic break claim, verified stamp release, onStale warnings</item>
19
18
  <item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
20
- <history>RFC-0268, RFC-0476, RFC-0756, RFC-0795, RFC-0997, RFC-1053, RFC-1097, RFC-1249, RFC-1271, RFC-1306, RFC-1310, RFC-1321, RFC-1322, RFC-1330, RFC-1333, RFC-1383, RFC-1391, RFC-1453, RFC-IMP-07</history>
19
+ <item>RFC-1569: lint rfc evidence annotations and transient probe targets</item>
20
+ <history>RFC-0268, RFC-0476, RFC-0756, RFC-0795, RFC-0997, RFC-1053, RFC-1097, RFC-1249, RFC-1271, RFC-1306, RFC-1310, RFC-1321, RFC-1322, RFC-1330, RFC-1333, RFC-1383, RFC-1391, RFC-1453, RFC-1454, RFC-IMP-07</history>
21
21
  </CHANGE_SUMMARY>
22
22
  */
23
23
 
@@ -40,6 +40,7 @@ import {
40
40
  loadRfcStatusMap,
41
41
  } from "../frontmatter-io.ts";
42
42
  import { evaluateAcceptanceCriteria, stripFencedCodeBlocks } from "./validate-rules.ts";
43
+ import { parseEvidenceAnnotation } from "../evidence-annotation.ts";
43
44
  import { evaluateDeviationGate } from "./implement-stamp-deviations.ts";
44
45
  import { toIsoDate } from "./shared.ts";
45
46
  import { byteHashHex, normalizeProbes, runRfcVerificationEmit } from "../verification-evidence.ts";
@@ -388,23 +389,21 @@ export async function resolveCriterionEvidence(
388
389
  return false;
389
390
  }
390
391
  };
391
- if (annotation.startsWith("probe:")) {
392
- const refId = annotation.slice("probe:".length).trim();
393
- return (envelope?.probes ?? []).some((r) => r.probe?.criterion === refId && r.ok === true);
394
- }
395
- if (annotation.startsWith("test:") || annotation.startsWith("file:")) {
396
- // A trailing :line / :line-range rides the annotation, not the path.
397
- const filePath = annotation
398
- .slice(annotation.indexOf(":") + 1)
399
- .trim()
400
- .replace(/:\d+(?:-\d+)?$/, "");
401
- return statFile(filePath);
402
- }
403
- if (/^[^:]+:\d+(?:-\d+)?$/.test(annotation)) {
404
- const filePath = annotation.slice(0, annotation.lastIndexOf(":")).trim();
405
- return statFile(filePath);
392
+ // RFC-1569: the annotation grammar lives in os/rfc/evidence-annotation.ts —
393
+ // this resolver consumes it, no second regex here.
394
+ const parsed = parseEvidenceAnnotation(annotation);
395
+ switch (parsed.kind) {
396
+ case "probe":
397
+ return (envelope?.probes ?? []).some(
398
+ (r) => r.probe?.criterion === parsed.criterion && r.ok === true,
399
+ );
400
+ case "test":
401
+ case "file":
402
+ case "path-line":
403
+ return statFile(parsed.path);
404
+ case "invalid":
405
+ return false;
406
406
  }
407
- return false;
408
407
  }
409
408
 
410
409
  /**
@@ -556,7 +555,11 @@ async function evaluateStampEvidenceGates(opts: {
556
555
  // ── RFC-IMP-10 / RFC-IMP-11: git-derived origin gates (RFC-1330) ─────────
557
556
  // Derived fresh at stamp time (head = HEAD) — the committed envelope's
558
557
  // origin records are volatile context and may predate later commits.
559
- if (runIndependent && hasProbes && String(opts.frontmatter["createdAt"] ?? "") >= RFC_ORIGIN_CUTOFF) {
558
+ if (
559
+ runIndependent &&
560
+ hasProbes &&
561
+ String(opts.frontmatter["createdAt"] ?? "") >= RFC_ORIGIN_CUTOFF
562
+ ) {
560
563
  const probes = acceptance as AcceptanceProbe[];
561
564
  const origins = await deriveProbeOrigins({
562
565
  git: createOriginGit(opts.workspaceRoot),
@@ -899,9 +902,7 @@ export async function runRfcImplementStamp(
899
902
  // sync chain — probes re-execute even inside the freshness window.
900
903
  syncReport = await context.invoke("rfc.evidence.sync", {
901
904
  id: targetId,
902
- ...(input.flags["no-evidence-reuse"] === true
903
- ? { "no-evidence-reuse": "true" }
904
- : {}),
905
+ ...(input.flags["no-evidence-reuse"] === true ? { "no-evidence-reuse": "true" } : {}),
905
906
  });
906
907
  } catch (err) {
907
908
  violations.push({
@@ -1238,9 +1239,7 @@ export async function runRfcImplementStamp(
1238
1239
  flags: {
1239
1240
  id: targetId,
1240
1241
  ...(waiveOutcome ? { "waive-outcome": waiveOutcome } : {}),
1241
- ...(input.flags["no-evidence-reuse"] === true
1242
- ? { "no-evidence-reuse": true }
1243
- : {}),
1242
+ ...(input.flags["no-evidence-reuse"] === true ? { "no-evidence-reuse": true } : {}),
1244
1243
  },
1245
1244
  },
1246
1245
  context,
@@ -1459,9 +1458,7 @@ export async function runRfcImplementStamp(
1459
1458
  flags: {
1460
1459
  id: targetId,
1461
1460
  ...(waiveOutcome ? { "waive-outcome": waiveOutcome } : {}),
1462
- ...(input.flags["no-evidence-reuse"] === true
1463
- ? { "no-evidence-reuse": true }
1464
- : {}),
1461
+ ...(input.flags["no-evidence-reuse"] === true ? { "no-evidence-reuse": true } : {}),
1465
1462
  },
1466
1463
  },
1467
1464
  context,
@@ -12,10 +12,12 @@ with candidates listed.
12
12
  </non-goals>
13
13
  </MODULE_CONTRACT>
14
14
  <CHANGE_SUMMARY>
15
- <item>RFC-1485: sweep compass headers — forge-os-rfc</item>
16
15
  <item>RFC-1482: extract-safe RFC-1482 template path + changelog for 9.1.0</item>
17
16
  <item>RFC-1514: attach corrected invocations to blocking diagnostics so retry is one-shot</item>
18
17
  <item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
18
+ <item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
19
+ <item>RFC-1569: lint rfc evidence annotations and transient probe targets</item>
20
+ <history>RFC-1485</history>
19
21
  </CHANGE_SUMMARY>
20
22
  */
21
23
 
@@ -186,7 +188,7 @@ describe("RFC-1482 validation-compliant skeleton", () => {
186
188
  await rm(root, { recursive: true, force: true });
187
189
  });
188
190
 
189
- test("AC-1: emitted draft passes rfc.validate with zero V-45/V-48/V-50 violations", async () => {
191
+ test("AC-1: emitted draft passes rfc.validate with zero V-45/V-48/V-50/V-53/V-54 violations", async () => {
190
192
  const result = await runRfcCreate(
191
193
  { flags: flags({ title: "Rotate the cache eviction cadence" }) } as never,
192
194
  context(),
@@ -195,14 +197,22 @@ describe("RFC-1482 validation-compliant skeleton", () => {
195
197
  const id = result.data!.id!;
196
198
  const v = await runRfcValidate({ argv: [], flags: { id } } as never, context());
197
199
  const violations = v.data?.violations ?? [];
198
- const named = violations.filter((x) => ["V-45", "V-48", "V-50"].includes(x.rule));
200
+ const named = violations.filter((x) =>
201
+ ["V-45", "V-48", "V-50", "V-53", "V-54"].includes(x.rule),
202
+ );
199
203
  expect(named, JSON.stringify(violations, null, 1)).toEqual([]);
200
204
  expect(v.data?.status, JSON.stringify(violations, null, 1)).toBe("pass");
201
205
  });
202
206
 
203
207
  test("AC-2: --proposed/--added seed commands.* and emit one reachable stub each", async () => {
204
208
  const result = await runRfcCreate(
205
- { flags: flags({ title: "Tame the registry loader", proposed: "foo.bar,baz.qux", added: "foo.new" }) } as never,
209
+ {
210
+ flags: flags({
211
+ title: "Tame the registry loader",
212
+ proposed: "foo.bar,baz.qux",
213
+ added: "foo.new",
214
+ }),
215
+ } as never,
206
216
  context(),
207
217
  );
208
218
  expect(result.data?.status).toBe("ok");
@@ -223,7 +233,7 @@ describe("RFC-1482 validation-compliant skeleton", () => {
223
233
  );
224
234
  const body = await readFile(join(root, result.data!.file!), "utf8");
225
235
  expect(body).toContain("## Fixed inputs");
226
- expect(body).toContain("| ID | Value | Source | Checked by |");
236
+ expect(body).toMatch(/\|\s*ID\s*\| Value \| Source \| Checked by \|/);
227
237
  expect(body).not.toMatch(/^\|\s*FI-/m);
228
238
  });
229
239
 
@@ -303,3 +313,46 @@ describe("RFC-1534 rfc.create --amends counterpart", () => {
303
313
  expect(result.data?.amendsSync).toEqual({ amended: "RFC-1201", wroteCounterpart: false });
304
314
  });
305
315
  });
316
+
317
+ describe("RFC-1546 AC-2: commands.* frontmatter regenerates the manifest", () => {
318
+ beforeEach(async () => {
319
+ await seed();
320
+ });
321
+ afterEach(async () => {
322
+ await rm(root, { recursive: true, force: true });
323
+ });
324
+
325
+ test("--proposed invokes ecosystem.manifest.generate after the write", async () => {
326
+ const invoked: string[] = [];
327
+ const result = await runRfcCreate(
328
+ { flags: flags({ title: "Tame the registry loader", proposed: "foo.bar" }) } as never,
329
+ {
330
+ ...context(),
331
+ invoke: async (name: string) => {
332
+ invoked.push(name);
333
+ return { ok: true, exitCode: 0 };
334
+ },
335
+ } as never,
336
+ );
337
+ expect(result.data?.status).toBe("ok");
338
+ expect(invoked).toEqual(["ecosystem.manifest.generate"]);
339
+ expect(result.data?.manifestRegen).toMatchObject({ invoked: true, ok: true });
340
+ });
341
+
342
+ test("no commands.* seeds — the generator is never invoked", async () => {
343
+ const invoked: string[] = [];
344
+ const result = await runRfcCreate(
345
+ { flags: flags({ title: "Tame the registry loader" }) } as never,
346
+ {
347
+ ...context(),
348
+ invoke: async (name: string) => {
349
+ invoked.push(name);
350
+ return { ok: true, exitCode: 0 };
351
+ },
352
+ } as never,
353
+ );
354
+ expect(result.data?.status).toBe("ok");
355
+ expect(invoked).toEqual([]);
356
+ expect(result.data?.manifestRegen).toBeUndefined();
357
+ });
358
+ });
@@ -6,13 +6,12 @@
6
6
  </non-goals>
7
7
  </MODULE_CONTRACT>
8
8
  <CHANGE_SUMMARY>
9
- <item>RFC-1467: block rfc.create on terminal-kind near-duplicates until --revisit acknowledges + V-52 validate mirror</item>
10
- <item>RFC-1467: address review r1 findings — object-shaped colliding payload, cite all colliding siblings, reviewBand field, supersede.propose escalation, flag-shape guard</item>
11
9
  <item>RFC-1482: emit validation-compliant RFC skeletons and surface contract breaches at authoring time</item>
12
10
  <item>RFC-1534: --amends flag seeds amends: and merges the draft id into the amended file's amendedBy[] in the same pass (line-level, F-0056); unreadable counterpart downgrades to a pending report.</item>
13
11
  <item>RFC-1514: attach corrected invocations to blocking diagnostics so retry is one-shot</item>
14
12
  <item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
15
- <history>RFC-0303, RFC-1097, RFC-1138, RFC-1139, RFC-1364</history>
13
+ <item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
14
+ <history>RFC-0303, RFC-1097, RFC-1138, RFC-1139, RFC-1364, RFC-1467</history>
16
15
  </CHANGE_SUMMARY>
17
16
  */
18
17
 
@@ -46,6 +45,7 @@ import { RFC_DIR, RFC_KINDS, RFC_SCOPES, RFC_METADATA_CUTOFF } from "../types.ts
46
45
  import { DNA_DOCS, loadInvariantIds, toIsoDate, resolveRfcTemplate } from "./shared.ts";
47
46
  import { allocateNextRfcId, appendReservation } from "../next-id.ts";
48
47
  import { currentBranch } from "../../flow/git.ts";
48
+ import { REGEN_FLAGS } from "../../core/archive-regen.ts";
49
49
  import {
50
50
  collectDecisionLog,
51
51
  scoreDecisions,
@@ -531,6 +531,32 @@ export async function runRfcCreate(
531
531
  );
532
532
  }
533
533
 
534
+ // RFC-1546: seeded commands.* buckets invalidate the ecosystem manifest —
535
+ // regenerate in the same invocation so the commit gate doesn't refuse on
536
+ // stale docs/ecosystem.generated.yaml. Advisory: the create succeeded; a
537
+ // missing invoke port or a failed regen only lands in the data payload.
538
+ let manifestRegen: { invoked: boolean; ok: boolean; summary?: string } | undefined;
539
+ if (proposed.length > 0 || added.length > 0) {
540
+ if (context.invoke) {
541
+ const regen = await context.invoke(
542
+ "ecosystem.manifest.generate",
543
+ REGEN_FLAGS["ecosystem.manifest.generate"] ?? {},
544
+ );
545
+ manifestRegen = {
546
+ invoked: true,
547
+ ok: regen.ok !== false && (regen.exitCode === undefined || regen.exitCode === 0),
548
+ ...(regen.summary !== undefined ? { summary: regen.summary } : {}),
549
+ };
550
+ if (!manifestRegen.ok) {
551
+ logger.warn(
552
+ `rfc.create: ecosystem.manifest.generate failed — ${regen.summary ?? `exit ${regen.exitCode}`} — regenerate before committing`,
553
+ );
554
+ }
555
+ } else {
556
+ manifestRegen = { invoked: false, ok: false };
557
+ }
558
+ }
559
+
534
560
  if (outputFormat === "pretty") {
535
561
  logger.success(`Created ${nextId}: ${title}`);
536
562
  logger.info(`File: ${relativeFile}`);
@@ -567,6 +593,7 @@ export async function runRfcCreate(
567
593
  ...(colliding.length > 0 ? { colliding, blocked: false } : {}),
568
594
  ...(reviewBand.length > 0 ? { reviewBand } : {}),
569
595
  ...(amendsSync ? { amendsSync } : {}),
596
+ ...(manifestRegen ? { manifestRegen } : {}),
570
597
  },
571
598
  summary: `Created ${nextId}: ${title}`,
572
599
  nextSteps: [
@@ -0,0 +1,218 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1569 V-53 — evidence-annotation shape lint on every criterion
4
+ line, plus parseEvidenceAnnotation exhaustiveness over the stamp's grammar.</purpose>
5
+ <non-goals>
6
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
7
+ </non-goals>
8
+ </MODULE_CONTRACT>
9
+ <CHANGE_SUMMARY>
10
+ <item>RFC-1569: V-53 rule tests + shared-parser exhaustiveness (AC-1, AC-2, AC-3)</item>
11
+ <item>RFC-1569: lint rfc evidence annotations and transient probe targets</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
15
+ import { test, expect, describe } from "vitest";
16
+ import { validateSingleRfc, type AddViolationFn } from "./validate-rules.ts";
17
+ import { parseEvidenceAnnotation } from "../evidence-annotation.ts";
18
+ import type { ParsedRfc } from "../frontmatter-io.ts";
19
+ import { join } from "node:path";
20
+ import { tmpdir } from "node:os";
21
+
22
+ const testWorkspace = join(tmpdir(), "test-workspace-rfc1569-v53");
23
+
24
+ function makeParsed(
25
+ status: string,
26
+ body: string,
27
+ extraFm: Record<string, unknown> = {},
28
+ ): ParsedRfc {
29
+ return {
30
+ frontmatter: {
31
+ id: "RFC-9999",
32
+ title: "Test RFC",
33
+ status,
34
+ kind: "command",
35
+ scope: "workspace",
36
+ owners: ["architecture"],
37
+ createdAt: "2026-09-01",
38
+ updatedAt: "2026-09-01",
39
+ ...extraFm,
40
+ },
41
+ body,
42
+ };
43
+ }
44
+
45
+ const BASE_BODY = `
46
+ # RFC-9999: Test RFC
47
+
48
+ ## Context
49
+
50
+ Test context.
51
+
52
+ ## Problem
53
+
54
+ Test problem.
55
+
56
+ ## Decision
57
+
58
+ Test decision.
59
+
60
+ ## Architectural fit
61
+
62
+ Test fit.
63
+
64
+ ## Design
65
+
66
+ ### CLI surface
67
+
68
+ Test CLI.
69
+
70
+ ### TypeScript contracts
71
+
72
+ Test types.
73
+
74
+ ### File system responsibilities
75
+
76
+ | Path | Role |
77
+ |---|---|
78
+ | \`test.ts\` | test |
79
+
80
+ ### Output format
81
+
82
+ Test output.
83
+
84
+ ### Failure modes
85
+
86
+ Test failures.
87
+
88
+ ## Rollout
89
+
90
+ Test rollout.
91
+
92
+ ## Alternatives considered
93
+
94
+ Test alternatives.
95
+
96
+ ## Risks
97
+
98
+ Test risks.
99
+
100
+ ## Acceptance criteria
101
+
102
+ ACCEPTANCE_HERE
103
+
104
+ ## Implementation notes for agents
105
+
106
+ Test notes.
107
+ `;
108
+
109
+ async function runValidate(
110
+ parsed: ParsedRfc,
111
+ ): Promise<{ rfcId: string; rule: string; message: string; severity: string }[]> {
112
+ const violations: { rfcId: string; rule: string; message: string; severity: string }[] = [];
113
+ const add: AddViolationFn = (rfcId, _file, rule, message, severity = "error") => {
114
+ violations.push({ rfcId, rule, message, severity });
115
+ };
116
+ await validateSingleRfc(
117
+ "rfc-9999-test.md",
118
+ parsed,
119
+ new Map(),
120
+ new Map(),
121
+ new Set(),
122
+ new Set(),
123
+ new Set(Object.keys(parsed.frontmatter)),
124
+ testWorkspace,
125
+ add,
126
+ );
127
+ return violations;
128
+ }
129
+
130
+ const PROSE_ANNOTATION =
131
+ "- [ ] AC-1: renders the hero (evidence: probe:AC-2 renders the hero)\n- [ ] AC-2: exits zero\n";
132
+
133
+ describe("V-53: evidence annotation shape (RFC-1569)", () => {
134
+ test("AC-1: unchecked criterion with prose annotation reports warning on a draft", async () => {
135
+ const violations = await runValidate(
136
+ makeParsed("draft", BASE_BODY.replace("ACCEPTANCE_HERE", PROSE_ANNOTATION)),
137
+ );
138
+ const v53 = violations.filter((v) => v.rule === "V-53");
139
+ expect(v53.length).toBeGreaterThan(0);
140
+ expect(v53.every((v) => v.severity === "warning")).toBe(true);
141
+ expect(v53[0]!.message).toContain("STAMP-CHECK-01");
142
+ });
143
+
144
+ test("AC-2: the same annotation on an accepted RFC reports error", async () => {
145
+ const violations = await runValidate(
146
+ makeParsed("accepted", BASE_BODY.replace("ACCEPTANCE_HERE", PROSE_ANNOTATION)),
147
+ );
148
+ const v53 = violations.filter((v) => v.rule === "V-53");
149
+ expect(v53.length).toBeGreaterThan(0);
150
+ expect(v53.every((v) => v.severity === "error")).toBe(true);
151
+ });
152
+
153
+ test("resolvable forms produce no V-53", async () => {
154
+ const acceptance = [
155
+ "- [ ] AC-1: c (evidence: test:packages/forge/x.test.ts)",
156
+ "- [ ] AC-2: c (evidence: file:packages/forge/x.ts)",
157
+ "- [ ] AC-3: c (evidence: file:packages/forge/x.ts:12-15)",
158
+ "- [ ] AC-4: c (evidence: packages/forge/x.ts:42)",
159
+ "- [ ] AC-5: c (evidence: probe:design:shared-grammar)",
160
+ ].join("\n");
161
+ const violations = await runValidate(
162
+ makeParsed("draft", BASE_BODY.replace("ACCEPTANCE_HERE", acceptance), {
163
+ acceptance: [
164
+ {
165
+ probe: "file-contains",
166
+ criterion: "design:shared-grammar",
167
+ path: "x",
168
+ pattern: "y",
169
+ },
170
+ ],
171
+ }),
172
+ );
173
+ expect(violations.filter((v) => v.rule === "V-53")).toEqual([]);
174
+ });
175
+
176
+ test("probe annotation naming a missing criterion reports V-53", async () => {
177
+ const acceptance = "- [ ] AC-1: c (evidence: probe:AC-9)\n- [ ] AC-2: c (evidence: file:x.ts)";
178
+ const violations = await runValidate(
179
+ makeParsed("draft", BASE_BODY.replace("ACCEPTANCE_HERE", acceptance)),
180
+ );
181
+ const v53 = violations.filter((v) => v.rule === "V-53");
182
+ expect(v53.some((v) => v.message.includes("probe:AC-9"))).toBe(true);
183
+ });
184
+ });
185
+
186
+ describe("AC-3: parseEvidenceAnnotation exhaustiveness (RFC-1569)", () => {
187
+ const resolvable: [string, string][] = [
188
+ ["probe:AC-1", "probe"],
189
+ ["probe:AC-12", "probe"],
190
+ ["probe: design:shared-grammar", "probe"],
191
+ ["test:packages/forge/x.test.ts", "test"],
192
+ ["test: packages/forge/x.test.ts", "test"],
193
+ ["file:packages/forge/x.ts", "file"],
194
+ ["file:packages/forge/x.ts:12", "file"],
195
+ ["file:packages/forge/x.ts:12-15", "file"],
196
+ ["packages/forge/x.ts:42", "path-line"],
197
+ ["packages/forge/x.ts:42-50", "path-line"],
198
+ ];
199
+ for (const [raw, kind] of resolvable) {
200
+ test(`accepts "${raw}" as ${kind}`, () => {
201
+ const parsed = parseEvidenceAnnotation(raw);
202
+ expect(parsed.kind).toBe(kind);
203
+ });
204
+ }
205
+ const unresolvable = [
206
+ "probe:AC-2 renders the hero",
207
+ "probe:AC-1 or test: <path>",
208
+ "test:",
209
+ "file: <module-path> with prose",
210
+ "",
211
+ "anything else",
212
+ ];
213
+ for (const raw of unresolvable) {
214
+ test(`rejects "${raw}"`, () => {
215
+ expect(parseEvidenceAnnotation(raw).kind).toBe("invalid");
216
+ });
217
+ }
218
+ });
@@ -0,0 +1,71 @@
1
+ /*
2
+ <MODULE_CONTRACT>
3
+ <purpose>RFC-1569 — V-PROBE-META-01 extension: mid-pattern anchors and
4
+ unescaped brace/bracket arms over collectProbeMetacharHits.</purpose>
5
+ <non-goals>
6
+ <item>Not a contract source of truth — the module under test owns the authoritative behavior; fixtures are minimal scaffolding only.</item>
7
+ </non-goals>
8
+ </MODULE_CONTRACT>
9
+ <CHANGE_SUMMARY>
10
+ <item>RFC-1569: metachar extension tests (AC-8) + suppression regression</item>
11
+ <item>RFC-1569: lint rfc evidence annotations and transient probe targets</item>
12
+ </CHANGE_SUMMARY>
13
+ */
14
+
15
+ import { test, expect, describe } from "vitest";
16
+ import { collectProbeMetacharHits } from "./validate-rules.ts";
17
+
18
+ const fm = (pattern: string): string =>
19
+ `acceptance:\n - probe: file-contains\n criterion: AC-1\n path: x\n pattern: "${pattern}"\n`;
20
+
21
+ const probe = (pattern: string) => [
22
+ { probe: "file-contains", criterion: "AC-1", path: "x", pattern },
23
+ ];
24
+
25
+ describe("V-PROBE-META-01 extensions (RFC-1569)", () => {
26
+ test("AC-8: mid-pattern unescaped $ is flagged", () => {
27
+ const hits = collectProbeMetacharHits(probe("${WORKSPACE_ROOT}"), fm(""));
28
+ expect(hits.some((h) => h.chars.some((c) => c.includes("`$`")))).toBe(true);
29
+ });
30
+
31
+ test("leading ^ and trailing $ anchors stay clean", () => {
32
+ const hits = collectProbeMetacharHits(probe("^hero end$"), fm(""));
33
+ expect(hits).toEqual([]);
34
+ });
35
+
36
+ test("mid-pattern unescaped ^ is flagged", () => {
37
+ const hits = collectProbeMetacharHits(probe("a^b"), fm(""));
38
+ expect(hits.some((h) => h.chars.some((c) => c.includes("`^`")))).toBe(true);
39
+ });
40
+
41
+ test("escaped \\$ and \\^ stay clean", () => {
42
+ const hits = collectProbeMetacharHits(probe("a\\$b\\^c"), fm(""));
43
+ expect(hits).toEqual([]);
44
+ });
45
+
46
+ test("unescaped {} and [] are flagged", () => {
47
+ const brace = collectProbeMetacharHits(probe("a{1,2}"), fm(""));
48
+ expect(brace.some((h) => h.chars.some((c) => c.includes("`{`/`}`")))).toBe(true);
49
+ const bracket = collectProbeMetacharHits(probe("a[bc]"), fm(""));
50
+ expect(bracket.some((h) => h.chars.some((c) => c.includes("`[`/`]`")))).toBe(true);
51
+ });
52
+
53
+ test("escaped \\{\\} and \\[\\] stay clean", () => {
54
+ const hits = collectProbeMetacharHits(probe("a\\{1\\}b\\[x\\]"), fm(""));
55
+ expect(hits).toEqual([]);
56
+ });
57
+
58
+ test("suggestion escapes the newly flagged characters", () => {
59
+ const hits = collectProbeMetacharHits(probe("a{b}c[d]e$f"), fm(""));
60
+ const s = hits[0]?.suggestion ?? "";
61
+ expect(s).not.toMatch(/(?<!\\)[{[\]]/);
62
+ expect(s).toContain("\\$");
63
+ });
64
+
65
+ test("probe-meta: intentional marker still suppresses", () => {
66
+ const pattern = "${WORKSPACE_ROOT}";
67
+ const fmWithMarker = `acceptance:\n - probe: file-contains\n criterion: AC-1\n path: x\n pattern: "${pattern}" # <!-- probe-meta: intentional -->\n`;
68
+ const hits = collectProbeMetacharHits(probe(pattern), fmWithMarker);
69
+ expect(hits).toEqual([]);
70
+ });
71
+ });