omnius 1.0.965 → 1.0.967

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.
@@ -0,0 +1,125 @@
1
+ /**
2
+ * observationLedger.ts — durable "current observed state" for NON-file-read
3
+ * tool outputs, rendered into the ACTIVE CONTEXT FRAME every turn.
4
+ *
5
+ * Root cause this addresses (2026-07-11 MJPEG-probe loop + personaplex
6
+ * post-mortems): the EvidenceLedger fixed read-amnesia for file_read only.
7
+ * Every other observation channel — shell, web_fetch, list_directory,
8
+ * grep_search, find_files — lives solely in transcript tool messages, which
9
+ * compaction replaces with content-free stubs ("[retired_duplicate…]",
10
+ * "[compacted to save context…]"). The KNOWLEDGE block then advertises only
11
+ * the NAMES of prior calls ("Shell commands already executed: …"), never
12
+ * their outputs. From the model's view the raw observations are absent, so:
13
+ * - re-running the identical probe is rational (it cannot see the result),
14
+ * - it cannot notice the output never changes across repeats,
15
+ * - it reasons from its own prose paraphrase instead of ground truth.
16
+ * A live dump showed activeEvidenceChars: 0 against 13,000 control chars —
17
+ * the model was flying fully blind on tool reality.
18
+ *
19
+ * Same design as EvidenceLedger: latest output per distinct call fingerprint,
20
+ * regenerated into the frame each turn, so it survives compaction by
21
+ * construction. Additionally tracks identical-output repeat counts so the
22
+ * model SEES "run 6×, output unchanged" — making probe stagnation visible as
23
+ * state instead of relying on gates to punish it after the fact.
24
+ */
25
+ export interface ObservationEntry {
26
+ fingerprint: string;
27
+ tool: string;
28
+ /** Human-readable call label, e.g. `shell: python3 << 'EOF' …`. */
29
+ label: string;
30
+ /** Bounded output text (full when small, head/tail extract when large). */
31
+ output: string;
32
+ /** Chars of the original (unbounded) output. */
33
+ fullChars: number;
34
+ success: boolean;
35
+ lastTurn: number;
36
+ /** Total executions of this fingerprint observed this run. */
37
+ runs: number;
38
+ /** Consecutive executions with identical output and success state (>=1). */
39
+ identicalRuns: number;
40
+ /** Basis of outputHash; display text alone does not establish source equality. */
41
+ identityBasis: "semantic_outcome" | "display_text";
42
+ /** Digest of the complete supplied display text, before bounded rendering. */
43
+ displaySha256: string;
44
+ outputHash: string;
45
+ }
46
+ /** Host-retained source identity. This identifies evidence from an execution, not a verification receipt. */
47
+ export interface DecisionObservationReceipt {
48
+ scopeSha256: string;
49
+ stateSha256: string;
50
+ inputVersionSha256?: string;
51
+ operationScopeSha256?: string;
52
+ semanticOutcomeSha256?: string;
53
+ findingExcerpt?: string;
54
+ criterionIds: string[];
55
+ label: string;
56
+ }
57
+ export interface DecisionObservation extends DecisionObservationReceipt {
58
+ callId: string;
59
+ tool: string;
60
+ argumentsSha256: string;
61
+ artifactLocator: string;
62
+ evidenceId: string;
63
+ restored?: boolean;
64
+ }
65
+ export declare function readDecisionObservationReceipt(value: unknown): DecisionObservationReceipt | undefined;
66
+ export declare function readCheckpointDecisionObservation(value: unknown): DecisionObservation | undefined;
67
+ export interface DecisionObservationView {
68
+ guidance: string;
69
+ records: Array<{
70
+ call: string;
71
+ tool: string;
72
+ action: string;
73
+ result: "observed_success";
74
+ arguments_sha256: string;
75
+ artifact: string;
76
+ evidence: string;
77
+ observed_input_version?: string;
78
+ related_criteria?: string[];
79
+ unchangedSuccessfulRuns?: number;
80
+ findingExcerpt?: string;
81
+ state: "superseded_observation" | "restored_prior_observation" | "same_known_task_state" | "prior_task_state";
82
+ }>;
83
+ openCriteria?: readonly string[];
84
+ }
85
+ export declare function projectDecisionObservations(input: {
86
+ observations: readonly DecisionObservation[];
87
+ scopeSha256: string;
88
+ stateSha256: string;
89
+ openCriterionIds: readonly string[];
90
+ maxChars: number;
91
+ }): DecisionObservationView | null;
92
+ /**
93
+ * Action identity for a tool call: the tool plus its target (command, path,
94
+ * query, url). Payload arguments such as file contents are never included.
95
+ */
96
+ export declare function labelFor(tool: string, args: Record<string, unknown> | undefined): string;
97
+ export declare class ObservationLedger {
98
+ private entries;
99
+ record(input: {
100
+ tool: string;
101
+ args?: Record<string, unknown>;
102
+ fingerprint: string;
103
+ output: string;
104
+ success: boolean;
105
+ turn: number;
106
+ /** Host-derived identity of the full observation before display/archive projection. */
107
+ semanticOutcomeSha256?: string;
108
+ }): void;
109
+ /** Consecutive identical-output executions for a fingerprint (0 if unseen). */
110
+ identicalRunsFor(fingerprint: string): number;
111
+ /** Whether any recorded call fingerprint has at least two executions. */
112
+ hasRepeatedCalls(): boolean;
113
+ /** Tool outcomes for the tool-less reasoning pass, independent of transcript compaction. */
114
+ renderGroundingEvidence(): string | null;
115
+ size(): number;
116
+ clear(): void;
117
+ /**
118
+ * Compact factual presentation for the model. Internal identities, source
119
+ * lengths and turn accounting remain in the stored entries.
120
+ */
121
+ renderBlock(maxChars?: number, options?: {
122
+ compactReceipts?: boolean;
123
+ }): string | null;
124
+ private renderObservations;
125
+ }
@@ -8,6 +8,8 @@ export interface OwnedInferenceWaitOwnerV1 {
8
8
  operationId: string;
9
9
  }
10
10
  export type OwnedInferenceWaitState = "ambiguous" | "retained_queue" | "in_progress" | "completed" | "completed_unavailable" | "unresolved";
11
+ export declare const OWNED_INFERENCE_OBSERVATION_ROUTE_UNAVAILABLE = "original_observation_route_unavailable";
12
+ export declare const OWNED_FINAL_RESPONSE_CONFIRMED_UNAVAILABLE = "original_final_response_confirmed_unavailable";
11
13
  export interface OwnedInferenceWaitReceiptV1 {
12
14
  readonly schema: "omnius.owned-inference-wait.v1";
13
15
  readonly custodyRef: string;
@@ -26,6 +28,10 @@ export interface OwnedInferenceWaitReceiptV1 {
26
28
  readonly initialResponseBudgetMs: number;
27
29
  readonly brokerRequestId?: string;
28
30
  readonly retryAfterMs?: number;
31
+ readonly fetchInvocationCount?: number;
32
+ readonly relayScopeSha256?: string;
33
+ readonly preForwardProofSha256?: string;
34
+ readonly transportStage?: "prepared" | "fetch_invoked" | "pre_forward_refused" | "broker_acknowledged" | "semantic_progress" | "response_ready";
29
35
  }
30
36
  export interface OwnedInferenceWaitContext {
31
37
  owner: OwnedInferenceWaitOwnerV1;
@@ -65,9 +71,14 @@ export declare function readOwnedInferenceDispatchFailure(error: unknown): Owned
65
71
  export interface OwnedInferenceWaitObserveOptions {
66
72
  owner: OwnedInferenceWaitOwnerV1;
67
73
  signal?: AbortSignal;
74
+ /** Initial readiness interval for this body-free lookup. The host signal also bounds semantic idle and total time. */
68
75
  timeoutMs: number;
76
+ /** Exact response lookup for a verified closeout whose original wire request had no tools. */
77
+ finalDelivery?: boolean;
69
78
  assertCurrent?: () => void;
70
79
  onObservation?: (receipt: OwnedInferenceWaitReceiptV1) => void;
80
+ /** A native decoded semantic transition under the current original response's issued receipt. */
81
+ onSemanticProgress?: (receipt: OwnedInferenceWaitReceiptV1) => void;
71
82
  }
72
83
  interface Custody {
73
84
  schema: "omnius.owned-inference-custody.v1";
@@ -83,6 +94,7 @@ interface Custody {
83
94
  capturedAt: string;
84
95
  captureNonce: string;
85
96
  }
97
+ type TransportObservationFields = "fetchInvocationCount" | "relayScopeSha256" | "preForwardProofSha256";
86
98
  export declare const OWNED_INFERENCE_STORE_MAX_BYTES: number;
87
99
  export declare const OWNED_INFERENCE_STORE_MAX_CAPTURES = 2048;
88
100
  type OwnerEpoch = Omit<OwnedInferenceWaitOwnerV1, "operationId">;
@@ -154,7 +166,7 @@ export declare function inspectOwnedInferenceWait(receipt: OwnedInferenceWaitRec
154
166
  observation: OwnedInferenceWaitReceiptV1;
155
167
  stateDir: string;
156
168
  };
157
- export declare function observeOwnedInferenceWaitReceipt(receipt: OwnedInferenceWaitReceiptV1, observation: Pick<OwnedInferenceWaitReceiptV1, "state" | "reason"> & Partial<Pick<OwnedInferenceWaitReceiptV1, "semanticProgress" | "brokerRequestId" | "retryAfterMs">>): OwnedInferenceWaitReceiptV1;
169
+ export declare function observeOwnedInferenceWaitReceipt(receipt: OwnedInferenceWaitReceiptV1, observation: Pick<OwnedInferenceWaitReceiptV1, "state" | "reason"> & Partial<Pick<OwnedInferenceWaitReceiptV1, "semanticProgress" | "brokerRequestId" | "retryAfterMs" | TransportObservationFields>>): OwnedInferenceWaitReceiptV1;
158
170
  export declare function notifyOwnedInferenceWait(handler: OwnedInferenceWaitContext["onObservation"], receipt: OwnedInferenceWaitReceiptV1): void;
159
171
  /** Managed-port identity alone does not prove support for the body-free resume protocol. */
160
172
  export declare function supportsOwnedInferenceWaitProtocol(document: unknown, endpoint: string): boolean;
@@ -1,9 +1,17 @@
1
- import type { OwnedInferenceDispatchFailureV1, OwnedInferenceWaitOwnerV1 } from "./owned-inference-wait.js";
1
+ import type { OwnedInferenceDispatchFailureV1, OwnedInferenceWaitOwnerV1, OwnedInferenceWaitReceiptV1 } from "./owned-inference-wait.js";
2
2
  export interface OwnedModelBlocker {
3
3
  reason: string;
4
4
  dispatch: "confirmed_unsent" | "possibly_sent";
5
+ disposition: "confirmed_unsent" | "observe_original" | "unresolved";
5
6
  checkpointSaved: boolean;
6
7
  canResume: boolean;
8
+ phase?: "final_delivery_pending";
9
+ transportStage?: OwnedInferenceWaitReceiptV1["transportStage"];
10
+ }
11
+ export interface VerifiedFinalDelivery {
12
+ workspaceRevision: string;
13
+ evidenceKey: string;
14
+ testsRun: string[];
7
15
  }
8
16
  /** Host attempt custody. This is not a provider admission or observer grant. */
9
17
  export interface OwnedModelWaitCheckpointV1 {
@@ -25,11 +33,16 @@ export interface OwnedModelWaitCheckpointV1 {
25
33
  state: "pending" | "waiting" | "unsupported" | "unresolved" | "semantic_progress" | "response_received" | "blocked";
26
34
  reason: string;
27
35
  dispatchFailure?: OwnedInferenceDispatchFailureV1;
36
+ resumeDisposition?: OwnedModelBlocker["disposition"];
37
+ /** An explicit Resume can renew the original observation budget once. */
38
+ observationResumedAtMs?: number;
39
+ transportStage?: OwnedInferenceWaitReceiptV1["transportStage"];
28
40
  capacityRecoveryAttempted?: boolean;
29
41
  semanticProgress: boolean;
30
42
  retiredByInputId?: string;
31
43
  startedAtMs: number;
32
44
  observationBudgetMs: number;
45
+ finalDelivery?: VerifiedFinalDelivery;
33
46
  }
34
47
  export declare function isOwnedModelWaitCheckpointV1(value: unknown): value is OwnedModelWaitCheckpointV1;
35
48
  export declare function isMatchingOwnedModelDispatchFailure(record: OwnedModelWaitCheckpointV1, receipt: OwnedInferenceDispatchFailureV1): boolean;
@@ -0,0 +1,66 @@
1
+ import type { CompletionEvidence } from "./completionLedger.js";
2
+ import type { CommandEvidenceReceipt } from "../execution/types.js";
3
+ export interface RoutineCodingAdmissionV1 {
4
+ readonly schema: "omnius.routine-coding-admission.v1";
5
+ readonly sessionId: string;
6
+ readonly inputId: string;
7
+ readonly workspaceRoot: string;
8
+ readonly requestSha256: string;
9
+ readonly artifactPath: string;
10
+ readonly expectedSha256: string;
11
+ readonly initialSha256: string | null;
12
+ readonly protectedWorkspaceSha256: string;
13
+ readonly verifierCommand: string;
14
+ readonly verifierCwd: string;
15
+ readonly verifierExecutable: string;
16
+ }
17
+ /** Only the complete literal request language qualifies. Every other input uses semantic admission. */
18
+ export declare function admitRoutineCodingV1(input: {
19
+ text: string;
20
+ workspaceRoot: string;
21
+ sessionId: string;
22
+ inputId: string;
23
+ }): RoutineCodingAdmissionV1 | undefined;
24
+ export declare function isIssuedRoutineCodingAdmission(value: unknown): value is RoutineCodingAdmissionV1;
25
+ export declare function routineVerifierRevision(admission: RoutineCodingAdmissionV1): string | null;
26
+ export declare function routineCodingAdmissionMatches(admission: unknown, input: {
27
+ text: string;
28
+ workspaceRoot: string;
29
+ sessionId: string;
30
+ }): admission is RoutineCodingAdmissionV1;
31
+ export type RoutineCodingCloseout = {
32
+ ready: true;
33
+ summary: string;
34
+ receipt: RoutineCodingCloseoutReceiptV1;
35
+ } | {
36
+ ready: false;
37
+ reason: "missing_current_authority" | "workspace_changed" | "unauthorized_mutation" | "requested_bytes_missing" | "owned_write_missing" | "exact_current_verifier_missing";
38
+ };
39
+ export interface RoutineCodingCloseoutReceiptV1 {
40
+ schema: "omnius.routine-coding-closeout.v1";
41
+ runId: string;
42
+ taskEpoch: number;
43
+ ownerId: string;
44
+ inputId: string;
45
+ sessionId: string;
46
+ requestSha256: string;
47
+ workspaceRoot: string;
48
+ artifactPath: string;
49
+ expectedSha256: string;
50
+ verifierCommand: string;
51
+ verifierCwd: string;
52
+ verifierExecutable: string;
53
+ passedTests: number;
54
+ writeId: string;
55
+ verifierId: string;
56
+ testedRevision: string;
57
+ }
58
+ /** Physical proof only. Report an uncovered obligation without treating model output as execution evidence. */
59
+ export declare function evaluateRoutineCodingCloseout(input: {
60
+ admission: RoutineCodingAdmissionV1;
61
+ runId: string;
62
+ taskEpoch: number;
63
+ ownerId: string;
64
+ evidence: readonly CompletionEvidence[];
65
+ originalVerifier(entry: CompletionEvidence): CommandEvidenceReceipt | undefined;
66
+ }): RoutineCodingCloseout;
@@ -43,6 +43,16 @@ export interface SuccessfulProcedureDeliveryFile extends SuccessfulProcedureFile
43
43
  /** Exact operation payload hash, including the actual rendered chunk. */
44
44
  expectedTextSha256: string;
45
45
  }
46
+ export interface SuccessfulProcedureNativeVerification {
47
+ schema: "omnius.successful-procedure-native-verification.v1";
48
+ scope: UserTaskNoteScope;
49
+ runId: string;
50
+ taskEpoch: number;
51
+ terminalSha256: string;
52
+ effectStateSha256: string;
53
+ deliverySha256: string[];
54
+ artifacts: SuccessfulProcedureFile[];
55
+ }
46
56
  export interface HistoricalProcedureContextV1 {
47
57
  schema: "omnius.procedure-history-context.v1";
48
58
  runtimeFingerprint?: string;
@@ -85,6 +95,9 @@ export interface SuccessfulProcedureInput {
85
95
  execution: TaskExecutionSnapshotV1;
86
96
  /** All final chunks of this current requested result, selected by its host owner. */
87
97
  records: SuccessfulProcedureDeliveryFile[];
98
+ } | {
99
+ nativeVerification: SuccessfulProcedureFile;
100
+ records: SuccessfulProcedureDeliveryFile[];
88
101
  };
89
102
  };
90
103
  /** Reassert current native/runner/provider ownership; never supplied by a model. */
@@ -158,6 +171,7 @@ export declare class SuccessfulProcedureMemory {
158
171
  assertCurrent: () => void;
159
172
  /** Request projection can inspect existing lexical cases without inference or access writes. */
160
173
  lexicalOnly?: boolean;
174
+ maxCases?: 1 | 2;
161
175
  }): Promise<{
162
176
  text: string;
163
177
  caseIds: string[];
@@ -64,4 +64,65 @@ export declare function projectTaskWorkPlanProposal(input: {
64
64
  evidenceIds: readonly string[];
65
65
  evidence?: readonly CompletionEvidence[];
66
66
  }): TaskWorkPlanV1 | null;
67
+ export declare const TASK_EXECUTION_SNAPSHOT_MARKER = "CURRENT TASK EXECUTION SNAPSHOT";
68
+ export declare const TASK_EXECUTION_UPDATE_MARKER = "[TASK EXECUTION UPDATE v1]";
69
+ export declare function taskExecutionProviderView(snapshot: TaskExecutionSnapshotV1, ownerSha256: string): {
70
+ runId: string;
71
+ taskEpoch: number;
72
+ ownerSha256: string;
73
+ snapshotSha256: string;
74
+ contractSha256: string;
75
+ contractRevision: number;
76
+ requirementSetSha256: string | null;
77
+ evidenceSnapshotSha256: string;
78
+ planRevision: number | null;
79
+ selectedWork: {
80
+ id: string;
81
+ purpose: string;
82
+ requirementIds?: string[];
83
+ criterionIds: string[];
84
+ sourceRefs: string[];
85
+ pendingOperationRef?: string;
86
+ } | null;
87
+ requirements: {
88
+ id: string;
89
+ kind: "delivery" | "content" | "transformation" | "constraint" | "state_change";
90
+ statement: string;
91
+ criterionIds: string[];
92
+ }[];
93
+ criteria: {
94
+ id: string;
95
+ mode: import("./taskObjective.js").ObjectiveCriterionModeV1 | undefined;
96
+ requiredEvidenceKinds: import("./taskObjective.js").ObjectiveEvidenceKindV1[];
97
+ satisfied: boolean;
98
+ }[];
99
+ workPlan: {
100
+ id: string;
101
+ requirementIds: string[] | undefined;
102
+ criterionIds: string[];
103
+ dependsOn: string[];
104
+ purpose: string;
105
+ attemptState: "proposed" | "selected" | "running" | "checkpointed" | "settled";
106
+ outcomeEvidenceIds: string[];
107
+ readiness: import("./taskWorkPlan.js").TaskWorkReadinessV1 | undefined;
108
+ checkpoint: import("./taskWorkPlan.js").TaskWorkCheckpointV1 | undefined;
109
+ readinessProof: import("./taskWorkPlan.js").TaskWorkReadinessProofV1 | undefined;
110
+ progressProof: import("./taskWorkPlan.js").TaskWorkProgressProofV1 | undefined;
111
+ pendingOperationRef: string | undefined;
112
+ }[];
113
+ selectedWorkOutcomes: {
114
+ sourceRef?: string | undefined;
115
+ id: string;
116
+ kind: import("./completionLedger.js").CompletionEvidenceKind;
117
+ success: boolean | undefined;
118
+ role: import("./completionLedger.js").CompletionEvidenceRole | undefined;
119
+ criterionIds: string[] | undefined;
120
+ objectiveEvidenceKinds: import("./taskObjective.js").ObjectiveEvidenceKindV1[] | undefined;
121
+ workOperation: import("./taskWorkPlan.js").TaskWorkOperationBindingV1 | undefined;
122
+ }[];
123
+ pendingLegacyOperationRefs: string[];
124
+ };
125
+ export type TaskExecutionProviderView = ReturnType<typeof taskExecutionProviderView>;
126
+ /** A current host view advances one already-transmitted execution view. */
127
+ export declare function renderTaskExecutionUpdate(before: TaskExecutionProviderView, after: TaskExecutionProviderView): string | undefined;
67
128
  export declare function renderTaskExecutionSnapshot(snapshot: TaskExecutionSnapshotV1): string;
@@ -11,6 +11,29 @@ export interface TaskRequirementBasisV1 {
11
11
  };
12
12
  interpretation: "explicit" | "semantic_necessity";
13
13
  }
14
+ export type TaskNativeCheckV1 = {
15
+ kind: "preservation";
16
+ path: string;
17
+ mode: "unchanged" | "untouched";
18
+ evidenceRef: string;
19
+ quote: string;
20
+ } | {
21
+ kind: "focused_verification";
22
+ implementationPath: string;
23
+ evidenceRef: string;
24
+ quote: string;
25
+ suiteCommand: string;
26
+ suiteQuote: string;
27
+ } | {
28
+ kind: "ordered_verification";
29
+ phase: "red" | "green" | "suite";
30
+ command: string;
31
+ implementationPath: string;
32
+ evidenceRef: string;
33
+ quote: string;
34
+ commandQuote: string;
35
+ implementationQuote: string;
36
+ };
14
37
  export interface TaskRequirementV1 {
15
38
  id: string;
16
39
  kind: "content" | "transformation" | "constraint" | "state_change" | "delivery";
@@ -20,6 +43,7 @@ export interface TaskRequirementV1 {
20
43
  requiredEffects: ExpectedOutcomeRequiredEffectV1[];
21
44
  /** Explicit reviewed acceptance method. Omission retains legacy execution verification. */
22
45
  verificationMethod?: "source_review" | "execution";
46
+ nativeCheck?: TaskNativeCheckV1;
23
47
  }
24
48
  export interface TaskRequirementSetV1 {
25
49
  schema: typeof TASK_REQUIREMENT_SET_SCHEMA;
@@ -43,6 +67,8 @@ export interface TaskEffectProvenanceV1 {
43
67
  nativeScopeSha256: string;
44
68
  nativeEvidenceSnapshotSha256: string;
45
69
  }
70
+ export declare function isTaskNativePath(value: unknown): value is string;
71
+ export declare function taskNativeQuoteContains(quote: string, literal: string): boolean;
46
72
  export declare function normalizeTaskRequirementSetV1(value: unknown): TaskRequirementSetV1 | null;
47
73
  export declare function digestTaskRequirementSetV1(value: TaskRequirementSetV1): string;
48
74
  /** Compatibility name for host adapters using the design's SHA spelling. */
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/index.js
3
- size: 42787331 bytes
4
- sha256: 438bf4a61162a86d9637d896d62dd1bef7df1cd5a70b4e3ca32fb58c98159b03
3
+ size: 43008270 bytes
4
+ sha256: 87d83292967d618eeb79f567755cb583a2aeab2101cdd18b2f7076a90e91a33d