@gajae-code/coding-agent 0.11.11 → 0.12.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/CHANGELOG.md +49 -3
- package/dist/types/cli/read-cli.d.ts +1 -0
- package/dist/types/commands/deep-interview.d.ts +9 -0
- package/dist/types/commands/harness.d.ts +22 -0
- package/dist/types/commands/read.d.ts +6 -0
- package/dist/types/config/model-registry.d.ts +4 -0
- package/dist/types/config/provider-auth-health.d.ts +14 -0
- package/dist/types/config/provider-ranking.d.ts +59 -0
- package/dist/types/config/settings-schema.d.ts +29 -1
- package/dist/types/config/settings.d.ts +2 -0
- package/dist/types/extensibility/extensions/types.d.ts +22 -2
- package/dist/types/extensibility/shared-events.d.ts +6 -0
- package/dist/types/gjc-runtime/deep-interview-ambiguity.d.ts +5 -12
- package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +17 -32
- package/dist/types/gjc-runtime/deep-interview-stage.d.ts +37 -0
- package/dist/types/gjc-runtime/deep-interview-state.d.ts +4 -135
- package/dist/types/gjc-runtime/gc-runtime.d.ts +1 -1
- package/dist/types/gjc-runtime/memory-guard-owner-claims.d.ts +47 -0
- package/dist/types/gjc-runtime/ralplan-runtime.d.ts +52 -1
- package/dist/types/gjc-runtime/state-writer.d.ts +5 -46
- package/dist/types/gjc-runtime/team-launch.d.ts +1 -1
- package/dist/types/gjc-runtime/team-runtime.d.ts +2 -1
- package/dist/types/gjc-runtime/team-store.d.ts +12 -0
- package/dist/types/gjc-runtime/team-worker-memory-guard.d.ts +92 -0
- package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +7 -0
- package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +8 -0
- package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -5
- package/dist/types/internal-urls/local-root-gc.d.ts +2 -0
- package/dist/types/main.d.ts +1 -1
- package/dist/types/memories/index.d.ts +2 -0
- package/dist/types/modes/acp/acp-agent.d.ts +8 -0
- package/dist/types/modes/components/assistant-message.d.ts +3 -1
- package/dist/types/modes/components/irc-sidebar.d.ts +41 -0
- package/dist/types/modes/components/read-tool-group.d.ts +4 -4
- package/dist/types/modes/components/session-observer-overlay.d.ts +4 -0
- package/dist/types/modes/components/settings-selector.d.ts +2 -0
- package/dist/types/modes/components/tool-execution.d.ts +8 -0
- package/dist/types/modes/controllers/event-controller.d.ts +3 -0
- package/dist/types/modes/interactive-mode.d.ts +2 -0
- package/dist/types/modes/irc-observation-ledger.d.ts +17 -1
- package/dist/types/modes/types.d.ts +2 -0
- package/dist/types/modes/utils/ui-helpers.d.ts +16 -0
- package/dist/types/runtime-mcp/smithery-auth.d.ts +5 -0
- package/dist/types/sdk/broker/lifecycle.d.ts +5 -0
- package/dist/types/sdk/bus/control-drain-lease.d.ts +52 -0
- package/dist/types/sdk/bus/index.d.ts +15 -1
- package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +37 -0
- package/dist/types/sdk/bus/prompt-reconciliation.d.ts +2 -1
- package/dist/types/sdk/bus/reconciliation-store.d.ts +65 -0
- package/dist/types/sdk/host/control/operations.d.ts +1 -1
- package/dist/types/sdk/host/host.d.ts +2 -0
- package/dist/types/sdk/host/query/handlers.d.ts +5 -0
- package/dist/types/session/agent-session.d.ts +44 -10
- package/dist/types/session/memory-guard-checkpoint-participant.d.ts +69 -0
- package/dist/types/session/session-manager.d.ts +25 -13
- package/dist/types/session/streaming-output.d.ts +60 -5
- package/dist/types/skill-state/active-state.d.ts +0 -4
- package/dist/types/skill-state/workflow-hud.d.ts +3 -0
- package/dist/types/tools/browser/launch.d.ts +7 -0
- package/dist/types/tools/fetch.d.ts +17 -1
- package/dist/types/tools/output-meta.d.ts +21 -1
- package/dist/types/tools/read-internals.d.ts +12 -0
- package/dist/types/tools/read.d.ts +45 -1
- package/dist/types/tools/resource-gc.d.ts +4 -0
- package/dist/types/tools/tool-result.d.ts +7 -1
- package/package.json +9 -13
- package/scripts/benchmark-sticky-viewport-pr1.ts +239 -0
- package/scripts/capture-sticky-viewport-showcase.ts +292 -0
- package/scripts/generate-sdk-operation-inventory.ts +2 -0
- package/scripts/verify-gjc-sdk-canonicalization.ts +122 -18
- package/scripts/verify-sticky-viewport-showcase.ts +611 -0
- package/src/capability/index.ts +8 -0
- package/src/cli/read-cli.ts +2 -1
- package/src/cli.ts +1 -0
- package/src/commands/deep-interview.ts +29 -9
- package/src/commands/harness.ts +35 -12
- package/src/commands/read.ts +11 -2
- package/src/commands/team.ts +1 -1
- package/src/config/model-registry.ts +21 -2
- package/src/config/provider-auth-health.ts +42 -0
- package/src/config/provider-ranking.ts +119 -0
- package/src/config/settings-schema.ts +23 -1
- package/src/config/settings.ts +246 -108
- package/src/defaults/gjc/skills/deep-interview/SKILL.md +229 -82
- package/src/defaults/gjc/skills/ralplan/SKILL.md +58 -25
- package/src/defaults/gjc/skills/team/SKILL.md +1 -1
- package/src/defaults/gjc/skills/ultragoal/SKILL.md +25 -15
- package/src/eval/py/executor.ts +7 -2
- package/src/extensibility/extensions/types.ts +28 -4
- package/src/extensibility/shared-events.ts +5 -0
- package/src/gjc-runtime/deep-interview-ambiguity.ts +47 -82
- package/src/gjc-runtime/deep-interview-recorder.ts +227 -310
- package/src/gjc-runtime/deep-interview-runtime.ts +109 -270
- package/src/gjc-runtime/deep-interview-stage.ts +1016 -0
- package/src/gjc-runtime/deep-interview-state.ts +12 -943
- package/src/gjc-runtime/gc-render.ts +1 -0
- package/src/gjc-runtime/gc-runtime.ts +11 -1
- package/src/gjc-runtime/memory-guard-owner-claims.ts +389 -0
- package/src/gjc-runtime/ralplan-runtime.ts +742 -85
- package/src/gjc-runtime/state-runtime.ts +2 -1
- package/src/gjc-runtime/state-writer.ts +70 -222
- package/src/gjc-runtime/team-launch.ts +34 -5
- package/src/gjc-runtime/team-runtime.ts +970 -33
- package/src/gjc-runtime/team-store.ts +32 -0
- package/src/gjc-runtime/team-worker-memory-guard.ts +363 -0
- package/src/gjc-runtime/team-workers.ts +1 -0
- package/src/gjc-runtime/tmux-owner-isolation.ts +18 -0
- package/src/gjc-runtime/ultragoal-receipt-freshness.ts +20 -0
- package/src/gjc-runtime/ultragoal-runtime.ts +13 -7
- package/src/gjc-runtime/workflow-manifest.generated.json +97 -350
- package/src/gjc-runtime/workflow-manifest.ts +34 -179
- package/src/hooks/native-skill-hook.ts +17 -4
- package/src/hooks/skill-state.ts +1 -23
- package/src/internal-urls/docs-index.generated.ts +8 -9
- package/src/internal-urls/local-root-gc.ts +127 -0
- package/src/main.ts +9 -5
- package/src/memories/index.ts +10 -0
- package/src/modes/DESIGN.md +47 -0
- package/src/modes/acp/acp-agent.ts +43 -7
- package/src/modes/acp/acp-event-mapper.ts +14 -7
- package/src/modes/acp/acp-mode.ts +39 -3
- package/src/modes/components/assistant-message.ts +123 -22
- package/src/modes/components/irc-sidebar.ts +176 -62
- package/src/modes/components/model-selector.ts +61 -4
- package/src/modes/components/oauth-selector.ts +42 -12
- package/src/modes/components/read-tool-group.ts +82 -14
- package/src/modes/components/session-observer-overlay.ts +187 -32
- package/src/modes/components/settings-selector.ts +60 -18
- package/src/modes/components/tool-execution.ts +138 -27
- package/src/modes/controllers/event-controller.ts +109 -27
- package/src/modes/controllers/extension-ui-controller.ts +19 -2
- package/src/modes/controllers/input-controller.ts +18 -3
- package/src/modes/controllers/selector-controller.ts +83 -37
- package/src/modes/interactive-mode.ts +62 -3
- package/src/modes/irc-observation-ledger.ts +71 -15
- package/src/modes/runtime-init.ts +19 -2
- package/src/modes/types.ts +2 -0
- package/src/modes/utils/ui-helpers.ts +94 -1
- package/src/prompts/agents/architect.md +9 -1
- package/src/prompts/agents/critic.md +9 -0
- package/src/prompts/system/system-prompt.md +0 -1
- package/src/prompts/tools/read.md +4 -2
- package/src/runtime-mcp/smithery-auth.ts +17 -2
- package/src/runtime-mcp/smithery-connect.ts +11 -1
- package/src/sdk/broker/lifecycle.ts +25 -6
- package/src/sdk/bus/control-drain-lease.ts +104 -0
- package/src/sdk/bus/index.ts +341 -38
- package/src/sdk/bus/kind-aware-reconciliation.ts +242 -0
- package/src/sdk/bus/prompt-reconciliation.ts +2 -1
- package/src/sdk/bus/reconciliation-store.ts +224 -0
- package/src/sdk/host/control/dispatch.ts +5 -1
- package/src/sdk/host/control/operations.ts +1 -1
- package/src/sdk/host/host.ts +23 -1
- package/src/sdk/host/query/handlers.ts +55 -0
- package/src/sdk/mcp/server.ts +46 -18
- package/src/sdk/protocol/operation-inventory.generated.json +29 -0
- package/src/sdk/protocol/operation-registry.ts +7 -2
- package/src/sdk/session.ts +13 -1
- package/src/session/agent-session.ts +466 -50
- package/src/session/memory-guard-checkpoint-participant.ts +131 -0
- package/src/session/session-manager.ts +764 -17
- package/src/session/streaming-output.ts +262 -43
- package/src/setup/provider-onboarding.ts +19 -4
- package/src/skill-state/active-state.ts +0 -10
- package/src/skill-state/workflow-hud.ts +25 -2
- package/src/skill-state/workflow-mutation-guard.ts +65 -7
- package/src/tools/ask.ts +89 -69
- package/src/tools/browser/launch.ts +41 -6
- package/src/tools/fetch.ts +114 -23
- package/src/tools/output-meta.ts +176 -9
- package/src/tools/path-utils.ts +5 -1
- package/src/tools/read-internals.ts +44 -0
- package/src/tools/read.ts +1542 -310
- package/src/tools/resource-gc.ts +182 -18
- package/src/tools/tool-result.ts +14 -1
- package/src/web/search/providers/codex.ts +1 -1
- package/dist/types/gjc-runtime/deep-interview-draft.d.ts +0 -8
- package/dist/types/gjc-runtime/deep-interview-payload.d.ts +0 -41
- package/dist/types/gjc-runtime/deep-interview-repair.d.ts +0 -17
- package/src/gjc-runtime/deep-interview-draft.ts +0 -843
- package/src/gjc-runtime/deep-interview-payload.ts +0 -262
- package/src/gjc-runtime/deep-interview-repair.ts +0 -1674
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { computeAmbiguityFloor, type DeepInterviewAmbiguityMilestone } from "./deep-interview-ambiguity";
|
|
2
1
|
/**
|
|
3
2
|
* Pure, dependency-free foundation for deep-interview state shape.
|
|
4
3
|
*
|
|
@@ -36,6 +35,10 @@ export interface DeepInterviewTriggerMetadata {
|
|
|
36
35
|
status: DeepInterviewTriggerStatus;
|
|
37
36
|
component: string;
|
|
38
37
|
dimension: string;
|
|
38
|
+
priorDimensionScore?: number;
|
|
39
|
+
newDimensionScore?: number;
|
|
40
|
+
priorAmbiguity?: number;
|
|
41
|
+
newAmbiguity?: number;
|
|
39
42
|
evidence?: string;
|
|
40
43
|
contradictedFactId?: string;
|
|
41
44
|
/** Required when status is `disputed` or `unresolved` to exempt the invariant. */
|
|
@@ -65,11 +68,9 @@ export interface DeepInterviewRoundRecord {
|
|
|
65
68
|
/** Deterministic floor in effect when this round was scored, when it clamped. */
|
|
66
69
|
ambiguity_floor?: number;
|
|
67
70
|
triggers?: DeepInterviewTriggerMetadata[];
|
|
68
|
-
round_result_digest?: string;
|
|
69
71
|
}
|
|
70
72
|
export interface DeepInterviewStateEnvelope {
|
|
71
73
|
threshold?: number;
|
|
72
|
-
threshold_units?: number;
|
|
73
74
|
threshold_source?: string;
|
|
74
75
|
state?: Record<string, unknown>;
|
|
75
76
|
[key: string]: unknown;
|
|
@@ -196,135 +197,3 @@ export declare function assertDeepInterviewIntentReview(value: unknown, locked:
|
|
|
196
197
|
round: unknown;
|
|
197
198
|
answer_hash: unknown;
|
|
198
199
|
}[]): asserts value is DeepInterviewIntentReview;
|
|
199
|
-
export type DeepInterviewDimension = "goal" | "constraints" | "criteria" | "context";
|
|
200
|
-
export type DeepInterviewResolution = "auto_research_accepted" | "auto_answer" | "direct" | "refined" | "cited_confirmation";
|
|
201
|
-
export interface DeepInterviewFactOperation {
|
|
202
|
-
op: "add" | "dispute" | "supersede";
|
|
203
|
-
id: string;
|
|
204
|
-
statement?: string;
|
|
205
|
-
component?: string;
|
|
206
|
-
dimension?: DeepInterviewDimension;
|
|
207
|
-
evidence?: string;
|
|
208
|
-
target_id?: string;
|
|
209
|
-
}
|
|
210
|
-
export interface DeepInterviewOntologyEntity {
|
|
211
|
-
id: string;
|
|
212
|
-
name: string;
|
|
213
|
-
type: string;
|
|
214
|
-
fields: string[];
|
|
215
|
-
}
|
|
216
|
-
export interface DeepInterviewOntologyRelationship {
|
|
217
|
-
id: string;
|
|
218
|
-
from_entity_id: string;
|
|
219
|
-
to_entity_id: string;
|
|
220
|
-
type: string;
|
|
221
|
-
}
|
|
222
|
-
export interface DeepInterviewOntologyReasoning {
|
|
223
|
-
statement: string;
|
|
224
|
-
evidence?: string;
|
|
225
|
-
}
|
|
226
|
-
export interface DeepInterviewOntologyInput {
|
|
227
|
-
entities: DeepInterviewOntologyEntity[];
|
|
228
|
-
relationships: DeepInterviewOntologyRelationship[];
|
|
229
|
-
reasoning: DeepInterviewOntologyReasoning[];
|
|
230
|
-
}
|
|
231
|
-
export interface DeepInterviewComponentUpdate {
|
|
232
|
-
component_id: string;
|
|
233
|
-
scores: Record<DeepInterviewDimension, number>;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Optional legacy assertions accepted only when they agree with the native
|
|
237
|
-
* target. The persisted target is always derived from component scores.
|
|
238
|
-
*/
|
|
239
|
-
export interface DeepInterviewTargetingInput {
|
|
240
|
-
target_component_id?: string;
|
|
241
|
-
target_dimension?: DeepInterviewDimension;
|
|
242
|
-
weakest_component_id?: string;
|
|
243
|
-
weakest_dimension?: DeepInterviewDimension;
|
|
244
|
-
last_targeted_component_id?: string | null;
|
|
245
|
-
}
|
|
246
|
-
export interface DeepInterviewRoundBookkeeping {
|
|
247
|
-
resolution: DeepInterviewResolution;
|
|
248
|
-
round_ids?: string[];
|
|
249
|
-
counter_deltas?: Record<string, number>;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Closed evidence submitted for one scoring transaction. All convergence values
|
|
253
|
-
* (ambiguity, floor, milestone, ontology counts, rotation, and streak) are
|
|
254
|
-
* native-derived and intentionally cannot be supplied here.
|
|
255
|
-
*/
|
|
256
|
-
export interface DeepInterviewRoundResultV1 {
|
|
257
|
-
global_scores: Record<DeepInterviewDimension, number>;
|
|
258
|
-
component_updates?: DeepInterviewComponentUpdate[];
|
|
259
|
-
targeting?: DeepInterviewTargetingInput;
|
|
260
|
-
triggers?: DeepInterviewTriggerMetadata[];
|
|
261
|
-
fact_ops?: DeepInterviewFactOperation[];
|
|
262
|
-
ontology?: DeepInterviewOntologyInput | DeepInterviewOntologyEntity[];
|
|
263
|
-
bookkeeping?: DeepInterviewRoundBookkeeping;
|
|
264
|
-
/** Compatibility adapter for recorder callers; never persisted as the v1 wire shape. */
|
|
265
|
-
component_scores?: Record<string, Record<DeepInterviewDimension, number>>;
|
|
266
|
-
auto_answered?: boolean;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Version 1 native projection returned by `apply-round-result` as
|
|
270
|
-
* `native_projection`. This is the complete renderable convergence surface;
|
|
271
|
-
* callers must not derive or supplement it from candidate scorer input.
|
|
272
|
-
*/
|
|
273
|
-
export interface DeepInterviewRoundResultProjection {
|
|
274
|
-
score_units: Partial<Record<DeepInterviewDimension, number>>;
|
|
275
|
-
weighted_ambiguity: number;
|
|
276
|
-
weighted_ambiguity_units: number;
|
|
277
|
-
floor: number;
|
|
278
|
-
floor_units: number;
|
|
279
|
-
floor_cause: ReturnType<typeof computeAmbiguityFloor>;
|
|
280
|
-
effective_ambiguity: number;
|
|
281
|
-
effective_ambiguity_units: number;
|
|
282
|
-
prior_effective_ambiguity: number | null;
|
|
283
|
-
direction: "increased" | "decreased" | "unchanged" | "initial";
|
|
284
|
-
ambiguity_milestone: DeepInterviewAmbiguityMilestone;
|
|
285
|
-
topology: unknown;
|
|
286
|
-
topology_counts: {
|
|
287
|
-
active: number;
|
|
288
|
-
deferred: number;
|
|
289
|
-
total: number;
|
|
290
|
-
};
|
|
291
|
-
ontology: unknown;
|
|
292
|
-
ontology_counts: {
|
|
293
|
-
stable: number;
|
|
294
|
-
changed: number;
|
|
295
|
-
new: number;
|
|
296
|
-
basis: string;
|
|
297
|
-
};
|
|
298
|
-
targeting: {
|
|
299
|
-
target_component_id: string | null;
|
|
300
|
-
target_dimension: DeepInterviewDimension | null;
|
|
301
|
-
last_targeted_component_id: string | null;
|
|
302
|
-
};
|
|
303
|
-
transition: {
|
|
304
|
-
round_key: string;
|
|
305
|
-
lifecycle: "scored";
|
|
306
|
-
auto_answer_streak: number;
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
export type DeepInterviewApplyRoundResult = {
|
|
310
|
-
kind: "noop";
|
|
311
|
-
envelope: DeepInterviewStateEnvelope;
|
|
312
|
-
projection?: DeepInterviewRoundResultProjection;
|
|
313
|
-
} | {
|
|
314
|
-
kind: "write";
|
|
315
|
-
envelope: DeepInterviewStateEnvelope;
|
|
316
|
-
projection: DeepInterviewRoundResultProjection;
|
|
317
|
-
};
|
|
318
|
-
/** Strict UTF-8 JSON serialization used by v1 replay digests. */
|
|
319
|
-
export declare function canonicalDeepInterviewJson(value: unknown): string;
|
|
320
|
-
export declare function deepInterviewRoundResultDigest(input: {
|
|
321
|
-
round: number;
|
|
322
|
-
question_id: string;
|
|
323
|
-
round_id?: string | null;
|
|
324
|
-
result: unknown;
|
|
325
|
-
}): string;
|
|
326
|
-
/** Complete persisted answer identity; omitted optional values normalize to null. */
|
|
327
|
-
export declare function deepInterviewAnswerIdentityEqual(a: Pick<DeepInterviewRoundRecord, "round" | "round_key" | "round_id" | "question_id" | "component" | "dimension" | "question_text" | "question_hash" | "selected_options" | "custom_input">, b: Pick<DeepInterviewRoundRecord, "round" | "round_key" | "round_id" | "question_id" | "component" | "dimension" | "question_text" | "question_hash" | "selected_options" | "custom_input">): boolean;
|
|
328
|
-
/** Apply one closed v1 scoring round. The input contains evidence only; all convergence state is derived here. */
|
|
329
|
-
export declare function applyDeepInterviewRoundResultV1(envelopeValue: unknown, roundKey: string, result: DeepInterviewRoundResultV1, now: string): DeepInterviewApplyRoundResult;
|
|
330
|
-
export declare function validateDeepInterviewV1Envelope(value: Record<string, unknown>): void;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* error all mean KEEP — a live process is never signalled or killed.
|
|
13
13
|
* - Dry-run by default: nothing is deleted unless `--prune`/`--force`.
|
|
14
14
|
*/
|
|
15
|
-
export type GcStore = "harness_leases" | "team_workers" | "file_locks" | "tmux_sessions" | "registry_entries";
|
|
15
|
+
export type GcStore = "harness_leases" | "team_workers" | "file_locks" | "tmux_sessions" | "registry_entries" | "local_roots";
|
|
16
16
|
export declare const GC_STORES: readonly GcStore[];
|
|
17
17
|
/** Why a probed pid is kept instead of treated as dead. */
|
|
18
18
|
export type GcPidKeepReason = "alive" | "eperm" | "unknown";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type LinuxProcPidProbeResult } from "./linux-proc";
|
|
2
|
+
declare const MEMORY_GUARD_CLAIM_RESOURCES: readonly ["writer", "tty"];
|
|
3
|
+
type MemoryGuardClaimResource = (typeof MEMORY_GUARD_CLAIM_RESOURCES)[number];
|
|
4
|
+
export interface MemoryGuardClaimOwner {
|
|
5
|
+
sessionId: string;
|
|
6
|
+
generation: string;
|
|
7
|
+
runId: string;
|
|
8
|
+
childToken: string;
|
|
9
|
+
pid: number;
|
|
10
|
+
processStartTime: string;
|
|
11
|
+
ttyDevice: string;
|
|
12
|
+
}
|
|
13
|
+
export interface MemoryGuardClaimsLease {
|
|
14
|
+
writerEpoch: number;
|
|
15
|
+
ttyEpoch: number;
|
|
16
|
+
owner: MemoryGuardClaimOwner;
|
|
17
|
+
claimStorePath: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function isMemoryGuardClaimsLease(value: unknown): value is MemoryGuardClaimsLease;
|
|
20
|
+
export declare function isMemoryGuardClaimsLeaseForStateDir(value: unknown, stateDir: string): value is MemoryGuardClaimsLease;
|
|
21
|
+
export type MemoryGuardClaimsReleasedProof = MemoryGuardClaimsLease;
|
|
22
|
+
interface PersistedMemoryGuardClaimRow {
|
|
23
|
+
resource: MemoryGuardClaimResource;
|
|
24
|
+
epoch: number;
|
|
25
|
+
session_id: string;
|
|
26
|
+
generation: string;
|
|
27
|
+
run_id: string;
|
|
28
|
+
child_token: string;
|
|
29
|
+
pid: number;
|
|
30
|
+
process_start_time: string;
|
|
31
|
+
tty_device: string;
|
|
32
|
+
acquired_at: string;
|
|
33
|
+
}
|
|
34
|
+
export interface MemoryGuardOwnerClaimsDeps {
|
|
35
|
+
probePid(pid: number): Promise<LinuxProcPidProbeResult>;
|
|
36
|
+
now(): string;
|
|
37
|
+
}
|
|
38
|
+
export declare function memoryGuardClaimsDatabaseFile(stateDir: string, sessionId: string): string;
|
|
39
|
+
export declare function acquireMemoryGuardClaims(stateDir: string, owner: MemoryGuardClaimOwner, deps?: MemoryGuardOwnerClaimsDeps): Promise<MemoryGuardClaimsLease>;
|
|
40
|
+
export declare function releaseMemoryGuardClaims(stateDir: string, claim: MemoryGuardClaimsLease): Promise<void>;
|
|
41
|
+
export declare function probeMemoryGuardClaimsReleased(stateDir: string, owner: MemoryGuardClaimOwner, deps?: MemoryGuardOwnerClaimsDeps): Promise<MemoryGuardClaimsReleasedProof>;
|
|
42
|
+
export interface PersistedMemoryGuardClaimsSnapshot {
|
|
43
|
+
epoch: number;
|
|
44
|
+
claims: PersistedMemoryGuardClaimRow[];
|
|
45
|
+
}
|
|
46
|
+
export declare function readMemoryGuardClaimsForTest(stateDir: string, sessionId: string): Promise<PersistedMemoryGuardClaimsSnapshot>;
|
|
47
|
+
export {};
|
|
@@ -13,7 +13,7 @@ import { type RalplanIndexRow } from "./ledger-event-renderer";
|
|
|
13
13
|
*
|
|
14
14
|
* 2. **Artifact write**: `gjc ralplan --write --stage <type> --stage_n <N>
|
|
15
15
|
* (--artifact <path-or-string> | --artifact-env GJC_RALPLAN_ARTIFACT)
|
|
16
|
-
* [--run-id <id>] [--session-id <id>] [--json]` persists Planner / Architect
|
|
16
|
+
* [--run-id <id>] [--session-id <id>] [--lane-verdict <token>] [--json]` persists Planner / Architect
|
|
17
17
|
* / Critic / revision / post-interview / ADR / final markdown under `.gjc/plans/ralplan/<run-id>/`, maintains
|
|
18
18
|
* an `index.jsonl` audit log, copies `final` stages to `pending-approval.md`, and advances
|
|
19
19
|
* the HUD chip to reflect the latest persisted stage.
|
|
@@ -29,6 +29,10 @@ export declare const RALPLAN_DEFAULT_MAX_ITERATIONS = 5;
|
|
|
29
29
|
export declare const RALPLAN_MAX_ITERATIONS_LIMIT = 20;
|
|
30
30
|
/** Operator-visible stuck signal for headless/CI orchestration (#3165). */
|
|
31
31
|
export declare const PLANNING_STUCK_MARKER = "PLANNING-STUCK";
|
|
32
|
+
/** Default architect/critic review passes per consensus iteration. */
|
|
33
|
+
export declare const RALPLAN_DEFAULT_MAX_REVIEW_PASSES_PER_LANE = 1;
|
|
34
|
+
/** Inclusive upper bound for `gjc.ralplan.maxReviewPassesPerLane` settings overrides. */
|
|
35
|
+
export declare const RALPLAN_MAX_REVIEW_PASSES_PER_LANE_LIMIT = 10;
|
|
32
36
|
export type RalplanIterationCapDecision = {
|
|
33
37
|
allowed: true;
|
|
34
38
|
currentIterations: number;
|
|
@@ -58,11 +62,52 @@ export declare function evaluateRalplanIterationCap(input: {
|
|
|
58
62
|
/** Minimum opener count (e.g. on-disk stage-*-{planner,revision}.md). */
|
|
59
63
|
iterationFloor?: number;
|
|
60
64
|
}): RalplanIterationCapDecision;
|
|
65
|
+
export type RalplanReviewLane = "architect" | "critic";
|
|
66
|
+
export type RalplanReviewLaneBudgetDecision = {
|
|
67
|
+
allowed: true;
|
|
68
|
+
lane?: RalplanReviewLane;
|
|
69
|
+
currentPasses: number;
|
|
70
|
+
projectedPasses: number;
|
|
71
|
+
maxReviewPassesPerLane: number;
|
|
72
|
+
finalSlot: boolean;
|
|
73
|
+
ledgerNote?: string;
|
|
74
|
+
} | {
|
|
75
|
+
allowed: false;
|
|
76
|
+
lane: RalplanReviewLane;
|
|
77
|
+
currentPasses: number;
|
|
78
|
+
projectedPasses: number;
|
|
79
|
+
maxReviewPassesPerLane: number;
|
|
80
|
+
finalSlot: false;
|
|
81
|
+
ledgerNote?: string;
|
|
82
|
+
reason: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Pure per-lane review-pass budget gate. Architect and critic passes are limited
|
|
86
|
+
* within the current consensus iteration; all other stages remain unconditionally
|
|
87
|
+
* available as escalation paths.
|
|
88
|
+
*/
|
|
89
|
+
export declare function evaluateRalplanReviewLaneBudget(input: {
|
|
90
|
+
rows: readonly RalplanIndexRow[];
|
|
91
|
+
stage: string;
|
|
92
|
+
maxReviewPassesPerLane?: unknown;
|
|
93
|
+
onDiskLaneCounts?: {
|
|
94
|
+
architect: number;
|
|
95
|
+
critic: number;
|
|
96
|
+
};
|
|
97
|
+
}): RalplanReviewLaneBudgetDecision;
|
|
61
98
|
/**
|
|
62
99
|
* Count on-disk planner/revision stage artifacts for a run. Used as a floor when
|
|
63
100
|
* `index.jsonl` is missing, empty, truncated, or otherwise under-counts openers.
|
|
64
101
|
*/
|
|
65
102
|
export declare function countRalplanOnDiskOpeners(cwd: string, sessionId: string, runId: string): Promise<number>;
|
|
103
|
+
/**
|
|
104
|
+
* Count on-disk Architect/Critic stage artifacts for a run. This is the
|
|
105
|
+
* fail-closed floor for a missing, truncated, or malformed `index.jsonl`.
|
|
106
|
+
*/
|
|
107
|
+
export declare function countRalplanOnDiskLaneArtifacts(cwd: string, sessionId: string, runId: string): Promise<{
|
|
108
|
+
architect: number;
|
|
109
|
+
critic: number;
|
|
110
|
+
}>;
|
|
66
111
|
/**
|
|
67
112
|
* Load index rows for cap enforcement. Unlike HUD reads, returns structural
|
|
68
113
|
* signals so callers can fail closed when the ledger is empty/malformed while
|
|
@@ -73,6 +118,7 @@ export declare function loadRalplanIndexForCap(cwd: string, sessionId: string, r
|
|
|
73
118
|
indexPresent: boolean;
|
|
74
119
|
parseableLines: number;
|
|
75
120
|
rawLineCount: number;
|
|
121
|
+
rawText?: string;
|
|
76
122
|
}>;
|
|
77
123
|
/**
|
|
78
124
|
* Resolve ralplan consensus iteration cap. Project `./.gjc/settings.json` overrides
|
|
@@ -82,5 +128,10 @@ export declare function resolveRalplanMaxIterations(cwd: string): Promise<{
|
|
|
82
128
|
maxIterations: number;
|
|
83
129
|
source: string;
|
|
84
130
|
}>;
|
|
131
|
+
/** Resolve the per-lane review-pass budget with project-over-user precedence. */
|
|
132
|
+
export declare function resolveRalplanMaxReviewPassesPerLane(cwd: string): Promise<{
|
|
133
|
+
maxReviewPassesPerLane: number;
|
|
134
|
+
source: string;
|
|
135
|
+
}>;
|
|
85
136
|
export declare function isRalplanArtifactWriteInvocation(args: readonly string[]): boolean;
|
|
86
137
|
export declare function runNativeRalplanCommand(args: string[], cwd?: string): Promise<RalplanCommandResult>;
|
|
@@ -46,47 +46,6 @@ export interface WorkflowEnvelopeIntegrityMismatch {
|
|
|
46
46
|
expected: string;
|
|
47
47
|
actual: string;
|
|
48
48
|
}
|
|
49
|
-
export type WorkflowReceiptVerification = "legacy" | "native-valid" | "receipt-malformed" | "receipt-missing" | "checksum-mismatch";
|
|
50
|
-
export interface GuardedWorkflowEnvelopeTransformOptions extends StateWriterOptions {
|
|
51
|
-
expectedRevision: number;
|
|
52
|
-
/** Additional native schema validation applied to both current and candidate envelopes. */
|
|
53
|
-
validate?: (value: Record<string, unknown>, legacy: boolean) => void;
|
|
54
|
-
transform: (current: Record<string, unknown>, context: {
|
|
55
|
-
revision: number;
|
|
56
|
-
legacy: boolean;
|
|
57
|
-
}) => {
|
|
58
|
-
kind: "noop";
|
|
59
|
-
} | {
|
|
60
|
-
kind: "write";
|
|
61
|
-
value: Record<string, unknown>;
|
|
62
|
-
} | Promise<{
|
|
63
|
-
kind: "noop";
|
|
64
|
-
} | {
|
|
65
|
-
kind: "write";
|
|
66
|
-
value: Record<string, unknown>;
|
|
67
|
-
}>;
|
|
68
|
-
}
|
|
69
|
-
export interface GuardedWorkflowEnvelopeWarning {
|
|
70
|
-
code: "DI_POST_COMMIT_AUDIT_FAILED";
|
|
71
|
-
message: string;
|
|
72
|
-
}
|
|
73
|
-
export type GuardedWorkflowEnvelopeTransformResult = {
|
|
74
|
-
path: string;
|
|
75
|
-
written: false;
|
|
76
|
-
reason: "noop";
|
|
77
|
-
revision: number;
|
|
78
|
-
warnings: [];
|
|
79
|
-
} | {
|
|
80
|
-
path: string;
|
|
81
|
-
written: true;
|
|
82
|
-
revision: number;
|
|
83
|
-
stamped: Record<string, unknown>;
|
|
84
|
-
warnings: GuardedWorkflowEnvelopeWarning[];
|
|
85
|
-
};
|
|
86
|
-
export declare class GuardedWorkflowEnvelopeError extends Error {
|
|
87
|
-
readonly code: string;
|
|
88
|
-
constructor(code: string);
|
|
89
|
-
}
|
|
90
49
|
export interface WorkflowTransactionJournal {
|
|
91
50
|
version: 1;
|
|
92
51
|
mutation_id: string;
|
|
@@ -103,7 +62,6 @@ export interface GuardedStateWriterOptions extends StateWriterOptions {
|
|
|
103
62
|
policy: StateWritePolicy;
|
|
104
63
|
expectedRevision?: number;
|
|
105
64
|
sourceRevision?: number;
|
|
106
|
-
lockHeld?: boolean;
|
|
107
65
|
}
|
|
108
66
|
export type GuardedWriteResult = {
|
|
109
67
|
path: string;
|
|
@@ -121,13 +79,17 @@ export interface StateWriterOptions {
|
|
|
121
79
|
receipt?: StateWriterReceiptContext;
|
|
122
80
|
audit?: StateWriterAuditContext;
|
|
123
81
|
sourceRevision?: number;
|
|
124
|
-
orderingRevision?: number;
|
|
125
82
|
/**
|
|
126
83
|
* Cross-process lock tuning for read-modify-write paths that route through
|
|
127
84
|
* `withWorkflowStateLock` / `updateJsonAtomic`. Omit for the hardened
|
|
128
85
|
* `withFileLock` defaults.
|
|
129
86
|
*/
|
|
130
87
|
lock?: FileLockOptions;
|
|
88
|
+
/**
|
|
89
|
+
* Caller already holds the workflow state lock for this target path (via
|
|
90
|
+
* `withWorkflowStateLock`). Skip re-acquisition to avoid self-deadlock.
|
|
91
|
+
*/
|
|
92
|
+
lockHeld?: boolean;
|
|
131
93
|
}
|
|
132
94
|
export declare class StateWriteConflictError extends Error {
|
|
133
95
|
readonly path: string;
|
|
@@ -183,8 +145,6 @@ export type StrictMutationReadResult = {
|
|
|
183
145
|
};
|
|
184
146
|
export declare function readExistingStateForMutation(filePath: string): Promise<StrictMutationReadResult>;
|
|
185
147
|
export declare function workflowEnvelopeContentSha256(value: unknown): string;
|
|
186
|
-
export declare function isNativeDeepInterviewV1(value: Record<string, unknown>): boolean;
|
|
187
|
-
export declare function verifyWorkflowEnvelopeReceiptValue(value: unknown, filePath: string): WorkflowReceiptVerification;
|
|
188
148
|
export declare function stampWorkflowEnvelopeChecksum<T>(value: T, filePath: string, computedAt?: string): T;
|
|
189
149
|
export declare function detectWorkflowEnvelopeIntegrityMismatch(filePath: string): Promise<WorkflowEnvelopeIntegrityMismatch | undefined>;
|
|
190
150
|
type ActiveStateCacheInvalidator = (cwd?: string, sessionId?: string) => void;
|
|
@@ -192,7 +152,6 @@ export declare function setActiveStateCacheInvalidator(invalidator: ActiveStateC
|
|
|
192
152
|
export declare function persistedStateRevision(value: unknown): number;
|
|
193
153
|
export declare function writeGuardedJsonAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
194
154
|
export declare function writeGuardedWorkflowEnvelopeAtomic(targetPath: string, value: unknown, options: GuardedStateWriterOptions): Promise<GuardedWriteResult>;
|
|
195
|
-
export declare function transformGuardedWorkflowEnvelopeAtomic(targetPath: string, options: GuardedWorkflowEnvelopeTransformOptions): Promise<GuardedWorkflowEnvelopeTransformResult>;
|
|
196
155
|
export declare function writeJsonAtomic(targetPath: string, value: unknown, options?: StateWriterOptions): Promise<string>;
|
|
197
156
|
export declare function writeWorkflowEnvelopeAtomic(targetPath: string, value: unknown, options?: StateWriterOptions): Promise<string>;
|
|
198
157
|
export declare function writeTextAtomic(targetPath: string, text: string, options?: StateWriterOptions): Promise<string>;
|
|
@@ -2,7 +2,7 @@ import type { GjcTeamConfig, GjcTeamSnapshot, GjcTeamStartOptions, GjcTeamTask,
|
|
|
2
2
|
/** Launch-specific option wiring kept separate from runtime dispatch. */
|
|
3
3
|
export declare function withTeamLaunchTransport(options: GjcTeamStartOptions, mailboxDeliveryTransport: GjcTeamStartOptions["mailboxDeliveryTransport"]): GjcTeamStartOptions;
|
|
4
4
|
/** @internal Exported for unit tests. */
|
|
5
|
-
export declare function buildWorkerCommand(config: GjcTeamConfig, worker: GjcTeamWorker, platform?: NodeJS.Platform): string;
|
|
5
|
+
export declare function buildWorkerCommand(config: GjcTeamConfig, worker: GjcTeamWorker, platform?: NodeJS.Platform, promptOverride?: string): string;
|
|
6
6
|
interface GjcTmuxBinary {
|
|
7
7
|
command: string;
|
|
8
8
|
isPsmux: boolean;
|
|
@@ -186,6 +186,7 @@ export interface WorkerHeartbeatFile {
|
|
|
186
186
|
last_turn_at: string;
|
|
187
187
|
turn_count: number;
|
|
188
188
|
alive: boolean;
|
|
189
|
+
process_start_time?: string;
|
|
189
190
|
}
|
|
190
191
|
export interface GjcWorkerIntegrationAttemptRequestResult {
|
|
191
192
|
requested: boolean;
|
|
@@ -199,7 +200,7 @@ export interface GjcWorkerIntegrationAttemptRequestResult {
|
|
|
199
200
|
export interface GjcWorkerIntegrationAttemptOptions {
|
|
200
201
|
signal?: AbortSignal;
|
|
201
202
|
}
|
|
202
|
-
export declare const GJC_TEAM_API_OPERATIONS: readonly ["send-message", "broadcast", "mailbox-list", "mailbox-mark-delivered", "mailbox-mark-notified", "notification-list", "notification-read", "notification-replay", "notification-mark-pane-attempt", "worker-startup-ack", "create-task", "read-task", "list-tasks", "update-task", "claim-task", "transition-task-status", "transition-task", "release-task-claim", "read-config", "read-manifest", "read-worker-status", "update-worker-status", "read-worker-heartbeat", "recover-stale-claims", "update-worker-heartbeat", "write-worker-inbox", "write-worker-identity", "append-event", "read-events", "read-traces", "await-event", "write-shutdown-request", "read-shutdown-ack", "read-monitor-snapshot", "write-monitor-snapshot", "read-task-approval", "write-task-approval"];
|
|
203
|
+
export declare const GJC_TEAM_API_OPERATIONS: readonly ["send-message", "broadcast", "mailbox-list", "mailbox-mark-delivered", "mailbox-mark-notified", "notification-list", "notification-read", "notification-replay", "notification-mark-pane-attempt", "worker-startup-ack", "create-task", "read-task", "list-tasks", "update-task", "claim-task", "transition-task-status", "transition-task", "release-task-claim", "read-config", "read-manifest", "read-worker-status", "update-worker-status", "read-worker-heartbeat", "recover-stale-claims", "update-worker-heartbeat", "read-worker-memory-guard", "update-worker-memory-guard", "apply-worker-memory-guard", "write-worker-inbox", "write-worker-identity", "append-event", "read-events", "read-traces", "await-event", "write-shutdown-request", "read-shutdown-ack", "read-monitor-snapshot", "write-monitor-snapshot", "read-task-approval", "write-task-approval"];
|
|
203
204
|
export interface GjcTeamRuntimeTestSeams {
|
|
204
205
|
nowMs?: () => number;
|
|
205
206
|
continuationTmuxDispatch?: (command: string, args: readonly string[]) => {
|
|
@@ -107,6 +107,18 @@ export interface GjcTeamApiClaimResult {
|
|
|
107
107
|
claim_token?: string;
|
|
108
108
|
reason?: string;
|
|
109
109
|
}
|
|
110
|
+
export type GjcTeamWorkerClaimSelection = {
|
|
111
|
+
kind: "none";
|
|
112
|
+
} | {
|
|
113
|
+
kind: "exact";
|
|
114
|
+
task: GjcTeamTask;
|
|
115
|
+
claim: GjcTeamTaskClaim;
|
|
116
|
+
} | {
|
|
117
|
+
kind: "ambiguous";
|
|
118
|
+
tasks: GjcTeamTask[];
|
|
119
|
+
};
|
|
120
|
+
export declare function selectCurrentClaimedTaskForWorker(tasks: readonly GjcTeamTask[], workerId: string): GjcTeamWorkerClaimSelection;
|
|
121
|
+
export declare function findGjcTeamClaimedTaskForWorker(tasks: readonly GjcTeamTask[], workerId: string): GjcTeamTask | undefined;
|
|
110
122
|
type EventAppender = (event: {
|
|
111
123
|
type: string;
|
|
112
124
|
task_id?: string;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type StateWriterOptions } from "./state-writer";
|
|
2
|
+
export type GjcTeamWorkerMemoryGuardState = "idle" | "advisory" | "retrying" | "checkpointed" | "replaced" | "blocked";
|
|
3
|
+
export type GjcTeamWorkerMemoryGuardCheckpointKind = "clean" | "eligible" | "protected_only" | "conflicted" | "git_error";
|
|
4
|
+
export type GjcTeamWorkerMemoryGuardPidProbe = {
|
|
5
|
+
kind: "live";
|
|
6
|
+
start_time: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: "absent";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "unverifiable";
|
|
11
|
+
reason: string;
|
|
12
|
+
};
|
|
13
|
+
export interface GjcTeamWorkerMemoryGuardCheckpoint {
|
|
14
|
+
kind: GjcTeamWorkerMemoryGuardCheckpointKind;
|
|
15
|
+
files: string[];
|
|
16
|
+
head?: string | null;
|
|
17
|
+
commit?: string | null;
|
|
18
|
+
recorded_at: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GjcTeamWorkerMemoryGuardReplacement {
|
|
21
|
+
old_pane_id?: string;
|
|
22
|
+
new_pane_id?: string;
|
|
23
|
+
recorded_at: string;
|
|
24
|
+
}
|
|
25
|
+
export interface GjcTeamWorkerMemoryGuardLedger {
|
|
26
|
+
schema_version: 1;
|
|
27
|
+
worker_id: string;
|
|
28
|
+
platform: string;
|
|
29
|
+
state: GjcTeamWorkerMemoryGuardState;
|
|
30
|
+
automatic_action_allowed: boolean;
|
|
31
|
+
retry_count: number;
|
|
32
|
+
retry_limit: number;
|
|
33
|
+
current_task_id?: string;
|
|
34
|
+
last_incident_id?: string;
|
|
35
|
+
last_reason?: string;
|
|
36
|
+
last_pid_probe?: GjcTeamWorkerMemoryGuardPidProbe;
|
|
37
|
+
last_checkpoint?: GjcTeamWorkerMemoryGuardCheckpoint;
|
|
38
|
+
last_replacement?: GjcTeamWorkerMemoryGuardReplacement;
|
|
39
|
+
updated_at: string;
|
|
40
|
+
}
|
|
41
|
+
export interface GjcTeamWorkerMemoryGuardSelectionCandidate {
|
|
42
|
+
worker_id: string;
|
|
43
|
+
platform: string;
|
|
44
|
+
excess_bytes: number;
|
|
45
|
+
retry_count: number;
|
|
46
|
+
retry_limit: number;
|
|
47
|
+
blocked?: boolean;
|
|
48
|
+
current_task_id?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface GjcTeamWorkerMemoryGuardSelection {
|
|
51
|
+
worker_id: string;
|
|
52
|
+
excess_bytes: number;
|
|
53
|
+
retry_count: number;
|
|
54
|
+
current_task_id?: string;
|
|
55
|
+
}
|
|
56
|
+
export declare function workerMemoryGuardLedgerPath(dir: string, workerId: string): string;
|
|
57
|
+
export declare function normalizeGjcTeamWorkerMemoryGuardPidProbe(value: unknown): GjcTeamWorkerMemoryGuardPidProbe | undefined;
|
|
58
|
+
export declare function isCanonicalGjcTeamWorkerMemoryGuardCheckpoint(value: unknown): value is GjcTeamWorkerMemoryGuardCheckpoint;
|
|
59
|
+
export declare function isCanonicalGjcTeamWorkerMemoryGuardReplacement(value: unknown): value is GjcTeamWorkerMemoryGuardReplacement;
|
|
60
|
+
export declare function isCanonicalGjcTeamWorkerMemoryGuardPidProbe(value: unknown): value is GjcTeamWorkerMemoryGuardPidProbe;
|
|
61
|
+
export declare function isCanonicalGjcTeamWorkerMemoryGuardLedger(value: unknown): value is GjcTeamWorkerMemoryGuardLedger;
|
|
62
|
+
export declare function createInitialGjcTeamWorkerMemoryGuardLedger(input: {
|
|
63
|
+
workerId: string;
|
|
64
|
+
platform: string;
|
|
65
|
+
now: string;
|
|
66
|
+
retryLimit?: number;
|
|
67
|
+
}): GjcTeamWorkerMemoryGuardLedger;
|
|
68
|
+
export declare function selectGjcTeamWorkerMemoryGuardCandidate(candidates: readonly GjcTeamWorkerMemoryGuardSelectionCandidate[]): GjcTeamWorkerMemoryGuardSelection | undefined;
|
|
69
|
+
export type TeamWorkerMemoryGuardAction = "advisory" | "replace" | "blocked";
|
|
70
|
+
export type TeamWorkerMemoryGuardResult = "noop" | "scheduled" | "succeeded" | "failed" | "blocked";
|
|
71
|
+
export interface TeamWorkerMemoryGuardLedgerEntry {
|
|
72
|
+
schema_version: 1;
|
|
73
|
+
recorded_at: string;
|
|
74
|
+
incident_id: string;
|
|
75
|
+
team_name: string;
|
|
76
|
+
worker_id: string;
|
|
77
|
+
task_id: string;
|
|
78
|
+
claim_token: string;
|
|
79
|
+
attempt: number;
|
|
80
|
+
platform: NodeJS.Platform;
|
|
81
|
+
action: TeamWorkerMemoryGuardAction;
|
|
82
|
+
result: TeamWorkerMemoryGuardResult;
|
|
83
|
+
reason: string;
|
|
84
|
+
}
|
|
85
|
+
export declare function isCanonicalTeamWorkerMemoryGuardLedgerEntry(value: unknown): value is TeamWorkerMemoryGuardLedgerEntry;
|
|
86
|
+
export declare function teamWorkerMemoryGuardDir(workerDirPath: string): string;
|
|
87
|
+
export declare function teamWorkerMemoryGuardLedgerPath(workerDirPath: string): string;
|
|
88
|
+
export declare function canMutateTeamWorkerMemoryGuard(platform: NodeJS.Platform): boolean;
|
|
89
|
+
export declare function advisoryReasonForTeamWorkerMemoryGuard(platform: NodeJS.Platform): string | undefined;
|
|
90
|
+
export declare function appendTeamWorkerMemoryGuardLedgerEntry(workerDirPath: string, entry: TeamWorkerMemoryGuardLedgerEntry, options?: StateWriterOptions): Promise<string>;
|
|
91
|
+
export declare function readTeamWorkerMemoryGuardLedger(workerDirPath: string): Promise<TeamWorkerMemoryGuardLedgerEntry[]>;
|
|
92
|
+
export declare function nextTeamWorkerMemoryGuardAttempt(entries: readonly TeamWorkerMemoryGuardLedgerEntry[], incidentId: string): number;
|
|
@@ -267,6 +267,13 @@ export interface LifecyclePaths {
|
|
|
267
267
|
journalFile: string;
|
|
268
268
|
}
|
|
269
269
|
export declare function lifecyclePaths(stateDir: string, sessionId: string, generation: string): LifecyclePaths;
|
|
270
|
+
export interface MemoryGuardClaimPaths {
|
|
271
|
+
root: string;
|
|
272
|
+
databaseFile: string;
|
|
273
|
+
walFile: string;
|
|
274
|
+
shmFile: string;
|
|
275
|
+
}
|
|
276
|
+
export declare function memoryGuardClaimPaths(stateDir: string, sessionId: string): MemoryGuardClaimPaths;
|
|
270
277
|
export declare function replaceOwnerGeneration(stateDir: string, sessionId: string, generation?: string, expectedBaseline?: OwnerGenerationBaseline): Promise<string>;
|
|
271
278
|
export type OwnerGenerationBaseline = {
|
|
272
279
|
state: "absent";
|
|
@@ -39,6 +39,14 @@ export declare function computeUltragoalPlanGeneration(input: {
|
|
|
39
39
|
basis: UltragoalCompletionVerification["basis"];
|
|
40
40
|
};
|
|
41
41
|
export declare function findLedgerReceiptEvent(ledger: readonly UltragoalLedgerEvent[], receipt: UltragoalCompletionVerification): UltragoalLedgerEvent | null;
|
|
42
|
+
/**
|
|
43
|
+
* A final-aggregate receipt whose recorded ledger checkpoint quality gate is
|
|
44
|
+
* missing a clean `criticReview` OKAY can never satisfy the completion guard,
|
|
45
|
+
* yet is not "stale" under {@link validateReceiptFreshBase}. Detect it so an
|
|
46
|
+
* identical-evidence complete replay can re-verify and re-mint with a
|
|
47
|
+
* corrected gate instead of no-opping into a permanently blocked run.
|
|
48
|
+
*/
|
|
49
|
+
export declare function finalAggregateReceiptMissingCriticOkay(ledger: readonly UltragoalLedgerEvent[], receipt: UltragoalCompletionVerification): boolean;
|
|
42
50
|
export declare function validateReceiptFreshBase(input: {
|
|
43
51
|
plan: UltragoalPlan;
|
|
44
52
|
ledger: readonly UltragoalLedgerEvent[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TypeScript is the authoritative source of truth for GJC workflow manifests.
|
|
3
|
-
*
|
|
3
|
+
* Any JSON manifest projection is derived from this module and must never be
|
|
4
|
+
* hand-edited.
|
|
4
5
|
*/
|
|
5
6
|
import { type CanonicalGjcWorkflowSkill } from "../skill-state/canonical-skills";
|
|
6
7
|
export interface WorkflowState {
|
|
@@ -17,9 +18,7 @@ export interface WorkflowVerb {
|
|
|
17
18
|
name: string;
|
|
18
19
|
planned?: boolean;
|
|
19
20
|
/** Invocation surface that exposes this verb in the real CLI parser. */
|
|
20
|
-
surface?: "state-action" | "command-positional" | "command-flag"
|
|
21
|
-
/** Legacy surface retained for callers that have not migrated to normal typed commands. */
|
|
22
|
-
compatibilityOnly?: boolean;
|
|
21
|
+
surface?: "state-action" | "command-positional" | "command-flag";
|
|
23
22
|
}
|
|
24
23
|
export interface TypedArgSpec {
|
|
25
24
|
name: string;
|
|
@@ -27,7 +26,6 @@ export interface TypedArgSpec {
|
|
|
27
26
|
enumValues?: string[];
|
|
28
27
|
required?: boolean;
|
|
29
28
|
appliesToVerbs?: string[];
|
|
30
|
-
compatibilityOnly?: boolean;
|
|
31
29
|
planned?: boolean;
|
|
32
30
|
}
|
|
33
31
|
export interface RetentionPolicy {
|
package/dist/types/main.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export declare const BARE_RESUME_INTERACTIVE_ERROR = "--resume requires an inter
|
|
|
96
96
|
export declare function resolveManagedAgentDirForScope(_cwd: string): string;
|
|
97
97
|
export declare const BARE_RESUME_OPEN_ERROR = "Could not open the selected session. Use --resume <id>.";
|
|
98
98
|
export declare function runInteractiveMode(session: AgentSession, version: string, changelogMarkdown: string | undefined, notifs: (InteractiveModeNotify | null)[], startupUpdate: StartupUpdateOrchestrator, initialMessages: string[], setExtensionUIContext: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers: LspStartupServerInfo[] | undefined, mcpManager: MCPManager | undefined, eventBus?: EventBus, initialMessage?: string, initialImages?: ImageContent[], createInteractiveMode?: CreateInteractiveMode, resumeAction?: "continue-tail" | "open-idle"): Promise<void>;
|
|
99
|
-
declare function getChangelogForDisplay(parsed: Args): Promise<string | undefined>;
|
|
99
|
+
export declare function getChangelogForDisplay(parsed: Args): Promise<string | undefined>;
|
|
100
100
|
export declare function createSessionManager(parsed: Args, cwd: string, activeSettings?: Settings): Promise<SessionManager | undefined>;
|
|
101
101
|
/**
|
|
102
102
|
* Research-mode (RLM) preset hook. Lets `gjc rlm` augment the session options
|
|
@@ -25,4 +25,6 @@ export declare function clearMemoryData(agentDir: string, cwd: string): Promise<
|
|
|
25
25
|
* Force-enqueue global consolidation maintenance work.
|
|
26
26
|
*/
|
|
27
27
|
export declare function enqueueMemoryConsolidation(agentDir: string, cwd: string, sourceUpdatedAt?: number): void;
|
|
28
|
+
/** Secret scrubbing applied to every phase-2 consolidation output. Test seam. */
|
|
29
|
+
export declare function redactMemorySecretsForTesting(input: string): string;
|
|
28
30
|
export declare function getMemoryRoot(agentDir: string, cwd: string): string;
|
|
@@ -195,6 +195,14 @@ export declare function acpPromptPayload(blocks: PromptRequest["prompt"]): {
|
|
|
195
195
|
mimeType: string;
|
|
196
196
|
}>;
|
|
197
197
|
};
|
|
198
|
+
/**
|
|
199
|
+
* `AcpSdkAdapterError.code` is an internal string, but the SDK only derives a
|
|
200
|
+
* JSON-RPC code from a `RequestError`. Everything else collapses to an opaque
|
|
201
|
+
* `-32603 Internal error`, which hides the reason and defeats client-side
|
|
202
|
+
* recovery (an ACP client cannot see that it must authenticate). Map the codes
|
|
203
|
+
* that have a defined ACP/JSON-RPC counterpart onto a real `RequestError`.
|
|
204
|
+
*/
|
|
205
|
+
export declare function acpRequestFailure(error: unknown): unknown;
|
|
198
206
|
/** Registers a permission provider only when the ACP client requires prompts. */
|
|
199
207
|
export declare function acpProviderRegistrations(capabilities: ClientCapabilities | undefined, env?: NodeJS.ProcessEnv): AcpProviderRegistration[];
|
|
200
208
|
/** Maps ACP permission handling to the session's canonical SDK policy. */
|
|
@@ -10,11 +10,13 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
10
10
|
#private;
|
|
11
11
|
private hideThinkingBlock;
|
|
12
12
|
private readonly onImageUpdate?;
|
|
13
|
-
|
|
13
|
+
private readonly onVisibleMutation?;
|
|
14
|
+
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: (() => void) | undefined, viewportAnchorId?: string, onVisibleMutation?: (() => void) | undefined);
|
|
14
15
|
invalidate(): void;
|
|
15
16
|
setHideThinkingBlock(hide: boolean): void;
|
|
16
17
|
setToolResultImages(toolCallId: string, images: ImageContent[]): void;
|
|
17
18
|
setUsageInfo(usage: Usage): void;
|
|
18
19
|
updateContent(message: AssistantMessage, options?: AssistantMessageUpdateOptions): void;
|
|
20
|
+
dispose(): void;
|
|
19
21
|
}
|
|
20
22
|
export {};
|