cclaw-cli 2.0.0 → 3.0.0

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,5 @@
1
1
  import fs from "node:fs/promises";
2
2
  import { resolveArtifactPath as resolveStageArtifactPath } from "./artifact-paths.js";
3
- import { readConfig } from "./config.js";
4
3
  import { exists } from "./fs-utils.js";
5
4
  import { stageSchema } from "./content/stage-schema.js";
6
5
  import { duplicateH2Headings, extractH2Sections, extractLockedDecisionAnchors, extractRequirementIdsFromMarkdown, isShortCircuitActivated, normalizeHeadingTitle, parseFrontmatter, parseLearningsSection, sectionBodyByAnyName, sectionBodyByHeadingPrefix, sectionBodyByName, validateSectionBody } from "./artifact-linter/shared.js";
@@ -58,7 +57,6 @@ export async function lintArtifact(projectRoot, stage, track = "standard") {
58
57
  details: `Duplicate H2 heading(s): ${duplicateHeadings.join(", ")}. Merge edits into the existing heading to avoid split contracts.`
59
58
  });
60
59
  }
61
- const projectConfig = await readConfig(projectRoot);
62
60
  const parsedFrontmatter = parseFrontmatter(raw);
63
61
  const frontmatterMissingKeys = FRONTMATTER_REQUIRED_KEYS.filter((key) => {
64
62
  const value = parsedFrontmatter.values[key];
@@ -97,8 +95,8 @@ export async function lintArtifact(projectRoot, stage, track = "standard") {
97
95
  });
98
96
  const brainstormShortCircuitBody = stage === "brainstorm" ? sectionBodyByName(sections, "Short-Circuit Decision") : null;
99
97
  const brainstormShortCircuitActivated = stage === "brainstorm" && isShortCircuitActivated(brainstormShortCircuitBody);
100
- const scopePreAuditEnabled = projectConfig.optInAudits?.scopePreAudit === true;
101
- const staleDiagramAuditEnabled = projectConfig.optInAudits?.staleDiagramAudit === true;
98
+ const scopePreAuditEnabled = true;
99
+ const staleDiagramAuditEnabled = true;
102
100
  const isTrivialOverride = Boolean(schema.trivialOverrideSections &&
103
101
  schema.trivialOverrideSections.length > 0 &&
104
102
  (/trivial.change|mini.design|escape.hatch/iu.test(raw) ||
package/dist/cli.js CHANGED
@@ -425,11 +425,8 @@ async function runCommand(parsed, ctx) {
425
425
  info(ctx, `Detected harnesses from repo: ${resolved.detectedHarnesses.join(", ")}`);
426
426
  }
427
427
  ctx.stdout.write(`${JSON.stringify({
428
- track: previewConfig.defaultTrack ?? "standard",
428
+ track: effectiveTrack ?? "standard",
429
429
  harnesses: previewConfig.harnesses,
430
- strictness: previewConfig.strictness ?? "advisory",
431
- gitHookGuards: previewConfig.gitHookGuards,
432
- languageRulePacks: previewConfig.languageRulePacks,
433
430
  generatedSurfaces: previewSurfaces
434
431
  }, null, 2)}\n`);
435
432
  return 0;
@@ -444,11 +441,7 @@ async function runCommand(parsed, ctx) {
444
441
  }
445
442
  const trackNote = effectiveTrack ? ` (track=${effectiveTrack})` : "";
446
443
  info(ctx, `Initialized .cclaw runtime and generated harness shims${trackNote}`);
447
- // Point new users at the one config surface they might actually flip —
448
- // `strictness` and `gitHookGuards` — without overselling the other knobs
449
- // (those live behind docs/config.md until someone needs them).
450
- info(ctx, "Config: .cclaw/config.yaml (strictness=advisory, gitHookGuards=false).");
451
- info(ctx, "Need stricter guards or language rule packs? See docs/config.md.");
444
+ info(ctx, "Config: .cclaw/config.yaml (harnesses + auto-managed version stamps).");
452
445
  await maybeEnableCodexHooksFlag(effectiveHarnesses, parsed, ctx);
453
446
  return 0;
454
447
  }
package/dist/config.d.ts CHANGED
@@ -1,4 +1,9 @@
1
1
  import type { CclawConfig, FlowTrack, HarnessId, LanguageRulePack } from "./types.js";
2
+ export declare const DEFAULT_TDD_TEST_PATH_PATTERNS: readonly string[];
3
+ export declare const DEFAULT_TDD_TEST_GLOBS: readonly string[];
4
+ export declare const DEFAULT_TDD_PRODUCTION_PATH_PATTERNS: readonly string[];
5
+ export declare const DEFAULT_COMPOUND_RECURRENCE_THRESHOLD = 3;
6
+ export declare const DEFAULT_EARLY_LOOP_MAX_ITERATIONS = 3;
2
7
  export interface ConfigWarningState {
3
8
  emitted: Set<string>;
4
9
  }
@@ -10,73 +15,12 @@ export declare class InvalidConfigError extends Error {
10
15
  constructor(message: string);
11
16
  }
12
17
  export declare function configPath(projectRoot: string): string;
13
- /**
14
- * Default test-path patterns used by the workflow-guard hook to classify TDD writes.
15
- *
16
- * Scope is intentionally narrow and language-agnostic; users can extend this
17
- * list in config when their repository uses different conventions.
18
- */
19
- export declare const DEFAULT_TDD_TEST_PATH_PATTERNS: readonly string[];
20
- /**
21
- * Legacy alias kept for backwards compatibility with `tddTestGlobs`.
22
- * Prefer `tdd.testPathPatterns` in new configurations.
23
- */
24
- export declare const DEFAULT_TDD_TEST_GLOBS: readonly string[];
25
- export declare const DEFAULT_TDD_PRODUCTION_PATH_PATTERNS: readonly string[];
26
- export declare const DEFAULT_COMPOUND_RECURRENCE_THRESHOLD = 3;
27
- export declare const DEFAULT_EARLY_LOOP_MAX_ITERATIONS = 3;
28
- /**
29
- * Populated runtime view of config values that downstream callers (install,
30
- * observe, sync/runtime checks) consume. Always has the derived guard modes populated,
31
- * regardless of whether the user wrote `strictness`, the legacy keys, both,
32
- * or neither.
33
- */
34
- export declare function createDefaultConfig(harnesses?: HarnessId[], defaultTrack?: FlowTrack): CclawConfig;
35
- /**
36
- * Probe common project-root manifests to infer which language rule packs the
37
- * user would reasonably want. Pure-functional best-effort: any filesystem
38
- * error is swallowed, producing an empty list — the user can always override
39
- * by hand.
40
- *
41
- * Called from `cclaw init` only (not `readConfig`), so subsequent upgrades
42
- * never surprise a user who intentionally cleared the list.
43
- */
44
- export declare function detectLanguageRulePacks(projectRoot: string): Promise<LanguageRulePack[]>;
45
- export declare function readConfig(projectRoot: string, options?: ReadConfigOptions): Promise<CclawConfig>;
46
- /**
47
- * Fields that live on the populated runtime `CclawConfig` but are considered
48
- * "advanced" — we keep them in the in-memory object so downstream callers
49
- * don't have to branch, but we do **not** write them to `config.yaml` unless
50
- * the user set them explicitly. Keeps the default template small and honest:
51
- * only knobs a new user would meaningfully flip show up.
52
- */
53
- type AdvancedConfigKey = "vcs" | "tddTestGlobs" | "tdd" | "compound" | "earlyLoop" | "defaultTrack" | "languageRulePacks" | "trackHeuristics" | "sliceReview" | "ironLaws" | "optInAudits" | "reviewLoop";
54
- /**
55
- * Options controlling the serialisation shape of `config.yaml`.
56
- *
57
- * - `"full"` (default): write every field on the `CclawConfig` object that
58
- * isn't `undefined`. Preserves existing shapes and keeps legacy callers
59
- * working without migration.
60
- * - `"minimal"`: write only the user-facing knobs (`MINIMAL_CONFIG_KEYS`)
61
- * plus any non-empty `languageRulePacks` (so auto-detected values survive
62
- * a fresh `cclaw init`). Use this when generating the default template;
63
- * power users can still add advanced keys by hand.
64
- *
65
- * `advancedKeysPresent` upgrades an otherwise-minimal serialisation by
66
- * including the listed advanced keys. `cclaw upgrade` uses it to preserve
67
- * the exact shape a user hand-authored, while still re-minimising configs
68
- * where the user stayed at defaults.
69
- */
18
+ export declare function createDefaultConfig(harnesses?: HarnessId[], _defaultTrack?: FlowTrack): CclawConfig;
19
+ export declare function detectLanguageRulePacks(_projectRoot: string): Promise<LanguageRulePack[]>;
20
+ export declare function readConfig(projectRoot: string, _options?: ReadConfigOptions): Promise<CclawConfig>;
70
21
  export interface WriteConfigOptions {
71
22
  mode?: "full" | "minimal";
72
- advancedKeysPresent?: ReadonlySet<AdvancedConfigKey>;
23
+ advancedKeysPresent?: ReadonlySet<never>;
73
24
  }
74
- export declare function writeConfig(projectRoot: string, config: CclawConfig, options?: WriteConfigOptions): Promise<void>;
75
- /**
76
- * Enumerate which advanced keys are currently set in the on-disk config.
77
- * Used by `cclaw upgrade` to preserve the user's existing shape — if they
78
- * wrote `tddTestGlobs` by hand, the upgrade keeps it; if they didn't, the
79
- * upgrade stays minimal.
80
- */
81
- export declare function detectAdvancedKeys(projectRoot: string): Promise<ReadonlySet<AdvancedConfigKey>>;
82
- export {};
25
+ export declare function writeConfig(projectRoot: string, config: CclawConfig, _options?: WriteConfigOptions): Promise<void>;
26
+ export declare function detectAdvancedKeys(_projectRoot: string): Promise<ReadonlySet<never>>;