omnius 1.0.964 → 1.0.966

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.
@@ -11,7 +11,8 @@ export interface NativeFileWriteObservation {
11
11
  readonly schema: 'omnius.native-file-write-observation.v1';
12
12
  readonly kind: 'pre_effect_overwrite_refusal' | 'committed_mutation';
13
13
  readonly canonicalTarget: string;
14
- readonly beforeSha256: string;
14
+ /** Null identifies a FileWrite creation that committed from an absent path. */
15
+ readonly beforeSha256: string | null;
15
16
  readonly afterSha256: string;
16
17
  readonly scope: Readonly<NativeFileWriteInvocationScope>;
17
18
  }
@@ -75,6 +75,20 @@ export interface CommandEvidenceReceipt {
75
75
  };
76
76
  /** Optional immutable pointer to a spilled full command transcript. */
77
77
  outputRef?: string;
78
+ /** Native direct execution substituted for a display-only test pipeline. */
79
+ verificationPreview?: {
80
+ framework: "pytest" | "python_unittest";
81
+ outputRef: string;
82
+ stdoutSha256: string;
83
+ stderrSha256: string;
84
+ passedTests: number;
85
+ /** Physical launcher resolved in the effective execution environment. */
86
+ executablePath?: string;
87
+ /** Present when scoped verifier inputs were captured unchanged before and after execution. */
88
+ testedRevision?: string;
89
+ /** Authenticated direct invocation with a framework-identified outcome. */
90
+ orderedOutcome?: "assertion_failure" | "pass";
91
+ };
78
92
  /** Exact explicit task artifacts observed by this local command, when the
79
93
  * controller can attest the relationship. This is never inferred from
80
94
  * display output and never grants verification authority by itself. */
@@ -241,6 +255,22 @@ export interface ToolInvocationContext {
241
255
  assertCurrent?: () => void;
242
256
  /** Host-authored correlation for one actual process; never model arguments. */
243
257
  shellRun?: import("./shell-runs.js").ShellRunInvocation;
258
+ /** An exact host recheck can only take the direct validator path. */
259
+ canonicalVerifierRecheck?: Readonly<{
260
+ command: string;
261
+ cwd: string;
262
+ testedRevision: string;
263
+ }>;
264
+ /** Exact ordinary verifier declared by the authenticated routine task. */
265
+ routineVerifier?: Readonly<{
266
+ command: string;
267
+ cwd: string;
268
+ }>;
269
+ /** Host-selected literal command and original invocation directory. */
270
+ orderedVerifier?: Readonly<{
271
+ command: string;
272
+ invocationCwd: string;
273
+ }>;
244
274
  /** Current runner-owned task context for bounded UI policy requests. Never tool/page input. */
245
275
  uiTaskContext?: {
246
276
  goal: string;
@@ -1,5 +1,6 @@
1
1
  import type { NativeMemoryViewBinding } from "../execution/native-memory-view-provider.js";
2
2
  import { type HostToolCompositionPolicy } from "./brokered-tool-composition.js";
3
+ import { projectAppendOnlyOutbound } from "./append-only-outbound.js";
3
4
  import { type InferenceRouteLifecycleReceipt, type InferenceFallbackApprovalReceipt, type PreparedInferenceContextCapacity } from "./remote-inference-fallback.js";
4
5
  import { type ForcedUpdateRequirementRecovery, type ForcedUpdateRequirementRecoveryResult, type ForcedUpdateRequirementRecoveryHandler } from "./forced-update-requirement-recovery.js";
5
6
  export type { ForcedUpdateRequirementRecovery, ForcedUpdateRequirementRecoveryReceipt, ForcedUpdateRequirementRecoveryResult, ForcedUpdateRequirementRecoveryHandler } from "./forced-update-requirement-recovery.js";
@@ -9,9 +10,10 @@ import { type DocumentPersistenceReviewEvidenceV1 } from "./document-persistence
9
10
  import { type TaskWorkDelegationV1, type TaskWorkDelegationParentV1, type TaskDocumentSourceV1, type TaskDocumentWorkerResultV1, type TaskWorkDelegationReceiptV1 } from "./taskWorkDelegation.js";
10
11
  import { type OwnedInferenceDispatchFailureV1, type OwnedInferenceWaitContext, type OwnedInferenceWaitObserveOptions, type OwnedInferenceWaitReceiptV1 } from "./owned-inference-wait.js";
11
12
  import type { SpanMeta } from "./types.js";
13
+ import { type RoutineCodingAdmissionV1 } from "./routine-coding-admission.js";
12
14
  import { type InferencePressureCoordinator } from "./inference-pressure.js";
13
15
  import { type InterruptionLifecycleMode, type InterruptionOperationKind, type InterruptionEffectClass, type InterruptionSnapshot, type InterruptionTransitionReceipt } from "./interruption-lifecycle.js";
14
- import { type OwnedModelWaitCheckpointV1 } from "./owned-model-wait.js";
16
+ import { type OwnedModelBlocker, type OwnedModelWaitCheckpointV1 } from "./owned-model-wait.js";
15
17
  import type { AgentRunEvent } from "./runEvents.js";
16
18
  import { type ProgressiveToolDescriptor, type TrustedToolExecutionProfile } from "./tool-exposure-policy.js";
17
19
  import { type SteeringInput, type SteeringIntakeReceipt } from "./steeringIntake.js";
@@ -20,7 +22,7 @@ import { type ExternalEffectIntentV1, type ExternalEffectReceiptV1, type NeedsIn
20
22
  import { PROMPT_CONTEXT_SELECTION, PROVIDER_RESPONSE_PARSER, REQUIRED_PROVIDER_SOURCES, type RequiredProviderSource, type PromptContextSelection, type ProviderContextAudit } from "./provider-context-contract.js";
21
23
  import { type TerminalTaskReport } from "./terminalTaskReport.js";
22
24
  import { type NativePendingProviderDeliveryV1, type NativeProviderDeliveryAckV1 } from "./native-provider-delivery.js";
23
- import { type CompletionFinalizationRecord, type TerminalRuntimeFailure } from "./completionFinalization.js";
25
+ import { type CompletionFinalizationRecord, type DecisionStopReason, type TerminalRuntimeFailure } from "./completionFinalization.js";
24
26
  import { type CompletionReadinessSnapshot } from "./completionReadiness.js";
25
27
  import { type CompletionDeliveryReceipt, type ExpectedOutcomeAssessmentV1, type ExpectedOutcomeContractV1, type ExpectedOutcomeRequiredEffectV1 } from "./expectedOutcomeContract.js";
26
28
  import { type TodoSnapshot } from "./todoObservability.js";
@@ -433,6 +435,10 @@ export interface NativeInteractiveDecisionV1 {
433
435
  readonly disposition: 'independent_reply' | 'steer' | 'pause' | 'resume' | 'replace' | 'stop' | 'unresolved';
434
436
  }
435
437
  export interface AgenticRunnerOptions {
438
+ /** Trusted standalone terminal entry may independently review an exact local work draft. */
439
+ standaloneLocalDraftCloseout?: boolean;
440
+ /** Opaque authority from the standalone local CLI's fully specified routine input. */
441
+ routineCodingAdmission?: RoutineCodingAdmissionV1;
436
442
  /** Pinned native issuer reader. Copied decisions and checkpoint JSON grant nothing. */
437
443
  readNativeInteractiveDecision?: (original: unknown) => Readonly<NativeInteractiveDecisionV1> | undefined;
438
444
  /** Pinned original host ACK reader; JSON or a surface flag never supplies delivery authority. */
@@ -533,6 +539,8 @@ export interface AgenticRunnerOptions {
533
539
  temperature?: number;
534
540
  /** Per-request timeout in ms (default: 300_000). Set 0 to wait until explicit abort. */
535
541
  requestTimeoutMs?: number;
542
+ /** Absolute host deadline, when a launcher owns a real wall-clock budget. Advisory only. */
543
+ taskWallDeadlineMs?: number;
536
544
  /**
537
545
  * Legacy progress health-check interval in ms. This is never a terminal task
538
546
  * timeout; agent runs end by completion, turn budget, explicit abort, or
@@ -563,10 +571,12 @@ export interface AgenticRunnerOptions {
563
571
  explicitWorkModeCustody?: ExplicitWorkModeCustody;
564
572
  /** Explicit host runtime/registry pin for cold provider-wait observation; never model arguments. */
565
573
  ownedInferenceWaitRuntimeFingerprint?: string;
566
- /** Optional operational polling budget. Zero keeps ownership until Stop or authoritative completion. */
574
+ /** Total body-free observation budget. A zero or omitted value uses the runtime default. */
567
575
  ownedInferenceWaitObservationBudgetMs?: number;
568
- /** Bound each body-free status request without renewing the original generation. */
576
+ /** Initial readiness and semantic idle interval for a body-free observation of the original generation. */
569
577
  ownedInferenceWaitObservationTimeoutMs?: number;
578
+ /** End an unattended caller at a model blocker while preserving the paused checkpoint. */
579
+ returnWhenOwnedModelBlocked?: boolean;
570
580
  /** Exact host-owned passive Telegram spans; quoted source text cannot grant this ownership. */
571
581
  telegramPassiveHistory?: TelegramPassiveHistoryManifest;
572
582
  /** Independently bound current native message owner for passive history. */
@@ -775,6 +785,8 @@ export interface AgenticRunnerOptions {
775
785
  * OMNIUS_COMPLETION_VERIFY_CMD.
776
786
  */
777
787
  completionVerifyCommand?: string;
788
+ /** Explicit host-declared deliverable paths to write against a current test result. */
789
+ verificationArtifactPaths?: readonly string[];
778
790
  /**
779
791
  * Focus supervisor mode. The supervisor turns scattered loop/failure/context
780
792
  * signals into one stateful next-action contract. "auto" may enforce a
@@ -985,6 +997,8 @@ export interface AgenticRunnerOptions {
985
997
  interruptionOwnerId?: string;
986
998
  /** Adopt and resume a valid paused generation recovered from stateDir. */
987
999
  resumeInterrupted?: boolean;
1000
+ /** Exact host-authorized explicit resume of a checkpointed unsent dispatch. */
1001
+ resumeOwnedModelBlockerOperationId?: string;
988
1002
  /** Host opts in only after revalidating the exact native Telegram owner. */
989
1003
  refreshTelegramNativeContextOnResume?: boolean;
990
1004
  }
@@ -1095,6 +1109,9 @@ export interface AgenticEvent {
1095
1109
  success?: boolean;
1096
1110
  /** Host-owned foreground readiness state; waiting retains the current task. */
1097
1111
  inferenceWaiting?: boolean;
1112
+ /** A settled local wait with an explicit operator prerequisite. */
1113
+ ownedModelBlocker?: OwnedModelBlocker | null;
1114
+ inferenceObservationRouteUnavailable?: boolean;
1098
1115
  /** Fresh host-observed effect for advisory lifecycle; never goal acceptance. */
1099
1116
  effectObserved?: boolean;
1100
1117
  turn?: number;
@@ -1109,6 +1126,13 @@ export interface AgenticEvent {
1109
1126
  shellMutationObservation?: ShellMutationObservation;
1110
1127
  /** Metadata-only transport and normalized response counts; never completion authority. */
1111
1128
  responseDiagnostics?: ModelResponseDiagnosticReceipt;
1129
+ /** Host projection receipt for correlating lowered requests with cache observations. */
1130
+ providerProjection?: {
1131
+ logicalRequestId: string;
1132
+ mode: "full" | "extended";
1133
+ reason: string;
1134
+ rebase?: NonNullable<ReturnType<typeof projectAppendOnlyOutbound>["rebase"]>;
1135
+ };
1112
1136
  /** Host-owned effective inference route and sanitized attempt outcome. */
1113
1137
  inferenceRoute?: InferenceRouteLifecycleReceipt;
1114
1138
  /** For stream_token events: what kind of content is being streamed */
@@ -1404,7 +1428,10 @@ export interface AgenticResult {
1404
1428
  /** Estimated tokens from content length (chars/4) — used when API doesn't report usage */
1405
1429
  estimatedTokens: number;
1406
1430
  summary: string;
1431
+ /** The run ended at a saved local pause, with no terminal completion. */
1432
+ ownedModelBlocker?: Readonly<OwnedModelBlocker>;
1407
1433
  runtimeFailure?: TerminalRuntimeFailure;
1434
+ decisionStopReason?: DecisionStopReason;
1408
1435
  /** A user answer owned by the exact task_complete call whose success was
1409
1436
  * admitted and committed. The text is either that call's explicit user_reply
1410
1437
  * or a fresh model-visible response bound to the same run, task epoch, and
@@ -1756,6 +1783,7 @@ export declare class AgenticRunner {
1756
1783
  /** First tool-log turn belonging to the active task epoch. */
1757
1784
  private _taskEpochStartTurn;
1758
1785
  private _activeRunId;
1786
+ private _routineCodingOwner?;
1759
1787
  private _featureWorkflow;
1760
1788
  private _featureWorkflowBindings;
1761
1789
  private _featureWorkflowSchemaDirty;
@@ -1791,11 +1819,7 @@ export declare class AgenticRunner {
1791
1819
  private _appendOnlyOutbound?;
1792
1820
  private _appendOnlyRequiredAuxiliaryHandoff?;
1793
1821
  /** Per primary turn: whether the request extended the previous one, and why not when it did not. */
1794
- readonly appendOnlyOutboundDecisions: Array<{
1795
- logicalRequestId: string;
1796
- mode: "full" | "extended";
1797
- reason: string;
1798
- }>;
1822
+ readonly appendOnlyOutboundDecisions: NonNullable<AgenticEvent["providerProjection"]>[];
1799
1823
  /** Selected method definition only; observation/status counters do not change schemas. */
1800
1824
  private _selectedWorkToolExposureKey;
1801
1825
  private pendingRuntimeGuidanceMessages;
@@ -1834,6 +1858,7 @@ export declare class AgenticRunner {
1834
1858
  private readonly _interruptionMode;
1835
1859
  private readonly _interruptionOwnerId;
1836
1860
  private readonly _resumeInterrupted;
1861
+ private readonly _resumeOwnedModelBlockerOperationId?;
1837
1862
  private readonly _canonicalProjectionMode;
1838
1863
  private readonly _completionReadinessMode;
1839
1864
  private _lastCanonicalProjectionComparison;
@@ -2086,7 +2111,10 @@ export declare class AgenticRunner {
2086
2111
  /** Frontier feedback is a live snapshot, never terminal summary text. */
2087
2112
  private _completionFrontierFeedbackCount;
2088
2113
  private _completionLedger;
2114
+ private _taskNativeChecks?;
2089
2115
  private _nativeShellVerificationEvidence;
2116
+ private _nativeShellVerificationReceipts;
2117
+ private _standaloneDraftVerifierRevisions;
2090
2118
  private readonly _nativeFileWriteCallProofs;
2091
2119
  private readonly _consumedFileWriteObservations;
2092
2120
  private _consumedShellVerificationObservations;
@@ -2161,6 +2189,9 @@ export declare class AgenticRunner {
2161
2189
  private _runStartTime;
2162
2190
  private _ownedInferenceWaitCheckpoint?;
2163
2191
  private _restoredOwnedInferenceWait;
2192
+ private _ownedModelBlocker?;
2193
+ private _ownedObservationResumeOperationId?;
2194
+ private _ownedModelBlockerSuperseded;
2164
2195
  private _retiredOwnedInferenceWaits;
2165
2196
  private _ownedInferenceWaitReceipt?;
2166
2197
  private _ownedInferenceWaitController?;
@@ -2202,6 +2233,7 @@ export declare class AgenticRunner {
2202
2233
  private _lastCanonicalToolProjection;
2203
2234
  private _lastCanonicalContextSignals;
2204
2235
  private _canonicalAcceptedReceipts;
2236
+ private _restoredDecisionObservations;
2205
2237
  private _canonicalExactSourceCarriers;
2206
2238
  /** Process-local successful observation qualification; never hydrated from JSON. */
2207
2239
  private _historyObservations;
@@ -2226,8 +2258,8 @@ export declare class AgenticRunner {
2226
2258
  private _sourceExtractionResumeReads;
2227
2259
  private _reviewedInterpretationProjectionBlocked;
2228
2260
  private _taskExecutionSnapshot;
2229
- private _taskExecutionSnapshotCarriers;
2230
- private _taskExecutionControllerProjection?;
2261
+ private _taskExecutionSnapshotByRequest;
2262
+ private _runObservationByRequest;
2231
2263
  private _pendingNativeRequirementAmendments;
2232
2264
  private _nativeRequirementInterpretationHolds;
2233
2265
  private _taskObjectiveContinuationRecord;
@@ -2408,6 +2440,9 @@ export declare class AgenticRunner {
2408
2440
  private _saveWorkboard;
2409
2441
  private _observeExpectedOutcomeEffect;
2410
2442
  private _initializeTaskObjective;
2443
+ private _taskNativeCheckScope;
2444
+ private _taskNativeCheckDeficits;
2445
+ private _taskNativeCompletionDeficit;
2411
2446
  private _reconcileObjectiveFrontier;
2412
2447
  private _durableWorkPreparation;
2413
2448
  private _objectivePreparationFromToolResult;
@@ -2440,10 +2475,17 @@ export declare class AgenticRunner {
2440
2475
  private _completionReadinessConstraints;
2441
2476
  private _completionReadinessAuthorityLedger;
2442
2477
  private _lastVerificationInvalidatingMutation;
2478
+ private _allMutationPathsOutsideVerifier;
2443
2479
  private _completionReadinessVerificationAuthority;
2444
2480
  private _completionReadinessDeliveryAuthority;
2445
2481
  private _readCurrentNativeCompletionDeficit;
2446
2482
  private _currentFactualCompletionDeficit;
2483
+ private _currentRoutineCodingAdmission;
2484
+ private _standaloneLocalDraftTaskIsCurrent;
2485
+ private _standaloneDraftWorkspaceRevision;
2486
+ private _standaloneDraftVerification;
2487
+ private _retainStandaloneDraftReview;
2488
+ private _routineCodingCloseout;
2447
2489
  private _completionReadinessSnapshot;
2448
2490
  /**
2449
2491
  * Commit one authoritative terminal receipt before emitting a result to the
@@ -2612,11 +2654,17 @@ export declare class AgenticRunner {
2612
2654
  getOwnedInferenceWaitState(): Readonly<OwnedModelWaitCheckpointV1> | undefined;
2613
2655
  /** Historical observation pointers; these never reopen current dispatch. */
2614
2656
  getRetiredOwnedInferenceWaits(): readonly Readonly<OwnedModelWaitCheckpointV1>[];
2657
+ private readonly _consumedOwnedInferenceWaits;
2658
+ /** Called only after publishing the checkpoint or terminal receipt which replaced the old turn. */
2659
+ private _retireConsumedModelRequests;
2615
2660
  private _ownedModelPolicySha256;
2616
2661
  /** This is a private live-object proof, not a serialized steering field. */
2617
2662
  private _pendingNativeControlCustodyIsCurrent;
2618
2663
  private _persistOwnedModelWait;
2619
2664
  private _ownedModelWaitTicket;
2665
+ private _restorableBlockedModelObservation;
2666
+ private _blockOwnedModelWait;
2667
+ private _ownedModelBlockerSummary;
2620
2668
  private _observeOwnedModelWait;
2621
2669
  private readonly _pendingAuxiliaryModelDispatches;
2622
2670
  /** Host observation of this exact current native backend argument, never an execution grant. */
@@ -2663,6 +2711,9 @@ export declare class AgenticRunner {
2663
2711
  };
2664
2712
  private _registerToolComposition;
2665
2713
  private readonly _responseToolCapabilities;
2714
+ private readonly _recoveryRequestCapabilities;
2715
+ private readonly _compactRecoveryRequests;
2716
+ private readonly _materializedCompactRecoveries;
2666
2717
  private readonly _unfilteredResponseBodies;
2667
2718
  private _lastBuiltToolCapabilities;
2668
2719
  private _lastBuiltTextToolDefinitions;
@@ -2713,7 +2764,10 @@ export declare class AgenticRunner {
2713
2764
  * input pressure can exchange only our owned bodies for their verified
2714
2765
  * bounded native projection and durable full-source retrieval handle. */
2715
2766
  private _applyTaskObjectiveContinuationSourceProjection;
2767
+ private _taskExecutionCarrierOwner;
2768
+ private _runObservationCarrierOwner;
2716
2769
  private _injectTaskExecutionSnapshotContext;
2770
+ private _applyCompactRecovery;
2717
2771
  private _recordContextWindowDump;
2718
2772
  /** Refresh exact transport fields after validated memory materialization. */
2719
2773
  private _refreshCanonicalTransportTrace;
@@ -2749,6 +2803,10 @@ export declare class AgenticRunner {
2749
2803
  */
2750
2804
  private _recordContextMemoryToolTransaction;
2751
2805
  private _sourceBodyProjectionScope;
2806
+ private _decisionObservationScope;
2807
+ private _decisionObservationState;
2808
+ private _sameTaskDecisionObservations;
2809
+ private _currentRecoveryObservation;
2752
2810
  /**
2753
2811
  * Materialize a successful result once so historical raw protocol messages
2754
2812
  * can be replaced by an accepted receipt without losing reopenability.
@@ -3275,6 +3333,8 @@ export declare class AgenticRunner {
3275
3333
  private _refreshClaimDiscoveryStateFromEvidence;
3276
3334
  private _completionArtifactHashes;
3277
3335
  private _shellVerificationFamily;
3336
+ /** Recover only a current, independently configured verifier before another model dispatch. */
3337
+ private _recoverLegacyVerification;
3278
3338
  private _currentVerificationEvidence;
3279
3339
  /** Select only evidence produced for this task and current workspace state. */
3280
3340
  private _selectCurrentVerification;
@@ -3647,21 +3707,8 @@ export declare class AgenticRunner {
3647
3707
  private _memoryHelperWantsConsolidation;
3648
3708
  private _maybeRunDynamicContextConsolidation;
3649
3709
  private _buildTurnContextFrame;
3650
- /**
3651
- * Feed the ContextTree one tool call, detect phase transitions, and — on a
3652
- * transition — capture the outgoing phase's message slice, contract inactive
3653
- * phases (LLM-summarized via makePhaseSummarizer, anchors retained), and
3654
- * archive the full message bodies to `.omnius/phases/<phase>-<id>-turnN.jsonl`,
3655
- * leaving only a pointer + high-signal summary in the working context. This is
3656
- * the core "offload large block → disk pointer + searchable signature"
3657
- * mechanism; `contextTree.expand(phase)` re-hydrates on demand.
3658
- *
3659
- * Wired into BOTH the primary loop and the brute-force loop. The brute-force
3660
- * path is the ACTIVE main-agent path on live 35B runs; omitting the feed here
3661
- * is why the context tree "never kicked off" — it rendered an empty phase
3662
- * status every turn while the raw history grew unbounded. Returns the
3663
- * transition (so the primary loop can reset per-phase tool budgets) or null.
3664
- */
3710
+ private _phaseVerificationPending;
3711
+ /** Record the phase proposal and archive an outgoing phase at its boundary. */
3665
3712
  private _advanceContextTreeOnToolCall;
3666
3713
  private makePhaseSummarizer;
3667
3714
  private _settleOptionalPhaseSummaries;
@@ -4237,7 +4284,7 @@ export declare class AgenticRunner {
4237
4284
  /**
4238
4285
  * Resume a paused task. The run loop continues from where it left off.
4239
4286
  */
4240
- resume(): InterruptionTransitionReceipt | null;
4287
+ resume(operatorRequested?: boolean): InterruptionTransitionReceipt | null;
4241
4288
  /** Whether the runner is currently paused */
4242
4289
  get isPaused(): boolean;
4243
4290
  /** Exact interruption state for CLI, daemon, and admin status surfaces. */
@@ -4781,6 +4828,7 @@ export declare class AgenticRunner {
4781
4828
  */
4782
4829
  private _buildRecentActionGroundTruth;
4783
4830
  private _nativeShellProgressIsCurrent;
4831
+ private _modelFacingVerifierCheck;
4784
4832
  private _nativeOperationProgressIsCurrent;
4785
4833
  private _nativeOperationRepetitions;
4786
4834
  private _equivalentNativeObservations;
@@ -0,0 +1,142 @@
1
+ import type { ChatMessage } from "./agenticRunner.js";
2
+ import { type TaskExecutionSnapshotV1 } from "./taskExecutionSnapshot.js";
3
+ export interface AppendOnlyReceiptCustody {
4
+ toolName: string;
5
+ artifactLocator: string;
6
+ argumentsSha256?: string;
7
+ members?: Array<{
8
+ transactionId: string;
9
+ toolName: string;
10
+ artifactLocator: string;
11
+ argumentsSha256: string;
12
+ }>;
13
+ }
14
+ /** A qualified source block and the exact native read result carrying its body. */
15
+ export interface AppendOnlyExactSourceCarrier {
16
+ sourceContent: string;
17
+ sourceBody: string;
18
+ message: ChatMessage;
19
+ }
20
+ /**
21
+ * Hybrid and recurrent models (Qwen3.x with linear-attention layers, SWA) cannot roll their state
22
+ * back to an arbitrary token. llama.cpp keeps a few checkpoints, saved near the end of each prompt,
23
+ * and re-processes the whole prompt when the new one diverges before the last checkpoint. The
24
+ * runner rebuilds its per-turn projections (the canonical task frame, passive chat history) at the
25
+ * tail of every request, so each turn diverged where the old frame began and every turn re-read
26
+ * 20-30k tokens. A live hosting run spent 190 of its 270 seconds re-reading prompts.
27
+ *
28
+ * This projection sends the previous request verbatim, then the turn's new history, then a compact
29
+ * factual snapshot of each changed projection. Nothing earlier changes, so the server resumes
30
+ * from its last checkpoint.
31
+ *
32
+ * The update is a host-labelled message in the conversation, not a system message. Some renderers
33
+ * (the local Ollama/llama.cpp chatml path among them) gather every system message into one block
34
+ * at the top of the prompt, so any added or changed system message, wherever it sits in the list,
35
+ * rewrites the top of the prompt and forces a full re-read. Measured live: an added system update
36
+ * cut the cache match from 27,279 to 24,510 tokens and cost a 23.7 s re-read; the same update in the
37
+ * conversation reused the whole previous prompt. When durable history was rewritten
38
+ * or the accumulated updates grow past a bound, the full fresh request is sent instead, which
39
+ * costs one cache miss and starts a new chain.
40
+ */
41
+ export declare const APPEND_ONLY_FRAME_UPDATE_MARKER = "[ACTIVE TASK FRAME UPDATE v1]";
42
+ export declare const APPEND_ONLY_OBSERVATION_SNAPSHOT_MARKER = "[HOST OBSERVATION SNAPSHOT v1]";
43
+ /** Prefix for a runtime system message added mid-run and sent in the conversation (see below). */
44
+ export declare const APPEND_ONLY_HOST_MESSAGE_MARKER = "[HOST RUNTIME MESSAGE v1: host-authored, not from the user]";
45
+ export interface AppendOnlyHostObservationMessage extends ChatMessage {
46
+ policyScope: "runtime";
47
+ runtimeOrigin: {
48
+ schema: "omnius.append-only-host-origin.v1";
49
+ producer: "append-only-outbound";
50
+ kind: "projection_snapshot" | "exact_source" | "runtime_message";
51
+ };
52
+ }
53
+ export declare function isIssuedRunObservationCarrier(message: ChatMessage, owner: string): boolean;
54
+ /** Only the runner's exact structured system frame can seed partial updates. */
55
+ export declare function issueRunObservationCarrier(message: ChatMessage, owner: string): ChatMessage;
56
+ export declare function isIssuedTaskExecutionSnapshotCarrier(message: ChatMessage): boolean;
57
+ export declare function issueTaskExecutionSnapshotCarrier(snapshot: TaskExecutionSnapshotV1, ownerSha256: string): ChatMessage;
58
+ /** Original producer identity only. JSON and marker text are not host issuance. */
59
+ export declare function readIssuedAppendOnlyHostObservation(value: unknown): Readonly<{
60
+ kind: AppendOnlyHostObservationMessage["runtimeOrigin"]["kind"];
61
+ content: string;
62
+ projections: readonly Readonly<ProjectionObservation>[];
63
+ }> | undefined;
64
+ interface ProjectionObservation {
65
+ marker: string;
66
+ label: string;
67
+ content: string | null;
68
+ }
69
+ /** How a per-turn projection is recognized: a system message that starts with its marker. */
70
+ export interface AppendOnlyProjectionKind {
71
+ marker: string;
72
+ label: string;
73
+ }
74
+ export interface AppendOnlyOutboundState {
75
+ key: string;
76
+ /** Exactly what the previous request sent. */
77
+ sent: ChatMessage[];
78
+ /** The previous request's durable history, without projections. */
79
+ base: ChatMessage[];
80
+ /** Latest full content of each projection kind, by marker. */
81
+ projections: Map<string, string>;
82
+ /** Immutable custody identities at the time this packet was built. */
83
+ acceptedReceipts?: ReadonlyMap<string, AppendOnlyReceiptCustody>;
84
+ /** Exact producer-selected source blocks, keyed by immutable range/revision identity. */
85
+ exactSources?: ReadonlyMap<string, string>;
86
+ /** Source blocks proved resident in this immutable sent prefix, including raw reads. */
87
+ residentExactSources?: ReadonlyMap<string, string>;
88
+ /** Characters of updates sent since the last full request. */
89
+ updateChars: number;
90
+ /** Historical frame-control churn only; exact source bodies are accounted separately. */
91
+ frameUpdateChars?: number;
92
+ frameUpdateCount?: number;
93
+ /** Exact issued baseline or most recent update present in sent. */
94
+ taskExecutionCarrier?: ChatMessage;
95
+ runObservationCarrier?: ChatMessage;
96
+ }
97
+ export interface AppendOnlyOutboundResult {
98
+ messages: ChatMessage[];
99
+ state: AppendOnlyOutboundState;
100
+ mode: "full" | "extended";
101
+ reason: string;
102
+ /** Observed control churn at a fresh-canonical rebase, before counters reset. */
103
+ rebase?: {
104
+ frameUpdateChars: number;
105
+ frameUpdateCount: number;
106
+ maxFrameUpdateChars: number;
107
+ maxFrameUpdates: number;
108
+ };
109
+ }
110
+ /** Accumulated update characters (~6k tokens) after which a fresh full request is cheaper and clearer. */
111
+ export declare const APPEND_ONLY_MAX_UPDATE_CHARS = 24000;
112
+ /** Separate from model capacity and evidence size: occasionally replace obsolete frame deltas. */
113
+ export declare const APPEND_ONLY_MAX_FRAME_UPDATE_CHARS = 24000;
114
+ export declare const APPEND_ONLY_MAX_FRAME_UPDATES = 8;
115
+ /** Line diff of `before` → `after` as compact hunks: "@@ after: <context>", then "-"/"+" lines. */
116
+ export declare function renderProjectionLineDiff(before: string, after: string): string;
117
+ /**
118
+ * Build this turn's outbound messages. `key` identifies the run; a different key, a rewritten
119
+ * history starts a new chain with the full request. Host projections may appear anywhere in
120
+ * the history: world-state regeneration and resumed Telegram observations are not always at
121
+ * the tail. Repeated messages of one kind form one ordered projection; none is discarded.
122
+ */
123
+ export declare function projectAppendOnlyOutbound(input: {
124
+ key: string;
125
+ messages: ChatMessage[];
126
+ previous?: AppendOnlyOutboundState;
127
+ kinds: readonly AppendOnlyProjectionKind[];
128
+ maxUpdateChars?: number;
129
+ maxFrameUpdateChars?: number;
130
+ maxFrameUpdates?: number;
131
+ /** Issued by the runner, never inferred from quoted/tool-authored receipt text. */
132
+ acceptedReceipts?: ReadonlyMap<string, AppendOnlyReceiptCustody>;
133
+ /** Producer-owned exact source blocks; quoted markers inside source cannot create these. */
134
+ exactSources?: ReadonlyMap<string, string>;
135
+ /** Independently qualified native read carriers, including sources omitted from the frame. */
136
+ exactSourceCarriers?: ReadonlyMap<string, AppendOnlyExactSourceCarrier>;
137
+ /** Current execution authority. Lookalike text or serialized copies cannot establish identity. */
138
+ taskExecutionOwner?: string;
139
+ /** Exact request-local runner-issued run observations. */
140
+ runObservationCarrier?: ChatMessage;
141
+ }): AppendOnlyOutboundResult;
142
+ export {};
@@ -10,11 +10,19 @@
10
10
  */
11
11
  import type { CompletionLedger, CompletionLedgerStatus } from "./completionLedger.js";
12
12
  import type { CompletionReadinessSnapshot } from "./completionReadiness.js";
13
+ import type { RoutineCodingCloseoutReceiptV1 } from "./routine-coding-admission.js";
13
14
  import type { ContextAdmissionReceipt } from "./context-admission.js";
14
15
  import type { TerminalTaskReport } from "./terminalTaskReport.js";
15
16
  import type { CompletionDeliveryReceipt, ExpectedOutcomeAssessmentV1, ExpectedOutcomeContractV1 } from "./expectedOutcomeContract.js";
16
17
  import type { ExternalEffectReceiptV1, NeedsInputContractV1, ObjectiveFrontierSnapshotV1, RunConvergenceStateV1, TaskObjectiveContractV1, VerificationReceiptV1 } from "./taskObjective.js";
17
18
  export type TerminalRunStatus = "completed" | "incomplete_verification" | "incomplete" | "awaiting_input";
19
+ declare const decisionStopReasons: readonly [
20
+ "output_limit_recovery_exhausted",
21
+ "no_progress_recovery_exhausted",
22
+ "no_action",
23
+ "turn_budget_exhausted"
24
+ ];
25
+ export type DecisionStopReason = typeof decisionStopReasons[number];
18
26
  /** Host runtime evidence, independent of model text or tool output. */
19
27
  interface TerminalRuntimeFailureScope {
20
28
  schema: "omnius.terminal-runtime-failure.v1";
@@ -121,6 +129,8 @@ export interface CompletionFinalizationRecord {
121
129
  };
122
130
  summary: string;
123
131
  runtimeFailure?: TerminalRuntimeFailure;
132
+ /** Why the host stopped making decisions. This grants no completion authority. */
133
+ decisionStopReason?: DecisionStopReason;
124
134
  /** User report frozen with the committed evidence snapshot; absent on legacy/prepared records. */
125
135
  terminalReport?: TerminalTaskReport;
126
136
  /** Exact immutable report-only evidence for a conversation; never a task authority ledger. */
@@ -137,6 +147,8 @@ export interface CompletionFinalizationRecord {
137
147
  objectiveLedgerPath?: string;
138
148
  /** Deterministic host authority used to accept or reject terminal success. */
139
149
  completionReadiness?: CompletionReadinessSnapshot;
150
+ /** Final current host proof for an exact standalone routine edit request. */
151
+ routineCodingCloseout?: RoutineCodingCloseoutReceiptV1;
140
152
  readinessHash?: string;
141
153
  boardHash?: string;
142
154
  workboardRevision?: string;
@@ -210,6 +222,7 @@ export declare function buildCompletionFinalizationRecord(input: {
210
222
  status: TerminalRunStatus;
211
223
  summary: string;
212
224
  runtimeFailure?: TerminalRuntimeFailure;
225
+ decisionStopReason?: DecisionStopReason;
213
226
  expectedOutcomeContract?: ExpectedOutcomeContractV1;
214
227
  expectedOutcomeAssessment?: ExpectedOutcomeAssessmentV1;
215
228
  taskObjectiveContract?: TaskObjectiveContractV1;
@@ -220,6 +233,7 @@ export declare function buildCompletionFinalizationRecord(input: {
220
233
  needsInput?: NeedsInputContractV1;
221
234
  objectiveLedgerPath?: string;
222
235
  completionReadiness?: CompletionReadinessSnapshot;
236
+ routineCodingCloseout?: RoutineCodingCloseoutReceiptV1;
223
237
  deliveryReceipts?: CompletionDeliveryReceipt[];
224
238
  ledger?: CompletionLedger | null;
225
239
  workboardPresent?: boolean;
@@ -43,6 +43,30 @@ export declare class ConvergenceProgressTracker {
43
43
  hasRecentProgress(turn: number, windowTurns: number): boolean;
44
44
  snapshot(turn: number): ConvergenceProgressSnapshot;
45
45
  }
46
+ export interface DecisionEvidence {
47
+ tool: string;
48
+ /** Stable identity of the executed operation and its returned evidence. */
49
+ identity?: string;
50
+ /** Current executor-owned call whose observation can explain this decision. */
51
+ observationCallId?: string;
52
+ noEffect: boolean;
53
+ material: boolean;
54
+ }
55
+ /** A proposal never reaches this tracker. Evidence can advance discovery or
56
+ * diagnosis without certifying completion. Only the current decision scope
57
+ * gets to reuse a finding or compare it to a previous execution. */
58
+ export declare class DecisionProgressTracker {
59
+ private scope?;
60
+ private turn;
61
+ private seen;
62
+ private advanced;
63
+ private repeated?;
64
+ observe(scope: string, turn: number, evidence: DecisionEvidence): void;
65
+ outcome(scope: string, turn: number): {
66
+ advanced: boolean;
67
+ repeated?: DecisionEvidence;
68
+ };
69
+ }
46
70
  export interface VerificationDiagnostic {
47
71
  id: string;
48
72
  file?: string;
@@ -1,5 +1,6 @@
1
1
  import { type CanonicalEvidenceReceiptInput, type CanonicalTaskFrameProjection } from "./canonical-context-projection.js";
2
2
  import type { NativeMemoryReadFacts } from "../execution/native-memory-operation-observation.js";
3
+ import type { DecisionObservationView } from "./observationLedger.js";
3
4
  export interface ModelFacingCanonicalMetadataProjection {
4
5
  content: string | null;
5
6
  audit: {
@@ -115,8 +116,45 @@ export interface ModelFacingChildCoverage {
115
116
  maxWorkers: number;
116
117
  omittedObservations: number;
117
118
  }
119
+ export interface ModelFacingVerifierCheck {
120
+ evidence: string;
121
+ command: string;
122
+ outcome: "exit_zero" | "nonzero_exit";
123
+ cwd?: string;
124
+ testedRevision?: string;
125
+ artifactHashes?: Array<{
126
+ path: string;
127
+ sha256: string;
128
+ }>;
129
+ outputRef?: string;
130
+ failureExcerpt?: string;
131
+ }
132
+ export interface ModelFacingCodingCheck {
133
+ action: "diagnose" | "alternate_action" | "bounded_review" | "verify_due";
134
+ finding?: {
135
+ observationEvidence: string;
136
+ artifact: string;
137
+ times: number;
138
+ };
139
+ changes?: Array<{
140
+ evidence: string;
141
+ paths: string[];
142
+ }>;
143
+ priorFailedCheck?: ModelFacingVerifierCheck;
144
+ postChangeChecks?: ModelFacingVerifierCheck[];
145
+ open: Array<{
146
+ id: string;
147
+ description: string;
148
+ }>;
149
+ covered: string[];
150
+ instruction: string;
151
+ remainingDecisionTurns?: number;
152
+ remainingWallMs?: number;
153
+ }
118
154
  /** Full exact accepted source, separate from changing execution observations. */
119
155
  export declare const MODEL_FACING_ACCEPTED_GOAL_MARKER = "[ACCEPTED NATIVE GOAL v1]";
156
+ export declare const MODEL_FACING_RUN_OBSERVATIONS_MARKER = "[RUN OBSERVATIONS v1]";
157
+ export declare const MODEL_FACING_RUN_OBSERVATION_FIELDS_MARKER = "[RUN OBSERVATION FIELD UPDATE v1]";
120
158
  export declare function renderModelFacingAcceptedGoal(acceptedGoal: string): string;
121
159
  /** Explicit producer fields only; no recursive key/text stripping of source data. */
122
160
  export declare function renderModelFacingRunObservations(input: {
@@ -127,6 +165,8 @@ export declare function renderModelFacingRunObservations(input: {
127
165
  }[];
128
166
  equivalentObservations?: readonly ModelFacingEquivalentObservationFacts[];
129
167
  operationRepetitions?: readonly ModelFacingOperationRepetitionFacts[];
168
+ decisionObservations?: DecisionObservationView | null;
169
+ codingCheck?: ModelFacingCodingCheck;
130
170
  operationObservationCoverage?: {
131
171
  window: string;
132
172
  qualifiedReturns: number;