Skip to content

foundry-parity-lab: CanCook as a registered DT64 method (G6) + board record for #1991/#1995 - #1996

Merged
AdaWorldAPI merged 8 commits into
mainfrom
ccr-ca0562e7-hudvlz
Nov 11, 2026
Merged

AdaWorldAPI merged 8 commits into
mainfrom
ccr-ca0562e7-hudvlz

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

This PR has two commits. One adds the G6 lab work: CanCook executed from its DT64 MethodRef. The other records the merged Foundry parity work on the board. No DR or DT64 contract changes.

G6: a registered method, lowered once per binding (fcee68c)

World::new now registers one MethodBinding for each (item, quantity) pair, with quantity ∈ {1, 3}. Each method's WHEN guard says "this store can make q of item m" as a SetExpr over the class's field positions: mask fields as Sym(field) and value fields as residuals. The method's reads are exactly the fields its guard names. DT64 guards take no parameters, so the quantity is a constant of the guard and part of the method id.

PreparedMethod::prepare does the following once per binding:

  • admits the MethodRef (BindStore::admit);
  • binds and borrows the reads plus storeId;
  • renames field positions to the bound planes, and conjoins the reader scope. The reader scope is the IAM stand-in and is never part of the method;
  • lowers the guard once through relalg and keeps the returned mask-RISC program.

run only executes that program. The lab writes no lowering of its own.

relalg: adds rel_from_set, a public wrapper over the SetExpr → Rel conversion that run_program already applied (from_set stays crate-private), plus a round-trip test.

Contract dependency: OGAR pulls lance-graph-contract from git, so the lab now patches it to the path crate, as relalg does. The lab's graph holds one contract and one ndarray.

Refusing a multi-fold lowering: relalg keeps only the last fold's program, so prepare refuses a guard that lowers into more than one fold. That cannot happen today; a test pins that every guard shape lowers to one fold.

Evidence

There are 8 new tests, 32 in the lab overall:

  • all 16 methods match the oracle;
  • row order does not change the answer;
  • the reader scope is load-bearing;
  • admit refuses a forged guard, another signature revision, and another store's reference;
  • a method whose reads miss a guard field is refused with NotBound;
  • repeated runs of one prepared method give the same answer;
  • every guard shape lowers to one fold.

Seven disable runs each turned the suite red and were restored:

  • drop the staff conjunct;
  • drop the known conjuncts;
  • make the stock threshold off by one;
  • drop the reader scope;
  • skip the identity mapping;
  • lower All instead of the guard;
  • treat an unbound field as All.

Measured

cargo run --release --manifest-path crates/foundry-parity-lab/Cargo.toml --bin bench. One VM, single thread, median of 41 runs, four runs:

Stage Time
method_ref + admit ~5 µs
prepare (admit, bind, borrow, one lowering) 14.9–15.2 µs
CanCook question, cached program 359–400 ns
arm B, hand-written program, same question 474 ns

The first version called run_program for every question, which re-lowers each time, and took about 21 µs per question. A fifth bench run, taken while the machine was loaded, measured 600 ns and is excluded.

Open

  • G6 in production: nothing yet owns a prepared program across questions.
  • G5 (bound relations) waits on ADMISSION B (EXO-140).
  • G1's limiting resource (P1b) waits on the min/argmin decision.

Board record (7323855)

The entries and supersession indexes are current, and board files only grew. Linear: EXO-227 (mirror) and EXO-223.


🤖 Generated with Claude Code

https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p

… transfer

PR_ARC_INVENTORY gets arc entries for #1991 and #1995; LATEST_STATE a row
for main after both; STATUS_BOARD marks D-FOUNDRY-PARITY-1 shipped and G1
partial (per-store cost done, limiting resource open as P1b);
INTEGRATION_PLANS points at the new entry and EXO-223. New entry
D-FOUNDRY-PARITY-1-P1A records arm C and the read-only LGJ crosswalk (the
R11 layout-witness gap is D-DRISA-M1). Entries index regenerated;
supersession index unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 131212d4-3daa-4910-a14c-24186a2c4775
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@AdaWorldAPI AdaWorldAPI reopened this Nov 10, 2026
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 10, 2026 20:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T20:20:29.753715Z 7323855 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

… per binding (G6)

World::new registers one MethodBinding per (item, quantity in {1, 3}). Each
binding's WHEN guard states the CanCook condition as a SetExpr over field
positions, and its reads are exactly the fields the guard names.
PreparedMethod::prepare does the following once per binding:

- admits the MethodRef;
- binds and borrows the reads plus storeId;
- renames field positions to the bound planes and conjoins the reader scope
  (the IAM stand-in, never part of the method);
- lowers the guard through relalg and keeps the returned mask-RISC program.

run only executes that program. The lab writes no lowering.

relalg gains rel_from_set, a public wrapper over the SetExpr -> Rel
conversion run_program already applied (from_set stays crate-private), plus a
round-trip test. The lab patches lance-graph-contract to the path crate, so
its graph holds one contract and one ndarray. prepare refuses a lowering of
more than one fold, because relalg keeps only the last fold's program. That
cannot happen today, and a test pins that every guard shape lowers to one
fold.

Eight tests:
- oracle parity for all 16 methods;
- row-order independence;
- the reader scope is load-bearing;
- admit refuses a forged guard, another signature revision and another
  store's reference;
- a method whose reads miss a guard field is refused NotBound;
- repeated runs of one prepared method equal the first;
- every guard shape lowers to one fold.

Seven disable runs turned the suite red, each restored afterwards. A
question takes 359-400 ns, level with arm B's hand-written program (474 ns).
The first version re-lowered on every call and took ~21 us.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
@AdaWorldAPI AdaWorldAPI changed the title board: record D-FOUNDRY-PARITY-1 (#1991, #1995) and the LGJ knowledge transfer foundry-parity-lab: CanCook as a registered DT64 method (G6) + board record for #1991/#1995 Nov 10, 2026
…it, xlog

The first matrix marked authorization, scenarios, actions and provenance as
having no contract without reading ogar-auth, ogar-rbac, lance-graph-rbac,
thought-git-probe or lance-graph-xlog. The authorization decision is
implemented (row scope + WideFieldMask via ScopedDecision); branches, a single
write path with commit witnesses, receipts with replay and a two-phase edge
write exist as probes. The gaps are restated as composition on this path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
…corrected

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
…ter, #1993 merged

Mapping for #1997 found three errors. authorize_identity reaches
authorize_memberships (MembershipDecision), not authorize_scoped. The
production LanceCycleWriter (WalSink::commit_cycle) is on main beside the
probe's stand-in, so G4 composes shipped pieces. #1993 merged as b34d195.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
# Conflicts:
#	.claude/board/entries/README.md
@AdaWorldAPI
AdaWorldAPI merged commit 83d5327 into main Nov 11, 2026
16 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Nov 11, 2026
…D-CODEGRAPH-MEM-1)

Regenerated after #1996/#1997 merged (--check flagged the drift first).
New workflow runs --self-test and --check on PRs touching the generator or
.codegraph/. REPORT.md: unrecovered original recipes, crosswalk, negative
tests with disable runs, 10-agent A/B measurement (index helps on
architecture questions, hurts on call impact while calls are
ARTIFACT_MISSING), gap report with owners, suggested CLAUDE.md line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
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.

2 participants