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,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* trajectory-checkpoint.ts — bounded, evidence-first task trajectory control.
|
|
3
|
+
*
|
|
4
|
+
* It turns observed runner state into one short checkpoint that can be placed
|
|
5
|
+
* in the active context frame, rendered in the TUI, and persisted for audit.
|
|
6
|
+
* The runner may enrich it with a bounded, auditable model orientation; this
|
|
7
|
+
* module never stores private chain-of-thought.
|
|
8
|
+
*/
|
|
9
|
+
import { type TaskWorkProgressProposalV1 } from "./taskWorkPlan.js";
|
|
10
|
+
export interface TrajectoryAcceptanceIntent {
|
|
11
|
+
readonly sourceRef: string;
|
|
12
|
+
readonly sourceSha256: string;
|
|
13
|
+
readonly originalRequest: string;
|
|
14
|
+
}
|
|
15
|
+
export type TrajectoryCheckpointMode = "off" | "shadow" | "adaptive" | "always";
|
|
16
|
+
/** How often the runner asks a model to form a bounded task orientation. */
|
|
17
|
+
export type TrajectoryGroundingMode = "off" | "initial" | "adaptive";
|
|
18
|
+
export type TrajectoryAssessment = "on_trajectory" | "recovery_required" | "verification_due" | "blocked";
|
|
19
|
+
export type TrajectoryFreshness = "fresh" | "stale" | "unknown";
|
|
20
|
+
export interface TrajectoryTaskState {
|
|
21
|
+
goal: string;
|
|
22
|
+
originalGoal?: string;
|
|
23
|
+
completedSteps: string[];
|
|
24
|
+
pendingSteps: string[];
|
|
25
|
+
currentStep: string;
|
|
26
|
+
failedApproaches: string[];
|
|
27
|
+
nextAction: string;
|
|
28
|
+
modifiedFiles: Iterable<[
|
|
29
|
+
string,
|
|
30
|
+
string
|
|
31
|
+
]>;
|
|
32
|
+
toolCallCount: number;
|
|
33
|
+
phase?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface TrajectoryObservation {
|
|
36
|
+
type: string;
|
|
37
|
+
turn?: number;
|
|
38
|
+
toolName?: string;
|
|
39
|
+
/** Normalized target observed from the corresponding tool call, when any. */
|
|
40
|
+
targetPath?: string;
|
|
41
|
+
success?: boolean;
|
|
42
|
+
/** Host-observed fresh mutation/provider ACK; does not establish goal completion. */
|
|
43
|
+
effectObserved?: boolean;
|
|
44
|
+
content?: string;
|
|
45
|
+
timestamp?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface TrajectoryFact {
|
|
48
|
+
statement: string;
|
|
49
|
+
evidence: string;
|
|
50
|
+
freshness: TrajectoryFreshness;
|
|
51
|
+
}
|
|
52
|
+
export interface TrajectoryCheckpoint {
|
|
53
|
+
schemaVersion: 1;
|
|
54
|
+
id: string;
|
|
55
|
+
revision: number;
|
|
56
|
+
turn: number;
|
|
57
|
+
trigger: string;
|
|
58
|
+
assessment: TrajectoryAssessment;
|
|
59
|
+
goal: string;
|
|
60
|
+
acceptanceIntent: TrajectoryAcceptanceIntent;
|
|
61
|
+
/** Unverified auxiliary interpretation. Never an action/acceptance contract. */
|
|
62
|
+
advisory?: TrajectoryGeneratedGrounding;
|
|
63
|
+
phase?: string;
|
|
64
|
+
currentStep?: string;
|
|
65
|
+
/** Compact, auditable model-generated orientation; never private chain-of-thought. */
|
|
66
|
+
situationAssessment?: string;
|
|
67
|
+
/** Whether the orientation was generated or is the deterministic safety fallback. */
|
|
68
|
+
groundingSource?: "model" | "deterministic";
|
|
69
|
+
/** Evidence labels the model cited while forming its orientation. */
|
|
70
|
+
groundingEvidenceRefs?: string[];
|
|
71
|
+
completedWork: string[];
|
|
72
|
+
groundedFacts: TrajectoryFact[];
|
|
73
|
+
openQuestions: string[];
|
|
74
|
+
nextAction: string;
|
|
75
|
+
successEvidence: string;
|
|
76
|
+
doNotRepeat: string[];
|
|
77
|
+
/** Host-owned acceptance state; never reconstructed from rendered prose. */
|
|
78
|
+
objectiveFrontierFingerprint?: string;
|
|
79
|
+
objectiveDecision?: import("./taskObjective.js").ObjectiveFrontierDecision;
|
|
80
|
+
/** Current scoped task evidence; independent of this run's recent calls. */
|
|
81
|
+
objectiveProgress?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Validated structured output from the bounded trajectory grounding pass. */
|
|
84
|
+
export interface TrajectoryGeneratedGrounding {
|
|
85
|
+
situationAssessment: string;
|
|
86
|
+
currentStep?: string;
|
|
87
|
+
openQuestions: string[];
|
|
88
|
+
nextAction?: string;
|
|
89
|
+
successEvidence?: string;
|
|
90
|
+
doNotRepeat: string[];
|
|
91
|
+
evidenceRefs: string[];
|
|
92
|
+
/** A proposal only; the host must independently admit its exact work evidence. */
|
|
93
|
+
workProgress?: TaskWorkProgressProposalV1 | null;
|
|
94
|
+
}
|
|
95
|
+
export interface TrajectoryCheckpointInput {
|
|
96
|
+
turn: number;
|
|
97
|
+
revision: number;
|
|
98
|
+
trigger?: string;
|
|
99
|
+
taskState: TrajectoryTaskState;
|
|
100
|
+
acceptanceIntent?: TrajectoryAcceptanceIntent;
|
|
101
|
+
observations: TrajectoryObservation[];
|
|
102
|
+
recentFailures?: Array<{
|
|
103
|
+
tool: string;
|
|
104
|
+
error?: string;
|
|
105
|
+
output?: string;
|
|
106
|
+
turn?: number;
|
|
107
|
+
/** Only active, task-relevant failures may drive recovery. */
|
|
108
|
+
status?: "active" | "resolved" | "superseded" | "expired";
|
|
109
|
+
scope?: "project" | "ephemeral" | "controller" | "external";
|
|
110
|
+
}>;
|
|
111
|
+
focusDirective?: string | null;
|
|
112
|
+
lastVerifier?: {
|
|
113
|
+
passed?: boolean;
|
|
114
|
+
summary?: string;
|
|
115
|
+
turn?: number;
|
|
116
|
+
quality?: "assertive" | "observational" | "rejected_untrusted" | "failed";
|
|
117
|
+
nextAction?: string;
|
|
118
|
+
};
|
|
119
|
+
lastMutationTurn?: number;
|
|
120
|
+
/** Identical deterministic-checkpoint streak (same fingerprint, no mutation). */
|
|
121
|
+
stallStreak?: number;
|
|
122
|
+
/** `lastMutationTurn` value when the current stall run began. */
|
|
123
|
+
stallBaselineMutationTurn?: number;
|
|
124
|
+
objectiveFrontier?: import("./taskObjective.js").ObjectiveFrontierSnapshotV1 | null;
|
|
125
|
+
objectiveNoDeltaStreak?: number;
|
|
126
|
+
objectiveProgress?: {
|
|
127
|
+
content: string;
|
|
128
|
+
observationEvidenceIds: readonly string[];
|
|
129
|
+
observedCriterionIds: readonly string[];
|
|
130
|
+
} | null;
|
|
131
|
+
/** Return the current freshness state for a normalized project path. */
|
|
132
|
+
evidenceFreshness?: (path: string) => TrajectoryFreshness;
|
|
133
|
+
/** Optional, validated model orientation merged without weakening safety facts. */
|
|
134
|
+
generatedGrounding?: TrajectoryGeneratedGrounding | null;
|
|
135
|
+
}
|
|
136
|
+
export interface TrajectoryScopedSlice {
|
|
137
|
+
parentGoal: string;
|
|
138
|
+
delegatedScope: string;
|
|
139
|
+
assessment: TrajectoryAssessment;
|
|
140
|
+
relevantConstraint?: string;
|
|
141
|
+
exitEvidence: string;
|
|
142
|
+
}
|
|
143
|
+
export declare function sanitizeTrajectoryText(value: unknown, max?: number): string;
|
|
144
|
+
export declare function trajectoryCheckpointFingerprint(checkpoint: Omit<TrajectoryCheckpoint, "id" | "revision" | "turn">): string;
|
|
145
|
+
/** Build a deterministic safety checkpoint, optionally enriched by a model grounding pass. */
|
|
146
|
+
export declare function buildTrajectoryCheckpoint(input: TrajectoryCheckpointInput): TrajectoryCheckpoint;
|
|
147
|
+
export declare function renderTrajectoryCheckpoint(checkpoint: TrajectoryCheckpoint, maxChars?: number, options?: {
|
|
148
|
+
goalReference?: string;
|
|
149
|
+
includeAdvisory?: boolean;
|
|
150
|
+
}): string;
|
|
151
|
+
/**
|
|
152
|
+
* Prompt for the pre-action model pass. It asks for an auditable assessment,
|
|
153
|
+
* not hidden reasoning or a generic planning ritual.
|
|
154
|
+
*/
|
|
155
|
+
export declare function buildTrajectoryGroundingPrompt(checkpoint: TrajectoryCheckpoint, supplementalEvidence?: string[], taskExecutionSnapshot?: string): string;
|
|
156
|
+
/** Parse and bound a model-generated trajectory orientation. */
|
|
157
|
+
export declare function parseTrajectoryGeneratedGrounding(raw: unknown, allowedEvidenceRefs: readonly string[]): TrajectoryGeneratedGrounding | null;
|
|
158
|
+
export declare function scopeTrajectoryCheckpoint(checkpoint: TrajectoryCheckpoint | null | undefined, delegatedScope: string, exitEvidence: string): TrajectoryScopedSlice | null;
|
|
159
|
+
export declare function renderScopedTrajectoryCheckpoint(slice: TrajectoryScopedSlice | null | undefined): string;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal types used by the orchestrator that are not part of the public
|
|
3
|
+
* @omnius/schemas package.
|
|
4
|
+
*
|
|
5
|
+
* This file contains both the legacy AgentLoop types and the newer RALPH loop
|
|
6
|
+
* types so that both agent-loop.ts and ralphLoop.ts can share a single source.
|
|
7
|
+
*/
|
|
8
|
+
export interface AgentLoopConfig {
|
|
9
|
+
model: string;
|
|
10
|
+
backendUrl: string;
|
|
11
|
+
projectRoot: string;
|
|
12
|
+
maxIterations: number;
|
|
13
|
+
maxTokens: number;
|
|
14
|
+
temperature: number;
|
|
15
|
+
routingConfig?: import("./model-router.js").ModelRoutingConfig;
|
|
16
|
+
noPlugins?: boolean;
|
|
17
|
+
disabledPlugins?: string[];
|
|
18
|
+
}
|
|
19
|
+
export type LoopState = "idle" | "thinking" | "executing_tool" | "completed" | "error";
|
|
20
|
+
export interface LoopEvent {
|
|
21
|
+
type: "state_change" | "tool_result" | "message";
|
|
22
|
+
data: unknown;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}
|
|
25
|
+
import type { NormalizedTask, TaskStatus } from "../schemas/task.js";
|
|
26
|
+
import type { Plan } from "../schemas/plan.js";
|
|
27
|
+
import type { RetrievalPacket } from "../schemas/retrieval.js";
|
|
28
|
+
import type { PatchProposal } from "../schemas/patch.js";
|
|
29
|
+
import type { VerificationDecision } from "../schemas/verification.js";
|
|
30
|
+
import type { DispatchDecision } from "../schemas/dispatch.js";
|
|
31
|
+
import type { RepoProfile } from "../schemas/repoProfile.js";
|
|
32
|
+
/**
|
|
33
|
+
* Minimal interface any LLM backend must satisfy to be usable by the runners.
|
|
34
|
+
*
|
|
35
|
+
* This is intentionally simpler than the full @omnius/schemas LLMBackend
|
|
36
|
+
* so that tests can supply lightweight stubs. The VllmClient structurally
|
|
37
|
+
* satisfies this interface because its complete() signature is a superset.
|
|
38
|
+
*/
|
|
39
|
+
export interface LLMBackend {
|
|
40
|
+
complete(request: {
|
|
41
|
+
messages: Array<{
|
|
42
|
+
role: "user" | "assistant" | "system" | "tool";
|
|
43
|
+
content: string;
|
|
44
|
+
}>;
|
|
45
|
+
maxTokens?: number;
|
|
46
|
+
temperature?: number;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
content: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Carries the runtime state for one subtask during the RALPH execution loop.
|
|
53
|
+
*/
|
|
54
|
+
export interface SubtaskExecution {
|
|
55
|
+
subtaskId: string;
|
|
56
|
+
status: "pending" | "running" | "done" | "failed";
|
|
57
|
+
retrievalPacket?: RetrievalPacket;
|
|
58
|
+
patchProposal?: PatchProposal;
|
|
59
|
+
verificationDecision?: VerificationDecision;
|
|
60
|
+
retryCount: number;
|
|
61
|
+
failureFingerprints: string[];
|
|
62
|
+
startedAt?: string;
|
|
63
|
+
completedAt?: string;
|
|
64
|
+
errorMessage?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Terminal output of the RALPH loop returned to the caller.
|
|
68
|
+
*/
|
|
69
|
+
export interface FinalReport {
|
|
70
|
+
taskId: string;
|
|
71
|
+
status: TaskStatus;
|
|
72
|
+
task: NormalizedTask;
|
|
73
|
+
plan: Plan | undefined;
|
|
74
|
+
repoProfile: RepoProfile | undefined;
|
|
75
|
+
dispatchDecision: DispatchDecision | undefined;
|
|
76
|
+
subtaskExecutions: SubtaskExecution[];
|
|
77
|
+
/** ISO-8601 timestamp when the loop started. */
|
|
78
|
+
startedAt: string;
|
|
79
|
+
/** ISO-8601 timestamp when the loop finished. */
|
|
80
|
+
completedAt: string;
|
|
81
|
+
/** Human-readable summary of what happened. */
|
|
82
|
+
summary: string;
|
|
83
|
+
/** Files changed across all patch applications. */
|
|
84
|
+
filesChanged: string[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Configuration surface for tuning the RALPH loop at call-time.
|
|
88
|
+
*/
|
|
89
|
+
export interface RalphLoopOptions {
|
|
90
|
+
/** Maximum number of retry cycles per subtask. Default: 3. */
|
|
91
|
+
maxRetries?: number;
|
|
92
|
+
/** Maximum wall-clock milliseconds before the loop is forcibly terminated. Default: 300_000 (5 min). */
|
|
93
|
+
timeoutMs?: number;
|
|
94
|
+
/** When true, patches are validated but NOT written to disk. Default: false. */
|
|
95
|
+
dryRun?: boolean;
|
|
96
|
+
/** Override repo root (useful in tests). Falls back to task.repoRoot. */
|
|
97
|
+
repoRootOverride?: string;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Result of parsing a raw LLM JSON response against a Zod schema.
|
|
101
|
+
*/
|
|
102
|
+
export interface ParsedLLMResponse<T> {
|
|
103
|
+
success: boolean;
|
|
104
|
+
data?: T;
|
|
105
|
+
rawContent: string;
|
|
106
|
+
parseError?: string;
|
|
107
|
+
}
|
|
108
|
+
/** A single causal measurement for one span or span-category. */
|
|
109
|
+
export interface CausalMeasurement {
|
|
110
|
+
span_id: string;
|
|
111
|
+
/** Category of noise this measurement covers. */
|
|
112
|
+
category: "contradiction" | "redundancy" | "staleness" | "groundedness";
|
|
113
|
+
/** Response quality score with the span present. */
|
|
114
|
+
causal_signal: number;
|
|
115
|
+
/** Response quality score with the span ablated (removed). */
|
|
116
|
+
causal_noise: number;
|
|
117
|
+
/** SNR in dB = 10*log10(causal_signal / max(causal_noise, 0.001)). */
|
|
118
|
+
causal_snr_db: number;
|
|
119
|
+
/** 95% confidence interval from bootstrap resampling. */
|
|
120
|
+
confidenceInterval95: [
|
|
121
|
+
number,
|
|
122
|
+
number
|
|
123
|
+
] | null;
|
|
124
|
+
}
|
|
125
|
+
/** Configuration for the causal ablation harness. */
|
|
126
|
+
export interface CausalAblationConfig {
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
/** Dimensions to ablate each turn (default: all). */
|
|
129
|
+
dimensions: Array<CausalMeasurement["category"]>;
|
|
130
|
+
/** Bootstrap resamples for CI (0 = skip CI). */
|
|
131
|
+
bootstrapResamples: number;
|
|
132
|
+
/** Max turns to ablate (0 = all). */
|
|
133
|
+
maxAblationTurns: number;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Aggregate noise-load report for one turn.
|
|
137
|
+
* Each metric is a ratio in [0, 1] representing the fraction of total
|
|
138
|
+
* context tokens consumed by that category of noise.
|
|
139
|
+
*/
|
|
140
|
+
export interface LoadMetricsReport {
|
|
141
|
+
turn: number;
|
|
142
|
+
/** Fraction of tokens in contradictory spans (same content_hash, different text). */
|
|
143
|
+
contradictionLoad: number;
|
|
144
|
+
/** Fraction of tokens in semantic-duplicate spans (near-identical content). */
|
|
145
|
+
redundancyLoad: number;
|
|
146
|
+
/** Fraction of tokens in stale spans (beyond age threshold by type). */
|
|
147
|
+
stalenessLoad: number;
|
|
148
|
+
/** Combined noise fraction: MIN(1, contradiction + redundancy + staleness). */
|
|
149
|
+
combinedNoiseRatio: number;
|
|
150
|
+
/** Estimated signal-to-noise ratio in dB. */
|
|
151
|
+
snrDb: number;
|
|
152
|
+
/** Estimated signal token count (total * (1 - combinedNoiseRatio)). */
|
|
153
|
+
estimatedSignalTokens: number;
|
|
154
|
+
/** Estimated noise token count (total * combinedNoiseRatio). */
|
|
155
|
+
estimatedNoiseTokens: number;
|
|
156
|
+
/** Total estimated tokens in the context. */
|
|
157
|
+
totalTokens: number;
|
|
158
|
+
timestamp: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Categorises where a message span originated. Used for causal ablation
|
|
162
|
+
* and SNR measurement: the runner can filter by provenance to measure
|
|
163
|
+
* the marginal contribution of each category.
|
|
164
|
+
*/
|
|
165
|
+
export type SpanProvenance = "system_prompt_root" | "system_directive" | "system_context" | "system_retrieval" | "user_message" | "assistant_response" | "tool_result" | "sub_agent_summary" | "compressed" | "synthesized";
|
|
166
|
+
/**
|
|
167
|
+
* Every chat message carries optional SpanMeta so the SNR harness can:
|
|
168
|
+
* - identify each message uniquely (span_id)
|
|
169
|
+
* - group by provenance for causal ablation
|
|
170
|
+
* - sort by timestamp to compute age -> staleness
|
|
171
|
+
* - deduplicate by content_hash
|
|
172
|
+
* - budget-plan by token_count
|
|
173
|
+
*/
|
|
174
|
+
export interface SpanMeta {
|
|
175
|
+
/** Unique identifier for this message span (UUID v4). */
|
|
176
|
+
span_id: string;
|
|
177
|
+
/** Unix-millis when the span was created. */
|
|
178
|
+
timestamp: number;
|
|
179
|
+
/** Where the span came from (system prompt, user, assistant, tool, etc.). */
|
|
180
|
+
provenance: SpanProvenance;
|
|
181
|
+
/** SHA-256 hex digest of content, truncated to 16 chars. */
|
|
182
|
+
content_hash: string;
|
|
183
|
+
/** Estimated token count for this message (chars/4 + tool_call overhead). */
|
|
184
|
+
token_count: number;
|
|
185
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DispatchModeSchema: z.ZodEnum<{
|
|
3
|
+
single_pass: "single_pass";
|
|
4
|
+
multi_agent: "multi_agent";
|
|
5
|
+
hybrid: "hybrid";
|
|
6
|
+
}>;
|
|
7
|
+
export type DispatchMode = z.infer<typeof DispatchModeSchema>;
|
|
8
|
+
export declare const TaskComplexitySchema: z.ZodEnum<{
|
|
9
|
+
low: "low";
|
|
10
|
+
medium: "medium";
|
|
11
|
+
high: "high";
|
|
12
|
+
}>;
|
|
13
|
+
export type TaskComplexity = z.infer<typeof TaskComplexitySchema>;
|
|
14
|
+
export declare const AgentRoleSchema: z.ZodEnum<{
|
|
15
|
+
planner: "planner";
|
|
16
|
+
scout: "scout";
|
|
17
|
+
editor: "editor";
|
|
18
|
+
verifier: "verifier";
|
|
19
|
+
researcher: "researcher";
|
|
20
|
+
}>;
|
|
21
|
+
export type AgentRole = z.infer<typeof AgentRoleSchema>;
|
|
22
|
+
export declare const BudgetsSchema: z.ZodObject<{
|
|
23
|
+
promptTokens: z.ZodNumber;
|
|
24
|
+
retries: z.ZodNumber;
|
|
25
|
+
wallClockSec: z.ZodNumber;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type Budgets = z.infer<typeof BudgetsSchema>;
|
|
28
|
+
export declare const DispatchDecisionSchema: z.ZodObject<{
|
|
29
|
+
mode: z.ZodEnum<{
|
|
30
|
+
single_pass: "single_pass";
|
|
31
|
+
multi_agent: "multi_agent";
|
|
32
|
+
hybrid: "hybrid";
|
|
33
|
+
}>;
|
|
34
|
+
taskComplexity: z.ZodEnum<{
|
|
35
|
+
low: "low";
|
|
36
|
+
medium: "medium";
|
|
37
|
+
high: "high";
|
|
38
|
+
}>;
|
|
39
|
+
splitRecommended: z.ZodBoolean;
|
|
40
|
+
initialAgents: z.ZodArray<z.ZodEnum<{
|
|
41
|
+
planner: "planner";
|
|
42
|
+
scout: "scout";
|
|
43
|
+
editor: "editor";
|
|
44
|
+
verifier: "verifier";
|
|
45
|
+
researcher: "researcher";
|
|
46
|
+
}>>;
|
|
47
|
+
budgets: z.ZodObject<{
|
|
48
|
+
promptTokens: z.ZodNumber;
|
|
49
|
+
retries: z.ZodNumber;
|
|
50
|
+
wallClockSec: z.ZodNumber;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type DispatchDecision = z.infer<typeof DispatchDecisionSchema>;
|