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.
@@ -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 artifactFile = stageSchema(stage, track).artifactFile;
15
- const candidates = [
16
- path.join(projectRoot, RUNTIME_ROOT, "artifacts", artifactFile),
17
- path.join(projectRoot, artifactFile)
18
- ];
19
- for (const candidate of candidates) {
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, artifactFile) {
359
- const artifactPath = path.join(projectRoot, RUNTIME_ROOT, "artifacts", artifactFile);
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, schema.artifactFile);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclaw-cli",
3
- "version": "0.48.27",
3
+ "version": "0.48.29",
4
4
  "description": "Installer-first flow toolkit for coding agents",
5
5
  "type": "module",
6
6
  "bin": {