Repository navigation
fix: abort-contract payload sweep -- 15 msuiter_abort() sites regain the mandatory i/j/c bullets (#129 sibling) - #130
Merged
Conversation
…the mandatory i/j/c bullets (#129 sibling) The error discipline in R/classes-utils.R (ARCHITECTURE section 3.5) requires every validator violation to raise msuiter_error_<topic> with the three-part information payload: i = what is wrong, j = where, c = how to fix. i, j and c are mandatory formals with NO defaults, so a call site that omits one does not raise the structured condition at all -- base R raises missingArgError / getvarError instead, in the locale language, with no payload for a caller to act on. A parse-tree census over R/*.R (utils::getParseData, SYMBOL_FUNCTION_CALL == "msuiter_abort", depth-0 SYMBOL_SUB collection) found 486 call sites, 15 of which passed two or three of the five names. This change restores the missing bullet(s) at each, with content appropriate to the site: R/calibrate-plot.R (2 sites) se/pass_window validation R/engines-ard.R (2 sites) counts matrix + k0 whole number R/engines-sparse.R (2 sites) counts matrix + k whole number R/fit.R (1 site) bca bootstrap interval selector R/ms-compare.R (1 site) n_draws Monte Carlo tail count R/ms-convert.R (1 site) opportunity vector shape R/viz-bootstrap.R (1 site) index / colname selector R/viz-profile.R (5 sites) index, colname and channel selectors The law is enforced going forward by a new static gate, tests/testthat/test-abort-contract.R: a firing-control unit proves the census sees a planted omission, then the gate walks the shipped R/ tree and asserts every call carries i, j and c. The file joins the sealed T0 roster at a 0 s integer weight (5 expects, witnessed nb=5 failed=0), so the pr-gate budget sum stays at its committed measurement of 625 -- a zero-weight roster row moves no seal, and the generator plus ci-selfcheck both re-price to 625. Verification: local frozen gate signature (2 WARNINGs + 2 NOTEs); test-ci-shard-map.R nb=212 failed=0; tools/ci-selfcheck.py PASS. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
What this repairs
The error discipline frozen in
R/classes-utils.R(ARCHITECTURE section 3.5)requires every validator violation to raise
msuiter_error_<topic>throughmsuiter_abort(topic, message, i, j, c, ...), wherei= what is wrong,j= where,c= how to fix. Those three are mandatory formals with nodefaults. A call site that omits one does not raise the structured
condition at all: base R raises
missingArgError/getvarErrorinstead,with a locale-language message and no actionable payload.
A parse-tree census over
R/*.R(utils::getParseData,SYMBOL_FUNCTION_CALL==
"msuiter_abort", depth-0SYMBOL_SUBcollection) found 486 call sites,15 of which passed two or three of the five names. Each is repaired here
with content appropriate to the site:
R/calibrate-plot.Rseselector;pass_windowpassthroughR/engines-ard.Rcountsmatrix class;k0whole numberR/engines-sparse.Rcountsmatrix class;kwhole numberR/fit.Rbcabootstrap interval selectorR/ms-compare.Rn_drawsMonte Carlo tail countR/ms-convert.RR/viz-bootstrap.RR/viz-profile.RNo behavioural change: the same violations raise the same topics with the
same
message; they now additionally carry the full three-part payload, so acaller catching
msuiter_error_*can readcondition$i,condition$jandcondition$cinstead of a bare base-R error.The law that keeps it repaired
tests/testthat/test-abort-contract.Rwalks the shippedR/tree with thesame census and asserts every call carries
i,jandc. A firing-controlunit proves the census actually sees a planted omission (a gate that can never
go red is not a gate). Locally:
nb=5 failed=0 error=0 warning=0, elapsed0.4 s.
Governance footprint
tools/ci/shard-weights.tsv: the law row joins the T0 roster at a 0 sinteger weight (5 expects).
tools/ci/pr-gate-budget.tsv: roster addition at constantt0-measured.Because the row weighs 0 s, the sealed manifest sum does not move -- the
generator re-prices to the committed value and
ci-selfcheckagrees, so theequality law stays exact rather than being re-sealed for a change that moves
no seconds. (The 16 prior re-seals each added a 1 s row; this one does not.)
tools/ci/shard-manifest.tsv: regenerated viatools/ci/gen-shard-manifest.R(fail-closed on any sum mismatch).
Verification (local, this branch)
devtools::check(".", document=FALSE, manual=FALSE, cran=TRUE, vignettes=TRUE, env_vars=character(), error_on="note"):2 WARNINGs + 2 NOTEs (the frozen signature).
tests/testthat/test-ci-shard-map.R:nb=212 failed=0 error=0 warning=0(re-run after the rebase onto the CS-17 merge).
tools/ci-selfcheck.py:PASS (all CI wiring assertions hold), exit 0.🤖 Generated with Claude Code