omnius 1.0.923 → 1.0.925
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/{providerRegistry.d.ts → _types/backend-vllm/providerRegistry.d.ts} +0 -1
- package/dist/_types/backend-vllm/types.d.ts +209 -0
- package/dist/_types/execution/av/media-capability.d.ts +94 -0
- package/dist/_types/execution/delegation-contract.d.ts +102 -0
- package/dist/_types/execution/evidence.d.ts +68 -0
- package/dist/_types/execution/html-source-evidence.d.ts +65 -0
- package/dist/_types/execution/mcp/types.d.ts +169 -0
- package/dist/_types/execution/mutation-contract.d.ts +102 -0
- package/dist/_types/execution/nol/artifacts.d.ts +39 -0
- package/dist/_types/execution/nol/checkpoint-edits.d.ts +98 -0
- package/dist/_types/execution/nol/distributions.d.ts +128 -0
- package/dist/_types/execution/nol/gguf-checkpoint-edits.d.ts +194 -0
- package/dist/_types/execution/nol/gguf-control-reader.d.ts +224 -0
- package/dist/_types/execution/nol/lora-exports.d.ts +129 -0
- package/dist/_types/execution/nol/neuronary.d.ts +212 -0
- package/dist/_types/execution/nol/pytorch-control-reader.d.ts +143 -0
- package/dist/_types/execution/nol/qwen35-head-sites.d.ts +61 -0
- package/dist/_types/execution/nol/worker-assets.d.ts +82 -0
- package/dist/_types/execution/nol/worker-protocol.d.ts +94 -0
- package/dist/_types/execution/page-content-source.d.ts +40 -0
- package/dist/_types/execution/rapid-computer-use/artifact-store.d.ts +21 -0
- package/dist/_types/execution/rapid-computer-use/contracts.d.ts +320 -0
- package/dist/_types/execution/rapid-computer-use/decision.d.ts +70 -0
- package/dist/_types/execution/rapid-computer-use/desktop-verification.d.ts +23 -0
- package/dist/_types/execution/rapid-computer-use/geometry.d.ts +57 -0
- package/dist/_types/execution/rapid-computer-use/planner.d.ts +78 -0
- package/dist/_types/execution/rapid-computer-use/trace.d.ts +80 -0
- package/dist/_types/execution/rapid-computer-use/visual.d.ts +48 -0
- package/dist/_types/execution/shell-runs.d.ts +78 -0
- package/dist/_types/execution/streamed-web-source.d.ts +64 -0
- package/dist/_types/execution/tools/browser-page-fallback.d.ts +25 -0
- package/dist/_types/execution/tools/network-egress-policy.d.ts +30 -0
- package/dist/_types/execution/tools/pdf-native-tables.d.ts +46 -0
- package/dist/_types/execution/tools/todo-store.d.ts +133 -0
- package/dist/_types/execution/tools/web-fetch.d.ts +57 -0
- package/dist/_types/execution/tools/workboard.d.ts +1223 -0
- package/dist/_types/execution/types.d.ts +549 -0
- package/dist/_types/execution/web-source.d.ts +14 -0
- package/dist/_types/memory/artifactReviewSourceIndex.d.ts +133 -0
- package/dist/_types/memory/contextMemoryLedger.d.ts +213 -0
- package/dist/_types/memory/db.d.ts +12 -0
- package/dist/_types/memory/embeddings.d.ts +36 -0
- package/dist/_types/memory/immutableEvidenceStore.d.ts +165 -0
- package/dist/_types/memory/memoryIngestion.d.ts +65 -0
- package/dist/_types/memory/memoryTypes.d.ts +312 -0
- package/dist/_types/memory/sourceCorpusStore.d.ts +331 -0
- package/dist/_types/memory/structuredMemoryStore.d.ts +105 -0
- package/dist/_types/memory/unifiedMemoryStore.d.ts +127 -0
- package/dist/_types/memory/virtualMemory.d.ts +187 -0
- package/dist/_types/orchestrator/agentic-page-content-receipt.d.ts +20 -0
- package/dist/_types/orchestrator/agentic-web-fetch-receipt.d.ts +20 -0
- package/dist/_types/orchestrator/agenticRunner.d.ts +5219 -0
- package/dist/_types/orchestrator/app-state.d.ts +171 -0
- package/dist/_types/orchestrator/artifactClaimCritic.d.ts +63 -0
- package/dist/_types/orchestrator/artifactQuality.d.ts +15 -0
- package/dist/_types/orchestrator/artifactSemanticIntegrity.d.ts +203 -0
- package/dist/_types/orchestrator/canonical-context-projection.d.ts +254 -0
- package/dist/_types/orchestrator/canonical-source-body-projection.d.ts +51 -0
- package/dist/_types/orchestrator/completion-review-pending.d.ts +24 -0
- package/dist/_types/orchestrator/completionContract.d.ts +103 -0
- package/dist/_types/orchestrator/completionFinalization.d.ts +224 -0
- package/dist/_types/orchestrator/completionLedger.d.ts +429 -0
- package/dist/_types/orchestrator/completionReadiness.d.ts +234 -0
- package/dist/_types/orchestrator/context-admission.d.ts +93 -0
- package/dist/_types/orchestrator/context-dump-retention.d.ts +25 -0
- package/dist/_types/orchestrator/context-fabric.d.ts +133 -0
- package/dist/_types/orchestrator/contextEngine.d.ts +68 -0
- package/dist/_types/orchestrator/contextWindowDump.d.ts +327 -0
- package/dist/_types/orchestrator/convergence-breaker.d.ts +225 -0
- package/dist/_types/orchestrator/convergence-progress.d.ts +66 -0
- package/dist/_types/orchestrator/deliveryCoverage.d.ts +181 -0
- package/dist/_types/orchestrator/document-persistence-goal-binding.d.ts +106 -0
- package/dist/_types/orchestrator/durable-document-worker.d.ts +85 -0
- package/dist/_types/orchestrator/evidenceBranch.d.ts +291 -0
- package/dist/_types/orchestrator/expected-inference-response.d.ts +55 -0
- package/dist/_types/orchestrator/expectedOutcomeContract.d.ts +58 -0
- package/dist/_types/orchestrator/failure-taxonomy.d.ts +36 -0
- package/dist/_types/orchestrator/focusSupervisor.d.ts +436 -0
- package/dist/_types/orchestrator/forced-update-requirement-recovery.d.ts +105 -0
- package/dist/_types/orchestrator/hooks.d.ts +100 -0
- package/dist/_types/orchestrator/inference-pressure.d.ts +61 -0
- package/dist/_types/orchestrator/integrationClosure.d.ts +89 -0
- package/dist/_types/orchestrator/interruption-lifecycle.d.ts +154 -0
- package/dist/_types/orchestrator/live-memory-passages.d.ts +51 -0
- package/dist/_types/orchestrator/liveVirtualContext.d.ts +84 -0
- package/dist/_types/orchestrator/memory-compiler.d.ts +254 -0
- package/dist/_types/orchestrator/memory-consolidation.d.ts +134 -0
- package/dist/_types/orchestrator/model-router.d.ts +17 -0
- package/dist/_types/orchestrator/modelResponseDiagnostics.d.ts +71 -0
- package/dist/_types/orchestrator/nativeRequirementAmendment.d.ts +63 -0
- package/dist/_types/orchestrator/nol/coordinator.d.ts +204 -0
- package/dist/_types/orchestrator/nol/datasets.d.ts +58 -0
- package/dist/_types/orchestrator/nol/discovery.d.ts +286 -0
- package/dist/_types/orchestrator/nol/evaluation.d.ts +59 -0
- package/dist/_types/orchestrator/nol/model-validation.d.ts +198 -0
- package/dist/_types/orchestrator/nol/statistics.d.ts +142 -0
- package/dist/_types/orchestrator/nol/store.d.ts +133 -0
- package/dist/_types/orchestrator/nol/variant-registry.d.ts +292 -0
- package/dist/_types/orchestrator/ollama-context-policy.d.ts +34 -0
- package/dist/_types/orchestrator/personality.d.ts +66 -0
- package/dist/_types/orchestrator/prompt-cache.d.ts +24 -0
- package/dist/_types/orchestrator/remote-inference-fallback.d.ts +224 -0
- package/dist/_types/orchestrator/remote-inference-policy.d.ts +58 -0
- package/dist/_types/orchestrator/request-budget.d.ts +75 -0
- package/dist/_types/orchestrator/requirementCoverage.d.ts +69 -0
- package/dist/_types/orchestrator/reviewedInterpretation.d.ts +111 -0
- package/dist/_types/orchestrator/runEvents.d.ts +115 -0
- package/dist/_types/orchestrator/runtime-rollout.d.ts +63 -0
- package/dist/_types/orchestrator/semanticVerification.d.ts +135 -0
- package/dist/_types/orchestrator/source-wide-extraction.d.ts +202 -0
- package/dist/_types/orchestrator/steeringIntake.d.ts +123 -0
- package/dist/_types/orchestrator/structured-memory-extraction-worker.d.ts +89 -0
- package/dist/_types/orchestrator/structuredMemoryInference.d.ts +62 -0
- package/dist/_types/orchestrator/successful-procedure-memory.d.ts +127 -0
- package/dist/_types/orchestrator/supportedAnswer.d.ts +68 -0
- package/dist/_types/orchestrator/taskEffectEvidence.d.ts +38 -0
- package/dist/_types/orchestrator/taskExecutionSnapshot.d.ts +67 -0
- package/dist/_types/orchestrator/taskObjective.d.ts +310 -0
- package/dist/_types/orchestrator/taskObjectiveContinuation.d.ts +134 -0
- package/dist/_types/orchestrator/taskRequirementReview.d.ts +246 -0
- package/dist/_types/orchestrator/taskRequirements.d.ts +80 -0
- package/dist/_types/orchestrator/taskSemanticAdmission.d.ts +159 -0
- package/dist/_types/orchestrator/taskWorkDelegation.d.ts +147 -0
- package/dist/_types/orchestrator/taskWorkPlan.d.ts +177 -0
- package/dist/_types/orchestrator/telegram-passive-history.d.ts +42 -0
- package/dist/_types/orchestrator/terminalTaskReport.d.ts +91 -0
- package/dist/_types/orchestrator/todoObservability.d.ts +147 -0
- package/dist/_types/orchestrator/tool-exposure-policy.d.ts +100 -0
- package/dist/_types/orchestrator/trajectory-checkpoint.d.ts +159 -0
- package/dist/_types/orchestrator/types.d.ts +185 -0
- package/dist/_types/schemas/dispatch.d.ts +53 -0
- package/dist/_types/schemas/feature-workflow.d.ts +362 -0
- package/dist/_types/schemas/messages.d.ts +15 -0
- package/dist/_types/schemas/nol-assets.d.ts +955 -0
- package/dist/_types/schemas/nol-json.d.ts +2 -0
- package/dist/_types/schemas/nol.d.ts +3995 -0
- package/dist/_types/schemas/patch.d.ts +47 -0
- package/dist/_types/schemas/plan.d.ts +47 -0
- package/dist/_types/schemas/repoProfile.d.ts +116 -0
- package/dist/_types/schemas/retrieval.d.ts +44 -0
- package/dist/_types/schemas/task.d.ts +57 -0
- package/dist/_types/schemas/tools.d.ts +16 -0
- package/dist/_types/schemas/verification.d.ts +31 -0
- package/dist/api/py-embed.js +3353 -1829
- package/dist/assets/nol-checkpoint-editor.py +701 -0
- package/dist/assets/nol-gguf-checkpoint-editor.py +785 -0
- package/dist/assets/nol-gguf-control-reader.py +428 -0
- package/dist/assets/nol-gne-tools-worker.py +425 -0
- package/dist/assets/nol-gne-worker.py +1081 -0
- package/dist/assets/nol-lora-exporter.py +349 -0
- package/dist/assets/nol-pytorch-control-reader.py +470 -0
- package/dist/assets/nol-transformers-nnsight-worker.py +512 -0
- package/dist/assets/nol-transformers-peft-validation-worker.py +385 -0
- package/dist/assets/nol-transformers-peft-worker.py +488 -0
- package/dist/assets/nol-transformers-research-worker.py +472 -0
- package/dist/assets/nol-transformers-worker.py +920 -0
- package/dist/assets/nol-vllm-owned-worker.py +803 -0
- package/dist/assets/nol-vllm-runtime.py +695 -0
- package/dist/assets/nol-vllm-tokenizer.py +93 -0
- package/dist/assets/nol-vllm-worker.py +201 -0
- package/dist/computer-use/configured-planner.d.ts +37 -0
- package/dist/computer-use/configured-point.d.ts +35 -0
- package/dist/computer-use/host-session.d.ts +60 -0
- package/dist/computer-use/runner-ui-port.d.ts +37 -0
- package/dist/computer-use/session-review.d.ts +14 -0
- package/dist/computer-use/task-spec.d.ts +84 -0
- package/dist/discovery.d.ts +16 -2
- package/dist/index.js +2 -2
- package/dist/library.d.ts +94 -10
- package/dist/library.js +144003 -87414
- package/dist/memory-maintenance-worker.js +1676 -511
- package/dist/nol/cpu-control-reader-profile.d.ts +93 -0
- package/dist/nol/cpu-control-reader-service.d.ts +87 -0
- package/dist/nol/cuda-lease.d.ts +111 -0
- package/dist/nol/cuda-mutations.d.ts +34 -0
- package/dist/nol/export-runtime-config.d.ts +114 -0
- package/dist/nol/export-service.d.ts +143 -0
- package/dist/nol/facade.d.ts +147 -0
- package/dist/nol/gguf-cpu-control-reader-profile.d.ts +106 -0
- package/dist/nol/gguf-cpu-control-reader-service.d.ts +91 -0
- package/dist/nol/gguf-model-control-verifier.d.ts +120 -0
- package/dist/nol/gguf-parameter-inventory.d.ts +28 -0
- package/dist/nol/gne-adapter.d.ts +134 -0
- package/dist/nol/gne-agent-evaluation.d.ts +84 -0
- package/dist/nol/gne-profile.d.ts +124 -0
- package/dist/nol/gne-tools-profile.d.ts +148 -0
- package/dist/nol/gne-tools-transport.d.ts +194 -0
- package/dist/nol/model-actions.d.ts +662 -0
- package/dist/nol/model-control-verifier.d.ts +135 -0
- package/dist/nol/model-json-scorer.d.ts +13 -0
- package/dist/nol/model-runtime-config.d.ts +830 -0
- package/dist/nol/model-serving.d.ts +130 -0
- package/dist/nol/model-subject-adapter.d.ts +72 -0
- package/dist/nol/model-validation-factory.d.ts +113 -0
- package/dist/nol/neuronary-catalog.d.ts +130 -0
- package/dist/nol/orphan-custody.d.ts +72 -0
- package/dist/nol/peft-conformance.d.ts +48 -0
- package/dist/nol/peft-control-types.d.ts +137 -0
- package/dist/nol/peft-control-verifier.d.ts +8 -0
- package/dist/nol/peft-model-actions.d.ts +41 -0
- package/dist/nol/peft-model-authority.d.ts +146 -0
- package/dist/nol/peft-model-controls.d.ts +20 -0
- package/dist/nol/peft-model-host.d.ts +47 -0
- package/dist/nol/peft-model-profile.d.ts +161 -0
- package/dist/nol/peft-model-runtime-config.d.ts +174 -0
- package/dist/nol/peft-model-subject-adapter.d.ts +36 -0
- package/dist/nol/peft-validation.d.ts +105 -0
- package/dist/nol/persistent-parameter-inventory.d.ts +32 -0
- package/dist/nol/runtime.d.ts +100 -0
- package/dist/nol/sqlite-store.d.ts +80 -0
- package/dist/nol/transformers-adapter.d.ts +119 -0
- package/dist/nol/transformers-nnsight.d.ts +87 -0
- package/dist/nol/transformers-peft.d.ts +107 -0
- package/dist/nol/transformers-research.d.ts +114 -0
- package/dist/nol/variant-service.d.ts +143 -0
- package/dist/nol/variant-store.d.ts +51 -0
- package/dist/nol/vllm-actions.d.ts +774 -0
- package/dist/nol/vllm-adapter.d.ts +1473 -0
- package/dist/nol/vllm-authority.d.ts +55 -0
- package/dist/nol/vllm-conformance.d.ts +662 -0
- package/dist/nol/vllm-profile.d.ts +850 -0
- package/dist/nol/vllm-protocol.d.ts +1505 -0
- package/dist/nol/vllm-runtime-config.d.ts +120 -0
- package/dist/nol/vllm-runtime.d.ts +34 -0
- package/dist/nol/vllm-startup.d.ts +235 -0
- package/dist/omni-setup-worker.js +3433 -1909
- package/dist/service-version.d.ts +0 -1
- package/dist/tui/async-process.d.ts +27 -0
- package/dist/tui/native/worker.js +3 -1
- package/dist/tui/telegram-action-session-registry.d.ts +136 -0
- package/dist/tui/telegram-cognition-queue.d.ts +154 -0
- package/dist/tui/telegram-context-packet-v2.d.ts +99 -0
- package/dist/tui/telegram-input-ownership.d.ts +78 -0
- package/dist/tui/telegram-turn-contract-v2.d.ts +62 -0
- package/dist/update-worker-runtime.js +4216 -2603
- package/docs/DISCOVERY.json +389 -0
- package/docs/DISCOVERY.md +4 -0
- package/npm-shrinkwrap.json +28 -12
- package/package.json +3 -2
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { type VerificationDiagnostics, type VerificationDiagnosticDelta } from "./convergence-progress.js";
|
|
2
|
+
/**
|
|
3
|
+
* Convergence Circuit-Breaker (WO-3)
|
|
4
|
+
* ==================================
|
|
5
|
+
*
|
|
6
|
+
* The focusSupervisor escalates a repeated failure family to `forced_replan`
|
|
7
|
+
* at count >= 2 — but then never escalates further, no matter how many times
|
|
8
|
+
* the same family repeats, and its counters are session-local. In the
|
|
9
|
+
* `myactuator` post-mortem the same `pio run` failure family repeated dozens of
|
|
10
|
+
* times across FIVE sessions; each resumed session re-earned the count from
|
|
11
|
+
* zero and the loop never terminated (15,342 duplicate-call dedup events, 0
|
|
12
|
+
* successful builds).
|
|
13
|
+
*
|
|
14
|
+
* This module adds the missing *convergence cliff*. The self-correction
|
|
15
|
+
* literature is consistent and blunt:
|
|
16
|
+
* - Rounds 1-2 capture ~75% of all reachable improvement
|
|
17
|
+
* (Yang et al., EMNLP 2025, arXiv:2510.07290).
|
|
18
|
+
* - 96.5% of refinement sequences resolve in <= 3 iterations.
|
|
19
|
+
* - Skill-evolution loops plateau by round 5 (EvoSkills, arXiv:2604.01687).
|
|
20
|
+
* - Autonomous test-repair has a hard practical ceiling (arXiv:2605.01471).
|
|
21
|
+
*
|
|
22
|
+
* Implication: a trajectory that has not converged in ~3 rounds essentially
|
|
23
|
+
* never will on that trajectory. The remedy is a *different* trajectory
|
|
24
|
+
* (regenerate the incoherent layer / re-plan / escalate), not more iterations.
|
|
25
|
+
*
|
|
26
|
+
* The breaker is a pure decision component. It observes the same failure-family
|
|
27
|
+
* key the focusSupervisor already computes, adds a cross-session carry, decays
|
|
28
|
+
* the count when productive mutations land (progress resets the cliff), and
|
|
29
|
+
* returns a tiered verdict. Wiring is additive and optional: when no breaker is
|
|
30
|
+
* injected, the focusSupervisor behaves exactly as before.
|
|
31
|
+
*/
|
|
32
|
+
/** Tier of the convergence verdict, ascending in severity. */
|
|
33
|
+
export type ConvergenceTier = "healthy" | "converging_warn" | "stalled" | "abandon";
|
|
34
|
+
/** Recovery the harness should steer toward for a given tier. */
|
|
35
|
+
export type ConvergenceAction = "continue" | "replan" | "regenerate_incoherent_layer" | "decompose_and_delegate" | "creative_pivot_or_research";
|
|
36
|
+
/** A single failure observation, keyed by the focusSupervisor family key. */
|
|
37
|
+
export interface ConvergenceObservation {
|
|
38
|
+
diagnostics?: VerificationDiagnostics;
|
|
39
|
+
/** Failure-family key (same key focusSupervisor computes). */
|
|
40
|
+
family: string;
|
|
41
|
+
/** Repeat count within the *current* session for this family (>= 1). */
|
|
42
|
+
sessionCount: number;
|
|
43
|
+
/** Current turn number, for telemetry. */
|
|
44
|
+
turn: number;
|
|
45
|
+
/** Short human-readable sample of the failure. */
|
|
46
|
+
sample?: string;
|
|
47
|
+
/** Coarse error class (e.g. "stale_ambiguous_target", "exit_code_1"). */
|
|
48
|
+
errorClass?: string;
|
|
49
|
+
/**
|
|
50
|
+
* True if a productive mutation landed since this family last failed. Used as
|
|
51
|
+
* a FALLBACK progress signal only when `failureSignal` is not available.
|
|
52
|
+
*/
|
|
53
|
+
mutatedSinceLast?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A numeric verification signal for this failure — lower is better (e.g. the
|
|
56
|
+
* count of compiler errors / failing tests in the action's output). When
|
|
57
|
+
* supplied it is the AUTHORITATIVE progress measure: the cliff decays only
|
|
58
|
+
* when this signal *drops* across repetitions. This implements the
|
|
59
|
+
* coherence-collapse / compiler-feedback finding that progress is a reduction
|
|
60
|
+
* in the verification signal, not merely that an edit occurred — so a futile
|
|
61
|
+
* edit loop (editing without reducing errors) is no longer treated as
|
|
62
|
+
* "advancing" and will correctly escalate. Generic: the caller extracts it
|
|
63
|
+
* from the action's own output; no tool-specific logic here.
|
|
64
|
+
*/
|
|
65
|
+
failureSignal?: number;
|
|
66
|
+
/**
|
|
67
|
+
* True when this family is a VERIFICATION / build-feedback action — a
|
|
68
|
+
* non-mutating command (build / compile / test runner) whose output is a
|
|
69
|
+
* diagnostic artifact set, not a failing action to abandon.
|
|
70
|
+
*
|
|
71
|
+
* The operator's principle: a build command (`pio run`, `npm build`, `cargo
|
|
72
|
+
* test`, `tsc`, `pytest`, …) is the verification ORACLE. You are SUPPOSED to
|
|
73
|
+
* run it after every fix; its repetition is expected, and each run emits
|
|
74
|
+
* diagnostics that should DECOMPOSE into investigate → fix → test loops.
|
|
75
|
+
* Treating repeated builds as a "dead trajectory" and abandoning them (as the
|
|
76
|
+
* live `myactuator` run did at rounds=6 on `pio run` → report_incomplete)
|
|
77
|
+
* mistakes the measurement instrument for the failure.
|
|
78
|
+
*
|
|
79
|
+
* When set, the breaker NEVER escalates this family to terminal `abandon`.
|
|
80
|
+
* A stuck build (diagnostic set not shrinking) instead escalates to
|
|
81
|
+
* `decompose_and_delegate` — parse the diagnostics, isolate the top
|
|
82
|
+
* implicated unit, delegate it to a sub-agent, then re-run to test. Progress
|
|
83
|
+
* (a dropping `failureSignal`) still resets the cliff as usual.
|
|
84
|
+
*/
|
|
85
|
+
isVerificationFeedback?: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface ConvergenceVerdict {
|
|
88
|
+
diagnosticDelta?: VerificationDiagnosticDelta;
|
|
89
|
+
tier: ConvergenceTier;
|
|
90
|
+
/** tier is "stalled" or "abandon". */
|
|
91
|
+
tripped: boolean;
|
|
92
|
+
/** session rounds + cross-session carry for this family. */
|
|
93
|
+
totalRounds: number;
|
|
94
|
+
family: string;
|
|
95
|
+
reason: string;
|
|
96
|
+
recommendedAction: ConvergenceAction;
|
|
97
|
+
}
|
|
98
|
+
/** Persisted per-family carry, so a resumed session inherits the cliff. */
|
|
99
|
+
export interface ConvergenceCarry {
|
|
100
|
+
family: string;
|
|
101
|
+
rounds: number;
|
|
102
|
+
lastSample?: string;
|
|
103
|
+
updatedAtMs: number;
|
|
104
|
+
diagnostics?: VerificationDiagnostics;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Cross-session persistence port. The default is in-memory; the agenticRunner
|
|
108
|
+
* can supply a JSON-file implementation writing to
|
|
109
|
+
* `.omnius/convergence-ledger.json` (matching the error-patterns.json /
|
|
110
|
+
* resolution-memory.json convention).
|
|
111
|
+
*/
|
|
112
|
+
export interface ConvergenceStore {
|
|
113
|
+
load(family: string): ConvergenceCarry | null;
|
|
114
|
+
save(entry: ConvergenceCarry): void;
|
|
115
|
+
}
|
|
116
|
+
export declare class InMemoryConvergenceStore implements ConvergenceStore {
|
|
117
|
+
private map;
|
|
118
|
+
load(family: string): ConvergenceCarry | null;
|
|
119
|
+
save(entry: ConvergenceCarry): void;
|
|
120
|
+
/** Test/telemetry helper. */
|
|
121
|
+
entries(): ConvergenceCarry[];
|
|
122
|
+
}
|
|
123
|
+
export interface ConvergenceBreakerOptions {
|
|
124
|
+
/**
|
|
125
|
+
* Rounds at which we start warning the trajectory is not converging.
|
|
126
|
+
* Default 2 (rounds 1-2 already captured most reachable improvement).
|
|
127
|
+
*/
|
|
128
|
+
warnRound?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Rounds at which the trajectory is stalled — stop patching, regenerate the
|
|
131
|
+
* incoherent layer. Default 3 (>96% of successful sequences finish by here).
|
|
132
|
+
*/
|
|
133
|
+
stallRound?: number;
|
|
134
|
+
/**
|
|
135
|
+
* Rounds at which we abandon this trajectory and force a terminal/report
|
|
136
|
+
* escalation. Default 5 (all studied loops plateau by round 5).
|
|
137
|
+
*/
|
|
138
|
+
abandonRound?: number;
|
|
139
|
+
/** Cross-session persistence. Defaults to in-memory. */
|
|
140
|
+
store?: ConvergenceStore;
|
|
141
|
+
}
|
|
142
|
+
export interface ConvergenceSnapshot {
|
|
143
|
+
families: Array<{
|
|
144
|
+
family: string;
|
|
145
|
+
totalRounds: number;
|
|
146
|
+
tier: ConvergenceTier;
|
|
147
|
+
}>;
|
|
148
|
+
}
|
|
149
|
+
/** Exact continuation state, carried inside the existing task-scoped pause checkpoint. */
|
|
150
|
+
export interface ConvergenceBreakerCheckpoint {
|
|
151
|
+
schema: "omnius.convergence-breaker-checkpoint.v1";
|
|
152
|
+
policy: {
|
|
153
|
+
warnRound: number;
|
|
154
|
+
stallRound: number;
|
|
155
|
+
abandonRound: number;
|
|
156
|
+
};
|
|
157
|
+
live: Array<[
|
|
158
|
+
string,
|
|
159
|
+
{
|
|
160
|
+
totalRounds: number;
|
|
161
|
+
tier: ConvergenceTier;
|
|
162
|
+
}
|
|
163
|
+
]>;
|
|
164
|
+
baseline: Array<[
|
|
165
|
+
string,
|
|
166
|
+
number
|
|
167
|
+
]>;
|
|
168
|
+
decay: Array<[
|
|
169
|
+
string,
|
|
170
|
+
number
|
|
171
|
+
]>;
|
|
172
|
+
lastSignal: Array<[
|
|
173
|
+
string,
|
|
174
|
+
number
|
|
175
|
+
]>;
|
|
176
|
+
lastDiagnostics: Array<[
|
|
177
|
+
string,
|
|
178
|
+
VerificationDiagnostics
|
|
179
|
+
]>;
|
|
180
|
+
diagnosticRounds: Array<[
|
|
181
|
+
string,
|
|
182
|
+
number
|
|
183
|
+
]>;
|
|
184
|
+
lastCounts: Array<[
|
|
185
|
+
string,
|
|
186
|
+
number
|
|
187
|
+
]>;
|
|
188
|
+
}
|
|
189
|
+
export declare function isConvergenceBreakerCheckpoint(value: unknown): value is ConvergenceBreakerCheckpoint;
|
|
190
|
+
export declare class ConvergenceBreaker {
|
|
191
|
+
private readonly warnRound;
|
|
192
|
+
private readonly stallRound;
|
|
193
|
+
private readonly abandonRound;
|
|
194
|
+
private readonly store;
|
|
195
|
+
/** Live per-family total (session + carry) for snapshotting. */
|
|
196
|
+
private live;
|
|
197
|
+
/**
|
|
198
|
+
* Prior-session rounds, captured from the store exactly once per family the
|
|
199
|
+
* first time it is seen this session. Never re-read mid-session, so the
|
|
200
|
+
* breaker's own persisted writes are not double-counted back into the total.
|
|
201
|
+
*/
|
|
202
|
+
private baseline;
|
|
203
|
+
/** Progress decay accumulated this session (one per productive mutation). */
|
|
204
|
+
private decay;
|
|
205
|
+
/** Last verification signal (error count) seen per family, for delta-based progress. */
|
|
206
|
+
private lastSignal;
|
|
207
|
+
private lastDiagnostics;
|
|
208
|
+
private diagnosticRounds;
|
|
209
|
+
private lastCounts;
|
|
210
|
+
constructor(options?: ConvergenceBreakerOptions);
|
|
211
|
+
/**
|
|
212
|
+
* Observe a failure and return the convergence verdict. Idempotent per
|
|
213
|
+
* (family, sessionCount): callers pass the focusSupervisor's monotonically
|
|
214
|
+
* increasing session count, so re-observing the same count does not
|
|
215
|
+
* double-advance the cliff.
|
|
216
|
+
*/
|
|
217
|
+
observe(obs: ConvergenceObservation): ConvergenceVerdict;
|
|
218
|
+
/** Clear a family's carry when its underlying work is verified/complete. */
|
|
219
|
+
resolve(family: string): void;
|
|
220
|
+
snapshot(): ConvergenceSnapshot;
|
|
221
|
+
checkpoint(): ConvergenceBreakerCheckpoint;
|
|
222
|
+
restoreCheckpoint(value: unknown): boolean;
|
|
223
|
+
private tierFor;
|
|
224
|
+
private verdict;
|
|
225
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task convergence uses typed state changes, not output novelty. A new read,
|
|
3
|
+
* search result, error string, or runtime-authored refusal can add evidence,
|
|
4
|
+
* but it cannot by itself prove that the task frontier advanced.
|
|
5
|
+
*/
|
|
6
|
+
export type AuthoritativeProgressKind = "mutation" | "todo_transition" | "workboard_transition" | "verifier_receipt" | "delivery_receipt";
|
|
7
|
+
export interface AuthoritativeProgressInput {
|
|
8
|
+
toolName: string;
|
|
9
|
+
fingerprint: string;
|
|
10
|
+
success: boolean;
|
|
11
|
+
noop?: boolean;
|
|
12
|
+
runtimeAuthored?: boolean;
|
|
13
|
+
confirmedMutation?: boolean;
|
|
14
|
+
todoTransition?: boolean;
|
|
15
|
+
workboardTransition?: boolean;
|
|
16
|
+
assertiveVerifier?: boolean;
|
|
17
|
+
deliveryReceipt?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface AuthoritativeProgressSignal {
|
|
20
|
+
kind: AuthoritativeProgressKind;
|
|
21
|
+
fingerprint: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function classifyAuthoritativeProgress(input: AuthoritativeProgressInput): AuthoritativeProgressSignal | null;
|
|
24
|
+
export interface ConvergenceProgressSnapshot {
|
|
25
|
+
count: number;
|
|
26
|
+
lastProgressTurn: number;
|
|
27
|
+
turnsSinceProgress: number;
|
|
28
|
+
reviewLatched: boolean;
|
|
29
|
+
lastKind?: AuthoritativeProgressKind;
|
|
30
|
+
}
|
|
31
|
+
export declare class ConvergenceProgressTracker {
|
|
32
|
+
private readonly fingerprints;
|
|
33
|
+
private progressCount;
|
|
34
|
+
private lastProgressTurn;
|
|
35
|
+
private lastKind;
|
|
36
|
+
private reviewLatched;
|
|
37
|
+
record(turn: number, signal: AuthoritativeProgressSignal | null): boolean;
|
|
38
|
+
shouldLatchReview(input: {
|
|
39
|
+
turn: number;
|
|
40
|
+
openLeafCount: number;
|
|
41
|
+
thresholdTurns: number;
|
|
42
|
+
}): boolean;
|
|
43
|
+
hasRecentProgress(turn: number, windowTurns: number): boolean;
|
|
44
|
+
snapshot(turn: number): ConvergenceProgressSnapshot;
|
|
45
|
+
}
|
|
46
|
+
export interface VerificationDiagnostic {
|
|
47
|
+
id: string;
|
|
48
|
+
file?: string;
|
|
49
|
+
code?: string;
|
|
50
|
+
message: string;
|
|
51
|
+
}
|
|
52
|
+
export interface VerificationDiagnostics {
|
|
53
|
+
diagnostics: VerificationDiagnostic[];
|
|
54
|
+
fingerprint: string;
|
|
55
|
+
/** Exact tested source identities, supplied by the host rather than parsed prose. */
|
|
56
|
+
sourceVersions?: Readonly<Record<string, string>>;
|
|
57
|
+
}
|
|
58
|
+
export interface VerificationDiagnosticDelta {
|
|
59
|
+
added: string[];
|
|
60
|
+
removed: string[];
|
|
61
|
+
persisting: string[];
|
|
62
|
+
sameTestedSources?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Parse actual diagnostics; a generic exit status is never a diagnostic set. */
|
|
65
|
+
export declare function extractVerificationDiagnostics(text: string, sourceVersions?: Readonly<Record<string, string>>): VerificationDiagnostics | undefined;
|
|
66
|
+
export declare function compareVerificationDiagnostics(previous: VerificationDiagnostics, current: VerificationDiagnostics): VerificationDiagnosticDelta;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema-backed product/delivery claims.
|
|
3
|
+
*
|
|
4
|
+
* This is deliberately workspace supplied: Omnius must not infer a motor
|
|
5
|
+
* protocol, product catalog, or physical capability from filenames. A task
|
|
6
|
+
* may declare a delivery surface in `.omnius/delivery-coverage.json`; the
|
|
7
|
+
* runner then makes its gaps visible and prevents an absent contract from
|
|
8
|
+
* becoming an invented implementation claim.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
import type { CommandEvidenceReceipt } from "../execution/types.js";
|
|
12
|
+
export declare const deliveryRealityStates: readonly [
|
|
13
|
+
"simulation_only",
|
|
14
|
+
"hardware_integrated",
|
|
15
|
+
"hardware_verified",
|
|
16
|
+
"blocked"
|
|
17
|
+
];
|
|
18
|
+
export type DeliverableRealityState = (typeof deliveryRealityStates)[number];
|
|
19
|
+
export declare const acceptanceLayers: readonly [
|
|
20
|
+
"golden_frame",
|
|
21
|
+
"serial_noise",
|
|
22
|
+
"browser_transport",
|
|
23
|
+
"can_fragmentation",
|
|
24
|
+
"platformio",
|
|
25
|
+
"hardware_in_loop",
|
|
26
|
+
"documentation"
|
|
27
|
+
];
|
|
28
|
+
export type AcceptanceLayer = (typeof acceptanceLayers)[number];
|
|
29
|
+
export declare const deliveryCoverageManifestSchema: z.ZodObject<{
|
|
30
|
+
schemaVersion: z.ZodUnion<readonly [
|
|
31
|
+
z.ZodLiteral<1>,
|
|
32
|
+
z.ZodLiteral<2>
|
|
33
|
+
]>;
|
|
34
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
kind: z.ZodEnum<{
|
|
37
|
+
local_contract: "local_contract";
|
|
38
|
+
official_vendor: "official_vendor";
|
|
39
|
+
third_party: "third_party";
|
|
40
|
+
generated: "generated";
|
|
41
|
+
}>;
|
|
42
|
+
pathOrUrl: z.ZodString;
|
|
43
|
+
revision: z.ZodOptional<z.ZodString>;
|
|
44
|
+
hash: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
contracts: z.ZodArray<z.ZodObject<{
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
productSeries: z.ZodString;
|
|
49
|
+
sourceId: z.ZodString;
|
|
50
|
+
declaredCommands: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
51
|
+
declaredParameters: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
52
|
+
declaredModelFormats: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
53
|
+
}, z.core.$strip>>;
|
|
54
|
+
acceptance: z.ZodArray<z.ZodObject<{
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
layer: z.ZodEnum<{
|
|
57
|
+
golden_frame: "golden_frame";
|
|
58
|
+
serial_noise: "serial_noise";
|
|
59
|
+
browser_transport: "browser_transport";
|
|
60
|
+
can_fragmentation: "can_fragmentation";
|
|
61
|
+
platformio: "platformio";
|
|
62
|
+
hardware_in_loop: "hardware_in_loop";
|
|
63
|
+
documentation: "documentation";
|
|
64
|
+
}>;
|
|
65
|
+
requiredFor: z.ZodArray<z.ZodEnum<{
|
|
66
|
+
blocked: "blocked";
|
|
67
|
+
simulation_only: "simulation_only";
|
|
68
|
+
hardware_integrated: "hardware_integrated";
|
|
69
|
+
hardware_verified: "hardware_verified";
|
|
70
|
+
}>>;
|
|
71
|
+
verificationCommands: z.ZodArray<z.ZodString>;
|
|
72
|
+
safetyInterlock: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
inspections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
boundary: z.ZodString;
|
|
77
|
+
targetPaths: z.ZodArray<z.ZodString>;
|
|
78
|
+
proves: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
80
|
+
contradictionChecks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
question: z.ZodString;
|
|
83
|
+
inspectionIds: z.ZodArray<z.ZodString>;
|
|
84
|
+
}, z.core.$strip>>>;
|
|
85
|
+
claims: z.ZodArray<z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
subjects: z.ZodArray<z.ZodObject<{
|
|
88
|
+
productSeries: z.ZodString;
|
|
89
|
+
commands: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
90
|
+
parameters: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
91
|
+
modelFormats: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
92
|
+
}, z.core.$strip>>;
|
|
93
|
+
state: z.ZodEnum<{
|
|
94
|
+
blocked: "blocked";
|
|
95
|
+
simulation_only: "simulation_only";
|
|
96
|
+
hardware_integrated: "hardware_integrated";
|
|
97
|
+
hardware_verified: "hardware_verified";
|
|
98
|
+
}>;
|
|
99
|
+
contractId: z.ZodOptional<z.ZodString>;
|
|
100
|
+
sourceIds: z.ZodArray<z.ZodString>;
|
|
101
|
+
evidenceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
102
|
+
requiredAcceptanceIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
103
|
+
requiredInspectionIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
104
|
+
requiredContradictionCheckIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
105
|
+
blockedReason: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type DeliveryCoverageManifest = z.infer<typeof deliveryCoverageManifestSchema>;
|
|
109
|
+
export type DeliveryCoverageManifestInspection = {
|
|
110
|
+
status: "absent";
|
|
111
|
+
path: string;
|
|
112
|
+
} | {
|
|
113
|
+
status: "invalid";
|
|
114
|
+
path: string;
|
|
115
|
+
error: string;
|
|
116
|
+
} | {
|
|
117
|
+
status: "valid";
|
|
118
|
+
path: string;
|
|
119
|
+
manifest: DeliveryCoverageManifest;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Runtime-only upgrade for legacy manifests. The authored v1 JSON is never
|
|
123
|
+
* rewritten and product surfaces are never inferred. We retain every declared
|
|
124
|
+
* product/command/source value, add only topology-derived source inspections,
|
|
125
|
+
* and make those inspections mandatory for the already-declared non-blocked
|
|
126
|
+
* claims. With no safe candidate, the V2 evaluator reports the missing
|
|
127
|
+
* inspection contract instead of pretending an upgrade succeeded.
|
|
128
|
+
*/
|
|
129
|
+
export interface DeliveryCoverageGap {
|
|
130
|
+
claimId: string;
|
|
131
|
+
code: "duplicate_id" | "unknown_source" | "unknown_contract" | "missing_contract_provenance" | "missing_contract" | "contract_series_mismatch" | "undeclared_command" | "undeclared_parameter" | "undeclared_model_format" | "missing_acceptance" | "missing_acceptance_receipt" | "missing_evidence" | "missing_hil_interlock" | "blocked_reason_required" | "wildcard_coverage" | "missing_inspection_contract" | "unknown_inspection" | "missing_inspection" | "stale_inspection" | "unknown_contradiction_check" | "missing_contradiction_check";
|
|
132
|
+
detail: string;
|
|
133
|
+
}
|
|
134
|
+
export interface DeliveryCoverageEvaluation {
|
|
135
|
+
manifestHash: string;
|
|
136
|
+
gaps: DeliveryCoverageGap[];
|
|
137
|
+
/** Claims that may be represented honestly at their declared state. */
|
|
138
|
+
claimStates: Array<{
|
|
139
|
+
id: string;
|
|
140
|
+
state: DeliverableRealityState;
|
|
141
|
+
/** State may be stated only when all source/test/contract evidence holds. */
|
|
142
|
+
attainedState: DeliverableRealityState | "unproven";
|
|
143
|
+
evidenceIds: string[];
|
|
144
|
+
missingAcceptanceIds: string[];
|
|
145
|
+
missingInspectionIds: string[];
|
|
146
|
+
missingContradictionCheckIds: string[];
|
|
147
|
+
}>;
|
|
148
|
+
completionReady: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface DeliveryCoverageEvidence {
|
|
151
|
+
id: string;
|
|
152
|
+
success?: boolean;
|
|
153
|
+
receipt?: Pick<CommandEvidenceReceipt, "canonicalCommand" | "exitCode" | "timedOut" | "cancelled" | "finishedAtIso" | "artifactHashes">;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Typed projection of an EvidenceLedger file read. It has no free-text
|
|
157
|
+
* evidence path: only a fresh, full, content-hashed read can satisfy a source
|
|
158
|
+
* inspection. This prevents grep/list/output narration from passing a
|
|
159
|
+
* capability boundary.
|
|
160
|
+
*/
|
|
161
|
+
export interface DeliverySourceObservation {
|
|
162
|
+
path: string;
|
|
163
|
+
contentHash?: string;
|
|
164
|
+
fidelity: "full" | "extract" | "partial";
|
|
165
|
+
stale?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export declare function evaluateDeliveryCoverage(manifest: DeliveryCoverageManifest, availableEvidenceIds?: Iterable<string | DeliveryCoverageEvidence>, sourceObservations?: Iterable<DeliverySourceObservation>): DeliveryCoverageEvaluation;
|
|
168
|
+
/**
|
|
169
|
+
* Inspect the optional authored delivery contract without collapsing an absent
|
|
170
|
+
* file and an invalid file into the same state. Absence is opt-out; once a
|
|
171
|
+
* workspace authors the file, malformed JSON or schema violations are an
|
|
172
|
+
* authoritative invalid contract and must remain visible to terminal gates.
|
|
173
|
+
*/
|
|
174
|
+
export declare function inspectDeliveryCoverageManifest(workspace: string): DeliveryCoverageManifestInspection;
|
|
175
|
+
/** Backward-compatible valid-only loader for callers that do not gate completion. */
|
|
176
|
+
export declare function loadDeliveryCoverageManifest(workspace: string): {
|
|
177
|
+
manifest: DeliveryCoverageManifest;
|
|
178
|
+
path: string;
|
|
179
|
+
} | null;
|
|
180
|
+
/** Compact, non-imperative state for a model request. */
|
|
181
|
+
export declare function renderDeliveryCoverageState(evaluation: DeliveryCoverageEvaluation, sourcePath: string): string;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { CompletionEvidence } from "./completionLedger.js";
|
|
2
|
+
import type { TaskObjectiveContractV1, TaskObjectiveCriterionV1, VerificationReceiptV1, ObjectiveCriterionStateV1 } from "./taskObjective.js";
|
|
3
|
+
import { type TaskRequirementReviewResult } from "./taskRequirementReview.js";
|
|
4
|
+
import { type TaskWorkPlanV1 } from "./taskWorkPlan.js";
|
|
5
|
+
import { type RequirementCoverageBindingV1 } from "./requirementCoverage.js";
|
|
6
|
+
import type { TaskNativeExecutionScopeV1 } from "./reviewedInterpretation.js";
|
|
7
|
+
export declare const DOCUMENT_PERSISTENCE_GOAL_METHOD: "document_persistence_goal_review";
|
|
8
|
+
export interface DocumentPersistenceGoalOwnerV1 {
|
|
9
|
+
scopeId: string;
|
|
10
|
+
taskId: string;
|
|
11
|
+
inputId: string;
|
|
12
|
+
originalInputId: string;
|
|
13
|
+
actorKey: string;
|
|
14
|
+
}
|
|
15
|
+
export interface DocumentPersistenceReviewEvidenceV1 {
|
|
16
|
+
schema: "omnius.document-persistence-review-evidence.v1";
|
|
17
|
+
owner: DocumentPersistenceGoalOwnerV1;
|
|
18
|
+
runId: string;
|
|
19
|
+
taskEpoch: number;
|
|
20
|
+
objectiveRef: string;
|
|
21
|
+
objectiveHash: string;
|
|
22
|
+
objectiveRevision: number;
|
|
23
|
+
requirementSetSha256: string;
|
|
24
|
+
nativeScopeSha256: string;
|
|
25
|
+
nativeEvidenceSnapshotSha256: string;
|
|
26
|
+
evidenceSnapshotSha256: string;
|
|
27
|
+
obligations: Array<{
|
|
28
|
+
requirementId: string;
|
|
29
|
+
expectedSourceCriterionIds: string[];
|
|
30
|
+
unitDefinitionSha256s: string[];
|
|
31
|
+
}>;
|
|
32
|
+
effects: Array<{
|
|
33
|
+
evidenceId: string;
|
|
34
|
+
source: {
|
|
35
|
+
sourceId: string;
|
|
36
|
+
sourceRef: string;
|
|
37
|
+
criterionId: string;
|
|
38
|
+
sourceSha256: string;
|
|
39
|
+
mediaKind: string;
|
|
40
|
+
};
|
|
41
|
+
unitId: string;
|
|
42
|
+
unitDefinitionSha256: string;
|
|
43
|
+
proofSha256: string;
|
|
44
|
+
bodySha256: string;
|
|
45
|
+
claimId: string;
|
|
46
|
+
effectKind: "durable_source_evidence_commit";
|
|
47
|
+
}>;
|
|
48
|
+
stateSha256: string;
|
|
49
|
+
}
|
|
50
|
+
export interface DocumentPersistenceGoalBindingV1 {
|
|
51
|
+
schema: "omnius.document-persistence-goal-binding.v1";
|
|
52
|
+
owner: DocumentPersistenceGoalOwnerV1;
|
|
53
|
+
runId: string;
|
|
54
|
+
coverageCriterionId: string;
|
|
55
|
+
coverage: RequirementCoverageBindingV1;
|
|
56
|
+
inventorySha256: string;
|
|
57
|
+
reviewInputSha256: string;
|
|
58
|
+
reviewSha256: string;
|
|
59
|
+
review: TaskRequirementReviewResult;
|
|
60
|
+
/** Exact host-issued custom authority; never arbitrary reviewer prose. */
|
|
61
|
+
reviewAuthority?: unknown;
|
|
62
|
+
checks: Array<{
|
|
63
|
+
requirementId: string;
|
|
64
|
+
supportingEffectEvidenceIds: string[];
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
/** The caller MUST reopen each physical proof through isCurrent. The source
|
|
68
|
+
* population is the reviewed plan's complete assignments, never the first
|
|
69
|
+
* successful grant or everything that happens to be in a memory store. */
|
|
70
|
+
export declare function createDocumentPersistenceReviewEvidenceV1(input: {
|
|
71
|
+
runId: string;
|
|
72
|
+
contract: TaskObjectiveContractV1;
|
|
73
|
+
workPlan: TaskWorkPlanV1 | null;
|
|
74
|
+
nativeScope: TaskNativeExecutionScopeV1;
|
|
75
|
+
evidence: readonly CompletionEvidence[];
|
|
76
|
+
evidenceSnapshotSha256: string;
|
|
77
|
+
isCurrent(entry: CompletionEvidence): boolean;
|
|
78
|
+
}): DocumentPersistenceReviewEvidenceV1 | undefined;
|
|
79
|
+
export declare function normalizeDocumentPersistenceReviewEvidenceV1(value: unknown): DocumentPersistenceReviewEvidenceV1 | null;
|
|
80
|
+
/** Complete declared source set, exact unit assignment, and no borrowed effect. */
|
|
81
|
+
export declare function documentPersistenceSupportsRequirement(inventory: DocumentPersistenceReviewEvidenceV1, requirementId: string, ids: readonly string[]): boolean;
|
|
82
|
+
export declare function normalizeDocumentPersistenceGoalBindingV1(value: unknown): DocumentPersistenceGoalBindingV1 | null;
|
|
83
|
+
export declare function documentPersistenceGoalArtifactIdentity(criterionId: string, binding: DocumentPersistenceGoalBindingV1): {
|
|
84
|
+
artifactEvidenceId: string;
|
|
85
|
+
artifactRevision: string;
|
|
86
|
+
};
|
|
87
|
+
/** A semantic link to existing physically reopened commits. This is NOT a
|
|
88
|
+
* new applied-effect receipt, source observation, or generic verification pass. */
|
|
89
|
+
export declare function createDocumentPersistenceGoalReceiptV1(input: {
|
|
90
|
+
contract: TaskObjectiveContractV1;
|
|
91
|
+
runId: string;
|
|
92
|
+
coverageReview: VerificationReceiptV1;
|
|
93
|
+
review: TaskRequirementReviewResult;
|
|
94
|
+
documentPersistenceEvidence: DocumentPersistenceReviewEvidenceV1;
|
|
95
|
+
evidenceId: string;
|
|
96
|
+
reviewAuthority?: unknown;
|
|
97
|
+
}): VerificationReceiptV1 | undefined;
|
|
98
|
+
export declare function projectDocumentPersistenceGoalCriterionState(input: {
|
|
99
|
+
runId: string;
|
|
100
|
+
contract: TaskObjectiveContractV1;
|
|
101
|
+
criterion: TaskObjectiveCriterionV1;
|
|
102
|
+
state: ObjectiveCriterionStateV1;
|
|
103
|
+
verifications: readonly VerificationReceiptV1[];
|
|
104
|
+
documentPersistenceEvidence?: DocumentPersistenceReviewEvidenceV1;
|
|
105
|
+
evidenceSnapshotSha256?: string;
|
|
106
|
+
}): ObjectiveCriterionStateV1;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ArtifactReviewSourceIndex, ArtifactReviewSourceIndexEntry } from "../memory/artifactReviewSourceIndex.js";
|
|
2
|
+
import type { SourceCorpusStore, SourceCorpusWorkClaim } from "../memory/sourceCorpusStore.js";
|
|
3
|
+
import type { TaskExecutionSnapshotV1 } from "./taskExecutionSnapshot.js";
|
|
4
|
+
import type { TaskNativeExecutionScopeV1 } from "./reviewedInterpretation.js";
|
|
5
|
+
import { type TaskDocumentSourceV1, type TaskDocumentWorkerResultV1, type TaskWorkDelegationParentV1, type TaskWorkDelegationReceiptV1, type TaskWorkDelegationV1 } from "./taskWorkDelegation.js";
|
|
6
|
+
export interface DurableDocumentWorkerOptions {
|
|
7
|
+
workspaceRoot: string;
|
|
8
|
+
grant: TaskWorkDelegationV1;
|
|
9
|
+
corpus: SourceCorpusStore;
|
|
10
|
+
index: ArtifactReviewSourceIndex;
|
|
11
|
+
readParent(): TaskWorkDelegationParentV1;
|
|
12
|
+
/** Host ceiling from the serving backend; each actual request retains its
|
|
13
|
+
* ordinary backend admission/capacity contract and queueing. */
|
|
14
|
+
maxConcurrency: number;
|
|
15
|
+
leaseMs?: number;
|
|
16
|
+
runWorker(input: {
|
|
17
|
+
grant: TaskWorkDelegationV1;
|
|
18
|
+
source: TaskDocumentSourceV1;
|
|
19
|
+
claim: SourceCorpusWorkClaim;
|
|
20
|
+
workerSessionId: string;
|
|
21
|
+
signal: AbortSignal;
|
|
22
|
+
}): Promise<TaskDocumentWorkerResultV1>;
|
|
23
|
+
/** Reopen actual immutable raw/document/chunk/archive/native tool proof.
|
|
24
|
+
* Index metadata or model output alone must never pass this boundary. */
|
|
25
|
+
verifyWorkerSource(input: {
|
|
26
|
+
grant: TaskWorkDelegationV1;
|
|
27
|
+
source: TaskDocumentSourceV1;
|
|
28
|
+
result: TaskDocumentWorkerResultV1;
|
|
29
|
+
entry: ArtifactReviewSourceIndexEntry;
|
|
30
|
+
signal: AbortSignal;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
/** Idempotent parent ledger merge after durable claim/source transaction.
|
|
33
|
+
* A crash here replays the exact receipt; it does not rerun the child. */
|
|
34
|
+
adoptResult(input: {
|
|
35
|
+
grant: TaskWorkDelegationV1;
|
|
36
|
+
receipt: TaskWorkDelegationReceiptV1;
|
|
37
|
+
entry: ArtifactReviewSourceIndexEntry;
|
|
38
|
+
output: string;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/** Only the owning frontend can resolve native attachments or create an
|
|
42
|
+
* independently admitted child backend. These callbacks are never tool args. */
|
|
43
|
+
export interface DocumentWorkersHostV1 {
|
|
44
|
+
maxConcurrency: number;
|
|
45
|
+
backendScopeSha256(): string;
|
|
46
|
+
assertCurrent(): void;
|
|
47
|
+
/** Reopen already committed physical evidence after the parent settles.
|
|
48
|
+
* Never used to acquire sources, dispatch children or admit new work. */
|
|
49
|
+
assertEvidenceCurrent?(): void;
|
|
50
|
+
resolveSources(input: {
|
|
51
|
+
snapshot: TaskExecutionSnapshotV1;
|
|
52
|
+
nativeScope: TaskNativeExecutionScopeV1;
|
|
53
|
+
sourceIds: readonly string[];
|
|
54
|
+
signal: AbortSignal;
|
|
55
|
+
}): Promise<readonly TaskDocumentSourceV1[]>;
|
|
56
|
+
runWorker: DurableDocumentWorkerOptions["runWorker"];
|
|
57
|
+
}
|
|
58
|
+
export interface DurableDocumentWorkerBatchResult {
|
|
59
|
+
delegationId: string;
|
|
60
|
+
results: Array<{
|
|
61
|
+
sourceId: string;
|
|
62
|
+
receipt: TaskWorkDelegationReceiptV1;
|
|
63
|
+
output: string;
|
|
64
|
+
replayed: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
pendingSourceIds: string[];
|
|
67
|
+
}
|
|
68
|
+
/** Durable source operations remain the execution substrate. No independent
|
|
69
|
+
* task/goal store, detached process or model-authored coverage flag is used. */
|
|
70
|
+
export declare class DurableDocumentWorkerCoordinator {
|
|
71
|
+
private readonly options;
|
|
72
|
+
private readonly controller;
|
|
73
|
+
private active?;
|
|
74
|
+
private readonly scope;
|
|
75
|
+
constructor(options: DurableDocumentWorkerOptions);
|
|
76
|
+
private assertCurrent;
|
|
77
|
+
run(input: {
|
|
78
|
+
sourceIds: readonly string[];
|
|
79
|
+
concurrency?: number;
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
}): Promise<DurableDocumentWorkerBatchResult>;
|
|
82
|
+
stopAndWait(): Promise<void>;
|
|
83
|
+
private runBatch;
|
|
84
|
+
private runClaim;
|
|
85
|
+
}
|