cclaw-cli 7.7.1 → 8.1.1
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/README.md +211 -134
- package/dist/artifact-frontmatter.d.ts +51 -0
- package/dist/artifact-frontmatter.js +131 -0
- package/dist/artifact-paths.d.ts +7 -27
- package/dist/artifact-paths.js +20 -249
- package/dist/cancel.d.ts +16 -0
- package/dist/cancel.js +66 -0
- package/dist/cli.d.ts +2 -27
- package/dist/cli.js +107 -511
- package/dist/compound.d.ts +26 -0
- package/dist/compound.js +96 -0
- package/dist/config.d.ts +14 -51
- package/dist/config.js +23 -359
- package/dist/constants.d.ts +11 -18
- package/dist/constants.js +19 -106
- package/dist/content/antipatterns.d.ts +1 -0
- package/dist/content/antipatterns.js +109 -0
- package/dist/content/artifact-templates.d.ts +10 -0
- package/dist/content/artifact-templates.js +550 -0
- package/dist/content/cancel-command.d.ts +2 -2
- package/dist/content/cancel-command.js +25 -17
- package/dist/content/core-agents.d.ts +9 -233
- package/dist/content/core-agents.js +39 -768
- package/dist/content/decision-protocol.d.ts +1 -12
- package/dist/content/decision-protocol.js +27 -20
- package/dist/content/examples.d.ts +8 -42
- package/dist/content/examples.js +293 -425
- package/dist/content/idea-command.d.ts +2 -0
- package/dist/content/idea-command.js +38 -0
- package/dist/content/iron-laws.d.ts +4 -138
- package/dist/content/iron-laws.js +18 -197
- package/dist/content/meta-skill.d.ts +1 -3
- package/dist/content/meta-skill.js +57 -134
- package/dist/content/node-hooks.d.ts +12 -8
- package/dist/content/node-hooks.js +188 -838
- package/dist/content/recovery.d.ts +8 -0
- package/dist/content/recovery.js +179 -0
- package/dist/content/reference-patterns.d.ts +4 -13
- package/dist/content/reference-patterns.js +260 -389
- package/dist/content/research-playbooks.d.ts +8 -8
- package/dist/content/research-playbooks.js +108 -121
- package/dist/content/review-loop.d.ts +6 -192
- package/dist/content/review-loop.js +29 -731
- package/dist/content/skills.d.ts +8 -38
- package/dist/content/skills.js +681 -732
- package/dist/content/specialist-prompts/architect.d.ts +1 -0
- package/dist/content/specialist-prompts/architect.js +225 -0
- package/dist/content/specialist-prompts/brainstormer.d.ts +1 -0
- package/dist/content/specialist-prompts/brainstormer.js +168 -0
- package/dist/content/specialist-prompts/index.d.ts +2 -0
- package/dist/content/specialist-prompts/index.js +14 -0
- package/dist/content/specialist-prompts/planner.d.ts +1 -0
- package/dist/content/specialist-prompts/planner.js +182 -0
- package/dist/content/specialist-prompts/reviewer.d.ts +1 -0
- package/dist/content/specialist-prompts/reviewer.js +193 -0
- package/dist/content/specialist-prompts/security-reviewer.d.ts +1 -0
- package/dist/content/specialist-prompts/security-reviewer.js +133 -0
- package/dist/content/specialist-prompts/slice-builder.d.ts +1 -0
- package/dist/content/specialist-prompts/slice-builder.js +232 -0
- package/dist/content/stage-playbooks.d.ts +8 -0
- package/dist/content/stage-playbooks.js +404 -0
- package/dist/content/start-command.d.ts +2 -12
- package/dist/content/start-command.js +221 -207
- package/dist/flow-state.d.ts +21 -178
- package/dist/flow-state.js +67 -170
- package/dist/fs-utils.d.ts +6 -26
- package/dist/fs-utils.js +29 -162
- package/dist/gitignore.d.ts +2 -1
- package/dist/gitignore.js +51 -34
- package/dist/harness-detect.d.ts +10 -0
- package/dist/harness-detect.js +29 -0
- package/dist/harness-prompt.d.ts +26 -0
- package/dist/harness-prompt.js +142 -0
- package/dist/install.d.ts +35 -15
- package/dist/install.js +238 -1347
- package/dist/knowledge-store.d.ts +19 -163
- package/dist/knowledge-store.js +56 -590
- package/dist/logger.d.ts +8 -3
- package/dist/logger.js +13 -4
- package/dist/orchestrator-routing.d.ts +29 -0
- package/dist/orchestrator-routing.js +156 -0
- package/dist/run-persistence.d.ts +7 -118
- package/dist/run-persistence.js +29 -845
- package/dist/runtime/run-hook.entry.d.ts +1 -3
- package/dist/runtime/run-hook.entry.js +19 -4
- package/dist/runtime/run-hook.mjs +13 -1024
- package/dist/types.d.ts +25 -261
- package/dist/types.js +8 -36
- package/package.json +6 -3
- package/dist/artifact-linter/brainstorm.d.ts +0 -2
- package/dist/artifact-linter/brainstorm.js +0 -353
- package/dist/artifact-linter/design.d.ts +0 -18
- package/dist/artifact-linter/design.js +0 -444
- package/dist/artifact-linter/findings-dedup.d.ts +0 -56
- package/dist/artifact-linter/findings-dedup.js +0 -232
- package/dist/artifact-linter/plan.d.ts +0 -2
- package/dist/artifact-linter/plan.js +0 -826
- package/dist/artifact-linter/review-army.d.ts +0 -49
- package/dist/artifact-linter/review-army.js +0 -520
- package/dist/artifact-linter/review.d.ts +0 -2
- package/dist/artifact-linter/review.js +0 -113
- package/dist/artifact-linter/scope.d.ts +0 -2
- package/dist/artifact-linter/scope.js +0 -158
- package/dist/artifact-linter/shared.d.ts +0 -637
- package/dist/artifact-linter/shared.js +0 -2163
- package/dist/artifact-linter/ship.d.ts +0 -2
- package/dist/artifact-linter/ship.js +0 -250
- package/dist/artifact-linter/spec.d.ts +0 -2
- package/dist/artifact-linter/spec.js +0 -176
- package/dist/artifact-linter/tdd.d.ts +0 -118
- package/dist/artifact-linter/tdd.js +0 -1404
- package/dist/artifact-linter.d.ts +0 -15
- package/dist/artifact-linter.js +0 -517
- package/dist/codex-feature-flag.d.ts +0 -58
- package/dist/codex-feature-flag.js +0 -193
- package/dist/content/closeout-guidance.d.ts +0 -14
- package/dist/content/closeout-guidance.js +0 -44
- package/dist/content/diff-command.d.ts +0 -1
- package/dist/content/diff-command.js +0 -43
- package/dist/content/harness-doc.d.ts +0 -1
- package/dist/content/harness-doc.js +0 -65
- package/dist/content/hook-events.d.ts +0 -9
- package/dist/content/hook-events.js +0 -23
- package/dist/content/hook-manifest.d.ts +0 -81
- package/dist/content/hook-manifest.js +0 -156
- package/dist/content/hooks.d.ts +0 -11
- package/dist/content/hooks.js +0 -1972
- package/dist/content/idea.d.ts +0 -60
- package/dist/content/idea.js +0 -416
- package/dist/content/language-policy.d.ts +0 -2
- package/dist/content/language-policy.js +0 -13
- package/dist/content/learnings.d.ts +0 -6
- package/dist/content/learnings.js +0 -141
- package/dist/content/observe.d.ts +0 -19
- package/dist/content/observe.js +0 -86
- package/dist/content/opencode-plugin.d.ts +0 -1
- package/dist/content/opencode-plugin.js +0 -635
- package/dist/content/review-prompts.d.ts +0 -1
- package/dist/content/review-prompts.js +0 -104
- package/dist/content/runtime-shared-snippets.d.ts +0 -8
- package/dist/content/runtime-shared-snippets.js +0 -80
- package/dist/content/session-hooks.d.ts +0 -7
- package/dist/content/session-hooks.js +0 -107
- package/dist/content/skills-elicitation.d.ts +0 -1
- package/dist/content/skills-elicitation.js +0 -167
- package/dist/content/stage-command.d.ts +0 -2
- package/dist/content/stage-command.js +0 -17
- package/dist/content/stage-schema.d.ts +0 -117
- package/dist/content/stage-schema.js +0 -955
- package/dist/content/stages/_lint-metadata/index.d.ts +0 -2
- package/dist/content/stages/_lint-metadata/index.js +0 -97
- package/dist/content/stages/brainstorm.d.ts +0 -2
- package/dist/content/stages/brainstorm.js +0 -184
- package/dist/content/stages/design.d.ts +0 -2
- package/dist/content/stages/design.js +0 -288
- package/dist/content/stages/index.d.ts +0 -8
- package/dist/content/stages/index.js +0 -11
- package/dist/content/stages/plan.d.ts +0 -2
- package/dist/content/stages/plan.js +0 -191
- package/dist/content/stages/review.d.ts +0 -2
- package/dist/content/stages/review.js +0 -240
- package/dist/content/stages/schema-types.d.ts +0 -203
- package/dist/content/stages/schema-types.js +0 -1
- package/dist/content/stages/scope.d.ts +0 -2
- package/dist/content/stages/scope.js +0 -254
- package/dist/content/stages/ship.d.ts +0 -2
- package/dist/content/stages/ship.js +0 -159
- package/dist/content/stages/spec.d.ts +0 -2
- package/dist/content/stages/spec.js +0 -170
- package/dist/content/stages/tdd.d.ts +0 -4
- package/dist/content/stages/tdd.js +0 -273
- package/dist/content/state-contracts.d.ts +0 -1
- package/dist/content/state-contracts.js +0 -63
- package/dist/content/status-command.d.ts +0 -4
- package/dist/content/status-command.js +0 -109
- package/dist/content/subagent-context-skills.d.ts +0 -4
- package/dist/content/subagent-context-skills.js +0 -279
- package/dist/content/subagents.d.ts +0 -3
- package/dist/content/subagents.js +0 -997
- package/dist/content/templates.d.ts +0 -26
- package/dist/content/templates.js +0 -1692
- package/dist/content/track-render-context.d.ts +0 -18
- package/dist/content/track-render-context.js +0 -53
- package/dist/content/tree-command.d.ts +0 -1
- package/dist/content/tree-command.js +0 -64
- package/dist/content/utility-skills.d.ts +0 -30
- package/dist/content/utility-skills.js +0 -160
- package/dist/content/view-command.d.ts +0 -2
- package/dist/content/view-command.js +0 -92
- package/dist/delegation.d.ts +0 -649
- package/dist/delegation.js +0 -1539
- package/dist/early-loop.d.ts +0 -70
- package/dist/early-loop.js +0 -302
- package/dist/execution-topology.d.ts +0 -44
- package/dist/execution-topology.js +0 -95
- package/dist/gate-evidence.d.ts +0 -85
- package/dist/gate-evidence.js +0 -631
- package/dist/harness-adapters.d.ts +0 -151
- package/dist/harness-adapters.js +0 -756
- package/dist/harness-selection.d.ts +0 -31
- package/dist/harness-selection.js +0 -214
- package/dist/hook-schema.d.ts +0 -6
- package/dist/hook-schema.js +0 -114
- package/dist/hook-schemas/claude-hooks.v1.json +0 -10
- package/dist/hook-schemas/codex-hooks.v1.json +0 -10
- package/dist/hook-schemas/cursor-hooks.v1.json +0 -13
- package/dist/init-detect.d.ts +0 -2
- package/dist/init-detect.js +0 -50
- package/dist/internal/advance-stage/advance.d.ts +0 -89
- package/dist/internal/advance-stage/advance.js +0 -655
- package/dist/internal/advance-stage/cancel-run.d.ts +0 -8
- package/dist/internal/advance-stage/cancel-run.js +0 -19
- package/dist/internal/advance-stage/flow-state-coercion.d.ts +0 -3
- package/dist/internal/advance-stage/flow-state-coercion.js +0 -81
- package/dist/internal/advance-stage/helpers.d.ts +0 -14
- package/dist/internal/advance-stage/helpers.js +0 -145
- package/dist/internal/advance-stage/hook.d.ts +0 -8
- package/dist/internal/advance-stage/hook.js +0 -40
- package/dist/internal/advance-stage/parsers.d.ts +0 -72
- package/dist/internal/advance-stage/parsers.js +0 -357
- package/dist/internal/advance-stage/proactive-delegation-trace.d.ts +0 -24
- package/dist/internal/advance-stage/proactive-delegation-trace.js +0 -56
- package/dist/internal/advance-stage/review-loop.d.ts +0 -16
- package/dist/internal/advance-stage/review-loop.js +0 -199
- package/dist/internal/advance-stage/rewind.d.ts +0 -14
- package/dist/internal/advance-stage/rewind.js +0 -108
- package/dist/internal/advance-stage/start-flow.d.ts +0 -13
- package/dist/internal/advance-stage/start-flow.js +0 -241
- package/dist/internal/advance-stage/verify.d.ts +0 -21
- package/dist/internal/advance-stage/verify.js +0 -185
- package/dist/internal/advance-stage.d.ts +0 -7
- package/dist/internal/advance-stage.js +0 -138
- package/dist/internal/cohesion-contract-stub.d.ts +0 -24
- package/dist/internal/cohesion-contract-stub.js +0 -148
- package/dist/internal/compound-readiness.d.ts +0 -23
- package/dist/internal/compound-readiness.js +0 -102
- package/dist/internal/detect-public-api-changes.d.ts +0 -5
- package/dist/internal/detect-public-api-changes.js +0 -45
- package/dist/internal/detect-supply-chain-changes.d.ts +0 -6
- package/dist/internal/detect-supply-chain-changes.js +0 -138
- package/dist/internal/early-loop-status.d.ts +0 -7
- package/dist/internal/early-loop-status.js +0 -93
- package/dist/internal/envelope-validate.d.ts +0 -7
- package/dist/internal/envelope-validate.js +0 -66
- package/dist/internal/flow-state-repair.d.ts +0 -20
- package/dist/internal/flow-state-repair.js +0 -104
- package/dist/internal/plan-split-waves.d.ts +0 -190
- package/dist/internal/plan-split-waves.js +0 -764
- package/dist/internal/runtime-integrity.d.ts +0 -7
- package/dist/internal/runtime-integrity.js +0 -268
- package/dist/internal/slice-commit.d.ts +0 -7
- package/dist/internal/slice-commit.js +0 -619
- package/dist/internal/tdd-loop-status.d.ts +0 -14
- package/dist/internal/tdd-loop-status.js +0 -68
- package/dist/internal/tdd-red-evidence.d.ts +0 -7
- package/dist/internal/tdd-red-evidence.js +0 -153
- package/dist/internal/waiver-grant.d.ts +0 -62
- package/dist/internal/waiver-grant.js +0 -294
- package/dist/internal/wave-status.d.ts +0 -74
- package/dist/internal/wave-status.js +0 -506
- package/dist/managed-resources.d.ts +0 -53
- package/dist/managed-resources.js +0 -313
- package/dist/policy.d.ts +0 -10
- package/dist/policy.js +0 -167
- package/dist/retro-gate.d.ts +0 -9
- package/dist/retro-gate.js +0 -47
- package/dist/run-archive.d.ts +0 -61
- package/dist/run-archive.js +0 -391
- package/dist/runs.d.ts +0 -2
- package/dist/runs.js +0 -2
- package/dist/stack-detection.d.ts +0 -116
- package/dist/stack-detection.js +0 -489
- package/dist/streaming/event-stream.d.ts +0 -31
- package/dist/streaming/event-stream.js +0 -114
- package/dist/tdd-cycle.d.ts +0 -107
- package/dist/tdd-cycle.js +0 -289
- package/dist/tdd-verification-evidence.d.ts +0 -17
- package/dist/tdd-verification-evidence.js +0 -122
- package/dist/track-heuristics.d.ts +0 -27
- package/dist/track-heuristics.js +0 -154
- package/dist/util/slice-id.d.ts +0 -58
- package/dist/util/slice-id.js +0 -89
- package/dist/worktree-manager.d.ts +0 -20
- package/dist/worktree-manager.js +0 -108
|
@@ -1,637 +0,0 @@
|
|
|
1
|
-
import { type DiscoveryMode, type FlowStage, type FlowTrack } from "../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Stages that run adaptive elicitation. The `qa_log_unconverged` rule
|
|
4
|
-
* only fires for these. Other stages may still record a Q&A Log but no
|
|
5
|
-
* convergence floor is enforced.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ELICITATION_STAGES: ReadonlySet<FlowStage>;
|
|
8
|
-
/**
|
|
9
|
-
* Language-neutral forcing-question topic descriptor.
|
|
10
|
-
*
|
|
11
|
-
* Each forcing-question row in a stage's checklist declares topics as
|
|
12
|
-
* `id: human-readable label` pairs (e.g. `pain: what pain are we solving`).
|
|
13
|
-
* The `id` (kebab-case ASCII) is the machine-key authors stamp on Q&A Log
|
|
14
|
-
* rows via `[topic:<id>]` so the linter can verify coverage in ANY natural
|
|
15
|
-
* language (RU/EN/UA/etc.). English keyword detection is intentionally
|
|
16
|
-
* absent because it silently mis-reports convergence on RU/UA Q&A.
|
|
17
|
-
*/
|
|
18
|
-
export interface ForcingQuestionTopic {
|
|
19
|
-
id: string;
|
|
20
|
-
topic: string;
|
|
21
|
-
}
|
|
22
|
-
export interface QaLogFloorOptions {
|
|
23
|
-
discoveryMode?: DiscoveryMode;
|
|
24
|
-
/**
|
|
25
|
-
* When true, downgrades the finding to advisory (`required: false`).
|
|
26
|
-
* Set when `--skip-questions` was persisted to the active stage flags.
|
|
27
|
-
*/
|
|
28
|
-
skipQuestions?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Optional pre-extracted forcing-question topic descriptors. When
|
|
31
|
-
* omitted, the evaluator calls `extractForcingQuestions(stage)` which
|
|
32
|
-
* scans the stage's checklist row. Strings are accepted as topic IDs
|
|
33
|
-
* (label = id) for callers that build their own list.
|
|
34
|
-
*/
|
|
35
|
-
forcingQuestions?: ReadonlyArray<ForcingQuestionTopic | string>;
|
|
36
|
-
}
|
|
37
|
-
export interface QaLogFloorResult {
|
|
38
|
-
/** Whether convergence is satisfied (passes the gate). */
|
|
39
|
-
ok: boolean;
|
|
40
|
-
/** Substantive Q&A Log row count (excludes `skipped`/`waived` only rows). */
|
|
41
|
-
count: number;
|
|
42
|
-
/**
|
|
43
|
-
* Legacy field, retained for harness UI compatibility. Always 0 in
|
|
44
|
-
* the convergence floor no longer enforces a fixed count.
|
|
45
|
-
* Harness can still surface `questionBudgetHint(track, stage).recommended`
|
|
46
|
-
* as a soft hint, but it is NOT tied to gate blocking.
|
|
47
|
-
*/
|
|
48
|
-
min: number;
|
|
49
|
-
/** Whether a stop-signal row was detected. */
|
|
50
|
-
hasStopSignal: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Legacy field, retained for harness UI compatibility. Always false in
|
|
53
|
-
* convergence semantics replaced the lite-tier short-circuit.
|
|
54
|
-
*/
|
|
55
|
-
liteShortCircuit: boolean;
|
|
56
|
-
/** Whether `--skip-questions` flag downgraded the finding to advisory. */
|
|
57
|
-
skipQuestionsAdvisory: boolean;
|
|
58
|
-
/** Forcing-question topics deemed addressed (substring match in Q&A). */
|
|
59
|
-
forcingCovered: string[];
|
|
60
|
-
/** Forcing-question topics still pending (no matching Q&A row). */
|
|
61
|
-
forcingPending: string[];
|
|
62
|
-
/**
|
|
63
|
-
* True when the last 2 substantive rows have decision_impact marking
|
|
64
|
-
* `skip`/`continue`/`no-change`/`done`/etc. — i.e. Q&A is no longer
|
|
65
|
-
* surfacing decision-changing answers (Ralph-Loop convergence detector).
|
|
66
|
-
*/
|
|
67
|
-
noNewDecisions: boolean;
|
|
68
|
-
/** Human-readable details for the linter finding. */
|
|
69
|
-
details: string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Parse a single checklist row into the list of forcing-question topic
|
|
73
|
-
* descriptors it declares. Returns `null` when the row is not a
|
|
74
|
-
* forcing-questions header. Throws when the header is found but its
|
|
75
|
-
* body does not match the `id: topic; id: topic; ...` syntax — authors
|
|
76
|
-
* fix the stage definition rather than silently ship un-coverable
|
|
77
|
-
* topics.
|
|
78
|
-
*
|
|
79
|
-
* Exposed for unit tests that exercise the parser without depending on
|
|
80
|
-
* the live stage schema.
|
|
81
|
-
*/
|
|
82
|
-
export declare function parseForcingQuestionsRow(row: string, context?: string): ForcingQuestionTopic[] | null;
|
|
83
|
-
/**
|
|
84
|
-
* Extract forcing-question topics from a stage's checklist.
|
|
85
|
-
*
|
|
86
|
-
* Only the `id: topic; id: topic; ...` syntax is accepted. Throws when
|
|
87
|
-
* the syntax is malformed so authors fix the stage definition rather
|
|
88
|
-
* than silently shipping un-coverable topics.
|
|
89
|
-
*
|
|
90
|
-
* Returns empty array when no forcing-questions row is present (caller
|
|
91
|
-
* treats absence as "no forcing requirement" — convergence falls back
|
|
92
|
-
* to the no-new-decisions / stop-signal detectors). Returning [] when
|
|
93
|
-
* the row exists but lists no segments is also legal.
|
|
94
|
-
*/
|
|
95
|
-
export declare function extractForcingQuestions(stage: FlowStage): ForcingQuestionTopic[];
|
|
96
|
-
/**
|
|
97
|
-
* Evaluate the Q&A Log convergence floor for a brainstorm / scope /
|
|
98
|
-
* design artifact. Returns ok=true when convergence is reached or any
|
|
99
|
-
* escape hatch fires.
|
|
100
|
-
*
|
|
101
|
-
* Convergence sources (any one can set ok=true — see also
|
|
102
|
-
* `adaptiveElicitationSkillMarkdown`):
|
|
103
|
-
* - Every forcing-question topic id from the stage checklist is tagged
|
|
104
|
-
* `[topic:<id>]` on at least one `## Q&A Log` row.
|
|
105
|
-
* - Ralph-Loop path: last 2 substantive rows read as no-new-decisions,
|
|
106
|
-
* substantive count ≥ max(2, questionBudgetHint(discoveryMode, stage).min),
|
|
107
|
-
* and not (guided/deep discovery with pending forcing-topic ids).
|
|
108
|
-
* - Stop-signal row (`QA_LOG_STOP_SIGNAL_PATTERNS`).
|
|
109
|
-
* - `--skip-questions` (`options.skipQuestions`): ok remains false but
|
|
110
|
-
* `skipQuestionsAdvisory` is true (linter treats as non-blocking).
|
|
111
|
-
* - No forcing-questions row in the checklist and ≥1 substantive row.
|
|
112
|
-
*
|
|
113
|
-
* `[topic:<id>]` is the sole topic-coverage signal. The `min` and
|
|
114
|
-
* `liteShortCircuit` fields stay for harness compatibility (min is
|
|
115
|
-
* always 0; liteShortCircuit false).
|
|
116
|
-
*/
|
|
117
|
-
export declare function evaluateQaLogFloor(qaLogBody: string | null, track: FlowTrack, stage: FlowStage, options?: QaLogFloorOptions): QaLogFloorResult;
|
|
118
|
-
export interface LintFinding {
|
|
119
|
-
section: string;
|
|
120
|
-
required: boolean;
|
|
121
|
-
rule: string;
|
|
122
|
-
found: boolean;
|
|
123
|
-
details: string;
|
|
124
|
-
}
|
|
125
|
-
export interface LintFindingDedupSummary {
|
|
126
|
-
newCount: number;
|
|
127
|
-
repeatCount: number;
|
|
128
|
-
resolvedCount: number;
|
|
129
|
-
/**
|
|
130
|
-
* Short single-line human-facing summary of the dedup outcome. Empty
|
|
131
|
-
* string when there is nothing to report.
|
|
132
|
-
*/
|
|
133
|
-
header: string;
|
|
134
|
-
/**
|
|
135
|
-
* Parallel to the `findings` array on `LintResult`; each status tags
|
|
136
|
-
* the finding at the same index as `new`, `repeat`, or `resolved`.
|
|
137
|
-
* `null` slots correspond to findings that weren't classified (for
|
|
138
|
-
* example, when the dedup cache is unreadable).
|
|
139
|
-
*/
|
|
140
|
-
statuses: Array<{
|
|
141
|
-
kind: "new";
|
|
142
|
-
} | {
|
|
143
|
-
kind: "repeat";
|
|
144
|
-
count: number;
|
|
145
|
-
} | {
|
|
146
|
-
kind: "resolved";
|
|
147
|
-
} | null>;
|
|
148
|
-
}
|
|
149
|
-
export interface LintResult {
|
|
150
|
-
stage: string;
|
|
151
|
-
file: string;
|
|
152
|
-
passed: boolean;
|
|
153
|
-
findings: LintFinding[];
|
|
154
|
-
dedup?: LintFindingDedupSummary;
|
|
155
|
-
}
|
|
156
|
-
export declare function normalizeHeadingTitle(title: string): string;
|
|
157
|
-
export type H2SectionMap = Map<string, string>;
|
|
158
|
-
/**
|
|
159
|
-
* Collect H2 sections and body content (`## Section Name`).
|
|
160
|
-
*
|
|
161
|
-
* - Ignores lines that live inside fenced code blocks (``` / ~~~) so a
|
|
162
|
-
* commented `## Approaches` inside an example doesn't open a phantom
|
|
163
|
-
* section and swallow real content.
|
|
164
|
-
* - When the same heading appears more than once at the top level we
|
|
165
|
-
* concatenate the bodies rather than silently overwriting the earlier
|
|
166
|
-
* occurrence. This keeps lint rules honest when authors split a section
|
|
167
|
-
* into multiple passes.
|
|
168
|
-
*/
|
|
169
|
-
export declare function extractH2Sections(markdown: string): H2SectionMap;
|
|
170
|
-
export declare function duplicateH2Headings(markdown: string): string[];
|
|
171
|
-
/**
|
|
172
|
-
* Return the author-authored prose of an artifact, stripping linter meta
|
|
173
|
-
* regions so free-text scans (placeholder tokens, scope-reduction phrases,
|
|
174
|
-
* investigation trigger words) don't self-cannibalize by matching the
|
|
175
|
-
* linter's own templated meta-phrases.
|
|
176
|
-
*
|
|
177
|
-
* Stripping rules (in order):
|
|
178
|
-
* 1. `<!-- linter-meta --> ... <!-- /linter-meta -->` paired blocks.
|
|
179
|
-
* Both markers must appear on their own line; unterminated openings
|
|
180
|
-
* are left as-is so a malformed artifact cannot hide arbitrary
|
|
181
|
-
* content by omitting the closing marker.
|
|
182
|
-
* 2. Every other HTML comment (`<!-- ... -->`, possibly multi-line).
|
|
183
|
-
* 3. Fenced code blocks that are tagged `linter-rule` (e.g.
|
|
184
|
-
* ```` ```linter-rule ````). Plain fenced code blocks are preserved
|
|
185
|
-
* because many stages quote code samples that the linter should
|
|
186
|
-
* still see.
|
|
187
|
-
*
|
|
188
|
-
* The function guarantees the returned string is a strict subset of the
|
|
189
|
-
* original: no characters are synthesized, and line offsets are
|
|
190
|
-
* preserved for any surviving line (blank lines stand in for stripped
|
|
191
|
-
* regions). This keeps regex-based linter checks stable when authors
|
|
192
|
-
* add or remove linter-meta blocks between runs.
|
|
193
|
-
*/
|
|
194
|
-
export declare function extractAuthoredBody(rawArtifact: string): string;
|
|
195
|
-
export declare function headingPresent(sections: H2SectionMap, section: string): boolean;
|
|
196
|
-
export declare function sectionBodyByName(sections: H2SectionMap, section: string): string | null;
|
|
197
|
-
export declare function sectionBodyByAnyName(sections: H2SectionMap, sectionNames: string[]): string | null;
|
|
198
|
-
export declare function sectionBodyByHeadingPrefix(sections: H2SectionMap, prefix: string): string | null;
|
|
199
|
-
export interface CriticPredictionsContractCheck {
|
|
200
|
-
found: boolean;
|
|
201
|
-
details: string;
|
|
202
|
-
}
|
|
203
|
-
export declare function checkCriticPredictionsContract(sections: H2SectionMap): CriticPredictionsContractCheck | null;
|
|
204
|
-
export interface LayeredDocumentReviewStatus {
|
|
205
|
-
triggeredReviewers: string[];
|
|
206
|
-
missingStructured: string[];
|
|
207
|
-
failOrPartialWithoutWaiver: string[];
|
|
208
|
-
}
|
|
209
|
-
export declare function evaluateLayeredDocumentReviewStatus(sections: H2SectionMap, confidenceFindingRegexSource: string): LayeredDocumentReviewStatus | null;
|
|
210
|
-
/**
|
|
211
|
-
* Build a regex that matches `<field>: <value>` even when the field name
|
|
212
|
-
* and/or value are wrapped in markdown emphasis (`*`, `**`, `_`, `__`).
|
|
213
|
-
*
|
|
214
|
-
* The shipped templates render fields as `- **Field name:** value`, so any
|
|
215
|
-
* structural check that searches for `Field:\s*token` against the rendered
|
|
216
|
-
* artifact must tolerate the closing `**` between the colon and the value.
|
|
217
|
-
*
|
|
218
|
-
* `field` is treated as literal text (regex meta-characters are escaped).
|
|
219
|
-
* `value` is inserted verbatim so callers can pass alternation
|
|
220
|
-
* (`STARTUP|BUILDER|...`). `flags` defaults to case-insensitive Unicode.
|
|
221
|
-
*/
|
|
222
|
-
export declare function markdownFieldRegex(field: string, value: string, flags?: string): RegExp;
|
|
223
|
-
export declare function extractMarkdownSectionBody(markdown: string, section: string): string | null;
|
|
224
|
-
export declare function headingLineIndex(markdown: string, section: string): number;
|
|
225
|
-
export declare function parseShortCircuitStatus(sectionBody: string | null): string;
|
|
226
|
-
export declare function isShortCircuitActivated(sectionBody: string | null): boolean;
|
|
227
|
-
export declare function meaningfulLineCount(sectionBody: string): number;
|
|
228
|
-
export declare function lineHasToken(line: string, token: string): boolean;
|
|
229
|
-
export declare function countListItems(sectionBody: string): number;
|
|
230
|
-
export declare function parseMarkdownTableRow(line: string): string[];
|
|
231
|
-
export declare function tableHeaderCells(sectionBody: string): string[] | null;
|
|
232
|
-
export declare function extractMinItemsFromRule(rule: string): number | null;
|
|
233
|
-
export declare function tokensFromRule(rule: string): string[];
|
|
234
|
-
export declare const VAGUE_AC_ADJECTIVES: string[];
|
|
235
|
-
export declare function isSeparatorRow(line: string): boolean;
|
|
236
|
-
export declare function getMarkdownTableRows(sectionBody: string): string[][];
|
|
237
|
-
export type BinaryFlag = "yes" | "no" | "unknown";
|
|
238
|
-
export declare function parseBinaryFlag(value: string): BinaryFlag;
|
|
239
|
-
export declare function parseKeyedBinaryFlag(value: string, key: string): BinaryFlag;
|
|
240
|
-
export declare function parseFailureModeRescueFlag(rescueCell: string): BinaryFlag;
|
|
241
|
-
export declare function parseFailureModeTestFlag(rowText: string): BinaryFlag;
|
|
242
|
-
export declare function validateFailureModeTable(sectionBody: string): {
|
|
243
|
-
ok: boolean;
|
|
244
|
-
details: string;
|
|
245
|
-
};
|
|
246
|
-
export declare const SCOPE_MODE_FULL_TOKENS: readonly string[];
|
|
247
|
-
export type CanonicalScopeMode = (typeof SCOPE_MODE_FULL_TOKENS)[number];
|
|
248
|
-
export declare const SCOPE_MODE_LINE_REGEX: RegExp;
|
|
249
|
-
export declare const SCOPE_MODE_SHORT_TOKEN_REGEX: RegExp;
|
|
250
|
-
export declare const SPEC_MAX_MODULES = 5;
|
|
251
|
-
export declare const NEXT_STAGE_HANDOFF_REGEX: RegExp;
|
|
252
|
-
export declare function hasCanonicalScopeMode(body: string): boolean;
|
|
253
|
-
export declare function canonicalModesInText(text: string): CanonicalScopeMode[];
|
|
254
|
-
export declare function shortModeToCanonical(text: string): CanonicalScopeMode | null;
|
|
255
|
-
export declare function canonicalModeFromCandidate(candidate: string): CanonicalScopeMode | null;
|
|
256
|
-
export declare function extractCanonicalScopeMode(body: string): CanonicalScopeMode | null;
|
|
257
|
-
export declare function validateScopeSummary(sectionBody: string): {
|
|
258
|
-
ok: boolean;
|
|
259
|
-
details: string;
|
|
260
|
-
};
|
|
261
|
-
export declare const APPROACH_ROLE_VALUES: readonly ["baseline", "challenger", "wild-card"];
|
|
262
|
-
export declare const APPROACH_UPSIDE_VALUES: readonly ["low", "modest", "high", "higher"];
|
|
263
|
-
export declare const REQUIREMENT_PRIORITY_VALUES: readonly ["P0", "P1", "P2", "P3", "DROPPED"];
|
|
264
|
-
export declare function normalizeTableToken(value: string): string;
|
|
265
|
-
export declare function columnIndex(header: string[], expected: string): number;
|
|
266
|
-
export declare function validateApproachesTaxonomy(sectionBody: string): {
|
|
267
|
-
rowCount: number;
|
|
268
|
-
roleUpsideOk: boolean;
|
|
269
|
-
challengerOk: boolean;
|
|
270
|
-
details: string;
|
|
271
|
-
};
|
|
272
|
-
export declare function validateCalibratedSelfReview(sectionBody: string): {
|
|
273
|
-
ok: boolean;
|
|
274
|
-
details: string;
|
|
275
|
-
};
|
|
276
|
-
export declare function validateRequirementsTaxonomy(sectionBody: string): {
|
|
277
|
-
ok: boolean;
|
|
278
|
-
details: string;
|
|
279
|
-
};
|
|
280
|
-
export interface InteractionEdgeCaseRequirement {
|
|
281
|
-
label: string;
|
|
282
|
-
pattern: RegExp;
|
|
283
|
-
}
|
|
284
|
-
export declare const INTERACTION_EDGE_CASE_REQUIREMENTS: readonly InteractionEdgeCaseRequirement[];
|
|
285
|
-
/**
|
|
286
|
-
* context for `validateInteractionEdgeCaseMatrix`.
|
|
287
|
-
*
|
|
288
|
-
* Background: a quick-tier test of a 3-file static landing page used
|
|
289
|
-
* to trip "Interaction Edge Case row \"nav-away-mid-request\" must mark
|
|
290
|
-
* Handled? as yes/no" because the author wrote `N/A` (no network at
|
|
291
|
-
* all), then `unhandled must reference a deferred item id (for example
|
|
292
|
-
* D-12)`. Two relaxations apply:
|
|
293
|
-
*
|
|
294
|
-
* 1. `N/A — <reason>` (em-dash + free-text reason) is now an
|
|
295
|
-
* accepted Handled? value. The reason replaces the D-XX
|
|
296
|
-
* requirement.
|
|
297
|
-
* 2. When the caller signals lite-tier and the design has no
|
|
298
|
-
* network/external dependencies (detected via the Architecture
|
|
299
|
-
* Diagram body or a missing Failure Mode Table), the standard
|
|
300
|
-
* mandatory rows (`nav-away-mid-request`, `10K-result dataset`,
|
|
301
|
-
* `background-job abandonment`, `zombie connection`) are
|
|
302
|
-
* treated as advisory rather than required. The `double-click`
|
|
303
|
-
* row stays mandatory because UI duplicate-action handling is
|
|
304
|
-
* relevant even for static pages.
|
|
305
|
-
*/
|
|
306
|
-
export interface InteractionEdgeCaseValidationContext {
|
|
307
|
-
/** Optional H2 sections map for cross-section "no network" detection. */
|
|
308
|
-
sections?: H2SectionMap | null;
|
|
309
|
-
/** When true, network-dependent mandatory rows become advisory. */
|
|
310
|
-
liteTier?: boolean;
|
|
311
|
-
}
|
|
312
|
-
export declare function validateInteractionEdgeCaseMatrix(sectionBody: string, context?: InteractionEdgeCaseValidationContext): {
|
|
313
|
-
ok: boolean;
|
|
314
|
-
details: string;
|
|
315
|
-
};
|
|
316
|
-
export declare const PRE_SCOPE_AUDIT_SIGNALS: ReadonlyArray<{
|
|
317
|
-
label: string;
|
|
318
|
-
pattern: RegExp;
|
|
319
|
-
}>;
|
|
320
|
-
export declare function validatePreScopeSystemAudit(sectionBody: string): {
|
|
321
|
-
ok: boolean;
|
|
322
|
-
details: string;
|
|
323
|
-
};
|
|
324
|
-
export declare const DIAGRAM_ARROW_PATTERN: RegExp;
|
|
325
|
-
export declare const DIAGRAM_FAILURE_EDGE_PATTERN: RegExp;
|
|
326
|
-
export declare const DIAGRAM_GENERIC_NODE_PATTERN: RegExp;
|
|
327
|
-
/**
|
|
328
|
-
* external-dependency keywords that trigger the
|
|
329
|
-
* failure-edge requirement. The architecture diagram is allowed to
|
|
330
|
-
* omit failure edges only when ALL of:
|
|
331
|
-
* - Failure Mode Table has zero rows.
|
|
332
|
-
* - The diagram body mentions no external-dependency keyword.
|
|
333
|
-
*
|
|
334
|
-
* Static landing pages (3 HTML/CSS/JS files, no network) match this:
|
|
335
|
-
* no failure modes to map, no external systems to fail. The previous
|
|
336
|
-
* blanket "must include at least one failure-edge" rule produced
|
|
337
|
-
* ceremony-only failures that the agent worked around with fake
|
|
338
|
-
* `(timeout)` annotations, defeating the spirit of the rule.
|
|
339
|
-
*/
|
|
340
|
-
export declare const DIAGRAM_EXTERNAL_DEPENDENCY_PATTERN: RegExp;
|
|
341
|
-
export declare const TEST_COMMAND_MARKER_PATTERN: RegExp;
|
|
342
|
-
export declare const RED_FAILURE_MARKER_PATTERN: RegExp;
|
|
343
|
-
export declare const GREEN_SUCCESS_MARKER_PATTERN: RegExp;
|
|
344
|
-
export declare function diagramEdgeLines(sectionBody: string): string[];
|
|
345
|
-
export declare function hasFailureEdgeInDiagram(sectionBody: string): boolean;
|
|
346
|
-
export declare function hasLabeledDiagramArrow(lines: string[]): boolean;
|
|
347
|
-
/**
|
|
348
|
-
* accepted async edge patterns. Returns true when
|
|
349
|
-
* a line carries any of:
|
|
350
|
-
*
|
|
351
|
-
* - `-.->`, `-->>`, `~~>` (mermaid dotted/messaging arrows)
|
|
352
|
-
* - `- - ->` (loose dotted ASCII arrow with optional spaces)
|
|
353
|
-
* - `.....>` (3-or-more dots followed by `>`)
|
|
354
|
-
* - `\basync\b` text token (label-based)
|
|
355
|
-
* - `[async]` bracketed label, `async:` prefix, `async:` cell content
|
|
356
|
-
*
|
|
357
|
-
* The error message printed when this fails (see
|
|
358
|
-
* `validateArchitectureDiagram`) lists every accepted pattern
|
|
359
|
-
* verbatim so the agent does not have to guess.
|
|
360
|
-
*/
|
|
361
|
-
export declare function hasAsyncDiagramEdge(lines: string[]): boolean;
|
|
362
|
-
/**
|
|
363
|
-
* accepted sync edge patterns. Returns true when a
|
|
364
|
-
* line carries any of:
|
|
365
|
-
*
|
|
366
|
-
* - `\bsync\b` text token (label-based)
|
|
367
|
-
* - `[sync]` bracketed label, `sync:` prefix, `sync:` cell content
|
|
368
|
-
* - Solid `-->`, `->`, `=>`, `→`, `⟶`, `↦` arrow that is NOT a known
|
|
369
|
-
* dotted/async variant (`-.->`, `-->>`, `~~>`)
|
|
370
|
-
* - `===>` (3+ `=` then `>`) and `--->` (3+ `-` then `>`) heavy solid
|
|
371
|
-
* arrows
|
|
372
|
-
*/
|
|
373
|
-
export declare function hasSyncDiagramEdge(lines: string[]): boolean;
|
|
374
|
-
/**
|
|
375
|
-
* exact accepted-pattern list shown in the error
|
|
376
|
-
* message when sync/async distinction fails. Keep in sync with
|
|
377
|
-
* `hasAsyncDiagramEdge` / `hasSyncDiagramEdge` above.
|
|
378
|
-
*/
|
|
379
|
-
export declare const DIAGRAM_SYNC_ASYNC_ACCEPTED_PATTERNS: readonly ["Solid arrows: `-->`, `->`, `===>`, `--->`, `=>`, `→`, `⟶`, `↦`", "Dotted/async arrows: `-.->`, `-->>`, `~~>`, `- - ->`, `.....>`", "Text labels on the same line: `sync` / `async`", "Bracket labels: `[sync]` / `[async]`", "Cell-prefix labels: `sync:` / `async:` (e.g. `A -->|sync: persist| B`)"];
|
|
380
|
-
export interface ArchitectureDiagramValidationContext {
|
|
381
|
-
/** Optional H2 sections map for cross-section checks (e.g. Failure Mode Table presence). */
|
|
382
|
-
sections?: H2SectionMap | null;
|
|
383
|
-
}
|
|
384
|
-
export interface ArchitectureDiagramValidationResult {
|
|
385
|
-
ok: boolean;
|
|
386
|
-
details: string;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Architecture Diagram structural check.
|
|
390
|
-
*
|
|
391
|
-
* Promoted out of `validateSectionBody` so it can take a `sections`
|
|
392
|
-
* map and conditionally enforce the failure-edge rule based on
|
|
393
|
-
* cross-section context (Failure Mode Table presence + diagram body
|
|
394
|
-
* mentioning external-dependency keywords).
|
|
395
|
-
*/
|
|
396
|
-
export declare function validateArchitectureDiagram(sectionBody: string, context?: ArchitectureDiagramValidationContext): ArchitectureDiagramValidationResult;
|
|
397
|
-
/**
|
|
398
|
-
* pointer-mode evidence acceptance. RED/GREEN sections may
|
|
399
|
-
* substitute pasted stdout with a single line of the form
|
|
400
|
-
* `Evidence: <relative-or-abs-path>` or `Evidence: spanId:<id>`. The
|
|
401
|
-
* validator alone cannot reach the filesystem or delegation ledger
|
|
402
|
-
* synchronously, so the lint pipeline pre-resolves pointers and then
|
|
403
|
-
* passes booleans through these option flags.
|
|
404
|
-
*/
|
|
405
|
-
export interface TddEvidencePointerOptions {
|
|
406
|
-
/**
|
|
407
|
-
* True when the section body has at least one `Evidence:` pointer line
|
|
408
|
-
* AND the pointer resolved to either an existing file or a known
|
|
409
|
-
* delegation spanId. The validator then short-circuits without
|
|
410
|
-
* requiring pasted stdout markers.
|
|
411
|
-
*/
|
|
412
|
-
pointerSatisfied?: boolean;
|
|
413
|
-
/**
|
|
414
|
-
* true when `delegation-events.jsonl` carries at least
|
|
415
|
-
* one slice-tagged event for the current run with the matching phase
|
|
416
|
-
* (`phase=red` for RED, `phase=green` for GREEN) and a non-empty
|
|
417
|
-
* `evidenceRefs` array. Phase events are the new source of truth in
|
|
418
|
-
* the markdown evidence block is auto-satisfied without
|
|
419
|
-
* requiring hand-pasted stdout content.
|
|
420
|
-
*/
|
|
421
|
-
phaseEventsSatisfied?: boolean;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Sync helper that scans for `Evidence:` lines in a section body and
|
|
425
|
-
* returns the trimmed value of each. Used by the lint pipeline to
|
|
426
|
-
* pre-resolve pointers (filesystem path-existence or delegation ledger
|
|
427
|
-
* spanId match) before invoking the validators.
|
|
428
|
-
*
|
|
429
|
-
* Recognised forms:
|
|
430
|
-
* Evidence: <path>
|
|
431
|
-
* Evidence: spanId:<id>
|
|
432
|
-
* - Evidence: <path>
|
|
433
|
-
*/
|
|
434
|
-
export declare function extractEvidencePointers(sectionBody: string): string[];
|
|
435
|
-
export declare function validateTddRedEvidence(sectionBody: string, opts?: TddEvidencePointerOptions): {
|
|
436
|
-
ok: boolean;
|
|
437
|
-
details: string;
|
|
438
|
-
};
|
|
439
|
-
export declare function validateTddGreenEvidence(sectionBody: string, opts?: TddEvidencePointerOptions): {
|
|
440
|
-
ok: boolean;
|
|
441
|
-
details: string;
|
|
442
|
-
};
|
|
443
|
-
export declare function validateVerificationLadder(sectionBody: string): {
|
|
444
|
-
ok: boolean;
|
|
445
|
-
details: string;
|
|
446
|
-
};
|
|
447
|
-
export declare function hasVerificationLadderTableRow(sectionBody: string): boolean;
|
|
448
|
-
export type LearningEntryType = "rule" | "pattern" | "lesson" | "compound";
|
|
449
|
-
export type LearningConfidence = "high" | "medium" | "low";
|
|
450
|
-
export type LearningSeverity = "critical" | "important" | "suggestion";
|
|
451
|
-
export type LearningSource = "stage" | "retro" | "compound" | "idea" | "manual";
|
|
452
|
-
export interface LearningSeedEntry {
|
|
453
|
-
type: LearningEntryType;
|
|
454
|
-
trigger: string;
|
|
455
|
-
action: string;
|
|
456
|
-
confidence: LearningConfidence;
|
|
457
|
-
severity?: LearningSeverity;
|
|
458
|
-
stage?: FlowStage | null;
|
|
459
|
-
origin_stage?: FlowStage | null;
|
|
460
|
-
frequency?: number;
|
|
461
|
-
created?: string;
|
|
462
|
-
first_seen_ts?: string;
|
|
463
|
-
last_seen_ts?: string;
|
|
464
|
-
project?: string | null;
|
|
465
|
-
source?: LearningSource | null;
|
|
466
|
-
}
|
|
467
|
-
export interface LearningsParseResult {
|
|
468
|
-
ok: boolean;
|
|
469
|
-
none: boolean;
|
|
470
|
-
entries: LearningSeedEntry[];
|
|
471
|
-
errors: string[];
|
|
472
|
-
details: string;
|
|
473
|
-
}
|
|
474
|
-
/** Multiline block used by linter + learnings harvest stderr (identical text). */
|
|
475
|
-
export declare function formatLearningsErrorsBullets(errors: string[]): string;
|
|
476
|
-
export declare function learningsParseFailureHumanSummary(artifactRelPath: string, errors: string[]): string;
|
|
477
|
-
export declare const LEARNING_TYPE_SET: Set<LearningEntryType>;
|
|
478
|
-
export declare const LEARNING_CONFIDENCE_SET: Set<LearningConfidence>;
|
|
479
|
-
export declare const LEARNING_SEVERITY_SET: Set<LearningSeverity>;
|
|
480
|
-
export declare const LEARNING_SOURCE_SET: Set<LearningSource>;
|
|
481
|
-
export declare const FLOW_STAGE_SET: Set<"brainstorm" | "scope" | "design" | "spec" | "plan" | "tdd" | "review" | "ship">;
|
|
482
|
-
export declare const LEARNING_ALLOWED_KEYS: Set<string>;
|
|
483
|
-
export declare function isIsoUtcTimestamp(value: string): boolean;
|
|
484
|
-
export declare function isNullableString(value: unknown): value is string | null;
|
|
485
|
-
export declare function isNullableStage(value: unknown): value is FlowStage | null;
|
|
486
|
-
export declare function parseLearningSeedEntry(raw: unknown, index: number): {
|
|
487
|
-
ok: boolean;
|
|
488
|
-
entry?: LearningSeedEntry;
|
|
489
|
-
error?: string;
|
|
490
|
-
};
|
|
491
|
-
export declare function parseLearningsSection(sectionBody: string): LearningsParseResult;
|
|
492
|
-
/**
|
|
493
|
-
* file-path / reference detector for the
|
|
494
|
-
* `investigation_path_first_missing` advisory rule.
|
|
495
|
-
*
|
|
496
|
-
* The detector is intentionally permissive: it only needs to recognize
|
|
497
|
-
* "the author wrote down a path or ref" — the linter does NOT validate
|
|
498
|
-
* the path resolves on disk. Patterns matched (any one is enough):
|
|
499
|
-
* - TS/JS/MD/JSON/YAML path with extension
|
|
500
|
-
* (`src/foo/bar.ts`, `tests/spec.test.ts`, `docs/quality-gates.md`).
|
|
501
|
-
* - Slash-bearing path under a known repo root prefix
|
|
502
|
-
* (`src/...`, `tests/...`, `docs/...`, `scripts/...`,
|
|
503
|
-
* `.cclaw/...`, `.cursor/...`, `node_modules/...`,
|
|
504
|
-
* `examples/...`, `e2e/...`).
|
|
505
|
-
* - GitHub-style ref (`owner/repo#123`, `org/repo@sha`,
|
|
506
|
-
* `path:line`, `path:line-line`).
|
|
507
|
-
* - Explicit `path:` / `paths:` / `ref:` / `refs:` marker.
|
|
508
|
-
* - Stable cclaw IDs (`R1`, `D-12`, `AC-3`, `T-4`, `S-2`, `DD-5`,
|
|
509
|
-
* `ADR-1`, `R-1`, `F-1`, `CR-1`, `I-1`, `QS-1`).
|
|
510
|
-
* - Backticked path-like token containing a slash.
|
|
511
|
-
*
|
|
512
|
-
* Exposed for unit tests (`tests/unit/investigation-trace-evaluator.test.ts`).
|
|
513
|
-
*/
|
|
514
|
-
export declare const INVESTIGATION_TRACE_PATH_PATTERNS: readonly RegExp[];
|
|
515
|
-
export interface InvestigationTraceFinding {
|
|
516
|
-
ok: boolean;
|
|
517
|
-
details: string;
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Internal core that does NOT depend on `StageLintContext`. Returned
|
|
521
|
-
* shape is consumed by `evaluateInvestigationTrace` (which pushes a
|
|
522
|
-
* finding into the context) and by unit tests that exercise the
|
|
523
|
-
* detector directly.
|
|
524
|
-
*
|
|
525
|
-
* Returns `null` for sections that are missing, empty, or contain only
|
|
526
|
-
* template scaffolding (table headers, separators, placeholder rows
|
|
527
|
-
* with empty cells, lone `- None.` lines). Callers treat `null` as
|
|
528
|
-
* silent — no finding is emitted.
|
|
529
|
-
*/
|
|
530
|
-
export declare function checkInvestigationTrace(sectionBody: string | null): InvestigationTraceFinding | null;
|
|
531
|
-
/**
|
|
532
|
-
* advisory rule wired into the brainstorm / scope /
|
|
533
|
-
* design / tdd / plan / review linters.
|
|
534
|
-
*
|
|
535
|
-
* Behavior contract:
|
|
536
|
-
* - Section missing or empty / placeholder-only: silent (no finding).
|
|
537
|
-
* - Section has substantive content with a recognizable file path /
|
|
538
|
-
* ref / explicit `path:`-style marker in the first non-empty rows:
|
|
539
|
-
* advisory pass (no finding).
|
|
540
|
-
* - Section has substantive content but no path/ref signal: advisory
|
|
541
|
-
* FAIL finding with ruleId `investigation_path_first_missing`.
|
|
542
|
-
*
|
|
543
|
-
* The rule is `required: false` so it never blocks `stage-complete`.
|
|
544
|
-
*/
|
|
545
|
-
export declare function evaluateInvestigationTrace(ctx: StageLintContext, sectionName: string): void;
|
|
546
|
-
export declare function lineContainsVagueAdjective(text: string): string | null;
|
|
547
|
-
export interface ParsedFrontmatter {
|
|
548
|
-
hasFrontmatter: boolean;
|
|
549
|
-
values: Record<string, string>;
|
|
550
|
-
}
|
|
551
|
-
export declare const FRONTMATTER_REQUIRED_KEYS: readonly ["stage", "schema_version", "version", "locked_decisions", "inputs_hash"];
|
|
552
|
-
export declare const PLACEHOLDER_PATTERNS: Array<{
|
|
553
|
-
label: string;
|
|
554
|
-
regex: RegExp;
|
|
555
|
-
}>;
|
|
556
|
-
export declare const SCOPE_REDUCTION_PATTERNS: Array<{
|
|
557
|
-
label: string;
|
|
558
|
-
regex: RegExp;
|
|
559
|
-
}>;
|
|
560
|
-
export declare function parseFrontmatter(markdown: string): ParsedFrontmatter;
|
|
561
|
-
export declare function extractDecisionIds(text: string): string[];
|
|
562
|
-
export declare function extractRequirementIdsFromMarkdown(text: string): string[];
|
|
563
|
-
export declare function extractAcceptanceCriterionIdsFromMarkdown(text: string): string[];
|
|
564
|
-
export declare function collectPatternHits(text: string, patterns: Array<{
|
|
565
|
-
label: string;
|
|
566
|
-
regex: RegExp;
|
|
567
|
-
}>): string[];
|
|
568
|
-
export interface ValidateSectionBodyContext {
|
|
569
|
-
/**
|
|
570
|
-
* optional H2 sections map for cross-section
|
|
571
|
-
* checks (e.g. Architecture Diagram failure-edge enforcement gates
|
|
572
|
-
* on Failure Mode Table presence). When omitted, cross-section
|
|
573
|
-
* checks fall back to legacy blanket enforcement.
|
|
574
|
-
*/
|
|
575
|
-
sections?: H2SectionMap | null;
|
|
576
|
-
/**
|
|
577
|
-
* when true, lite-tier-only relaxations apply.
|
|
578
|
-
* Currently used by the Interaction Edge Case matrix to demote
|
|
579
|
-
* network-dependent mandatory rows to advisory when the design has
|
|
580
|
-
* no Failure Mode Table rows and no external-dependency keywords
|
|
581
|
-
* in the Architecture Diagram body.
|
|
582
|
-
*/
|
|
583
|
-
liteTier?: boolean;
|
|
584
|
-
/**
|
|
585
|
-
* pre-resolved RED/GREEN Evidence pointer state. The
|
|
586
|
-
* artifact linter resolves `Evidence: <path|spanId:...>` lines and
|
|
587
|
-
* inspects the TDD slice sidecar before invoking
|
|
588
|
-
* `validateSectionBody`; the resulting booleans here let the
|
|
589
|
-
* validator short-circuit without re-doing async work.
|
|
590
|
-
*/
|
|
591
|
-
tddEvidence?: {
|
|
592
|
-
red?: TddEvidencePointerOptions;
|
|
593
|
-
green?: TddEvidencePointerOptions;
|
|
594
|
-
};
|
|
595
|
-
}
|
|
596
|
-
export declare function validateSectionBody(sectionBody: string, rule: string, sectionName: string, context?: ValidateSectionBodyContext): {
|
|
597
|
-
ok: boolean;
|
|
598
|
-
details: string;
|
|
599
|
-
};
|
|
600
|
-
export interface StageLintContext {
|
|
601
|
-
projectRoot: string;
|
|
602
|
-
stage: FlowStage;
|
|
603
|
-
track: FlowTrack;
|
|
604
|
-
discoveryMode: DiscoveryMode;
|
|
605
|
-
raw: string;
|
|
606
|
-
absFile: string;
|
|
607
|
-
sections: H2SectionMap;
|
|
608
|
-
findings: LintFinding[];
|
|
609
|
-
parsedFrontmatter: ParsedFrontmatter;
|
|
610
|
-
brainstormShortCircuitBody: string | null;
|
|
611
|
-
brainstormShortCircuitActivated: boolean;
|
|
612
|
-
scopePreAuditEnabled: boolean;
|
|
613
|
-
staleDiagramAuditEnabled: boolean;
|
|
614
|
-
isTrivialOverride: boolean;
|
|
615
|
-
overrideSet: Set<string> | null;
|
|
616
|
-
/**
|
|
617
|
-
* Stage-level flags persisted to flow-state.json `activeRun.currentStage.flags`
|
|
618
|
-
* (or equivalent). Used as escape-hatch signal for the Q&A floor rule
|
|
619
|
-
* (e.g. `--skip-questions` downgrades `qa_log_unconverged` to advisory).
|
|
620
|
-
* When orchestrator cannot read flow-state, defaults to an empty array.
|
|
621
|
-
*/
|
|
622
|
-
activeStageFlags: string[];
|
|
623
|
-
/**
|
|
624
|
-
* task class for the active run, mirrored from
|
|
625
|
-
* `flow-state.json::taskClass`. `null` when not classified. Stage
|
|
626
|
-
* linters read this together with `track` via
|
|
627
|
-
* `shouldDemoteArtifactValidationByTrack` to demote advanced
|
|
628
|
-
* artifact-level checks (architecture diagram async/failure edges,
|
|
629
|
-
* interaction edge-case mandatory rows, stale-diagram drift,
|
|
630
|
-
* expansion-strategist delegation) from required → advisory.
|
|
631
|
-
*/
|
|
632
|
-
taskClass: "software-standard" | "software-trivial" | "software-bugfix" | null;
|
|
633
|
-
/**
|
|
634
|
-
* `flow-state.json::packageVersion` when present.
|
|
635
|
-
*/
|
|
636
|
-
packageVersion?: string | null;
|
|
637
|
-
}
|