Skip to content

feat: CS-16 ard-witness scenario -- planted-R-object adjudication over the exported ms_ard/MsArd face (pillar 3) - #127

Merged
ShixiangWang merged 1 commit into
mainfrom
bench/cs16-ard-witness
Nov 23, 2026
Merged

ShixiangWang merged 1 commit into
mainfrom
bench/cs16-ard-witness

Conversation

@ShixiangWang

Copy link
Copy Markdown
Contributor

What

Pillar-3 case study CS-16: the ARD engine descriptor as a governed witness -- planted-R-object adjudication over the exported ms_ard()/MsArd face. The fourth entry in the CS-12/13/14/15/16 double-gate witness family. This one targets the S7 property-class surface: where CS-14 planted byte-text and CS-15 planted RDS files, CS-16 plants objects, and it measures that the descriptor's refusal surface is stratified across three error classes, not one.

Evidence

  • Two hosts, one shared block. tests/testthat/test-scenario-ard-witness.R (10 units U1-U10) and bench/scenarios/run_ard_witness.R share the law helpers via a single byte-identical SHARED-BEGIN/END block: the frozen law roster plus the fire/shadow/mirror/mint helpers. The test host asserts; the runner host re-mints the witnesses.
  • Five committed witnesses under bench/scenarios/out/: laws 40 rows, specs 9, precedence 8, degenerates 14 (7 hi/lo pairs), scalars 9 (6 law-key re-fire-able values + 3 attest shas). All mechanical (built from the audited probe ledger out/cs16_laws.tsv via the shared lawrows() family, zero hand-retyped expectations), all re-witness-DET (the runner refuses a re-run that does not reproduce the committed bytes).
  • TDD watched RED first (pure witness-absence class: 5 missing-file failures + every witness-dependent assertion), then GREEN 246/0/0; the witness file registers 246 expects in the shard weights at T0.
  • Class census (the probe's measured class(err) truth, 71 arms total): the 40 law rows split 26 msuiter_error_engine / 12 simpleError / 2 msuiter_error_internal; across all 71 arms (40 laws + 9 precedence + 8 specs + 14 degenerates) the full distribution is msuiter_error_engine 41, simpleError 12, msuiter_error_internal 2, s7:msuiter::MsArd 15, s7:character 1 -- asserted live at U10 over every class vector.
  • Dual-kernel (.ms_fit_sha256 vs digest::digest(bytes, algo="sha256", serialize=FALSE)) agreement pinned at both hosts on the >1KB plant corpus and the spec corpus.
  • RNG-state rails: identical .Random.seed existence sentinels probe-observed and committed (both FALSE), rail-verified at both ends of the runner and in U1/U8.

Committed measured laws

  • 40 validator law rows (the probe's full validator-arm ledger), class-split 26/12/2 as above, mirrored clause-by-clause witness <-> frozen <-> live-fire at U3/U4 -- every message byte in the witness must equal its frozen clause, every frozen clause must be what the live face actually speaks.
  • The double-gate anatomy, measured: S7 property coercion fires first for type-words (label, name, a0, seed as scalars), the ms_ard validators next (@params must be <list>, @deterministic must be <logical>), and the hyper-domain values list(a0=2,3)/list(seed=2,3) die inside the abort plumbing -- the got:/format(v) bullet vectorises and abort() refuses it: msuiter_error_internal: msuiter_abort: bullet 'i' must be a non-empty string. The two shared laws that name this stratum are kept verbatim, ugly truth and all; the scenarios leg now adjudicates it as its own column.
  • (named)-permissiveness: fully-unnamed @params passes (the names() %in_% NULL short-circuit); partially-named list(1, k=2) is refused. The accept leg and the reject leg are both committed witnesses.
  • The precedence ladder (8 arms, discriminators with fires+anti-anchors): name > mode > params > deterministic > packages > label (the shared constructor order), then a0 > b0 > tol > max_iter > seed -- with the seed domain [0, 2^31-1] welded by the ceiling witness (a0-vs-seed ordering proved by the fraction-vs-name discriminator at seed=2147483647).
  • 7 degenerate hi/lo pairs lock the exact accept/reject boundaries: seed ceiling+1 vs ceiling, seed negative vs zero, a0/b0 fraction-vs-character discriminators, tol/taxa zero-vs-negative, max_iter 0.5-vs-NA.
  • 9 scalar values incl. the two attest shas + 6 re-fire-able law keys; the runner re-fires every law-keyed scalar live and dies on drift.

Instrument catches (all TDD-surfaced, none papered over)

  • The vacuous-NULL mint family (the deepest): on this R fork a parsed function literal is a 4-slot object (function, formals, body, extra NULL) -- the minter read th[[length(th)]] (the last slot) for every body, deparsed NULL, and minted all 57 arms as the string "NULL" while BOTH self-checks (parse-length==1, double-mint determinism) passed vacuously. The first live-replay mirror caught it (@params on NULL). Fixed to th[[3L]] + non-NULL + face-token guards at all three sites.
  • tryCatch(..., error=) returns the condition -- a blind $v projection makes an error-arm read as an accept (NULL -> @ on NULL); .cs16_fire/.cs16_scalval now branch on inherits(r, "error") first.
  • The fires-anchor vector evaporated: vector-regexpr returns a bare integer vector (attr match.start NULL), so ifelse(logical(0), ...) gave character(0) and the minter minted an empty precedence roster -- caught only by the count+non-empty guard. Elementwise re-write.
  • vapply refuses logical->character coercion AND carries a names attribute that read.csv columns lack -- both would have made the mirrors vacuous; now paste0()-minted "TRUE"/"FALSE" strings + unname() at every mirror.
  • grepl with a vector pattern uses element 1 only (silent single-arm scan) -- the ban-rail face-scan was half-vacuous; explicit ORs restored, verified against the full 10066-byte source.
  • The back-reference "\\1" landed a raw 0x01 control byte into pr-gate-budget.tsv (git-visible), and my own line-surgery guard (multiset check) refused the editor twice before a deterministic literal-tail rebuild.
  • Ban-rail scoping: the frozen/shared marker regions legitimately quote face bytes (msuiter_abort:, required_pkgs() clause text) -- hand-written ban-scan vs whole-file needle-scan split, with region-integrity assertions.

Governance

  • shard-weights: ard-witness row 246-expect/T0, T0 seal moved 624 -> 625 with the witnessed generator refusal recorded verbatim ("T0 weight moved to 625 s but the committed measurement says 624 s") before the seal was re-authored.
  • shard-manifest re-minted from the sealed weights: gen-shard-manifest: k=6 files=109 t0-weight=625s (ceiling 800) makespan=1250s; the ard row lands on shard 5; the re-mint is determinist (MANIFEST-DET-OK).
  • Full local devtools::check (the same posture as CS-10..CS-15) green before opening this PR, incl. the vignette body that now runs the ard-witness legs end-to-end.

Docs

  • New devlog devlog-2026-11-23-p3-cs16-ard-witness.qmd (the double-gate anatomy, the discovered internal-error stratum, the full instrument-catch record, the CS-12/14/15 differentiation).
  • paper-draft: CS-16 bullet + Fig. 5 roster extended; docs-bridge: CS-16 row + test-docs-bridge.R green (15/0/0); _pkgdown.yml article row + test-pkgdown-coherence.R green (18/0/0, 131/131 hrefs); scenarios.Rmd driver roster sixteen, the new "The ARD engine descriptor as a governed witness" section with the three-class adjudication legs, Reproducing line.

Test plan

  • RED watched (witness-absence class), GREEN test-scenario-ard-witness.R: 246/0/0
  • Full local devtools::check: GATE-RAN-CLEAN, exit 0 (two consecutive full burns; the new scenarios leg renders and all seven adjudications print TRUE)
  • Status baseline: the frozen 2W/1N holds -- with one documented environmental exemption: R's future-file-timestamps probe verifies mtimes against an external clock (worldclockapi.com over HTTP) and both endpoints currently answer empty, so it self-declares unable to verify current time as a second NOTE. Evidence anchored (carrier branch dumped from tools:::.check_packages, live curl probes, run-to-run reproducibility, all CS-16 mtimes proven strictly past); the probe never claims a pass it did not earn -- it is reported here, not suppressed.
  • Runner: OVERALL PASS + WITNESS-DET-OK; dual-kernel SHA agreement; RNG rails TRUE
  • test-docs-bridge.R + test-pkgdown-coherence.R green
  • Governance: manifest re-mint determinist (k=6 files=109, T0=625 s, makespan 1250 s)
  • CI arms green at check-run level

🤖 Generated with Claude Code

…r the exported ms_ard/MsArd face (pillar 3)

Dual hosts (testthat + runner) share one byte-identical block; five
committed witnesses (40 laws 26/12/2, 9 specs, 8 precedence, 7 hi/lo
pairs, 9 scalars), dual-kernel SHAs, RNG rails, TDD RED watched then
GREEN 246/0/0. Governance T0 re-seal 624->625 with the witnessed
refusal verbatim; manifest re-mint k=6 files=109 DET. Docs quartet +
fifteenth scenarios leg (render-verified). Full local gate GATE-RAN-CLEAN
exit 0 (Status 2W/1N frozen + documented worldclockapi NOTE exemption).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@ShixiangWang
ShixiangWang merged commit 2b29456 into main Nov 23, 2026
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant