Repository navigation
Persist predict_physics claims: physics_specs + receipt re-verification - #525
Conversation
Mirror the clearance-claim persistence loop for static-physics assertions:
- vcad-ir: PhysicsSpec (label, part/domain_box, loads, supports, material
props, limits, fidelity) + Document.physics_specs, ts-rs exported
- predict_physics gains `label`: upserts the spec on the document (part
persisted by resolved root id); requires document_id + at least one limit
- physicsReceiptClaims re-solves each spec at its stored fidelity and emits
physics.static.<label>.{displacement,stress} claims with basis
predicted/verified and a re-runnable StoredPhysicsClaim in details
- verifyPhysicsClaims re-solves and classifies Holds/Stale/Violated;
fail-closed: unresolvable part, non-converged solve, or missing payload
is Violated (unverifiable at build time), never a silent pass
- build_receipt/verify_receipt wired; verify_receipt tool handler now
passes the engine (clearance re-verification via the live tool needed it
too)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Choji review — Looks good This delta addresses both prior findings: STALE_REL_EPS is now 1e-6 with an explanatory comment, and the epsilon-based stale classification is no longer a concern. The new changes wire physicsReceiptClaims into the place_order gate alongside clearanceReceiptClaims, add two gate tests (violated and holds paths), and fix the no-specs guard to check both clearance_specs and physics_specs. The logic is correct: the gate correctly refuses on failing or unverifiable physics claims, the no-specs path is properly updated, and the test fixtures look sound. No blockers found in the delta. No findings — looks good. Verified by ChojiChoji ran your change live — checks failed. 3 checks.
Checks marked environment failed in Choji's sandbox, not against your PR. They never block. The ticket asked for persisted predict_physics claims (physics_specs + receipt re-verification); the PR implements exactly that — PhysicsSpec IR types, label-based upsert on the document, physicsReceiptClaims for build_receipt, verifyPhysicsClaims for verify_receipt, and the verify_receipt engine-pass fix. No live preview was run (this is an MCP/server-side change with no browser UI). Both npm test and npm typecheck failed solely because wasm-pack is absent in the environment (vcad-kernel-wasm#build: spawnSync wasm-pack ENOENT), which cascades through Turborepo and prevents downstream packages from running. The cargo check failure is also environmental: the tang crate path is missing from the sandbox. Neither failure reflects a defect in this PR's code. Tool-surface fixture is updated, changelog entry is present, and the gen-ir-types.mjs FORCE_OPTIONAL list is updated for physics_specs — all consistent with the stated intent. No issues found in the running app. Was this review useful? Rate the findings → — your thumbs up or down trains Choji on what's worth flagging. Reviewed |
M4 gate 2 now re-solves doc.physics_specs (via physicsReceiptClaims) alongside clearance specs before money moves: a failing or unverifiable physics.static claim refuses the debit fail-closed, and the no-specs "unverified" path only applies when the document carries neither kind of spec. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Added e0eec02: the place_order M4 receipt gate now also re-solves persisted physics specs — failing/unverifiable physics.static claims refuse the debit fail-closed, and the no-specs 'unverified' path requires neither clearance nor physics specs. Two new gate tests; full mcp suite 807 passed. |
- The two new place-order gate tests hit vitest's 5 s default on CI runners (two mesh FEA solves each): solve at resolution 12 — the gate semantics don't need FEA accuracy — and allow 30 s. - STALE_REL_EPS 1e-9 → 1e-6 (review feedback): PCG converges to a tolerance, not bit-identical results, so the Holds/Stale boundary now sits above iterative-solver noise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Pushed 215fcb8: the two new order-gate tests timed out at vitest's 5 s default on CI (two mesh FEA solves each) — they now solve at resolution 12 with a 30 s allowance. Also took Choji's epsilon finding: STALE_REL_EPS raised 1e-9 → 1e-6 with a comment explaining that PCG converges to a tolerance, not bit-identical results. 🤖 Addressed by Claude Code |
Dismissing prior approval to re-evaluate 215fcb8.
Mirrors the clearance-claim persistence pattern (check_clearance) for
predict_physics, so structural limits re-verify viabuild_receipt/verify_receiptinstead of rotting as one-off checks.Stacked on #524 (needs ClaimBasis + predict_physics). Base will be retargeted to
mainonce #524 merges.What
PhysicsSpec(label, part/domain_box, loads, supports, material props, limits, fidelity) +Document.physics_specs, ts-rs exported (npm run ir:genregenerated;gen-ir-types.mjsmarks the field wire-optional likeclearance_specs).labelarg: upserts the spec on the document; the part is persisted by resolved root id so it survives renames. Requiresdocument_idand at least one limit.physicsReceiptClaims: re-solves each spec at its stored fidelity, emittingphysics.static.<label>.{displacement,stress}claims withbasis: predicted|verified(ClaimBasis from Verified design loop, Acts I–III: claim basis, trust boundary, predict_physics, macro library #524) and a re-runnableStoredPhysicsClaimpayload indetails.verifyPhysicsClaims: re-solves per claim and classifies Holds (identical result), Stale (geometry changed, limit still holds), Violated (limit exceeded). One solve per spec via cache when a spec carries both limits.build_receiptemits physics claims in both the mechanical-only and PCB branches;verify_receiptre-verifies them and folds into the worst-status rollup. Drive-by fix: theverify_receipttool handler never passed the engine, so clearance re-verification via the live tool always errored — now passesctx.engine.Tests
physics-claims.test.ts: persistence/upsert, labeled claim emission with basis, Holds/Stale/Violated transitions, fail-closed paths (10 tests).@vcad/mcpsuite: 805 passed.cargo test -p vcad-ir, workspace clippy-D warningsclean. Tool-surface fixture regenerated.🤖 Generated with Claude Code