Repository navigation
Validate unsigned subtraction independently in Target IR - #214
Conversation
…t-unsigned-subtraction
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 32 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…t-unsigned-subtraction
|
Code Lawyer self-audit at
Cc @codex for an independent second opinion. No throughput claim is inferred from this source inspection; regression evidence will count actual visits. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review please |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Code Lawyer Activity SummaryCandidate:
Whole-diff audit: traced target-selection/type-integrity checks, input proof lifetime, arithmetic signatures and literal parsing, node/expression totality traversal, authority/type inference, comparison shapes, and artifact/refusal construction. For/Branch nodes are still refused during lowering; their earlier validation shortcuts do not emit an accepted Target artifact. Audited all three branch merges against parents; their remerge diffs were empty, and main-relative changes remain scoped to this target boundary. Verification: exact-head Resources: reused the existing COPY worker and shared target; approximately 2.7 GiB compiler output plus 446 MiB registry, 716 GiB host free. Worker stopped after validation. No new image, worker, volume, or target created. Review gate: CodeRabbit is rate limited; the explicit alternate Codex request received a quota response. Neither counts as approval. Independent agy review is running for this exact head. No merge claimed yet. |
Independent agy review: APPROVEThe user authorized Code Lawyer remediation and merging, including the independent agy fallback. CodeRabbit and Codex quota responses are not approvals. The corrected full independent review below evaluates exact head Coordinator reconciliation: approval is bounded to the inspected source and tested cases. It does not prove absence of every defect, universal compiler complexity, runtime/provider acceptance, or completion of Jim #302. I independently rechecked the cited RED/GREEN counts, full-gate sections, clean worktree, and parent merge diffs. The previously noted advisory and historical consumer-probe limitations remain disclosed. No actionable finding remains from this review. Ultra-Strict Adversarial Code Review: PR #214
1. Executive Summary & Verification ContextThis independent audit evaluates PR #214 at exact HEAD commit Both automated review bots are unavailable: CodeRabbit is rate-limited ( The PR independently validates raw Core unsigned subtraction ( All local and raw Docker verification artifacts were inspected. The full COPY-based Docker worker 2. Verified Findings (P0–P5)Demonstrated Defects (P0–P3)No open P0–P3 blocking defects identified in branch HEAD Non-Defect Findings, Coverage Limitations, and Disclosures (P4–P5)Finding P4-01: Coverage Limitation on Bounded Work Claims
Finding P5-01: Retained Release-Ledger Policy Advisory (Disclosed / Non-Fatal)
Finding P5-02: Target Execution and Consumer Narrative Status
3. Production Paths & Boundary Analysis
4. Merge Commit Inspection
5. Constants & Numeric Claims Audit
6. Citations & PR Structure Validation
7. Executed vs. Inspected ChecksExecuted Checks (Read-Only Terminal Inspection in Workspace)
Inspected Coordinator Evidence (Docker COPY Worker
|
|
Code Lawyer merge gate: OPEN at All five automated CI checks pass; exact-head Docker The user has explicitly authorized Code Lawyer merging. Proceeding with a regular merge commit and exact-head match, without protection bypass, consumer repin, or branch deletion. Jim #302 remains incomplete; this closes the target-validation prerequisite only. |
Outcome
Checks and actions
|
Plain-English Walkthrough
TL;DR
Target IR lowering accepts proven same-width unsigned subtraction after independently checking raw Core. Altered guards, malformed operands, and proof-scope violations reject before artifact construction. This supplies the target boundary needed after merged #211; it does not add Echo execution or complete Jim #302. [claim:target-boundary, confidence:1.00]
Walkthrough
Core supplied to the target lowerer remains untrusted even when a source compiler normally produces it. The target-owned walker checks basis expressions and input predicates without treating those predicates as established facts. Intent body expressions may use exact conjunctive input constraints. It never calls the source compiler's subtraction proof routine. Existing authority/type checks validate signatures, operand types, and literal values. [claim:independent-proof, confidence:1.00]
The stages below distinguish totality evidence from type validation; both must succeed before a target artifact is emitted.
flowchart LR A[Raw Core] --> B[Whole-module type integrity] B --> C[Target-owned arithmetic totality] C --> D[Expression types and authority] D --> E[Target IR construction] B --> F[Structured refusal] C --> F D --> FCaption: Independent target validation
The target preserves the arithmetic expression, width, and operand order. It accepts self-subtraction, a zero subtrahend, ordered unsigned constants, or exact conjunctive input facts. Disjunctions and negations supply no proof; basis and input-constraint arithmetic cannot assume body evidence. [claim:target-boundary, confidence:1.00]
Audit found repeated recursive validation: eight subtraction nodes triggered 255 validation visits directly, 6,560 through conditionals, and 43,690 through record-field operands. The fix makes inferred type coordinates carry validated literal/reference facts and reuses that result in subtraction and comparison-shape checks. All three fixtures now take eight subtraction-validation visits. These are deterministic work counts, not throughput measurements or a bound on every compiler pass. [claim:bounded-validation, confidence:1.00]
Validation
Tests and checks ran inside the existing COPY-based Docker worker, with copied source/history and no host repository mounts.
InvalidCoreIdentitybefore target support; original mutation refusals were retained.cargo test --locked -p edict-syntax --lib target_ir::unsigned_subtraction::testsfailed all three work-bound assertions at the counts above.cargo test --locked -p edict-syntax --test target_unsigned_subtractionpasses all ten tests. Nested public inputs retain overflow, negative-unsigned, and malformed-literal refusal.edict-syntaxClippy passed.cargo xtask verifyexited 0 at34832fb8a1484fc5f462db9fc316dff9854374a3, including workspace tests, doctests, golden/provider checks, and all 27 topic shelves.MissingSurface: v0.1.0-alpha.1 [policy block]release-ledger advisory remains disclosed.Scope, prerequisites, and compatibility
Both #215 (security prerequisite) and #211 (source compiler) are merged. This PR targets
mainand includes them by regular merge. The main-relative diff changes no dependencies or consumer producer locks. [claim:scope, confidence:0.99]Earlier isolated Jim public-build evidence advanced from target refusal to package construction, while the original evaluator still returned
UnsupportedProgram. That historical consumer probe was not rerun for this audit and is not used as proof of runtime completion. Runtime support, application-owned rope semantics, admitted execution, Tick/WAL/receipts, recovery, and full oracle agreement remain outside this PR.Updated the Target IR topic, requirement/test matrix, and changelog. Hosted CI and independent review remain separate live merge gates.
Appendix: Citations
claim:target-boundarycrates/edict-syntax/src/target_ir/unsigned_subtraction.rs#11@34832fb8a1484fc5f462db9fc316dff9854374a3;target_lowers_proven_unsigned_difference_without_changing_operands, signature/guard mutation tests incrates/edict-syntax/tests/target_unsigned_subtraction.rsclaim:independent-proofcrates/edict-syntax/src/target_ir/unsigned_subtraction.rs#33@34832fb8a1484fc5f462db9fc316dff9854374a3; metadata and cross-intent tests incrates/edict-syntax/tests/target_unsigned_subtraction.rsclaim:bounded-validationcrates/edict-syntax/src/target_ir/unsigned_subtraction.rs#194@34832fb8a1484fc5f462db9fc316dff9854374a3;crates/edict-syntax/src/target_ir.rs#1408@34832fb8a1484fc5f462db9fc316dff9854374a3; the three*_validation_work_is_boundedtests andtarget_checks_nested_operands_without_repeated_validationclaim:scopeCloses #212