@kynver-app/runtime 0.2.4 → 0.2.13
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/cli.js +110 -59
- package/dist/dispatch-claim-release.d.ts +6 -0
- package/dist/doctor/local-store-cli.d.ts +11 -0
- package/dist/doctor/local-store.d.ts +35 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +136 -85
- package/dist/local-run-store/admission-enforce.d.ts +38 -0
- package/dist/local-run-store/admission-shadow.d.ts +56 -0
- package/dist/local-run-store/dispatch-claim-recovery-startup.d.ts +11 -0
- package/dist/local-run-store/dispatch-claim-recovery.d.ts +54 -0
- package/dist/local-run-store/dispatch-receipts.d.ts +90 -0
- package/dist/local-run-store/index.d.ts +10 -0
- package/dist/local-run-store/index.js +21 -9
- package/dist/local-run-store/local-run-store.d.ts +26 -0
- package/dist/local-run-store/remote-surface-flags.d.ts +15 -0
- package/dist/local-run-store/small-surfaces.d.ts +37 -0
- package/dist/local-run-store/sqlite/sqlite-local-run-store.d.ts +14 -1
- package/dist/local-run-store/store-lifecycle.d.ts +38 -0
- package/dist/local-run-store/surface-flags.d.ts +47 -0
- package/dist/local-run-store/tick-posture.d.ts +27 -0
- package/dist/plan-persist/index.d.ts +1 -1
- package/dist/plan-persist/outbox-durability.d.ts +31 -0
- package/dist/plan-persist/outbox-store.d.ts +18 -0
- package/dist/plan-persist/types.d.ts +4 -0
- package/dist/repo-search.d.ts +13 -0
- package/dist/resource-gate.d.ts +9 -0
- package/dist/server/cleanup.js +14 -14
- package/dist/server/default-repo.js +1 -1
- package/dist/server/heavy-verification.js +1 -1
- package/dist/server/memory-cost-enforce.js +2 -2
- package/dist/server/memory-cost.js +2 -2
- package/dist/server/monitor.js +7 -7
- package/dist/server/repo-search.d.ts +1 -1
- package/dist/server/repo-search.js +1 -1
- package/dist/server/worker-policy.d.ts +1 -1
- package/dist/server/worker-policy.js +1 -1
- package/dist/util.d.ts +11 -0
- package/dist/worker-env.d.ts +40 -3
- package/package.json +1 -1
|
@@ -4,12 +4,18 @@ export interface ReleaseDispatchClaimInput {
|
|
|
4
4
|
agentOsId: string;
|
|
5
5
|
taskId: string;
|
|
6
6
|
leaseOwner: string;
|
|
7
|
+
/** The lease token from claim time — the server refuses a superseded release (§7.7). */
|
|
8
|
+
leaseToken?: string | null;
|
|
7
9
|
failureDetail?: string;
|
|
8
10
|
}
|
|
9
11
|
export interface ReleaseDispatchClaimOutcome {
|
|
10
12
|
released: boolean;
|
|
11
13
|
releaseResponse: unknown;
|
|
12
14
|
httpOk: boolean;
|
|
15
|
+
/** True only when the POST itself failed (no HTTP response at all) — a
|
|
16
|
+
* transport failure is NOT a server refusal and callers that bracket on
|
|
17
|
+
* refusal must not bracket on it (D1b review A2). */
|
|
18
|
+
transportError: boolean;
|
|
13
19
|
}
|
|
14
20
|
/**
|
|
15
21
|
* Hand a dispatch-next lease back to the board when local worker spawn did not start.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `kynver doctor local-store [--no-probe]` — report-only in D0: always exits
|
|
3
|
+
* 0 (no surface consults the store yet, so nothing may gate on this); the
|
|
4
|
+
* posture lives in the printed report.
|
|
5
|
+
*
|
|
6
|
+
* The default openability probe CREATES `local-run-store.sqlite` under the
|
|
7
|
+
* harness root on a host that never opened it (inert — nothing reads it with
|
|
8
|
+
* flags off). Pass `--no-probe` to report current lifecycle state without
|
|
9
|
+
* touching disk.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runLocalStoreDoctorCli(args?: Record<string, unknown>): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type LocalRunStoreLifecycleStatus } from "../local-run-store/store-lifecycle.js";
|
|
2
|
+
import { type LocalRunStoreSurfaceMode } from "../local-run-store/surface-flags.js";
|
|
3
|
+
export interface LocalStoreQuarantineEntry {
|
|
4
|
+
file: string;
|
|
5
|
+
mtime: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface LocalStoreDoctorReport {
|
|
8
|
+
command: "doctor local-store";
|
|
9
|
+
contractVersion: 1;
|
|
10
|
+
harnessRoot: string;
|
|
11
|
+
store: {
|
|
12
|
+
state: LocalRunStoreLifecycleStatus["state"];
|
|
13
|
+
databasePath: string | null;
|
|
14
|
+
schemaVersion: number | null;
|
|
15
|
+
recovered: boolean;
|
|
16
|
+
quarantinedTo: string | null;
|
|
17
|
+
reason: string | null;
|
|
18
|
+
};
|
|
19
|
+
surfaces: Array<{
|
|
20
|
+
key: string;
|
|
21
|
+
env: string;
|
|
22
|
+
milestone: string;
|
|
23
|
+
mode: LocalRunStoreSurfaceMode;
|
|
24
|
+
/** env override / server-delivered policy / default off. */
|
|
25
|
+
source: "env" | "server" | "default";
|
|
26
|
+
}>;
|
|
27
|
+
flagWarnings: string[];
|
|
28
|
+
/** `*.quarantine-*` artifacts under the harness root (offline inspection). */
|
|
29
|
+
quarantineHistory: LocalStoreQuarantineEntry[];
|
|
30
|
+
}
|
|
31
|
+
export declare function buildLocalStoreDoctorReport(options?: {
|
|
32
|
+
env?: NodeJS.ProcessEnv;
|
|
33
|
+
/** Skip the open probe (report current lifecycle state only). */
|
|
34
|
+
probe?: boolean;
|
|
35
|
+
}): LocalStoreDoctorReport;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { cleanupWslCrashDumps, shouldAutoCleanupWslCrashDumps, type WslCrashDump
|
|
|
9
9
|
export { postJson, type DispatchNextDiskGateShape, type DispatchNextWslHostShape, } from "./callbacks.js";
|
|
10
10
|
export { parseClaudeStream, parseHarnessStream, summarizeEvent, summarizeShellToolCallEvent, } from "./stream.js";
|
|
11
11
|
export { classifyNpmAuditOutcome, classifyShellCommandOutcome, summarizeNpmAuditReport, type NpmAuditSummary, type ShellCommandOutcome, type ShellCommandOutcomeKind, } from "./shell-command-outcome.js";
|
|
12
|
-
export { classifyRepoSearchMeta, diagnoseRepoSearchFailure, extractSearchMeta, extractSearchMetaFromToolLine, formatRepoSearchGuidance, isRgExcludeScopeTarget, isSingleFileSearchTarget, metaToNormalizedRgCommand, normalizeRepoSearchCommand, normalizeRgArgv, type RepoSearchContext, type RepoSearchKind, } from "./repo-search.js";
|
|
12
|
+
export { classifyRepoSearchMeta, diagnoseRepoSearchFailure, extractSearchMeta, extractSearchMetaFromToolLine, formatRepoSearchGuidance, isRgExcludeScopeTarget, isSingleFileSearchTarget, metaToNormalizedRgCommand, normalizeRepoSearchCommand, normalizeRgArgv, shouldTreatRgNoMatchAsSuccess, unwrapShellWrapperCommand, type RepoSearchContext, type RepoSearchKind, } from "./repo-search.js";
|
|
13
13
|
export { parseHeartbeat, isTerminalHeartbeatPhase, terminalFinalResultFromHeartbeat, } from "./heartbeat.js";
|
|
14
14
|
export { buildBoxResourceSnapshotFromGate, formatHeartbeatLine, type RuntimeBoxResourceSnapshot, type RuntimeBoxResourceSnapshotPrEvidence, type HeartbeatLineInput, } from "./box-resource-snapshot.js";
|
|
15
15
|
export { resolveBoxKindFromEnv, defaultBoxId } from "./box-resource-snapshot-shared.js";
|
|
@@ -37,7 +37,7 @@ export { parseExecutorRefRoutingIntent, executorRefRequestsNonCursorWorker, type
|
|
|
37
37
|
export { assessDispatchModelGuard, type DispatchModelGuardInput, type DispatchModelGuardResult, } from "./dispatch-model-guard.js";
|
|
38
38
|
export { GLOBAL_DEFAULT_MODEL, CURSOR_DEFAULT_MODEL, inferModelRoutingFromTask, resolveGlobalDefaultModel, resolveModelFallback, resolveWorkerLaunch, type ModelRoutingDecision, } from "./model-routing.js";
|
|
39
39
|
export { redactHarness } from "./redact.js";
|
|
40
|
-
export { scrubWorkerEnv, scrubClaudeEnv, auditWorkerEnv, listForbiddenWorkerEnvKeys, isForbiddenWorkerEnvKey, FORBIDDEN_WORKER_ENV_KEYS, type WorkerEnvAudit, } from "./worker-env.js";
|
|
40
|
+
export { scrubWorkerEnv, scrubClaudeEnv, auditWorkerEnv, listForbiddenWorkerEnvKeys, listOperatorAllowedWorkerEnvKeys, isForbiddenWorkerEnvKey, FORBIDDEN_WORKER_ENV_KEYS, type WorkerEnvAudit, } from "./worker-env.js";
|
|
41
41
|
export { KYNVER_NO_PROD_DB_CREDENTIALS_ENV, REVIEW_WORKER_EXTRA_FORBIDDEN_ENV_KEYS, ProductionDatabaseCredentialBlockedError, assertProductionDatabaseResolutionAllowed, auditReviewWorkerCredentialScope, buildWorkerSpawnEnv, isNoProdCredentialReviewEnvironment, type BuildWorkerSpawnEnvOptions, type ReviewWorkerCredentialScopeAudit, } from "./security-review-environment.js";
|
|
42
42
|
export { isHarnessExpertReviewWorker } from "./harness-expert-review.js";
|
|
43
43
|
export { discoverProductionDbEnvFilePaths, expandHomePath } from "./db-credential-env-paths.js";
|
|
@@ -74,7 +74,7 @@ export { runBoundedBuildCheck, assessBuildAdmission, mergeNodeOptionsForBuildChe
|
|
|
74
74
|
export { assessHeavyVerificationGate, countActiveHeavyVerificationSlots, isHeavyVerificationGateSkipped, listActiveHeavyVerificationSlots, reclaimStaleHeavyVerificationSlots, releaseHeavyVerificationSlot, resolveHeavyVerificationMaxConcurrent, tryAcquireHeavyVerificationSlot, waitForHeavyVerificationSlot, DEFAULT_HEAVY_VERIFICATION_MAX_CONCURRENT, classifyHeavyShellCommand, gateWorkerShellCommand, HEAVY_VERIFICATION_TOKEN_REQUIRED, type HeavyCommandClass, type HeavyCommandClassification, type HeavyVerificationGateVerdict, type HeavyVerificationSlotRecord, type WorkerCommandGateOutcome, type WorkerCommandGateResult, } from "./heavy-verification/index.js";
|
|
75
75
|
export { assessAutoCompleteEligibility, classifyWorkerHealth, getMonitorStatus, listMonitors, runMonitorTick, spawnMonitorSidecar, type AutoCompleteAssessment, type MonitorTickResult, type TaskLeaseSnapshot, type WorkerHealthClass, type WorkerMonitorView, } from "./monitor/index.js";
|
|
76
76
|
export { formatHarnessToolReadable, formatMonitorTickNotice, formatAutoCompleteOutcomeNotice, formatWorkerStatusNotice, formatWorkerCompleteNotice, joinHarnessNotice, type HarnessReadableNotice, type HarnessToolFormatContext, } from "./harness-notice/index.js";
|
|
77
|
-
export { persistPlan, drainPlanOutbox, listOutboxItems, formatPlanOutboxHandoffBlock, extractPlanOutboxFromTask, hashPlanBody, type PersistPlanInput, type PersistPlanResult, type PlanPersistUserStatus, } from "./plan-persist/index.js";
|
|
77
|
+
export { persistPlan, drainPlanOutbox, listOutboxItems, writeOutboxItem, formatPlanOutboxHandoffBlock, extractPlanOutboxFromTask, hashPlanBody, type PersistPlanInput, type PersistPlanResult, type PlanPersistUserStatus, } from "./plan-persist/index.js";
|
|
78
78
|
export { classifyVercelUrl, collectVercelEvidence, evidenceFromGitHubVercelStatus, isDashboardVercelUrl, isInspectableVercelTarget, isVercelStatusContext, pickVercelStatusContext, resolveVercelInspectTarget, type CollectVercelEvidenceInput, type GitHubCommitStatusRow, type VercelEvidenceResult, type VercelEvidenceStatus, } from "./vercel/index.js";
|
|
79
79
|
export { validateJobEnvelope, type LocalCodexJobEnvelope, type LocalCodexJobToolPolicy, type JobEnvelopeValidationError, type JobEnvelopeValidationResult, } from "./byoc/job-envelope.js";
|
|
80
80
|
export { verifyLocalCodexGoldenPath, formatGoldenPathFailureNotice, type GoldenPathCheckCode, type GoldenPathAuditEvidence, type GoldenPathOptions, type GoldenPathResult, } from "./byoc/m6-golden-path.js";
|
|
@@ -82,3 +82,4 @@ export { AGENT_RUNTIME_ENVELOPE_SCHEMA_VERSION, AGENT_RUNTIME_ENVELOPE_SCHEMA_VE
|
|
|
82
82
|
export { evaluateNodeRuntimePolicy, KYNVER_NODE_PATCH_FLOOR, PUBLISHED_NODE_RANGE, PRIVATE_ROOT_NODE_RANGE, type NodeRuntimePolicyStatus, type NodeRuntimePolicyVerdict, } from "./node-runtime-policy.js";
|
|
83
83
|
export { buildRuntimeIdentity, type RuntimeIdentityV1 } from "./runtime-identity.js";
|
|
84
84
|
export { buildNodeRuntimeDoctorReport, type NodeRuntimeDoctorReport } from "./doctor/node-runtime.js";
|
|
85
|
+
export { readJson, writeJson } from "./util.js";
|