cclaw-cli 0.51.30 → 0.55.2

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.
Files changed (142) hide show
  1. package/README.md +22 -16
  2. package/dist/artifact-linter/brainstorm.d.ts +2 -0
  3. package/dist/artifact-linter/brainstorm.js +245 -0
  4. package/dist/artifact-linter/design.d.ts +2 -0
  5. package/dist/artifact-linter/design.js +323 -0
  6. package/dist/artifact-linter/plan.d.ts +2 -0
  7. package/dist/artifact-linter/plan.js +162 -0
  8. package/dist/artifact-linter/review-army.d.ts +24 -0
  9. package/dist/artifact-linter/review-army.js +365 -0
  10. package/dist/artifact-linter/review.d.ts +2 -0
  11. package/dist/artifact-linter/review.js +65 -0
  12. package/dist/artifact-linter/scope.d.ts +2 -0
  13. package/dist/artifact-linter/scope.js +115 -0
  14. package/dist/artifact-linter/shared.d.ts +246 -0
  15. package/dist/artifact-linter/shared.js +1488 -0
  16. package/dist/artifact-linter/ship.d.ts +2 -0
  17. package/dist/artifact-linter/ship.js +46 -0
  18. package/dist/artifact-linter/spec.d.ts +2 -0
  19. package/dist/artifact-linter/spec.js +108 -0
  20. package/dist/artifact-linter/tdd.d.ts +2 -0
  21. package/dist/artifact-linter/tdd.js +124 -0
  22. package/dist/artifact-linter.d.ts +4 -76
  23. package/dist/artifact-linter.js +56 -2949
  24. package/dist/cli.d.ts +1 -6
  25. package/dist/cli.js +4 -159
  26. package/dist/codex-feature-flag.d.ts +1 -1
  27. package/dist/codex-feature-flag.js +1 -1
  28. package/dist/config.d.ts +3 -2
  29. package/dist/config.js +67 -3
  30. package/dist/constants.d.ts +1 -7
  31. package/dist/constants.js +9 -15
  32. package/dist/content/cancel-command.js +2 -2
  33. package/dist/content/closeout-guidance.js +10 -7
  34. package/dist/content/core-agents.d.ts +18 -0
  35. package/dist/content/core-agents.js +46 -2
  36. package/dist/content/decision-protocol.d.ts +1 -1
  37. package/dist/content/decision-protocol.js +1 -1
  38. package/dist/content/examples.js +6 -6
  39. package/dist/content/harness-doc.js +20 -2
  40. package/dist/content/hook-inline-snippets.d.ts +17 -4
  41. package/dist/content/hook-inline-snippets.js +218 -5
  42. package/dist/content/hook-manifest.d.ts +2 -2
  43. package/dist/content/hook-manifest.js +2 -2
  44. package/dist/content/hooks.d.ts +1 -0
  45. package/dist/content/hooks.js +32 -137
  46. package/dist/content/idea-command.d.ts +8 -0
  47. package/dist/content/{ideate-command.js → idea-command.js} +57 -50
  48. package/dist/content/idea-frames.d.ts +31 -0
  49. package/dist/content/{ideate-frames.js → idea-frames.js} +9 -9
  50. package/dist/content/idea-ranking.d.ts +25 -0
  51. package/dist/content/{ideate-ranking.js → idea-ranking.js} +5 -5
  52. package/dist/content/iron-laws.d.ts +0 -1
  53. package/dist/content/iron-laws.js +31 -16
  54. package/dist/content/learnings.js +1 -1
  55. package/dist/content/meta-skill.js +7 -7
  56. package/dist/content/node-hooks.d.ts +10 -0
  57. package/dist/content/node-hooks.js +43 -9
  58. package/dist/content/opencode-plugin.js +3 -3
  59. package/dist/content/skills.js +19 -7
  60. package/dist/content/stage-schema.js +44 -2
  61. package/dist/content/stages/_lint-metadata/index.js +26 -2
  62. package/dist/content/stages/brainstorm.js +13 -7
  63. package/dist/content/stages/design.js +16 -11
  64. package/dist/content/stages/plan.js +7 -4
  65. package/dist/content/stages/review.js +4 -4
  66. package/dist/content/stages/schema-types.d.ts +1 -1
  67. package/dist/content/stages/scope.js +15 -12
  68. package/dist/content/stages/ship.js +2 -2
  69. package/dist/content/stages/spec.js +9 -3
  70. package/dist/content/stages/tdd.js +14 -4
  71. package/dist/content/start-command.js +11 -10
  72. package/dist/content/status-command.js +3 -3
  73. package/dist/content/subagents.js +60 -6
  74. package/dist/content/templates.d.ts +1 -1
  75. package/dist/content/templates.js +102 -150
  76. package/dist/content/tree-command.js +2 -2
  77. package/dist/content/utility-skills.d.ts +2 -2
  78. package/dist/content/utility-skills.js +2 -2
  79. package/dist/content/view-command.js +4 -2
  80. package/dist/delegation.d.ts +2 -0
  81. package/dist/delegation.js +2 -1
  82. package/dist/early-loop.d.ts +66 -0
  83. package/dist/early-loop.js +275 -0
  84. package/dist/gate-evidence.d.ts +8 -0
  85. package/dist/gate-evidence.js +141 -5
  86. package/dist/harness-adapters.d.ts +2 -2
  87. package/dist/harness-adapters.js +47 -18
  88. package/dist/install.js +153 -29
  89. package/dist/internal/advance-stage/advance.d.ts +50 -0
  90. package/dist/internal/advance-stage/advance.js +480 -0
  91. package/dist/internal/advance-stage/cancel-run.d.ts +8 -0
  92. package/dist/internal/advance-stage/cancel-run.js +19 -0
  93. package/dist/internal/advance-stage/flow-state-coercion.d.ts +3 -0
  94. package/dist/internal/advance-stage/flow-state-coercion.js +81 -0
  95. package/dist/internal/advance-stage/helpers.d.ts +14 -0
  96. package/dist/internal/advance-stage/helpers.js +145 -0
  97. package/dist/internal/advance-stage/hook.d.ts +8 -0
  98. package/dist/internal/advance-stage/hook.js +40 -0
  99. package/dist/internal/advance-stage/parsers.d.ts +54 -0
  100. package/dist/internal/advance-stage/parsers.js +307 -0
  101. package/dist/internal/advance-stage/review-loop.d.ts +7 -0
  102. package/dist/internal/advance-stage/review-loop.js +170 -0
  103. package/dist/internal/advance-stage/rewind.d.ts +14 -0
  104. package/dist/internal/advance-stage/rewind.js +108 -0
  105. package/dist/internal/advance-stage/start-flow.d.ts +11 -0
  106. package/dist/internal/advance-stage/start-flow.js +136 -0
  107. package/dist/internal/advance-stage/verify.d.ts +29 -0
  108. package/dist/internal/advance-stage/verify.js +225 -0
  109. package/dist/internal/advance-stage.js +21 -1470
  110. package/dist/internal/compound-readiness.d.ts +1 -1
  111. package/dist/internal/compound-readiness.js +2 -2
  112. package/dist/internal/early-loop-status.d.ts +7 -0
  113. package/dist/internal/early-loop-status.js +90 -0
  114. package/dist/internal/runtime-integrity.d.ts +7 -0
  115. package/dist/internal/runtime-integrity.js +288 -0
  116. package/dist/internal/tdd-red-evidence.js +1 -1
  117. package/dist/knowledge-store.d.ts +3 -8
  118. package/dist/knowledge-store.js +16 -29
  119. package/dist/managed-resources.js +24 -2
  120. package/dist/policy.js +4 -6
  121. package/dist/run-archive.d.ts +1 -1
  122. package/dist/run-archive.js +12 -12
  123. package/dist/run-persistence.js +111 -11
  124. package/dist/tdd-cycle.d.ts +3 -3
  125. package/dist/tdd-cycle.js +1 -1
  126. package/dist/types.d.ts +18 -10
  127. package/package.json +1 -1
  128. package/dist/content/ideate-command.d.ts +0 -8
  129. package/dist/content/ideate-frames.d.ts +0 -31
  130. package/dist/content/ideate-ranking.d.ts +0 -25
  131. package/dist/content/next-command.d.ts +0 -20
  132. package/dist/content/next-command.js +0 -298
  133. package/dist/content/seed-shelf.d.ts +0 -36
  134. package/dist/content/seed-shelf.js +0 -301
  135. package/dist/content/stage-common-guidance.d.ts +0 -1
  136. package/dist/content/stage-common-guidance.js +0 -106
  137. package/dist/doctor-registry.d.ts +0 -10
  138. package/dist/doctor-registry.js +0 -186
  139. package/dist/doctor.d.ts +0 -17
  140. package/dist/doctor.js +0 -2201
  141. package/dist/internal/hook-manifest.d.ts +0 -16
  142. package/dist/internal/hook-manifest.js +0 -77
@@ -0,0 +1,246 @@
1
+ import { type FlowStage, type FlowTrack } from "../types.js";
2
+ export interface LintFinding {
3
+ section: string;
4
+ required: boolean;
5
+ rule: string;
6
+ found: boolean;
7
+ details: string;
8
+ }
9
+ export interface LintResult {
10
+ stage: string;
11
+ file: string;
12
+ passed: boolean;
13
+ findings: LintFinding[];
14
+ }
15
+ export declare function normalizeHeadingTitle(title: string): string;
16
+ export type H2SectionMap = Map<string, string>;
17
+ /**
18
+ * Collect H2 sections and body content (`## Section Name`).
19
+ *
20
+ * - Ignores lines that live inside fenced code blocks (``` / ~~~) so a
21
+ * commented `## Approaches` inside an example doesn't open a phantom
22
+ * section and swallow real content.
23
+ * - When the same heading appears more than once at the top level we
24
+ * concatenate the bodies rather than silently overwriting the earlier
25
+ * occurrence. This keeps lint rules honest when authors split a section
26
+ * into multiple passes.
27
+ */
28
+ export declare function extractH2Sections(markdown: string): H2SectionMap;
29
+ export declare function headingPresent(sections: H2SectionMap, section: string): boolean;
30
+ export declare function sectionBodyByName(sections: H2SectionMap, section: string): string | null;
31
+ export declare function sectionBodyByAnyName(sections: H2SectionMap, sectionNames: string[]): string | null;
32
+ export declare function sectionBodyByHeadingPrefix(sections: H2SectionMap, prefix: string): string | null;
33
+ /**
34
+ * Build a regex that matches `<field>: <value>` even when the field name
35
+ * and/or value are wrapped in markdown emphasis (`*`, `**`, `_`, `__`).
36
+ *
37
+ * The shipped templates render fields as `- **Field name:** value`, so any
38
+ * structural check that searches for `Field:\s*token` against the rendered
39
+ * artifact must tolerate the closing `**` between the colon and the value.
40
+ *
41
+ * `field` is treated as literal text (regex meta-characters are escaped).
42
+ * `value` is inserted verbatim so callers can pass alternation
43
+ * (`STARTUP|BUILDER|...`). `flags` defaults to case-insensitive Unicode.
44
+ */
45
+ export declare function markdownFieldRegex(field: string, value: string, flags?: string): RegExp;
46
+ export declare function extractMarkdownSectionBody(markdown: string, section: string): string | null;
47
+ export declare function headingLineIndex(markdown: string, section: string): number;
48
+ export declare function parseShortCircuitStatus(sectionBody: string | null): string;
49
+ export declare function isShortCircuitActivated(sectionBody: string | null): boolean;
50
+ export declare function meaningfulLineCount(sectionBody: string): number;
51
+ export declare function lineHasToken(line: string, token: string): boolean;
52
+ export declare function countListItems(sectionBody: string): number;
53
+ export declare function parseMarkdownTableRow(line: string): string[];
54
+ export declare function tableHeaderCells(sectionBody: string): string[] | null;
55
+ export declare function extractMinItemsFromRule(rule: string): number | null;
56
+ export declare function tokensFromRule(rule: string): string[];
57
+ export declare const VAGUE_AC_ADJECTIVES: string[];
58
+ export declare function isSeparatorRow(line: string): boolean;
59
+ export declare function getMarkdownTableRows(sectionBody: string): string[][];
60
+ export type BinaryFlag = "yes" | "no" | "unknown";
61
+ export declare function parseBinaryFlag(value: string): BinaryFlag;
62
+ export declare function parseKeyedBinaryFlag(value: string, key: string): BinaryFlag;
63
+ export declare function parseFailureModeRescueFlag(rescueCell: string): BinaryFlag;
64
+ export declare function parseFailureModeTestFlag(rowText: string): BinaryFlag;
65
+ export declare function validateFailureModeTable(sectionBody: string): {
66
+ ok: boolean;
67
+ details: string;
68
+ };
69
+ export declare const SCOPE_MODE_FULL_TOKENS: readonly string[];
70
+ export type CanonicalScopeMode = (typeof SCOPE_MODE_FULL_TOKENS)[number];
71
+ export declare const SCOPE_MODE_LINE_REGEX: RegExp;
72
+ export declare const SCOPE_MODE_SHORT_TOKEN_REGEX: RegExp;
73
+ export declare const SPEC_MAX_MODULES = 5;
74
+ export declare const NEXT_STAGE_HANDOFF_REGEX: RegExp;
75
+ export declare function hasCanonicalScopeMode(body: string): boolean;
76
+ export declare function canonicalModesInText(text: string): CanonicalScopeMode[];
77
+ export declare function shortModeToCanonical(text: string): CanonicalScopeMode | null;
78
+ export declare function canonicalModeFromCandidate(candidate: string): CanonicalScopeMode | null;
79
+ export declare function extractCanonicalScopeMode(body: string): CanonicalScopeMode | null;
80
+ export declare function validatePremiseChallenge(sectionBody: string): {
81
+ ok: boolean;
82
+ details: string;
83
+ };
84
+ export declare function validateScopeSummary(sectionBody: string): {
85
+ ok: boolean;
86
+ details: string;
87
+ };
88
+ export declare const APPROACH_ROLE_VALUES: readonly ["baseline", "challenger", "wild-card"];
89
+ export declare const APPROACH_UPSIDE_VALUES: readonly ["low", "modest", "high", "higher"];
90
+ export declare const REQUIREMENT_PRIORITY_VALUES: readonly ["P0", "P1", "P2", "P3", "DROPPED"];
91
+ export declare function normalizeTableToken(value: string): string;
92
+ export declare function columnIndex(header: string[], expected: string): number;
93
+ export declare function validateApproachesTaxonomy(sectionBody: string): {
94
+ rowCount: number;
95
+ roleUpsideOk: boolean;
96
+ challengerOk: boolean;
97
+ details: string;
98
+ };
99
+ export declare function validateCalibratedSelfReview(sectionBody: string): {
100
+ ok: boolean;
101
+ details: string;
102
+ };
103
+ export declare function validateRequirementsTaxonomy(sectionBody: string): {
104
+ ok: boolean;
105
+ details: string;
106
+ };
107
+ export declare function validateLockedDecisionAnchors(sectionBody: string): {
108
+ ok: boolean;
109
+ anchors: string[];
110
+ details: string;
111
+ };
112
+ export interface InteractionEdgeCaseRequirement {
113
+ label: string;
114
+ pattern: RegExp;
115
+ }
116
+ export declare const INTERACTION_EDGE_CASE_REQUIREMENTS: readonly InteractionEdgeCaseRequirement[];
117
+ export declare function validateInteractionEdgeCaseMatrix(sectionBody: string): {
118
+ ok: boolean;
119
+ details: string;
120
+ };
121
+ export declare const PRE_SCOPE_AUDIT_SIGNALS: ReadonlyArray<{
122
+ label: string;
123
+ pattern: RegExp;
124
+ }>;
125
+ export declare function validatePreScopeSystemAudit(sectionBody: string): {
126
+ ok: boolean;
127
+ details: string;
128
+ };
129
+ export declare const DIAGRAM_ARROW_PATTERN: RegExp;
130
+ export declare const DIAGRAM_FAILURE_EDGE_PATTERN: RegExp;
131
+ export declare const DIAGRAM_GENERIC_NODE_PATTERN: RegExp;
132
+ export declare const TEST_COMMAND_MARKER_PATTERN: RegExp;
133
+ export declare const RED_FAILURE_MARKER_PATTERN: RegExp;
134
+ export declare const GREEN_SUCCESS_MARKER_PATTERN: RegExp;
135
+ export declare function diagramEdgeLines(sectionBody: string): string[];
136
+ export declare function hasFailureEdgeInDiagram(sectionBody: string): boolean;
137
+ export declare function hasLabeledDiagramArrow(lines: string[]): boolean;
138
+ export declare function hasAsyncDiagramEdge(lines: string[]): boolean;
139
+ export declare function hasSyncDiagramEdge(lines: string[]): boolean;
140
+ export declare function validateTddRedEvidence(sectionBody: string): {
141
+ ok: boolean;
142
+ details: string;
143
+ };
144
+ export declare function validateTddGreenEvidence(sectionBody: string): {
145
+ ok: boolean;
146
+ details: string;
147
+ };
148
+ export declare function validateVerificationLadder(sectionBody: string): {
149
+ ok: boolean;
150
+ details: string;
151
+ };
152
+ export declare function hasVerificationLadderTableRow(sectionBody: string): boolean;
153
+ export type LearningEntryType = "rule" | "pattern" | "lesson" | "compound";
154
+ export type LearningConfidence = "high" | "medium" | "low";
155
+ export type LearningSeverity = "critical" | "important" | "suggestion";
156
+ export type LearningUniversality = "project" | "personal" | "universal";
157
+ export type LearningMaturity = "raw" | "lifted-to-rule" | "lifted-to-enforcement";
158
+ export type LearningSource = "stage" | "retro" | "compound" | "idea" | "manual";
159
+ export interface LearningSeedEntry {
160
+ type: LearningEntryType;
161
+ trigger: string;
162
+ action: string;
163
+ confidence: LearningConfidence;
164
+ severity?: LearningSeverity;
165
+ domain?: string | null;
166
+ stage?: FlowStage | null;
167
+ origin_stage?: FlowStage | null;
168
+ origin_run?: string | null;
169
+ frequency?: number;
170
+ universality?: LearningUniversality;
171
+ maturity?: LearningMaturity;
172
+ created?: string;
173
+ first_seen_ts?: string;
174
+ last_seen_ts?: string;
175
+ project?: string | null;
176
+ source?: LearningSource | null;
177
+ supersedes?: string[];
178
+ superseded_by?: string;
179
+ }
180
+ export interface LearningsParseResult {
181
+ ok: boolean;
182
+ none: boolean;
183
+ entries: LearningSeedEntry[];
184
+ errors: string[];
185
+ details: string;
186
+ }
187
+ export declare const LEARNING_TYPE_SET: Set<LearningEntryType>;
188
+ export declare const LEARNING_CONFIDENCE_SET: Set<LearningConfidence>;
189
+ export declare const LEARNING_SEVERITY_SET: Set<LearningSeverity>;
190
+ export declare const LEARNING_UNIVERSALITY_SET: Set<LearningUniversality>;
191
+ export declare const LEARNING_MATURITY_SET: Set<LearningMaturity>;
192
+ export declare const LEARNING_SOURCE_SET: Set<LearningSource>;
193
+ export declare const FLOW_STAGE_SET: Set<"brainstorm" | "scope" | "design" | "spec" | "plan" | "tdd" | "review" | "ship">;
194
+ export declare const LEARNING_ALLOWED_KEYS: Set<string>;
195
+ export declare function isIsoUtcTimestamp(value: string): boolean;
196
+ export declare function isNullableString(value: unknown): value is string | null;
197
+ export declare function isNullableStage(value: unknown): value is FlowStage | null;
198
+ export declare function parseLearningSeedEntry(raw: unknown, index: number): {
199
+ ok: boolean;
200
+ entry?: LearningSeedEntry;
201
+ error?: string;
202
+ };
203
+ export declare function parseLearningsSection(sectionBody: string): LearningsParseResult;
204
+ export declare function lineContainsVagueAdjective(text: string): string | null;
205
+ export interface ParsedFrontmatter {
206
+ hasFrontmatter: boolean;
207
+ values: Record<string, string>;
208
+ }
209
+ export declare const FRONTMATTER_REQUIRED_KEYS: readonly ["stage", "schema_version", "version", "locked_decisions", "inputs_hash"];
210
+ export declare const PLACEHOLDER_PATTERNS: Array<{
211
+ label: string;
212
+ regex: RegExp;
213
+ }>;
214
+ export declare const SCOPE_REDUCTION_PATTERNS: Array<{
215
+ label: string;
216
+ regex: RegExp;
217
+ }>;
218
+ export declare function parseFrontmatter(markdown: string): ParsedFrontmatter;
219
+ export declare function extractDecisionIds(text: string): string[];
220
+ export declare function extractRequirementIdsFromMarkdown(text: string): string[];
221
+ export declare function extractLockedDecisionAnchors(text: string): string[];
222
+ export declare function lockedDecisionHash(value: string): string;
223
+ export declare function collectPatternHits(text: string, patterns: Array<{
224
+ label: string;
225
+ regex: RegExp;
226
+ }>): string[];
227
+ export declare function validateSectionBody(sectionBody: string, rule: string, sectionName: string): {
228
+ ok: boolean;
229
+ details: string;
230
+ };
231
+ export interface StageLintContext {
232
+ projectRoot: string;
233
+ stage: FlowStage;
234
+ track: FlowTrack;
235
+ raw: string;
236
+ absFile: string;
237
+ sections: H2SectionMap;
238
+ findings: LintFinding[];
239
+ parsedFrontmatter: ParsedFrontmatter;
240
+ brainstormShortCircuitBody: string | null;
241
+ brainstormShortCircuitActivated: boolean;
242
+ scopePreAuditEnabled: boolean;
243
+ staleDiagramAuditEnabled: boolean;
244
+ isTrivialOverride: boolean;
245
+ overrideSet: Set<string> | null;
246
+ }