@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
@@ -20,12 +20,17 @@ triggerPhrases: ["завершаем", "протокол завершения",
20
20
  </non-goals>
21
21
  </MODULE_CONTRACT>
22
22
  <CHANGE_SUMMARY>
23
- <item>RFC-1491: step 6 — outbound AGENTS paragraphs, retro step 3f, FLOW-PUSH/HOLD/GUARD-05/10/INT-11 catalog</item>
24
- <item>RFC-1528: worktree-first preamble — session-end writes go through a dedicated session worktree; docs.archive prefers the kernel host</item>
25
23
  <item>RFC-1531: add flow.integrate remediation flags on the shared dirty classifier</item>
26
24
  <item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
27
25
  <item>ADR-0126: docs-rule batch — 16 friction measures landed</item>
28
- <history>ADR-0119, ADR-0121, RFC-1097, RFC-1247, RFC-1433, RFC-1460, RFC-1487</history>
26
+ <item>RFC-1460: draft mechanical-obligation RFCs and land harvest doc rules
27
+
28
+ RFC-1460 harvest wave 2026-11-09: five draft RFCs (derive-and-repair flow
29
+ surfaces, quiet kernel output, staged-commit/invocation guards, fixed-branch
30
+ onboarding-status routing, forge task prettier coverage), seven docs-rule
31
+ landings, registry flips — 25 entries served, F-0025 stays external.</item>
32
+ <item>RFC-1460: session-end teardown — stop worktree-held dev servers before flow.integrate</item>
33
+ <history>ADR-0119, ADR-0121, RFC-1097, RFC-1247, RFC-1433, RFC-1460, RFC-1487, RFC-1491, RFC-1528</history>
29
34
  </CHANGE_SUMMARY>
30
35
  -->
31
36
 
@@ -103,7 +108,8 @@ The agent reconstructs the current session's conversation from its context windo
103
108
 
104
109
  **Instructions:**
105
110
 
106
- 1. Create the directory `docs/sessions/.raw/` if it does not exist.
111
+ 1. Create the directory `docs/sessions/.raw/` if it does not exist. **Synthesized timestamps MUST fall inside the real session window** — `session.save` derives the session id from the first timestamp, so a 2025-epoch placeholder produces a wrongly-dated session file and forces a redo. Anchor the first line to the session's actual start and step forward from there.
112
+
107
113
  2. Generate a timestamp-based filename: `<YYYY-MM-DD-HH-MM-SS>-session.atif` (use current time in the operator's timezone).
108
114
  3. Reconstruct the conversation from context — include every user message and assistant response you can recall from the current session, in chronological order. This is a best-effort reconstruction: the agent's context window is the source, not an external export tool.
109
115
  4. **Redact sensitive information** — remove API keys, passwords, PII, and secret values before writing. Replace with `<redacted>`.
@@ -199,8 +205,10 @@ for d in missions/*/workpiece; do [ -d "$d/.git" ] && echo "=== $d ===" && rtk g
199
205
  **3e. Integrate or discard the session flow branch:**
200
206
 
201
207
  - This step applies only when the session's cwd is a flow worktree — its branch is a registered `auto/session-*` entry (check `flow.status`; repositories not on the fixed branch model have no registered branches → skip silently). When the worktree-first preamble opened a retro worktree, run the integration from that worktree — the whole session's writes ride it.
208
+ - Before integrating, stop processes that hold files inside the session worktree — dev servers (`astro dev`, `vite dev`, `node --watch`, …) started during the session keep `node_modules`/build-output handles open and make `git worktree remove` fail with FLOW-INT-04 ("Directory not empty"): the branch still integrates, but an orphaned directory shell plus a stale server stay behind. Detect holders via `/proc` cwd links — `for d in /proc/[0-9]*/cwd; do readlink "$d"; done | grep -F "<worktree path>"` (or `lsof +D <worktree>`) — terminate them, then integrate.
202
209
  - After the clean-tree commit, run `flow.integrate` from the session worktree — it rebases the branch onto `develop`, runs the primary checkout's `hooks/integration-gate.sh`, and fast-forwards `develop`.
203
210
  - On a FLOW-INT-02 (rebase conflict) or FLOW-INT-05 (gate refusal) diagnostic, report the refusal and leave the branch for the next session — do not force-resolve inside session end.
211
+ - A FLOW-INT-04 (worktree removal failed) means the branch already integrated — only teardown failed: stop the file-holding process, confirm the worktree is unregistered (`git worktree list`), then remove the leftover directory.
204
212
  - A FLOW-INT-01 dirty refusal is different: `data.entries` carries each path's class (`disposable`/`work`/…) — remediate via the flow.integrate remediation flags (`--auto-clean` when every entry is disposable, `--autocommit` to sweep the rest into the fixed-subject commit) or leave the branch for the next session with the classification reported.
205
213
  - When the operator said to drop the work, run `flow.discard --reason "<operator words>"` instead of `flow.integrate`.
206
214
 
package/src/cli-flags.ts CHANGED
@@ -14,6 +14,7 @@ with `TypeError: targetId.toLowerCase is not a function`.</purpose>
14
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>
15
15
  <item>RFC-1395: port --output → --json alias into forge CLI parser</item>
16
16
  <item>RFC-1485: sweep compass headers — forge-src + forge root eslint</item>
17
+ <item>RFC-1568: durable gate-run records, --detach mechanics, and forge CLI wiring</item>
17
18
  </CHANGE_SUMMARY>
18
19
  */
19
20
 
@@ -34,6 +35,11 @@ export const CLI_UNIVERSAL_FLAGS: Record<string, ForgeFlagSpec> = {
34
35
  "dry-run": { kind: "boolean", description: "Report intended mutations without writing them." },
35
36
  force: { kind: "boolean", description: "Bypass a normally-blocking safety check." },
36
37
  help: { kind: "boolean", description: "Print command help instead of executing." },
38
+ detach: {
39
+ kind: "boolean",
40
+ description:
41
+ "RFC-1568: run a `detachable` command as a detached child — returns immediately with a run id; poll via gate.run.status.",
42
+ },
37
43
  };
38
44
 
39
45
  /**
@@ -43,6 +49,7 @@ export const CLI_UNIVERSAL_FLAGS: Record<string, ForgeFlagSpec> = {
43
49
  */
44
50
  const CLI_BOOLEAN_FLAGS = new Set<string>([
45
51
  "all",
52
+ "detach",
46
53
  "all-apps",
47
54
  "approve-all",
48
55
  "dry-run",
@@ -22,6 +22,7 @@ operator-owned.
22
22
  <CHANGE_SUMMARY>
23
23
  <item>RFC-1154: initial implementation — plan/apply + delimited-block reconcile.</item>
24
24
  <item>RFC-1255: Enumerate generated AGENTS.md paths (root + nested workspaces via discoverWorkspaces) in the managed block — prettier normalization byte-diverges from the generator render and trips doctor's stale check on every format-on-commit.</item>
25
+ <item>RFC-1550: FIXED_ENTRIES gains `.forge/task/` — forge-owned task scratch paths are prettier-irrelevant and must not be normalized or linted by consumers.</item>
25
26
  </CHANGE_SUMMARY>
26
27
  */
27
28
 
@@ -57,6 +58,7 @@ const PRETTIER_CONFIG_NAMES = [
57
58
 
58
59
  /** Non-skill generated-artifact entries, in stable order. */
59
60
  const FIXED_ENTRIES = [
61
+ ".forge/task/",
60
62
  "**/*.generated.yaml",
61
63
  "docs/sessions/",
62
64
  "docs/metrics/",
@@ -10,6 +10,7 @@ prettier-free consumers.</purpose>
10
10
  </MODULE_CONTRACT>
11
11
  <CHANGE_SUMMARY>
12
12
  <item>RFC-1154: initial prettierignore plan/apply tests.</item>
13
+ <item>RFC-1550: `.forge/task/` block entry + exactly-once-after-regeneration assertion.</item>
13
14
  </CHANGE_SUMMARY>
14
15
  */
15
16
 
@@ -84,6 +85,7 @@ test("AC-2: block contains generated.yaml glob, sessions, metrics, queues entrie
84
85
  expect(result).toBe("written");
85
86
  const content = await readFile(join(tmpDir, ".prettierignore"), "utf8");
86
87
  expect(content).toContain(PRETTIERIGNORE_BLOCK_BEGIN);
88
+ expect(content).toContain(".forge/task/");
87
89
  expect(content).toContain("**/*.generated.yaml");
88
90
  expect(content).toContain("docs/sessions/");
89
91
  expect(content).toContain("docs/metrics/");
@@ -91,6 +93,15 @@ test("AC-2: block contains generated.yaml glob, sessions, metrics, queues entrie
91
93
  expect(content).toContain(PRETTIERIGNORE_BLOCK_END);
92
94
  });
93
95
 
96
+ test("RFC-1550 AC-3: .forge/task/ appears exactly once after repeated regeneration", async () => {
97
+ await withPrettier(tmpDir);
98
+ await applyPrettierignore(tmpDir, await planPrettierignore(tmpDir));
99
+ const result = await applyPrettierignore(tmpDir, await planPrettierignore(tmpDir));
100
+ expect(result).toBe("unchanged");
101
+ const content = await readFile(join(tmpDir, ".prettierignore"), "utf8");
102
+ expect(content.split(".forge/task/").length - 1).toBe(1);
103
+ });
104
+
94
105
  test("skill entries enumerate only marker-carrying dirs (AC-9)", async () => {
95
106
  await withPrettier(tmpDir);
96
107
  const skillsDir = join(tmpDir, ".agents", "skills");
package/src/types.ts CHANGED
@@ -9,18 +9,12 @@ can be registered in a Warpgogol kernel without direct dependency.</purpose>
9
9
  </non-goals>
10
10
  </MODULE_CONTRACT>
11
11
  <CHANGE_SUMMARY>
12
- <item>RFC-1360: step 2 — env-input declaration sweep (59 commands)
13
-
14
- Declare every reachable env read on its owning command across engine/site/
15
- forge (fresh full-registry replay worklist: 151 ENV-INPUT-01, 60 commands).
16
- ForgeCommandMetadata gains the mirrored envInputs contract field. The
17
- npm_execpath ambient read in open-source-page.ts is removed for a
18
- deterministic PATH spawn (DNA-105) — undeclarable name class, ledger Q-9.</item>
19
12
  <item>RFC-1366: kernel resolves mission workpieceEnv + KERNEL-ENV-01 gate on required envInputs</item>
20
13
  <item>RFC-1461: declare rules[] severity via CommandRuleDecl workspace-wide (RFC-1461)</item>
21
14
  <item>RFC-1463: composite gates report complete violation sets and self-ensure prerequisites — ensure/compositeGate metadata, executor ensure runner, blockedBy skip tracking, ENSURE-01..04 + GATE-CMP-01, runCompositeGate</item>
22
15
  <item>RFC-1486: review r1 — committed-state adoption gate, uncommitted-hook committedness, step-failure trail, idempotency declaration, lazy asset resolution</item>
23
- <history>RFC-0518, RFC-1097, RFC-1147, RFC-1231, RFC-1306, RFC-1354</history>
16
+ <item>RFC-1568: durable gate-run records, --detach mechanics, and forge CLI wiring</item>
17
+ <history>RFC-0518, RFC-1097, RFC-1147, RFC-1231, RFC-1306, RFC-1354, RFC-1360</history>
24
18
  </CHANGE_SUMMARY>
25
19
  */
26
20
 
@@ -189,6 +183,13 @@ export interface ForgeCommandMetadata {
189
183
  * KernelCommandMetadata.
190
184
  */
191
185
  mutatingFlags?: string[];
186
+ /**
187
+ * RFC-1568: the command may run under `--detach` and every execution
188
+ * writes a durable gate-run record. Structurally mirrors
189
+ * KernelCommandMetadata — the standalone CLI checks this field on forge
190
+ * commands.
191
+ */
192
+ detachable?: true;
192
193
  /**
193
194
  * RFC-1327: rerun-safety class for mutating commands — structurally
194
195
  * mirrors KernelCommandMetadata. `rerun-safe` requires a sibling