Repository navigation
Restore identity-grain witness cost disclosure on the required floor: mint one occurrence, fold everything from it - #8932
Merged
Conversation
… mint one occurrence, fold everything from it R of the R/X pair (operator ruling, 2026-08-22). WHAT WAS LOST AND IS RESTORED HERE. `run_required_floor` already measures every claim -- `run_claim_measured` returns a `PerformanceReceipt` carrying wall and CPU nanoseconds, and the loop binds it. It was consumed to increment one integer and then dropped at end of iteration. So the floor measured 10,457 claims, kept `over_cost_line_diagnostic`, and discarded every identity behind it. That is why the number could move 67 -> 77 -> 73 with nobody able to say which witnesses entered or left. Nothing new is measured here; what was already in hand stops being thrown away. ONE OCCURRENCE, MINTED IMMEDIATELY, AND EVERYTHING IS A FOLD OVER IT. `WitnessExecutionOccurrence` is pushed the instant `run_claim_measured` returns, before expected-red holding, route-gap classification or summary accounting can diverge from it. `over_cost_line_diagnostic` is now `over_cost_members.len()` and the independent `+= 1` is deleted, so the summary cannot disagree with its own members and there is no separate tally to drift. THE RE-DERIVATION IS EXACT, NOT APPROXIMATE, which is the only reason folding is safe. `exceeds_completed_cost_line` judges `VerdictReached` claims and compares `observed_*_ms`, which `claim_terminality` computes as `nanos / 1_000_000`. The row retains exact nanos, `verdict_reached`, and the `cost_line_ms` it was judged against, and the fold re-applies that same arithmetic. If the two could ever disagree the fold would be a second account of the population, which is the defect this change exists to remove. WHAT THE ROW DELIBERATELY DOES NOT CARRY: no `over_cost` flag and no count. Membership is the policy predicate applied to the measurement, not a stored property -- a stored flag is a second representation of a comparison the policy already owns. Milliseconds are a rendering choice; flooring at mint would destroy the sub-millisecond/unmeasured distinction at the one place it still exists. EVERY EXECUTED CLAIM GETS A ROW, not only the over-cost ones. Emitting only the positives loses which identities entered or left the set, the near-threshold population, the ability to reclassify after a policy-line change, and the proof that every executed identity was measured at all. `witness_execution_outcome_label` is exhaustive with no `_` arm: a new `ClaimOutcome` variant must fail to compile rather than be absorbed into a plausible existing label. WHAT THIS IS NOT. No gate -- artifact presence changes no verdict, and no witness pass/fail depends on elapsed time. The disclosure wall is deliberately a separate change, after a real run proves this producer. The `.dag`-side `ObservationEvent` projection is also not here: the carrier and its transport are unbuilt, and this lands as a draft so that seam can be reviewed before it goes live. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PgpEN2jnUGsLhM5vRKH6fD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
R of the R/X pair (operator ruling, 2026-08-22). Draft on purpose — see What is not here.
What was lost, and what "restore" means
run_required_flooralready measures every claim:run_claim_measuredreturns aPerformanceReceiptcarrying wall and CPU nanoseconds, and the loop binds it. It was consumed to increment one integer, then dropped at end of iteration. The floor measured 10,457 claims, keptover_cost_line_diagnostic, and discarded every identity behind it.That is why the number could move 67 → 77 → 73 with nobody able to say which witnesses entered or left. Nothing new is measured here; what was already in hand stops being thrown away.
One occurrence, minted immediately; everything is a fold over it
WitnessExecutionOccurrenceis pushed the instantrun_claim_measuredreturns — before expected-red holding, route-gap classification, or summary accounting can diverge from it.over_cost_line_diagnosticis nowover_cost_members.len(), and the independent+= 1is deleted. The summary cannot disagree with its own members, and there is no separate tally to drift.The re-derivation is exact, not approximate
This is the only reason folding is safe.
exceeds_completed_cost_linejudgesVerdictReachedclaims and comparesobserved_*_ms, whichclaim_terminalitycomputes asnanos / 1_000_000. The row retains exact nanos,verdict_reached, and thecost_line_msit was judged against; the fold re-applies that same arithmetic. If the two could ever disagree, the fold would be a second account of the population — the defect this change exists to remove.What the row deliberately does not carry
No
over_costflag, no count. Membership is the policy predicate applied to the measurement, not a stored property — a stored flag is a second representation of a comparison the policy already owns. Milliseconds are a rendering choice; flooring at mint would destroy the sub-millisecond-vs-unmeasured distinction at the one place it still exists.Every executed claim gets a row, not only the over-cost ones. Emitting only positives loses which identities entered or left, the near-threshold population, the ability to reclassify after a policy-line change, and the proof that every executed identity was measured at all.
witness_execution_outcome_labelis exhaustive with no_arm: a newClaimOutcomevariant must fail to compile rather than be absorbed into a plausible existing label.What is not here — and why this is a draft
.dag-sideObservationEventprojection. The agreed end state builds events and renders in.dagfrom a minimal carrier. That carrier and its transport are unbuilt. This is the seam most worth arguing about before it goes live — a Rust-side cost projection is the shape Retire the batch-fed witness-cost materialization at the root: three writers and two census rows #8923 just deleted, and "we will move it to.dagnext" is the deferred-refactor tell §6 names. I would rather that be reviewed than assumed.Operational note
Touches
src/v1/stage0/src/cli_run.rs, which a peer session is holding for ~a day while absorbing 28 conflicted files. Draft status keeps it out of their integration path.🤖 Generated with Claude Code
https://claude.ai/code/session_01PgpEN2jnUGsLhM5vRKH6fD