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.
- package/dist/artifact-linter.js +2 -4
- package/dist/cli.js +2 -9
- package/dist/config.d.ts +11 -67
- package/dist/config.js +59 -649
- package/dist/content/hook-events.js +0 -3
- package/dist/content/hook-manifest.d.ts +5 -2
- package/dist/content/hook-manifest.js +18 -64
- package/dist/content/node-hooks.d.ts +0 -26
- package/dist/content/node-hooks.js +237 -105
- package/dist/content/observe.js +2 -1
- package/dist/content/opencode-plugin.js +1 -72
- package/dist/content/stages/design.js +2 -2
- package/dist/content/stages/plan.js +2 -2
- package/dist/content/stages/scope.js +3 -3
- package/dist/content/stages/tdd.js +11 -11
- package/dist/gate-evidence.js +1 -5
- package/dist/hook-schema.js +3 -0
- package/dist/hook-schemas/claude-hooks.v1.json +0 -2
- package/dist/hook-schemas/codex-hooks.v1.json +0 -3
- package/dist/hook-schemas/cursor-hooks.v1.json +0 -2
- package/dist/install.d.ts +2 -7
- package/dist/install.js +20 -120
- package/dist/internal/compound-readiness.js +1 -16
- package/dist/internal/early-loop-status.js +1 -3
- package/dist/internal/runtime-integrity.js +0 -20
- package/dist/policy.js +6 -9
- package/dist/runtime/run-hook.mjs +237 -213
- package/dist/tdd-verification-evidence.js +6 -18
- package/dist/types.d.ts +0 -56
- package/package.json +1 -1
package/dist/artifact-linter.js
CHANGED
|
@@ -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 =
|
|
101
|
-
const staleDiagramAuditEnabled =
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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<
|
|
23
|
+
advancedKeysPresent?: ReadonlySet<never>;
|
|
73
24
|
}
|
|
74
|
-
export declare function writeConfig(projectRoot: string, config: CclawConfig,
|
|
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>>;
|