@adhdev/mesh-shared 1.0.82-rc.11 → 1.0.82-rc.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant-protocol.d.ts +163 -6
- package/dist/decision-push-relay.d.ts +20 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1630 -118
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1491 -118
- package/dist/index.mjs.map +1 -1
- package/dist/launch-defaults.d.ts +196 -0
- package/dist/light-task.d.ts +96 -0
- package/dist/mesh-tool-names.d.ts +2 -2
- package/dist/mesh-vocabulary.d.ts +13 -4
- package/dist/mission-git-state.d.ts +83 -0
- package/dist/mission-items.d.ts +202 -0
- package/dist/node-facts.d.ts +61 -1
- package/dist/outbound-message.d.ts +9 -2
- package/dist/protocol/daemon-server.d.ts +42 -2
- package/dist/protocol/dashboard-daemon-p2p.d.ts +1 -1
- package/dist/protocol/dashboard-server.d.ts +20 -2
- package/dist/provider-approval.d.ts +36 -0
- package/dist/provider-question.d.ts +19 -0
- package/dist/quota-freshness.d.ts +4 -4
- package/dist/relay-reprobe.d.ts +52 -0
- package/dist/release.d.ts +90 -0
- package/dist/role-launch.d.ts +11 -0
- package/dist/session-launch.d.ts +10 -22
- package/dist/slot-proposal.d.ts +14 -0
- package/dist/task-source-phase.d.ts +83 -0
- package/dist/task-stages.d.ts +210 -0
- package/dist/turn-evidence.d.ts +43 -13
- package/dist/turn-ipc-mission.d.ts +72 -1
- package/dist/turn-ipc-queue.d.ts +30 -0
- package/dist/turn-ipc.d.ts +2 -2
- package/dist/types.d.ts +1 -0
- package/dist/worker-protocol.d.ts +41 -1
- package/package.json +1 -1
- package/src/assistant-protocol.ts +306 -6
- package/src/daemon-normalize.ts +7 -5
- package/src/decision-push-relay.ts +23 -0
- package/src/index.ts +13 -0
- package/src/launch-defaults.ts +170 -0
- package/src/light-task.ts +116 -0
- package/src/mesh-tool-names.ts +22 -0
- package/src/mesh-vocabulary.ts +12 -2
- package/src/mission-git-state.ts +112 -0
- package/src/mission-items.ts +421 -0
- package/src/node-facts.ts +56 -1
- package/src/outbound-message.ts +19 -0
- package/src/protocol/daemon-server.ts +37 -2
- package/src/protocol/dashboard-server.ts +13 -2
- package/src/provider-approval.ts +59 -0
- package/src/provider-question.ts +31 -0
- package/src/quota-freshness.ts +29 -13
- package/src/relay-reprobe.ts +117 -0
- package/src/release.ts +121 -0
- package/src/role-launch.ts +51 -0
- package/src/session-launch.ts +17 -1
- package/src/slot-proposal.ts +61 -2
- package/src/task-source-phase.ts +70 -0
- package/src/task-stages.ts +459 -0
- package/src/turn-evidence.ts +56 -20
- package/src/turn-ipc-mission.ts +127 -11
- package/src/turn-ipc-queue.ts +45 -2
- package/src/turn-ipc-turn.ts +1 -1
- package/src/turn-ipc.ts +1 -0
- package/src/types.ts +1 -0
- package/src/worker-protocol.ts +94 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { OwnedPathEntry } from './path-ownership';
|
|
2
|
+
export type MeshTaskPhase = 'source' | 'integration';
|
|
3
|
+
/** Host-produced evidence. Never accepted from MCP/peer-supplied paths or branch labels. */
|
|
4
|
+
export interface PhysicalOwnershipScope {
|
|
5
|
+
version: 1;
|
|
6
|
+
repoIdentity: string;
|
|
7
|
+
machineId: string;
|
|
8
|
+
nodeId: string;
|
|
9
|
+
worktree: string;
|
|
10
|
+
worktreeIdentity: string;
|
|
11
|
+
gitDir: string;
|
|
12
|
+
commonGitDir: string;
|
|
13
|
+
phase: MeshTaskPhase;
|
|
14
|
+
gitResources: {
|
|
15
|
+
index: string;
|
|
16
|
+
refs: string;
|
|
17
|
+
hooks: string;
|
|
18
|
+
config: string;
|
|
19
|
+
};
|
|
20
|
+
resources: Array<{
|
|
21
|
+
path: string;
|
|
22
|
+
identity?: string;
|
|
23
|
+
subtree: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
declaration: readonly OwnedPathEntry[];
|
|
26
|
+
}
|
|
27
|
+
/** A source packet is an input to integration, never release/feature acceptance. */
|
|
28
|
+
export interface MeshSourceCandidate {
|
|
29
|
+
version: 1;
|
|
30
|
+
readiness: 'uncommitted' | 'verified_source_candidate';
|
|
31
|
+
taskId: string;
|
|
32
|
+
missionId: string;
|
|
33
|
+
revision: number;
|
|
34
|
+
repoIdentity: string;
|
|
35
|
+
machineId: string;
|
|
36
|
+
canonicalWorktree: string;
|
|
37
|
+
rootBaseSha: string;
|
|
38
|
+
ossBaseSha: string;
|
|
39
|
+
rootCandidateSha?: string;
|
|
40
|
+
ossCandidateSha?: string;
|
|
41
|
+
patchSha256: string;
|
|
42
|
+
manifestSha256: string;
|
|
43
|
+
touchedPaths: string[];
|
|
44
|
+
tests: Array<{
|
|
45
|
+
command: string;
|
|
46
|
+
exit: number;
|
|
47
|
+
logSha256: string;
|
|
48
|
+
}>;
|
|
49
|
+
settledCommands: boolean;
|
|
50
|
+
integrationTaskId: string;
|
|
51
|
+
logicalOverlapTaskIds: string[];
|
|
52
|
+
}
|
|
53
|
+
/** Product B consumes one frozen batch; normal hooks/parity/gates remain required. */
|
|
54
|
+
export interface MeshIntegrationBatchContract {
|
|
55
|
+
version: 1;
|
|
56
|
+
batchId: string;
|
|
57
|
+
candidates: MeshSourceCandidate[];
|
|
58
|
+
integrationOrder: string[];
|
|
59
|
+
approvedRootSha: string;
|
|
60
|
+
approvedOssSha: string;
|
|
61
|
+
bundleInvocationCount: 1;
|
|
62
|
+
requiredGates: string[];
|
|
63
|
+
normalHooksRequired: true;
|
|
64
|
+
independentReviewRequired: true;
|
|
65
|
+
ownerLandingApprovalRequired: true;
|
|
66
|
+
}
|
|
67
|
+
/** These only rank legal targets; targetNodeId/SessionId and requiredTags remain hard. */
|
|
68
|
+
export interface MeshRoutingPreferences {
|
|
69
|
+
nodeIds?: string[];
|
|
70
|
+
providers?: string[];
|
|
71
|
+
}
|
|
72
|
+
export type MeshReviewIndependence = 'different_provider' | 'fresh_session';
|
|
73
|
+
/**
|
|
74
|
+
* Review row constraint. `differentProvider: true` is the legacy spelling of
|
|
75
|
+
* `independence: 'different_provider'`; `independence: 'fresh_session'` is the stage pipeline's
|
|
76
|
+
* fallback (same provider allowed, but never the implementer's session).
|
|
77
|
+
*/
|
|
78
|
+
export interface MeshReviewConstraint {
|
|
79
|
+
sourceTaskId: string;
|
|
80
|
+
differentProvider?: true;
|
|
81
|
+
independence?: MeshReviewIndependence;
|
|
82
|
+
}
|
|
83
|
+
export declare function reviewIndependenceOf(review: Pick<MeshReviewConstraint, 'differentProvider' | 'independence'>): MeshReviewIndependence;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* task-stages — vocabulary, shapes and validators for "review in task".
|
|
3
|
+
*
|
|
4
|
+
* A medium/difficult `code_change` can be enqueued as ONE stage task: the daemon runs
|
|
5
|
+
* implement → self-check → independent review → (bounded) revise inside the task and the
|
|
6
|
+
* coordinator is woken once, by the parent's terminal. Design:
|
|
7
|
+
* docs/design/2026-11-01-review-in-task.md (§3 model, §5 data contract).
|
|
8
|
+
*
|
|
9
|
+
* Dependency-free leaf: every cap and enum the daemon validator, the MCP schemas and the
|
|
10
|
+
* dashboard chips read lives here once.
|
|
11
|
+
*/
|
|
12
|
+
import type { LightTestRun } from './light-task';
|
|
13
|
+
export declare const REVIEW_VERDICTS: readonly ["approve", "approve_with_nits", "changes_requested", "reject_approach"];
|
|
14
|
+
export type MeshReviewVerdict = typeof REVIEW_VERDICTS[number];
|
|
15
|
+
export declare const FINDING_SEVERITIES: readonly ["blocking", "major", "minor", "nit"];
|
|
16
|
+
export type MeshFindingSeverity = typeof FINDING_SEVERITIES[number];
|
|
17
|
+
export declare const FINDING_CATEGORIES: readonly ["correctness", "regression", "test_gap", "scope", "security", "performance", "maintainability"];
|
|
18
|
+
export type MeshFindingCategory = typeof FINDING_CATEGORIES[number];
|
|
19
|
+
export declare const PRIOR_FINDING_STATUSES: readonly ["resolved", "unresolved", "dispute_accepted", "dispute_rejected"];
|
|
20
|
+
export type MeshPriorFindingStatus = typeof PRIOR_FINDING_STATUSES[number];
|
|
21
|
+
export declare const FINDING_RESPONSE_KINDS: readonly ["fixed", "disputed"];
|
|
22
|
+
export type MeshFindingResponseKind = typeof FINDING_RESPONSE_KINDS[number];
|
|
23
|
+
export declare const STAGE_PHASES: readonly ["implementing", "self_checking", "awaiting_review", "reviewing", "revising", "done"];
|
|
24
|
+
export type MeshStagePhase = typeof STAGE_PHASES[number];
|
|
25
|
+
/** Phases in which the parent row holds NO open attempt but is waiting on the daemon (watchdogs must skip it). */
|
|
26
|
+
export declare const STAGE_PARKED_PHASES: readonly MeshStagePhase[];
|
|
27
|
+
export declare const STAGE_INDEPENDENCE_MODES: readonly ["different_provider", "fresh_session_ok"];
|
|
28
|
+
export type MeshStageIndependenceMode = typeof STAGE_INDEPENDENCE_MODES[number];
|
|
29
|
+
/** What actually reviewed (recorded on the verdict and in the final report). */
|
|
30
|
+
export type MeshStageIndependenceUsed = 'different_provider' | 'fresh_session_fallback';
|
|
31
|
+
export declare const STAGE_ROLES: readonly ["implement", "revise", "review"];
|
|
32
|
+
export type MeshStageRole = typeof STAGE_ROLES[number];
|
|
33
|
+
/** Why a stage parent ended `blocked` (R4/R12, doc §3.2). */
|
|
34
|
+
export declare const STAGE_BLOCKED_REASONS: readonly ["review_unresolved", "review_rejected_approach", "review_unavailable", "self_check_failed", "stage_pipeline_ceiling", "reviewer_mutated_source", "reviewer_integrity_unverifiable"];
|
|
35
|
+
export type MeshStageBlockedReason = typeof STAGE_BLOCKED_REASONS[number];
|
|
36
|
+
export declare const STAGE_DECIDE_ACTIONS: readonly ["accept", "revise_once", "rereview", "abandon"];
|
|
37
|
+
export type MeshStageDecideAction = typeof STAGE_DECIDE_ACTIONS[number];
|
|
38
|
+
export declare const STAGE_MAX_REVISIONS_LIMIT = 3;
|
|
39
|
+
export declare const STAGE_DEFAULT_MAX_REVISIONS = 2;
|
|
40
|
+
export declare const STAGE_SELF_CHECK_MAX_BOUNCES = 2;
|
|
41
|
+
/** Minutes a review child may be refused only for `review_independence_required` before fresh_session fallback (R2). */
|
|
42
|
+
export declare const STAGE_INDEPENDENCE_FALLBACK_MS: number;
|
|
43
|
+
/** Parent pipeline ceiling from first dispatch (R12). */
|
|
44
|
+
export declare const STAGE_PIPELINE_CEILING_DEFAULT_MS: number;
|
|
45
|
+
export declare const REVIEW_FINDINGS_MAX = 30;
|
|
46
|
+
export declare const REVIEW_CLAIM_MAX_CHARS = 500;
|
|
47
|
+
export declare const REVIEW_EVIDENCE_MAX_CHARS = 1000;
|
|
48
|
+
export declare const REVIEW_FIX_MAX_CHARS = 500;
|
|
49
|
+
export declare const REVIEW_FINDING_ID_MAX_CHARS = 40;
|
|
50
|
+
export declare const REVIEW_CHECKED_MAX = 20;
|
|
51
|
+
export declare const REVIEW_NOTE_MAX_CHARS = 500;
|
|
52
|
+
export declare const REVIEW_TESTS_RUN_MAX = 20;
|
|
53
|
+
export declare const FINDING_RESPONSES_MAX = 30;
|
|
54
|
+
export interface MeshTaskStagePlan {
|
|
55
|
+
review: true;
|
|
56
|
+
maxRevisions: 0 | 1 | 2 | 3;
|
|
57
|
+
independence: MeshStageIndependenceMode;
|
|
58
|
+
}
|
|
59
|
+
export interface MeshStageHead {
|
|
60
|
+
round: number;
|
|
61
|
+
rootSha: string;
|
|
62
|
+
submodules?: Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
export interface MeshTaskStageState {
|
|
65
|
+
phase: MeshStagePhase;
|
|
66
|
+
/** Review round in progress (0 before the first review child exists). */
|
|
67
|
+
round: number;
|
|
68
|
+
selfCheckBounces: number;
|
|
69
|
+
startedAt: string;
|
|
70
|
+
phaseSince: string;
|
|
71
|
+
baseSha: string;
|
|
72
|
+
stageHeads: MeshStageHead[];
|
|
73
|
+
reviewTaskIds: string[];
|
|
74
|
+
lastVerdict?: MeshReviewVerdict;
|
|
75
|
+
openFindingIds: string[];
|
|
76
|
+
artifacts: {
|
|
77
|
+
diff: string[];
|
|
78
|
+
selfCheck: string[];
|
|
79
|
+
verdict: string[];
|
|
80
|
+
};
|
|
81
|
+
reviewerSessionId?: string;
|
|
82
|
+
independenceUsed?: MeshStageIndependenceUsed;
|
|
83
|
+
/** Attempts the reducer already consumed (idempotency against the two terminal paths). */
|
|
84
|
+
handledAttemptIds?: string[];
|
|
85
|
+
/** Consecutive reviewer-unavailable outcomes (2 → review_unavailable). */
|
|
86
|
+
reviewerFailures?: number;
|
|
87
|
+
/** Coordinator-granted extra revision rounds (`mesh_task_stage_decide revise_once`). */
|
|
88
|
+
extraRevisions?: number;
|
|
89
|
+
/** Why the parent is blocked, once it is. */
|
|
90
|
+
blockedReason?: MeshStageBlockedReason;
|
|
91
|
+
/** The underlying error text when the reason alone does not say it (e.g. why no reviewer could be created). */
|
|
92
|
+
blockedDetail?: string;
|
|
93
|
+
/** Unresolved findings snapshot kept for the final report (id + severity + claim). */
|
|
94
|
+
openFindings?: Array<{
|
|
95
|
+
id: string;
|
|
96
|
+
severity: MeshFindingSeverity;
|
|
97
|
+
claim: string;
|
|
98
|
+
}>;
|
|
99
|
+
/** Nits/minors from the approving verdict, delivered in the final report. */
|
|
100
|
+
openNits?: Array<{
|
|
101
|
+
id: string;
|
|
102
|
+
severity: MeshFindingSeverity;
|
|
103
|
+
claim: string;
|
|
104
|
+
}>;
|
|
105
|
+
/** Self-check outcome summary for the final report. */
|
|
106
|
+
selfCheck?: 'passed' | 'skipped_not_configured' | 'skipped_infra_error' | 'unavailable' | 'failed';
|
|
107
|
+
/** Resolved/disputed counters for the verdict line. */
|
|
108
|
+
findingsFixed?: number;
|
|
109
|
+
/** The original coordinator message, preserved while revise memos replace `message`. */
|
|
110
|
+
originalMessage?: string;
|
|
111
|
+
/** Artifact ids the implementer cited in its own report (feed the next stage's input, top 4). */
|
|
112
|
+
workerArtifactIds?: string[];
|
|
113
|
+
/** Read-lease reviews only: HEAD + working-tree fingerprint of the parent checkout taken when the review child was created (§11). */
|
|
114
|
+
reviewFingerprint?: string;
|
|
115
|
+
/** Read-lease review whose baseline fingerprint could not be taken (after one retry): the verdict is never accepted. */
|
|
116
|
+
reviewFingerprintUnavailable?: boolean;
|
|
117
|
+
/** True once the parent was released to a terminal by the pipeline (hold lifted). */
|
|
118
|
+
released?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface MeshReviewFinding {
|
|
121
|
+
id: string;
|
|
122
|
+
severity: MeshFindingSeverity;
|
|
123
|
+
category: MeshFindingCategory;
|
|
124
|
+
file?: string;
|
|
125
|
+
line?: number;
|
|
126
|
+
claim: string;
|
|
127
|
+
evidence: string;
|
|
128
|
+
suggestedFix?: string;
|
|
129
|
+
}
|
|
130
|
+
export interface MeshPriorFindingStatusEntry {
|
|
131
|
+
id: string;
|
|
132
|
+
status: MeshPriorFindingStatus;
|
|
133
|
+
note?: string;
|
|
134
|
+
}
|
|
135
|
+
/** One definition: the light-task `LightTestRun` (same {command, exit, passed?, failed?, note?} shape). */
|
|
136
|
+
export type MeshTestRun = LightTestRun;
|
|
137
|
+
export interface MeshReviewReport {
|
|
138
|
+
verdict: MeshReviewVerdict;
|
|
139
|
+
findings: MeshReviewFinding[];
|
|
140
|
+
priorFindings?: MeshPriorFindingStatusEntry[];
|
|
141
|
+
checked: string[];
|
|
142
|
+
notChecked: string[];
|
|
143
|
+
testsRun?: MeshTestRun[];
|
|
144
|
+
}
|
|
145
|
+
export interface MeshFindingResponse {
|
|
146
|
+
id: string;
|
|
147
|
+
response: MeshFindingResponseKind;
|
|
148
|
+
note: string;
|
|
149
|
+
}
|
|
150
|
+
export interface StageValidationError {
|
|
151
|
+
field: string;
|
|
152
|
+
message: string;
|
|
153
|
+
}
|
|
154
|
+
export declare const isReviewVerdict: (value: unknown) => value is "approve" | "approve_with_nits" | "changes_requested" | "reject_approach";
|
|
155
|
+
export declare const isFindingSeverity: (value: unknown) => value is "major" | "minor" | "blocking" | "nit";
|
|
156
|
+
export declare const isFindingCategory: (value: unknown) => value is "scope" | "correctness" | "regression" | "test_gap" | "security" | "performance" | "maintainability";
|
|
157
|
+
export declare const isPriorFindingStatus: (value: unknown) => value is "resolved" | "unresolved" | "dispute_accepted" | "dispute_rejected";
|
|
158
|
+
export declare const isFindingResponseKind: (value: unknown) => value is "fixed" | "disputed";
|
|
159
|
+
export declare const isStageBlockedReason: (value: unknown) => value is "review_unresolved" | "review_rejected_approach" | "review_unavailable" | "self_check_failed" | "stage_pipeline_ceiling" | "reviewer_mutated_source" | "reviewer_integrity_unverifiable";
|
|
160
|
+
/** Blocking/major findings keep a review from passing. */
|
|
161
|
+
export declare function isBlockingSeverity(severity: MeshFindingSeverity): boolean;
|
|
162
|
+
export interface StagePlanDefaultsInput {
|
|
163
|
+
taskMode?: string;
|
|
164
|
+
difficulty?: string;
|
|
165
|
+
readonly?: boolean;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Resolve the enqueue-time `review` option into a stage plan, or null when review is off.
|
|
169
|
+
* `review` undefined → OFF (owner decision 2026-11-08: in-task review is opt-in; the default cost speed and parallelism
|
|
170
|
+
* without catching the live bugs). Pass `review: true` (or an options object) for a change that genuinely needs one.
|
|
171
|
+
* `defaultOn: true` restores the old R5 default (medium/difficult non-readonly `code_change` → on) for a caller that asks for it.
|
|
172
|
+
* Throws `invalid_review_option: …` on malformed input (rejected, never coerced).
|
|
173
|
+
*/
|
|
174
|
+
export declare function resolveStagePlan(raw: unknown, task: StagePlanDefaultsInput, opts?: {
|
|
175
|
+
defaultOn?: boolean;
|
|
176
|
+
}): MeshTaskStagePlan | null;
|
|
177
|
+
export declare function defaultStagePlan(): MeshTaskStagePlan;
|
|
178
|
+
/** R5: only non-readonly code_change tasks run the pipeline by default (medium/difficult). */
|
|
179
|
+
export declare function isStageEligibleTask(task: StagePlanDefaultsInput): boolean;
|
|
180
|
+
export interface ReviewValidationContext {
|
|
181
|
+
/** 1-based review round of the child this report is for. */
|
|
182
|
+
round: number;
|
|
183
|
+
/** Blocking/major finding ids still open from the previous round (round ≥ 2 must answer each). */
|
|
184
|
+
priorOpenBlockingIds?: readonly string[];
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Validate the `review` field of a reviewer's `report_completion`. Rejects, never coerces;
|
|
188
|
+
* unknown keys are rejected (a misspelled `notChecked` must not silently vanish).
|
|
189
|
+
*/
|
|
190
|
+
export declare function validateReviewReport(raw: unknown, ctx: ReviewValidationContext): {
|
|
191
|
+
report?: MeshReviewReport;
|
|
192
|
+
errors: StageValidationError[];
|
|
193
|
+
};
|
|
194
|
+
/** Shared by the reviewer's `review.testsRun` and the top-level `testsRun` of any report. */
|
|
195
|
+
export declare function validateTestsRun(raw: unknown, field: string, errors: StageValidationError[]): MeshTestRun[];
|
|
196
|
+
/** Validate an implementer's `findingResponses` (§5.3). */
|
|
197
|
+
export declare function validateFindingResponses(raw: unknown, field?: string): {
|
|
198
|
+
responses?: MeshFindingResponse[];
|
|
199
|
+
errors: StageValidationError[];
|
|
200
|
+
};
|
|
201
|
+
export interface StageVerdictLineInput {
|
|
202
|
+
verdict: MeshReviewVerdict | 'skipped_no_diff';
|
|
203
|
+
rounds: number;
|
|
204
|
+
reviewerProvider?: string;
|
|
205
|
+
independenceUsed?: MeshStageIndependenceUsed;
|
|
206
|
+
fixed?: number;
|
|
207
|
+
openNits?: number;
|
|
208
|
+
}
|
|
209
|
+
/** One human-readable line: `review: approve_with_nits · 2 rounds · reviewer codex-cli (different_provider) · 3 findings fixed, 1 nit open`. */
|
|
210
|
+
export declare function formatStageVerdictLine(input: StageVerdictLineInput): string;
|
package/dist/turn-evidence.d.ts
CHANGED
|
@@ -40,7 +40,11 @@ export declare const DELIVERY_OUTCOMES: readonly ["delivered", "queued"];
|
|
|
40
40
|
export type DeliveryOutcome = typeof DELIVERY_OUTCOMES[number];
|
|
41
41
|
export declare const DELIVERY_VIAS: readonly ["local", "p2p"];
|
|
42
42
|
export type DeliveryVia = typeof DELIVERY_VIAS[number];
|
|
43
|
-
|
|
43
|
+
/** `submit_unconfirmed` (SUBMIT-UNCONFIRMED-RECLAIM): the worker's CLI never
|
|
44
|
+
* took the written prompt — the submit budget and one re-paste were spent at
|
|
45
|
+
* an idle composer. An owner daemon older than this value drops the evidence
|
|
46
|
+
* as invalid and falls back to its consume/turn holds (the pre-fix path). */
|
|
47
|
+
export declare const DISPATCH_FAILURE_REASONS: readonly ["worker_absent", "transport_error", "spawn_failed", "rejected_by_worker", "timeout", "submit_unconfirmed"];
|
|
44
48
|
export type DispatchFailureReason = typeof DISPATCH_FAILURE_REASONS[number];
|
|
45
49
|
/**
|
|
46
50
|
* Normalize a worker's own refusal code (e.g. `session_busy_with_task`,
|
|
@@ -52,26 +56,40 @@ export type DispatchFailureReason = typeof DISPATCH_FAILURE_REASONS[number];
|
|
|
52
56
|
* (see the field's doc comment — this evidence replicates cross-machine).
|
|
53
57
|
*/
|
|
54
58
|
export declare function sanitizeRefusalCode(value: unknown): string | undefined;
|
|
59
|
+
/** Longest refusal message kept on a failed dispatch (see {@link sanitizeDispatchRefusalDetail}). */
|
|
60
|
+
export declare const DISPATCH_REFUSAL_DETAIL_MAX = 200;
|
|
61
|
+
/**
|
|
62
|
+
* Bounded, sanitized "why was this dispatch refused" detail for triage:
|
|
63
|
+
* `{code, message}` with the code in the refusal-code identifier shape and the
|
|
64
|
+
* message a single printable line of at most {@link DISPATCH_REFUSAL_DETAIL_MAX}
|
|
65
|
+
* chars (home-directory prefixes collapsed to `~`). Refusal texts are generated
|
|
66
|
+
* by the daemon / transport, never by a user or an agent. LOCAL records only:
|
|
67
|
+
* it is deliberately NOT part of the replicated turn evidence (content-free).
|
|
68
|
+
*/
|
|
69
|
+
export declare function sanitizeDispatchRefusalDetail(code: unknown, message: unknown): {
|
|
70
|
+
code?: string;
|
|
71
|
+
message?: string;
|
|
72
|
+
} | undefined;
|
|
55
73
|
export declare const CONSUME_PROFILES: readonly ["default", "native_source"];
|
|
56
74
|
export type ConsumeProfile = typeof CONSUME_PROFILES[number];
|
|
57
75
|
export declare const SESSION_REBOUND_REASONS: readonly ["restart", "live_holder"];
|
|
58
76
|
export type SessionReboundReason = typeof SESSION_REBOUND_REASONS[number];
|
|
59
77
|
export declare const SUSPENSION_MODALS: readonly ["approval", "choice"];
|
|
60
78
|
export type SuspensionModal = typeof SUSPENSION_MODALS[number];
|
|
61
|
-
export declare const SUSPENSION_RESOLUTIONS: readonly ["approved", "rejected", "answered"];
|
|
79
|
+
export declare const SUSPENSION_RESOLUTIONS: readonly ["approved", "rejected", "answered", "dismissed"];
|
|
62
80
|
export type SuspensionResolution = typeof SUSPENSION_RESOLUTIONS[number];
|
|
63
|
-
export declare const SUSPENSION_RESOLUTION_VIAS: readonly ["modal_button", "auto_approve", "prompt_answer"];
|
|
81
|
+
export declare const SUSPENSION_RESOLUTION_VIAS: readonly ["modal_button", "auto_approve", "prompt_answer", "modal_disappeared"];
|
|
64
82
|
export type SuspensionResolutionVia = typeof SUSPENSION_RESOLUTION_VIAS[number];
|
|
65
83
|
export declare const TURN_END_STRENGTHS: readonly ["genuine", "weak"];
|
|
66
84
|
export type TurnEndStrength = typeof TURN_END_STRENGTHS[number];
|
|
67
85
|
/** Why a provider-side weak end was released (was free text `blockReason`). */
|
|
68
86
|
export declare const TURN_END_BLOCK_REASONS: readonly ["missing_final_assistant", "finalization_timeout", "terminal_block_hard_cap", "decoupled_completion"];
|
|
69
87
|
export type TurnEndBlockReason = typeof TURN_END_BLOCK_REASONS[number];
|
|
70
|
-
export declare const NATIVE_TURN_OUTCOMES: readonly ["completed", "aborted"];
|
|
88
|
+
export declare const NATIVE_TURN_OUTCOMES: readonly ["completed", "aborted", "failed"];
|
|
71
89
|
export type NativeTurnOutcome = typeof NATIVE_TURN_OUTCOMES[number];
|
|
72
90
|
export declare const LIVENESS_RESULTS: readonly ["alive", "unknown", "read_failed", "dead"];
|
|
73
91
|
export type LivenessResult = typeof LIVENESS_RESULTS[number];
|
|
74
|
-
export declare const PROVIDER_FAILURES: readonly ["auth_failed", "billing_failed"];
|
|
92
|
+
export declare const PROVIDER_FAILURES: readonly ["auth_failed", "billing_failed", "usage_limit_exceeded", "server_overloaded", "provider_error"];
|
|
75
93
|
export type ProviderFailure = typeof PROVIDER_FAILURES[number];
|
|
76
94
|
/**
|
|
77
95
|
* `daemon_restart` (wiring-unification follow-up, design §5): boot-time
|
|
@@ -99,14 +117,14 @@ export type NoProgressObservedStatus = SessionStatus | 'unknown';
|
|
|
99
117
|
* Reasons a turn hold exists. Holds are attempt-scoped only (C2: delivery-side
|
|
100
118
|
* waits are consumer deferral on the `turn.deliver` cursor, not hold rows).
|
|
101
119
|
*/
|
|
102
|
-
export declare const HOLD_REASONS: readonly ["await_delivery", "await_consume", "await_turn", "liveness", "hard_ceiling", "live_pending", "transcript_quiet", "weak_candidate", "suspension_before_consumed", "await_report", "await_end"];
|
|
120
|
+
export declare const HOLD_REASONS: readonly ["await_delivery", "await_consume", "await_turn", "liveness", "hard_ceiling", "live_pending", "transcript_quiet", "weak_candidate", "suspension_before_consumed", "await_report", "await_end", "report_correction"];
|
|
103
121
|
export type HoldReason = typeof HOLD_REASONS[number];
|
|
104
|
-
export declare const TURN_OUTCOMES: readonly ["completed", "failed", "cancelled"];
|
|
122
|
+
export declare const TURN_OUTCOMES: readonly ["completed", "blocked", "failed", "cancelled"];
|
|
105
123
|
export type TurnOutcome = typeof TURN_OUTCOMES[number];
|
|
106
124
|
export declare const COMMIT_STRENGTHS: readonly ["genuine", "weak", "tool_report", "operator"];
|
|
107
125
|
export type CommitStrength = typeof COMMIT_STRENGTHS[number];
|
|
108
126
|
/** Every terminal or reclaim reason the ledger writes. Closed: no free-text reasons. */
|
|
109
|
-
export declare const TURN_REASONS: readonly ["turn_end", "weak_end_confirmed", "transcript_final", "worker_reported", "finalization_timeout_no_response", "session_error", "provider_auth_failed", "provider_billing_failed", "operator_cancel", "intentional_cleanup", "task_removed", "mission_abandoned", "superseded", "operator_update", "refine_terminal", "validation_terminal", "hard_ceiling", "reclaim_budget_exhausted", "hollow_max_retries", "migration_orphan", "dispatch_refused_session_exited", "dispatch_refused_no_target", "dispatch_refused_unsupported_input", "dispatch_failed", "session_exit", "session_exit_before_turn", "session_dead", "hollow_completion", "assigned_stranded_dispatch_unconfirmed", "delivered_not_consumed_redrive", "delivered_no_turn_deadline"];
|
|
127
|
+
export declare const TURN_REASONS: readonly ["turn_end", "weak_end_confirmed", "transcript_final", "worker_reported", "finalization_timeout_no_response", "weak_end_liveness_unconfirmed", "weak_end_probe_unobserved", "report_correction_expired", "session_error", "provider_auth_failed", "provider_billing_failed", "provider_usage_limit_exceeded", "provider_server_overloaded", "provider_error", "operator_cancel", "intentional_cleanup", "task_removed", "mission_abandoned", "superseded", "operator_update", "refine_terminal", "validation_terminal", "hard_ceiling", "reclaim_budget_exhausted", "hollow_max_retries", "migration_orphan", "writer_unreachable", "dispatch_refused_session_exited", "dispatch_refused_no_target", "dispatch_refused_unsupported_input", "dispatch_failed", "session_exit", "session_exit_before_turn", "session_dead", "hollow_completion", "assigned_stranded_dispatch_unconfirmed", "delivered_not_consumed_redrive", "delivered_no_turn_deadline"];
|
|
110
128
|
export type TurnReason = typeof TURN_REASONS[number];
|
|
111
129
|
/**
|
|
112
130
|
* What a `turn.notify` entry tells a coordinator.
|
|
@@ -118,7 +136,7 @@ export type TurnReason = typeof TURN_REASONS[number];
|
|
|
118
136
|
* (refine terminal, worktree bootstrap, …) whose text lives only in the
|
|
119
137
|
* owner's local `turn_events.payload_json` and is rendered at deliver time.
|
|
120
138
|
*/
|
|
121
|
-
export declare const NOTIFY_KINDS: readonly ["completed", "failed", "cancelled", "stopped", "approval", "choice", "approval_resolved", "candidate", "no_progress", "progress", "late_completion", "mesh_event"];
|
|
139
|
+
export declare const NOTIFY_KINDS: readonly ["completed", "blocked", "failed", "cancelled", "stopped", "approval", "choice", "approval_resolved", "candidate", "no_progress", "progress", "late_completion", "mesh_event"];
|
|
122
140
|
export type NotifyKind = typeof NOTIFY_KINDS[number];
|
|
123
141
|
export interface TurnAttemptRef {
|
|
124
142
|
attemptId: string;
|
|
@@ -149,6 +167,9 @@ export interface EvidenceCoordinatorIdentity {
|
|
|
149
167
|
export interface NativeTurnMarkerRef {
|
|
150
168
|
outcome: NativeTurnOutcome;
|
|
151
169
|
turnId?: string;
|
|
170
|
+
receivedAt?: number;
|
|
171
|
+
startedAt?: number;
|
|
172
|
+
errorAt?: number;
|
|
152
173
|
}
|
|
153
174
|
export interface EvidenceEnvelope {
|
|
154
175
|
/** Stable id of this observation; dedupe key across republish/replication. */
|
|
@@ -220,10 +241,13 @@ export type TurnEvidenceBody = {
|
|
|
220
241
|
kind: 'suspension';
|
|
221
242
|
modal: SuspensionModal;
|
|
222
243
|
modalKey?: string;
|
|
244
|
+
providerSetup?: boolean;
|
|
245
|
+
clockUnknown?: boolean;
|
|
223
246
|
} | {
|
|
224
247
|
kind: 'suspension_resolved';
|
|
225
248
|
resolution: SuspensionResolution;
|
|
226
249
|
via: SuspensionResolutionVia;
|
|
250
|
+
modalKey?: string;
|
|
227
251
|
} | {
|
|
228
252
|
kind: 'turn_end';
|
|
229
253
|
strength: TurnEndStrength;
|
|
@@ -233,6 +257,7 @@ export type TurnEvidenceBody = {
|
|
|
233
257
|
blockReason?: TurnEndBlockReason;
|
|
234
258
|
releasedByHardCap?: boolean;
|
|
235
259
|
nativeOutcome?: NativeTurnOutcome;
|
|
260
|
+
nativeMarker?: NativeTurnMarkerRef;
|
|
236
261
|
live?: LiveTurnPending;
|
|
237
262
|
/**
|
|
238
263
|
* Stamped (true only) by the WORKER's daemon when the session holds a live
|
|
@@ -268,6 +293,7 @@ export type TurnEvidenceBody = {
|
|
|
268
293
|
} | {
|
|
269
294
|
kind: 'liveness';
|
|
270
295
|
result: LivenessResult;
|
|
296
|
+
probeStartedAtMs?: number;
|
|
271
297
|
} | {
|
|
272
298
|
kind: 'process_exit';
|
|
273
299
|
exitCode: number | null;
|
|
@@ -288,6 +314,9 @@ export type TurnEvidenceBody = {
|
|
|
288
314
|
hasHandoffNotes: boolean;
|
|
289
315
|
branchState?: WorkerBranchState;
|
|
290
316
|
touchedFileCount?: number;
|
|
317
|
+
} | {
|
|
318
|
+
kind: 'worker_report_correction_requested';
|
|
319
|
+
deliveryId?: string;
|
|
291
320
|
} | {
|
|
292
321
|
kind: 'worker_progress';
|
|
293
322
|
note?: SummaryRef;
|
|
@@ -371,14 +400,15 @@ export declare const TURN_EVIDENCE_FIELD_SPECS: TurnEvidenceFieldSpecs;
|
|
|
371
400
|
export declare const TURN_EVIDENCE_KINDS: readonly TurnEvidenceKind[];
|
|
372
401
|
/** Evidence kinds that, on their own, can end a turn (the ones R18/R19/R27 reason about). */
|
|
373
402
|
export declare const TERMINAL_CLASS_EVIDENCE_KINDS: readonly ["turn_end", "transcript_final", "no_progress", "worker_report", "session_error", "process_exit", "cancel", "operator_status"];
|
|
374
|
-
export declare const isTurnEvidenceKind: (value: unknown) => value is "no_progress" | "delivered" | "liveness" | "turn_end" | "transcript_final" | "session_error" | "dispatch_failed" | "dispatch_accepted" | "delivery_refused" | "duplicate_dispatch_refusal" | "session_rebound" | "turn_started" | "suspension" | "suspension_resolved" | "transcript_activity" | "process_exit" | "worker_report" | "worker_progress" | "git_side_effect" | "cancel" | "operator_status" | "coordinator_ack" | "hold_expired";
|
|
375
|
-
export declare const isTurnReason: (value: unknown) => value is "intentional_cleanup" | "operator_cancel" | "task_removed" | "mission_abandoned" | "superseded" | "operator_update" | "refine_terminal" | "validation_terminal" | "hard_ceiling" | "turn_end" | "weak_end_confirmed" | "transcript_final" | "worker_reported" | "finalization_timeout_no_response" | "session_error" | "provider_auth_failed" | "provider_billing_failed" | "reclaim_budget_exhausted" | "hollow_max_retries" | "migration_orphan" | "dispatch_refused_session_exited" | "dispatch_refused_no_target" | "dispatch_refused_unsupported_input" | "dispatch_failed" | "session_exit" | "session_exit_before_turn" | "session_dead" | "hollow_completion" | "assigned_stranded_dispatch_unconfirmed" | "delivered_not_consumed_redrive" | "delivered_no_turn_deadline";
|
|
376
|
-
export declare const isNotifyKind: (value: unknown) => value is "stopped" | "failed" | "no_progress" | "completed" | "cancelled" | "approval" | "choice" | "approval_resolved" | "candidate" | "progress" | "late_completion" | "mesh_event";
|
|
377
|
-
export declare const isTurnOutcome: (value: unknown) => value is "failed" | "completed" | "cancelled";
|
|
403
|
+
export declare const isTurnEvidenceKind: (value: unknown) => value is "no_progress" | "delivered" | "liveness" | "turn_end" | "transcript_final" | "session_error" | "dispatch_failed" | "dispatch_accepted" | "delivery_refused" | "duplicate_dispatch_refusal" | "session_rebound" | "turn_started" | "suspension" | "suspension_resolved" | "transcript_activity" | "process_exit" | "worker_report" | "worker_report_correction_requested" | "worker_progress" | "git_side_effect" | "cancel" | "operator_status" | "coordinator_ack" | "hold_expired";
|
|
404
|
+
export declare const isTurnReason: (value: unknown) => value is "provider_error" | "intentional_cleanup" | "operator_cancel" | "task_removed" | "mission_abandoned" | "superseded" | "operator_update" | "refine_terminal" | "validation_terminal" | "hard_ceiling" | "turn_end" | "weak_end_confirmed" | "transcript_final" | "worker_reported" | "finalization_timeout_no_response" | "weak_end_liveness_unconfirmed" | "weak_end_probe_unobserved" | "report_correction_expired" | "session_error" | "provider_auth_failed" | "provider_billing_failed" | "provider_usage_limit_exceeded" | "provider_server_overloaded" | "reclaim_budget_exhausted" | "hollow_max_retries" | "migration_orphan" | "writer_unreachable" | "dispatch_refused_session_exited" | "dispatch_refused_no_target" | "dispatch_refused_unsupported_input" | "dispatch_failed" | "session_exit" | "session_exit_before_turn" | "session_dead" | "hollow_completion" | "assigned_stranded_dispatch_unconfirmed" | "delivered_not_consumed_redrive" | "delivered_no_turn_deadline";
|
|
405
|
+
export declare const isNotifyKind: (value: unknown) => value is "stopped" | "failed" | "blocked" | "no_progress" | "completed" | "cancelled" | "approval" | "choice" | "approval_resolved" | "candidate" | "progress" | "late_completion" | "mesh_event";
|
|
406
|
+
export declare const isTurnOutcome: (value: unknown) => value is "failed" | "blocked" | "completed" | "cancelled";
|
|
378
407
|
export declare const isCommitStrength: (value: unknown) => value is "operator" | "genuine" | "weak" | "tool_report";
|
|
379
408
|
export declare function isEvidenceIdentifier(value: unknown): value is string;
|
|
380
409
|
export declare function isSummaryRef(value: unknown): value is SummaryRef;
|
|
381
410
|
export declare function isTurnAttemptRef(value: unknown): value is TurnAttemptRef;
|
|
411
|
+
export declare function isNativeMarkerRef(value: unknown): value is NativeTurnMarkerRef;
|
|
382
412
|
/**
|
|
383
413
|
* Strict structural guard: known kind, every declared field of the right class,
|
|
384
414
|
* and NO undeclared field (an unknown key is how free text would sneak in).
|
|
@@ -30,8 +30,43 @@ export interface MissionUpsertRequest {
|
|
|
30
30
|
* this wire guard only checks SHAPE, not that decision.
|
|
31
31
|
*/
|
|
32
32
|
brief?: MissionBriefWire | null;
|
|
33
|
+
/**
|
|
34
|
+
* Structured-missions bundle A (design 2026-10-28 §5.1). Every key below is optional
|
|
35
|
+
* and ABSENT on a legacy call. `structured: true` is the caller's capability flag: the
|
|
36
|
+
* daemon only puts the new keys on the response (mission summary/outcome/version,
|
|
37
|
+
* `result`) when it is set, so an older mcp-server that never sends it keeps decoding
|
|
38
|
+
* byte-identical responses (mixed-version fleets, design §13.1).
|
|
39
|
+
*/
|
|
40
|
+
structured?: boolean;
|
|
41
|
+
summary?: string;
|
|
42
|
+
/** One user/operator-visible sentence for the release CHANGELOG draft (design 2026-11-01-release-objects L5). `''` clears. */
|
|
43
|
+
releaseNote?: string;
|
|
44
|
+
outcome?: string;
|
|
45
|
+
outcomeReason?: string;
|
|
46
|
+
/** Mission id open items move to when this call closes the mission (default: the carry-over mission). */
|
|
47
|
+
carryOverTo?: string;
|
|
48
|
+
/** Route to the mesh's auto-created carry-over mission instead of `id`/`title` (decision requests without a mission). `title` may then be empty. */
|
|
49
|
+
toCarryOver?: boolean;
|
|
50
|
+
itemsAdd?: readonly Record<string, unknown>[];
|
|
51
|
+
itemsUpdate?: readonly Record<string, unknown>[];
|
|
52
|
+
}
|
|
53
|
+
export interface MeshMissionOpenItemCountsWire {
|
|
54
|
+
remaining: number;
|
|
55
|
+
live_check: number;
|
|
56
|
+
decision: number;
|
|
57
|
+
evidence: number;
|
|
58
|
+
}
|
|
59
|
+
/** Structured-missions fields (only with `structured: true` on the request). */
|
|
60
|
+
export interface MeshMissionStructuredWire {
|
|
61
|
+
summary?: string;
|
|
62
|
+
releaseNote?: string;
|
|
63
|
+
outcome?: string;
|
|
64
|
+
outcomeReason?: string;
|
|
65
|
+
version?: number;
|
|
66
|
+
carryOver?: boolean;
|
|
67
|
+
openItems?: MeshMissionOpenItemCountsWire;
|
|
33
68
|
}
|
|
34
|
-
export interface MeshMissionRecordWire {
|
|
69
|
+
export interface MeshMissionRecordWire extends MeshMissionStructuredWire {
|
|
35
70
|
id: string;
|
|
36
71
|
meshId: string;
|
|
37
72
|
title: string;
|
|
@@ -42,6 +77,8 @@ export interface MeshMissionRecordWire {
|
|
|
42
77
|
}
|
|
43
78
|
export interface MissionUpsertResponse {
|
|
44
79
|
mission: MeshMissionRecordWire;
|
|
80
|
+
/** Structured calls only: per-item results, movedItems/movedTo, restoredItems, ownerConfirmationItemId, warnings. */
|
|
81
|
+
result?: Record<string, unknown>;
|
|
45
82
|
}
|
|
46
83
|
export declare function decodeMissionUpsertRequest(value: unknown): MissionUpsertRequest | null;
|
|
47
84
|
export declare function isMissionUpsertResponse(value: unknown): value is MissionUpsertResponse;
|
|
@@ -77,6 +114,12 @@ export interface MissionListQueryRequest {
|
|
|
77
114
|
* option except `historyIdLimit` is ignored. An older daemon rejects the key.
|
|
78
115
|
*/
|
|
79
116
|
meshStatusView?: 'compact' | 'verbose';
|
|
117
|
+
/** Structured-missions capability flag (see MissionUpsertRequest.structured): rows then carry summary/outcome/openItems/carryOver/version. */
|
|
118
|
+
structured?: boolean;
|
|
119
|
+
/** Structured only: attach each mission's items. */
|
|
120
|
+
items?: boolean;
|
|
121
|
+
/** Structured only: attach each mission's change history (bounded tail). */
|
|
122
|
+
history?: boolean;
|
|
80
123
|
}
|
|
81
124
|
export interface MeshMissionTaskAggregateWire {
|
|
82
125
|
total: number;
|
|
@@ -89,6 +132,8 @@ export interface MeshMissionTaskAggregateWire {
|
|
|
89
132
|
lastActivityAt: string | null;
|
|
90
133
|
}
|
|
91
134
|
export interface MeshMissionStatsWire {
|
|
135
|
+
/** Present on peers that project proven blocked outcomes separately. */
|
|
136
|
+
blocked?: number;
|
|
92
137
|
missionId: string;
|
|
93
138
|
taskCount: number;
|
|
94
139
|
completed: number;
|
|
@@ -113,6 +158,16 @@ export interface MissionListSummaryVerboseWire {
|
|
|
113
158
|
createdAt?: string;
|
|
114
159
|
updatedAt?: string;
|
|
115
160
|
closeCandidateEmittedAt?: string | null;
|
|
161
|
+
/** Structured lists only. */
|
|
162
|
+
summary?: string;
|
|
163
|
+
releaseNote?: string;
|
|
164
|
+
outcome?: string;
|
|
165
|
+
outcomeReason?: string;
|
|
166
|
+
version?: number;
|
|
167
|
+
carryOver?: boolean;
|
|
168
|
+
openItems?: MeshMissionOpenItemCountsWire;
|
|
169
|
+
items?: readonly Record<string, unknown>[];
|
|
170
|
+
history?: readonly Record<string, unknown>[];
|
|
116
171
|
}
|
|
117
172
|
/** Compact (default) mission row. `goalPreview`/`goalTruncated` present, `goal` absent. */
|
|
118
173
|
export interface MissionListSummarySlimWire {
|
|
@@ -130,6 +185,16 @@ export interface MissionListSummarySlimWire {
|
|
|
130
185
|
createdAt?: string;
|
|
131
186
|
updatedAt?: string;
|
|
132
187
|
closeCandidateEmittedAt?: string | null;
|
|
188
|
+
/** Structured lists only. */
|
|
189
|
+
summary?: string;
|
|
190
|
+
releaseNote?: string;
|
|
191
|
+
outcome?: string;
|
|
192
|
+
outcomeReason?: string;
|
|
193
|
+
version?: number;
|
|
194
|
+
carryOver?: boolean;
|
|
195
|
+
openItems?: MeshMissionOpenItemCountsWire;
|
|
196
|
+
items?: readonly Record<string, unknown>[];
|
|
197
|
+
history?: readonly Record<string, unknown>[];
|
|
133
198
|
}
|
|
134
199
|
export type MissionListSummaryWire = MissionListSummaryVerboseWire | MissionListSummarySlimWire;
|
|
135
200
|
export interface MeshMissionHistoryFoldWire {
|
|
@@ -231,6 +296,12 @@ export interface LedgerQueryEntryWire {
|
|
|
231
296
|
payload: Record<string, unknown>;
|
|
232
297
|
}
|
|
233
298
|
export interface LedgerQuerySummaryWire {
|
|
299
|
+
/** Absent on older peers; never folded into failed by the decoder. */
|
|
300
|
+
taskBlocked?: number;
|
|
301
|
+
/** Failed Refinery jobs (not tasks). Absent on older peers. Lifetime, not the current window. */
|
|
302
|
+
refineFailed?: number;
|
|
303
|
+
/** Refine failures inside the 30-minute current window. Absent on older peers. */
|
|
304
|
+
recentRefineFailures?: number;
|
|
234
305
|
meshId: string;
|
|
235
306
|
totalEntries: number;
|
|
236
307
|
taskDispatched: number;
|
package/dist/turn-ipc-queue.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export interface QueueQueryResponse {
|
|
|
65
65
|
counts?: Record<string, number>;
|
|
66
66
|
/** `withCounts` + `historicalOlderThanMs`: terminal rows older than that age. */
|
|
67
67
|
oldHistoricalCount?: number;
|
|
68
|
+
/** Included in counts.blocked, derived from proven worker reports; stored failed rows stay unchanged. */
|
|
69
|
+
legacyReportedBlockedCount?: number;
|
|
68
70
|
/** `withDependencyHeads`. */
|
|
69
71
|
dependencyHeads?: readonly QueueDependencyHeadWire[];
|
|
70
72
|
}
|
|
@@ -123,6 +125,12 @@ export interface QueueRequeueRequest {
|
|
|
123
125
|
}
|
|
124
126
|
export interface QueueRequeueResponse {
|
|
125
127
|
task: QueueEntryWire | null;
|
|
128
|
+
/** queue_revise {requestQuotaOverride}: the owner decision that was raised (or already open). Never a grant. */
|
|
129
|
+
quotaOverrideRequested?: {
|
|
130
|
+
decisionId: string;
|
|
131
|
+
alreadyAsked: boolean;
|
|
132
|
+
options: string[];
|
|
133
|
+
};
|
|
126
134
|
}
|
|
127
135
|
export declare function decodeQueueRequeueRequest(value: unknown): QueueRequeueRequest | null;
|
|
128
136
|
export declare function decodeQueueRequeueResponse(value: unknown): QueueRequeueResponse | null;
|
|
@@ -194,3 +202,25 @@ export interface RecoveryContextQueryResponse {
|
|
|
194
202
|
}
|
|
195
203
|
export declare function decodeRecoveryContextQueryRequest(value: unknown): RecoveryContextQueryRequest | null;
|
|
196
204
|
export declare function decodeRecoveryContextQueryResponse(value: unknown): RecoveryContextQueryResponse | null;
|
|
205
|
+
export interface QueueReviseRequest {
|
|
206
|
+
v: typeof TURN_IPC_PROTOCOL_VERSION;
|
|
207
|
+
meshId: string;
|
|
208
|
+
taskId: string;
|
|
209
|
+
expectedRevision: number;
|
|
210
|
+
dryRun?: boolean;
|
|
211
|
+
deferScheduling?: boolean;
|
|
212
|
+
patch: {
|
|
213
|
+
message?: string;
|
|
214
|
+
ownedPaths?: string[];
|
|
215
|
+
phase?: 'source' | 'integration';
|
|
216
|
+
dependsOn?: string[];
|
|
217
|
+
routingPreferences?: import('./task-source-phase').MeshRoutingPreferences;
|
|
218
|
+
review?: import('./task-source-phase').MeshReviewConstraint;
|
|
219
|
+
difficulty?: 'easy' | 'medium' | 'difficult' | 'freeform';
|
|
220
|
+
requestQuotaOverride?: true;
|
|
221
|
+
attestActiveOwnership?: true;
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
export type QueueReviseResponse = QueueRequeueResponse;
|
|
225
|
+
export declare function decodeQueueReviseRequest(value: unknown): QueueReviseRequest | null;
|
|
226
|
+
export declare const decodeQueueReviseResponse: typeof decodeQueueRequeueResponse;
|
package/dist/turn-ipc.d.ts
CHANGED
|
@@ -94,6 +94,6 @@ export interface TurnIpcError {
|
|
|
94
94
|
}
|
|
95
95
|
export declare function isTurnIpcError(value: unknown): value is TurnIpcError;
|
|
96
96
|
/** The complete, closed set of IPC command names this contract defines. */
|
|
97
|
-
export declare const TURN_IPC_COMMANDS: readonly ["turn_observe", "mesh_record", "turn_cancel", "operator_status", "turn_query", "mesh_index_query", "mission_upsert", "mission_query", "note_upsert", "note_forget", "tool_call_record", "ledger_query", "mission_list_query", "record_local", "queue_query", "queue_enqueue", "queue_enqueue_batch", "queue_cancel", "queue_requeue", "direct_dispatch_record", "active_work_query", "recovery_context_query", "task_stats_query", "prune_stale_direct", "orphaned_pin_notify"];
|
|
97
|
+
export declare const TURN_IPC_COMMANDS: readonly ["turn_observe", "mesh_record", "turn_cancel", "operator_status", "turn_query", "mesh_index_query", "mission_upsert", "mission_query", "note_upsert", "note_forget", "tool_call_record", "ledger_query", "mission_list_query", "record_local", "queue_query", "queue_enqueue", "queue_enqueue_batch", "queue_cancel", "queue_requeue", "queue_revise", "direct_dispatch_record", "active_work_query", "recovery_context_query", "task_stats_query", "prune_stale_direct", "orphaned_pin_notify"];
|
|
98
98
|
export type TurnIpcCommand = typeof TURN_IPC_COMMANDS[number];
|
|
99
|
-
export declare const isTurnIpcCommand: (value: unknown) => value is "prune_stale_direct" | "operator_status" | "turn_observe" | "mesh_record" | "turn_cancel" | "turn_query" | "mesh_index_query" | "mission_upsert" | "mission_query" | "note_upsert" | "note_forget" | "tool_call_record" | "ledger_query" | "mission_list_query" | "record_local" | "queue_query" | "queue_enqueue" | "queue_enqueue_batch" | "queue_cancel" | "queue_requeue" | "direct_dispatch_record" | "active_work_query" | "recovery_context_query" | "task_stats_query" | "orphaned_pin_notify";
|
|
99
|
+
export declare const isTurnIpcCommand: (value: unknown) => value is "prune_stale_direct" | "operator_status" | "turn_observe" | "mesh_record" | "turn_cancel" | "turn_query" | "mesh_index_query" | "mission_upsert" | "mission_query" | "note_upsert" | "note_forget" | "tool_call_record" | "ledger_query" | "mission_list_query" | "record_local" | "queue_query" | "queue_enqueue" | "queue_enqueue_batch" | "queue_cancel" | "queue_requeue" | "queue_revise" | "direct_dispatch_record" | "active_work_query" | "recovery_context_query" | "task_stats_query" | "orphaned_pin_notify";
|
package/dist/types.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface MeshNodeIdentified {
|
|
|
120
120
|
[key: string]: unknown;
|
|
121
121
|
}
|
|
122
122
|
export interface RepoMeshSessionStatus {
|
|
123
|
+
providerApproval?: import('./provider-approval').ProviderApproval | null;
|
|
123
124
|
sessionId: string;
|
|
124
125
|
providerType?: string;
|
|
125
126
|
state?: string;
|