@rulvar/core 1.245.0 → 1.246.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.
package/dist/index.d.ts CHANGED
@@ -922,6 +922,16 @@ interface CostAttributionFacts {
922
922
  */
923
923
  label?: string;
924
924
  finalizeReserve?: boolean;
925
+ /**
926
+ * What dispatched a semantic repair round (RV4105): 'claim' (the
927
+ * RV3307 contradiction round) or 'citation' (the RV4004 entailment
928
+ * round), stamped at dispatch beside `phase: 'repair'`, so the
929
+ * repair ledger attributes the round without cross-reading two
930
+ * metas. Absent on every other dispatch and on journals written
931
+ * before it shipped (absence means NOT RECORDED, RV1209). Policy,
932
+ * never identity.
933
+ */
934
+ repairTrigger?: "claim" | "citation";
925
935
  }
926
936
  /**
927
937
  * The per-model slices of a terminal entry: the recorded split when the
@@ -3712,6 +3722,75 @@ declare class ExternalRegistry {
3712
3722
  private resolveDetached;
3713
3723
  }
3714
3724
  //#endregion
3725
+ //#region src/l0/spi/regulated-posture.d.ts
3726
+ /**
3727
+ * The construction-side posture attestation (RV4101; the debt RV4009
3728
+ * named). The regulated floor binds what flows through
3729
+ * CreateEngineOptions / RunOptions / OrchestrateOptions, but the
3730
+ * postures that decide whether a tool list can drift under a run or
3731
+ * whether a provider executes tools outside the permission chain live
3732
+ * on CONSTRUCTIONS: the mcp() source and the AI SDK bridge adapter.
3733
+ * RV4009 deliberately excluded them from the profile hash ("a hash
3734
+ * must not imply what it cannot verify") and named them in prose
3735
+ * beside the call. This descriptor makes them verifiable: a
3736
+ * risk-bearing construction exposes `describeRegulatedPosture()`, a
3737
+ * PURE snapshot of what was chosen at construction time (no wire, no
3738
+ * connect, no side effects), and `compileRegulatedProfile` walks the
3739
+ * constructions reachable from its options, refuses a loosened
3740
+ * posture naming the field, and folds the sorted descriptors into the
3741
+ * hashed posture map beside an `unrecognized` count of the
3742
+ * constructions that exposed nothing, so the hash names its own blind
3743
+ * spot instead of implying totality.
3744
+ *
3745
+ * The descriptor is a snapshot, not a lease, and the window between
3746
+ * compile time and use is held by re-assertion (RV4102, the RV1608
3747
+ * template): the compiled options wrap each attested construction so
3748
+ * every use of its risk seam (`tools()` on a source, `stream()` on an
3749
+ * adapter) re-reads and re-judges the descriptor, refusing a posture
3750
+ * that moved since compile. The cross-process half of the window
3751
+ * needs no wrapper: a mutated construction compiles to a different
3752
+ * profile hash, and the RV3210 resume assertion refuses it.
3753
+ */
3754
+ /** The posture an mcp() tool source chose at construction (RV1516/RV1808). */
3755
+ interface McpSourceRegulatedPosture {
3756
+ /** Descriptor shape version; bumps when the meaning changes. */
3757
+ regulatedPosture: 1;
3758
+ kind: "mcp-source";
3759
+ /** The source id (`mcp:stdio:<command>`, `mcp:http:<url>`, `mcp:inprocess`). */
3760
+ name: string;
3761
+ /** What a listChanged notification means for this source (RV1516). */
3762
+ drift: "rekey" | "refuse";
3763
+ /**
3764
+ * The discovery bounds (RV1808); `declared` is the all-four
3765
+ * predicate `requireBounds` enforces (maxTools, maxPages,
3766
+ * maxSchemaBytes, timeouts.discoveryMs), and the declared values
3767
+ * ride beside it so the profile hash moves when a bound moves.
3768
+ */
3769
+ bounds: {
3770
+ declared: boolean;
3771
+ maxTools?: number;
3772
+ maxPages?: number;
3773
+ maxSchemaBytes?: number;
3774
+ discoveryMs?: number;
3775
+ };
3776
+ }
3777
+ /** The posture a bridgeAiSdk() adapter chose at construction. */
3778
+ interface AiSdkBridgeRegulatedPosture {
3779
+ /** Descriptor shape version; bumps when the meaning changes. */
3780
+ regulatedPosture: 1;
3781
+ kind: "ai-sdk-bridge";
3782
+ /** The adapter id. */
3783
+ name: string;
3784
+ /**
3785
+ * Whether provider-executed tool results are admitted past the
3786
+ * seam; 'allow' runs tools outside the permission chain and the
3787
+ * journal, which the regulated floor refuses.
3788
+ */
3789
+ providerExecutedTools: "allow" | "deny";
3790
+ }
3791
+ /** What `describeRegulatedPosture()` returns: one of the known shapes. */
3792
+ type RegulatedPostureDescriptor = McpSourceRegulatedPosture | AiSdkBridgeRegulatedPosture;
3793
+ //#endregion
3715
3794
  //#region src/l0/spi/toolsource.d.ts
3716
3795
  /**
3717
3796
  * Declarative risk metadata on the tool contract. Policy input, not
@@ -3794,6 +3873,15 @@ interface ToolSourceSession {
3794
3873
  interface ToolSource {
3795
3874
  id: string;
3796
3875
  tools(session: ToolSourceSession): Promise<ToolDef[]>;
3876
+ /**
3877
+ * The construction-side posture attestation (RV4101): a PURE
3878
+ * snapshot of the risk postures this source chose at construction
3879
+ * (no wire, no connect, no side effects), read by
3880
+ * `compileRegulatedProfile` to refuse a loosened posture and hash a
3881
+ * tightened one. Optional: a source without it counts into the
3882
+ * profile's `unrecognized` tally instead of being implied verified.
3883
+ */
3884
+ describeRegulatedPosture?(): RegulatedPostureDescriptor;
3797
3885
  }
3798
3886
  //#endregion
3799
3887
  //#region src/l0/spi/executor.d.ts
@@ -4020,6 +4108,15 @@ interface ProviderAdapter {
4020
4108
  countTokens?(req: ChatRequest, opts?: {
4021
4109
  signal?: AbortSignal;
4022
4110
  }): Promise<number>;
4111
+ /**
4112
+ * The construction-side posture attestation (RV4101): a PURE
4113
+ * snapshot of the risk postures this adapter chose at construction
4114
+ * (no wire, no side effects), read by `compileRegulatedProfile` to
4115
+ * refuse a loosened posture and hash a tightened one. Optional: an
4116
+ * adapter without it counts into the profile's `unrecognized` tally
4117
+ * instead of being implied verified.
4118
+ */
4119
+ describeRegulatedPosture?(): RegulatedPostureDescriptor;
4023
4120
  }
4024
4121
  //#endregion
4025
4122
  //#region src/l0/spi/knowledge.d.ts
@@ -11514,7 +11611,12 @@ interface OrchestrateClaimConsistency {
11514
11611
  * it and why. `expiresAt` (ISO 8601) bounds the standing waiver: an
11515
11612
  * expired one refuses exactly like no waiver, evaluated once at
11516
11613
  * the enforcement point and journaled, so a resume replays the
11517
- * recorded verdict instead of re-reading the clock. Requires
11614
+ * recorded verdict instead of re-reading the clock (RV4104): a run
11615
+ * that waived, crashed, and outlived its waiver finishes under the
11616
+ * recorded exception. The frozen decision licenses exactly the
11617
+ * document it judged: an entry carrying a `judgedHash` is honored
11618
+ * only for that hash (the RV603 bound), and entries written before
11619
+ * the field existed stay reusable. Requires
11518
11620
  * `coveragePolicy: 'strict-final'`; declaring it without the
11519
11621
  * policy is a ConfigError, because a waiver over an unenforced
11520
11622
  * grade is a signature over nothing.
@@ -14479,10 +14581,23 @@ interface JournaledPostFanIn {
14479
14581
  declare function criticalPathFromJournal(entries: readonly JournalEntry[]): JournaledCriticalPath;
14480
14582
  //#endregion
14481
14583
  //#region src/stores/repair-ledger.d.ts
14482
- /** One granted repair, folded from its journaled verdict (RV4002). */
14584
+ /** One counted repair, folded from its journaled verdict or dispatch (RV4002/RV4105). */
14483
14585
  interface RepairLedgerRound {
14484
- /** Which gate granted it: the draft gate, a composition invocation, or the RV3307 round's own pool. */
14485
- stage: "draft" | "composition" | "round";
14586
+ /**
14587
+ * Which gate granted it (the draft gate, a composition invocation,
14588
+ * or the RV3307 round's own pool), or 'semantic' for a dispatched
14589
+ * semantic repair round itself (RV4105): the round has no verdict
14590
+ * decision, so its row folds from the settled dispatch entry.
14591
+ */
14592
+ stage: "draft" | "composition" | "round" | "semantic";
14593
+ /**
14594
+ * What dispatched the semantic round (RV4105): 'claim' (the RV3307
14595
+ * contradiction round) or 'citation' (the RV4004 entailment round),
14596
+ * read from the `costAttribution.repairTrigger` stamped at dispatch.
14597
+ * Absent on non-semantic rows and on journals written before the
14598
+ * stamp shipped (absence means NOT RECORDED, RV1209).
14599
+ */
14600
+ trigger?: "claim" | "citation";
14486
14601
  /** The verdict decision's seq: the repair's address in the run. */
14487
14602
  seq: number;
14488
14603
  /** The finish call id the verdict was keyed by, when journaled. */
@@ -14517,7 +14632,12 @@ interface RepairLedger {
14517
14632
  semantic: number;
14518
14633
  /** draft + composition + semantic. */
14519
14634
  total: number;
14520
- /** One row per counted repair, in seq order (semantic rounds carry no verdict row). */
14635
+ /**
14636
+ * One row per counted repair, in seq order. Semantic rounds carry
14637
+ * their own rows since RV4105 (stage 'semantic', with the trigger
14638
+ * when the journal stamped one), so their wires have a home and
14639
+ * `semantic: 2` is decomposable without cross-reading metas.
14640
+ */
14521
14641
  rounds: readonly RepairLedgerRound[];
14522
14642
  /**
14523
14643
  * Finish-validation 'repair' verdicts with no journaled stage: the
@@ -17127,4 +17247,4 @@ interface SandboxBridge {
17127
17247
  declare const SANDBOX_AGENT_OPT_KEYS: readonly string[];
17128
17248
  declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
17129
17249
  //#endregion
17130
- export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, AcceptanceChildSummary, AcceptanceTailSpec, AcceptanceTailTerms, 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, ApprovalRevocationOutcome, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BillingComponent, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CITATION_JUDGE_SCHEMA, CLAIM_JUDGE_LABEL, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CachePolicy, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildExecutionFacts, ChildIdentityInput, ChildResultPage, ChildrenAtFailure, CitationAuditFinding, CitationAuditPlanOptions, CitationAuditRow, CitationAuditSectionMeta, CitationTarget, type ClaimClass, ClaimContradictionFinding, ClaimCoverageGrade, ClaimCoverageInput, type ClaimOp, ClaimPair, ClaimPairOptions, ClaimPairsFold, ClaimPoolReading, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ComponentDelta, ConfigError, Contradiction, ContradictionClaim, ContradictionOptions, ContradictionSource, type CoreEvents, CostAttribution, CostAttributionFacts, type CostBasis, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DECISION_CHAIN_KINDS, DEFAULT_ANCHOR_PATTERN, DEFAULT_ARTIFACT_PATTERN, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_EXCERPT_WINDOW, DEFAULT_CITATION_MAX_SAMPLED, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_CITATION_SAMPLE_PER_SECTION, 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, DecisionChainRow, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DelimitedStatementOptions, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DocumentedRates, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_AUTHORITY_HASH, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EXPOSURE_WAIT_SWEEP_MS, 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, ExecutionScope, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINAL_COMPOSITION_LABEL, FINISH_LESSON_CAP_CHARS, FINISH_SCHEMA, FINISH_SECTIONAL_SCHEMA, FINISH_TOOL_NAME, FUTURE_RATES_TOLERANCE_MS, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, type FinalizationWindowBudget, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishContractSectionPattern, FinishInfo, FinishRepairHint, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, GET_SETTLED_CHILD_RESULTS_SCHEMA, GET_SETTLED_CHILD_RESULTS_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, JournalIntegrityError, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSealedError, JournalSerializationContext, JournalSerializationHook, type JournalStore, JournaledChild, JournaledChildRoster, JournaledCriticalPath, JournaledPostFanIn, JournaledSynthesisCandidate, JournaledSynthesisCandidateReport, 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, LogicalRunTelemetry, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_CITATION_EXCERPT_CHARS, MAX_CITATION_EXCERPT_LINES, 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, OpenWireIntent, OperationDisposition, OrchestrateAcceptance, OrchestrateCitationAudit, OrchestrateClaimConsistency, OrchestrateClaimConsistencyMeta, OrchestrateContradictions, OrchestrateContradictionsMeta, OrchestrateDeterministicPatches, OrchestrateDraftToFinal, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, OutputContractManifest, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, PersistedTerminalRefusal, PersistedTerminalResult, type PhaseRow, PhaseTarget, PilotAgentProfileOptions, PilotAgentProfileResult, 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, ProviderStatement, 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, ReconcileStatementOptions, RefEntryAppender, RefEntryClassification, RefusalInfo, RegulatedProfile, RejectedFinishCandidate, RepairLedger, RepairLedgerRound, 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_ADMISSION_DECISION_TYPE, SPAWN_AGENT_SCHEMA, SYNTHESIS_NOTE_LABEL, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, SectionPatternEntry, SectionalRoundPlan, SemanticPassSummary, SemanticPassesSummary, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StatementCategoryRow, StatementColumnMap, StatementCoverage, StatementReconciliation, StatementRequestRow, StepIdentityInput, type StreamHooks, StructuredOutputTier, SupersededError, SuspendedAppend, SuspensionState, SynthesisCandidateFailure, TERMINAL_TELEMETRY_SCOPE, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TelemetryScope, type TerminalEnvelope, TerminalOutcomeFacts, TerminalPatch, TerminalTelemetryScopes, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, ToolAuthority, type ToolBudgetSummary, ToolCalibrationExclusion, ToolCalibrationReport, ToolCalibrationRow, 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, WireCapacityEstimate, WireCapacitySpec, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, acceptanceJudgePasses, acceptanceTailRequiredUsd, accountSpendFromJournal, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyFinishRepairHints, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, assertSafeRunId, atCompactionThreshold, attestToolset, attributionBucket, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, childRostersFromJournal, citationExcerptOf, citationTargetsValidator, citedValueValidator, claimCoverageOf, claimExpired, claimExpiry, claimIssues, claimJudgeStageOf, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compareRates, compilePermissionChain, compilePermissionPreset, compileRegulatedProfile, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, criticalPathFromJournal, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, enforceToolsetAttestation, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidenceGradeValidator, evidencePreservedValidator, executeWorkflow, executionFactsOf, executionScopeKey, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, findContradictions, finishContract, foldLedger, foldTermination, formatAcceptanceTailTerms, formatCharacterValidator, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, insertRunIdIntoSentence, invoiceFromJournal, isClaimJudgeLabel, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastMechanicalRepairCostUsd, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, logicalRunTelemetry, makeOrchestratorWorkflow, manifestValidators, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeExecutionScope, normalizeFallbacks, openWireIntentsOf, orchestrate, orchestratorAdmissionEstCostUsd, pairDraftClaims, pairRunFactClaims, parallelScope, parseCitationVerdicts, parseModelRef, parseScopePath, parseTerminalEnvelope, persistedTerminalEnvelope, phiInitialOf, pilotAgentProfile, pipelineScope, planNodeScope, preflightEstimate, priceComponentsOf, priceEntryBilling, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualRequestsDelta, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleKey, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reconcileStatement, reduceAuditTrail, reduceCriticalPath, reduceDecisionChain, reduceInvocationTable, registryKeyRing, remeasureQueue, renderContractRequirements, repairLedgerFromJournal, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredMentionsValidator, requiredSectionsValidator, researchAgentProfile, resolveCitationAuditPlan, resolveModelInvocation, resolvePricing, resolveToolset, retentionKeyOf, retryClassOf, retryDelayMs, retryWireMultiplier, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sampleCitationRows, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, scopeBucket, sectionCitationsValidator, sectionPatternCountValidator, sectionalRoundPlan, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, statementFromRows, statementRowsFromDelimited, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, synthesisCandidatesFromJournal, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolAuthority, toolCalibrationFromJournal, toolContract, toolContractHash, toolsetAuthorityHash, toolsetHash, ttlState, unionOfIntervalsMs, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wireCapacityEstimate, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
17250
+ export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, AcceptanceChildSummary, AcceptanceTailSpec, AcceptanceTailTerms, 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 AiSdkBridgeRegulatedPosture, type AppliedPricingRow, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, ApprovalRevocationOutcome, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BillingComponent, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CITATION_JUDGE_SCHEMA, CLAIM_JUDGE_LABEL, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CachePolicy, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildExecutionFacts, ChildIdentityInput, ChildResultPage, ChildrenAtFailure, CitationAuditFinding, CitationAuditPlanOptions, CitationAuditRow, CitationAuditSectionMeta, CitationTarget, type ClaimClass, ClaimContradictionFinding, ClaimCoverageGrade, ClaimCoverageInput, type ClaimOp, ClaimPair, ClaimPairOptions, ClaimPairsFold, ClaimPoolReading, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ComponentDelta, ConfigError, Contradiction, ContradictionClaim, ContradictionOptions, ContradictionSource, type CoreEvents, CostAttribution, CostAttributionFacts, type CostBasis, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DECISION_CHAIN_KINDS, DEFAULT_ANCHOR_PATTERN, DEFAULT_ARTIFACT_PATTERN, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_EXCERPT_WINDOW, DEFAULT_CITATION_MAX_SAMPLED, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_CITATION_SAMPLE_PER_SECTION, 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, DecisionChainRow, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DelimitedStatementOptions, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DocumentedRates, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_AUTHORITY_HASH, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EXPOSURE_WAIT_SWEEP_MS, 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, ExecutionScope, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINAL_COMPOSITION_LABEL, FINISH_LESSON_CAP_CHARS, FINISH_SCHEMA, FINISH_SECTIONAL_SCHEMA, FINISH_TOOL_NAME, FUTURE_RATES_TOLERANCE_MS, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, type FinalizationWindowBudget, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishContractSectionPattern, FinishInfo, FinishRepairHint, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, GET_SETTLED_CHILD_RESULTS_SCHEMA, GET_SETTLED_CHILD_RESULTS_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, JournalIntegrityError, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSealedError, JournalSerializationContext, JournalSerializationHook, type JournalStore, JournaledChild, JournaledChildRoster, JournaledCriticalPath, JournaledPostFanIn, JournaledSynthesisCandidate, JournaledSynthesisCandidateReport, 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, LogicalRunTelemetry, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_CITATION_EXCERPT_CHARS, MAX_CITATION_EXCERPT_LINES, MAX_CRITICAL_UNCOVERED, MAX_DEPTH_CEILING, MAX_RUN_FACTS_SHEET_CHARS, MAX_RUN_ID_LENGTH, MAX_TIMER_DELAY_MS, MatchResult, McpConfig, type McpSourceRegulatedPosture, 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, OpenWireIntent, OperationDisposition, OrchestrateAcceptance, OrchestrateCitationAudit, OrchestrateClaimConsistency, OrchestrateClaimConsistencyMeta, OrchestrateContradictions, OrchestrateContradictionsMeta, OrchestrateDeterministicPatches, OrchestrateDraftToFinal, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, OutputContractManifest, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, PersistedTerminalRefusal, PersistedTerminalResult, type PhaseRow, PhaseTarget, PilotAgentProfileOptions, PilotAgentProfileResult, 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, ProviderStatement, 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, ReconcileStatementOptions, RefEntryAppender, RefEntryClassification, RefusalInfo, type RegulatedPostureDescriptor, RegulatedProfile, RejectedFinishCandidate, RepairLedger, RepairLedgerRound, 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_ADMISSION_DECISION_TYPE, SPAWN_AGENT_SCHEMA, SYNTHESIS_NOTE_LABEL, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, SectionPatternEntry, SectionalRoundPlan, SemanticPassSummary, SemanticPassesSummary, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StatementCategoryRow, StatementColumnMap, StatementCoverage, StatementReconciliation, StatementRequestRow, StepIdentityInput, type StreamHooks, StructuredOutputTier, SupersededError, SuspendedAppend, SuspensionState, SynthesisCandidateFailure, TERMINAL_TELEMETRY_SCOPE, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TelemetryScope, type TerminalEnvelope, TerminalOutcomeFacts, TerminalPatch, TerminalTelemetryScopes, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, ToolAuthority, type ToolBudgetSummary, ToolCalibrationExclusion, ToolCalibrationReport, ToolCalibrationRow, 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, WireCapacityEstimate, WireCapacitySpec, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, acceptanceJudgePasses, acceptanceTailRequiredUsd, accountSpendFromJournal, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyFinishRepairHints, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, assertSafeRunId, atCompactionThreshold, attestToolset, attributionBucket, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, childRostersFromJournal, citationExcerptOf, citationTargetsValidator, citedValueValidator, claimCoverageOf, claimExpired, claimExpiry, claimIssues, claimJudgeStageOf, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compareRates, compilePermissionChain, compilePermissionPreset, compileRegulatedProfile, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, criticalPathFromJournal, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, enforceToolsetAttestation, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidenceGradeValidator, evidencePreservedValidator, executeWorkflow, executionFactsOf, executionScopeKey, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, findContradictions, finishContract, foldLedger, foldTermination, formatAcceptanceTailTerms, formatCharacterValidator, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, insertRunIdIntoSentence, invoiceFromJournal, isClaimJudgeLabel, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, journalPricingSnapshot, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastMechanicalRepairCostUsd, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, logicalRunTelemetry, makeOrchestratorWorkflow, manifestValidators, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeExecutionScope, normalizeFallbacks, openWireIntentsOf, orchestrate, orchestratorAdmissionEstCostUsd, pairDraftClaims, pairRunFactClaims, parallelScope, parseCitationVerdicts, parseModelRef, parseScopePath, parseTerminalEnvelope, persistedTerminalEnvelope, phiInitialOf, pilotAgentProfile, pipelineScope, planNodeScope, preflightEstimate, priceComponentsOf, priceEntryBilling, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualRequestsDelta, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleKey, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reconcileStatement, reduceAuditTrail, reduceCriticalPath, reduceDecisionChain, reduceInvocationTable, registryKeyRing, remeasureQueue, renderContractRequirements, repairLedgerFromJournal, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredMentionsValidator, requiredSectionsValidator, researchAgentProfile, resolveCitationAuditPlan, resolveModelInvocation, resolvePricing, resolveToolset, retentionKeyOf, retryClassOf, retryDelayMs, retryWireMultiplier, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sampleCitationRows, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, scopeBucket, sectionCitationsValidator, sectionPatternCountValidator, sectionalRoundPlan, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, statementFromRows, statementRowsFromDelimited, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, synthesisCandidatesFromJournal, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolAuthority, toolCalibrationFromJournal, toolContract, toolContractHash, toolsetAuthorityHash, toolsetHash, ttlState, unionOfIntervalsMs, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wireCapacityEstimate, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
package/dist/index.js CHANGED
@@ -4483,6 +4483,19 @@ function mcp(cfg) {
4483
4483
  };
4484
4484
  return {
4485
4485
  id: sourceIdOf(cfg),
4486
+ describeRegulatedPosture: () => ({
4487
+ regulatedPosture: 1,
4488
+ kind: "mcp-source",
4489
+ name: sourceIdOf(cfg),
4490
+ drift: cfg.drift ?? "rekey",
4491
+ bounds: {
4492
+ declared: cfg.maxTools !== void 0 && cfg.maxPages !== void 0 && cfg.maxSchemaBytes !== void 0 && cfg.timeouts?.discoveryMs !== void 0,
4493
+ ...cfg.maxTools === void 0 ? {} : { maxTools: cfg.maxTools },
4494
+ ...cfg.maxPages === void 0 ? {} : { maxPages: cfg.maxPages },
4495
+ ...cfg.maxSchemaBytes === void 0 ? {} : { maxSchemaBytes: cfg.maxSchemaBytes },
4496
+ ...cfg.timeouts?.discoveryMs === void 0 ? {} : { discoveryMs: cfg.timeouts.discoveryMs }
4497
+ }
4498
+ }),
4486
4499
  tools: async () => {
4487
4500
  if (poisoned) throw new ConfigError(`mcp: the tool list of '${sourceIdOf(cfg)}' changed after import (listChanged) and drift policy 'refuse' holds the source closed; close() and re-create the source (and re-record any toolset attestation) to import the changed list deliberately`);
4488
4501
  if (cache !== void 0) return cache;
@@ -9961,7 +9974,18 @@ function repairLedgerFromJournal(entries, priceUsd) {
9961
9974
  const wireRows = [];
9962
9975
  for (const entry of ordered) {
9963
9976
  if (entry.kind === "agent" && entry.status !== "running" && entry.status !== "suspended") {
9964
- if (entry.costAttribution?.label === "final-composition" && entry.costAttribution.phase === "repair") semantic += 1;
9977
+ if (entry.costAttribution?.label === "final-composition" && entry.costAttribution.phase === "repair") {
9978
+ semantic += 1;
9979
+ const trigger = entry.costAttribution.repairTrigger;
9980
+ const semanticRow = {
9981
+ stage: "semantic",
9982
+ seq: entry.seq,
9983
+ failedValidators: [],
9984
+ ...trigger === "claim" || trigger === "citation" ? { trigger } : {}
9985
+ };
9986
+ rounds.push(semanticRow);
9987
+ rowScopes.set(semanticRow, entry.scope);
9988
+ }
9965
9989
  continue;
9966
9990
  }
9967
9991
  if (entry.kind !== "decision") continue;
@@ -10031,16 +10055,16 @@ function repairLedgerFromJournal(entries, priceUsd) {
10031
10055
  break;
10032
10056
  }
10033
10057
  for (const wire of wireRows) {
10034
- let target;
10058
+ let nearest;
10035
10059
  for (const row of rounds) {
10036
- if (row.seq >= wire.seq || row.wireRef !== void 0 || rowScopes.get(row) !== wire.scope) continue;
10037
- target = row;
10060
+ if (row.seq >= wire.seq || rowScopes.get(row) !== wire.scope) continue;
10061
+ nearest = row;
10038
10062
  }
10039
- if (target === void 0) continue;
10040
- target.wireRef = wire.seq;
10063
+ if (nearest === void 0 || nearest.wireRef !== void 0) continue;
10064
+ nearest.wireRef = wire.seq;
10041
10065
  if (priceUsd !== void 0 && wire.record.servedBy !== void 0) {
10042
10066
  const usd = priceUsd(wire.record.servedBy, wire.record.usage);
10043
- if (usd !== void 0 && Number.isFinite(usd) && usd >= 0) target.costUsd = usd;
10067
+ if (usd !== void 0 && Number.isFinite(usd) && usd >= 0) nearest.costUsd = usd;
10044
10068
  }
10045
10069
  }
10046
10070
  rounds.sort((a, b) => a.seq - b.seq);
@@ -10288,7 +10312,7 @@ function toolCalibrationFromJournal(entries) {
10288
10312
  if (entry.kind !== "agent" || entry.ref === void 0 || entry.status === "running") continue;
10289
10313
  dispatches += 1;
10290
10314
  const role = entry.costAttribution?.role;
10291
- if ((role === "orchestrate" || role === "synthesize") && entry.toolBudget !== void 0) {
10315
+ if ((role === "orchestrate" || role === "synthesize") && entry.toolBudget !== void 0 && entry.evidence === void 0) {
10292
10316
  coordinationDispatches += 1;
10293
10317
  coordinationToolCalls += entry.toolBudget.used;
10294
10318
  continue;
@@ -20329,6 +20353,7 @@ function createCtx(internals, rootWorkflow) {
20329
20353
  ...result.providerCalls === void 0 ? {} : { providerCalls: result.providerCalls },
20330
20354
  costAttribution: {
20331
20355
  ...state.phase === void 0 ? {} : { phase: state.phase },
20356
+ ...state.repairTrigger === void 0 ? {} : { repairTrigger: state.repairTrigger },
20332
20357
  agentType,
20333
20358
  role: primaryRole,
20334
20359
  budgetAccount: state.budgetScope ?? "run",
@@ -26953,7 +26978,7 @@ function makeOrchestratorWorkflow(goal, opts) {
26953
26978
  }
26954
26979
  }, callingState.spanId);
26955
26980
  };
26956
- const runSynthesis = async (draft, stagePhase = "composition") => {
26981
+ const runSynthesis = async (draft, stagePhase = "composition", repairTrigger) => {
26957
26982
  const spec = opts?.synthesis;
26958
26983
  if (spec === void 0) return draft;
26959
26984
  await recoveryDone;
@@ -27312,6 +27337,7 @@ function makeOrchestratorWorkflow(goal, opts) {
27312
27337
  const heldReserveUsd = orchestratorAccount === void 0 ? 0 : internals.budget.accountView(orchestratorAccount)?.synthesisReserveUsd ?? 0;
27313
27338
  const synthesisState = { ...callingState };
27314
27339
  synthesisState.phase = synthesisState.phase ?? stagePhase;
27340
+ if (repairTrigger !== void 0) synthesisState.repairTrigger = repairTrigger;
27315
27341
  if (orchestratorAccount !== void 0) {
27316
27342
  synthesisState.budgetScope = orchestratorAccount;
27317
27343
  internals.budget.releaseSynthesisReserve(orchestratorAccount);
@@ -28096,7 +28122,7 @@ function makeOrchestratorWorkflow(goal, opts) {
28096
28122
  }, callingState.spanId);
28097
28123
  }
28098
28124
  try {
28099
- synthesizedFinal = await runSynthesis(result.output, "repair");
28125
+ synthesizedFinal = await runSynthesis(result.output, "repair", "claim");
28100
28126
  } catch (thrown) {
28101
28127
  await journalSynthesisAdmissionDecline(thrown);
28102
28128
  const hostRejection = thrown instanceof FailRunError && typeof thrown.data === "object" && thrown.data !== null && !Array.isArray(thrown.data) && thrown.data.source === "orchestrator_finish_validation" ? thrown.data : void 0;
@@ -28208,7 +28234,7 @@ function makeOrchestratorWorkflow(goal, opts) {
28208
28234
  }
28209
28235
  carriedCitationFindings = carried;
28210
28236
  try {
28211
- synthesizedFinal = await runSynthesis(result.output, "repair");
28237
+ synthesizedFinal = await runSynthesis(result.output, "repair", "citation");
28212
28238
  } catch (thrown) {
28213
28239
  await journalSynthesisAdmissionDecline(thrown);
28214
28240
  const auditHostRejection = (thrown instanceof FailRunError && typeof thrown.data === "object" && thrown.data !== null && !Array.isArray(thrown.data) ? thrown.data.source : void 0) === "orchestrator_finish_validation" ? thrown.data : void 0;
@@ -28274,34 +28300,49 @@ function makeOrchestratorWorkflow(goal, opts) {
28274
28300
  if (opts?.claimConsistency?.coveragePolicy === "strict-final") {
28275
28301
  const grade = claimConsistencyMeta?.coverage ?? "not-judged";
28276
28302
  if (grade !== "full") {
28277
- const waiverSpec = opts.claimConsistency.waiver;
28278
- const expired = waiverSpec?.expiresAt !== void 0 && Date.parse(waiverSpec.expiresAt) < internals.now();
28279
- if (waiverSpec === void 0 || expired) throw new FailRunError(`claimConsistency.coveragePolicy 'strict-final': the final coverage grade is '${grade}', not 'full', and ` + (waiverSpec === void 0 ? "no waiver is declared" : `the declared waiver expired at ${String(waiverSpec.expiresAt)}`) + "; raise the coverage (pairs, targets, critical anchors) or record a waiver naming who accepts the gap and why", { data: {
28280
- source: "orchestrator_claim_consistency",
28281
- coveragePolicy: "strict-final",
28282
- coverage: grade,
28283
- ...waiverSpec === void 0 ? {} : { waiverExpiredAt: waiverSpec.expiresAt ?? null },
28284
- ...claimConsistencyMeta === void 0 ? {} : { claimConsistencyMeta }
28285
- } });
28286
- claimCoverageWaiver = {
28287
- principal: waiverSpec.principal,
28288
- reason: waiverSpec.reason,
28289
- ...waiverSpec.expiresAt === void 0 ? {} : { expiresAt: waiverSpec.expiresAt },
28290
- coverage: grade
28291
- };
28292
- await internals.replayer.appendSinglePhase({
28293
- scope: callingState.scope,
28294
- key: deriverV2.deriveKey({ kind: "claim-coverage-waived" }),
28295
- kind: "decision",
28296
- status: "ok",
28297
- spanId: internals.spans.mint(callingState.spanId),
28298
- site: "orchestrator-claim-coverage",
28299
- value: {
28300
- decisionType: "claim_coverage_waived",
28301
- ...claimCoverageWaiver,
28302
- ...claimConsistencyMeta?.judgedHash === void 0 ? {} : { judgedHash: claimConsistencyMeta.judgedHash }
28303
- }
28303
+ const priorWaiveDecision = internals.replayer.snapshot().find((entry) => {
28304
+ if (entry.kind !== "decision" || entry.scope !== callingState.scope) return false;
28305
+ const value = entry.value;
28306
+ return value?.decisionType === "claim_coverage_waived" && (value.judgedHash === void 0 || value.judgedHash === claimConsistencyMeta?.judgedHash);
28304
28307
  });
28308
+ if (priorWaiveDecision !== void 0) {
28309
+ const frozen = priorWaiveDecision.value;
28310
+ claimCoverageWaiver = {
28311
+ principal: frozen.principal,
28312
+ reason: frozen.reason,
28313
+ ...frozen.expiresAt === void 0 ? {} : { expiresAt: frozen.expiresAt },
28314
+ coverage: frozen.coverage
28315
+ };
28316
+ } else {
28317
+ const waiverSpec = opts.claimConsistency.waiver;
28318
+ const expired = waiverSpec?.expiresAt !== void 0 && Date.parse(waiverSpec.expiresAt) < internals.now();
28319
+ if (waiverSpec === void 0 || expired) throw new FailRunError(`claimConsistency.coveragePolicy 'strict-final': the final coverage grade is '${grade}', not 'full', and ` + (waiverSpec === void 0 ? "no waiver is declared" : `the declared waiver expired at ${String(waiverSpec.expiresAt)}`) + "; raise the coverage (pairs, targets, critical anchors) or record a waiver naming who accepts the gap and why", { data: {
28320
+ source: "orchestrator_claim_consistency",
28321
+ coveragePolicy: "strict-final",
28322
+ coverage: grade,
28323
+ ...waiverSpec === void 0 ? {} : { waiverExpiredAt: waiverSpec.expiresAt ?? null },
28324
+ ...claimConsistencyMeta === void 0 ? {} : { claimConsistencyMeta }
28325
+ } });
28326
+ claimCoverageWaiver = {
28327
+ principal: waiverSpec.principal,
28328
+ reason: waiverSpec.reason,
28329
+ ...waiverSpec.expiresAt === void 0 ? {} : { expiresAt: waiverSpec.expiresAt },
28330
+ coverage: grade
28331
+ };
28332
+ await internals.replayer.appendSinglePhase({
28333
+ scope: callingState.scope,
28334
+ key: deriverV2.deriveKey({ kind: "claim-coverage-waived" }),
28335
+ kind: "decision",
28336
+ status: "ok",
28337
+ spanId: internals.spans.mint(callingState.spanId),
28338
+ site: "orchestrator-claim-coverage",
28339
+ value: {
28340
+ decisionType: "claim_coverage_waived",
28341
+ ...claimCoverageWaiver,
28342
+ ...claimConsistencyMeta?.judgedHash === void 0 ? {} : { judgedHash: claimConsistencyMeta.judgedHash }
28343
+ }
28344
+ });
28345
+ }
28305
28346
  }
28306
28347
  }
28307
28348
  return {
@@ -31292,16 +31333,95 @@ function createEngine(options) {
31292
31333
  * no strategy enum and no behavioral branch; a host that wants the
31293
31334
  * posture applies the compiled options like any others. The floor
31294
31335
  * binds what flows through CreateEngineOptions / RunOptions /
31295
- * OrchestrateOptions; construction-side postures the options cannot
31296
- * see (MCP source `drift: 'refuse'` and bounds, the AI SDK bridge's
31297
- * `providerExecutedTools: 'deny'`) are named in the docs checklist
31298
- * beside this function, because a hash must not imply what it cannot
31299
- * verify.
31300
- */
31301
- const REGULATED_VERSION = 1;
31336
+ * OrchestrateOptions, and since RV4101 it also walks the
31337
+ * CONSTRUCTIONS those options reach (adapters, tool sources in named
31338
+ * toolsets and profiles). A construction exposing
31339
+ * `describeRegulatedPosture()` has its posture judged by field name
31340
+ * (an MCP source's drift must be 'refuse' with every discovery bound
31341
+ * declared; the AI SDK bridge must keep providerExecutedTools
31342
+ * 'deny'), the sorted descriptors enter the hashed map under
31343
+ * `construction`, and constructions exposing nothing are COUNTED
31344
+ * there as `unrecognized`, so the hash names its own blind spot
31345
+ * instead of implying totality (the RV4009 rule "a hash must not
31346
+ * imply what it cannot verify", now with the verifiable part
31347
+ * verified). The between-compile-and-use window is held as well
31348
+ * (RV4102): the compiled options carry re-asserting wrappers whose
31349
+ * risk seams re-judge the descriptor on every use, and the
31350
+ * cross-process half was always held by the RV3210 fingerprint
31351
+ * assertion.
31352
+ */
31353
+ const REGULATED_VERSION = 2;
31302
31354
  function refuse(field, requirement) {
31303
31355
  throw new ConfigError(`compileRegulatedProfile: ${field} ${requirement}; the regulated floor is non-loosenable, so drop the field to inherit the floor or meet it explicitly`);
31304
31356
  }
31357
+ /**
31358
+ * Judges one construction's descriptor against the floor (RV4101) and
31359
+ * returns the normalized shape that enters the hashed posture map.
31360
+ * Shared by the compile walk and the use-time re-assertion (RV4102),
31361
+ * so a posture that loosens AFTER compile refuses with the same
31362
+ * field-named error it would have refused with at compile time.
31363
+ */
31364
+ function judgeDescriptor(raw) {
31365
+ const descriptor = raw;
31366
+ if (descriptor === null || typeof descriptor !== "object" || descriptor.regulatedPosture !== 1 || typeof descriptor.name !== "string" || descriptor.name === "") refuse("construction", "exposes describeRegulatedPosture() with an unrecognized shape (need regulatedPosture: 1, a non-empty string name, and a known kind)");
31367
+ if (descriptor.kind === "mcp-source") {
31368
+ const mcpPosture = descriptor;
31369
+ if (mcpPosture.drift !== "refuse") refuse(`construction['${descriptor.name}'].drift`, "must be 'refuse' (RV1516): under a rekey posture a listChanged notification imports a changed tool list beneath the regulated run");
31370
+ const bounds = mcpPosture.bounds;
31371
+ if (bounds === void 0 || bounds.declared !== true) refuse(`construction['${descriptor.name}'].bounds`, "must declare every discovery bound (maxTools, maxPages, maxSchemaBytes, timeouts.discoveryMs; RV1808): an unbounded sweep against a remote registry is an availability decision someone should have made on purpose");
31372
+ return {
31373
+ regulatedPosture: 1,
31374
+ kind: "mcp-source",
31375
+ name: descriptor.name,
31376
+ drift: "refuse",
31377
+ bounds: {
31378
+ declared: true,
31379
+ ...typeof bounds.maxTools === "number" ? { maxTools: bounds.maxTools } : {},
31380
+ ...typeof bounds.maxPages === "number" ? { maxPages: bounds.maxPages } : {},
31381
+ ...typeof bounds.maxSchemaBytes === "number" ? { maxSchemaBytes: bounds.maxSchemaBytes } : {},
31382
+ ...typeof bounds.discoveryMs === "number" ? { discoveryMs: bounds.discoveryMs } : {}
31383
+ }
31384
+ };
31385
+ }
31386
+ if (descriptor.kind === "ai-sdk-bridge") {
31387
+ if (descriptor.providerExecutedTools !== "deny") refuse(`construction['${descriptor.name}'].providerExecutedTools`, "must be 'deny': a provider-executed tool runs outside the permission chain and the journal");
31388
+ return {
31389
+ regulatedPosture: 1,
31390
+ kind: "ai-sdk-bridge",
31391
+ name: descriptor.name,
31392
+ providerExecutedTools: "deny"
31393
+ };
31394
+ }
31395
+ refuse(`construction['${descriptor.name}']`, `attests an unrecognized kind '${String(descriptor.kind)}'; this floor can judge 'mcp-source' and 'ai-sdk-bridge'`);
31396
+ }
31397
+ /**
31398
+ * The use-time re-assertion (RV4102, the RV1608 template). The
31399
+ * descriptor is a snapshot, and the window between compile and use is
31400
+ * where a construction mutated in-process could walk a moved posture
31401
+ * beneath the hash. The compiled options therefore carry this proxy
31402
+ * in the original's place: every use of the risk seam (`tools` on a
31403
+ * source, `stream` on an adapter) re-reads and re-judges the
31404
+ * descriptor first. A loosening refuses with the compile-time
31405
+ * field-named error; any other movement (a rename, a bound change, a
31406
+ * vanished descriptor) refuses naming the drift. Everything else
31407
+ * passes through untouched, so `close()`, `caps()`, and identity
31408
+ * fields behave exactly as before. The cross-process half of the
31409
+ * window needs no proxy: a mutated construction compiles to a
31410
+ * different profile hash, and the RV3210 resume assertion refuses it.
31411
+ */
31412
+ function wrapReasserting(construction, frozen) {
31413
+ const guard = (seam, original) => (...args) => {
31414
+ const probe = construction.describeRegulatedPosture;
31415
+ const fresh = typeof probe === "function" ? jcsSerialize(judgeDescriptor(probe.call(construction))) : void 0;
31416
+ if (fresh !== frozen) throw new ConfigError(`compileRegulatedProfile: the construction posture moved between compile time and ${seam}() (RV4102): the compiled profile licensed ${frozen}, the construction now reports ${fresh ?? "no describeRegulatedPosture() at all"}. Recompile the profile deliberately instead of mutating a construction beneath it.`);
31417
+ return original.apply(construction, args);
31418
+ };
31419
+ return new Proxy(construction, { get(target, prop) {
31420
+ const value = Reflect.get(target, prop, target);
31421
+ if ((prop === "tools" || prop === "stream") && typeof value === "function") return guard(String(prop), value);
31422
+ return value;
31423
+ } });
31424
+ }
31305
31425
  function compileRegulatedProfile(input) {
31306
31426
  const engine = {
31307
31427
  ...input.engine,
@@ -31325,18 +31445,57 @@ function compileRegulatedProfile(input) {
31325
31445
  if (profile.permissions?.strictApprovals === false) refuse(`defaults.profiles.${name}.permissions.strictApprovals`, "must not be false");
31326
31446
  if (profile.tools !== void 0 && profile.toolsetAttestation === void 0) refuse(`defaults.profiles.${name}`, "declares tools without a toolsetAttestation (pin the resolved hashes)");
31327
31447
  }
31328
- if (typeof run.budgetUsd !== "number") refuse("run.budgetUsd", "must declare a USD ceiling");
31448
+ const walked = /* @__PURE__ */ new Set();
31449
+ const attested = [];
31450
+ const reasserted = /* @__PURE__ */ new Map();
31451
+ let unrecognized = 0;
31452
+ const visit = (construction) => {
31453
+ if (construction === null || typeof construction !== "object" || walked.has(construction)) return;
31454
+ walked.add(construction);
31455
+ const probe = construction.describeRegulatedPosture;
31456
+ if (typeof probe !== "function") {
31457
+ unrecognized += 1;
31458
+ return;
31459
+ }
31460
+ const judged = judgeDescriptor(probe.call(construction));
31461
+ attested.push(judged);
31462
+ reasserted.set(construction, wrapReasserting(construction, jcsSerialize(judged)));
31463
+ };
31464
+ for (const adapter of engine.adapters ?? []) visit(adapter);
31465
+ const visitTools = (tools) => {
31466
+ for (const entry of tools ?? []) {
31467
+ if (typeof entry === "string" || entry.kind === "tool") continue;
31468
+ visit(entry);
31469
+ }
31470
+ };
31471
+ for (const toolset of Object.values(defaults.toolsets ?? {})) visitTools(toolset);
31472
+ for (const profile of Object.values(defaults.profiles ?? {})) visitTools(profile.tools);
31473
+ const swap = (value) => typeof value === "object" && value !== null && reasserted.has(value) ? reasserted.get(value) : value;
31474
+ if (reasserted.size > 0) {
31475
+ if (engine.adapters !== void 0) engine.adapters = engine.adapters.map(swap);
31476
+ if (defaults.toolsets !== void 0) defaults.toolsets = Object.fromEntries(Object.entries(defaults.toolsets).map(([name, tools]) => [name, tools.map(swap)]));
31477
+ if (defaults.profiles !== void 0) defaults.profiles = Object.fromEntries(Object.entries(defaults.profiles).map(([name, profile]) => [name, profile.tools === void 0 ? profile : {
31478
+ ...profile,
31479
+ tools: profile.tools.map(swap)
31480
+ }]));
31481
+ }
31482
+ const postureKeyOf = (entry) => `${entry.kind} ${entry.name}`;
31483
+ attested.sort((a, b) => postureKeyOf(a) < postureKeyOf(b) ? -1 : postureKeyOf(a) > postureKeyOf(b) ? 1 : 0);
31484
+ if (typeof run.budgetUsd !== "number" || !Number.isFinite(run.budgetUsd) || run.budgetUsd <= 0) refuse("run.budgetUsd", "must declare a positive finite USD ceiling (RV4107): NaN and Infinity are not ceilings, and a non-positive one is a run that cannot pay for its own floor");
31329
31485
  if (run.strictPricing === false) refuse("run.strictPricing", "must not be false");
31330
31486
  run.strictPricing = run.strictPricing ?? true;
31331
31487
  if (run.budgetPolicy !== void 0 && run.budgetPolicy !== "immutable-lifetime") refuse("run.budgetPolicy", "must be 'immutable-lifetime' (RV3902)");
31332
31488
  run.budgetPolicy = "immutable-lifetime";
31333
31489
  if (run.scope === void 0) refuse("run.scope", "must name the execution scope (RV4007): a regulated run has an owner");
31490
+ run.scope = normalizeExecutionScope(run.scope, "compileRegulatedProfile run.scope");
31334
31491
  if (orchestrate !== void 0) {
31335
31492
  const budget = { ...orchestrate.budget ?? {} };
31336
31493
  if (budget.acceptanceReserve !== void 0 && budget.acceptanceReserve !== "require") refuse("orchestrate.budget.acceptanceReserve", "must be 'require' (RV3907/RV4001)");
31337
31494
  budget.acceptanceReserve = "require";
31338
31495
  orchestrate.budget = budget;
31339
31496
  if (orchestrate.citationAudit === void 0) refuse("orchestrate.citationAudit", "must be declared with the host snapshot resolver (RV4004): entailment is the regulated posture, not an option");
31497
+ if (typeof orchestrate.citationAudit.resolve !== "function") refuse("orchestrate.citationAudit.resolve", "must be the host snapshot resolver function (RV4004/RV4107)");
31498
+ if (orchestrate.claimConsistency === void 0) refuse("orchestrate.claimConsistency", "must be declared with stage 'final' or 'both' (RV4103): the claim machinery is the regulated posture, and omitting it entirely is the deepest loosening");
31340
31499
  if (orchestrate.claimConsistency !== void 0) {
31341
31500
  const claim = { ...orchestrate.claimConsistency };
31342
31501
  if (claim.coveragePolicy !== void 0 && claim.coveragePolicy !== "strict-final") refuse("orchestrate.claimConsistency.coveragePolicy", "must be 'strict-final' (RV4003)");
@@ -31350,6 +31509,10 @@ function compileRegulatedProfile(input) {
31350
31509
  strictApprovals: true,
31351
31510
  billingReceipts: "intent",
31352
31511
  determinism: "error",
31512
+ construction: {
31513
+ attested,
31514
+ unrecognized
31515
+ },
31353
31516
  strictPricing: run.strictPricing === true ? true : run.strictPricing,
31354
31517
  budgetPolicy: "immutable-lifetime",
31355
31518
  budgetUsd: run.budgetUsd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.245.0",
3
+ "version": "1.246.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",