@rulvar/core 1.172.0 → 1.174.0

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +175 -2
  2. package/dist/index.js +487 -285
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -7933,6 +7933,20 @@ interface ClaimPairOptions {
7933
7933
  maxPoolPerPair?: number;
7934
7934
  /** Bound on each excerpt; default {@link DEFAULT_MAX_PAIR_EXCERPT_CHARS}. */
7935
7935
  maxExcerptChars?: number;
7936
+ /**
7937
+ * Critical anchor declarations (RV1603): each entry is a path
7938
+ * (`packages/executor/src/ledger.ts`, matching that file and anything
7939
+ * under it as a directory) or an anchor with a span
7940
+ * (`src/exec.ts:250-300`, matching same-file anchors intersecting the
7941
+ * span). Pairs whose draft anchor matches sort FIRST, before the
7942
+ * `max` cap applies, so a bounded pass judges the declared claims
7943
+ * preferentially; the fold also reports which critical draft anchors
7944
+ * ended up with no reported pair. Unset = the exact pre-RV1603
7945
+ * ordering, byte for byte (the eighteenth comparison benchmark's
7946
+ * judge saw 40 of 144 citing sentences with nothing steering WHICH
7947
+ * 40).
7948
+ */
7949
+ critical?: readonly string[];
7936
7950
  }
7937
7951
  /** What the fold produced, beside the pairs themselves. */
7938
7952
  interface ClaimPairsFold {
@@ -7942,10 +7956,28 @@ interface ClaimPairsFold {
7942
7956
  truncated: boolean;
7943
7957
  /** Draft sentences carrying at least one parsable anchor. */
7944
7958
  draftCitingSentences: number;
7959
+ /**
7960
+ * Citing sentences with at least one REPORTED pair (RV1603): the
7961
+ * honest coverage numerator against `draftCitingSentences`. A
7962
+ * sentence can be uncovered because nothing in the pool read its
7963
+ * files, because every reading agreed verbatim, or because the `max`
7964
+ * cap cut it; all three mean the judge never saw it.
7965
+ */
7966
+ coveredCitingSentences: number;
7967
+ /**
7968
+ * Present only when `critical` was given: the critical draft anchors
7969
+ * (verbatim, draft order, deduplicated) with no reported pair, capped
7970
+ * at {@link MAX_CRITICAL_UNCOVERED} entries.
7971
+ */
7972
+ criticalUncovered?: string[];
7973
+ /** The uncapped count behind `criticalUncovered`; present with it. */
7974
+ criticalUncoveredTotal?: number;
7945
7975
  }
7946
7976
  declare const DEFAULT_MAX_CLAIM_PAIRS = 40;
7947
7977
  declare const DEFAULT_MAX_POOL_PER_PAIR = 3;
7948
7978
  declare const DEFAULT_MAX_PAIR_EXCERPT_CHARS = 400;
7979
+ /** Bound on the reported uncovered-critical anchor list (RV1603). */
7980
+ declare const MAX_CRITICAL_UNCOVERED = 32;
7949
7981
  /**
7950
7982
  * Folds the composed draft against the settled pool it composed from:
7951
7983
  * every draft sentence citing an anchor is paired with the pool
@@ -7955,6 +7987,54 @@ declare const DEFAULT_MAX_PAIR_EXCERPT_CHARS = 400;
7955
7987
  * journaling anything (the `findContradictions` precedent).
7956
7988
  */
7957
7989
  declare function pairDraftClaims(draftText: string, rows: readonly ContradictionSource[], options?: ClaimPairOptions): ClaimPairsFold;
7990
+ /** The synthetic anchor and nodeId of run-facts pairs (RV1603). */
7991
+ declare const RUN_FACTS_ANCHOR = "(run-facts)";
7992
+ declare const DEFAULT_MAX_RUN_FACT_PAIRS = 8;
7993
+ /** The sheet excerpt bound: one sheet rides EVERY run-facts pair. */
7994
+ declare const MAX_RUN_FACTS_SHEET_CHARS = 1200;
7995
+ /**
7996
+ * The run's own recorded execution facts, prepared by the caller
7997
+ * (deterministic sentences plus the trigger vocabularies).
7998
+ */
7999
+ interface RunFactsSheet {
8000
+ /** Deterministic sentences of the recorded facts. */
8001
+ text: string;
8002
+ /** Identity triggers: ids the run itself minted (runId, child node ids). */
8003
+ ids: readonly string[];
8004
+ /** Numeric triggers: recorded fact values (counts, totals). */
8005
+ numbers: readonly number[];
8006
+ }
8007
+ interface RunFactPairOptions {
8008
+ /** Case-insensitive substring triggers, e.g. 'not run' or a locale phrase. */
8009
+ terms?: readonly string[];
8010
+ /** Bound on returned pairs; default {@link DEFAULT_MAX_RUN_FACT_PAIRS}. */
8011
+ max?: number;
8012
+ /** Bound on the draft excerpt; default {@link DEFAULT_MAX_PAIR_EXCERPT_CHARS}. */
8013
+ maxExcerptChars?: number;
8014
+ }
8015
+ interface RunFactPairsFold {
8016
+ /** The pairs, in draft order, capped at `max`; anchor {@link RUN_FACTS_ANCHOR}. */
8017
+ pairs: ClaimPair[];
8018
+ /** True when more sentences matched than `max` allowed to report. */
8019
+ truncated: boolean;
8020
+ }
8021
+ /**
8022
+ * Pairs draft sentences that speak about the RUN with the run's own
8023
+ * recorded fact sheet (RV1603), so the same judge invocation that rules
8024
+ * on source claims also rules on run claims. The eighteenth comparison
8025
+ * benchmark shipped both failure shapes this closes: a dossier claiming
8026
+ * "each role recorded 18-20 evidence entries" over recorded profiles of
8027
+ * 23/18/22/20/20/20, and "real models were not run" beside 125 recorded
8028
+ * wire requests, with executionFacts ENABLED on the input side; facts
8029
+ * offered to the composer verify nothing about what it composed.
8030
+ *
8031
+ * A sentence pairs when it names a minted id, a recorded fact value
8032
+ * (standalone, two digits or more, so a prose "6" cannot flood the
8033
+ * fold), or a caller-supplied term (case-insensitive). Pure and
8034
+ * deterministic like {@link pairDraftClaims}; the sheet excerpt rides
8035
+ * every pair, capped at {@link MAX_RUN_FACTS_SHEET_CHARS}.
8036
+ */
8037
+ declare function pairRunFactClaims(draftText: string, sheet: RunFactsSheet, options?: RunFactPairOptions): RunFactPairsFold;
7958
8038
  //#endregion
7959
8039
  //#region src/orchestrator/output-contract.d.ts
7960
8040
  /** The golden citation sample used with {@link DEFAULT_CITATION_PATTERN}. */
@@ -9179,6 +9259,50 @@ interface OrchestrateClaimConsistency {
9179
9259
  maxPoolPerPair?: number;
9180
9260
  /** Bound on each excerpt; default {@link DEFAULT_MAX_PAIR_EXCERPT_CHARS}. */
9181
9261
  maxExcerptChars?: number;
9262
+ /**
9263
+ * Critical anchor declarations (RV1603): paths (a file, or a
9264
+ * directory matched as a prefix) or span anchors
9265
+ * (`src/exec.ts:250-300`). Pairs whose draft anchor matches sort
9266
+ * FIRST, before the `max` cap, so the bounded judge spends its
9267
+ * budget on the declared claims, and the meta names every critical
9268
+ * draft anchor that ended up unjudged (`criticalUncovered`). The
9269
+ * eighteenth comparison benchmark judged 40 of 144 citing sentences
9270
+ * with nothing steering which 40 and nothing saying what was left
9271
+ * out. Unset = the exact historical pairing order, byte for byte.
9272
+ */
9273
+ critical?: string[];
9274
+ /**
9275
+ * What an unjudged critical anchor does (RV1603): 'report' (the
9276
+ * default) names them on the meta only; 'fail' fails the run typed
9277
+ * with `data.source` 'orchestrator_claim_consistency' BEFORE the
9278
+ * judge dispatch, so a run whose declared claims cannot be verified
9279
+ * never pays for a partial verdict. Requires `critical`.
9280
+ */
9281
+ onUncoveredCritical?: "report" | "fail";
9282
+ /**
9283
+ * The run-facts grounding opt-in (RV1603): the run's own recorded
9284
+ * execution facts (accepted children, statuses, recorded evidence
9285
+ * entry counts, wire request and token totals; the
9286
+ * {@link executionFactsOf} material plus the entries plumbing) become
9287
+ * one more pool reading, and draft sentences that SPEAK about the
9288
+ * run (naming a minted id, a recorded fact value of two or more
9289
+ * digits, or a `runFactTerms` phrase) are paired with that sheet
9290
+ * under the `(run-facts)` anchor, judged by the same invocation.
9291
+ * Closes the eighteenth benchmark's live gap: a dossier claimed
9292
+ * "each role recorded 18-20 evidence entries" over recorded profiles
9293
+ * of 23/18/22/20/20/20 and "real models were not run" beside 125
9294
+ * recorded wire requests, with `executionFacts` enabled; facts
9295
+ * offered to the composer verify nothing about what it composed.
9296
+ * Off by default: judge prompt bytes stay identical when unset.
9297
+ */
9298
+ runFacts?: boolean;
9299
+ /**
9300
+ * Case-insensitive phrases that mark a draft sentence as a run
9301
+ * claim for the `runFacts` pass (negations carry no number: "real
9302
+ * models were not run" pairs only through a term). Requires
9303
+ * `runFacts: true`.
9304
+ */
9305
+ runFactTerms?: string[];
9182
9306
  }
9183
9307
  /** One judged contradiction: the pair plus the judge's one-sentence reason. */
9184
9308
  interface ClaimContradictionFinding extends ClaimPair {
@@ -9204,6 +9328,24 @@ interface OrchestrateClaimConsistencyMeta {
9204
9328
  pairs: number;
9205
9329
  /** True when more pairs existed than `max` allowed to judge. */
9206
9330
  truncated: boolean;
9331
+ /**
9332
+ * Citing sentences with at least one judged pair (RV1603): the honest
9333
+ * coverage numerator against `draftCitingSentences`, so `[]` findings
9334
+ * over 40 of 144 sentences can never read as "fully verified".
9335
+ */
9336
+ coveredCitingSentences: number;
9337
+ /**
9338
+ * Present when `critical` was declared: the critical draft anchors
9339
+ * with no judged pair (capped at {@link MAX_CRITICAL_UNCOVERED});
9340
+ * `[]` means every declared claim the draft cited was judged.
9341
+ */
9342
+ criticalUncovered?: string[];
9343
+ /** The uncapped count behind `criticalUncovered`; present with it. */
9344
+ criticalUncoveredTotal?: number;
9345
+ /** Present under `runFacts`: run-claim pairs judged against the fact sheet. */
9346
+ runFactPairs?: number;
9347
+ /** Present under `runFacts` when more run claims matched than the bound. */
9348
+ runFactPairsTruncated?: true;
9207
9349
  /** True when the judge invocation was dispatched. */
9208
9350
  judgeInvoked: boolean;
9209
9351
  /** Present when the judge invocation did not settle ok. */
@@ -12565,8 +12707,27 @@ interface CriticalPath {
12565
12707
  runWallMs?: number;
12566
12708
  /** Last non-coordination agent:end to run:end; absent without both. */
12567
12709
  postFanInMs?: number;
12568
- /** Summed wall of completed 'synthesize' spans (0 when none). */
12710
+ /**
12711
+ * Summed wall of completed 'synthesize' spans (0 when none). Since
12712
+ * RV1604 this is exactly `finalCompositionMs + semanticJudgeMs`,
12713
+ * kept whole for existing consumers: the name predates the claim
12714
+ * judge riding the same role, and the eighteenth comparison
12715
+ * benchmark read a 54-second `synthesisMs` as a second final
12716
+ * composition when the run had SKIPPED synthesis and the bucket was
12717
+ * entirely the judge and its extract. Read the split fields.
12718
+ */
12569
12719
  synthesisMs: number;
12720
+ /**
12721
+ * Completed 'synthesize' spans that ARE final composition (every
12722
+ * synthesize span not labeled as the claim judge), summed (RV1604).
12723
+ */
12724
+ finalCompositionMs: number;
12725
+ /**
12726
+ * Completed 'synthesize' spans that are the claim-consistency judge
12727
+ * (agent:start label {@link CLAIM_JUDGE_LABEL}), its extract phase
12728
+ * included, summed (RV1604).
12729
+ */
12730
+ semanticJudgeMs: number;
12570
12731
  /** postFanInMs / runWallMs when both are defined and the wall is > 0. */
12571
12732
  postFanInShare?: number;
12572
12733
  /** synthesisMs / runWallMs under the same conditions. */
@@ -12643,6 +12804,10 @@ interface PostFanInBreakdown {
12643
12804
  coordinationToolCallsByName: Record<string, number>;
12644
12805
  /** Completed 'synthesize' span wall clipped to the window. */
12645
12806
  synthesisMs: number;
12807
+ /** The final-composition half of `synthesisMs`, clipped (RV1604). */
12808
+ finalCompositionMs: number;
12809
+ /** The claim-judge half of `synthesisMs`, clipped (RV1604). */
12810
+ semanticJudgeMs: number;
12646
12811
  /** Union length of every covered interval above. */
12647
12812
  coveredMs: number;
12648
12813
  /** postFanInMs minus coveredMs, floored at zero. */
@@ -12650,6 +12815,14 @@ interface PostFanInBreakdown {
12650
12815
  /** residueMs / postFanInMs when the window is longer than zero. */
12651
12816
  residueShare?: number;
12652
12817
  }
12818
+ /**
12819
+ * The label the claim-consistency judge invocation dispatches under
12820
+ * (RV1502; named here since RV1604 so the critical-path reducer and the
12821
+ * orchestrator share one constant): the judge rides role 'synthesize',
12822
+ * and this label is what tells its wall apart from a real final
12823
+ * composition in {@link reduceCriticalPath}.
12824
+ */
12825
+ declare const CLAIM_JUDGE_LABEL = "claim-consistency-judge";
12653
12826
  declare function reduceCriticalPath(events: Iterable<WorkflowEvent>): CriticalPath;
12654
12827
  //#endregion
12655
12828
  //#region src/runner/sandbox-bridge.d.ts
@@ -12724,4 +12897,4 @@ interface SandboxBridge {
12724
12897
  declare const SANDBOX_AGENT_OPT_KEYS: readonly string[];
12725
12898
  declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
12726
12899
  //#endregion
12727
- export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, AcceptanceChildSummary, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, type AgentInvocationRow, AgentOpts, AgentProfile, AgentProfilePermissions, AgentProfileTemplateOptions, AgentResult, AgentResultMeta, AgentStatus, type AppliedPricingRow, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildExecutionFacts, ChildIdentityInput, ChildResultPage, CitationTarget, type ClaimClass, ClaimContradictionFinding, type ClaimOp, ClaimPair, ClaimPairOptions, ClaimPairsFold, ClaimPoolReading, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, Contradiction, ContradictionClaim, ContradictionOptions, ContradictionSource, type CoreEvents, CostAttribution, CostAttributionFacts, type CostBasis, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DEFAULT_ANCHOR_PATTERN, DEFAULT_ARTIFACT_PATTERN, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_CLAIM_JUDGE_MAX_TURNS, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_GRADE_PHRASES, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_CLAIM_PAIRS, DEFAULT_MAX_CONTRADICTIONS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_EXCERPT_CHARS, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PAIR_EXCERPT_CHARS, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_POOL_PER_PAIR, DEFAULT_MAX_QUOTA_DENIALS, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DataKeyProvider, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DocumentedRates, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EngineQuotaConfig, EngineQuotaRuntime, EntryBillingFold, EntryBillingUnit, EntryKind, EntryRef, EntryStatus, EnvelopeEncryption, EnvelopeEncryptionOptions, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, EvidenceContract, type EvidenceRef, type ExecKeyDerivation, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_SECTIONAL_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, type FinalizationWindowBudget, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishInfo, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IN_FLIGHT_EXPOSURE_REFUSAL_PREFIX, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, InvoiceCardinality, InvoiceExport, InvoicePricingProvenance, InvoiceReconciliation, InvoiceRow, type IsolatedExecContext, type IsolatedExecRequest, type IsolatedExecutorTag, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JOURNAL_ENVELOPE_MARKER, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSerializationContext, JournalSerializationHook, type JournalStore, type Json, JsonSchema, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, type KbProposal, type KbProposalTrigger, KeyDeriver, KeyRing, KeyedLimiter, KnowledgeCasError, type KnowledgeSnapshot, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LadderSpec, type LeasableStore, type Lease, LeaseHeldError, Ledger, LineageCounters, LineageIndex, LineageRef, LineageRelation, LineageStats, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MAX_RUN_ID_LENGTH, MAX_TIMER_DELAY_MS, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, MemoryQuotaLimiter, type MetaLookupStore, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateAcceptance, OrchestrateClaimConsistency, OrchestrateClaimConsistencyMeta, OrchestrateContradictions, OrchestrateContradictionsMeta, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, PersistedTerminalRefusal, PersistedTerminalResult, type PhaseRow, PhaseTarget, type PinnedPricingSegment, PipelineCollected, PipelineOpts, PlanInvariantError, type PostFanInBreakdown, PreflightAdmissionRow, PreflightFinding, PreflightInput, PreflightOrchestratorSpec, PreflightReport, PreflightSpawnReport, PreflightSpawnSpec, PreflightToolCeiling, PriceTable, PricedComponent, PricedComponents, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, ProviderCallRecord, QUOTA_WINDOW_MS, QualityFloors, QuotaCounters, type QuotaDecision, type QuotaEstimate, type QuotaLimiter, type QuotaReservationRequest, QuotaRule, QuotaWindowSnapshot, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, RateLimitObservation, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, ResearchAgentProfileOptions, ResearchAgentProfileResult, ResearchEvidenceEntry, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunAuditVerdict, RunBudget, RunEventSink, RunExport, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStateAudit, RunStatus, RuntimeEventSink, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StepIdentityInput, type StreamHooks, StructuredOutputTier, SupersededError, SuspendedAppend, SuspensionState, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, type TerminalEnvelope, TerminalOutcomeFacts, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, type ToolBudgetSummary, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, type ToolExecutorProvider, ToolInit, type ToolRisk, ToolRuntime, type ToolSource, type ToolSourceSession, ToolsOption, ToolsetAttestation, TranscriptSerializationHook, type TranscriptStore, TriggerClass, TtlState, Usage, UsageLimits, UsageSlice, VerifiedRecommendation, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, WakeBudgetBlock, WakeDigest, WakeTrigger, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, accountSpendFromJournal, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, assertSafeRunId, atCompactionThreshold, attestToolset, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, citationTargetsValidator, citedValueValidator, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compareRates, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, enforceToolsetAttestation, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidenceGradeValidator, evidencePreservedValidator, executeWorkflow, executionFactsOf, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, findContradictions, finishContract, foldLedger, foldTermination, formatCharacterValidator, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, pairDraftClaims, parallelScope, parseModelRef, parseScopePath, persistedTerminalEnvelope, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceComponentsOf, priceEntryBilling, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualRequestsDelta, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleKey, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolContractHash, toolsetHash, ttlState, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
12900
+ export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, AcceptanceChildSummary, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, type AgentInvocationRow, AgentOpts, AgentProfile, AgentProfilePermissions, AgentProfileTemplateOptions, AgentResult, AgentResultMeta, AgentStatus, type AppliedPricingRow, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_JUDGE_LABEL, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildExecutionFacts, ChildIdentityInput, ChildResultPage, CitationTarget, type ClaimClass, ClaimContradictionFinding, type ClaimOp, ClaimPair, ClaimPairOptions, ClaimPairsFold, ClaimPoolReading, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, Contradiction, ContradictionClaim, ContradictionOptions, ContradictionSource, type CoreEvents, CostAttribution, CostAttributionFacts, type CostBasis, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DEFAULT_ANCHOR_PATTERN, DEFAULT_ARTIFACT_PATTERN, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_CLAIM_JUDGE_MAX_TURNS, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_GRADE_PHRASES, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_CLAIM_PAIRS, DEFAULT_MAX_CONTRADICTIONS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_EXCERPT_CHARS, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PAIR_EXCERPT_CHARS, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_POOL_PER_PAIR, DEFAULT_MAX_QUOTA_DENIALS, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_RUN_FACT_PAIRS, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DataKeyProvider, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DocumentedRates, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EngineQuotaConfig, EngineQuotaRuntime, EntryBillingFold, EntryBillingUnit, EntryKind, EntryRef, EntryStatus, EnvelopeEncryption, EnvelopeEncryptionOptions, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, EvidenceContract, type EvidenceRef, type ExecKeyDerivation, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_SECTIONAL_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, type FinalizationWindowBudget, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishInfo, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IN_FLIGHT_EXPOSURE_REFUSAL_PREFIX, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, InvoiceCardinality, InvoiceExport, InvoicePricingProvenance, InvoiceReconciliation, InvoiceRow, type IsolatedExecContext, type IsolatedExecRequest, type IsolatedExecutorTag, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JOURNAL_ENVELOPE_MARKER, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSerializationContext, JournalSerializationHook, type JournalStore, type Json, JsonSchema, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, type KbProposal, type KbProposalTrigger, KeyDeriver, KeyRing, KeyedLimiter, KnowledgeCasError, type KnowledgeSnapshot, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LadderSpec, type LeasableStore, type Lease, LeaseHeldError, Ledger, LineageCounters, LineageIndex, LineageRef, LineageRelation, LineageStats, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_CRITICAL_UNCOVERED, MAX_DEPTH_CEILING, MAX_RUN_FACTS_SHEET_CHARS, MAX_RUN_ID_LENGTH, MAX_TIMER_DELAY_MS, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, MemoryQuotaLimiter, type MetaLookupStore, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateAcceptance, OrchestrateClaimConsistency, OrchestrateClaimConsistencyMeta, OrchestrateContradictions, OrchestrateContradictionsMeta, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, PersistedTerminalRefusal, PersistedTerminalResult, type PhaseRow, PhaseTarget, type PinnedPricingSegment, PipelineCollected, PipelineOpts, PlanInvariantError, type PostFanInBreakdown, PreflightAdmissionRow, PreflightFinding, PreflightInput, PreflightOrchestratorSpec, PreflightReport, PreflightSpawnReport, PreflightSpawnSpec, PreflightToolCeiling, PriceTable, PricedComponent, PricedComponents, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, ProviderCallRecord, QUOTA_WINDOW_MS, QualityFloors, QuotaCounters, type QuotaDecision, type QuotaEstimate, type QuotaLimiter, type QuotaReservationRequest, QuotaRule, QuotaWindowSnapshot, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_FACTS_ANCHOR, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, RateLimitObservation, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, ResearchAgentProfileOptions, ResearchAgentProfileResult, ResearchEvidenceEntry, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunAuditVerdict, RunBudget, RunEventSink, RunExport, RunFactPairOptions, RunFactPairsFold, RunFactsSheet, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStateAudit, RunStatus, RuntimeEventSink, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StepIdentityInput, type StreamHooks, StructuredOutputTier, SupersededError, SuspendedAppend, SuspensionState, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, type TerminalEnvelope, TerminalOutcomeFacts, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, type ToolBudgetSummary, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, type ToolExecutorProvider, ToolInit, type ToolRisk, ToolRuntime, type ToolSource, type ToolSourceSession, ToolsOption, ToolsetAttestation, TranscriptSerializationHook, type TranscriptStore, TriggerClass, TtlState, Usage, UsageLimits, UsageSlice, VerifiedRecommendation, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, WakeBudgetBlock, WakeDigest, WakeTrigger, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, accountSpendFromJournal, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, assertSafeRunId, atCompactionThreshold, attestToolset, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, citationTargetsValidator, citedValueValidator, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compareRates, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, enforceToolsetAttestation, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidenceGradeValidator, evidencePreservedValidator, executeWorkflow, executionFactsOf, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, findContradictions, finishContract, foldLedger, foldTermination, formatCharacterValidator, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, pairDraftClaims, pairRunFactClaims, parallelScope, parseModelRef, parseScopePath, persistedTerminalEnvelope, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceComponentsOf, priceEntryBilling, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualRequestsDelta, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleKey, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolContractHash, toolsetHash, ttlState, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
package/dist/index.js CHANGED
@@ -15175,6 +15175,294 @@ var AdmissionController = class {
15175
15175
  }
15176
15176
  };
15177
15177
  //#endregion
15178
+ //#region src/l0/telemetry-reduce.ts
15179
+ const ZERO = {
15180
+ inputTokens: 0,
15181
+ outputTokens: 0,
15182
+ cacheReadTokens: 0,
15183
+ cacheWriteTokens: 0
15184
+ };
15185
+ /**
15186
+ * Reduces one run's event stream (or any slice of it) to the invocation
15187
+ * table. Feed it the events in emission order; both a live stream and a
15188
+ * replayed one produce the same usage and cost columns.
15189
+ */
15190
+ function reduceInvocationTable(events) {
15191
+ const rows = /* @__PURE__ */ new Map();
15192
+ const order = [];
15193
+ const openPhases = /* @__PURE__ */ new Map();
15194
+ const byRole = {};
15195
+ let totalCostUsd = 0;
15196
+ const rowFor = (event) => {
15197
+ let row = rows.get(event.spanId);
15198
+ if (row === void 0) {
15199
+ row = {
15200
+ spanId: event.spanId,
15201
+ agentType: event.agentType,
15202
+ ...event.label === void 0 ? {} : { label: event.label },
15203
+ usage: ZERO,
15204
+ costUsd: 0,
15205
+ costBasis: "aggregate-estimate",
15206
+ usageApprox: false,
15207
+ retryCount: 0,
15208
+ replayed: event.replayed === true,
15209
+ open: true,
15210
+ phases: []
15211
+ };
15212
+ rows.set(event.spanId, row);
15213
+ order.push(row);
15214
+ }
15215
+ return row;
15216
+ };
15217
+ for (const event of events) switch (event.type) {
15218
+ case "agent:start": {
15219
+ const row = rowFor(event);
15220
+ row.role = event.role;
15221
+ break;
15222
+ }
15223
+ case "agent:phase:start": {
15224
+ const row = rowFor(event);
15225
+ const phase = {
15226
+ invocation: event.invocation,
15227
+ role: event.role,
15228
+ model: event.model,
15229
+ durationMs: 0,
15230
+ usage: ZERO,
15231
+ costUsd: 0,
15232
+ costBasis: "aggregate-estimate",
15233
+ retries: 0,
15234
+ replayed: event.replayed === true,
15235
+ open: true
15236
+ };
15237
+ row.phases.push(phase);
15238
+ openPhases.set(`${event.spanId}#${event.invocation}`, phase);
15239
+ break;
15240
+ }
15241
+ case "agent:phase:end": {
15242
+ const key = `${event.spanId}#${event.invocation}`;
15243
+ let phase = openPhases.get(key);
15244
+ if (phase === void 0) {
15245
+ phase = {
15246
+ invocation: event.invocation,
15247
+ role: event.role,
15248
+ model: event.model,
15249
+ durationMs: 0,
15250
+ usage: ZERO,
15251
+ costUsd: 0,
15252
+ costBasis: "aggregate-estimate",
15253
+ retries: 0,
15254
+ replayed: event.replayed === true,
15255
+ open: true
15256
+ };
15257
+ rowFor(event).phases.push(phase);
15258
+ }
15259
+ openPhases.delete(key);
15260
+ phase.open = false;
15261
+ phase.role = event.role;
15262
+ phase.model = event.model;
15263
+ phase.durationMs = event.durationMs;
15264
+ phase.usage = event.usage;
15265
+ phase.costUsd = event.costUsd;
15266
+ phase.costBasis = event.costBasis ?? "aggregate-estimate";
15267
+ phase.outcome = event.outcome;
15268
+ phase.retries = event.retries ?? 0;
15269
+ const bucket = byRole[event.role] ??= {
15270
+ usage: ZERO,
15271
+ costUsd: 0,
15272
+ costBasis: "per-call"
15273
+ };
15274
+ bucket.usage = sumUsage(bucket.usage, event.usage);
15275
+ bucket.costUsd += event.costUsd;
15276
+ if (phase.costBasis === "aggregate-estimate") bucket.costBasis = "aggregate-estimate";
15277
+ break;
15278
+ }
15279
+ case "agent:end": {
15280
+ const row = rowFor(event);
15281
+ row.open = false;
15282
+ row.status = event.status;
15283
+ row.usage = event.usage;
15284
+ row.costUsd = event.costUsd;
15285
+ row.costBasis = event.costBasis ?? "aggregate-estimate";
15286
+ row.usageApprox = event.usageApprox === true;
15287
+ row.retryCount = event.retryCount ?? 0;
15288
+ if (event.toolBudget !== void 0) row.toolBudget = event.toolBudget;
15289
+ totalCostUsd += event.costUsd;
15290
+ break;
15291
+ }
15292
+ default: break;
15293
+ }
15294
+ return {
15295
+ agents: order,
15296
+ byRole,
15297
+ totalCostUsd
15298
+ };
15299
+ }
15300
+ /**
15301
+ * The label the claim-consistency judge invocation dispatches under
15302
+ * (RV1502; named here since RV1604 so the critical-path reducer and the
15303
+ * orchestrator share one constant): the judge rides role 'synthesize',
15304
+ * and this label is what tells its wall apart from a real final
15305
+ * composition in {@link reduceCriticalPath}.
15306
+ */
15307
+ const CLAIM_JUDGE_LABEL = "claim-consistency-judge";
15308
+ /** Total length of the union of possibly overlapping intervals. */
15309
+ function unionLength(intervals) {
15310
+ const positive = intervals.filter((interval) => interval.to > interval.from);
15311
+ if (positive.length === 0) return 0;
15312
+ const sorted = [...positive].sort((a, b) => a.from - b.from);
15313
+ let total = 0;
15314
+ let from = sorted[0]?.from ?? 0;
15315
+ let to = sorted[0]?.to ?? 0;
15316
+ for (const interval of sorted.slice(1)) if (interval.from > to) {
15317
+ total += to - from;
15318
+ from = interval.from;
15319
+ to = interval.to;
15320
+ } else if (interval.to > to) to = interval.to;
15321
+ return total + (to - from);
15322
+ }
15323
+ function reduceCriticalPath(events) {
15324
+ let runStart;
15325
+ let runEnd;
15326
+ const startBySpan = /* @__PURE__ */ new Map();
15327
+ let lastWorkerEnd;
15328
+ let workerSpans = 0;
15329
+ let synthesisMs = 0;
15330
+ let finalCompositionMs = 0;
15331
+ let semanticJudgeMs = 0;
15332
+ const coordinationModel = [];
15333
+ const coordinationTools = [];
15334
+ const synthesisSpans = [];
15335
+ const spanOf = (durationMs) => Number.isFinite(durationMs) && durationMs > 0 ? durationMs : 0;
15336
+ for (const event of events) {
15337
+ const at = Date.parse(event.ts);
15338
+ if (!Number.isFinite(at)) continue;
15339
+ switch (event.type) {
15340
+ case "run:start":
15341
+ runStart ??= at;
15342
+ break;
15343
+ case "run:end":
15344
+ runEnd = at;
15345
+ break;
15346
+ case "agent:start":
15347
+ startBySpan.set(event.spanId, {
15348
+ role: event.role,
15349
+ at,
15350
+ ...event.label === void 0 ? {} : { label: event.label }
15351
+ });
15352
+ break;
15353
+ case "agent:phase:end":
15354
+ if (startBySpan.get(event.spanId)?.role === "orchestrate") coordinationModel.push({
15355
+ phase: event.role,
15356
+ from: at - spanOf(event.durationMs),
15357
+ to: at
15358
+ });
15359
+ break;
15360
+ case "tool:end":
15361
+ if (startBySpan.get(event.spanId)?.role === "orchestrate") coordinationTools.push({
15362
+ name: event.toolName,
15363
+ from: at - spanOf(event.durationMs),
15364
+ to: at
15365
+ });
15366
+ break;
15367
+ case "agent:end": {
15368
+ const started = startBySpan.get(event.spanId);
15369
+ if (started === void 0) break;
15370
+ if (started.role === "synthesize") {
15371
+ const wall = Math.max(0, at - started.at);
15372
+ const judge = started.label === CLAIM_JUDGE_LABEL;
15373
+ synthesisMs += wall;
15374
+ if (judge) semanticJudgeMs += wall;
15375
+ else finalCompositionMs += wall;
15376
+ synthesisSpans.push({
15377
+ from: started.at,
15378
+ to: at,
15379
+ judge
15380
+ });
15381
+ } else if (started.role !== "orchestrate") {
15382
+ workerSpans += 1;
15383
+ lastWorkerEnd = lastWorkerEnd === void 0 ? at : Math.max(lastWorkerEnd, at);
15384
+ }
15385
+ break;
15386
+ }
15387
+ default: break;
15388
+ }
15389
+ }
15390
+ const path = {
15391
+ synthesisMs,
15392
+ finalCompositionMs,
15393
+ semanticJudgeMs,
15394
+ workerSpans
15395
+ };
15396
+ if (runStart !== void 0 && runEnd !== void 0) path.runWallMs = Math.max(0, runEnd - runStart);
15397
+ if (runEnd !== void 0 && lastWorkerEnd !== void 0) {
15398
+ path.postFanInMs = Math.max(0, runEnd - lastWorkerEnd);
15399
+ const windowFrom = Math.min(lastWorkerEnd, runEnd);
15400
+ const windowTo = runEnd;
15401
+ const clip = (interval) => {
15402
+ if (interval.to < windowFrom || interval.from > windowTo) return;
15403
+ return {
15404
+ from: Math.max(interval.from, windowFrom),
15405
+ to: Math.min(interval.to, windowTo)
15406
+ };
15407
+ };
15408
+ const byPhase = {};
15409
+ const modelClipped = [];
15410
+ for (const interval of coordinationModel) {
15411
+ const clipped = clip(interval);
15412
+ if (clipped === void 0) continue;
15413
+ byPhase[interval.phase] = (byPhase[interval.phase] ?? 0) + (clipped.to - clipped.from);
15414
+ modelClipped.push(clipped);
15415
+ }
15416
+ const synthesisClipped = [];
15417
+ let judgeClippedMs = 0;
15418
+ let compositionClippedMs = 0;
15419
+ for (const span of synthesisSpans) {
15420
+ const clipped = clip(span);
15421
+ if (clipped === void 0) continue;
15422
+ synthesisClipped.push(clipped);
15423
+ if (span.judge) judgeClippedMs += clipped.to - clipped.from;
15424
+ else compositionClippedMs += clipped.to - clipped.from;
15425
+ }
15426
+ const byName = {};
15427
+ const callsByName = {};
15428
+ const toolsClipped = [];
15429
+ for (const interval of coordinationTools) {
15430
+ const clipped = clip(interval);
15431
+ if (clipped === void 0) continue;
15432
+ byName[interval.name] = (byName[interval.name] ?? 0) + (clipped.to - clipped.from);
15433
+ callsByName[interval.name] = (callsByName[interval.name] ?? 0) + 1;
15434
+ toolsClipped.push(clipped);
15435
+ }
15436
+ const lengthOf = (intervals) => intervals.reduce((sum, interval) => sum + (interval.to - interval.from), 0);
15437
+ const coveredMs = unionLength([
15438
+ ...modelClipped,
15439
+ ...toolsClipped,
15440
+ ...synthesisClipped
15441
+ ]);
15442
+ const modelOnlyMs = unionLength([...modelClipped, ...toolsClipped]) - unionLength(toolsClipped);
15443
+ const breakdown = {
15444
+ coordinationModelMs: lengthOf(modelClipped),
15445
+ coordinationModelMsByPhase: byPhase,
15446
+ coordinationModelOnlyMs: modelOnlyMs,
15447
+ coordinationToolMs: lengthOf(toolsClipped),
15448
+ coordinationToolMsByName: byName,
15449
+ coordinationToolCallsByName: callsByName,
15450
+ synthesisMs: lengthOf(synthesisClipped),
15451
+ finalCompositionMs: compositionClippedMs,
15452
+ semanticJudgeMs: judgeClippedMs,
15453
+ coveredMs,
15454
+ residueMs: Math.max(0, path.postFanInMs - coveredMs)
15455
+ };
15456
+ if (path.postFanInMs > 0) breakdown.residueShare = breakdown.residueMs / path.postFanInMs;
15457
+ path.postFanIn = breakdown;
15458
+ }
15459
+ if (path.runWallMs !== void 0 && path.runWallMs > 0) {
15460
+ if (path.postFanInMs !== void 0) path.postFanInShare = path.postFanInMs / path.runWallMs;
15461
+ path.synthesisShare = synthesisMs / path.runWallMs;
15462
+ }
15463
+ return path;
15464
+ }
15465
+ //#endregion
15178
15466
  //#region src/model/profile-card.ts
15179
15467
  function toolNamesOf(profile) {
15180
15468
  return (profile.tools ?? []).map((entry) => {
@@ -18896,6 +19184,8 @@ const DEFAULT_ANCHOR_PATTERN = `${DEFAULT_CITATION_PATTERN}(?:-\\d+)?`;
18896
19184
  const DEFAULT_MAX_CLAIM_PAIRS = 40;
18897
19185
  const DEFAULT_MAX_POOL_PER_PAIR = 3;
18898
19186
  const DEFAULT_MAX_PAIR_EXCERPT_CHARS = 400;
19187
+ /** Bound on the reported uncovered-critical anchor list (RV1603). */
19188
+ const MAX_CRITICAL_UNCOVERED = 32;
18899
19189
  /** Splits an anchor into path, start, and optional end at the LAST colon. */
18900
19190
  const ANCHOR_TAIL = /^(.*):(\d+)(?:-(\d+))?$/u;
18901
19191
  function requirePositiveInteger(value, what) {
@@ -18973,10 +19263,34 @@ function pairDraftClaims(draftText, rows, options) {
18973
19263
  });
18974
19264
  }
18975
19265
  }
18976
- const pairs = [];
19266
+ const critical = options?.critical;
19267
+ if (critical !== void 0) {
19268
+ for (const entry of critical) if (typeof entry !== "string" || entry.length === 0) throw new ConfigError(`pairDraftClaims critical entries must be nonempty strings; got ${JSON.stringify(entry)}`);
19269
+ }
19270
+ const criticalSpans = [];
19271
+ const criticalPaths = [];
19272
+ for (const entry of critical ?? []) {
19273
+ const parsed = ANCHOR_TAIL.exec(entry);
19274
+ const start = parsed === null ? NaN : Number(parsed[2]);
19275
+ const end = parsed === null || parsed[3] === void 0 ? start : Number(parsed[3]);
19276
+ if (parsed !== null && Number.isSafeInteger(start) && Number.isSafeInteger(end) && start >= 1 && end >= start) criticalSpans.push({
19277
+ raw: entry,
19278
+ path: parsed[1],
19279
+ start,
19280
+ end
19281
+ });
19282
+ else criticalPaths.push(entry);
19283
+ }
19284
+ const isCritical = (anchor) => {
19285
+ for (const path of criticalPaths) if (anchor.path === path || anchor.path.startsWith(`${path}/`)) return true;
19286
+ for (const span of criticalSpans) if (anchor.path === span.path && anchor.end >= span.start && anchor.start <= span.end) return true;
19287
+ return false;
19288
+ };
19289
+ const candidates = [];
18977
19290
  const seenPairs = /* @__PURE__ */ new Set();
18978
19291
  let draftCitingSentences = 0;
18979
- let total = 0;
19292
+ const criticalDraftAnchors = [];
19293
+ const seenCriticalAnchors = /* @__PURE__ */ new Set();
18980
19294
  for (const sentence of sentencesOf(draftText)) {
18981
19295
  const anchors = anchorsOf(sentence, pattern);
18982
19296
  if (anchors.length === 0) continue;
@@ -18984,6 +19298,11 @@ function pairDraftClaims(draftText, rows, options) {
18984
19298
  const full = collapse(sentence);
18985
19299
  const draftExcerpt = full.slice(0, maxExcerptChars);
18986
19300
  for (const anchor of anchors) {
19301
+ const anchorCritical = critical !== void 0 && isCritical(anchor);
19302
+ if (anchorCritical && !seenCriticalAnchors.has(anchor.raw)) {
19303
+ seenCriticalAnchors.add(anchor.raw);
19304
+ criticalDraftAnchors.push(anchor.raw);
19305
+ }
18987
19306
  const pairKey = `${full}\u0000${anchor.raw}`;
18988
19307
  if (seenPairs.has(pairKey)) continue;
18989
19308
  const readings = poolByPath.get(anchor.path) ?? [];
@@ -19003,18 +19322,94 @@ function pairDraftClaims(draftText, rows, options) {
19003
19322
  }
19004
19323
  if (pool.length === 0) continue;
19005
19324
  seenPairs.add(pairKey);
19006
- total += 1;
19007
- if (pairs.length < max) pairs.push({
19008
- anchor: anchor.raw,
19009
- draftExcerpt,
19010
- pool
19325
+ candidates.push({
19326
+ pair: {
19327
+ anchor: anchor.raw,
19328
+ draftExcerpt,
19329
+ pool
19330
+ },
19331
+ sentence: full,
19332
+ critical: anchorCritical
19011
19333
  });
19012
19334
  }
19013
19335
  }
19336
+ const reported = (critical === void 0 ? candidates : [...candidates.filter((candidate) => candidate.critical), ...candidates.filter((candidate) => !candidate.critical)]).slice(0, max);
19337
+ const coveredSentences = new Set(reported.map((candidate) => candidate.sentence));
19338
+ const fold = {
19339
+ pairs: reported.map((candidate) => candidate.pair),
19340
+ truncated: candidates.length > reported.length,
19341
+ draftCitingSentences,
19342
+ coveredCitingSentences: coveredSentences.size
19343
+ };
19344
+ if (critical !== void 0) {
19345
+ const reportedAnchors = new Set(reported.map((candidate) => candidate.pair.anchor));
19346
+ const uncovered = criticalDraftAnchors.filter((anchor) => !reportedAnchors.has(anchor));
19347
+ fold.criticalUncovered = uncovered.slice(0, 32);
19348
+ fold.criticalUncoveredTotal = uncovered.length;
19349
+ }
19350
+ return fold;
19351
+ }
19352
+ /** The synthetic anchor and nodeId of run-facts pairs (RV1603). */
19353
+ const RUN_FACTS_ANCHOR = "(run-facts)";
19354
+ const DEFAULT_MAX_RUN_FACT_PAIRS = 8;
19355
+ /** The sheet excerpt bound: one sheet rides EVERY run-facts pair. */
19356
+ const MAX_RUN_FACTS_SHEET_CHARS = 1200;
19357
+ /** Standalone numbers of two or more digits: single digits trigger nothing. */
19358
+ const RUN_FACT_NUMBER = /(?<![\d.,])(\d{2,})(?![\d.,])/gu;
19359
+ /**
19360
+ * Pairs draft sentences that speak about the RUN with the run's own
19361
+ * recorded fact sheet (RV1603), so the same judge invocation that rules
19362
+ * on source claims also rules on run claims. The eighteenth comparison
19363
+ * benchmark shipped both failure shapes this closes: a dossier claiming
19364
+ * "each role recorded 18-20 evidence entries" over recorded profiles of
19365
+ * 23/18/22/20/20/20, and "real models were not run" beside 125 recorded
19366
+ * wire requests, with executionFacts ENABLED on the input side; facts
19367
+ * offered to the composer verify nothing about what it composed.
19368
+ *
19369
+ * A sentence pairs when it names a minted id, a recorded fact value
19370
+ * (standalone, two digits or more, so a prose "6" cannot flood the
19371
+ * fold), or a caller-supplied term (case-insensitive). Pure and
19372
+ * deterministic like {@link pairDraftClaims}; the sheet excerpt rides
19373
+ * every pair, capped at {@link MAX_RUN_FACTS_SHEET_CHARS}.
19374
+ */
19375
+ function pairRunFactClaims(draftText, sheet, options) {
19376
+ const max = requirePositiveInteger(options?.max ?? 8, "pairRunFactClaims max");
19377
+ const maxExcerptChars = requirePositiveInteger(options?.maxExcerptChars ?? 400, "pairRunFactClaims maxExcerptChars");
19378
+ for (const term of options?.terms ?? []) if (typeof term !== "string" || term.length === 0) throw new ConfigError(`pairRunFactClaims terms must be nonempty strings; got ${JSON.stringify(term)}`);
19379
+ const terms = (options?.terms ?? []).map((term) => term.toLowerCase());
19380
+ const factNumbers = new Set(sheet.numbers.filter((value) => Number.isSafeInteger(value)));
19381
+ const sheetExcerpt = collapse(sheet.text).slice(0, MAX_RUN_FACTS_SHEET_CHARS);
19382
+ const pool = [{
19383
+ nodeId: RUN_FACTS_ANCHOR,
19384
+ excerpt: sheetExcerpt
19385
+ }];
19386
+ const matched = [];
19387
+ const seen = /* @__PURE__ */ new Set();
19388
+ let total = 0;
19389
+ for (const sentence of sentencesOf(draftText)) {
19390
+ const full = collapse(sentence);
19391
+ if (full.length === 0 || seen.has(full)) continue;
19392
+ const lower = full.toLowerCase();
19393
+ let triggered = sheet.ids.some((id) => id.length > 0 && full.includes(id));
19394
+ if (!triggered) triggered = terms.some((term) => lower.includes(term));
19395
+ if (!triggered) {
19396
+ for (const match of full.matchAll(RUN_FACT_NUMBER)) if (factNumbers.has(Number(match[1]))) {
19397
+ triggered = true;
19398
+ break;
19399
+ }
19400
+ }
19401
+ if (!triggered) continue;
19402
+ seen.add(full);
19403
+ total += 1;
19404
+ if (matched.length < max) matched.push({
19405
+ anchor: RUN_FACTS_ANCHOR,
19406
+ draftExcerpt: full.slice(0, maxExcerptChars),
19407
+ pool
19408
+ });
19409
+ }
19014
19410
  return {
19015
- pairs,
19016
- truncated: total > pairs.length,
19017
- draftCitingSentences
19411
+ pairs: matched,
19412
+ truncated: total > matched.length
19018
19413
  };
19019
19414
  }
19020
19415
  //#endregion
@@ -19637,6 +20032,16 @@ function validateOrchestrateOptions(opts) {
19637
20032
  ["maxPoolPerPair", consistency.maxPoolPerPair],
19638
20033
  ["maxExcerptChars", consistency.maxExcerptChars]
19639
20034
  ]) if (bound !== void 0 && (!Number.isInteger(bound) || bound < 1)) throw new ConfigError(`orchestrate claimConsistency.${label} must be a positive integer; got ` + JSON.stringify(bound));
20035
+ if (consistency.critical !== void 0) {
20036
+ if (!Array.isArray(consistency.critical) || consistency.critical.some((entry) => typeof entry !== "string" || entry.length === 0)) throw new ConfigError("orchestrate claimConsistency.critical must be an array of nonempty strings; got " + JSON.stringify(consistency.critical));
20037
+ }
20038
+ if (consistency.onUncoveredCritical !== void 0 && consistency.onUncoveredCritical !== "report" && consistency.onUncoveredCritical !== "fail") throw new ConfigError("orchestrate claimConsistency.onUncoveredCritical must be 'report' or 'fail'; got " + JSON.stringify(consistency.onUncoveredCritical));
20039
+ if (consistency.onUncoveredCritical !== void 0 && consistency.critical === void 0) throw new ConfigError("orchestrate claimConsistency.onUncoveredCritical needs critical anchors to watch; declare claimConsistency.critical");
20040
+ if (consistency.runFacts !== void 0 && typeof consistency.runFacts !== "boolean") throw new ConfigError(`orchestrate claimConsistency.runFacts must be a boolean; got ${typeof consistency.runFacts}`);
20041
+ if (consistency.runFactTerms !== void 0) {
20042
+ if (consistency.runFacts !== true) throw new ConfigError("orchestrate claimConsistency.runFactTerms rides the runFacts pass; set claimConsistency.runFacts true");
20043
+ if (!Array.isArray(consistency.runFactTerms) || consistency.runFactTerms.some((term) => typeof term !== "string" || term.length === 0)) throw new ConfigError("orchestrate claimConsistency.runFactTerms must be an array of nonempty strings; got " + JSON.stringify(consistency.runFactTerms));
20044
+ }
19640
20045
  if (consistency.judge !== void 0) {
19641
20046
  const judge = consistency.judge;
19642
20047
  if (typeof judge !== "object" || judge === null || Array.isArray(judge)) throw new ConfigError(`orchestrate claimConsistency.judge must be an object; got ${JSON.stringify(consistency.judge)}`);
@@ -21422,6 +21827,12 @@ function makeOrchestratorWorkflow(goal, opts) {
21422
21827
  const acceptedRoster = acceptedRosterNow();
21423
21828
  const pool = [];
21424
21829
  let poolChildren = 0;
21830
+ const factRows = [];
21831
+ const factIds = [internals.runId];
21832
+ const factNumbers = [];
21833
+ let factWires = 0;
21834
+ let factInput = 0;
21835
+ let factOutput = 0;
21425
21836
  for (const record of [...byOrdinal.values()].sort((a, b) => a.spawnOrdinal - b.spawnOrdinal)) {
21426
21837
  const settled = record.settled;
21427
21838
  if (settled === void 0) continue;
@@ -21436,20 +21847,66 @@ function makeOrchestratorWorkflow(goal, opts) {
21436
21847
  nodeId: record.nodeId,
21437
21848
  text: recorded.map((entry) => `${entry.claim.replace(/\.\s*$/u, "")}${entry.citation === void 0 ? "" : ` (\`${entry.citation}\`)`}.`).join(" ")
21438
21849
  });
21850
+ if (spec.runFacts === true) {
21851
+ const facts = executionFactsOf(settled);
21852
+ factRows.push(`Child ${record.nodeId} settled '${settled.status}' with ${String(recorded.length)} recorded evidence entries and ${String(facts.wireRequests)} wire requests.`);
21853
+ factIds.push(record.nodeId);
21854
+ factNumbers.push(recorded.length, facts.wireRequests);
21855
+ factWires += facts.wireRequests;
21856
+ factInput += facts.inputTokens;
21857
+ factOutput += facts.outputTokens;
21858
+ }
21439
21859
  }
21440
- const fold = pairDraftClaims(typeof draft === "string" ? draft : JSON.stringify(draft ?? null), pool, {
21860
+ const draftText = typeof draft === "string" ? draft : JSON.stringify(draft ?? null);
21861
+ const fold = pairDraftClaims(draftText, pool, {
21441
21862
  ...spec.pattern === void 0 ? {} : { pattern: spec.pattern },
21442
21863
  max: spec.max ?? 40,
21443
21864
  ...spec.maxPoolPerPair === void 0 ? {} : { maxPoolPerPair: spec.maxPoolPerPair },
21444
- ...spec.maxExcerptChars === void 0 ? {} : { maxExcerptChars: spec.maxExcerptChars }
21865
+ ...spec.maxExcerptChars === void 0 ? {} : { maxExcerptChars: spec.maxExcerptChars },
21866
+ ...spec.critical === void 0 ? {} : { critical: spec.critical }
21445
21867
  });
21868
+ const runFold = spec.runFacts === true ? pairRunFactClaims(draftText, {
21869
+ text: `The run ${internals.runId} made ${String(factWires)} provider wire requests across ${String(poolChildren)} accepted children, with token totals ${String(factInput)} input and ${String(factOutput)} output (the run's own recorded execution facts; harness-observed, not production evidence). ${factRows.join(" ")}`,
21870
+ ids: factIds,
21871
+ numbers: [
21872
+ ...factNumbers,
21873
+ factWires,
21874
+ factInput,
21875
+ factOutput
21876
+ ]
21877
+ }, {
21878
+ ...spec.runFactTerms === void 0 ? {} : { terms: spec.runFactTerms },
21879
+ ...spec.maxExcerptChars === void 0 ? {} : { maxExcerptChars: spec.maxExcerptChars }
21880
+ }) : void 0;
21881
+ const allPairs = runFold === void 0 ? fold.pairs : [...fold.pairs, ...runFold.pairs];
21446
21882
  const onFound = spec.onFound ?? "report";
21447
21883
  const metaBase = {
21448
21884
  poolChildren,
21449
21885
  draftCitingSentences: fold.draftCitingSentences,
21450
- pairs: fold.pairs.length,
21451
- truncated: fold.truncated
21886
+ pairs: allPairs.length,
21887
+ truncated: fold.truncated,
21888
+ coveredCitingSentences: fold.coveredCitingSentences,
21889
+ ...fold.criticalUncovered === void 0 ? {} : {
21890
+ criticalUncovered: fold.criticalUncovered,
21891
+ criticalUncoveredTotal: fold.criticalUncoveredTotal ?? 0
21892
+ },
21893
+ ...runFold === void 0 ? {} : {
21894
+ runFactPairs: runFold.pairs.length,
21895
+ ...runFold.truncated ? { runFactPairsTruncated: true } : {}
21896
+ }
21452
21897
  };
21898
+ if (spec.onUncoveredCritical === "fail" && fold.criticalUncovered !== void 0 && fold.criticalUncovered.length > 0) {
21899
+ claimConsistencyMeta = {
21900
+ ...metaBase,
21901
+ judgeInvoked: false
21902
+ };
21903
+ throw new FailRunError(`the claim-consistency pass left ${String(fold.criticalUncoveredTotal ?? 0)} critical draft anchor(s) unjudged (${fold.criticalUncovered.join(", ")}), and the armed onUncoveredCritical posture cannot pass the draft`, { data: {
21904
+ source: "orchestrator_claim_consistency",
21905
+ criticalUncovered: fold.criticalUncovered,
21906
+ claimConsistencyMeta,
21907
+ ...snapshot ?? {}
21908
+ } });
21909
+ }
21453
21910
  const announce = () => {
21454
21911
  internals.events.emit({
21455
21912
  type: "log",
@@ -21457,7 +21914,7 @@ function makeOrchestratorWorkflow(goal, opts) {
21457
21914
  msg: "orchestrator claim consistency pass",
21458
21915
  data: {
21459
21916
  children: poolChildren,
21460
- pairs: fold.pairs.length,
21917
+ pairs: allPairs.length,
21461
21918
  findings: claimFindingsFound?.length ?? 0,
21462
21919
  truncated: fold.truncated,
21463
21920
  onFound,
@@ -21466,7 +21923,7 @@ function makeOrchestratorWorkflow(goal, opts) {
21466
21923
  }
21467
21924
  }, callingState.spanId);
21468
21925
  };
21469
- if (fold.pairs.length === 0) {
21926
+ if (allPairs.length === 0) {
21470
21927
  claimFindingsFound = [];
21471
21928
  claimConsistencyMeta = {
21472
21929
  ...metaBase,
@@ -21475,18 +21932,22 @@ function makeOrchestratorWorkflow(goal, opts) {
21475
21932
  announce();
21476
21933
  return;
21477
21934
  }
21478
- const judgePrompt = ["You are the claim-consistency judge of an orchestrated run. Each PAIR below holds one sentence of the COMPOSED DRAFT beside the settled child sentences citing an intersecting span of the same file. Report ONLY real contradictions: a pair whose draft sentence asserts about the cited location something a pool reading denies (an inverted behavior, a negated default, a different value). Restating, summarizing, or narrowing a reading is NOT a contradiction. Answer with { contradictions: [{ pair, reason }] }: pair is the zero-based PAIR index and reason is one short sentence naming the disagreement; an empty array means every pair agrees.", `PAIRS: ${JSON.stringify(fold.pairs.map((pair, index) => ({
21479
- pair: index,
21480
- anchor: pair.anchor,
21481
- draft: pair.draftExcerpt,
21482
- pool: pair.pool
21483
- })))}`].join("\n");
21935
+ const judgePrompt = [
21936
+ "You are the claim-consistency judge of an orchestrated run. Each PAIR below holds one sentence of the COMPOSED DRAFT beside the settled child sentences citing an intersecting span of the same file. Report ONLY real contradictions: a pair whose draft sentence asserts about the cited location something a pool reading denies (an inverted behavior, a negated default, a different value). Restating, summarizing, or narrowing a reading is NOT a contradiction. Answer with { contradictions: [{ pair, reason }] }: pair is the zero-based PAIR index and reason is one short sentence naming the disagreement; an empty array means every pair agrees.",
21937
+ ...runFold !== void 0 && runFold.pairs.length > 0 ? ["Pairs anchored '(run-facts)' hold the run's own recorded execution facts as the pool reading. A draft sentence asserting something those facts deny (a count outside the recorded values, a negation of recorded activity) is a contradiction on the same terms."] : [],
21938
+ `PAIRS: ${JSON.stringify(allPairs.map((pair, index) => ({
21939
+ pair: index,
21940
+ anchor: pair.anchor,
21941
+ draft: pair.draftExcerpt,
21942
+ pool: pair.pool
21943
+ })))}`
21944
+ ].join("\n");
21484
21945
  const judgeState = { ...callingState };
21485
21946
  if (orchestratorAccount !== void 0) judgeState.budgetScope = orchestratorAccount;
21486
21947
  const judgeOpts = {
21487
21948
  role: "synthesize",
21488
21949
  result: "full",
21489
- label: "claim-consistency-judge",
21950
+ label: CLAIM_JUDGE_LABEL,
21490
21951
  schema: CLAIM_JUDGE_SCHEMA,
21491
21952
  limits: spec.judge?.limits ?? { maxTurns: 3 },
21492
21953
  ...spec.judge?.model === void 0 ? {} : { model: spec.judge.model },
@@ -21521,11 +21982,11 @@ function makeOrchestratorWorkflow(goal, opts) {
21521
21982
  const byPair = /* @__PURE__ */ new Map();
21522
21983
  if (Array.isArray(rows)) for (const row of rows) {
21523
21984
  const candidate = row;
21524
- if (typeof candidate.pair !== "number" || !Number.isInteger(candidate.pair) || candidate.pair < 0 || candidate.pair >= fold.pairs.length || typeof candidate.reason !== "string" || candidate.reason.length === 0 || byPair.has(candidate.pair)) continue;
21985
+ if (typeof candidate.pair !== "number" || !Number.isInteger(candidate.pair) || candidate.pair < 0 || candidate.pair >= allPairs.length || typeof candidate.reason !== "string" || candidate.reason.length === 0 || byPair.has(candidate.pair)) continue;
21525
21986
  byPair.set(candidate.pair, candidate.reason);
21526
21987
  }
21527
21988
  const findings = [...byPair.entries()].sort((a, b) => a[0] - b[0]).map(([index, reason]) => ({
21528
- ...fold.pairs[index],
21989
+ ...allPairs[index],
21529
21990
  reason
21530
21991
  }));
21531
21992
  claimFindingsFound = findings;
@@ -23444,265 +23905,6 @@ var EventBus = class {
23444
23905
  }
23445
23906
  };
23446
23907
  //#endregion
23447
- //#region src/l0/telemetry-reduce.ts
23448
- const ZERO = {
23449
- inputTokens: 0,
23450
- outputTokens: 0,
23451
- cacheReadTokens: 0,
23452
- cacheWriteTokens: 0
23453
- };
23454
- /**
23455
- * Reduces one run's event stream (or any slice of it) to the invocation
23456
- * table. Feed it the events in emission order; both a live stream and a
23457
- * replayed one produce the same usage and cost columns.
23458
- */
23459
- function reduceInvocationTable(events) {
23460
- const rows = /* @__PURE__ */ new Map();
23461
- const order = [];
23462
- const openPhases = /* @__PURE__ */ new Map();
23463
- const byRole = {};
23464
- let totalCostUsd = 0;
23465
- const rowFor = (event) => {
23466
- let row = rows.get(event.spanId);
23467
- if (row === void 0) {
23468
- row = {
23469
- spanId: event.spanId,
23470
- agentType: event.agentType,
23471
- ...event.label === void 0 ? {} : { label: event.label },
23472
- usage: ZERO,
23473
- costUsd: 0,
23474
- costBasis: "aggregate-estimate",
23475
- usageApprox: false,
23476
- retryCount: 0,
23477
- replayed: event.replayed === true,
23478
- open: true,
23479
- phases: []
23480
- };
23481
- rows.set(event.spanId, row);
23482
- order.push(row);
23483
- }
23484
- return row;
23485
- };
23486
- for (const event of events) switch (event.type) {
23487
- case "agent:start": {
23488
- const row = rowFor(event);
23489
- row.role = event.role;
23490
- break;
23491
- }
23492
- case "agent:phase:start": {
23493
- const row = rowFor(event);
23494
- const phase = {
23495
- invocation: event.invocation,
23496
- role: event.role,
23497
- model: event.model,
23498
- durationMs: 0,
23499
- usage: ZERO,
23500
- costUsd: 0,
23501
- costBasis: "aggregate-estimate",
23502
- retries: 0,
23503
- replayed: event.replayed === true,
23504
- open: true
23505
- };
23506
- row.phases.push(phase);
23507
- openPhases.set(`${event.spanId}#${event.invocation}`, phase);
23508
- break;
23509
- }
23510
- case "agent:phase:end": {
23511
- const key = `${event.spanId}#${event.invocation}`;
23512
- let phase = openPhases.get(key);
23513
- if (phase === void 0) {
23514
- phase = {
23515
- invocation: event.invocation,
23516
- role: event.role,
23517
- model: event.model,
23518
- durationMs: 0,
23519
- usage: ZERO,
23520
- costUsd: 0,
23521
- costBasis: "aggregate-estimate",
23522
- retries: 0,
23523
- replayed: event.replayed === true,
23524
- open: true
23525
- };
23526
- rowFor(event).phases.push(phase);
23527
- }
23528
- openPhases.delete(key);
23529
- phase.open = false;
23530
- phase.role = event.role;
23531
- phase.model = event.model;
23532
- phase.durationMs = event.durationMs;
23533
- phase.usage = event.usage;
23534
- phase.costUsd = event.costUsd;
23535
- phase.costBasis = event.costBasis ?? "aggregate-estimate";
23536
- phase.outcome = event.outcome;
23537
- phase.retries = event.retries ?? 0;
23538
- const bucket = byRole[event.role] ??= {
23539
- usage: ZERO,
23540
- costUsd: 0,
23541
- costBasis: "per-call"
23542
- };
23543
- bucket.usage = sumUsage(bucket.usage, event.usage);
23544
- bucket.costUsd += event.costUsd;
23545
- if (phase.costBasis === "aggregate-estimate") bucket.costBasis = "aggregate-estimate";
23546
- break;
23547
- }
23548
- case "agent:end": {
23549
- const row = rowFor(event);
23550
- row.open = false;
23551
- row.status = event.status;
23552
- row.usage = event.usage;
23553
- row.costUsd = event.costUsd;
23554
- row.costBasis = event.costBasis ?? "aggregate-estimate";
23555
- row.usageApprox = event.usageApprox === true;
23556
- row.retryCount = event.retryCount ?? 0;
23557
- if (event.toolBudget !== void 0) row.toolBudget = event.toolBudget;
23558
- totalCostUsd += event.costUsd;
23559
- break;
23560
- }
23561
- default: break;
23562
- }
23563
- return {
23564
- agents: order,
23565
- byRole,
23566
- totalCostUsd
23567
- };
23568
- }
23569
- /** Total length of the union of possibly overlapping intervals. */
23570
- function unionLength(intervals) {
23571
- const positive = intervals.filter((interval) => interval.to > interval.from);
23572
- if (positive.length === 0) return 0;
23573
- const sorted = [...positive].sort((a, b) => a.from - b.from);
23574
- let total = 0;
23575
- let from = sorted[0]?.from ?? 0;
23576
- let to = sorted[0]?.to ?? 0;
23577
- for (const interval of sorted.slice(1)) if (interval.from > to) {
23578
- total += to - from;
23579
- from = interval.from;
23580
- to = interval.to;
23581
- } else if (interval.to > to) to = interval.to;
23582
- return total + (to - from);
23583
- }
23584
- function reduceCriticalPath(events) {
23585
- let runStart;
23586
- let runEnd;
23587
- const startBySpan = /* @__PURE__ */ new Map();
23588
- let lastWorkerEnd;
23589
- let workerSpans = 0;
23590
- let synthesisMs = 0;
23591
- const coordinationModel = [];
23592
- const coordinationTools = [];
23593
- const synthesisSpans = [];
23594
- const spanOf = (durationMs) => Number.isFinite(durationMs) && durationMs > 0 ? durationMs : 0;
23595
- for (const event of events) {
23596
- const at = Date.parse(event.ts);
23597
- if (!Number.isFinite(at)) continue;
23598
- switch (event.type) {
23599
- case "run:start":
23600
- runStart ??= at;
23601
- break;
23602
- case "run:end":
23603
- runEnd = at;
23604
- break;
23605
- case "agent:start":
23606
- startBySpan.set(event.spanId, {
23607
- role: event.role,
23608
- at
23609
- });
23610
- break;
23611
- case "agent:phase:end":
23612
- if (startBySpan.get(event.spanId)?.role === "orchestrate") coordinationModel.push({
23613
- phase: event.role,
23614
- from: at - spanOf(event.durationMs),
23615
- to: at
23616
- });
23617
- break;
23618
- case "tool:end":
23619
- if (startBySpan.get(event.spanId)?.role === "orchestrate") coordinationTools.push({
23620
- name: event.toolName,
23621
- from: at - spanOf(event.durationMs),
23622
- to: at
23623
- });
23624
- break;
23625
- case "agent:end": {
23626
- const started = startBySpan.get(event.spanId);
23627
- if (started === void 0) break;
23628
- if (started.role === "synthesize") {
23629
- synthesisMs += Math.max(0, at - started.at);
23630
- synthesisSpans.push({
23631
- from: started.at,
23632
- to: at
23633
- });
23634
- } else if (started.role !== "orchestrate") {
23635
- workerSpans += 1;
23636
- lastWorkerEnd = lastWorkerEnd === void 0 ? at : Math.max(lastWorkerEnd, at);
23637
- }
23638
- break;
23639
- }
23640
- default: break;
23641
- }
23642
- }
23643
- const path = {
23644
- synthesisMs,
23645
- workerSpans
23646
- };
23647
- if (runStart !== void 0 && runEnd !== void 0) path.runWallMs = Math.max(0, runEnd - runStart);
23648
- if (runEnd !== void 0 && lastWorkerEnd !== void 0) {
23649
- path.postFanInMs = Math.max(0, runEnd - lastWorkerEnd);
23650
- const windowFrom = Math.min(lastWorkerEnd, runEnd);
23651
- const windowTo = runEnd;
23652
- const clip = (interval) => {
23653
- if (interval.to < windowFrom || interval.from > windowTo) return;
23654
- return {
23655
- from: Math.max(interval.from, windowFrom),
23656
- to: Math.min(interval.to, windowTo)
23657
- };
23658
- };
23659
- const byPhase = {};
23660
- const modelClipped = [];
23661
- for (const interval of coordinationModel) {
23662
- const clipped = clip(interval);
23663
- if (clipped === void 0) continue;
23664
- byPhase[interval.phase] = (byPhase[interval.phase] ?? 0) + (clipped.to - clipped.from);
23665
- modelClipped.push(clipped);
23666
- }
23667
- const synthesisClipped = synthesisSpans.map(clip).filter((interval) => interval !== void 0);
23668
- const byName = {};
23669
- const callsByName = {};
23670
- const toolsClipped = [];
23671
- for (const interval of coordinationTools) {
23672
- const clipped = clip(interval);
23673
- if (clipped === void 0) continue;
23674
- byName[interval.name] = (byName[interval.name] ?? 0) + (clipped.to - clipped.from);
23675
- callsByName[interval.name] = (callsByName[interval.name] ?? 0) + 1;
23676
- toolsClipped.push(clipped);
23677
- }
23678
- const lengthOf = (intervals) => intervals.reduce((sum, interval) => sum + (interval.to - interval.from), 0);
23679
- const coveredMs = unionLength([
23680
- ...modelClipped,
23681
- ...toolsClipped,
23682
- ...synthesisClipped
23683
- ]);
23684
- const modelOnlyMs = unionLength([...modelClipped, ...toolsClipped]) - unionLength(toolsClipped);
23685
- const breakdown = {
23686
- coordinationModelMs: lengthOf(modelClipped),
23687
- coordinationModelMsByPhase: byPhase,
23688
- coordinationModelOnlyMs: modelOnlyMs,
23689
- coordinationToolMs: lengthOf(toolsClipped),
23690
- coordinationToolMsByName: byName,
23691
- coordinationToolCallsByName: callsByName,
23692
- synthesisMs: lengthOf(synthesisClipped),
23693
- coveredMs,
23694
- residueMs: Math.max(0, path.postFanInMs - coveredMs)
23695
- };
23696
- if (path.postFanInMs > 0) breakdown.residueShare = breakdown.residueMs / path.postFanInMs;
23697
- path.postFanIn = breakdown;
23698
- }
23699
- if (path.runWallMs !== void 0 && path.runWallMs > 0) {
23700
- if (path.postFanInMs !== void 0) path.postFanInShare = path.postFanInMs / path.runWallMs;
23701
- path.synthesisShare = synthesisMs / path.runWallMs;
23702
- }
23703
- return path;
23704
- }
23705
- //#endregion
23706
23908
  //#region src/runner/inprocess.ts
23707
23909
  /**
23708
23910
  * The mode (a) runner for human-authored closures. Determinism is enforced
@@ -25151,4 +25353,4 @@ function createSandboxBridge(ctx, options) {
25151
25353
  };
25152
25354
  }
25153
25355
  //#endregion
25154
- export { AWAIT_SCHEMA, AdmissionController, AdmissionRejectedError, AgentCallError, BUDGET_ABORT_REASON, BudgetExhaustedError, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, ConfigError, DEFAULT_ANCHOR_PATTERN, DEFAULT_ARTIFACT_PATTERN, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_CLAIM_JUDGE_MAX_TURNS, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_GRADE_PHRASES, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_CLAIM_PAIRS, DEFAULT_MAX_CONTRADICTIONS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_EXCERPT_CHARS, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PAIR_EXCERPT_CHARS, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_POOL_PER_PAIR, DEFAULT_MAX_QUOTA_DENIALS, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DedupIndex, DeterminismError, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EscalationDecisionAbortedError, EventBus, ExternalRegistry, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_SECTIONAL_SCHEMA, FINISH_TOOL_NAME, FailRunError, FileModelKnowledgeStore, FileTranscriptStore, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, GitWorktreeProvider, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IN_FLIGHT_EXPOSURE_REFUSAL_PREFIX, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, JOURNAL_ENVELOPE_MARKER, JournalCompatibilityError, JournalMatcher, JournalMissError, JournalOrderViolation, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, KeyedLimiter, KnowledgeCasError, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LeaseHeldError, LineageIndex, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MAX_RUN_ID_LENGTH, MAX_TIMER_DELAY_MS, ModelRetry, NoProgressDetector, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OrchestratorCapConfigError, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, PlanInvariantError, QUOTA_WINDOW_MS, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, ReplayPlanHashMismatch, Replayer, ResolutionArbiter, ResolutionFold, RulvarError, RunBudget, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxError, ScriptRejected, Semaphore, SettlementError, SpanRegistry, SupersededError, TOOL_NAME_PATTERN, TerminationAccount, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, accountSpendFromJournal, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, assertSafeRunId, atCompactionThreshold, attestToolset, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, citationTargetsValidator, citedValueValidator, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compareRates, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, enforceToolsetAttestation, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidenceGradeValidator, evidencePreservedValidator, executeWorkflow, executionFactsOf, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, findContradictions, finishContract, foldLedger, foldTermination, formatCharacterValidator, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, pairDraftClaims, parallelScope, parseModelRef, parseScopePath, persistedTerminalEnvelope, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceComponentsOf, priceEntryBilling, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualRequestsDelta, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleKey, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolContractHash, toolsetHash, ttlState, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
25356
+ export { AWAIT_SCHEMA, AdmissionController, AdmissionRejectedError, AgentCallError, BUDGET_ABORT_REASON, BudgetExhaustedError, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_JUDGE_LABEL, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, ConfigError, DEFAULT_ANCHOR_PATTERN, DEFAULT_ARTIFACT_PATTERN, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_CLAIM_JUDGE_MAX_TURNS, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_GRADE_PHRASES, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_CLAIM_PAIRS, DEFAULT_MAX_CONTRADICTIONS, DEFAULT_MAX_DEPTH, DEFAULT_MAX_EXCERPT_CHARS, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PAIR_EXCERPT_CHARS, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_POOL_PER_PAIR, DEFAULT_MAX_QUOTA_DENIALS, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_RUN_FACT_PAIRS, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DedupIndex, DeterminismError, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EscalationDecisionAbortedError, EventBus, ExternalRegistry, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_SECTIONAL_SCHEMA, FINISH_TOOL_NAME, FailRunError, FileModelKnowledgeStore, FileTranscriptStore, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, GitWorktreeProvider, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IN_FLIGHT_EXPOSURE_REFUSAL_PREFIX, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, InvalidResolutionError, JOURNAL_ENVELOPE_MARKER, JournalCompatibilityError, JournalMatcher, JournalMissError, JournalOrderViolation, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, KeyedLimiter, KnowledgeCasError, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LeaseHeldError, LineageIndex, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_CRITICAL_UNCOVERED, MAX_DEPTH_CEILING, MAX_RUN_FACTS_SHEET_CHARS, MAX_RUN_ID_LENGTH, MAX_TIMER_DELAY_MS, ModelRetry, NoProgressDetector, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OrchestratorCapConfigError, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, PlanInvariantError, QUOTA_WINDOW_MS, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_FACTS_ANCHOR, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, ReplayPlanHashMismatch, Replayer, ResolutionArbiter, ResolutionFold, RulvarError, RunBudget, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxError, ScriptRejected, Semaphore, SettlementError, SpanRegistry, SupersededError, TOOL_NAME_PATTERN, TerminationAccount, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, accountSpendFromJournal, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, assertSafeRunId, atCompactionThreshold, attestToolset, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, citationTargetsValidator, citedValueValidator, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compareRates, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, enforceToolsetAttestation, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidenceGradeValidator, evidencePreservedValidator, executeWorkflow, executionFactsOf, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, findContradictions, finishContract, foldLedger, foldTermination, formatCharacterValidator, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, pairDraftClaims, pairRunFactClaims, parallelScope, parseModelRef, parseScopePath, persistedTerminalEnvelope, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceComponentsOf, priceEntryBilling, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualRequestsDelta, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleKey, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolContractHash, toolsetHash, ttlState, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.172.0",
3
+ "version": "1.174.0",
4
4
  "description": "Rulvar core: L0 contracts, journal kernel, ctx primitives, agent runtime, model router, tool system, dynamic orchestrator, InMemory and JSONL stores, event stream.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",