@warpgogol/forge 5.3.4 → 6.0.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 (235) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin/cli.ts +7 -2
  3. package/dist/bin/cli.js +7 -2
  4. package/dist/bin/cli.js.map +1 -1
  5. package/dist/os/adr/adr.module.d.ts.map +1 -1
  6. package/dist/os/adr/adr.module.js +2 -0
  7. package/dist/os/adr/adr.module.js.map +1 -1
  8. package/dist/os/audit/audit.module.d.ts.map +1 -1
  9. package/dist/os/audit/audit.module.js +2 -0
  10. package/dist/os/audit/audit.module.js.map +1 -1
  11. package/dist/os/compass/compass.module.d.ts.map +1 -1
  12. package/dist/os/compass/compass.module.js +47 -15
  13. package/dist/os/compass/compass.module.js.map +1 -1
  14. package/dist/os/compass/handlers/compass-audit-handler.d.ts +2 -0
  15. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  16. package/dist/os/compass/handlers/compass-audit-handler.js +39 -9
  17. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  18. package/dist/os/compass/handlers/compass-docs-validate.d.ts +13 -0
  19. package/dist/os/compass/handlers/compass-docs-validate.d.ts.map +1 -0
  20. package/dist/os/compass/handlers/compass-docs-validate.js +326 -0
  21. package/dist/os/compass/handlers/compass-docs-validate.js.map +1 -0
  22. package/dist/os/compass/handlers/summary-record.d.ts +11 -2
  23. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  24. package/dist/os/compass/handlers/summary-record.js +93 -5
  25. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  26. package/dist/os/core/core.module.d.ts.map +1 -1
  27. package/dist/os/core/core.module.js +124 -73
  28. package/dist/os/core/core.module.js.map +1 -1
  29. package/dist/os/exploration/exploration.module.d.ts.map +1 -1
  30. package/dist/os/exploration/exploration.module.js +3 -0
  31. package/dist/os/exploration/exploration.module.js.map +1 -1
  32. package/dist/os/naming/naming.module.d.ts.map +1 -1
  33. package/dist/os/naming/naming.module.js +9 -2
  34. package/dist/os/naming/naming.module.js.map +1 -1
  35. package/dist/os/notes/notes.module.d.ts.map +1 -1
  36. package/dist/os/notes/notes.module.js +17 -6
  37. package/dist/os/notes/notes.module.js.map +1 -1
  38. package/dist/os/plan/plan.module.d.ts.map +1 -1
  39. package/dist/os/plan/plan.module.js +2 -0
  40. package/dist/os/plan/plan.module.js.map +1 -1
  41. package/dist/os/plugin/plugin.module.d.ts.map +1 -1
  42. package/dist/os/plugin/plugin.module.js +9 -2
  43. package/dist/os/plugin/plugin.module.js.map +1 -1
  44. package/dist/os/program/program.module.d.ts.map +1 -1
  45. package/dist/os/program/program.module.js +19 -4
  46. package/dist/os/program/program.module.js.map +1 -1
  47. package/dist/os/queue/handlers/queue-validate.d.ts.map +1 -1
  48. package/dist/os/queue/handlers/queue-validate.js +154 -7
  49. package/dist/os/queue/handlers/queue-validate.js.map +1 -1
  50. package/dist/os/queue/manifest.d.ts +17 -1
  51. package/dist/os/queue/manifest.d.ts.map +1 -1
  52. package/dist/os/queue/manifest.js +127 -6
  53. package/dist/os/queue/manifest.js.map +1 -1
  54. package/dist/os/queue/queue.module.d.ts.map +1 -1
  55. package/dist/os/queue/queue.module.js +32 -4
  56. package/dist/os/queue/queue.module.js.map +1 -1
  57. package/dist/os/queue/types.d.ts +100 -1
  58. package/dist/os/queue/types.d.ts.map +1 -1
  59. package/dist/os/queue/types.js +44 -0
  60. package/dist/os/queue/types.js.map +1 -1
  61. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  62. package/dist/os/rfc/handlers/implement-stamp.js +28 -5
  63. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  64. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  65. package/dist/os/rfc/rfc.module.js +27 -3
  66. package/dist/os/rfc/rfc.module.js.map +1 -1
  67. package/dist/os/rfc/types.d.ts +11 -0
  68. package/dist/os/rfc/types.d.ts.map +1 -1
  69. package/dist/os/rfc/types.js +1 -0
  70. package/dist/os/rfc/types.js.map +1 -1
  71. package/dist/os/rfc/verification-evidence.d.ts +21 -0
  72. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  73. package/dist/os/rfc/verification-evidence.js +140 -23
  74. package/dist/os/rfc/verification-evidence.js.map +1 -1
  75. package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
  76. package/dist/os/rfc/verification-refresh.js +72 -37
  77. package/dist/os/rfc/verification-refresh.js.map +1 -1
  78. package/dist/os/session/handlers/save.d.ts.map +1 -1
  79. package/dist/os/session/handlers/save.js +46 -5
  80. package/dist/os/session/handlers/save.js.map +1 -1
  81. package/dist/os/session/session.module.d.ts.map +1 -1
  82. package/dist/os/session/session.module.js +5 -0
  83. package/dist/os/session/session.module.js.map +1 -1
  84. package/dist/os/spec/live-spec-merge.d.ts.map +1 -1
  85. package/dist/os/spec/live-spec-merge.js +55 -134
  86. package/dist/os/spec/live-spec-merge.js.map +1 -1
  87. package/dist/os/spec/live-spec-rebuild.d.ts +32 -0
  88. package/dist/os/spec/live-spec-rebuild.d.ts.map +1 -0
  89. package/dist/os/spec/live-spec-rebuild.js +272 -0
  90. package/dist/os/spec/live-spec-rebuild.js.map +1 -0
  91. package/dist/os/spec/live-spec-shared.d.ts +62 -0
  92. package/dist/os/spec/live-spec-shared.d.ts.map +1 -0
  93. package/dist/os/spec/live-spec-shared.js +315 -0
  94. package/dist/os/spec/live-spec-shared.js.map +1 -0
  95. package/dist/os/spec/live-spec-types.d.ts +17 -1
  96. package/dist/os/spec/live-spec-types.d.ts.map +1 -1
  97. package/dist/os/spec/live-spec-types.js +3 -0
  98. package/dist/os/spec/live-spec-types.js.map +1 -1
  99. package/dist/os/spec/live-spec-validate.d.ts.map +1 -1
  100. package/dist/os/spec/live-spec-validate.js +105 -2
  101. package/dist/os/spec/live-spec-validate.js.map +1 -1
  102. package/dist/os/spec/spec-materialize.d.ts +2 -0
  103. package/dist/os/spec/spec-materialize.d.ts.map +1 -1
  104. package/dist/os/spec/spec-materialize.js +45 -5
  105. package/dist/os/spec/spec-materialize.js.map +1 -1
  106. package/dist/os/spec/spec-schema.d.ts +19 -0
  107. package/dist/os/spec/spec-schema.d.ts.map +1 -1
  108. package/dist/os/spec/spec-schema.js +30 -0
  109. package/dist/os/spec/spec-schema.js.map +1 -1
  110. package/dist/os/spec/spec-status.d.ts +4 -0
  111. package/dist/os/spec/spec-status.d.ts.map +1 -1
  112. package/dist/os/spec/spec-status.js +19 -1
  113. package/dist/os/spec/spec-status.js.map +1 -1
  114. package/dist/os/spec/spec-validate.d.ts.map +1 -1
  115. package/dist/os/spec/spec-validate.js +55 -8
  116. package/dist/os/spec/spec-validate.js.map +1 -1
  117. package/dist/os/spec/spec.module.d.ts.map +1 -1
  118. package/dist/os/spec/spec.module.js +84 -8
  119. package/dist/os/spec/spec.module.js.map +1 -1
  120. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +1 -1
  121. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +10 -4
  122. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +1 -1
  123. package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
  124. package/dist/os/werkstatt/werkstatt.module.js +13 -4
  125. package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
  126. package/dist/os/workflow/workflow.module.d.ts.map +1 -1
  127. package/dist/os/workflow/workflow.module.js +13 -5
  128. package/dist/os/workflow/workflow.module.js.map +1 -1
  129. package/dist/src/cli-flags.d.ts.map +1 -1
  130. package/dist/src/cli-flags.js +25 -5
  131. package/dist/src/cli-flags.js.map +1 -1
  132. package/dist/src/config/forge-config.d.ts +3 -0
  133. package/dist/src/config/forge-config.d.ts.map +1 -1
  134. package/dist/src/config/forge-config.js +2 -0
  135. package/dist/src/config/forge-config.js.map +1 -1
  136. package/dist/src/onboarding/init.d.ts.map +1 -1
  137. package/dist/src/onboarding/init.js +8 -3
  138. package/dist/src/onboarding/init.js.map +1 -1
  139. package/dist/src/pipeline-status.d.ts +14 -1
  140. package/dist/src/pipeline-status.d.ts.map +1 -1
  141. package/dist/src/pipeline-status.js +28 -8
  142. package/dist/src/pipeline-status.js.map +1 -1
  143. package/dist/src/types.d.ts +7 -1
  144. package/dist/src/types.d.ts.map +1 -1
  145. package/dist/src/types.js +6 -0
  146. package/dist/src/types.js.map +1 -1
  147. package/dist/src/utils/generated-marker.d.ts +8 -0
  148. package/dist/src/utils/generated-marker.d.ts.map +1 -1
  149. package/dist/src/utils/generated-marker.js +25 -0
  150. package/dist/src/utils/generated-marker.js.map +1 -1
  151. package/os/adr/adr.module.ts +2 -0
  152. package/os/audit/audit.module.ts +2 -0
  153. package/os/compass/compass.module.ts +49 -15
  154. package/os/compass/handlers/compass-audit-handler.ts +50 -9
  155. package/os/compass/handlers/compass-docs-validate.ts +359 -0
  156. package/os/compass/handlers/summary-record.ts +104 -5
  157. package/os/compass/handlers/tests/compass-audit-record.test.ts +2 -1
  158. package/os/compass/handlers/tests/compass-audit-validate.test.ts +92 -3
  159. package/os/compass/handlers/tests/compass-docs-validate.test.ts +203 -0
  160. package/os/compass/handlers/tests/compass-ledger-scope.test.ts +2 -1
  161. package/os/compass/handlers/tests/summary-record.test.ts +127 -0
  162. package/os/core/core.module.ts +147 -75
  163. package/os/core/docs-archive.test.ts +136 -0
  164. package/os/exploration/exploration.module.ts +3 -0
  165. package/os/naming/naming.module.ts +9 -2
  166. package/os/notes/notes.module.ts +17 -6
  167. package/os/plan/plan-0000-template.md +150 -0
  168. package/os/plan/plan.module.ts +2 -0
  169. package/os/plugin/plugin.module.ts +9 -2
  170. package/os/program/program.module.ts +19 -4
  171. package/os/queue/decision-ledger.test.ts +163 -0
  172. package/os/queue/handlers/queue-validate.ts +190 -8
  173. package/os/queue/manifest.ts +201 -7
  174. package/os/queue/queue-validate.test.ts +303 -0
  175. package/os/queue/queue.module.ts +32 -4
  176. package/os/queue/types.ts +56 -1
  177. package/os/rfc/handlers/implement-stamp.ts +35 -5
  178. package/os/rfc/rfc.module.ts +29 -3
  179. package/os/rfc/types.ts +17 -1
  180. package/os/rfc/verification-emit.test.ts +305 -0
  181. package/os/rfc/verification-evidence.ts +155 -24
  182. package/os/rfc/verification-refresh.test.ts +222 -1
  183. package/os/rfc/verification-refresh.ts +80 -38
  184. package/os/session/handlers/save.ts +41 -5
  185. package/os/session/session.module.ts +5 -0
  186. package/os/spec/live-spec-idempotency.pbt.test.ts +222 -0
  187. package/os/spec/live-spec-list-show-validate.test.ts +10 -6
  188. package/os/spec/live-spec-merge.test.ts +187 -7
  189. package/os/spec/live-spec-merge.ts +71 -155
  190. package/os/spec/live-spec-rebuild.test.ts +317 -0
  191. package/os/spec/live-spec-rebuild.ts +356 -0
  192. package/os/spec/live-spec-shared.ts +378 -0
  193. package/os/spec/live-spec-types.ts +21 -1
  194. package/os/spec/live-spec-validate.test.ts +317 -0
  195. package/os/spec/live-spec-validate.ts +106 -2
  196. package/os/spec/spec-materialize.test.ts +192 -0
  197. package/os/spec/spec-materialize.ts +48 -4
  198. package/os/spec/spec-schema.ts +49 -0
  199. package/os/spec/spec-status.ts +24 -0
  200. package/os/spec/spec-validate.test.ts +66 -0
  201. package/os/spec/spec-validate.ts +62 -8
  202. package/os/spec/spec.module.ts +85 -8
  203. package/os/werkstatt/handlers/werkstatt-operation-validate.ts +10 -4
  204. package/os/werkstatt/werkstatt.module.ts +13 -4
  205. package/os/workflow/workflow.module.ts +13 -5
  206. package/package.json +1 -1
  207. package/skills/_shared/fo-pipeline-conventions.md +126 -1
  208. package/skills/fo/fo-doc-audit/SKILL.md +4 -4
  209. package/skills/fo/fo-explore/SKILL.md +2 -1
  210. package/skills/fo/fo-fix/SKILL.md +11 -3
  211. package/skills/fo/fo-handoff/SKILL.md +4 -6
  212. package/skills/fo/fo-idea-create-rfc/SKILL.md +2 -1
  213. package/skills/fo/fo-idea-enhance/SKILL.md +23 -4
  214. package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +86 -22
  215. package/skills/fo/fo-idea-implement/SKILL.md +53 -10
  216. package/skills/fo/fo-idea-plan/SKILL.md +28 -6
  217. package/skills/fo/fo-review/SKILL.md +69 -8
  218. package/skills/fo/fo-session-retro/SKILL.md +3 -2
  219. package/skills/fo/fo-step-commit/SKILL.md +2 -0
  220. package/skills/shared/grilling/SKILL.md +12 -0
  221. package/skills/shared/writing-great-skills/GLOSSARY.md +2 -0
  222. package/skills/shared/writing-great-skills/SKILL.md +2 -1
  223. package/src/cli-flags.ts +23 -5
  224. package/src/config/forge-config.ts +4 -0
  225. package/src/onboarding/init.ts +8 -3
  226. package/src/pipeline-status.ts +32 -8
  227. package/src/tests/cli-flags.test.ts +20 -0
  228. package/src/tests/cli-output.test.ts +13 -7
  229. package/src/tests/fixtures/agents-generate-business-before.txt +7 -7
  230. package/src/tests/implement-stamp.test.ts +38 -0
  231. package/src/tests/session-handlers.test.ts +33 -0
  232. package/src/types.ts +13 -1
  233. package/src/utils/generated-marker.ts +28 -0
  234. package/skills/fo/fo-idea-implement/ADR-FLOW.md +0 -179
  235. package/skills/fo/fo-review/AXES.md +0 -70
@@ -2,12 +2,14 @@ import { describe, it, expect, beforeEach, afterEach } from "vitest";
2
2
  import { mkdtemp, mkdir, writeFile, readFile, rm } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { join } from "node:path";
5
+ import { execFileSync } from "node:child_process";
5
6
  import {
6
7
  runCompassSummaryRecord,
7
8
  parseChangeSummary,
8
9
  mergeHistoryIds,
9
10
  buildChangeSummaryBlock,
10
11
  stripConventionalPrefix,
12
+ stripGitTrailers,
11
13
  isValidGovernanceId,
12
14
  CHANGE_SUMMARY_WINDOW,
13
15
  } from "../summary-record.ts";
@@ -160,6 +162,51 @@ describe("compass.summary.record", () => {
160
162
  expect(missing.exitCode).toBe(1);
161
163
  });
162
164
 
165
+ it("skips auto-inject when the worktree diff already adds a same-ID item (id-in-diff)", async () => {
166
+ execFileSync("git", ["init"], { cwd: root });
167
+ execFileSync("git", ["config", "user.email", "t@t"], { cwd: root });
168
+ execFileSync("git", ["config", "user.name", "T"], { cwd: root });
169
+ await writeFile(join(root, "src", "a.ts"), TS_HEADER(["RFC-0001: existing item."]));
170
+ execFileSync("git", ["add", "-A"], { cwd: root });
171
+ execFileSync("git", ["commit", "-m", "baseline"], { cwd: root });
172
+ // The pending change carries a hand-authored descriptive item for the ID.
173
+ await writeFile(
174
+ join(root, "src", "a.ts"),
175
+ TS_HEADER(["RFC-0001: existing item.", "RFC-1095: descriptive hand-written entry"]),
176
+ );
177
+
178
+ const result = await runCompassSummaryRecord(
179
+ makeInput({ id: "RFC-1095", files: ["src/a.ts"], text: "generic subject line" }),
180
+ makeContext(root),
181
+ );
182
+
183
+ expect(result.data?.skipped).toEqual([{ file: "src/a.ts", reason: "id-in-diff" }]);
184
+ expect(result.data?.recorded).toEqual([]);
185
+ const source = await readFile(join(root, "src", "a.ts"), "utf8");
186
+ expect(source).not.toContain("generic subject line");
187
+ });
188
+
189
+ it("still records when the same-ID item already exists at HEAD (consecutive-commit stack)", async () => {
190
+ execFileSync("git", ["init"], { cwd: root });
191
+ execFileSync("git", ["config", "user.email", "t@t"], { cwd: root });
192
+ execFileSync("git", ["config", "user.name", "T"], { cwd: root });
193
+ await writeFile(
194
+ join(root, "src", "a.ts"),
195
+ TS_HEADER(["RFC-1095: step 1 — recorded by the previous commit"]),
196
+ );
197
+ execFileSync("git", ["add", "-A"], { cwd: root });
198
+ execFileSync("git", ["commit", "-m", "baseline"], { cwd: root });
199
+
200
+ const result = await runCompassSummaryRecord(
201
+ makeInput({ id: "RFC-1095", files: ["src/a.ts"], text: "step 2" }),
202
+ makeContext(root),
203
+ );
204
+
205
+ expect(result.data?.recorded).toEqual(["src/a.ts"]);
206
+ const source = await readFile(join(root, "src", "a.ts"), "utf8");
207
+ expect(source).toContain("<item>RFC-1095: step 2</item>");
208
+ });
209
+
163
210
  it("defaults item text to the bare ID when --text is absent", async () => {
164
211
  await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
165
212
  await runCompassSummaryRecord(
@@ -191,6 +238,65 @@ describe("compass.summary.record", () => {
191
238
  expect(source).toContain("<item>RFC-1095: record command</item>");
192
239
  expect(source).not.toContain("RFC-1095: RFC-1095");
193
240
  });
241
+
242
+ it("strips Generated-with/Co-Authored-By trailer blocks from the recorded item (RFC-1233 AC-1)", async () => {
243
+ await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
244
+ await runCompassSummaryRecord(
245
+ makeInput({
246
+ id: "RFC-1233",
247
+ files: ["src/a.ts"],
248
+ text: "trailer stripping\n\nGenerated with [Devin](https://devin.ai)\nCo-Authored-By: Devin <bot@users.noreply.github.com>",
249
+ }),
250
+ makeContext(root),
251
+ );
252
+ const source = await readFile(join(root, "src", "a.ts"), "utf8");
253
+ expect(source).toContain("<item>RFC-1233: trailer stripping</item>");
254
+ expect(source).not.toContain("Co-Authored-By");
255
+ expect(source).not.toContain("Generated with");
256
+ expect(source).not.toContain("devin.ai");
257
+ });
258
+
259
+ it("neutralizes a literal star-slash in --text so the item cannot terminate the block comment (RFC-1233 AC-2)", async () => {
260
+ await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
261
+ await runCompassSummaryRecord(
262
+ makeInput({
263
+ id: "RFC-1233",
264
+ files: ["src/a.ts"],
265
+ text: "glob src" + "/**/*.ts in comments",
266
+ }),
267
+ makeContext(root),
268
+ );
269
+ const source = await readFile(join(root, "src", "a.ts"), "utf8");
270
+ expect(source).toContain("RFC-1233: glob src");
271
+ expect(source.match(CS_BLOCK_RE)).not.toBeNull();
272
+ // The neutralized form keeps both characters readable but cannot close /*.
273
+ expect(source).toContain("glob src/**" + "∕*.ts in comments");
274
+ });
275
+
276
+ it("keeps a single-line subject identical — negative regression (RFC-1233 AC-3)", async () => {
277
+ await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
278
+ await runCompassSummaryRecord(
279
+ makeInput({ id: "RFC-1233", files: ["src/a.ts"], text: "plain subject line" }),
280
+ makeContext(root),
281
+ );
282
+ const source = await readFile(join(root, "src", "a.ts"), "utf8");
283
+ expect(source).toContain("<item>RFC-1233: plain subject line</item>");
284
+ });
285
+
286
+ it("preserves a Key: value-shaped line when it is not in the trailing block (RFC-1233 AC-4)", async () => {
287
+ await writeFile(join(root, "src", "a.ts"), TS_HEADER([]));
288
+ await runCompassSummaryRecord(
289
+ makeInput({
290
+ id: "RFC-1233",
291
+ files: ["src/a.ts"],
292
+ text: "fix the parser\n\nNote: this line is prose about the fix\nfinal summary line",
293
+ }),
294
+ makeContext(root),
295
+ );
296
+ const source = await readFile(join(root, "src", "a.ts"), "utf8");
297
+ expect(source).toContain("Note: this line is prose about the fix");
298
+ expect(source).toContain("final summary line");
299
+ });
194
300
  });
195
301
 
196
302
  describe("summary-record helpers", () => {
@@ -246,4 +352,25 @@ describe("summary-record helpers", () => {
246
352
  expect(block).not.toContain("<history>");
247
353
  expect(block).toContain("<item>RFC-1: a</item>");
248
354
  });
355
+
356
+ it("stripGitTrailers strips a Token:-shaped tail block (RFC-1233)", () => {
357
+ expect(
358
+ stripGitTrailers("subject\n\nbody line\nCo-Authored-By: Devin <bot@x>\nX-RFC: RFC-1233"),
359
+ ).toBe("subject\n\nbody line");
360
+ });
361
+
362
+ it("stripGitTrailers keeps a lone markdown-link tail (no strict trailer line)", () => {
363
+ const msg = "subject\n\nsee [the docs](https://example.com)";
364
+ expect(stripGitTrailers(msg)).toBe(msg);
365
+ });
366
+
367
+ it("stripGitTrailers on a trailer-only message returns empty", () => {
368
+ expect(stripGitTrailers("Co-Authored-By: Devin <bot@x>")).toBe("");
369
+ });
370
+
371
+ it("stripGitTrailers strips empty-value trailers (Token:) — interpret-trailers allows them", () => {
372
+ expect(stripGitTrailers("subject\n\nReviewed-by:\nSigned-off-by: Devin <bot@x>")).toBe(
373
+ "subject",
374
+ );
375
+ });
249
376
  });