@warpgogol/forge 9.6.0 → 9.6.2
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 +28 -0
- package/README.md +161 -104
- package/README.uk.md +175 -117
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +58 -5
- package/dist/os/core/core.module.js.map +1 -1
- package/dist/os/core/handlers/package-health.d.ts.map +1 -1
- package/dist/os/core/handlers/package-health.js +95 -8
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/os/flow/handlers/flow-cut.d.ts.map +1 -1
- package/dist/os/flow/handlers/flow-cut.js +27 -6
- package/dist/os/flow/handlers/flow-cut.js.map +1 -1
- package/dist/os/rfc/rfc.module.d.ts.map +1 -1
- package/dist/os/rfc/rfc.module.js +7 -3
- package/dist/os/rfc/rfc.module.js.map +1 -1
- package/dist/src/onboarding/scaffold-project.d.ts.map +1 -1
- package/dist/src/onboarding/scaffold-project.js +21 -2
- package/dist/src/onboarding/scaffold-project.js.map +1 -1
- package/dist/src/validators/skill-doc-sync.d.ts +76 -0
- package/dist/src/validators/skill-doc-sync.d.ts.map +1 -0
- package/dist/src/validators/skill-doc-sync.js +333 -0
- package/dist/src/validators/skill-doc-sync.js.map +1 -0
- package/docs/concepts/governance-model.md +9 -1
- package/docs/concepts/verification-model.md +31 -0
- package/docs/guides/existing-project.md +12 -0
- package/docs/guides/skills.md +27 -8
- package/docs/guides/upgrading.md +6 -2
- package/docs/guides/verification-and-evidence.md +45 -0
- package/docs/integrations/devin.md +49 -0
- package/docs/reference/cli.md +12 -1
- package/docs/reference/fleet-measurement.md +52 -0
- package/docs/reference/programmatic-api.md +62 -33
- package/os/core/core.module.ts +70 -11
- package/os/core/handlers/package-health.test.ts +104 -23
- package/os/core/handlers/package-health.ts +133 -19
- package/os/flow/handlers/flow-cut.ts +27 -6
- package/os/flow/tests/flow-cut.rerun.test.ts +54 -4
- package/os/rfc/rfc.module.ts +7 -3
- package/package.json +1 -1
- package/profiles/forge-shell.yaml +1 -0
- package/profiles/godot-game.yaml +1 -0
- package/profiles/phaser-game.yaml +1 -0
- package/profiles/site-workshop.yaml +1 -0
- package/profiles/system.yaml +1 -0
- package/profiles/typescript.yaml +1 -0
- package/skills/fo/fo-session-retro/SKILL.md +6 -4
- package/src/onboarding/scaffold-project.ts +19 -2
- package/src/tests/skill-doc-sync.test.ts +233 -0
- package/src/validators/skill-doc-sync.ts +449 -0
|
@@ -15,13 +15,26 @@
|
|
|
15
15
|
<item>Module attribution is provider-aware: deriveModulePackageMap returns separate workshop/site maps because module names collide across buckets (deploy is engine() AND sitePlugin()), and each command resolves through the map matching its manifest siteScope — a flat last-write-wins map silently misattributed the engine deploy.* family to the private site package (RFC-1518 r2, deviation D-004).</item>
|
|
16
16
|
</KEY_DECISIONS>
|
|
17
17
|
<CHANGE_SUMMARY>
|
|
18
|
-
<item>RFC-1518: attribution merge, private-package docs gate, suppression journal</item>
|
|
19
18
|
<item>RFC-1518: key decision for private-package docs-gate scope</item>
|
|
20
19
|
<item>RFC-1518: provider-aware module attribution, per-rule markers, tld-tail scoping</item>
|
|
21
20
|
<item>RFC-1518: key decision for provider-aware attribution</item>
|
|
22
21
|
<item>ADR-0131: pkg-health-10 suppression on the line above the literal
|
|
23
22
|
|
|
24
23
|
literalEscapesInLine accepts a // pkg-health-10: comment directly above the literal (one-line reach); the publish at-ref scan fetches that line via git show only for candidate lines; bin/cli.ts drops its prettier-ignore lines.</item>
|
|
24
|
+
<item>RFC-1585: review wave — write-path corruptions, --check flag, scaffold hydration
|
|
25
|
+
|
|
26
|
+
Independent fo-review (isolation: subagent) found: empty marker pairs lost
|
|
27
|
+
their open tag on --write, multi-line regions collapsed line numbers, a
|
|
28
|
+
leading fence injected a phantom line, --check was undocumented-undeclared,
|
|
29
|
+
and --write exited 1 on a successful heal. Fixes: open-marker capture,
|
|
30
|
+
newline-preserving placeholder, empty-chunk skip, check flag, healedRegions
|
|
31
|
+
split (write always exits 0), dryRun/io threading, byte-exact inventory
|
|
32
|
+
compare on the prettier-stable canonical form, CHECK-13 delegated through
|
|
33
|
+
commandRegistry/invoke so the registry-integrity scan stays within its
|
|
34
|
+
slice cap (KNOWN_TRUNCATED_SCANS is shrink-only), record-tree exclusions
|
|
35
|
+
extended, two real stale claims corrected, profile templates ship empty
|
|
36
|
+
markers hydrated at scaffold write time. RFC amended to implemented
|
|
37
|
+
grammar/result/exclusions; command moved to commands.added.</item>
|
|
25
38
|
<history>PKG-HEALTH-05, RFC-1097, RFC-1254, RFC-1255, RFC-1517, RFC-1518</history>
|
|
26
39
|
</CHANGE_SUMMARY>
|
|
27
40
|
*/
|
|
@@ -29,6 +42,7 @@ literalEscapesInLine accepts a // pkg-health-10: comment directly above the lite
|
|
|
29
42
|
import * as fs from "../../../src/utils/sync-fs.ts";
|
|
30
43
|
import path from "node:path";
|
|
31
44
|
import { parse as parseYaml } from "yaml";
|
|
45
|
+
import type { SkillDocDrift } from "../../../src/validators/skill-doc-sync.ts";
|
|
32
46
|
import type {
|
|
33
47
|
ForgeCommandInput,
|
|
34
48
|
ForgeCommandResult,
|
|
@@ -92,7 +106,14 @@ export interface HealthScanConfig {
|
|
|
92
106
|
}
|
|
93
107
|
|
|
94
108
|
const DEFAULT_KEY_SEGMENTS = [".input/signing-key", ".input/batches"];
|
|
95
|
-
const BASE_IGNORE_DIRS = new Set([
|
|
109
|
+
const BASE_IGNORE_DIRS = new Set([
|
|
110
|
+
"node_modules",
|
|
111
|
+
".turbo",
|
|
112
|
+
"dist",
|
|
113
|
+
".env",
|
|
114
|
+
".DS_Store",
|
|
115
|
+
"Thumbs.db",
|
|
116
|
+
]);
|
|
96
117
|
const IGNORE_FILES = new Set([
|
|
97
118
|
".env",
|
|
98
119
|
".env.local",
|
|
@@ -348,7 +369,13 @@ export function scanDocsSurface(
|
|
|
348
369
|
// (warpgogol.com) or TLD-shaped property paths (context.io); a 3+
|
|
349
370
|
// segment token under a registered namespace (deploy.smoke.run after
|
|
350
371
|
// removal) stays a dead-reference candidate — never TLD-exempt.
|
|
351
|
-
.filter(
|
|
372
|
+
.filter(
|
|
373
|
+
(t) =>
|
|
374
|
+
!registeredCommands ||
|
|
375
|
+
registeredCommands.has(t) ||
|
|
376
|
+
t.split(".").length > 2 ||
|
|
377
|
+
!DOC_TLD_TAIL_RE.test(t),
|
|
378
|
+
);
|
|
352
379
|
const s11 = line.match(DOC_SUPPRESS_11_RE);
|
|
353
380
|
const s12 = line.match(DOC_SUPPRESS_12_RE);
|
|
354
381
|
// A marker with an empty reason does not suppress — an exemption needs
|
|
@@ -359,14 +386,26 @@ export function scanDocsSurface(
|
|
|
359
386
|
const m12 = s12 ? reason(s12) || null : null;
|
|
360
387
|
for (const token of tokens) {
|
|
361
388
|
if (m11) {
|
|
362
|
-
const entry = {
|
|
389
|
+
const entry = {
|
|
390
|
+
ruleId: "PKG-HEALTH-11" as const,
|
|
391
|
+
file: rel,
|
|
392
|
+
line: i + 1,
|
|
393
|
+
token,
|
|
394
|
+
reason: m11,
|
|
395
|
+
};
|
|
363
396
|
suppressed11.set(token, entry);
|
|
364
397
|
suppressions.push(entry);
|
|
365
398
|
} else {
|
|
366
399
|
documented.add(token);
|
|
367
400
|
}
|
|
368
401
|
if (m12) {
|
|
369
|
-
suppressions.push({
|
|
402
|
+
suppressions.push({
|
|
403
|
+
ruleId: "PKG-HEALTH-12",
|
|
404
|
+
file: rel,
|
|
405
|
+
line: i + 1,
|
|
406
|
+
token,
|
|
407
|
+
reason: m12,
|
|
408
|
+
});
|
|
370
409
|
documented.add(token);
|
|
371
410
|
} else if (!refs.has(token)) {
|
|
372
411
|
refs.set(token, { file: rel, line: i + 1 });
|
|
@@ -386,13 +425,27 @@ export function scanDocsSurface(
|
|
|
386
425
|
* buckets (deploy is both engine() and sitePlugin()) and commands attribute
|
|
387
426
|
* through the map matching their siteScope.
|
|
388
427
|
*/
|
|
389
|
-
export function deriveModulePackageMap(workspaceRoot: string): {
|
|
428
|
+
export function deriveModulePackageMap(workspaceRoot: string): {
|
|
429
|
+
workshop: Map<string, string>;
|
|
430
|
+
site: Map<string, string>;
|
|
431
|
+
} {
|
|
390
432
|
const out = new Map<string, string>();
|
|
391
433
|
const site = new Map<string, string>();
|
|
392
|
-
const mmPath = path.join(
|
|
434
|
+
const mmPath = path.join(
|
|
435
|
+
workspaceRoot,
|
|
436
|
+
"packages",
|
|
437
|
+
"werkstatt-engine",
|
|
438
|
+
"src",
|
|
439
|
+
"kernel",
|
|
440
|
+
"module-map.ts",
|
|
441
|
+
);
|
|
393
442
|
try {
|
|
394
443
|
const mm = fs.readFileSync(mmPath, "utf8");
|
|
395
|
-
const bucketToConst: Record<string, string> = {
|
|
444
|
+
const bucketToConst: Record<string, string> = {
|
|
445
|
+
engine: "ENGINE",
|
|
446
|
+
sitePlugin: "SITE",
|
|
447
|
+
forge: "FORGE",
|
|
448
|
+
};
|
|
396
449
|
const constToSpec: Record<string, string> = {};
|
|
397
450
|
for (const m of mm.matchAll(/const (\w+) = "(@warpgogol\/[^"]+)"/g)) constToSpec[m[1]!] = m[2]!;
|
|
398
451
|
for (const m of mm.matchAll(/["']?([\w-]+)["']?:\s*(engine|sitePlugin|forge)\(/g)) {
|
|
@@ -407,7 +460,9 @@ export function deriveModulePackageMap(workspaceRoot: string): { workshop: Map<s
|
|
|
407
460
|
const kcPath = path.join(workspaceRoot, "tools", "kernel.config.ts");
|
|
408
461
|
try {
|
|
409
462
|
const kc = fs.readFileSync(kcPath, "utf8");
|
|
410
|
-
for (const m of kc.matchAll(
|
|
463
|
+
for (const m of kc.matchAll(
|
|
464
|
+
/["']?(\w[\w-]*)["']?:\s*async[^=]*=>[^;]*?import\("(@warpgogol\/[^"]+)"/g,
|
|
465
|
+
)) {
|
|
411
466
|
out.set(m[1]!, `packages/${m[2]!.split("/")[1]}`);
|
|
412
467
|
}
|
|
413
468
|
} catch {
|
|
@@ -426,14 +481,21 @@ export function deriveModulePackageMap(workspaceRoot: string): { workshop: Map<s
|
|
|
426
481
|
*/
|
|
427
482
|
export function loadCommandInventory(
|
|
428
483
|
workspaceRoot: string,
|
|
429
|
-
commandRegistry?: {
|
|
484
|
+
commandRegistry?: {
|
|
485
|
+
listCommands(): Array<{ name: string; module?: string; siteScope?: boolean }>;
|
|
486
|
+
},
|
|
430
487
|
): Array<{ name: string; module?: string; siteScope?: boolean }> {
|
|
431
488
|
const byName = new Map<string, { name: string; module?: string; siteScope?: boolean }>();
|
|
432
489
|
const manifestPath = path.join(workspaceRoot, "docs", "command-manifest.generated.yaml");
|
|
433
490
|
try {
|
|
434
491
|
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
435
492
|
const parsed = parseYaml(raw) as {
|
|
436
|
-
commands?: Array<{
|
|
493
|
+
commands?: Array<{
|
|
494
|
+
name?: unknown;
|
|
495
|
+
module?: unknown;
|
|
496
|
+
siteScope?: unknown;
|
|
497
|
+
providers?: unknown;
|
|
498
|
+
}>;
|
|
437
499
|
} | null;
|
|
438
500
|
for (const c of parsed?.commands ?? []) {
|
|
439
501
|
if (typeof c.name === "string" && c.name.length > 0) {
|
|
@@ -492,10 +554,7 @@ export function isShippedEntry(
|
|
|
492
554
|
* repo-extract's `cp` filter; a realpath-set bounds link cycles. Never a
|
|
493
555
|
* hand-maintained file list.
|
|
494
556
|
*/
|
|
495
|
-
export function deriveShippedFiles(
|
|
496
|
-
projectRoot: string,
|
|
497
|
-
extractConfigRaw: string | null,
|
|
498
|
-
): string[] {
|
|
557
|
+
export function deriveShippedFiles(projectRoot: string, extractConfigRaw: string | null): string[] {
|
|
499
558
|
const cfg = parseHealthScanConfig(extractConfigRaw);
|
|
500
559
|
const root = path.resolve(projectRoot);
|
|
501
560
|
const shipped: string[] = [];
|
|
@@ -766,7 +825,9 @@ export async function runPackageHealth(
|
|
|
766
825
|
(pkgCommands.get(pkg) ?? pkgCommands.set(pkg, []).get(pkg)!).push(c.name);
|
|
767
826
|
}
|
|
768
827
|
|
|
769
|
-
const entries = fs
|
|
828
|
+
const entries = fs
|
|
829
|
+
.readdirSync(packagesDir, { withFileTypes: true })
|
|
830
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
770
831
|
for (const entry of entries) {
|
|
771
832
|
if (!entry.isDirectory()) continue;
|
|
772
833
|
if (entry.name.startsWith(".")) continue;
|
|
@@ -822,6 +883,54 @@ export async function runPackageHealth(
|
|
|
822
883
|
}
|
|
823
884
|
}
|
|
824
885
|
|
|
886
|
+
// RFC-1585 CHECK 13 — skill-count claims and <!-- forge:skills-* -->
|
|
887
|
+
// marked regions drifted from FORGE_SKILLS. Runs outside the command-
|
|
888
|
+
// inventory gate: the lint needs no command list. Delegated through the
|
|
889
|
+
// registry (standalone CLI) or the invoke port (kernel host — `werkstatt
|
|
890
|
+
// run` injects no commandRegistry) so the child is judged by its own
|
|
891
|
+
// declaration; an in-handler descent into the doc-sync subtree truncates
|
|
892
|
+
// the registry-integrity scan.
|
|
893
|
+
{
|
|
894
|
+
const docSyncCmd = context.commandRegistry?.getCommand("forge.skill.doc-sync");
|
|
895
|
+
let docSync: { drift?: SkillDocDrift[] } | undefined;
|
|
896
|
+
if (docSyncCmd) {
|
|
897
|
+
const r = await docSyncCmd.execute(
|
|
898
|
+
{ argv: [], flags: { check: true, root: pkgDir } },
|
|
899
|
+
context,
|
|
900
|
+
);
|
|
901
|
+
docSync = r?.data as { drift?: SkillDocDrift[] } | undefined;
|
|
902
|
+
} else if (context.invoke) {
|
|
903
|
+
const r = await context.invoke("forge.skill.doc-sync", {
|
|
904
|
+
check: true,
|
|
905
|
+
root: pkgDir,
|
|
906
|
+
});
|
|
907
|
+
docSync = r.data as { drift?: SkillDocDrift[] } | undefined;
|
|
908
|
+
} else {
|
|
909
|
+
violations.push({
|
|
910
|
+
ruleId: "PKG-HEALTH-13",
|
|
911
|
+
packageName,
|
|
912
|
+
severity: "warning",
|
|
913
|
+
message: "skill doc-sync check skipped — no commandRegistry or invoke port in this host",
|
|
914
|
+
file: pkgDir,
|
|
915
|
+
fixHint:
|
|
916
|
+
"Run `forge skill.doc-sync --check` directly, or dispatch through a host that exposes the command.",
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
for (const d of docSync?.drift ?? []) {
|
|
920
|
+
violations.push({
|
|
921
|
+
ruleId: "PKG-HEALTH-13",
|
|
922
|
+
packageName,
|
|
923
|
+
severity: "error",
|
|
924
|
+
message: `${d.file}:${d.line} ${d.kind} — found "${d.found}", registry renders "${d.expected}"`,
|
|
925
|
+
file: path.join(pkgDir, d.file),
|
|
926
|
+
fixHint:
|
|
927
|
+
d.kind === "marked-region"
|
|
928
|
+
? `Run "forge skill.doc-sync --write" to re-render the marked region.`
|
|
929
|
+
: `Fix the literal to the registry count, or journal a same-line "<!-- forge-skill-count:ok: <reason> -->" exemption.`,
|
|
930
|
+
});
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
|
|
825
934
|
if (isPrivate) continue;
|
|
826
935
|
|
|
827
936
|
packagesChecked++;
|
|
@@ -1044,7 +1153,10 @@ export async function runPackageHealth(
|
|
|
1044
1153
|
}
|
|
1045
1154
|
|
|
1046
1155
|
suppressions.sort(
|
|
1047
|
-
(a, b) =>
|
|
1156
|
+
(a, b) =>
|
|
1157
|
+
(a.packageName ?? "").localeCompare(b.packageName ?? "") ||
|
|
1158
|
+
a.file.localeCompare(b.file) ||
|
|
1159
|
+
a.line - b.line,
|
|
1048
1160
|
);
|
|
1049
1161
|
if (packagesChecked > 0 && commandInfos.length === 0) {
|
|
1050
1162
|
violations.push({
|
|
@@ -1054,7 +1166,8 @@ export async function runPackageHealth(
|
|
|
1054
1166
|
message:
|
|
1055
1167
|
"no command inventory available — docs-drift gate skipped (context.commandRegistry unset and docs/command-manifest.generated.yaml absent or unparsable)",
|
|
1056
1168
|
file: workspaceRoot,
|
|
1057
|
-
fixHint:
|
|
1169
|
+
fixHint:
|
|
1170
|
+
"Run `werkstatt run command.manifest.generate`, or dispatch through a host that injects commandRegistry.",
|
|
1058
1171
|
});
|
|
1059
1172
|
} else if (packagesChecked > 0 && commandInfos.length > 0 && attributed === 0) {
|
|
1060
1173
|
// Inventory exists but no command resolved to a package — module→package
|
|
@@ -1066,7 +1179,8 @@ export async function runPackageHealth(
|
|
|
1066
1179
|
severity: "warning",
|
|
1067
1180
|
message: `${commandInfos.length} inventoried command(s) resolved to no package — module attribution unavailable, PKG-HEALTH-11 coverage skipped`,
|
|
1068
1181
|
file: workspaceRoot,
|
|
1069
|
-
fixHint:
|
|
1182
|
+
fixHint:
|
|
1183
|
+
"Check that packages/werkstatt-engine/src/kernel/module-map.ts or tools/kernel.config.ts declares the command modules.",
|
|
1070
1184
|
});
|
|
1071
1185
|
}
|
|
1072
1186
|
|
|
@@ -20,11 +20,20 @@ released with no mutation.</purpose>
|
|
|
20
20
|
<item>RFC-1502: `git add -u` folds the release-prepare hook's tracked edits in; its untracked leftovers are listed as FLOW-CUT-14 then removed via io.rm (the integrate gate demands a clean tree, and `git clean -f` is blocked in agent sessions). Pre-tag verification extracts every named line at the release commit — a failure deletes worktree+branch before any ref or tag moves (FLOW-CUT-13).</item>
|
|
21
21
|
</KEY_DECISIONS>
|
|
22
22
|
<CHANGE_SUMMARY>
|
|
23
|
-
<item>RFC-1502: review r1 — fix-cut rollback on FLOW-CUT-12/13, populated steps[], hook validation, GIT_* env scrub</item>
|
|
24
23
|
<item>RFC-1515: harden forge flow worktree lifecycle against vanished paths, forge-local state, dead-holder locks and generated drift</item>
|
|
25
24
|
<item>RFC-1515: close rfc-1515 review findings — delete tolerated paths before worktree remove, prune vanished registrations, verified branch -D, shared held-lock render, gated e2e throw, journal toleratedState, edge tests</item>
|
|
26
25
|
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
27
26
|
<item>RFC-1546: derive-and-repair recoverable state across flow surfaces (AC-1..AC-5)</item>
|
|
27
|
+
<item>RFC-1546: flow.cut resume keys on nearest chore(release): subject, not tip only (F-0269)
|
|
28
|
+
|
|
29
|
+
A concurrent session landing on develop between a cut's own integrate and
|
|
30
|
+
its tail buried the release commit — every re-run fell through to the
|
|
31
|
+
fresh-cut path and refused FLOW-CUT-01 on already-bumped version files
|
|
32
|
+
(the documented recovery could never fire). planOrdinaryCut now back-walks
|
|
33
|
+
git log (-20) to the nearest chore(release): declaration; resume fires only
|
|
34
|
+
for an incomplete release (missing tags) or a tip-resident one — a buried
|
|
35
|
+
completed release never re-runs its main CAS. Regression tests cover the
|
|
36
|
+
buried-pending and buried-completed cases.</item>
|
|
28
37
|
<history>RFC-1490, RFC-1491, RFC-1494, RFC-1502</history>
|
|
29
38
|
</CHANGE_SUMMARY>
|
|
30
39
|
*/
|
|
@@ -271,9 +280,17 @@ async function planOrdinaryCut(
|
|
|
271
280
|
// still runs but the tail completes exactly the subject's tags (and tags
|
|
272
281
|
// the subject names cannot block as FLOW-CUT-06).
|
|
273
282
|
const tipSubject = (await git(repoRoot, io, ["log", "-1", "--format=%s", ref])).stdout.trim();
|
|
283
|
+
// The tip may sit past the release commit: a concurrent session can land
|
|
284
|
+
// on develop between this cut's own integrate and its tail — the release
|
|
285
|
+
// declaration is still the nearest `chore(release):` subject behind tip.
|
|
286
|
+
const recentSubjects = (await git(repoRoot, io, ["log", "-20", "--format=%s", ref])).stdout
|
|
287
|
+
.split("\n")
|
|
288
|
+
.map((s) => s.trim());
|
|
289
|
+
const releaseIdx = recentSubjects.findIndex((s) => s.startsWith("chore(release): "));
|
|
290
|
+
const releaseSubject = releaseIdx >= 0 ? recentSubjects[releaseIdx]! : tipSubject;
|
|
274
291
|
let resumeTags: string[] | null = null;
|
|
275
|
-
if (
|
|
276
|
-
const named =
|
|
292
|
+
if (releaseSubject.startsWith("chore(release): ")) {
|
|
293
|
+
const named = releaseSubject
|
|
277
294
|
.slice("chore(release): ".length)
|
|
278
295
|
.split(",")
|
|
279
296
|
.map((t) => t.trim())
|
|
@@ -297,14 +314,18 @@ async function planOrdinaryCut(
|
|
|
297
314
|
const existence = await Promise.all(
|
|
298
315
|
named.map(
|
|
299
316
|
async (t) =>
|
|
300
|
-
(await git(repoRoot, io, ["rev-parse", "--verify", "-q", `refs/tags/${t}`]))
|
|
301
|
-
|
|
317
|
+
(await git(repoRoot, io, ["rev-parse", "--verify", "-q", `refs/tags/${t}`]))
|
|
318
|
+
.exitCode === 0,
|
|
302
319
|
),
|
|
303
320
|
);
|
|
304
321
|
if (named.length > 0 && existence.every((e) => e) && mainTip === ref) {
|
|
305
322
|
return { kind: "completed", ref, tags: named, allLines: lines, mainTip };
|
|
306
323
|
}
|
|
307
|
-
|
|
324
|
+
// A buried release whose tags all exist already ran its tail — do not
|
|
325
|
+
// resume it to redo the main CAS. Only an incomplete release (missing
|
|
326
|
+
// tags) or the tip-resident one may resume.
|
|
327
|
+
const allNamedExist = named.length > 0 && existence.every((e) => e);
|
|
328
|
+
if (named.length > 0 && (releaseIdx === 0 || !allNamedExist)) resumeTags = named;
|
|
308
329
|
}
|
|
309
330
|
}
|
|
310
331
|
|
|
@@ -14,6 +14,16 @@ tagged tail completes exactly the named tags (fingerprints → main → tags).</
|
|
|
14
14
|
<CHANGE_SUMMARY>
|
|
15
15
|
<item>RFC-1490: step 4 — resume-path tests split out per the RFC file table</item>
|
|
16
16
|
<item>RFC-1490: independent-review pass — lock-held planning, fix-branch verification, spec-shaped data, coverage</item>
|
|
17
|
+
<item>RFC-1546: flow.cut resume keys on nearest chore(release): subject, not tip only (F-0269)
|
|
18
|
+
|
|
19
|
+
A concurrent session landing on develop between a cut's own integrate and
|
|
20
|
+
its tail buried the release commit — every re-run fell through to the
|
|
21
|
+
fresh-cut path and refused FLOW-CUT-01 on already-bumped version files
|
|
22
|
+
(the documented recovery could never fire). planOrdinaryCut now back-walks
|
|
23
|
+
git log (-20) to the nearest chore(release): declaration; resume fires only
|
|
24
|
+
for an incomplete release (missing tags) or a tip-resident one — a buried
|
|
25
|
+
completed release never re-runs its main CAS. Regression tests cover the
|
|
26
|
+
buried-pending and buried-completed cases.</item>
|
|
17
27
|
</CHANGE_SUMMARY>
|
|
18
28
|
*/
|
|
19
29
|
|
|
@@ -42,10 +52,7 @@ async function adoptedRepo(): Promise<string> {
|
|
|
42
52
|
const repo = await initRepo({ prefix: "flow-cut-rerun-" });
|
|
43
53
|
dirs.push(repo);
|
|
44
54
|
await writeFile(join(repo, "forge.yaml"), 'schema: "forge/workspace@1"\n');
|
|
45
|
-
await writeFile(
|
|
46
|
-
join(repo, "package.json"),
|
|
47
|
-
'{\n "name": "fixture",\n "version": "0.1.0"\n}\n',
|
|
48
|
-
);
|
|
55
|
+
await writeFile(join(repo, "package.json"), '{\n "name": "fixture",\n "version": "0.1.0"\n}\n');
|
|
49
56
|
await gitExec(repo, ["add", "-A"]);
|
|
50
57
|
await gitExec(repo, ["commit", "-m", "config"]);
|
|
51
58
|
await gitExec(repo, ["switch", "-c", "develop"]);
|
|
@@ -92,4 +99,47 @@ describe("flow.cut — rerun/resume (AC-5)", () => {
|
|
|
92
99
|
expect(await sha(repo, "v0.1.1^{}")).toBe(await sha(repo, "develop"));
|
|
93
100
|
expect(await sha(repo, "main")).toBe(await sha(repo, "develop"));
|
|
94
101
|
}, 30_000);
|
|
102
|
+
|
|
103
|
+
it("resumes the tail when a later commit buried the release commit on develop", async () => {
|
|
104
|
+
const repo = await adoptedRepo();
|
|
105
|
+
const first = await runOrdinaryCut(repo, ambientIo, { lines: [], dryRun: false });
|
|
106
|
+
expect(first.released).toBe(true);
|
|
107
|
+
// Break the tail as a refused fingerprints step would have, then let an
|
|
108
|
+
// unrelated session land on develop past the release commit.
|
|
109
|
+
await gitExec(repo, ["tag", "-d", "v0.1.1"]);
|
|
110
|
+
await gitExec(repo, ["update-ref", "refs/heads/main", "v0.1.0"]);
|
|
111
|
+
await writeFile(join(repo, "housekeeping.txt"), "retro");
|
|
112
|
+
await gitExec(repo, ["add", "housekeeping.txt"]);
|
|
113
|
+
const bury = await gitExec(repo, ["commit", "-m", "chore: session-end housekeeping"], {
|
|
114
|
+
FORGE_FLOW_OP: "install",
|
|
115
|
+
});
|
|
116
|
+
if (bury.exitCode !== 0) throw new Error(`bury commit failed: ${bury.stderr}`);
|
|
117
|
+
|
|
118
|
+
const data = await runOrdinaryCut(repo, ambientIo, { lines: [], dryRun: false });
|
|
119
|
+
|
|
120
|
+
expect(data.diagnostics).toEqual([]);
|
|
121
|
+
expect(data.released).toBe(true);
|
|
122
|
+
expect(data.resumed).toBe(true);
|
|
123
|
+
expect(await sha(repo, "v0.1.1^{}")).toBe(await sha(repo, "develop"));
|
|
124
|
+
expect(await sha(repo, "main")).toBe(await sha(repo, "develop"));
|
|
125
|
+
}, 30_000);
|
|
126
|
+
|
|
127
|
+
it("does not resume a buried release whose tags already exist", async () => {
|
|
128
|
+
const repo = await adoptedRepo();
|
|
129
|
+
const first = await runOrdinaryCut(repo, ambientIo, { lines: [], dryRun: false });
|
|
130
|
+
expect(first.released).toBe(true);
|
|
131
|
+
// Fully landed release, then a later commit — the buried declaration
|
|
132
|
+
// must not trigger a resume (main lagging develop is unrelated state).
|
|
133
|
+
await writeFile(join(repo, "later.txt"), "later");
|
|
134
|
+
await gitExec(repo, ["add", "later.txt"]);
|
|
135
|
+
const bury = await gitExec(repo, ["commit", "-m", "docs: later work"], {
|
|
136
|
+
FORGE_FLOW_OP: "install",
|
|
137
|
+
});
|
|
138
|
+
if (bury.exitCode !== 0) throw new Error(`bury commit failed: ${bury.stderr}`);
|
|
139
|
+
|
|
140
|
+
const data = await runOrdinaryCut(repo, ambientIo, { lines: [], dryRun: false });
|
|
141
|
+
|
|
142
|
+
// Falls through to the fresh-cut path — the prior release is complete.
|
|
143
|
+
expect(data.resumed).toBe(false);
|
|
144
|
+
}, 30_000);
|
|
95
145
|
});
|
package/os/rfc/rfc.module.ts
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
</non-goals>
|
|
8
8
|
</MODULE_CONTRACT>
|
|
9
9
|
<CHANGE_SUMMARY>
|
|
10
|
-
<item>RFC-1516: add an evidence-freshness window to the stamp-sync chain for rfc-1516</item>
|
|
11
10
|
<item>RFC-1528: close review findings — manifest-union command inventory for regen/preflight</item>
|
|
12
11
|
<item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
|
|
13
12
|
<item>RFC-1568: durable gate-run records, --detach mechanics, and forge CLI wiring</item>
|
|
14
13
|
<item>RFC-1580: digest trail, manifest review export, operating model and skills
|
|
15
14
|
|
|
16
15
|
flow.digest lists X-Correctness-Weakening trailers and verifier-trailer commits (correctnessTrail, part of digestId); rfc.verify.workspace --manifest exports the oracle-review surface with MANIFEST-REVIEW-BUNDLE.md hashes; operating model §7 product tiers and §8 'a self oracle never covers an anchor of a product correctness manifest'; fo-review oracle review mode producing forge/oracle-review@1; fo-idea-implement step 4.4c; correctness-gate reference page; forge AGENTS.md gate rules.</item>
|
|
17
|
-
<
|
|
16
|
+
<item>RFC-1582: scope integrate-gate steps to verified path domains — skipped rows, manifest-derived domains, --full-gate escape</item>
|
|
17
|
+
<history>RFC-0260, RFC-0795, RFC-1097, RFC-1173, RFC-1231, RFC-1237, RFC-1249, RFC-1271, RFC-1306, RFC-1322, RFC-1333, RFC-1351, RFC-1354, RFC-1364, RFC-1453, RFC-1458, RFC-1461, RFC-1463, RFC-1467, RFC-1474, RFC-1482, RFC-1483, RFC-1489, RFC-1516</history>
|
|
18
18
|
</CHANGE_SUMMARY>
|
|
19
19
|
*/
|
|
20
20
|
|
|
@@ -163,7 +163,11 @@ export async function createForgeRfcModule(): Promise<ForgeModule> {
|
|
|
163
163
|
"RFC-1534: repair V-19 amends/amendedBy asymmetries by merging the missing counterpart into the referenced file.",
|
|
164
164
|
},
|
|
165
165
|
},
|
|
166
|
-
|
|
166
|
+
// RFC-1582: the validator's honest surface — the RFC tree (markdown
|
|
167
|
+
// plus generated indexes/verification envelopes), vendored specs,
|
|
168
|
+
// and the DNA registry the satisfies/related rules resolve against.
|
|
169
|
+
// The gate derives rfc-validate's domain from this declaration.
|
|
170
|
+
reads: ["docs/rfcs/**", "docs/specs/**", "docs/architecture-dna.md"],
|
|
167
171
|
execute: runRfcValidate,
|
|
168
172
|
},
|
|
169
173
|
{
|
package/package.json
CHANGED
package/profiles/godot-game.yaml
CHANGED
|
@@ -1108,6 +1108,7 @@ workspace:
|
|
|
1108
1108
|
- Engine: @warpgogol/werkstatt-engine
|
|
1109
1109
|
- Plugin: @warpgogol/werkstatt-godot-game
|
|
1110
1110
|
- Stack profile: godot-game
|
|
1111
|
+
- Skills: <!-- forge:skills-count --><!-- /forge:skills-count --> (rendered by `forge skill.doc-sync`)
|
|
1111
1112
|
- path: hooks/worktree-setup.sh
|
|
1112
1113
|
content: |
|
|
1113
1114
|
#!/bin/sh
|
|
@@ -677,6 +677,7 @@ workspace:
|
|
|
677
677
|
- Engine: @warpgogol/werkstatt-engine
|
|
678
678
|
- Plugin: @warpgogol/werkstatt-phaser-game
|
|
679
679
|
- Stack profile: phaser-game
|
|
680
|
+
- Skills: <!-- forge:skills-count --><!-- /forge:skills-count --> (rendered by `forge skill.doc-sync`)
|
|
680
681
|
- path: hooks/worktree-setup.sh
|
|
681
682
|
content: |
|
|
682
683
|
#!/bin/sh
|
|
@@ -596,6 +596,7 @@ workspace:
|
|
|
596
596
|
- Engine: @warpgogol/werkstatt-engine + @warpgogol/werkstatt-site
|
|
597
597
|
- Governance: @warpgogol/forge
|
|
598
598
|
- Stack profile: site-workshop
|
|
599
|
+
- Skills: <!-- forge:skills-count --><!-- /forge:skills-count --> (rendered by `forge skill.doc-sync`)
|
|
599
600
|
|
|
600
601
|
## Platform updates
|
|
601
602
|
|
package/profiles/system.yaml
CHANGED
package/profiles/typescript.yaml
CHANGED
|
@@ -540,6 +540,7 @@ workspace:
|
|
|
540
540
|
- Engine: @warpgogol/forge
|
|
541
541
|
- Plugin: @warpgogol/werkstatt-typescript
|
|
542
542
|
- Stack profile: typescript
|
|
543
|
+
- Skills: <!-- forge:skills-count --><!-- /forge:skills-count --> (rendered by `forge skill.doc-sync`)
|
|
543
544
|
- path: docs/correctness.yaml
|
|
544
545
|
content: |
|
|
545
546
|
# Product correctness manifest (RFC-1578, forge/correctness-manifest@1).
|
|
@@ -20,7 +20,6 @@ triggerPhrases: ["завершаем", "протокол завершения",
|
|
|
20
20
|
</non-goals>
|
|
21
21
|
</MODULE_CONTRACT>
|
|
22
22
|
<CHANGE_SUMMARY>
|
|
23
|
-
<item>RFC-1531: add flow.integrate remediation flags on the shared dirty classifier</item>
|
|
24
23
|
<item>RFC-1534: lint probe patterns, sync amends counterparts, name next free ledger id</item>
|
|
25
24
|
<item>ADR-0126: docs-rule batch — 16 friction measures landed</item>
|
|
26
25
|
<item>RFC-1460: draft mechanical-obligation RFCs and land harvest doc rules
|
|
@@ -30,7 +29,8 @@ surfaces, quiet kernel output, staged-commit/invocation guards, fixed-branch
|
|
|
30
29
|
onboarding-status routing, forge task prettier coverage), seven docs-rule
|
|
31
30
|
landings, registry flips — 25 entries served, F-0025 stays external.</item>
|
|
32
31
|
<item>RFC-1460: session-end teardown — stop worktree-held dev servers before flow.integrate</item>
|
|
33
|
-
<
|
|
32
|
+
<item>RFC-1573: parallelize session-end housekeeping and detach flow.integrate</item>
|
|
33
|
+
<history>ADR-0119, ADR-0121, RFC-1097, RFC-1247, RFC-1433, RFC-1460, RFC-1487, RFC-1491, RFC-1528, RFC-1531</history>
|
|
34
34
|
</CHANGE_SUMMARY>
|
|
35
35
|
-->
|
|
36
36
|
|
|
@@ -134,7 +134,7 @@ If the save succeeded, proceed to Step 1. The saved session file will be annotat
|
|
|
134
134
|
|
|
135
135
|
## Pre-retro steps
|
|
136
136
|
|
|
137
|
-
Before gathering insights, perform these housekeeping steps
|
|
137
|
+
Before gathering insights, perform these housekeeping steps. **Steps 1–2 are latency, not dependencies** — launch them in a background shell immediately after Step 0 and run insight gathering, insight routing, and the friction autopsy while they execute; synchronize only before Step 3's first `git add` (the archive stages its moves and regenerates artifacts — committing mid-run races the index).
|
|
138
138
|
|
|
139
139
|
### Step 1: Clean up test temp directories
|
|
140
140
|
|
|
@@ -162,6 +162,8 @@ Run the `docs.archive` umbrella command to move terminal RFCs, ADRs, plans, audi
|
|
|
162
162
|
rtk pnpm exec werkstatt run docs.archive
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
The run takes minutes on a mature tree — launch it in a **background shell** and continue with insight gathering and the friction autopsy. It touches only `docs/{audits,plans,rfcs,sessions,missions}` plus generated indexes — never `frictions.yaml`, `.agents/`, or `AGENTS.md`. **Synchronization point:** wait for it to finish before Step 3's `git status`/`git add`; its staged moves and regenerated artifacts are "our" changes committed in Step 3c.
|
|
166
|
+
|
|
165
167
|
Prefer the kernel host — under `werkstatt run` the archive regenerates every generated artifact invalidated by the moves (e.g. `docs/ecosystem.generated.yaml`, `docs/rfcs/index.yaml`) and reports them. Under a standalone forge install (`pnpm exec forge docs.archive`) the command still archives but regeneration is skipped with a printed note.
|
|
166
168
|
|
|
167
169
|
The command is idempotent — re-running is safe. If files were moved or regenerated, commit them in step 3 as part of the clean tree check (they are "our" changes).
|
|
@@ -206,7 +208,7 @@ for d in missions/*/workpiece; do [ -d "$d/.git" ] && echo "=== $d ===" && rtk g
|
|
|
206
208
|
|
|
207
209
|
- 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
210
|
- 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.
|
|
209
|
-
- After the clean-tree commit, run `flow.integrate` from the session worktree — it
|
|
211
|
+
- After the clean-tree commit, run `flow.integrate --detach` from the session worktree — the command is `detachable: true`: it prints a run id and log path and returns at once while rebase + integration gate + correctness gate run detached (tens of minutes even for a docs-only commit; the worktree removes itself on success). Report the run id in the Step 7 report so the operator can watch `gate.run.status --id <runId>`; a refusal (FLOW-INT-02/05/18) lands in `flow.status` for the next session. Use the blocking form only when the session's own diff is non-trivial and an immediate refusal verdict would change what you commit next.
|
|
210
212
|
- 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
213
|
- 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.
|
|
212
214
|
- 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.
|
|
@@ -15,6 +15,20 @@ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten
|
|
|
15
15
|
<item>RFC-1097: sweep — werkstatt-engine clean
|
|
16
16
|
|
|
17
17
|
Sweep batch 4: 73 Compass headers on headerless engine files (certification, component-runtime, isolation, evolution, testing), real KEY_DECISIONS on 75 files (kernel, cache, dht, swim, gitmesh, runtime), ~80 purpose expansions (CONTRACT-02/PURPOSE-02), non-goals on 13 CONTRACT-03 files, CS-07 history literal fix repo-wide (253 files). Policy: .template.ts/.template.astro excludedPaths. werkstatt-engine now 0 diagnostics.</item>
|
|
18
|
+
<item>RFC-1585: review wave — write-path corruptions, --check flag, scaffold hydration
|
|
19
|
+
|
|
20
|
+
Independent fo-review (isolation: subagent) found: empty marker pairs lost
|
|
21
|
+
their open tag on --write, multi-line regions collapsed line numbers, a
|
|
22
|
+
leading fence injected a phantom line, --check was undocumented-undeclared,
|
|
23
|
+
and --write exited 1 on a successful heal. Fixes: open-marker capture,
|
|
24
|
+
newline-preserving placeholder, empty-chunk skip, check flag, healedRegions
|
|
25
|
+
split (write always exits 0), dryRun/io threading, byte-exact inventory
|
|
26
|
+
compare on the prettier-stable canonical form, CHECK-13 delegated through
|
|
27
|
+
commandRegistry/invoke so the registry-integrity scan stays within its
|
|
28
|
+
slice cap (KNOWN_TRUNCATED_SCANS is shrink-only), record-tree exclusions
|
|
29
|
+
extended, two real stale claims corrected, profile templates ship empty
|
|
30
|
+
markers hydrated at scaffold write time. RFC amended to implemented
|
|
31
|
+
grammar/result/exclusions; command moved to commands.added.</item>
|
|
18
32
|
</CHANGE_SUMMARY>
|
|
19
33
|
*/
|
|
20
34
|
|
|
@@ -23,6 +37,7 @@ import { resolveIo } from "../utils/io.ts";
|
|
|
23
37
|
import { listStackProfiles, type StackProfile } from "../profiles/stack-profile.ts";
|
|
24
38
|
import { checkNpmToken, workshopNeedsWarpgogolToken } from "./npm-token-check.ts";
|
|
25
39
|
import { resolveForgeRoot } from "../config/forge-config.ts";
|
|
40
|
+
import { hydrateSkillDocMarkers } from "../validators/skill-doc-sync.ts";
|
|
26
41
|
import type {
|
|
27
42
|
ForgeCommandInput,
|
|
28
43
|
ForgeCommandResult,
|
|
@@ -117,7 +132,8 @@ export async function runScaffoldProject(
|
|
|
117
132
|
for (const file of profile.workspace.files) {
|
|
118
133
|
const filePath = path.join(workspaceRoot, file.path);
|
|
119
134
|
await fio.mkdir(path.dirname(filePath));
|
|
120
|
-
|
|
135
|
+
let content = file.content.replace(/__PROJECT_NAME__/g, effectiveProjectName);
|
|
136
|
+
if (file.path.endsWith(".md")) content = hydrateSkillDocMarkers(content);
|
|
121
137
|
await fio.writeFile(filePath, content);
|
|
122
138
|
created.push(file.path);
|
|
123
139
|
}
|
|
@@ -170,9 +186,10 @@ export async function runScaffoldProject(
|
|
|
170
186
|
const filePath = path.join(wsDir, file.path);
|
|
171
187
|
await fio.mkdir(path.dirname(filePath));
|
|
172
188
|
// Replace placeholder names (quoted and bare)
|
|
173
|
-
|
|
189
|
+
let content = file.content
|
|
174
190
|
.replace(/my-site/g, effectiveProjectName)
|
|
175
191
|
.replace(/my-game/g, effectiveProjectName);
|
|
192
|
+
if (file.path.endsWith(".md")) content = hydrateSkillDocMarkers(content);
|
|
176
193
|
await fio.writeFile(filePath, content);
|
|
177
194
|
created.push(`${wsPath}/${file.path}`);
|
|
178
195
|
}
|