cclaw-cli 6.14.4 → 7.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/README.md +0 -2
- package/dist/artifact-linter/brainstorm.js +1 -1
- package/dist/artifact-linter/design.js +2 -2
- package/dist/artifact-linter/findings-dedup.js +1 -1
- package/dist/artifact-linter/plan.js +6 -6
- package/dist/artifact-linter/review-army.d.ts +1 -1
- package/dist/artifact-linter/review-army.js +1 -1
- package/dist/artifact-linter/scope.js +6 -6
- package/dist/artifact-linter/shared.d.ts +37 -73
- package/dist/artifact-linter/shared.js +30 -37
- package/dist/artifact-linter/spec.js +1 -1
- package/dist/artifact-linter/tdd.d.ts +20 -33
- package/dist/artifact-linter/tdd.js +89 -639
- package/dist/artifact-linter.js +11 -32
- package/dist/cli.js +1 -1
- package/dist/config.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/content/core-agents.d.ts +8 -26
- package/dist/content/core-agents.js +48 -94
- package/dist/content/examples.d.ts +1 -1
- package/dist/content/examples.js +4 -4
- package/dist/content/hooks.js +62 -149
- package/dist/content/idea.js +2 -2
- package/dist/content/iron-laws.js +1 -1
- package/dist/content/node-hooks.js +2 -2
- package/dist/content/skills-elicitation.js +2 -2
- package/dist/content/skills.d.ts +4 -6
- package/dist/content/skills.js +14 -53
- package/dist/content/stage-schema.d.ts +3 -3
- package/dist/content/stage-schema.js +8 -46
- package/dist/content/stages/brainstorm.js +5 -5
- package/dist/content/stages/plan.js +2 -2
- package/dist/content/stages/review.js +1 -1
- package/dist/content/stages/schema-types.d.ts +1 -1
- package/dist/content/stages/scope.js +1 -1
- package/dist/content/stages/spec.js +2 -2
- package/dist/content/stages/tdd.js +43 -108
- package/dist/content/start-command.js +3 -3
- package/dist/content/subagent-context-skills.js +5 -3
- package/dist/content/subagents.js +13 -74
- package/dist/content/templates.d.ts +6 -6
- package/dist/content/templates.js +23 -24
- package/dist/content/utility-skills.d.ts +1 -1
- package/dist/content/utility-skills.js +1 -1
- package/dist/delegation.d.ts +79 -139
- package/dist/delegation.js +83 -215
- package/dist/early-loop.js +1 -1
- package/dist/flow-state.d.ts +24 -129
- package/dist/flow-state.js +5 -30
- package/dist/gate-evidence.d.ts +2 -7
- package/dist/gate-evidence.js +2 -59
- package/dist/harness-adapters.d.ts +1 -1
- package/dist/harness-adapters.js +11 -10
- package/dist/install.js +24 -459
- package/dist/internal/advance-stage/advance.d.ts +5 -5
- package/dist/internal/advance-stage/advance.js +9 -24
- package/dist/internal/advance-stage/parsers.d.ts +1 -1
- package/dist/internal/advance-stage/review-loop.d.ts +1 -1
- package/dist/internal/advance-stage/review-loop.js +3 -3
- package/dist/internal/advance-stage/start-flow.js +1 -3
- package/dist/internal/advance-stage.js +4 -23
- package/dist/internal/cohesion-contract-stub.d.ts +8 -13
- package/dist/internal/cohesion-contract-stub.js +18 -24
- package/dist/internal/flow-state-repair.d.ts +1 -1
- package/dist/internal/plan-split-waves.d.ts +18 -21
- package/dist/internal/plan-split-waves.js +16 -19
- package/dist/internal/wave-status.d.ts +3 -6
- package/dist/internal/wave-status.js +5 -27
- package/dist/policy.js +1 -1
- package/dist/run-persistence.js +10 -44
- package/dist/runtime/run-hook.mjs +3 -3
- package/dist/track-heuristics.js +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
- package/dist/integration-fanin.d.ts +0 -44
- package/dist/integration-fanin.js +0 -180
- package/dist/internal/set-checkpoint-mode.d.ts +0 -16
- package/dist/internal/set-checkpoint-mode.js +0 -72
- package/dist/internal/set-integration-overseer-mode.d.ts +0 -14
- package/dist/internal/set-integration-overseer-mode.js +0 -69
- package/dist/internal/set-worktree-mode.d.ts +0 -10
- package/dist/internal/set-worktree-mode.js +0 -28
- package/dist/worktree-manager.d.ts +0 -50
- package/dist/worktree-manager.js +0 -136
- package/dist/worktree-types.d.ts +0 -36
- package/dist/worktree-types.js +0 -6
package/dist/delegation.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export type DelegationMode = "mandatory" | "proactive";
|
|
|
7
7
|
export type DelegationStatus = "scheduled" | "launched" | "acknowledged" | "completed" | "failed" | "waived" | "stale";
|
|
8
8
|
export declare const DELEGATION_DISPATCH_SURFACES: readonly ["claude-task", "cursor-task", "opencode-agent", "codex-agent", "generic-task", "role-switch", "manual"];
|
|
9
9
|
export type DelegationDispatchSurface = typeof DELEGATION_DISPATCH_SURFACES[number];
|
|
10
|
+
/** Agents that declare `claimedPaths` for parallel/disjoint scheduling and fan-out caps. */
|
|
11
|
+
export declare function isParallelTddSliceWorker(agent: string | undefined): boolean;
|
|
10
12
|
/**
|
|
11
13
|
* Per-surface allowed agent-definition path prefixes. Used by the generated
|
|
12
14
|
* `.cclaw/hooks/delegation-record.mjs` helper to reject mismatched
|
|
@@ -63,9 +65,9 @@ export type DelegationEntry = {
|
|
|
63
65
|
acceptedBy?: DelegationWaiverAcceptedBy;
|
|
64
66
|
/**
|
|
65
67
|
* Waiver approval token captured from `cclaw-cli internal waiver-grant`.
|
|
66
|
-
* Present on waiver rows
|
|
67
|
-
*
|
|
68
|
-
* `waiver_legacy_provenance`.
|
|
68
|
+
* Present on waiver rows that went through `cclaw-cli internal
|
|
69
|
+
* waiver-grant`. Legacy rows that lack provenance are surfaced as the
|
|
70
|
+
* advisory linter finding `waiver_legacy_provenance`.
|
|
69
71
|
*/
|
|
70
72
|
approvalToken?: string;
|
|
71
73
|
approvalReason?: string;
|
|
@@ -118,85 +120,63 @@ export type DelegationEntry = {
|
|
|
118
120
|
*/
|
|
119
121
|
schemaVersion?: 1 | 2 | 3;
|
|
120
122
|
/**
|
|
121
|
-
*
|
|
123
|
+
* When set, the operator explicitly opted into running this
|
|
122
124
|
* scheduled span concurrently with another active span on the same
|
|
123
125
|
* `(stage, agent)` pair. Bypasses the dispatch-dedup check.
|
|
124
126
|
*/
|
|
125
127
|
allowParallel?: boolean;
|
|
126
128
|
/**
|
|
127
|
-
*
|
|
129
|
+
* Set on synthetic terminal `stale` rows written via
|
|
128
130
|
* `--supersede=<prevSpanId>`. References the new spanId that
|
|
129
131
|
* superseded this span. Helps `/cc tree` and the linter report a
|
|
130
132
|
* coherent successor chain.
|
|
131
133
|
*/
|
|
132
134
|
supersededBy?: string;
|
|
133
135
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
* other than slice-implementer the field is advisory.
|
|
136
|
+
* Repo-relative paths the delegated slice-builder will edit. Used by the
|
|
137
|
+
* file-overlap scheduler to either auto-allow parallel dispatch (disjoint
|
|
138
|
+
* paths) or block the row with `DispatchOverlapError` (overlapping paths).
|
|
139
|
+
* For agents other than `slice-builder` the field is advisory.
|
|
139
140
|
*
|
|
140
141
|
* keep in sync with the inline copy in
|
|
141
142
|
* `src/content/hooks.ts::delegationRecordScript`.
|
|
142
143
|
*/
|
|
143
144
|
claimedPaths?: string[];
|
|
144
145
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* `slice-documenter` so the artifact linter can auto-derive the
|
|
146
|
+
* TDD slice identifier, e.g. `"S-1"`. Recorded by the controller when
|
|
147
|
+
* dispatching `slice-builder` so the artifact linter can auto-derive the
|
|
148
148
|
* Watched-RED Proof + Vertical Slice Cycle tables from
|
|
149
|
-
* `delegation-events.jsonl` instead of requiring agents to maintain
|
|
150
|
-
*
|
|
149
|
+
* `delegation-events.jsonl` instead of requiring agents to maintain the
|
|
150
|
+
* markdown by hand. Optional on non-TDD rows.
|
|
151
151
|
*
|
|
152
152
|
* keep in sync with the inline copy in
|
|
153
153
|
* `src/content/hooks.ts::delegationRecordScript`.
|
|
154
154
|
*/
|
|
155
155
|
sliceId?: string;
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* `doc` is reserved for the parallel `slice-documenter` subagent
|
|
163
|
-
* (Phase C). Optional: legacy and non-TDD rows omit it.
|
|
157
|
+
* Explicit phase tag for TDD slice events. Combined with `sliceId`, the
|
|
158
|
+
* linter validates RED → GREEN → REFACTOR → DOC monotonicity per slice.
|
|
159
|
+
* `refactor-deferred` requires a rationale either via
|
|
160
|
+
* `--refactor-rationale` (recorded into `evidenceRefs[0]`) or an
|
|
161
|
+
* `evidenceRefs` entry that contains the rationale text.
|
|
164
162
|
*
|
|
165
163
|
* keep in sync with the inline copy in
|
|
166
164
|
* `src/content/hooks.ts::delegationRecordScript`.
|
|
167
165
|
*/
|
|
168
166
|
phase?: "red" | "green" | "refactor" | "refactor-deferred" | "doc" | "resolve-conflict";
|
|
169
167
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*/
|
|
173
|
-
claimToken?: string;
|
|
174
|
-
/** v6.13.0 — lane / worktree id owning the slice checkout. */
|
|
175
|
-
ownerLaneId?: string;
|
|
176
|
-
/** v6.13.0 — ISO lease expiry for reclaim sweeps. */
|
|
177
|
-
leasedUntil?: string;
|
|
178
|
-
/** v6.13.0 — lease bookkeeping for audit + reclaim tooling. */
|
|
179
|
-
leaseState?: "claimed" | "expired" | "released" | "reclaimed";
|
|
180
|
-
/** v6.13.0 — plan unit dependency ids echoed for scheduler diagnostics. */
|
|
181
|
-
dependsOn?: string[];
|
|
182
|
-
/**
|
|
183
|
-
* v6.13.0 — integration branch merge status after deterministic fan-in.
|
|
184
|
-
*/
|
|
185
|
-
integrationState?: "pending" | "applied" | "conflict" | "resolved" | "abandoned";
|
|
186
|
-
/**
|
|
187
|
-
* v6.14.0 — refactor outcome folded into `phase=green` events so a single
|
|
188
|
-
* row can close RED→GREEN→REFACTOR for the slice without a separate
|
|
168
|
+
* Refactor outcome folded into `phase=green` events so a single row can
|
|
169
|
+
* close RED → GREEN → REFACTOR for the slice without a separate
|
|
189
170
|
* `phase=refactor` / `phase=refactor-deferred` lifecycle pass.
|
|
190
171
|
*
|
|
191
172
|
* - `mode: "inline"` — refactor pass ran inline as part of the GREEN
|
|
192
173
|
* delegation (rationale optional but recommended for traceability).
|
|
193
174
|
* - `mode: "deferred"` — refactor was intentionally deferred; rationale
|
|
194
175
|
* is required (carried in `rationale` and mirrored into
|
|
195
|
-
* `evidenceRefs[0]` so
|
|
176
|
+
* `evidenceRefs[0]` so evidence-pointer linters keep matching).
|
|
196
177
|
*
|
|
197
|
-
* `phase=refactor` and `phase=refactor-deferred` events remain valid
|
|
198
|
-
*
|
|
199
|
-
* REFACTOR coverage.
|
|
178
|
+
* `phase=refactor` and `phase=refactor-deferred` events remain valid;
|
|
179
|
+
* the linter accepts either form for REFACTOR coverage.
|
|
200
180
|
*
|
|
201
181
|
* keep in sync with the inline copy in
|
|
202
182
|
* `src/content/hooks.ts::delegationRecordScript`.
|
|
@@ -206,10 +186,10 @@ export type DelegationEntry = {
|
|
|
206
186
|
rationale?: string;
|
|
207
187
|
};
|
|
208
188
|
/**
|
|
209
|
-
*
|
|
210
|
-
* `integrationCheckRequired()` to decide whether the
|
|
211
|
-
*
|
|
212
|
-
*
|
|
189
|
+
* Risk tier hint copied from the plan slice. Used by
|
|
190
|
+
* `integrationCheckRequired()` to decide whether the integration-overseer
|
|
191
|
+
* must run. `low` and `medium` are advisory; `high` always triggers the
|
|
192
|
+
* overseer. Optional on every row.
|
|
213
193
|
*/
|
|
214
194
|
riskTier?: "low" | "medium" | "high";
|
|
215
195
|
};
|
|
@@ -238,31 +218,9 @@ export type DelegationEvent = DelegationEntry & {
|
|
|
238
218
|
*/
|
|
239
219
|
export declare function isTrustBoundaryPath(filePath: string): boolean;
|
|
240
220
|
export declare function readDelegationLedger(projectRoot: string): Promise<DelegationLedger>;
|
|
241
|
-
/** Parsed `cclaw_fanin_*` audit rows from `delegation-events.jsonl`. */
|
|
242
|
-
export interface FanInAuditRecord {
|
|
243
|
-
event: "cclaw_fanin_applied" | "cclaw_fanin_conflict" | "cclaw_fanin_resolved" | "cclaw_fanin_abandoned";
|
|
244
|
-
runId?: string;
|
|
245
|
-
laneId?: string;
|
|
246
|
-
sliceIds?: string[];
|
|
247
|
-
integrationBranch?: string;
|
|
248
|
-
details?: string;
|
|
249
|
-
ts: string;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Append a deterministic fan-in audit row (not a delegation lifecycle event).
|
|
253
|
-
*/
|
|
254
|
-
export declare function recordCclawFanInAudit(projectRoot: string, params: {
|
|
255
|
-
kind: FanInAuditRecord["event"];
|
|
256
|
-
runId: string;
|
|
257
|
-
laneId: string;
|
|
258
|
-
sliceIds: string[];
|
|
259
|
-
integrationBranch: string;
|
|
260
|
-
details?: string;
|
|
261
|
-
}): Promise<void>;
|
|
262
221
|
export declare function readDelegationEvents(projectRoot: string): Promise<{
|
|
263
222
|
events: DelegationEvent[];
|
|
264
223
|
corruptLines: number[];
|
|
265
|
-
fanInAudits: FanInAuditRecord[];
|
|
266
224
|
}>;
|
|
267
225
|
/**
|
|
268
226
|
* Fold ledger entries to the latest row per `spanId` and keep only spans
|
|
@@ -284,7 +242,7 @@ export declare function readDelegationEvents(projectRoot: string): Promise<{
|
|
|
284
242
|
*/
|
|
285
243
|
export declare function computeActiveSubagents(entries: DelegationEntry[]): DelegationEntry[];
|
|
286
244
|
/**
|
|
287
|
-
*
|
|
245
|
+
* Thrown by `validateMonotonicTimestamps` when an incoming row
|
|
288
246
|
* would push a span's timeline backwards. Carries enough context that
|
|
289
247
|
* the CLI / hook surface can format a `delegation_timestamp_non_monotonic`
|
|
290
248
|
* JSON payload without re-deriving the offending field.
|
|
@@ -299,7 +257,7 @@ export declare class DelegationTimestampError extends Error {
|
|
|
299
257
|
constructor(field: string, actual: string, priorBound: string);
|
|
300
258
|
}
|
|
301
259
|
/**
|
|
302
|
-
*
|
|
260
|
+
* Enforce that lifecycle timestamps on a delegation span move
|
|
303
261
|
* forward (or stay equal). Validates both per-row invariants
|
|
304
262
|
* (`startTs ≤ launchedTs ≤ ackTs ≤ completedTs`) and a cross-row
|
|
305
263
|
* invariant: the union of prior rows for this `spanId` plus the
|
|
@@ -313,7 +271,7 @@ export declare class DelegationTimestampError extends Error {
|
|
|
313
271
|
*/
|
|
314
272
|
export declare function validateMonotonicTimestamps(stamped: DelegationEntry, prior: DelegationEntry[]): void;
|
|
315
273
|
/**
|
|
316
|
-
*
|
|
274
|
+
* Thrown by `appendDelegation` when the operator opens a
|
|
317
275
|
* second `scheduled` span on the same `(stage, agent)` pair while an
|
|
318
276
|
* earlier span on the same pair is still active. Callers can catch and
|
|
319
277
|
* either pass the existing span id via `--supersede=<id>` (which
|
|
@@ -339,13 +297,12 @@ export declare class DispatchDuplicateError extends Error {
|
|
|
339
297
|
});
|
|
340
298
|
}
|
|
341
299
|
/**
|
|
342
|
-
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
* deliberately to acknowledge the conflict.
|
|
300
|
+
* Thrown by `validateFileOverlap` when a new `slice-builder` is scheduled
|
|
301
|
+
* on a TDD stage with at least one `claimedPaths` entry that overlaps an
|
|
302
|
+
* active span. The scheduler auto-allows parallel dispatch when paths are
|
|
303
|
+
* disjoint, so an explicit overlap is treated as a serialization signal:
|
|
304
|
+
* the operator must wait for the existing span to terminate or pass
|
|
305
|
+
* `--allow-parallel` deliberately to acknowledge the conflict.
|
|
349
306
|
*/
|
|
350
307
|
export declare class DispatchOverlapError extends Error {
|
|
351
308
|
readonly existingSpanId: string;
|
|
@@ -366,11 +323,10 @@ export declare class DispatchOverlapError extends Error {
|
|
|
366
323
|
});
|
|
367
324
|
}
|
|
368
325
|
/**
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* `CCLAW_MAX_PARALLEL_SLICE_IMPLEMENTERS=<N>` env.
|
|
326
|
+
* Thrown when the count of active `slice-builder` spans reaches
|
|
327
|
+
* `MAX_PARALLEL_SLICE_BUILDERS` and a new scheduled row would push it past
|
|
328
|
+
* the cap. Cap can be overridden once via `--override-cap=N` on the hook
|
|
329
|
+
* flag or globally via `CCLAW_MAX_PARALLEL_SLICE_BUILDERS=<N>` env.
|
|
374
330
|
*/
|
|
375
331
|
export declare class DispatchCapError extends Error {
|
|
376
332
|
readonly cap: number;
|
|
@@ -389,17 +345,10 @@ export declare class DispatchCapError extends Error {
|
|
|
389
345
|
});
|
|
390
346
|
}
|
|
391
347
|
/**
|
|
392
|
-
*
|
|
393
|
-
|
|
394
|
-
export declare class DispatchClaimInvalidError extends Error {
|
|
395
|
-
constructor(message: string);
|
|
396
|
-
}
|
|
397
|
-
/**
|
|
398
|
-
* v6.10.0 (P2) — default cap on active `slice-implementer` spans in a
|
|
399
|
-
* single TDD run. Aligned with evanflow's parallel cap. Override via
|
|
400
|
-
* `CCLAW_MAX_PARALLEL_SLICE_IMPLEMENTERS=<int>` (validated `>=1`).
|
|
348
|
+
* Default cap on active `slice-builder` spans in a single TDD run. Override
|
|
349
|
+
* via `CCLAW_MAX_PARALLEL_SLICE_BUILDERS=<int>` (validated `>=1`).
|
|
401
350
|
*/
|
|
402
|
-
export declare const
|
|
351
|
+
export declare const MAX_PARALLEL_SLICE_BUILDERS: 5;
|
|
403
352
|
export interface ReadySliceUnit {
|
|
404
353
|
unitId: string;
|
|
405
354
|
sliceId: string;
|
|
@@ -413,7 +362,6 @@ export interface SelectReadySlicesOptions {
|
|
|
413
362
|
activePathHolders: ReadonlyArray<{
|
|
414
363
|
paths: string[];
|
|
415
364
|
}>;
|
|
416
|
-
legacyContinuation: boolean;
|
|
417
365
|
}
|
|
418
366
|
/**
|
|
419
367
|
* Return up to `cap` slice units whose dependsOn are satisfied, avoiding
|
|
@@ -421,18 +369,18 @@ export interface SelectReadySlicesOptions {
|
|
|
421
369
|
*/
|
|
422
370
|
export declare function selectReadySlices(units: ReadySliceUnit[], opts: SelectReadySlicesOptions): ReadySliceUnit[];
|
|
423
371
|
/**
|
|
424
|
-
*
|
|
372
|
+
* Build scheduler rows from merged parallel wave definitions + plan units.
|
|
425
373
|
*/
|
|
426
374
|
export declare function readySliceUnitsFromMergedWaves(mergedWaves: ParsedParallelWave[], planMarkdown: string, options?: ParseImplementationUnitParallelOptions): ReadySliceUnit[];
|
|
427
375
|
/**
|
|
428
|
-
*
|
|
376
|
+
* Verdict from `integrationCheckRequired()`.
|
|
429
377
|
*
|
|
430
378
|
* `required: true` means the controller MUST dispatch
|
|
431
379
|
* `integration-overseer` before stage-complete; `reasons[]` lists the
|
|
432
380
|
* triggers that fired so the controller can quote them in artifacts.
|
|
433
381
|
*
|
|
434
382
|
* `required: false` means the integration check can be safely skipped
|
|
435
|
-
* (disjoint paths
|
|
383
|
+
* (disjoint paths and no high-risk slices). Callers
|
|
436
384
|
* that skip dispatch should append a `cclaw_integration_overseer_skipped`
|
|
437
385
|
* audit row to `delegation-events.jsonl` so the run log stays honest
|
|
438
386
|
* about the decision.
|
|
@@ -442,16 +390,14 @@ export interface IntegrationCheckVerdict {
|
|
|
442
390
|
reasons: string[];
|
|
443
391
|
}
|
|
444
392
|
/**
|
|
445
|
-
*
|
|
393
|
+
* Heuristic helper deciding whether a multi-slice wave needs
|
|
446
394
|
* the `integration-overseer` dispatch.
|
|
447
395
|
*
|
|
448
396
|
* Triggers (any one):
|
|
449
397
|
* - **two or more closed slices share import boundaries** (heuristic:
|
|
450
398
|
* two slices declare a `claimedPaths` whose first 2 path segments
|
|
451
399
|
* match — same package/module directory);
|
|
452
|
-
* - any slice has `riskTier === "high"
|
|
453
|
-
* - any `cclaw_fanin_conflict` audit row exists in the supplied
|
|
454
|
-
* events list (regardless of slice).
|
|
400
|
+
* - any slice has `riskTier === "high"`.
|
|
455
401
|
*
|
|
456
402
|
* When none fire, the verdict is `{ required: false, reasons: ["disjoint-paths"] }`
|
|
457
403
|
* and the caller should record a `cclaw_integration_overseer_skipped`
|
|
@@ -462,9 +408,8 @@ export interface IntegrationCheckVerdict {
|
|
|
462
408
|
* Use `readDelegationEvents(projectRoot)` in production paths.
|
|
463
409
|
*/
|
|
464
410
|
export declare function integrationCheckRequired(events: DelegationEvent[]): IntegrationCheckVerdict;
|
|
465
|
-
export declare function integrationCheckRequired(events: DelegationEvent[], fanInAudits: FanInAuditRecord[]): IntegrationCheckVerdict;
|
|
466
411
|
/**
|
|
467
|
-
*
|
|
412
|
+
* Append a non-delegation audit event recording that the
|
|
468
413
|
* integration-overseer dispatch was skipped because
|
|
469
414
|
* `integrationCheckRequired()` returned `required: false`. Best-effort;
|
|
470
415
|
* never throws.
|
|
@@ -475,58 +420,53 @@ export declare function recordIntegrationOverseerSkipped(projectRoot: string, pa
|
|
|
475
420
|
sliceIds: string[];
|
|
476
421
|
}): Promise<void>;
|
|
477
422
|
/**
|
|
478
|
-
*
|
|
423
|
+
* Load merged wave plan (Parallel Execution Plan block + wave-plans/) and map to `ReadySliceUnit[]`.
|
|
479
424
|
*/
|
|
480
425
|
export declare function loadTddReadySlicePool(planMarkdown: string, artifactsDir: string, options?: ParseImplementationUnitParallelOptions): Promise<ReadySliceUnit[]>;
|
|
481
426
|
/**
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
*
|
|
487
|
-
*
|
|
488
|
-
* `
|
|
489
|
-
* `{ autoParallel: false }` and the legacy dedup path takes over.
|
|
427
|
+
* When scheduling a `slice-builder` on a TDD stage, compare `claimedPaths`
|
|
428
|
+
* against every currently active span on the same `(stage, agent)` pair.
|
|
429
|
+
* Overlap → throw `DispatchOverlapError`; disjoint paths → return
|
|
430
|
+
* `{ autoParallel: true }` so the caller can mark the new entry
|
|
431
|
+
* `allowParallel = true` without explicit operator intent. When the agent
|
|
432
|
+
* is not a slice-builder or no `claimedPaths` are supplied, the function
|
|
433
|
+
* returns `{ autoParallel: false }` and the standard dedup path takes over.
|
|
490
434
|
*/
|
|
491
435
|
export declare function validateFileOverlap(stamped: DelegationEntry, activeEntries: DelegationEntry[]): {
|
|
492
436
|
autoParallel: boolean;
|
|
493
437
|
};
|
|
494
438
|
/**
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
439
|
+
* Enforce the slice-builder fan-out cap. The new scheduled row pushes the
|
|
440
|
+
* active count from N to N+1; if that would exceed the cap (default 5,
|
|
441
|
+
* env-overridable via `CCLAW_MAX_PARALLEL_SLICE_BUILDERS`), throw
|
|
442
|
+
* `DispatchCapError`.
|
|
498
443
|
*
|
|
499
|
-
* Caller passes the already-folded list of active entries (latest row
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
444
|
+
* Caller passes the already-folded list of active entries (latest row per
|
|
445
|
+
* spanId, ACTIVE statuses only). The function counts entries that match
|
|
446
|
+
* the agent on the same `stage`. The new row's own spanId is excluded so
|
|
447
|
+
* re-recording a `scheduled` doesn't trip the cap on a span that's already
|
|
448
|
+
* counted.
|
|
504
449
|
*/
|
|
505
450
|
export declare function validateFanOutCap(stamped: DelegationEntry, activeEntries: DelegationEntry[], override?: number | null): void;
|
|
506
451
|
/**
|
|
507
|
-
*
|
|
452
|
+
* Find the latest active span for a given `(stage, agent)`
|
|
508
453
|
* pair in the supplied ledger entries. Returns the row whose latest
|
|
509
454
|
* status (after the latest-by-spanId fold) is still in the active set
|
|
510
455
|
* (`scheduled | launched | acknowledged`).
|
|
511
456
|
*
|
|
512
457
|
* Run-scope is **strict**: only entries whose `runId` matches the
|
|
513
458
|
* supplied `runId` are folded. Entries with empty/missing `runId`
|
|
514
|
-
* (
|
|
459
|
+
* (older ledgers without explicit run scoping) are treated as NOT belonging
|
|
515
460
|
* to the current run, so they cannot keep an old span "active" across
|
|
516
461
|
* a fresh dispatch and trip a spurious `dispatch_duplicate`. This
|
|
517
|
-
*
|
|
518
|
-
* slice-
|
|
462
|
+
* Ensures a slice-builder that ran in run-1 does not block a
|
|
463
|
+
* slice-builder scheduled in run-2.
|
|
519
464
|
*
|
|
520
465
|
* keep in sync with the inline copy in
|
|
521
466
|
* `src/content/hooks.ts::delegationRecordScript`.
|
|
522
467
|
*/
|
|
523
468
|
export declare function findActiveSpanForPair(stage: string, agent: string, runId: string, ledger: DelegationLedger): DelegationEntry | null;
|
|
524
469
|
export declare function appendDelegation(projectRoot: string, entry: DelegationEntry): Promise<void>;
|
|
525
|
-
/**
|
|
526
|
-
* Scan delegation events for expired `leasedUntil` timestamps and append
|
|
527
|
-
* best-effort `cclaw_slice_lease_expired` audit rows (one per span/slice key).
|
|
528
|
-
*/
|
|
529
|
-
export declare function reclaimExpiredDelegationClaims(projectRoot: string, now?: Date): Promise<number>;
|
|
530
470
|
/**
|
|
531
471
|
* Aggregate the fulfillment mode cclaw expects for the active harness set.
|
|
532
472
|
* Priority native > generic-dispatch > role-switch > waiver — the best
|
|
@@ -539,10 +479,10 @@ export declare function checkMandatoryDelegations(projectRoot: string, stage: Fl
|
|
|
539
479
|
/**
|
|
540
480
|
* Optional task class for the active run. When set to
|
|
541
481
|
* `"software-bugfix"`, the mandatory delegation gate is skipped
|
|
542
|
-
* entirely
|
|
482
|
+
* entirely. Callers that don't classify the run leave
|
|
543
483
|
* this undefined; the function then falls back to
|
|
544
484
|
* `flowState.taskClass` (persisted in `flow-state.json`) so the
|
|
545
|
-
*
|
|
485
|
+
* Bugfix-skip remains active across the `cclaw advance-stage`
|
|
546
486
|
* code path even when no caller forwards an explicit override.
|
|
547
487
|
*/
|
|
548
488
|
taskClass?: MandatoryDelegationTaskClass | null;
|
|
@@ -564,7 +504,7 @@ export declare function checkMandatoryDelegations(projectRoot: string, stage: Fl
|
|
|
564
504
|
/** Expected fulfillment mode for the active harness set. */
|
|
565
505
|
expectedMode: DelegationFulfillmentMode;
|
|
566
506
|
/**
|
|
567
|
-
*
|
|
507
|
+
* `true` when `mandatoryAgentsFor` returned [] for
|
|
568
508
|
* this (track, taskClass) combination — i.e. the gate was skipped
|
|
569
509
|
* entirely on quick track or software-bugfix runs. The skip is also
|
|
570
510
|
* recorded as a `mandatory_delegations_skipped_by_track` event in
|
|
@@ -573,12 +513,12 @@ export declare function checkMandatoryDelegations(projectRoot: string, stage: Fl
|
|
|
573
513
|
skippedByTrack: boolean;
|
|
574
514
|
}>;
|
|
575
515
|
/**
|
|
576
|
-
*
|
|
516
|
+
* Append a non-delegation audit event recording
|
|
577
517
|
* that one or more required artifact-validation findings were
|
|
578
518
|
* demoted from blocking to advisory because the active run is on a
|
|
579
519
|
* small-fix lane (`track === "quick"` or `taskClass === "software-bugfix"`).
|
|
580
520
|
*
|
|
581
|
-
* The event mirrors
|
|
521
|
+
* The event mirrors `mandatory_delegations_skipped_by_track`
|
|
582
522
|
* audit pattern: best-effort write to `delegation-events.jsonl`, no
|
|
583
523
|
* agent payload, recognized by `readDelegationEvents` so it does not
|
|
584
524
|
* corrupt downstream parsers. Failures are swallowed.
|
|
@@ -591,12 +531,12 @@ export declare function recordArtifactValidationDemotedByTrack(projectRoot: stri
|
|
|
591
531
|
sections: string[];
|
|
592
532
|
}): Promise<void>;
|
|
593
533
|
/**
|
|
594
|
-
*
|
|
534
|
+
* Append a non-delegation audit event recording
|
|
595
535
|
* that the scope-stage Expansion Strategist (`product-discovery`)
|
|
596
536
|
* delegation requirement was skipped because the active run is on a
|
|
597
537
|
* small-fix lane (`track === "quick"` or `taskClass === "software-bugfix"`).
|
|
598
538
|
*
|
|
599
|
-
* Mirrors the
|
|
539
|
+
* Mirrors the `mandatory_delegations_skipped_by_track`
|
|
600
540
|
* audit pattern: best-effort write to `delegation-events.jsonl`, no
|
|
601
541
|
* agent payload, recognized by `readDelegationEvents` so it does not
|
|
602
542
|
* corrupt downstream parsers. Failures are swallowed.
|