Repository navigation
fix(public-proof): reject incomplete receipt fields (#5465) - #8289
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Tests use fs::copy of committed receipts into a temp scratch dir; race risk only under concurrent test execution via NEXT counter (process-id scoped but not thread-safe across processes). Existing counter plus process-id prefix is sufficient for
cargo testparallelism.
Verification questions
- Confirm test 3 assertion pair ('render(root).err() == Some(expected); bars(&load(root)?).err() == Some(expected)') only distinguishes paths when load() accepts malformed 'cases'. Need to verify load() does not pre-reject, otherwise bars-path coverage is illusory.
- Confirm with_receipt_copy names the scratch after pid+AtomicUsize and removes it on result; concurrent lane/test waves share the same pid -> filename collisions and removes of other workers' dirs. The added tests are essentially load-bearing for the repair; if another test/sensor process uses temp_dir concurrently, race risks corruption rather than deterministic failure.
- Confirm selected-lane test asserts basis == path after bars() but never asserts the rank-bias fixture: if RANKING_BASELINE were absent, the test would still pass once two iterations use CORPUS variants. The selected-lane test is structurally insensitive to missing RANKING inputs.
- Confirm xtask/src/public_proof/required_fields_tests.rs:76 — check_metric_metadata mutates the receipt file in place then asserts render() error matches "{id}: missing string
{key}"; if a later replacement-loop iteration leaves the file altered (panic or early return), subsequent tests/vectors reading the on-disk receipt see poisoned state because restore only fires at the end. Wrap each write+assert in a guard or write to a clone then move-back. - Confirm xtask/src/public_proof/required_fields_tests.rs:17 — with_receipt_copy's temp-name uses pid+AtomicUsize; under cargo test parallelism other test binaries running in same process can collide on the directory name and a panicked sibling's cleanup may wipe a peer's still-in-use scratch, corrupting results. Prefer a per-test random suffix or include the test name.
Parked follow-ups
- Malformed-string sweep covers None/Null/bool/int/array/object but not float (42.0) or string with valid JSON-array shape; orthogonal to required-field contract per the existing helpers, minor coverage gap.
|
Raw local validation receipts for #8289. Source reviewer: Commands: 5465-green.log — SHA256 ba303770ea86e2e7b91b8cfbba709424f0fdd22e44696c7ac9e84d84ee2d8bb55465-red.log — SHA256 d179ef7d3bddd7371571fb7a8575522b829c5c3a7efc226bcb2a8d14e4d001675465-precommit-v2.json — SHA256 03756bc4c7dac89136900fe09a06972444b44bc37201735151a2d9836dd70504{
"schema_version": "0.2",
"composition": "local_precommit",
"status": "pass",
"failure_kind": null,
"repository_root": "$REPO",
"head_sha": "12854d71817521f024ecfa46e77ee8848d2378c8",
"merge_base_ref": "origin/main",
"merge_base_sha": "a1ea790e923ae6036efdd9457ffc16ea2ad93348",
"change_set": {
"changes": [
{
"kind": "added",
"path": "xtask/src/public_proof/required_fields_tests.rs",
"old_path": null,
"origins": [
"committed"
]
},
{
"kind": "modified",
"path": "xtask/src/public_proof.rs",
"old_path": null,
"origins": [
"committed"
]
}
],
"complete": true,
"limitations": []
},
"impact_plan": {
"impacted_packages": [
"xtask"
],
"workspace_clippy": false,
"workspace_widening_reason": null,
"skipped_reason": null
},
"commands": [
{
"command": "cargo metadata --format-version 1 --manifest-path $REPO/Cargo.toml",
"outcome": "pass",
"detail": null,
"diagnostic": null
},
{
"command": "existing repository policy precommit",
"outcome": "pass",
"detail": null,
"diagnostic": null
},
{
"command": "git diff --check a1ea790e923ae6036efdd9457ffc16ea2ad93348...HEAD",
"outcome": "pass",
"detail": null,
"diagnostic": {
"program": "git",
"argv": [
"-C",
"$REPO",
"diff",
"--check",
"a1ea790e923ae6036efdd9457ffc16ea2ad93348...HEAD"
],
"outcome": "pass",
"status": "exit status: 0",
"exit_code": 0,
"elapsed_ms": 100,
"elapsed_scope": "runner_start_to_observed_exit_excluding_pipe_drain",
"cargo_progress": null
}
},
{
"command": "git diff --cached --check",
"outcome": "pass",
"detail": null,
"diagnostic": {
"program": "git",
"argv": [
"-C",
"$REPO",
"diff",
"--cached",
"--check"
],
"outcome": "pass",
"status": "exit status: 0",
"exit_code": 0,
"elapsed_ms": 100,
"elapsed_scope": "runner_start_to_observed_exit_excluding_pipe_drain",
"cargo_progress": null
}
},
{
"command": "git diff --check",
"outcome": "pass",
"detail": null,
"diagnostic": {
"program": "git",
"argv": [
"-C",
"$REPO",
"diff",
"--check"
],
"outcome": "pass",
"status": "exit status: 0",
"exit_code": 0,
"elapsed_ms": 100,
"elapsed_scope": "runner_start_to_observed_exit_excluding_pipe_drain",
"cargo_progress": null
}
},
{
"command": "cargo clippy --manifest-path $REPO/Cargo.toml -p xtask --all-targets -- -D warnings",
"outcome": "pass",
"detail": null,
"diagnostic": {
"program": "cargo",
"argv": [
"clippy",
"--manifest-path",
"$REPO/Cargo.toml",
"-p",
"xtask",
"--all-targets",
"--",
"-D",
"warnings"
],
"outcome": "pass",
"status": "exit status: 0",
"exit_code": 0,
"elapsed_ms": 97635,
"elapsed_scope": "runner_start_to_observed_exit_excluding_pipe_drain",
"cargo_progress": {
"compiling_lines": 2,
"checking_lines": 1,
"fresh_lines": null
}
}
}
],
"skipped": [],
"limitations": [],
"report_digest": "sha256:9b065db73b278041c5d4246f6b74f9837a11db2ec13e8770317bb73562e5639f"
}
5465-independent-cli.py — SHA256 2fcff40e93ec70543c812fd829b3e1642fe610126d96e7bfffec25982c03a699from pathlib import Path
import hashlib,json,shutil,subprocess,tempfile
repo=Path('/workspace/ripr-swarm'); binary=repo/'target/debug/xtask'
expected='3b8f27bd56769020a265d46617407ec906b3c82da10ac97725755f1c52aa7685'
assert hashlib.sha256(binary.read_bytes()).hexdigest()==expected
print('binary sha256:',expected)
with tempfile.TemporaryDirectory(prefix='5465-independent-cli-') as td:
root=Path(td)
shutil.copytree(repo/'metrics/public-proof',root/'metrics/public-proof')
(root/'metrics/dx-scoreboard').mkdir(parents=True)
for name in ['corpus-full-baseline.json','corpus-fast-baseline.json','pilot-ranking-baseline.json']:
shutil.copyfile(repo/'metrics/dx-scoreboard'/name,root/'metrics/dx-scoreboard'/name)
(root/'docs').mkdir()
page=root/'docs/PUBLIC_PROOF.md'; canonical=(repo/'docs/PUBLIC_PROOF.md').read_bytes()
def run():
return subprocess.run([str(binary),'public-proof'],cwd=root,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
result=run(); assert result.returncode==0,(result.returncode,result.stderr)
assert page.read_bytes()==canonical
print('valid CLI: exit=0; PUBLIC_PROOF byte equality=yes; bytes=',len(canonical))
checks=[('metrics/public-proof/dx-scoreboard.json','ci.workflow_lines','direction',None,'ci.workflow_lines: missing string `direction`'),('metrics/public-proof/dx-scoreboard.json','ci.workflow_lines','unit',False,'ci.workflow_lines: missing string `unit`'),('metrics/public-proof/dx-scoreboard.json','ci.workflow_lines','title',{},'ci.workflow_lines: missing string `title`'),('metrics/dx-scoreboard/corpus-full-baseline.json','corpus.not_analyzed','direction',None,'corpus.not_analyzed: missing string `direction`'),('metrics/public-proof/first-run-current.json',None,'cases',None,'first-run-current: missing array `cases`'),('metrics/public-proof/first-run-previous.json',None,'cases',{},'first-run-previous: missing array `cases`')]
sentinel=b'Independent review sentinel: leave existing output untouched.\n'
for relative,id,key,value,error in checks:
path=root/relative; original=path.read_bytes(); data=json.loads(original)
target=next(m for m in data['metrics'] if m['id']==id) if id else data
if value is None: del target[key]
else: target[key]=value
path.write_text(json.dumps(data)); page.write_bytes(sentinel)
result=run(); output=(result.stdout+result.stderr).decode()
assert result.returncode!=0,(relative,key,'accepted')
assert error in output,(error,output)
assert page.read_bytes()==sentinel,(relative,key,'output modified')
print(f'{relative} {id or "receipt"}.{key}: exit={result.returncode}; error={error}; sentinel preserved=yes')
path.write_bytes(original)
result=run(); assert result.returncode==0,result.stderr
assert page.read_bytes()==canonical
print('restored valid CLI: exit=0; PUBLIC_PROOF byte equality=yes')5465-independent-cli.log — SHA256 0741ea2503493255f2cfd1f342f9d429be336cfea400bba831b154de4e3b00f3 |
|
Raw local validation receipts for #8289. Source reviewer: Commands: Complete original online precommit console output follows; the structured receipt is in the companion evidence comment. The earlier offline attempt failed to fetch uncached Cargo metadata and is not a pass. 5465-precommit-online.log — SHA256 0093f67e34c085fc6ecf9d47c538663f97b3a2c6b0e3274bae34908c8a206105 |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Recovered independent review of #8289 — no actionable findings emitted.
Reviewer identity: /root/review_required_fields, the original independent agent. This COMMENT publishes that agent's inspection record through the delivery owner's GitHub account; it is not a separate human approval.
Reviewed head: 12854d71817521f024ecfa46e77ee8848d2378c8; tree 34e239b06ace719935057d6ef3c0d4bfda4542dd. Proof base: a1ea790e923ae6036efdd9457ffc16ea2ad93348. Scope: generator and focused tests only, xtask/src/public_proof.rs and xtask/src/public_proof/required_fields_tests.rs.
Inspected complete diff, JSON loading, scoreboard and selected full/fast/ranking lanes, first-run derivation, full render/CLI write boundary, stimulus/oracle grip, and valid output equality. Existing required-field helpers own validation. Unknown duration and empty walk semantics remain preserved. No generated receipts/docs, scoring, policy, access, or release changes.
Observed raw receipts: 44-test log, behavioral red control, structured precommit receipt, exact independent CLI script and output, plus complete original online precommit output. These are recovered originals, not claimed fresh executions. cargo test -p xtask --bin xtask public_proof: 44 passed/0 failed. cargo xtask precommit: pass at exact candidate/base, two changed paths, selected xtask Clippy exit 0. The tests-only checkpoint cea11a1ca5a179ebf7ffdd1385e59cb571124f78 failed all three new controls for the intended behavioral reasons.
The reviewer independently executed the retained CLI script: executable SHA256 3b8f27bd56769020a265d46617407ec906b3c82da10ac97725755f1c52aa7685; valid receipt output exit 0, byte-identical 69,993-byte page before and after six counterexamples. Each counterexample exited 1 with its expected contextual error and preserved the existing sentinel page. Page SHA256 4568ca5609bceed2c56e5c81f3e271f3cc5fb9bda08ded93a63f761508db1e84.
Disposition of review 5555380301, independently rechecked by the original reviewer:
- Cases-path concern refuted:
load(public_proof.rs:322) parses JSON without validating cases;bars(&load(root)?)therefore reaches bars on malformed cases. The complete renderer already rejected cases through header validation; the red control distinguishes that from the newly hardened bars path. - Collision concerns refuted: the test helper's process ID plus atomic
fetch_adddistinguishes live processes and concurrent calls. Separate test binaries do not share one live OS PID. - Ranking coverage concern refuted: the explicit ranking iteration finds its bar, asserts its selected path, then reads/mutates that file. Missing ranking input fails rather than silently passing corpus iterations.
- Fixture-poisoning concern refuted: each vector starts from
original.clone(), each test owns separate scratch storage, and error returns stop and clean that test. A panic can leave its own scratch directory, not poison peer tests. The owned red-control scratch was removed after preserving the witness. - Extra floats exercise the same
as_strrejection as the covered integer. JSON-looking strings remain strings under the bounded presence/type contract. Direction enum and repository-sample schema changes remain outside scope.
CodeRabbit's exact-head review reported no actionable comments; its docstring percentage warning is an advisory suggestion, not a correctness finding. Gemini quota exhaustion is unavailable review, not a clean review. No unresolved inline threads were returned by the current inventory; that is not itself substantive review.
Pre-Ready hosted subject: Git-fetched refs/pull/8289/merge = 3ccbd407860619eda3bdece68a635ba7a40cc880, parents 60a22c66851e8f5f6d932361c8e6cd758b9efd48 and reviewed head, tree 5a65fef43cec2b0d280dc17aa2335939400f1081. Its delta from the reviewed head is the unrelated explain/context-selector landing. Later main movement concerns side-flip, npm recovery, and diff rename parsing; no generator, receipt, or build prerequisite changed. No behind-only restack or duplicate local matrix is warranted. Actual qualification checkout identity still must be inspected after Ready.
Disposition: REVIEW_INCOMPLETE only for hosted qualification and final protected-merge assessment. Independent substantive review and local proof are established, with no unresolved material source/oracle finding. Supports one Ready transition to obtain normal qualification; this is not yet REVIEW_READY for merge.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Hosted qualification receipt for #8289Run 38993733135 / attempt 1; Rust job 117281577129; final result job 117291517838. Exact reviewed head |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Final exact-head review for #8289: REVIEW_READY.
Reviewed head 12854d71817521f024ecfa46e77ee8848d2378c8, original proof base a1ea790e923ae6036efdd9457ffc16ea2ad93348. Independent source/oracle/CLI reviewer /root/review_required_fields and finding dispositions are retained in review 5555494825. Raw local receipts were published and read back exactly in comments 6228309719 and 6228310696.
I inspected the actual completed Rust job 117281577129, its steps and raw log, and result job 117291517838. Actual Rust checkout: 3ccbd407860619eda3bdece68a635ba7a40cc880, parents 60a22c66851e8f5f6d932361c8e6cd758b9efd48 / reviewed head; tree 5a65fef43cec2b0d280dc17aa2335939400f1081. It matches the pre-Ready subject. No controller/workflow change is in this patch.
Observed proof: policy/honesty/process/network checks, workspace/all-target check, all-features target check, strict workspace Clippy, required nextest suite, doctests, goldens, fixture contracts, verdict corpora and PR evidence all passed. The raw nextest terminal report records 16,548 passed, 3 skipped, 24 slow; all 44 public-proof tests have explicit PASS lines, including all three new controls. Doctests: 2 passed, 1 ignored (xtask has 0). No retries were configured. Retained raw log excerpts include the checkout, denominator, all 44 passes and PR-evidence success.
Nextest artifact 12086998788 was uploaded (546,226 bytes, metadata digest sha256:dab11669558f685d0b94e92577eb0aa873406b629772055fd6cf5068c1bf4abb, expires Oct 22). The local archive reader returned 403, so ZIP contents/digest were not independently verified. Execution counts and subject identity above are directly verified from the completed raw job log instead; artifact existence is not substituted for execution.
Current head is unchanged, PR Ready/open, current inline thread inventory is empty, and no new substantive finding was posted. Previous bot verification questions were source-refuted in the independent record. CodeRabbit and Devin statuses are success; Gemini quota limits are unavailable review, not clean review.
The only red check is inherited advisory Public Proof Drift (#8049): same old receipt/source mismatch on the qualified subject, not a required-field defect. No refresh is included. Live main is now c6ca3945f with unrelated analyzer/CLI/LSP/npm/corpus work; the generator, its two-file patch, committed receipt/page inputs, Cargo manifests/lockfile, and qualification configuration remain unaffected. New canonical corpus rows remain separate refresh work; no behind-only restack or duplicate qualification is needed.
Active main ruleset 18845973 was inspected: 0 required approvals, required thread resolution, no bypass. Classic review/status-check protection reads returned integration 403; that read limitation remains explicit and normal protected expected-head squash merge must enforce any unreadable constraints. No settings or access change is authorized or used.
No blocking source/oracle/integration finding remains for this focused generator/tests repair. Scope and rollback remain the two-file patch, with unchanged valid receipt output. Disposition: REVIEW_READY for normal protected squash merge of expected head only.
Missing
direction,unit, ortitlein a scoreboard receipt currently letscargo xtask public-proofwrite a misleading page. This change uses the existing required-field parsers for scoreboard and selected lane metadata, and propagates missing/malformed first-runcaseserrors from the bars path. Valid receipt output stays byte-for-byte identical.Fixes #5465. Prerequisite #5405 is merged. Rechecked the issue (open/unassigned), current source, and all-state PR searches for
5465and"public-proof"; no equivalent repair was found.Scope and acceptance
xtask/src/public_proof.rs; evidence: its newrequired_fields_testsmodule.render(root), including corpus full/fast fallback and ranking lanes.Source and proof
Linux x86_64, Bash, Rust 1.95.0 (
59807616e). Proof base / initial current-main observation:a1ea790e923ae6036efdd9457ffc16ea2ad93348. Candidate:12854d71817521f024ecfa46e77ee8848d2378c8, tree34e239b06ace719935057d6ef3c0d4bfda4542dd. Tests-only red checkpoint:cea11a1ca5a179ebf7ffdd1385e59cb571124f78.Commands executed with
/workspace/.ripr-toolchain/cargo/binon PATH and matching CARGO_HOME/RUSTUP_HOME:cargo xtask worktree doctoron basecargo xtask check-faston basecargo check -p xtask --all-targetson basecargo test -p xtask public_proofon basecargo test -p xtask --bin xtask public_proof::required_fields_testson tests-only checkpointcargo test -p xtask --bin xtask public_proofon repaired sourcecargo xtask precommit(online retry)pass, exact candidate/base, onlyxtaskimpacted, selectedcargo clippy -p xtask --all-targets -- -D warningspassedgit diff --checkThe independent reviewer inspected the complete exact-head diff and consumers, checked red/green logs, and independently executed
/workspace/ripr-swarm/target/debug/xtask public-proofin scratch working directories. No actionable source/oracle findings. CLI SHA-256:3b8f27bd56769020a265d46617407ec906b3c82da10ac97725755f1c52aa7685; unchanged page SHA-256:4568ca5609bceed2c56e5c81f3e271f3cc5fb9bda08ded93a63f761508db1e84.Precommit's first offline attempt could not load Cargo metadata because
android_system_properties v0.1.6was uncached. The online retry passed; its report confirms the exact candidate and base, two changed paths, and selected xtask Clippy. No pass is claimed for the failed offline attempt. Hosted qualification is complete; no broad local CI/full workspace test run was requested.Changelog disposition: defer a contributor-only
Internal / CInote to the release inventory of this PR linked to #5465, respecting the explicit generator/tests-only scope. No analyzer behavior or valid generated output changes. There is no dedicated public-proof spec mapping to update; #5465 and the module's required-field contract govern this repair.Initial hosted observation: CI run 38989501956 reports success, but its actual Rust test/toolchain steps and the MSRV/Perl/VS Code jobs were skipped at this Draft stage. This is not hosted test qualification. At that initial Draft observation, other review/advisory runs were still in progress and submitted reviews were empty; later qualification and reviews are recorded below. The independent local review above remains the substantive review evidence.
Continuation — delivered
Owner / governing claim: #5465 delivery owner.
PR_MERGED; issue #5465 verified closed/completed.Candidate: reviewed/published head
12854d71817521f024ecfa46e77ee8848d2378c8; normal protected expected-head squash resultb10e748969d3634c6357dcf787beb7693b21a262. The two changed file blobs match the reviewed head exactly; merge result is on main. No branch rewrite or policy bypass was used.Review: independent reviewer
/root/review_required_fields, exact head/base/scope and finding dispositions in review 5555494825; final REVIEW_READY.Validation: raw local tests/CLI/structured precommit receipts, full original precommit console output, actual hosted checkout and test log excerpts. Ready requested once; qualification run 38993733135 attempt 1 passed. Actual Rust checkout
3ccbd407860619eda3bdece68a635ba7a40cc880, parents60a22c66851e8f5f6d932361c8e6cd758b9efd48/ reviewed head, tree5a65fef43cec2b0d280dc17aa2335939400f1081. 16,548 nextest tests passed, 3 skipped; all 44 public-proof tests have explicit PASS lines. Required policy, checks, Clippy, doctests, goldens, fixtures, corpora and PR evidence all passed. No duplicate CI was dispatched.Limitations retained: classic protection reads returned integration 403; the active main ruleset was inspected and the normal protected merge succeeded. Nextest archive metadata was verified, but local archive retrieval returned 403; executed subjects/counts/checkout were verified directly in the completed raw job log. These reader limits were not relabeled as archive-content verification.
Residual / next: #5465 complete; no successor repair selected. Inherited advisory Public Proof Drift remains separate under #8049: verdict-corpus receipt differs from canonical source, with unchanged receipt/source/page inputs on the qualified subject relative to the pre-repair base. No refresh, scoring/threshold, CI admission, access or release change was included. Checkpoints, CLI witness, raw receipts and local mutable build cache are retained for parent verification; the owned failed-test scratch was removed. No unarranged background monitoring is claimed.