@warpgogol/forge 9.4.0 → 9.4.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.
- package/CHANGELOG.md +15 -0
- package/README.md +4 -2
- package/README.uk.md +10 -8
- package/dist/os/flow/dirty-classify.d.ts +4 -1
- package/dist/os/flow/dirty-classify.d.ts.map +1 -1
- package/dist/os/flow/dirty-classify.js +2 -0
- package/dist/os/flow/dirty-classify.js.map +1 -1
- package/dist/os/flow/flow.module.d.ts.map +1 -1
- package/dist/os/flow/flow.module.js +27 -2
- package/dist/os/flow/flow.module.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +22 -8
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.d.ts +6 -0
- package/dist/os/flow/handlers/flow-integrate.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-integrate.js +118 -40
- package/dist/os/flow/handlers/flow-integrate.js.map +1 -1
- package/dist/os/flow/handlers/flow-peers.d.ts +24 -0
- package/dist/os/flow/handlers/flow-peers.d.ts.map +1 -0
- package/dist/os/flow/handlers/flow-peers.js +99 -0
- package/dist/os/flow/handlers/flow-peers.js.map +1 -0
- package/dist/os/flow/index.d.ts +2 -0
- package/dist/os/flow/index.d.ts.map +1 -1
- package/dist/os/flow/index.js +4 -1
- package/dist/os/flow/index.js.map +1 -1
- package/dist/os/flow/ops-registry.d.ts +33 -0
- package/dist/os/flow/ops-registry.d.ts.map +1 -0
- package/dist/os/flow/ops-registry.js +177 -0
- package/dist/os/flow/ops-registry.js.map +1 -0
- package/dist/os/flow/preflight.d.ts +46 -3
- package/dist/os/flow/preflight.d.ts.map +1 -1
- package/dist/os/flow/preflight.js +196 -44
- package/dist/os/flow/preflight.js.map +1 -1
- package/dist/os/flow/standalone-invoke.d.ts +11 -0
- package/dist/os/flow/standalone-invoke.d.ts.map +1 -0
- package/dist/os/flow/standalone-invoke.js +75 -0
- package/dist/os/flow/standalone-invoke.js.map +1 -0
- package/dist/os/mission/handlers/archive.d.ts.map +1 -1
- package/dist/os/mission/handlers/archive.js +12 -8
- package/dist/os/mission/handlers/archive.js.map +1 -1
- package/dist/os/mission/importer-block.d.ts +19 -0
- package/dist/os/mission/importer-block.d.ts.map +1 -0
- package/dist/os/mission/importer-block.js +124 -0
- package/dist/os/mission/importer-block.js.map +1 -0
- package/dist/os/mission/lockfile.d.ts +17 -0
- package/dist/os/mission/lockfile.d.ts.map +1 -1
- package/dist/os/mission/lockfile.js +38 -0
- package/dist/os/mission/lockfile.js.map +1 -1
- package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
- package/dist/os/rfc/handlers/list-create.js +25 -3
- package/dist/os/rfc/handlers/list-create.js.map +1 -1
- package/dist/os/rfc/types.d.ts +9 -2
- package/dist/os/rfc/types.d.ts.map +1 -1
- package/dist/os/rfc/types.js +2 -2
- package/dist/os/rfc/types.js.map +1 -1
- package/dist/os/system/handlers/system-task-collect.d.ts.map +1 -1
- package/dist/os/system/handlers/system-task-collect.js +11 -5
- package/dist/os/system/handlers/system-task-collect.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
- package/dist/src/onboarding/prettierignore.js +2 -0
- package/dist/src/onboarding/prettierignore.js.map +1 -1
- package/os/flow/dirty-classify.ts +8 -0
- package/os/flow/flow.module.ts +29 -2
- package/os/flow/handlers/flow-cut.ts +28 -11
- package/os/flow/handlers/flow-integrate.ts +177 -50
- package/os/flow/handlers/flow-peers.ts +142 -0
- package/os/flow/index.ts +5 -1
- package/os/flow/ops-registry.ts +194 -0
- package/os/flow/preflight.ts +262 -51
- package/os/flow/standalone-invoke.ts +85 -0
- package/os/flow/tests/dirty-classify.test.ts +139 -4
- package/os/flow/tests/flow-cut.test.ts +21 -0
- package/os/flow/tests/flow-integrate.preflight.test.ts +8 -4
- package/os/flow/tests/flow-integrate.test.ts +366 -16
- package/os/flow/tests/ops-registry.test.ts +136 -0
- package/os/mission/handlers/archive.ts +22 -14
- package/os/mission/importer-block.ts +119 -0
- package/os/mission/lockfile.ts +41 -0
- package/os/rfc/handlers/list-create.test.ts +44 -0
- package/os/rfc/handlers/list-create.ts +30 -3
- package/os/rfc/types.ts +5 -2
- package/os/system/handlers/system-task-collect.ts +11 -5
- package/os/system/tests/system-task-collect.test.ts +16 -0
- package/package.json +1 -1
- package/skills/fo/fo-session-retro/SKILL.md +9 -3
- package/src/onboarding/prettierignore.ts +2 -0
- package/src/tests/prettierignore-manage.test.ts +11 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Text-splice primitives for a single importer subtree inside
|
|
4
|
+
pnpm-lock.yaml (RFC-1544). A mission workpiece registers as the importer key
|
|
5
|
+
`missions/<id>/workpiece:` at the fixed two-space indent under `importers:`;
|
|
6
|
+
both consumers — flow.integrate's foreign-open-mission restore and
|
|
7
|
+
mission.archive's bookkeeping prune — must move exactly that key's block and
|
|
8
|
+
nothing else, so a whole-file checkout or a YAML round-trip (which rewrites
|
|
9
|
+
unrelated formatting) is never the mechanism.</purpose>
|
|
10
|
+
<non-goals>
|
|
11
|
+
<item>No YAML semantics — block boundaries are indent arithmetic on the pnpm-lock layout, not a parse.</item>
|
|
12
|
+
<item>No git/file I/O — pure string transforms; callers own reads and writes.</item>
|
|
13
|
+
</non-goals>
|
|
14
|
+
</MODULE_CONTRACT>
|
|
15
|
+
<CHANGE_SUMMARY>
|
|
16
|
+
<item>RFC-1544: importer-block extract/insert/remove text splices shared by flow.integrate restore and mission.archive prune</item>
|
|
17
|
+
<item>RFC-1544: attribute mission lockfile churn to owning checkout and auto-resolve foreign importer diffs (RFC-1544)</item>
|
|
18
|
+
</CHANGE_SUMMARY>
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const IMPORTER_INDENT = 2;
|
|
22
|
+
|
|
23
|
+
function indentOf(line: string): number {
|
|
24
|
+
return line.length - line.trimStart().length;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Locate ` <key>:` at the importer indent — exact key, no prefix bleed. */
|
|
28
|
+
function importerKeyIndex(lines: string[], key: string): number {
|
|
29
|
+
const wanted = `${" ".repeat(IMPORTER_INDENT)}${key}:`;
|
|
30
|
+
return lines.findIndex((l) => l.trimEnd() === wanted);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The importer block lines for `key` inside lockfile `text`: the key line
|
|
35
|
+
* plus every deeper-indented member, trailing blanks excluded. Null when the
|
|
36
|
+
* key is absent.
|
|
37
|
+
*/
|
|
38
|
+
export function extractImporterBlock(text: string, key: string): string[] | null {
|
|
39
|
+
const lines = text.split("\n");
|
|
40
|
+
const start = importerKeyIndex(lines, key);
|
|
41
|
+
if (start === -1) return null;
|
|
42
|
+
let end = start + 1;
|
|
43
|
+
while (end < lines.length) {
|
|
44
|
+
const l = lines[end];
|
|
45
|
+
if (l.trim().length === 0) {
|
|
46
|
+
end += 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (indentOf(l) <= IMPORTER_INDENT) break;
|
|
50
|
+
end += 1;
|
|
51
|
+
}
|
|
52
|
+
while (end > start + 1 && lines[end - 1].trim().length === 0) end -= 1;
|
|
53
|
+
return lines.slice(start, end);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* `text` without `key`'s importer block — the block plus its separating
|
|
58
|
+
* blank line(s), so removal leaves the surrounding layout intact. Returns
|
|
59
|
+
* the input unchanged when the key is absent.
|
|
60
|
+
*/
|
|
61
|
+
export function removeImporterBlock(text: string, key: string): string {
|
|
62
|
+
const lines = text.split("\n");
|
|
63
|
+
const start = importerKeyIndex(lines, key);
|
|
64
|
+
if (start === -1) return text;
|
|
65
|
+
let end = start + 1;
|
|
66
|
+
while (end < lines.length) {
|
|
67
|
+
const l = lines[end];
|
|
68
|
+
if (l.trim().length === 0) {
|
|
69
|
+
end += 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (indentOf(l) <= IMPORTER_INDENT) break;
|
|
73
|
+
end += 1;
|
|
74
|
+
}
|
|
75
|
+
// Also absorb the blank separator BEFORE the block when one exists —
|
|
76
|
+
// pnpm separates importer stanzas with a single blank line.
|
|
77
|
+
let s = start;
|
|
78
|
+
if (s > 0 && lines[s - 1].trim().length === 0) s -= 1;
|
|
79
|
+
const out = [...lines.slice(0, s), ...lines.slice(end)];
|
|
80
|
+
// Collapse a doubled blank left at the seam when both sides kept one.
|
|
81
|
+
return out.join("\n").replace(/\n{3,}/g, "\n\n");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* `text` with `block` inserted under `importers:` at pnpm's alphabetical
|
|
86
|
+
* position — before the first importer key sorting after `key`, else at the
|
|
87
|
+
* end of the importers section. Null when no `importers:` section exists.
|
|
88
|
+
*/
|
|
89
|
+
export function insertImporterBlock(text: string, key: string, block: string[]): string | null {
|
|
90
|
+
const lines = text.split("\n");
|
|
91
|
+
const importersIdx = lines.findIndex((l) => l.trimEnd() === "importers:");
|
|
92
|
+
if (importersIdx === -1) return null;
|
|
93
|
+
// Section end: first non-blank line with indent < 2 (or EOF).
|
|
94
|
+
let sectionEnd = lines.length;
|
|
95
|
+
for (let i = importersIdx + 1; i < lines.length; i += 1) {
|
|
96
|
+
const l = lines[i];
|
|
97
|
+
if (l.trim().length === 0) continue;
|
|
98
|
+
if (indentOf(l) < IMPORTER_INDENT) {
|
|
99
|
+
sectionEnd = i;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// First importer key sorting after ours — mid-section insert.
|
|
104
|
+
for (let i = importersIdx + 1; i < sectionEnd; i += 1) {
|
|
105
|
+
const l = lines[i];
|
|
106
|
+
if (l.trim().length === 0 || indentOf(l) !== IMPORTER_INDENT) continue;
|
|
107
|
+
const other = l.trim().replace(/:$/, "");
|
|
108
|
+
if (other > key) {
|
|
109
|
+
return [...lines.slice(0, i), ...block, "", ...lines.slice(i)].join("\n");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// End-of-section insert: splice before the trailing blank run when one
|
|
113
|
+
// exists (it already separates the last block from the next section).
|
|
114
|
+
let at = sectionEnd;
|
|
115
|
+
while (at > importersIdx + 1 && lines[at - 1].trim().length === 0) at -= 1;
|
|
116
|
+
const hadTrailingBlanks = at < sectionEnd;
|
|
117
|
+
const payload = ["", ...block, ...(hadTrailingBlanks ? [] : [""])];
|
|
118
|
+
return [...lines.slice(0, at), ...payload, ...lines.slice(at)].join("\n");
|
|
119
|
+
}
|
package/os/mission/lockfile.ts
CHANGED
|
@@ -16,12 +16,14 @@ restores the file committed at HEAD so the worktree returns clean.
|
|
|
16
16
|
<item>RFC-1505: steps 3-5 — tracked lockfile restore, no side-effect commits</item>
|
|
17
17
|
<item>RFC-1505: review r1 — durable projections and lockfile restore hardening</item>
|
|
18
18
|
<item>RFC-1505: review r2 — clone-only sternsystem enumeration and mission-gated lockfile net</item>
|
|
19
|
+
<item>RFC-1544: attribute mission lockfile churn to owning checkout and auto-resolve foreign importer diffs (RFC-1544)</item>
|
|
19
20
|
</CHANGE_SUMMARY>
|
|
20
21
|
*/
|
|
21
22
|
|
|
22
23
|
import path from "node:path";
|
|
23
24
|
import { execFileSync } from "../../src/utils/sync-fs.ts";
|
|
24
25
|
import type { ExecOptions, ExecResult, WorkspaceIO } from "../../src/types.ts";
|
|
26
|
+
import { extractImporterBlock, removeImporterBlock } from "./importer-block.ts";
|
|
25
27
|
|
|
26
28
|
const LOCKFILE_NAME = "pnpm-lock.yaml";
|
|
27
29
|
|
|
@@ -82,3 +84,42 @@ export function execFileSyncAdapter(): Pick<WorkspaceIO, "exec"> {
|
|
|
82
84
|
},
|
|
83
85
|
};
|
|
84
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* RFC-1544 AC-5: drop the listed missions' `missions/<id>/workpiece`
|
|
90
|
+
* importer subtrees from the tracked `pnpm-lock.yaml` and stage the result
|
|
91
|
+
* for the archive bookkeeping commit. The written bytes are HEAD-minus-
|
|
92
|
+
* importers — the post-archive `pnpm install` may churn unrelated lockfile
|
|
93
|
+
* state, and only the importer removal is legitimate tracked change, so
|
|
94
|
+
* everything else is discarded exactly like `restoreTrackedLockfile` did.
|
|
95
|
+
*
|
|
96
|
+
* Returns `pruned` = mission ids whose importer block was actually removed;
|
|
97
|
+
* `staged` = whether `pnpm-lock.yaml` reached the index. When no listed
|
|
98
|
+
* importer exists at HEAD the tracked file is restored instead (the old
|
|
99
|
+
* churn-discard behavior) and `staged` stays false.
|
|
100
|
+
*/
|
|
101
|
+
export async function pruneMissionImportersFromLockfile(
|
|
102
|
+
root: string,
|
|
103
|
+
missionIds: string[],
|
|
104
|
+
io: Pick<WorkspaceIO, "exec" | "writeFile">,
|
|
105
|
+
): Promise<{ pruned: string[]; staged: boolean }> {
|
|
106
|
+
const head = await io.exec("git", ["show", `HEAD:${LOCKFILE_NAME}`], { cwd: root });
|
|
107
|
+
if (head.exitCode !== 0) return { pruned: [], staged: false };
|
|
108
|
+
let next = head.stdout;
|
|
109
|
+
const pruned: string[] = [];
|
|
110
|
+
for (const missionId of missionIds) {
|
|
111
|
+
const key = `missions/${missionId}/workpiece`;
|
|
112
|
+
if (extractImporterBlock(next, key) === null) continue;
|
|
113
|
+
next = removeImporterBlock(next, key);
|
|
114
|
+
pruned.push(missionId);
|
|
115
|
+
}
|
|
116
|
+
const target = path.join(root, LOCKFILE_NAME);
|
|
117
|
+
if (pruned.length === 0) {
|
|
118
|
+
// Nothing legitimately prunes — keep the discard-churn restore.
|
|
119
|
+
await io.writeFile(target, head.stdout);
|
|
120
|
+
return { pruned, staged: false };
|
|
121
|
+
}
|
|
122
|
+
await io.writeFile(target, next);
|
|
123
|
+
const add = await io.exec("git", ["add", LOCKFILE_NAME], { cwd: root });
|
|
124
|
+
return { pruned, staged: add.exitCode === 0 };
|
|
125
|
+
}
|
|
@@ -16,6 +16,7 @@ with candidates listed.
|
|
|
16
16
|
<item>RFC-1482: extract-safe RFC-1482 template path + changelog for 9.1.0</item>
|
|
17
17
|
<item>RFC-1514: attach corrected invocations to blocking diagnostics so retry is one-shot</item>
|
|
18
18
|
<item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
|
|
19
|
+
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
19
20
|
</CHANGE_SUMMARY>
|
|
20
21
|
*/
|
|
21
22
|
|
|
@@ -303,3 +304,46 @@ describe("RFC-1534 rfc.create --amends counterpart", () => {
|
|
|
303
304
|
expect(result.data?.amendsSync).toEqual({ amended: "RFC-1201", wroteCounterpart: false });
|
|
304
305
|
});
|
|
305
306
|
});
|
|
307
|
+
|
|
308
|
+
describe("RFC-1546 AC-2: commands.* frontmatter regenerates the manifest", () => {
|
|
309
|
+
beforeEach(async () => {
|
|
310
|
+
await seed();
|
|
311
|
+
});
|
|
312
|
+
afterEach(async () => {
|
|
313
|
+
await rm(root, { recursive: true, force: true });
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
test("--proposed invokes ecosystem.manifest.generate after the write", async () => {
|
|
317
|
+
const invoked: string[] = [];
|
|
318
|
+
const result = await runRfcCreate(
|
|
319
|
+
{ flags: flags({ title: "Tame the registry loader", proposed: "foo.bar" }) } as never,
|
|
320
|
+
{
|
|
321
|
+
...context(),
|
|
322
|
+
invoke: async (name: string) => {
|
|
323
|
+
invoked.push(name);
|
|
324
|
+
return { ok: true, exitCode: 0 };
|
|
325
|
+
},
|
|
326
|
+
} as never,
|
|
327
|
+
);
|
|
328
|
+
expect(result.data?.status).toBe("ok");
|
|
329
|
+
expect(invoked).toEqual(["ecosystem.manifest.generate"]);
|
|
330
|
+
expect(result.data?.manifestRegen).toMatchObject({ invoked: true, ok: true });
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
test("no commands.* seeds — the generator is never invoked", async () => {
|
|
334
|
+
const invoked: string[] = [];
|
|
335
|
+
const result = await runRfcCreate(
|
|
336
|
+
{ flags: flags({ title: "Tame the registry loader" }) } as never,
|
|
337
|
+
{
|
|
338
|
+
...context(),
|
|
339
|
+
invoke: async (name: string) => {
|
|
340
|
+
invoked.push(name);
|
|
341
|
+
return { ok: true, exitCode: 0 };
|
|
342
|
+
},
|
|
343
|
+
} as never,
|
|
344
|
+
);
|
|
345
|
+
expect(result.data?.status).toBe("ok");
|
|
346
|
+
expect(invoked).toEqual([]);
|
|
347
|
+
expect(result.data?.manifestRegen).toBeUndefined();
|
|
348
|
+
});
|
|
349
|
+
});
|
|
@@ -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
|
-
<
|
|
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: [
|
package/os/rfc/types.ts
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* </non-goals>
|
|
13
13
|
* </MODULE_CONTRACT>
|
|
14
14
|
* * <CHANGE_SUMMARY>
|
|
15
|
-
<item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
|
|
16
15
|
<item>RFC-1516: bind evidence reuse to the oldest replayed result and harden committed-envelope reads for rfc-1516</item>
|
|
17
16
|
<item>RFC-1514: attach corrected invocations to blocking diagnostics so retry is one-shot</item>
|
|
18
17
|
<item>RFC-1536: owning-checkout routing, FLOW-OPEN-01 dirty-primary warning, shared governance-id allocation (RFC+ADR)</item>
|
|
19
18
|
<item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
|
|
20
|
-
<
|
|
19
|
+
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
20
|
+
<history>RFC-0465, RFC-0478, RFC-0480, RFC-0795, RFC-0998, RFC-0999, RFC-1097, RFC-1249, RFC-1271, RFC-1306, RFC-1310, RFC-1320, RFC-1322, RFC-1330, RFC-1333, RFC-1334, RFC-1336, RFC-1364, RFC-1383, RFC-1391, RFC-1401, RFC-1445, RFC-1453, RFC-1454, RFC-1455, RFC-1458, RFC-1467, RFC-1483, RFC-1516</history>
|
|
21
21
|
</CHANGE_SUMMARY>
|
|
22
22
|
***************************************************************/
|
|
23
23
|
|
|
@@ -641,6 +641,9 @@ export interface RfcCreateResult {
|
|
|
641
641
|
/** RFC-1534: --amends counterpart outcome — wroteCounterpart false means
|
|
642
642
|
* the amended file was missing/unreadable and V-19 still applies. */
|
|
643
643
|
amendsSync?: { amended: string; wroteCounterpart: boolean };
|
|
644
|
+
/** RFC-1546: ecosystem.manifest.generate outcome when commands.* seeds were
|
|
645
|
+
* written — invoked false means the kernel invoke port was unavailable. */
|
|
646
|
+
manifestRegen?: { invoked: boolean; ok: boolean; summary?: string };
|
|
644
647
|
}
|
|
645
648
|
|
|
646
649
|
export interface RfcNextIdResult {
|
|
@@ -19,6 +19,7 @@ sha — never from report commit ids. One call may apply dispatched → reported
|
|
|
19
19
|
<item>RFC-1509: implement RFC-1509 — system task queue, dispatch briefs and task reports</item>
|
|
20
20
|
<item>RFC-1509: close RFC-1509 review r1 findings — mark-failed escape, open-error refusal, dry-run coverage</item>
|
|
21
21
|
<item>RFC-1509: address RFC-1509 review r2 — mark-failed without product, journal-read warning, status map diagnostics, V-49 deviations</item>
|
|
22
|
+
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
22
23
|
</CHANGE_SUMMARY>
|
|
23
24
|
*/
|
|
24
25
|
|
|
@@ -290,11 +291,16 @@ export async function runSystemTaskCollect(
|
|
|
290
291
|
},
|
|
291
292
|
exitCode: errors > 0 ? 1 : 0,
|
|
292
293
|
summary:
|
|
293
|
-
|
|
294
|
-
? `system.task.collect refused
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
294
|
+
errors > 0
|
|
295
|
+
? `system.task.collect refused — ${diagnostics
|
|
296
|
+
.filter((d) => d.severity === "error")
|
|
297
|
+
.map((d) => `${d.ruleId}: ${d.message}`)
|
|
298
|
+
.join("; ")}`
|
|
299
|
+
: task === null
|
|
300
|
+
? "system.task.collect refused (0 error(s))"
|
|
301
|
+
: dryRun
|
|
302
|
+
? `system.task.collect would process ${task.id} (state ${task.state})`
|
|
303
|
+
: `system.task.collect: ${task.id} is now ${task.state}${task.integratedCommit ? ` (integrated ${task.integratedCommit.slice(0, 9)})` : ""}`,
|
|
298
304
|
nextSteps:
|
|
299
305
|
task?.state === "reported"
|
|
300
306
|
? [{ action: "integrate the product branch, then re-run system.task.collect", kind: "optional" }]
|
|
@@ -10,6 +10,7 @@ reported→integrated, and --mark-failed.</purpose>
|
|
|
10
10
|
<item>RFC-1509: implement RFC-1509 — system task queue, dispatch briefs and task reports</item>
|
|
11
11
|
<item>RFC-1509: close RFC-1509 review r1 findings — mark-failed escape, open-error refusal, dry-run coverage</item>
|
|
12
12
|
<item>RFC-1509: address RFC-1509 review r2 — mark-failed without product, journal-read warning, status map diagnostics, V-49 deviations</item>
|
|
13
|
+
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
13
14
|
</CHANGE_SUMMARY>
|
|
14
15
|
*/
|
|
15
16
|
|
|
@@ -265,6 +266,21 @@ describe("system.task.collect", () => {
|
|
|
265
266
|
expect(result.exitCode).toBe(1);
|
|
266
267
|
expect(result.data?.diagnostics.some((d) => d.ruleId === "SYSTEM-TASK-02")).toBe(true);
|
|
267
268
|
});
|
|
269
|
+
|
|
270
|
+
it("RFC-1546 AC-5: a refusal's text summary names the ruleId and message", async () => {
|
|
271
|
+
const productRoot = await makeProduct();
|
|
272
|
+
const systemRoot = await makeSystemRepo({
|
|
273
|
+
"system/system.yaml": VALID_SYSTEM_YAML,
|
|
274
|
+
"system/products.yaml": VALID_PRODUCTS_YAML,
|
|
275
|
+
"system/edges.yaml": VALID_EDGES_YAML,
|
|
276
|
+
"system/products.local.yaml": localMapFor({ alpha: productRoot }),
|
|
277
|
+
"queue/tasks/T-0001.yaml": taskYaml({ state: "ready" }),
|
|
278
|
+
});
|
|
279
|
+
const result = await runSystemTaskCollect(input({ task: "T-0001" }), makeContext(systemRoot));
|
|
280
|
+
expect(result.exitCode).toBe(1);
|
|
281
|
+
expect(result.summary).toContain("SYSTEM-TASK-02");
|
|
282
|
+
expect(result.summary).toContain("T-0001 is ready");
|
|
283
|
+
});
|
|
268
284
|
});
|
|
269
285
|
|
|
270
286
|
async function SystemCollect(systemRoot: string) {
|
package/package.json
CHANGED
|
@@ -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
23
|
<item>RFC-1528: worktree-first preamble — session-end writes go through a dedicated session worktree; docs.archive prefers the kernel host</item>
|
|
25
24
|
<item>RFC-1531: add flow.integrate remediation flags on the shared dirty classifier</item>
|
|
26
25
|
<item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
|
|
27
26
|
<item>ADR-0126: docs-rule batch — 16 friction measures landed</item>
|
|
28
|
-
<
|
|
27
|
+
<item>RFC-1460: draft mechanical-obligation RFCs and land harvest doc rules
|
|
28
|
+
|
|
29
|
+
RFC-1460 harvest wave 2026-11-09: five draft RFCs (derive-and-repair flow
|
|
30
|
+
surfaces, quiet kernel output, staged-commit/invocation guards, fixed-branch
|
|
31
|
+
onboarding-status routing, forge task prettier coverage), seven docs-rule
|
|
32
|
+
landings, registry flips — 25 entries served, F-0025 stays external.</item>
|
|
33
|
+
<history>ADR-0119, ADR-0121, RFC-1097, RFC-1247, RFC-1433, RFC-1460, RFC-1487, RFC-1491</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>`.
|
|
@@ -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");
|