@rulvar/core 1.228.0 → 1.229.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
@@ -2216,6 +2216,22 @@ type CoreEvents = {
2216
2216
  */
2217
2217
  belowFloorOkChildren?: string[];
2218
2218
  /**
2219
+ * What the children had produced when the run died BEFORE any
2220
+ * acceptance verdict (RV2602), lifted on its own rather than with
2221
+ * the completion, because it exists for the terminal where there
2222
+ * is no completion to lift. Present exactly when children were
2223
+ * spawned and no acceptance verdict exists, so it never overlaps
2224
+ * the fields above. Frozen at the moment of death, ahead of the
2225
+ * RV1903 exit barrier, which is why `unsettled` can be non-empty.
2226
+ */
2227
+ childrenAtFailure?: {
2228
+ spawned: number;
2229
+ settled: number;
2230
+ statusCounts: Record<string, number>;
2231
+ belowFloorOkChildren?: string[];
2232
+ unsettled?: string[];
2233
+ };
2234
+ /**
2219
2235
  * Present and false ONLY when nothing durable records this
2220
2236
  * terminal: a settlement write failed (the run_settle journal
2221
2237
  * append or the terminal RunMeta projection, RV907), or the
@@ -5577,6 +5593,16 @@ interface RunAgentOptions<S extends SchemaSpec = JsonSchema> {
5577
5593
  remaining: number;
5578
5594
  reserveCalls: number;
5579
5595
  budget: FinalizationWindowBudget;
5596
+ /**
5597
+ * Present exactly when RV1208 widened the reserve past the
5598
+ * configured one (RV2601): the outstanding evidence entries, and
5599
+ * the floor they are outstanding against. Absent means the
5600
+ * configured reserve is what bound, so the arithmetic behind an
5601
+ * unexpected reserve is always in the journal and never only in
5602
+ * the notice the model read.
5603
+ */
5604
+ evidenceDeficit?: number;
5605
+ minEntries?: number;
5580
5606
  }) => Promise<void>;
5581
5607
  };
5582
5608
  /** Emits agent:stream deltas when true (telemetry only). */
@@ -11701,6 +11727,28 @@ interface RejectedFinishCandidate {
11701
11727
  /** Transcript ref holding the bytes; absent unless retention is on and the write succeeded. */
11702
11728
  ref?: string;
11703
11729
  }
11730
+ /**
11731
+ * The roster facts of a run that died before any acceptance verdict
11732
+ * (RV2602): a fold over the children's own journaled terminals, so an
11733
+ * `exhausted` or failed orchestration still names the work it paid for.
11734
+ */
11735
+ interface ChildrenAtFailure {
11736
+ /** Children admitted, whether or not they settled. */
11737
+ spawned: number;
11738
+ /** Of those, the ones carrying a terminal at the moment of death. */
11739
+ settled: number;
11740
+ /** Their statuses, counted; the same vocabulary a child terminal uses. */
11741
+ statusCounts: Record<string, number>;
11742
+ /**
11743
+ * Children that settled `ok` under a declared evidence contract they
11744
+ * did not meet. The acceptance fold names these too, but only after
11745
+ * it runs: the fourth parity run's silent worker was `ok` with zero
11746
+ * recorded entries and its run never reached acceptance at all.
11747
+ */
11748
+ belowFloorOkChildren?: string[];
11749
+ /** Children still running when the run gave up; absent when none were. */
11750
+ unsettled?: string[];
11751
+ }
11704
11752
  interface AcceptanceChildSummary {
11705
11753
  child: string;
11706
11754
  status: string;
@@ -11837,7 +11885,28 @@ type RunOutcome<R> = {
11837
11885
  * verdict. Replay-stable: the roster is journaled inside the single
11838
11886
  * acceptance decision.
11839
11887
  */
11840
- acceptanceChildren?: AcceptanceChildSummary[]; /** Pipeline drops and onError:'null' losses; silent losses are forbidden. */
11888
+ acceptanceChildren?: AcceptanceChildSummary[];
11889
+ /**
11890
+ * What the children had produced when the run died BEFORE its
11891
+ * acceptance policy ever rendered a verdict (RV2602).
11892
+ *
11893
+ * Every other field on this envelope describes a policy's claim, and
11894
+ * a policy that never ran claims nothing: an orchestration whose
11895
+ * coordination loop crosses its ceiling mid-roster settles with
11896
+ * `completion` absent, and until this shipped the terminal said
11897
+ * nothing at all about work that was already paid for, even though
11898
+ * every child terminal was in the journal. Deliberately NOT
11899
+ * `childStatusCounts`: that field is the acceptance fold's number,
11900
+ * and a fold done by no policy must not borrow its name.
11901
+ *
11902
+ * Present exactly when children were spawned AND no acceptance
11903
+ * verdict exists, so the two readings never overlap and neither can
11904
+ * be mistaken for the other. Frozen at the moment of death, before
11905
+ * the RV1903 exit barrier settles the stragglers, which is why
11906
+ * `unsettled` can be non-empty: those children had not landed when
11907
+ * the run gave up.
11908
+ */
11909
+ childrenAtFailure?: ChildrenAtFailure; /** Pipeline drops and onError:'null' losses; silent losses are forbidden. */
11841
11910
  dropped: DroppedItem[]; /** Suspensions open at settle time (M2). */
11842
11911
  pending: PendingExternal[];
11843
11912
  usage: Usage;
@@ -12780,6 +12849,15 @@ declare function lastRunSettle(entries: readonly JournalEntry[]): {
12780
12849
  seq: number;
12781
12850
  outputHash?: string;
12782
12851
  completion?: "complete" | "partial" | "rejected";
12852
+ /**
12853
+ * The rejected finish candidates the settle recorded (RV2507),
12854
+ * read back for offline readers (RV2605). The settle persists the
12855
+ * whole completion lift, so this needs no re-fold and no
12856
+ * validator re-run; it is parsed defensively, exactly like
12857
+ * `completion`, so a foreign or older journal reads as "not
12858
+ * recorded" rather than as a claim.
12859
+ */
12860
+ rejectedFinishCandidates?: RejectedFinishCandidate[];
12783
12861
  } | undefined;
12784
12862
  /**
12785
12863
  * Whether a terminal figure counts THIS segment's work or the whole
@@ -14695,4 +14773,4 @@ interface SandboxBridge {
14695
14773
  declare const SANDBOX_AGENT_OPT_KEYS: readonly string[];
14696
14774
  declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
14697
14775
  //#endregion
14698
- 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, BillingComponent, 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, CachePolicy, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildExecutionFacts, ChildIdentityInput, ChildResultPage, 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_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, DecisionChainRow, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, 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, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, 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, 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, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSealedError, 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, LogicalRunTelemetry, 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, OrchestrateDraftToFinal, 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, 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, RejectedFinishCandidate, 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, SectionPatternEntry, 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, TERMINAL_TELEMETRY_SCOPE, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TelemetryScope, type TerminalEnvelope, TerminalOutcomeFacts, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, ToolAuthority, 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, claimCoverageOf, 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, logicalRunTelemetry, 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, 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, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, sectionPatternCountValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, statementFromRows, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolAuthority, toolContract, toolContractHash, toolsetAuthorityHash, toolsetHash, ttlState, usageViolations, validateDetachedResolution, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateToolsetAttestation, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
14776
+ 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, BillingComponent, 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, CachePolicy, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildExecutionFacts, ChildIdentityInput, ChildResultPage, ChildrenAtFailure, 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_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, DecisionChainRow, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, 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, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, 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, 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, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, type JournalPricingSnapshot, JournalSealedError, 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, LogicalRunTelemetry, 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, OrchestrateDraftToFinal, 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, 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, RejectedFinishCandidate, 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, SectionPatternEntry, 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, TERMINAL_TELEMETRY_SCOPE, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TelemetryScope, type TerminalEnvelope, TerminalOutcomeFacts, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, ToolAuthority, 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, claimCoverageOf, 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, logicalRunTelemetry, 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, 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, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, sectionPatternCountValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotQuotaRules, snapshotUsage, spawnDepthOf, spliceSections, statementFromRows, stripFencedBlocks, sumUsage, summarizeInstruction, summarizeOutput, terminalEnvelopeOf, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolAuthority, toolContract, toolContractHash, toolsetAuthorityHash, 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
@@ -8736,16 +8736,52 @@ function lastRunSettle(entries) {
8736
8736
  const value = entry.value;
8737
8737
  if (value?.decisionType === "run_settle" && typeof value.runStatus === "string" && RUN_STATUSES.has(value.runStatus)) {
8738
8738
  const completion = value.completion;
8739
+ const rejected = readRejectedFinishCandidates(value.rejectedFinishCandidates);
8739
8740
  return {
8740
8741
  runStatus: value.runStatus,
8741
8742
  seq: entry.seq,
8742
8743
  ...typeof value.outputHash === "string" ? { outputHash: value.outputHash } : {},
8743
- ...completion === "complete" || completion === "partial" || completion === "rejected" ? { completion } : {}
8744
+ ...completion === "complete" || completion === "partial" || completion === "rejected" ? { completion } : {},
8745
+ ...rejected === void 0 ? {} : { rejectedFinishCandidates: rejected }
8744
8746
  };
8745
8747
  }
8746
8748
  }
8747
8749
  }
8748
8750
  /**
8751
+ * The rejected finish candidates of a persisted settle, or `undefined`
8752
+ * (RV2605). The WHOLE list drops on any malformed row, the same posture
8753
+ * the live lift takes (RV2507): a partial history read as complete
8754
+ * would under-report exactly the runs that misbehaved most.
8755
+ */
8756
+ function readRejectedFinishCandidates(raw) {
8757
+ if (!Array.isArray(raw) || raw.length === 0) return;
8758
+ const rows = [];
8759
+ for (const row of raw) {
8760
+ if (typeof row !== "object" || row === null) return;
8761
+ const { callId, verdict, hash, chars, failed, ref } = row;
8762
+ if (typeof callId !== "string" || verdict !== "repair" && verdict !== "rejected" || typeof hash !== "string" || typeof chars !== "number" || !Number.isSafeInteger(chars) || chars < 0 || !Array.isArray(failed) || ref !== void 0 && typeof ref !== "string") return;
8763
+ const validators = [];
8764
+ for (const entry of failed) {
8765
+ if (typeof entry !== "object" || entry === null) return;
8766
+ const { name, reasons } = entry;
8767
+ if (typeof name !== "string" || !Array.isArray(reasons) || reasons.some((reason) => typeof reason !== "string")) return;
8768
+ validators.push({
8769
+ name,
8770
+ reasons
8771
+ });
8772
+ }
8773
+ rows.push({
8774
+ callId,
8775
+ verdict,
8776
+ hash,
8777
+ chars,
8778
+ failed: validators,
8779
+ ...ref === void 0 ? {} : { ref }
8780
+ });
8781
+ }
8782
+ return rows;
8783
+ }
8784
+ /**
8749
8785
  * The scope of every field the engine writes onto a terminal (RV2510),
8750
8786
  * as one exported table rather than as sentences scattered through
8751
8787
  * field docs.
@@ -11656,10 +11692,11 @@ async function runAgent(options) {
11656
11692
  if (state === void 0) return;
11657
11693
  const reserve = reserveFor(state.budget);
11658
11694
  const deficit = evidenceDeficit();
11695
+ const widenedByDeficit = state.budget !== "turns" && finalizationWindow?.reserveForEvidenceDeficit === true && deficit > 0;
11659
11696
  const commit = () => {
11660
11697
  windowEntered = true;
11661
11698
  windowNoticeFired = true;
11662
- pendingWindowNotices.push(finalizationWindowNoticeText(state.remaining, reserve, state.budget, state.budget !== "turns" && finalizationWindow?.reserveForEvidenceDeficit === true && deficit > 0 ? deficit : void 0));
11699
+ pendingWindowNotices.push(finalizationWindowNoticeText(state.remaining, reserve, state.budget, widenedByDeficit ? deficit : void 0));
11663
11700
  events?.emit({
11664
11701
  type: "log",
11665
11702
  level: "info",
@@ -11674,7 +11711,11 @@ async function runAgent(options) {
11674
11711
  return durable({
11675
11712
  remaining: state.remaining,
11676
11713
  reserveCalls: reserve,
11677
- budget: state.budget
11714
+ budget: state.budget,
11715
+ ...widenedByDeficit ? {
11716
+ evidenceDeficit: deficit,
11717
+ minEntries: options.evidenceContract?.minEntries ?? 0
11718
+ } : {}
11678
11719
  }).then(commit);
11679
11720
  };
11680
11721
  const flushWindowNotices = () => {
@@ -22134,6 +22175,52 @@ function makeOrchestratorWorkflow(goal, opts) {
22134
22175
  };
22135
22176
  barrier.run = exitBarrier;
22136
22177
  /**
22178
+ * Whether an acceptance verdict exists (RV2602). The roster fold
22179
+ * below reports only where no policy ever spoke: two folds of the
22180
+ * same children under two different authorities would be one
22181
+ * reading too many, and the acceptance decision is the authority
22182
+ * wherever it exists.
22183
+ */
22184
+ let acceptanceRendered = false;
22185
+ /**
22186
+ * The pre-acceptance roster (RV2602): what the children had
22187
+ * produced at the moment the run gave up. The facts are already in
22188
+ * the journal, one child terminal at a time, and the terminal said
22189
+ * nothing about them because every surface that names children
22190
+ * hangs off the acceptance fold. The fourth parity run is the
22191
+ * shape: a worker settled `ok` with zero recorded evidence entries
22192
+ * under a declared contract, and the run died before acceptance
22193
+ * could say so.
22194
+ *
22195
+ * Read BEFORE the exit barrier, so it is the roster the verdict
22196
+ * would have frozen, not the one the stragglers land on later.
22197
+ */
22198
+ const rosterAtFailure = () => {
22199
+ if (acceptanceRendered) return;
22200
+ const roster = [...byOrdinal.values()];
22201
+ if (roster.length === 0) return;
22202
+ const statusCounts = {};
22203
+ const belowFloor = [];
22204
+ const unsettled = [];
22205
+ for (const record of roster) {
22206
+ const settled = record.settled;
22207
+ if (settled === void 0) {
22208
+ unsettled.push(record.nodeId);
22209
+ continue;
22210
+ }
22211
+ statusCounts[settled.status] = (statusCounts[settled.status] ?? 0) + 1;
22212
+ if (settled.status === "ok" && settled.evidence !== void 0 && !settled.evidence.met) belowFloor.push(record.nodeId);
22213
+ }
22214
+ return {
22215
+ spawned: roster.length,
22216
+ settled: roster.length - unsettled.length,
22217
+ statusCounts,
22218
+ ...belowFloor.length === 0 ? {} : { belowFloorOkChildren: belowFloor },
22219
+ ...unsettled.length === 0 ? {} : { unsettled }
22220
+ };
22221
+ };
22222
+ barrier.roster = rosterAtFailure;
22223
+ /**
22137
22224
  * The journaled spec behind each recovered ordinal: the idempotent
22138
22225
  * re-execution guard compares it against the incoming call, because
22139
22226
  * after a cross-attempt resume a REGENERATED turn (the boundary
@@ -24899,6 +24986,7 @@ function makeOrchestratorWorkflow(goal, opts) {
24899
24986
  const acceptanceKey = "acceptance";
24900
24987
  const priorAcceptance = internals.replayer.snapshot().find((entry) => entry.kind === "decision" && entry.scope === callingState.scope && entry.key === acceptanceKey);
24901
24988
  let decision;
24989
+ acceptanceRendered = true;
24902
24990
  if (priorAcceptance !== void 0) decision = priorAcceptance.value;
24903
24991
  else {
24904
24992
  const childStatusCounts = {};
@@ -25171,6 +25259,16 @@ function makeOrchestratorWorkflow(goal, opts) {
25171
25259
  const barrier = {};
25172
25260
  try {
25173
25261
  return await orchestrationBody(ctx, barrier);
25262
+ } catch (thrown) {
25263
+ const roster = barrier.roster?.();
25264
+ if (roster === void 0) throw thrown;
25265
+ const widen = (data) => ({
25266
+ ...data ?? {},
25267
+ ...data?.childrenAtFailure === void 0 ? { childrenAtFailure: roster } : {}
25268
+ });
25269
+ if (thrown instanceof BudgetExhaustedError) throw new BudgetExhaustedError(thrown.message, { data: widen(thrown.data) });
25270
+ if (thrown instanceof FailRunError) throw new FailRunError(thrown.message, { data: widen(thrown.data) });
25271
+ throw thrown;
25174
25272
  } finally {
25175
25273
  await barrier.run?.();
25176
25274
  }
@@ -26762,6 +26860,42 @@ function workflowSourceRef(runId) {
26762
26860
  * telemetry, never authority), and an invalid counts record drops the
26763
26861
  * counts while keeping a valid completion.
26764
26862
  */
26863
+ /**
26864
+ * The pre-acceptance roster lift (RV2602), deliberately NOT gated on a
26865
+ * completion.
26866
+ *
26867
+ * Every other lifted field rides {@link liftRunCompletion}, which bails
26868
+ * out the moment there is no completion literal, and that is exactly
26869
+ * right: those fields report what an acceptance policy CLAIMED. This
26870
+ * one exists for the case where no policy ever ran, so gating it on a
26871
+ * completion would gate it on the very thing that is missing.
26872
+ *
26873
+ * Same posture as its siblings otherwise: a well formed record mirrors,
26874
+ * anything malformed drops silently rather than half-mirroring, so a
26875
+ * consumer never reads a partial roster as a whole one.
26876
+ */
26877
+ function liftChildrenAtFailure(candidate) {
26878
+ if (typeof candidate !== "object" || candidate === null || Array.isArray(candidate)) return;
26879
+ const raw = candidate.childrenAtFailure;
26880
+ if (typeof raw !== "object" || raw === null || Array.isArray(raw)) return;
26881
+ const { spawned, settled, statusCounts, belowFloorOkChildren, unsettled } = raw;
26882
+ const count = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
26883
+ if (!count(spawned) || !count(settled)) return;
26884
+ if (typeof statusCounts !== "object" || statusCounts === null || Array.isArray(statusCounts)) return;
26885
+ const entries = Object.entries(statusCounts);
26886
+ if (!entries.every(([, value]) => count(value))) return;
26887
+ const names = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string") ? [...value] : void 0;
26888
+ const below = belowFloorOkChildren === void 0 ? void 0 : names(belowFloorOkChildren);
26889
+ const open = unsettled === void 0 ? void 0 : names(unsettled);
26890
+ if (belowFloorOkChildren !== void 0 && below === void 0 || unsettled !== void 0 && open === void 0) return;
26891
+ return {
26892
+ spawned,
26893
+ settled,
26894
+ statusCounts: Object.fromEntries(entries),
26895
+ ...below === void 0 ? {} : { belowFloorOkChildren: below },
26896
+ ...open === void 0 ? {} : { unsettled: open }
26897
+ };
26898
+ }
26765
26899
  function liftRunCompletion(candidate) {
26766
26900
  if (typeof candidate !== "object" || candidate === null || Array.isArray(candidate)) return;
26767
26901
  const completion = candidate.completion;
@@ -27415,6 +27549,8 @@ function createEngine(options) {
27415
27549
  if (wireError !== void 0) outcomeFacts.error = wireError;
27416
27550
  let lifted = liftRunCompletion(status === "ok" || status === "exhausted" ? outcomeFacts.value : status === "error" ? wireError?.data : void 0);
27417
27551
  if (lifted === void 0 && status === "exhausted") lifted = liftRunCompletion(wireError?.data);
27552
+ const childrenAtFailure = liftChildrenAtFailure(status === "ok" || status === "exhausted" ? outcomeFacts.value : wireError?.data) ?? liftChildrenAtFailure(wireError?.data);
27553
+ if (childrenAtFailure !== void 0) outcomeFacts.childrenAtFailure = childrenAtFailure;
27418
27554
  if (lifted !== void 0) {
27419
27555
  outcomeFacts.completion = lifted.completion;
27420
27556
  if (lifted.childStatusCounts !== void 0) outcomeFacts.childStatusCounts = lifted.childStatusCounts;
@@ -27508,6 +27644,7 @@ function createEngine(options) {
27508
27644
  totalUsd: outcome.cost.totalUsd,
27509
27645
  ...outcome.cost.usageApprox === true ? { usageApprox: true } : {},
27510
27646
  ...lifted === void 0 ? {} : lifted,
27647
+ ...childrenAtFailure === void 0 ? {} : { childrenAtFailure },
27511
27648
  ...settlementFailure !== void 0 ? { settled: false } : supersededBy !== void 0 ? {
27512
27649
  settled: false,
27513
27650
  settledReason: "superseded"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.228.0",
3
+ "version": "1.229.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",