@warpgogol/forge 6.3.1 → 6.3.3
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 +162 -0
- package/bin/cli.js +13 -2
- package/dist/os/compass/handlers/compass-docs-scaffold.d.ts.map +1 -1
- package/dist/os/compass/handlers/compass-docs-scaffold.js +26 -3
- package/dist/os/compass/handlers/compass-docs-scaffold.js.map +1 -1
- package/dist/os/core/core.module.d.ts.map +1 -1
- package/dist/os/core/core.module.js +6 -8
- 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 +178 -4
- package/dist/os/core/handlers/package-health.js.map +1 -1
- package/dist/src/onboarding/agents-generate.d.ts +2 -0
- package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/agents-generate.js +46 -38
- package/dist/src/onboarding/agents-generate.js.map +1 -1
- package/dist/src/onboarding/compass-docs/semantic-layer-block.d.ts +40 -0
- package/dist/src/onboarding/compass-docs/semantic-layer-block.d.ts.map +1 -0
- package/dist/src/onboarding/compass-docs/semantic-layer-block.js +116 -0
- package/dist/src/onboarding/compass-docs/semantic-layer-block.js.map +1 -0
- package/dist/src/onboarding/doctor.d.ts.map +1 -1
- package/dist/src/onboarding/doctor.js +72 -33
- package/dist/src/onboarding/doctor.js.map +1 -1
- package/dist/src/onboarding/init.d.ts.map +1 -1
- package/dist/src/onboarding/init.js +35 -4
- package/dist/src/onboarding/init.js.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.d.ts +2 -0
- package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-generate.js +31 -6
- package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
- package/dist/src/onboarding/nested-agents-templates.d.ts +6 -1
- package/dist/src/onboarding/nested-agents-templates.d.ts.map +1 -1
- package/dist/src/onboarding/nested-agents-templates.js +20 -5
- package/dist/src/onboarding/nested-agents-templates.js.map +1 -1
- package/dist/src/onboarding/prettierignore.d.ts +8 -2
- package/dist/src/onboarding/prettierignore.d.ts.map +1 -1
- package/dist/src/onboarding/prettierignore.js +36 -4
- package/dist/src/onboarding/prettierignore.js.map +1 -1
- package/dist/src/onboarding/skill-markers.d.ts +1 -0
- package/dist/src/onboarding/skill-markers.d.ts.map +1 -1
- package/dist/src/onboarding/skill-markers.js +1 -1
- package/dist/src/onboarding/skill-markers.js.map +1 -1
- package/dist/src/onboarding/upgrade.d.ts +4 -0
- package/dist/src/onboarding/upgrade.d.ts.map +1 -1
- package/dist/src/onboarding/upgrade.js +73 -9
- package/dist/src/onboarding/upgrade.js.map +1 -1
- package/dist/src/onboarding/workspace-discovery.d.ts +9 -0
- package/dist/src/onboarding/workspace-discovery.d.ts.map +1 -1
- package/dist/src/onboarding/workspace-discovery.js +30 -0
- package/dist/src/onboarding/workspace-discovery.js.map +1 -1
- package/dist/src/utils/generated-marker.d.ts.map +1 -1
- package/dist/src/utils/generated-marker.js +14 -6
- package/dist/src/utils/generated-marker.js.map +1 -1
- package/docs/reference/cli.md +1 -1
- package/docs/reference/compass-docs.md +57 -39
- package/os/compass/handlers/compass-docs-scaffold.ts +26 -3
- package/os/core/core.module.ts +6 -8
- package/os/core/docs-archive.test.ts +2 -5
- package/os/core/handlers/package-health.test.ts +199 -3
- package/os/core/handlers/package-health.ts +188 -4
- package/os/rfc/verification-emit.test.ts +1 -1
- package/os/rfc/verification-refresh.test.ts +1 -1
- package/os/spec/spec-validate.test.ts +4 -4
- package/package.json +2 -2
- package/profiles/forge-shell.yaml +5 -14
- package/profiles/godot-game.yaml +5 -14
- package/profiles/phaser-game.yaml +5 -14
- package/profiles/typescript.yaml +5 -14
- package/skills/fo/fo-handoff/SKILL.md +5 -4
- package/skills/fo/fo-step-commit/SKILL.md +4 -1
- package/src/onboarding/agents-generate.ts +49 -42
- package/src/onboarding/compass-docs/semantic-layer-block.test.ts +137 -0
- package/src/onboarding/compass-docs/semantic-layer-block.ts +132 -0
- package/src/onboarding/doctor.ts +77 -31
- package/src/onboarding/init.ts +35 -4
- package/src/onboarding/nested-agents-generate.ts +40 -6
- package/src/onboarding/nested-agents-templates.ts +25 -5
- package/src/onboarding/prettierignore.ts +45 -2
- package/src/onboarding/skill-markers.ts +5 -1
- package/src/onboarding/templates/behavioral-layer-core.md +2 -0
- package/src/onboarding/templates/root-agents-business.md +1 -0
- package/src/onboarding/templates/root-agents-creative.md +1 -0
- package/src/onboarding/upgrade.ts +122 -11
- package/src/onboarding/workspace-discovery.ts +33 -0
- package/src/tests/agents-generate.test.ts +128 -0
- package/src/tests/bindings-schema.test.ts +1 -0
- package/src/tests/compass-docs-flag.test.ts +2 -0
- package/src/tests/compass-docs-scaffold.test.ts +67 -0
- package/src/tests/doctor-version-sync.test.ts +155 -0
- package/src/tests/file-size-lint.test.ts +7 -5
- package/src/tests/fixtures/agents-generate-business-before.txt +8 -2
- package/src/tests/forge-config.test.ts +2 -3
- package/src/tests/generated-marker.test.ts +17 -0
- package/src/tests/prettierignore-manage.test.ts +30 -0
- package/src/tests/session-handlers.test.ts +2 -2
- package/src/tests/session-pbt.test.ts +1 -1
- package/src/tests/skill-agents-sync.test.ts +25 -0
- package/src/tests/upgrade.test.ts +82 -1
- package/src/utils/generated-marker.ts +15 -6
|
@@ -11,8 +11,6 @@ With --update-npm, also updates @warpgogol/forge from npm before syncing (skippe
|
|
|
11
11
|
</non-goals>
|
|
12
12
|
</MODULE_CONTRACT>
|
|
13
13
|
<CHANGE_SUMMARY>
|
|
14
|
-
<item>RFC-0663: added syncSharedKnowledge step to sync shared knowledge layer to .agents/skills/shared-knowledge/.</item>
|
|
15
|
-
<item>RFC-0664: added scaffoldMemoryLayer step to scaffold .agents/memory/ and .gitignore block.</item>
|
|
16
14
|
<item>RFC-1097: step 6 — compass.migrate codemod run
|
|
17
15
|
|
|
18
16
|
Mechanical v1 to v2 header migration across the workspace: 942 files rewritten — CHANGE_SUMMARY windows collapsed into history, forbidden v1 blocks stripped, KEY_DECISIONS seeded from @ai-invariant comments (5 files) or TODO placeholders (103 files), blocks reordered to canonical order.</item>
|
|
@@ -20,7 +18,9 @@ Mechanical v1 to v2 header migration across the workspace: 942 files rewritten
|
|
|
20
18
|
|
|
21
19
|
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>
|
|
22
20
|
<item>RFC-1224: preserve operator forge.yaml content on upgrade, promote adrImplementStamp binding</item>
|
|
23
|
-
<
|
|
21
|
+
<item>fix: sync skills/_shared/ convention docs to .agents/skills/_shared/ — fo-* SKILL.md references dangled for npm consumers</item>
|
|
22
|
+
<item>Knowledge conflicts land in .forge/knowledge-conflicts.txt (summary + path in console instead of a 60+ entry dump); exposed as knowledgeConflicts/knowledgeConflictsReport on UpgradeResult. Prettierignore plan now enumerates generated AGENTS.md paths.</item>
|
|
23
|
+
<history>RFC-0543, RFC-0611, RFC-0663, RFC-0664, RFC-1224</history>
|
|
24
24
|
</CHANGE_SUMMARY>
|
|
25
25
|
*/
|
|
26
26
|
|
|
@@ -45,13 +45,19 @@ import {
|
|
|
45
45
|
import { FORGE_SKILLS, discoverPackSkills } from "../registry.ts";
|
|
46
46
|
import { syncKnowledgeFile } from "../knowledge/index.ts";
|
|
47
47
|
import { writeFileIfChanged } from "../utils/fs-idempotent.ts";
|
|
48
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
writeSkillMarker,
|
|
50
|
+
pruneStaleSkillDirs,
|
|
51
|
+
listFilesRecursive,
|
|
52
|
+
type PruneResult,
|
|
53
|
+
} from "./skill-markers.ts";
|
|
49
54
|
import {
|
|
50
55
|
planPrettierignore,
|
|
51
56
|
applyPrettierignore,
|
|
52
57
|
type PrettierignoreResult,
|
|
53
58
|
} from "./prettierignore.ts";
|
|
54
59
|
import { generateNestedAgentsMd } from "./nested-agents-generate.ts";
|
|
60
|
+
import { resolveWorkspaceTypes } from "./workspace-discovery.ts";
|
|
55
61
|
import { scaffoldMemoryLayer } from "./memory-scaffold.ts";
|
|
56
62
|
import type { SkippedSkill } from "./init.ts";
|
|
57
63
|
import type { ForgeCommandInput, ForgeCommandResult, ForgeNextStep, ForgeRuntimeContext } from "../types.ts";
|
|
@@ -81,6 +87,10 @@ export interface UpgradeResult {
|
|
|
81
87
|
skillsPruned: string[];
|
|
82
88
|
skillsKeptWithConsumerFiles: string[];
|
|
83
89
|
prettierignore: PrettierignoreResult;
|
|
90
|
+
/** Knowledge entries diverging between package and project — local kept. */
|
|
91
|
+
knowledgeConflicts?: string[];
|
|
92
|
+
/** Repo-relative path of the written conflicts report, when any. */
|
|
93
|
+
knowledgeConflictsReport?: string | null;
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
async function isMonorepoForge(workspaceRoot: string, io: WorkspaceIO): Promise<boolean> {
|
|
@@ -258,6 +268,37 @@ async function syncSharedKnowledge(
|
|
|
258
268
|
return { updated, knowledgeConflicts };
|
|
259
269
|
}
|
|
260
270
|
|
|
271
|
+
/**
|
|
272
|
+
* Sync `_shared/` convention docs (fo-pipeline-conventions.md et al.) into
|
|
273
|
+
* `.agents/skills/_shared/`. fo-* SKILL.md files link these by relative path —
|
|
274
|
+
* without the copy the references dangle for npm consumers. Verbatim sync like
|
|
275
|
+
* SKILL.md, forge-managed via marker so a dropped upstream dir prunes cleanly.
|
|
276
|
+
*/
|
|
277
|
+
async function syncSharedConventions(
|
|
278
|
+
workspaceRoot: string,
|
|
279
|
+
forgeRoot: string,
|
|
280
|
+
skillsDir: string,
|
|
281
|
+
dryRun: boolean,
|
|
282
|
+
io: WorkspaceIO,
|
|
283
|
+
): Promise<{ updated: string[] }> {
|
|
284
|
+
const srcDir = path.join(forgeRoot, "skills", "_shared");
|
|
285
|
+
if (!(await io.exists(srcDir))) return { updated: [] };
|
|
286
|
+
|
|
287
|
+
const files = await listFilesRecursive(srcDir, io);
|
|
288
|
+
if (files.length === 0) return { updated: [] };
|
|
289
|
+
|
|
290
|
+
if (!dryRun) {
|
|
291
|
+
const destDir = path.join(workspaceRoot, skillsDir, "_shared");
|
|
292
|
+
await io.mkdir(destDir);
|
|
293
|
+
for (const rel of files) {
|
|
294
|
+
const content = await io.readFile(path.join(srcDir, rel));
|
|
295
|
+
await writeFileIfChanged(path.join(destDir, rel), content, io);
|
|
296
|
+
}
|
|
297
|
+
await writeSkillMarker(destDir, files, io);
|
|
298
|
+
}
|
|
299
|
+
return { updated: ["_shared"] };
|
|
300
|
+
}
|
|
301
|
+
|
|
261
302
|
async function syncPackSkills(
|
|
262
303
|
workspaceRoot: string,
|
|
263
304
|
config: ForgeConfig,
|
|
@@ -370,11 +411,19 @@ async function reconcileGeneratedSurface(
|
|
|
370
411
|
dryRun,
|
|
371
412
|
io,
|
|
372
413
|
);
|
|
414
|
+
const sharedConventionsResult = await syncSharedConventions(
|
|
415
|
+
workspaceRoot,
|
|
416
|
+
forgeRoot,
|
|
417
|
+
config.paths.skillsDir,
|
|
418
|
+
dryRun,
|
|
419
|
+
io,
|
|
420
|
+
);
|
|
373
421
|
|
|
374
422
|
const currentSyncSet = new Set([
|
|
375
423
|
...forgeSkillsResult.updated,
|
|
376
424
|
...packResult.updated,
|
|
377
425
|
...sharedKnowledgeResult.updated,
|
|
426
|
+
...sharedConventionsResult.updated,
|
|
378
427
|
]);
|
|
379
428
|
|
|
380
429
|
const warnings: string[] = [];
|
|
@@ -397,7 +446,10 @@ async function reconcileGeneratedSurface(
|
|
|
397
446
|
try {
|
|
398
447
|
prettierignore = await applyPrettierignore(
|
|
399
448
|
workspaceRoot,
|
|
400
|
-
await planPrettierignore(workspaceRoot, config.paths.skillsDir, io
|
|
449
|
+
await planPrettierignore(workspaceRoot, config.paths.skillsDir, io, {
|
|
450
|
+
workspaceTypes: resolveWorkspaceTypes(config, forgeRoot),
|
|
451
|
+
workspaceSkipDirs: config.bindings?.workspaces?.skipDirs,
|
|
452
|
+
}),
|
|
401
453
|
io,
|
|
402
454
|
);
|
|
403
455
|
} catch (err) {
|
|
@@ -410,6 +462,7 @@ async function reconcileGeneratedSurface(
|
|
|
410
462
|
...forgeSkillsResult.updated,
|
|
411
463
|
...packResult.updated,
|
|
412
464
|
...sharedKnowledgeResult.updated,
|
|
465
|
+
...sharedConventionsResult.updated,
|
|
413
466
|
],
|
|
414
467
|
knowledgeConflicts: [
|
|
415
468
|
...forgeSkillsResult.knowledgeConflicts,
|
|
@@ -423,6 +476,52 @@ async function reconcileGeneratedSurface(
|
|
|
423
476
|
};
|
|
424
477
|
}
|
|
425
478
|
|
|
479
|
+
/**
|
|
480
|
+
* Knowledge-conflict report — the full divergence list lands in
|
|
481
|
+
* `.forge/knowledge-conflicts.txt` (overwritten each run, no churn); the
|
|
482
|
+
* console keeps a one-line summary + path instead of a 60+ entry dump.
|
|
483
|
+
*/
|
|
484
|
+
async function writeKnowledgeConflictsReport(
|
|
485
|
+
workspaceRoot: string,
|
|
486
|
+
conflicts: string[],
|
|
487
|
+
io: WorkspaceIO,
|
|
488
|
+
): Promise<string | null> {
|
|
489
|
+
const rel = ".forge/knowledge-conflicts.txt";
|
|
490
|
+
try {
|
|
491
|
+
await io.writeFile(
|
|
492
|
+
path.join(workspaceRoot, rel),
|
|
493
|
+
[
|
|
494
|
+
"# forge.upgrade knowledge conflicts — local project versions were kept.",
|
|
495
|
+
"# Review and merge the package entries manually, then delete this file.",
|
|
496
|
+
`# generated: ${new Date().toISOString()}`,
|
|
497
|
+
"",
|
|
498
|
+
...conflicts.map((c) => `- ${c}`),
|
|
499
|
+
"",
|
|
500
|
+
].join("\n"),
|
|
501
|
+
);
|
|
502
|
+
return rel;
|
|
503
|
+
} catch {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
async function reportKnowledgeConflicts(
|
|
509
|
+
workspaceRoot: string,
|
|
510
|
+
conflicts: string[],
|
|
511
|
+
isDryRun: boolean,
|
|
512
|
+
io: WorkspaceIO,
|
|
513
|
+
logger: ForgeRuntimeContext["logger"],
|
|
514
|
+
): Promise<string | null> {
|
|
515
|
+
if (conflicts.length === 0) return null;
|
|
516
|
+
const reportPath = isDryRun ? null : await writeKnowledgeConflictsReport(workspaceRoot, conflicts, io);
|
|
517
|
+
logger.warn(
|
|
518
|
+
`forge.upgrade: ${conflicts.length} knowledge entr${conflicts.length === 1 ? "y" : "ies"} ` +
|
|
519
|
+
`diverge between package and project — local versions kept` +
|
|
520
|
+
(reportPath ? `; list: ${reportPath}` : ""),
|
|
521
|
+
);
|
|
522
|
+
return reportPath;
|
|
523
|
+
}
|
|
524
|
+
|
|
426
525
|
function addMissingBindingDefaults(
|
|
427
526
|
config: ForgeConfig,
|
|
428
527
|
dryRun: boolean,
|
|
@@ -643,6 +742,13 @@ export async function runUpgrade(
|
|
|
643
742
|
for (const warn of reconcile.warnings) {
|
|
644
743
|
context.logger.warn(`forge.upgrade: ${warn}`);
|
|
645
744
|
}
|
|
745
|
+
const noopConflictsReport = await reportKnowledgeConflicts(
|
|
746
|
+
workspaceRoot,
|
|
747
|
+
reconcile.knowledgeConflicts,
|
|
748
|
+
isDryRun,
|
|
749
|
+
fio,
|
|
750
|
+
context.logger,
|
|
751
|
+
);
|
|
646
752
|
return {
|
|
647
753
|
data: {
|
|
648
754
|
command: "forge.upgrade",
|
|
@@ -665,6 +771,8 @@ export async function runUpgrade(
|
|
|
665
771
|
skillsPruned: reconcile.prune.pruned,
|
|
666
772
|
skillsKeptWithConsumerFiles: reconcile.prune.keptWithConsumerFiles,
|
|
667
773
|
prettierignore: reconcile.prettierignore,
|
|
774
|
+
knowledgeConflicts: reconcile.knowledgeConflicts,
|
|
775
|
+
knowledgeConflictsReport: noopConflictsReport,
|
|
668
776
|
},
|
|
669
777
|
nextSteps: npmCheck.warning
|
|
670
778
|
? [{ action: npmCheck.warning, kind: "optional" }]
|
|
@@ -696,12 +804,13 @@ export async function runUpgrade(
|
|
|
696
804
|
for (const warn of reconcile.warnings) {
|
|
697
805
|
context.logger.warn(`forge.upgrade: ${warn}`);
|
|
698
806
|
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
807
|
+
const knowledgeConflictsReport = await reportKnowledgeConflicts(
|
|
808
|
+
workspaceRoot,
|
|
809
|
+
knowledgeConflicts,
|
|
810
|
+
isDryRun,
|
|
811
|
+
fio,
|
|
812
|
+
context.logger,
|
|
813
|
+
);
|
|
705
814
|
|
|
706
815
|
// Step 3d: Scaffold memory layer (RFC-0664)
|
|
707
816
|
const memoryScaffold = isDryRun ? { created: [], gitignoreUpdated: false, skipped: [] } : scaffoldMemoryLayer(workspaceRoot);
|
|
@@ -812,6 +921,8 @@ export async function runUpgrade(
|
|
|
812
921
|
skillsPruned: reconcile.prune.pruned,
|
|
813
922
|
skillsKeptWithConsumerFiles: reconcile.prune.keptWithConsumerFiles,
|
|
814
923
|
prettierignore: reconcile.prettierignore,
|
|
924
|
+
knowledgeConflicts,
|
|
925
|
+
knowledgeConflictsReport,
|
|
815
926
|
},
|
|
816
927
|
nextSteps,
|
|
817
928
|
exitCode: 0,
|
|
@@ -12,6 +12,7 @@ workspace type (app, service, package) by content markers.</purpose>
|
|
|
12
12
|
<CHANGE_SUMMARY>
|
|
13
13
|
<item>RFC-0611: initial workspace discovery and type auto-detection.</item>
|
|
14
14
|
<item>RFC-0640: accept optional workspaceTypes from profile for profile-driven detection, falling back to hardcoded detection when absent.</item>
|
|
15
|
+
<item>Extracted shared resolveWorkspaceTypes — config.profile wins, then stack-catalog lookup; deduplicates the resolution inlined in runAgentsGenerate/runDoctor and reused by the prettierignore plan.</item>
|
|
15
16
|
</CHANGE_SUMMARY>
|
|
16
17
|
*/
|
|
17
18
|
|
|
@@ -19,6 +20,8 @@ import * as fs from "../utils/sync-fs.ts";
|
|
|
19
20
|
import path from "node:path";
|
|
20
21
|
import { hasGeneratedMarker } from "../utils/index.ts";
|
|
21
22
|
import type { ProfileWorkspaceType } from "../profiles/profile-schema.ts";
|
|
23
|
+
import { listStackProfiles, type StackProfile } from "../profiles/stack-profile.ts";
|
|
24
|
+
import type { ForgeConfig } from "../config/forge-config.ts";
|
|
22
25
|
|
|
23
26
|
export type WorkspaceType = "app" | "service" | "package" | string;
|
|
24
27
|
|
|
@@ -45,6 +48,36 @@ const SKIP_DIRS = new Set([
|
|
|
45
48
|
".stryker-tmp",
|
|
46
49
|
]);
|
|
47
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Resolve the effective workspace-type catalog for discovery/nested-AGENTS.md:
|
|
53
|
+
* the loaded `config.profile` wins, then the first `project.stack` id whose
|
|
54
|
+
* profile declares workspaceTypes, else undefined (hardcoded fallback).
|
|
55
|
+
* Previously inlined in runAgentsGenerate/runDoctor — shared so every
|
|
56
|
+
* discoverWorkspaces consumer classifies workspaces identically.
|
|
57
|
+
*/
|
|
58
|
+
export function resolveWorkspaceTypes(
|
|
59
|
+
config: ForgeConfig,
|
|
60
|
+
forgeRoot: string | undefined,
|
|
61
|
+
): ProfileWorkspaceType[] | undefined {
|
|
62
|
+
const profile = config.profile as StackProfile | undefined;
|
|
63
|
+
if (profile?.workspaceTypes && profile.workspaceTypes.length > 0) {
|
|
64
|
+
return profile.workspaceTypes;
|
|
65
|
+
}
|
|
66
|
+
if (!forgeRoot) return undefined;
|
|
67
|
+
try {
|
|
68
|
+
const profiles = listStackProfiles(forgeRoot);
|
|
69
|
+
for (const stackId of config.project.stack) {
|
|
70
|
+
const stackProfile = profiles.find((p) => p.id === stackId);
|
|
71
|
+
if (stackProfile?.workspaceTypes && stackProfile.workspaceTypes.length > 0) {
|
|
72
|
+
return stackProfile.workspaceTypes;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
} catch {
|
|
76
|
+
// profile catalog not loadable — hardcoded detection applies
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
48
81
|
export function detectWorkspaceType(
|
|
49
82
|
dirPath: string,
|
|
50
83
|
workspaceTypes?: ProfileWorkspaceType[],
|
|
@@ -532,3 +532,131 @@ test("agents-generate omits the read-first block when compassDocs is absent (RFC
|
|
|
532
532
|
const agentsMd = await readFile(join(tempDir, "AGENTS.md"), "utf8");
|
|
533
533
|
expect(agentsMd).not.toContain("## Semantic layer — read first");
|
|
534
534
|
});
|
|
535
|
+
|
|
536
|
+
// Consumer field report: the block must reach every surface an agent reads —
|
|
537
|
+
// nested generated guides and opt-in hand-written files, not only generated roots.
|
|
538
|
+
|
|
539
|
+
test("agents-generate emits the read-first block into nested workspace guides", async () => {
|
|
540
|
+
await makeForgeYaml(tempDir);
|
|
541
|
+
await mkdir(join(tempDir, "packages", "my-pkg"), { recursive: true });
|
|
542
|
+
await writeFile(
|
|
543
|
+
join(tempDir, "packages", "my-pkg", "package.json"),
|
|
544
|
+
JSON.stringify({ name: "@test/my-pkg" }),
|
|
545
|
+
);
|
|
546
|
+
|
|
547
|
+
const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
548
|
+
expect(result.exitCode).toBe(0);
|
|
549
|
+
|
|
550
|
+
const nested = await readFile(join(tempDir, "packages", "my-pkg", "AGENTS.md"), "utf8");
|
|
551
|
+
expect(nested).toContain("<!-- forge:begin semantic-layer -->");
|
|
552
|
+
expect(nested).toContain("## Semantic layer — read first");
|
|
553
|
+
expect(nested).toContain("`docs/requirements.xml`");
|
|
554
|
+
expect(nested).toContain("<!-- forge:end semantic-layer -->");
|
|
555
|
+
// the footer stays the last substantive line — it is the merge boundary
|
|
556
|
+
// for legacy marker-less files and must not move below the block
|
|
557
|
+
expect(nested.indexOf("## Semantic layer — read first")).toBeLessThan(
|
|
558
|
+
nested.indexOf("See the root `AGENTS.md`"),
|
|
559
|
+
);
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
test("agents-generate expands the forge:semantic-layer sentinel in a hand-written root", async () => {
|
|
563
|
+
await makeForgeYaml(tempDir);
|
|
564
|
+
await writeFile(
|
|
565
|
+
join(tempDir, "AGENTS.md"),
|
|
566
|
+
"# Hand-written\n\nCustom intro.\n\n<!-- forge:semantic-layer -->\n\nCustom tail.\n",
|
|
567
|
+
"utf8",
|
|
568
|
+
);
|
|
569
|
+
|
|
570
|
+
const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
571
|
+
expect(result.exitCode).toBe(0);
|
|
572
|
+
expect(result.data?.rootSkipped).toBe(true);
|
|
573
|
+
expect(result.data?.injected).toContain("AGENTS.md");
|
|
574
|
+
|
|
575
|
+
const agentsMd = await readFile(join(tempDir, "AGENTS.md"), "utf8");
|
|
576
|
+
expect(agentsMd).toContain("<!-- forge:begin semantic-layer -->");
|
|
577
|
+
expect(agentsMd).toContain("## Semantic layer — read first");
|
|
578
|
+
expect(agentsMd).toContain("`docs/requirements.xml`");
|
|
579
|
+
expect(agentsMd).toContain("<!-- forge:end semantic-layer -->");
|
|
580
|
+
expect(agentsMd).toContain("Custom intro.");
|
|
581
|
+
expect(agentsMd).toContain("Custom tail.");
|
|
582
|
+
expect(agentsMd).not.toContain("<!-- forge:semantic-layer -->");
|
|
583
|
+
expect(agentsMd.match(/## Semantic layer — read first/g)).toHaveLength(1);
|
|
584
|
+
});
|
|
585
|
+
|
|
586
|
+
test("agents-generate refreshes a pasted semantic-layer region in a hand-written root", async () => {
|
|
587
|
+
await makeForgeYaml(tempDir);
|
|
588
|
+
const staleRegion = [
|
|
589
|
+
"<!-- forge:begin semantic-layer -->",
|
|
590
|
+
"",
|
|
591
|
+
"## Semantic layer — read first",
|
|
592
|
+
"",
|
|
593
|
+
"STALE",
|
|
594
|
+
"",
|
|
595
|
+
"<!-- forge:end semantic-layer -->",
|
|
596
|
+
].join("\n");
|
|
597
|
+
await writeFile(join(tempDir, "AGENTS.md"), `# Hand-written\n\n${staleRegion}\n`, "utf8");
|
|
598
|
+
|
|
599
|
+
const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
600
|
+
const agentsMd = await readFile(join(tempDir, "AGENTS.md"), "utf8");
|
|
601
|
+
expect(agentsMd).not.toContain("STALE");
|
|
602
|
+
expect(agentsMd).toContain("`docs/requirements.xml`");
|
|
603
|
+
expect(result.data?.injected).toContain("AGENTS.md");
|
|
604
|
+
|
|
605
|
+
// idempotent — a current region reports no further injection
|
|
606
|
+
const second = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
607
|
+
expect(second.data?.injected).toEqual([]);
|
|
608
|
+
});
|
|
609
|
+
|
|
610
|
+
test("agents-generate leaves a hand-written root without the sentinel untouched", async () => {
|
|
611
|
+
await makeForgeYaml(tempDir);
|
|
612
|
+
const original = "# Hand-written\nNo marker, no sentinel — fully authored.\n";
|
|
613
|
+
await writeFile(join(tempDir, "AGENTS.md"), original, "utf8");
|
|
614
|
+
|
|
615
|
+
const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
616
|
+
expect(result.exitCode).toBe(0);
|
|
617
|
+
expect(result.data?.injected).toEqual([]);
|
|
618
|
+
|
|
619
|
+
const agentsMd = await readFile(join(tempDir, "AGENTS.md"), "utf8");
|
|
620
|
+
expect(agentsMd).toBe(original);
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
test("agents-generate expands the sentinel in a hand-written nested guide", async () => {
|
|
624
|
+
await makeForgeYaml(tempDir);
|
|
625
|
+
await mkdir(join(tempDir, "packages", "my-pkg"), { recursive: true });
|
|
626
|
+
await writeFile(
|
|
627
|
+
join(tempDir, "packages", "my-pkg", "package.json"),
|
|
628
|
+
JSON.stringify({ name: "@test/my-pkg" }),
|
|
629
|
+
);
|
|
630
|
+
await writeFile(
|
|
631
|
+
join(tempDir, "packages", "my-pkg", "AGENTS.md"),
|
|
632
|
+
"# Custom\n\n<!-- forge:semantic-layer -->\n",
|
|
633
|
+
"utf8",
|
|
634
|
+
);
|
|
635
|
+
|
|
636
|
+
const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
637
|
+
expect(result.data?.injected).toContain(join("packages", "my-pkg", "AGENTS.md"));
|
|
638
|
+
|
|
639
|
+
const nested = await readFile(join(tempDir, "packages", "my-pkg", "AGENTS.md"), "utf8");
|
|
640
|
+
expect(nested).toContain("## Semantic layer — read first");
|
|
641
|
+
expect(nested).toContain("# Custom");
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
test("agents-generate emits no read-first block in nested guides when compassDocs is absent", async () => {
|
|
645
|
+
await makeForgeYaml(tempDir);
|
|
646
|
+
const yaml = (await readFile(join(tempDir, "forge.yaml"), "utf8")).replace(
|
|
647
|
+
" compassDocs: [docs/requirements.xml]\n",
|
|
648
|
+
"",
|
|
649
|
+
);
|
|
650
|
+
await writeFile(join(tempDir, "forge.yaml"), yaml, "utf8");
|
|
651
|
+
await mkdir(join(tempDir, "packages", "my-pkg"), { recursive: true });
|
|
652
|
+
await writeFile(
|
|
653
|
+
join(tempDir, "packages", "my-pkg", "package.json"),
|
|
654
|
+
JSON.stringify({ name: "@test/my-pkg" }),
|
|
655
|
+
);
|
|
656
|
+
|
|
657
|
+
const result = await runAgentsGenerate({ argv: [], flags: {} }, makeContext(tempDir));
|
|
658
|
+
expect(result.exitCode).toBe(0);
|
|
659
|
+
|
|
660
|
+
const nested = await readFile(join(tempDir, "packages", "my-pkg", "AGENTS.md"), "utf8");
|
|
661
|
+
expect(nested).not.toContain("## Semantic layer — read first");
|
|
662
|
+
});
|
|
@@ -73,6 +73,7 @@ describe("--compass-docs lifecycle flag (RFC-1253)", () => {
|
|
|
73
73
|
const init = mod.commands.find((c) => c.name === "forge.init")!;
|
|
74
74
|
|
|
75
75
|
const result = await init.execute(makeInput({ "compass-docs": true }), makeContext(root));
|
|
76
|
+
if (!result) throw new Error("forge.init returned no result");
|
|
76
77
|
expect(result.exitCode).toBe(0);
|
|
77
78
|
|
|
78
79
|
const req = await readFile(join(root, "docs", "requirements.xml"), "utf8");
|
|
@@ -88,6 +89,7 @@ describe("--compass-docs lifecycle flag (RFC-1253)", () => {
|
|
|
88
89
|
const init = mod.commands.find((c) => c.name === "forge.init")!;
|
|
89
90
|
|
|
90
91
|
const result = await init.execute(makeInput({}), makeContext(root));
|
|
92
|
+
if (!result) throw new Error("forge.init returned no result");
|
|
91
93
|
expect(result.exitCode).toBe(0);
|
|
92
94
|
|
|
93
95
|
await expect(readFile(join(root, "docs", "requirements.xml"), "utf8")).rejects.toThrow();
|
|
@@ -14,6 +14,7 @@ import { mkdtemp, mkdir, writeFile, readFile, rm } from "node:fs/promises";
|
|
|
14
14
|
import { tmpdir } from "node:os";
|
|
15
15
|
import { join } from "node:path";
|
|
16
16
|
import { runCompassDocsScaffold } from "../../os/compass/handlers/compass-docs-scaffold.ts";
|
|
17
|
+
import { runCompassDocsValidate } from "../../os/compass/handlers/compass-docs-validate.ts";
|
|
17
18
|
import { forgeYaml } from "../../os/compass/handlers/tests/forge-yaml-fixture.ts";
|
|
18
19
|
import { ambientIo } from "../utils/io.ts";
|
|
19
20
|
import type { ForgeCommandInput, ForgeRuntimeContext } from "../types.ts";
|
|
@@ -169,6 +170,72 @@ describe("compass.docs.scaffold — RFC-1253", () => {
|
|
|
169
170
|
expect(forgeYaml).toContain("docs/knowledge-graph.xml");
|
|
170
171
|
});
|
|
171
172
|
|
|
173
|
+
it("consumer field report: mixed-layout repo — ids derive from location, scaffold → validate needs zero manual edits", async () => {
|
|
174
|
+
// apps/ workspaces without astro/Dockerfile/service.config markers detect
|
|
175
|
+
// as "package" — under the old type-derived prefix they would emit pkg-*
|
|
176
|
+
// ids that COMPASS-DOC-02 resolves to nonexistent packages/<name> paths.
|
|
177
|
+
// The prefix must follow the location convention the validator enforces.
|
|
178
|
+
await mkdir(join(root, "apps", "api"), { recursive: true });
|
|
179
|
+
await writeFile(
|
|
180
|
+
join(root, "apps", "api", "package.json"),
|
|
181
|
+
JSON.stringify({ name: "@fixture/api" }),
|
|
182
|
+
);
|
|
183
|
+
await mkdir(join(root, "apps", "api-staging"), { recursive: true });
|
|
184
|
+
await writeFile(
|
|
185
|
+
join(root, "apps", "api-staging", "package.json"),
|
|
186
|
+
JSON.stringify({ name: "@fixture/api-staging" }),
|
|
187
|
+
);
|
|
188
|
+
await mkdir(join(root, "apps", "dashboard"), { recursive: true });
|
|
189
|
+
await writeFile(
|
|
190
|
+
join(root, "apps", "dashboard", "package.json"),
|
|
191
|
+
JSON.stringify({ name: "@fixture/dashboard" }),
|
|
192
|
+
);
|
|
193
|
+
await writeFile(join(root, "apps", "dashboard", "astro.config.mjs"), "export default {};\n");
|
|
194
|
+
await mkdir(join(root, "services", "beta"), { recursive: true });
|
|
195
|
+
await writeFile(
|
|
196
|
+
join(root, "services", "beta", "package.json"),
|
|
197
|
+
JSON.stringify({ name: "@fixture/beta" }),
|
|
198
|
+
);
|
|
199
|
+
await writeFile(join(root, "services", "beta", "service.config.yaml"), "name: beta\n");
|
|
200
|
+
// Locations the prefixed convention cannot express fall back to dotted ids.
|
|
201
|
+
await mkdir(join(root, "tools", "hammer"), { recursive: true });
|
|
202
|
+
await writeFile(
|
|
203
|
+
join(root, "tools", "hammer", "package.json"),
|
|
204
|
+
JSON.stringify({ name: "@fixture/hammer" }),
|
|
205
|
+
);
|
|
206
|
+
await mkdir(join(root, "packages", "alpha", "modules", "deep"), { recursive: true });
|
|
207
|
+
await writeFile(
|
|
208
|
+
join(root, "packages", "alpha", "modules", "deep", "package.json"),
|
|
209
|
+
JSON.stringify({ name: "@fixture/deep" }),
|
|
210
|
+
);
|
|
211
|
+
// knowledge-graph's root.rules node references AGENTS.md.
|
|
212
|
+
await writeFile(join(root, "AGENTS.md"), "# fixture\n");
|
|
213
|
+
|
|
214
|
+
const scaffold = await runCompassDocsScaffold(makeInput(), makeContext(root));
|
|
215
|
+
expect(scaffold.exitCode).toBe(0);
|
|
216
|
+
|
|
217
|
+
const kg = await readFile(join(root, "docs", "knowledge-graph.xml"), "utf8");
|
|
218
|
+
expect(kg).toContain('id="app-api"');
|
|
219
|
+
expect(kg).toContain('id="app-api-staging"');
|
|
220
|
+
expect(kg).toContain('id="app-dashboard"');
|
|
221
|
+
expect(kg).toContain('id="svc-beta"');
|
|
222
|
+
expect(kg).toContain('id="pkg-alpha"');
|
|
223
|
+
expect(kg).toContain('id="tools.hammer"');
|
|
224
|
+
expect(kg).toContain('id="packages.alpha.modules.deep"');
|
|
225
|
+
expect(kg).not.toContain('id="pkg-api"');
|
|
226
|
+
|
|
227
|
+
const tech = await readFile(join(root, "docs", "technology.xml"), "utf8");
|
|
228
|
+
expect(tech).toContain('id="app-api"');
|
|
229
|
+
expect(tech).not.toContain('id="pkg-api"');
|
|
230
|
+
|
|
231
|
+
const validation = await runCompassDocsValidate(makeInput(), makeContext(root));
|
|
232
|
+
expect(
|
|
233
|
+
validation.data?.diagnostics.filter((d) => d.severity === "error"),
|
|
234
|
+
"scaffold output must validate clean — check workspaceNodeId prefix derivation",
|
|
235
|
+
).toEqual([]);
|
|
236
|
+
expect(validation.exitCode).toBe(0);
|
|
237
|
+
});
|
|
238
|
+
|
|
172
239
|
it("dry-run reports the manifest without writing", async () => {
|
|
173
240
|
const result = await runCompassDocsScaffold(
|
|
174
241
|
makeInput({ "dry-run": true }),
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
<MODULE_CONTRACT>
|
|
3
|
+
<purpose>Unit tests for the forge-version-sync doctor check — installed
|
|
4
|
+
@warpgogol/forge package version vs forge.yaml forge.syncedVersion. Drift is
|
|
5
|
+
a warn (pnpm up bumps the package without running forge.upgrade); missing
|
|
6
|
+
sides pass with a skipped note.</purpose>
|
|
7
|
+
</MODULE_CONTRACT>
|
|
8
|
+
<CHANGE_SUMMARY>
|
|
9
|
+
<item>Initial forge-version-sync doctor check tests.</item>
|
|
10
|
+
</CHANGE_SUMMARY>
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { test, expect, beforeEach, afterEach } from "vitest";
|
|
14
|
+
import { mkdtemp, rm, mkdir, writeFile } from "node:fs/promises";
|
|
15
|
+
import { tmpdir } from "node:os";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { runDoctor } from "../onboarding/doctor.ts";
|
|
18
|
+
import { createForgeCoreModule } from "../../os/core/core.module.ts";
|
|
19
|
+
import { ambientIo } from "../utils/io.ts";
|
|
20
|
+
import type { ForgeCommandInput, ForgeRuntimeContext } from "../types.ts";
|
|
21
|
+
|
|
22
|
+
let tempDir: string;
|
|
23
|
+
|
|
24
|
+
beforeEach(async () => {
|
|
25
|
+
tempDir = await mkdtemp(join(tmpdir(), "doctor-version-sync-"));
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
afterEach(async () => {
|
|
29
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function makeContext(): ForgeRuntimeContext {
|
|
33
|
+
return {
|
|
34
|
+
workspaceRoot: tempDir,
|
|
35
|
+
logger: {
|
|
36
|
+
section: () => {},
|
|
37
|
+
success: () => {},
|
|
38
|
+
warn: () => {},
|
|
39
|
+
error: () => {},
|
|
40
|
+
info: () => {},
|
|
41
|
+
},
|
|
42
|
+
dryRun: false,
|
|
43
|
+
outputFormat: "json",
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function forgeYaml(syncedVersion: string | null): string {
|
|
48
|
+
const forgeSection =
|
|
49
|
+
syncedVersion !== null ? `\nforge:\n syncedVersion: ${syncedVersion}\n` : "";
|
|
50
|
+
return `schema: "forge/config@1"
|
|
51
|
+
project:
|
|
52
|
+
name: test-project
|
|
53
|
+
stack: []
|
|
54
|
+
packageManager: pnpm
|
|
55
|
+
paths:
|
|
56
|
+
rfcsDir: docs/rfcs
|
|
57
|
+
adrsDir: docs/adrs
|
|
58
|
+
plansDir: docs/plans
|
|
59
|
+
auditsDir: docs/audits
|
|
60
|
+
specsDir: docs/specs
|
|
61
|
+
skillsDir: .agents/skills
|
|
62
|
+
sessionsDir: docs/sessions
|
|
63
|
+
bindings:
|
|
64
|
+
schema: forge/bindings@1
|
|
65
|
+
commands:
|
|
66
|
+
validateRfc: null
|
|
67
|
+
validateAdr: null
|
|
68
|
+
implementStamp: null
|
|
69
|
+
typecheck: null
|
|
70
|
+
test: null
|
|
71
|
+
scopedBuild: null
|
|
72
|
+
specValidate: null
|
|
73
|
+
sessionSave: null
|
|
74
|
+
paths:
|
|
75
|
+
invariantsFile: null
|
|
76
|
+
compassDocs: []
|
|
77
|
+
reviewsDir: null
|
|
78
|
+
handoffsDir: null
|
|
79
|
+
sessionsDir: null${forgeSection}
|
|
80
|
+
`;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
async function installForgePackage(version: string): Promise<void> {
|
|
84
|
+
const pkgDir = join(tempDir, "node_modules", "@warpgogol", "forge");
|
|
85
|
+
await mkdir(pkgDir, { recursive: true });
|
|
86
|
+
await writeFile(
|
|
87
|
+
join(pkgDir, "package.json"),
|
|
88
|
+
JSON.stringify({ name: "@warpgogol/forge", version }),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const input: ForgeCommandInput = { argv: [], flags: {} };
|
|
93
|
+
|
|
94
|
+
test("forge-version-sync passes when installed version matches syncedVersion", async () => {
|
|
95
|
+
await installForgePackage("1.2.3");
|
|
96
|
+
await writeFile(join(tempDir, "forge.yaml"), forgeYaml("1.2.3"), "utf8");
|
|
97
|
+
|
|
98
|
+
const result = await runDoctor(input, makeContext());
|
|
99
|
+
const check = result.data!.checks.find((c) => c.name === "forge-version-sync");
|
|
100
|
+
expect(check).toBeDefined();
|
|
101
|
+
expect(check!.status).toBe("pass");
|
|
102
|
+
expect(check!.message).toContain("1.2.3");
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test("forge-version-sync warns when installed version diverges from syncedVersion", async () => {
|
|
106
|
+
await installForgePackage("9.9.9");
|
|
107
|
+
await writeFile(join(tempDir, "forge.yaml"), forgeYaml("1.0.0"), "utf8");
|
|
108
|
+
|
|
109
|
+
const result = await runDoctor(input, makeContext());
|
|
110
|
+
const check = result.data!.checks.find((c) => c.name === "forge-version-sync");
|
|
111
|
+
expect(check).toBeDefined();
|
|
112
|
+
expect(check!.status).toBe("warn");
|
|
113
|
+
expect(check!.message).toContain("9.9.9");
|
|
114
|
+
expect(check!.message).toContain("1.0.0");
|
|
115
|
+
expect(check!.message).toContain("forge upgrade");
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test("forge-version-sync passes when no syncedVersion recorded", async () => {
|
|
119
|
+
await installForgePackage("1.2.3");
|
|
120
|
+
await writeFile(join(tempDir, "forge.yaml"), forgeYaml(null), "utf8");
|
|
121
|
+
|
|
122
|
+
const result = await runDoctor(input, makeContext());
|
|
123
|
+
const check = result.data!.checks.find((c) => c.name === "forge-version-sync");
|
|
124
|
+
expect(check).toBeDefined();
|
|
125
|
+
expect(check!.status).toBe("pass");
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test("forge.doctor wraps warn-only results as optional next-steps, fails as required", async () => {
|
|
129
|
+
await installForgePackage("9.9.9");
|
|
130
|
+
await writeFile(join(tempDir, "forge.yaml"), forgeYaml("1.0.0"), "utf8");
|
|
131
|
+
// .agents/skills missing is the only hard fail on a minimal workspace —
|
|
132
|
+
// everything else warns or passes, so the run lands warn-only.
|
|
133
|
+
await mkdir(join(tempDir, ".agents", "skills"), { recursive: true });
|
|
134
|
+
|
|
135
|
+
const mod = await createForgeCoreModule();
|
|
136
|
+
const doctor = mod.commands.find((c) => c.name === "forge.doctor")!;
|
|
137
|
+
const ctx: ForgeRuntimeContext = {
|
|
138
|
+
...makeContext(),
|
|
139
|
+
io: ambientIo,
|
|
140
|
+
} as unknown as ForgeRuntimeContext;
|
|
141
|
+
const result = await doctor.execute(input, ctx);
|
|
142
|
+
expect(result).toBeDefined();
|
|
143
|
+
if (!result) return;
|
|
144
|
+
|
|
145
|
+
const data = result.data as { checks?: { status: string }[]; allPass?: boolean } | undefined;
|
|
146
|
+
const checks = data?.checks ?? [];
|
|
147
|
+
const allPass = data?.allPass === true;
|
|
148
|
+
const hasFails = checks.some((c) => c.status === "fail");
|
|
149
|
+
// This workspace should surface warnings (version mismatch at minimum)
|
|
150
|
+
// without hard failures — if the fixture ever drifts, update the scenario.
|
|
151
|
+
expect(allPass).toBe(false);
|
|
152
|
+
expect(hasFails).toBe(false);
|
|
153
|
+
expect(result.nextSteps).toHaveLength(1);
|
|
154
|
+
expect(result.nextSteps![0].kind).toBe("optional");
|
|
155
|
+
});
|