cclaw-cli 0.48.27 → 0.48.29
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/dist/artifact-linter.js +16 -5
- package/dist/artifact-paths.d.ts +28 -0
- package/dist/artifact-paths.js +261 -0
- package/dist/content/contracts.js +3 -2
- package/dist/content/stage-schema.d.ts +1 -1
- package/dist/content/stage-schema.js +71 -15
- package/dist/content/stages/_lint-metadata/index.d.ts +2 -0
- package/dist/content/stages/_lint-metadata/index.js +79 -0
- package/dist/content/stages/brainstorm.js +140 -139
- package/dist/content/stages/design.js +243 -242
- package/dist/content/stages/plan.js +1 -2
- package/dist/content/stages/review.js +0 -1
- package/dist/content/stages/schema-types.d.ts +22 -3
- package/dist/content/stages/scope.js +215 -207
- package/dist/content/stages/ship.js +0 -7
- package/dist/content/stages/spec.js +2 -3
- package/dist/content/stages/tdd.d.ts +2 -2
- package/dist/content/stages/tdd.js +1 -3
- package/dist/gate-evidence.js +7 -17
- package/dist/internal/advance-stage.js +9 -3
- package/package.json +1 -1
package/dist/gate-evidence.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { checkReviewSecurityNoChangeAttestation, checkReviewVerdictConsistency, extractMarkdownSectionBody, lintArtifact, validateReviewArmy } from "./artifact-linter.js";
|
|
4
|
+
import { resolveArtifactPath } from "./artifact-paths.js";
|
|
4
5
|
import { RUNTIME_ROOT } from "./constants.js";
|
|
5
6
|
import { stageSchema } from "./content/stage-schema.js";
|
|
6
7
|
import { readDelegationLedger } from "./delegation.js";
|
|
@@ -11,23 +12,12 @@ import { parseTddCycleLog, validateTddCycleOrder } from "./tdd-cycle.js";
|
|
|
11
12
|
import { buildTraceMatrix } from "./trace-matrix.js";
|
|
12
13
|
import { FLOW_STAGES } from "./types.js";
|
|
13
14
|
async function currentStageArtifactExists(projectRoot, stage, track) {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (await exists(candidate))
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
// Artifact-linter also accepts the file under current working directory fallback; stat once more.
|
|
24
|
-
try {
|
|
25
|
-
await fs.access(path.join(projectRoot, artifactFile));
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
15
|
+
const resolved = await resolveArtifactPath(stage, {
|
|
16
|
+
projectRoot,
|
|
17
|
+
track,
|
|
18
|
+
intent: "read"
|
|
19
|
+
});
|
|
20
|
+
return exists(resolved.absPath);
|
|
31
21
|
}
|
|
32
22
|
async function readArtifactMarkdown(projectRoot, artifactFile) {
|
|
33
23
|
const candidates = [
|
|
@@ -2,6 +2,7 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import process from "node:process";
|
|
5
|
+
import { resolveArtifactPath } from "../artifact-paths.js";
|
|
5
6
|
import { RUNTIME_ROOT, SHIP_FINALIZATION_MODES } from "../constants.js";
|
|
6
7
|
import { stageSchema } from "../content/stage-schema.js";
|
|
7
8
|
import { appendDelegation, checkMandatoryDelegations } from "../delegation.js";
|
|
@@ -355,8 +356,13 @@ function withLearningsHarvestMarker(artifactMarkdown, appendedEntries, skippedDu
|
|
|
355
356
|
const suffix = artifactMarkdown.endsWith("\n") ? "" : "\n";
|
|
356
357
|
return `${artifactMarkdown}${suffix}${LEARNINGS_HARVEST_MARKER_PREFIX}${new Date().toISOString()} appended=${appendedEntries} skipped=${skippedDuplicates} -->\n`;
|
|
357
358
|
}
|
|
358
|
-
async function harvestStageLearnings(projectRoot, stage,
|
|
359
|
-
const
|
|
359
|
+
async function harvestStageLearnings(projectRoot, stage, track) {
|
|
360
|
+
const resolvedArtifact = await resolveArtifactPath(stage, {
|
|
361
|
+
projectRoot,
|
|
362
|
+
track,
|
|
363
|
+
intent: "read"
|
|
364
|
+
});
|
|
365
|
+
const artifactPath = resolvedArtifact.absPath;
|
|
360
366
|
let raw = "";
|
|
361
367
|
try {
|
|
362
368
|
raw = await fs.readFile(artifactPath, "utf8");
|
|
@@ -560,7 +566,7 @@ async function runAdvanceStage(projectRoot, args, io) {
|
|
|
560
566
|
}
|
|
561
567
|
return 1;
|
|
562
568
|
}
|
|
563
|
-
const learningsHarvest = await harvestStageLearnings(projectRoot, args.stage,
|
|
569
|
+
const learningsHarvest = await harvestStageLearnings(projectRoot, args.stage, flowState.track);
|
|
564
570
|
if (!learningsHarvest.ok) {
|
|
565
571
|
io.stderr.write(`cclaw internal advance-stage: learnings harvest failed for "${schema.artifactFile}". ${learningsHarvest.details}\n`);
|
|
566
572
|
return 1;
|