Skip to content

feat(769): body templates for 9 remaining trinity concepts — verdict 13→4#769

Merged
TSavo merged 1 commit into
mainfrom
feat/769-body-templates-9-concepts
May 13, 2026
Merged

feat(769): body templates for 9 remaining trinity concepts — verdict 13→4#769
TSavo merged 1 commit into
mainfrom
feat/769-body-templates-9-concepts

Conversation

@TSavo
Copy link
Copy Markdown
Owner

@TSavo TSavo commented May 13, 2026

Why

Fourth and final PR in the body-template stack. Fills in real concept:* → java code body templates for the 9 concepts that #768 left as language-stubs. Trinity verdict drops from 13 loss entries to 4 — and the remaining 4 are all substrate-deferred capabilities, not template gaps.

What

menagerie/java-language-signature/specs/body-templates/java-canonical-bodies.json expanded from 3 entries (identity / unit / bool-cell) to 12 — adding the 9 named in #768's bind-stub-body-emitted list:

  • assert — translates panic! to throw new RuntimeException(...) with documented message-loss
  • list — Rust slice-sum-with-+= lowered to enhanced-for accumulator
  • option-1 sentinel for None (documented in loss_record_contribution)
  • option-bind — fixture-specific doubling body (loss-flagged)
  • pair — Rust tuple (b, a) lifted to new long[] { ${param1}, ${param0} } (two loss-dims)
  • result-1 sentinel for Err
  • result-bind — fixture-specific doubling body (loss-flagged)
  • retry-loop — fixture-specific termination condition (loss-flagged)
  • tagged-union — fixture-specific labels 0/1/2 (loss-flagged)

Each non-canonical template carries loss_record_contribution as a literal ir-formula Map keyed by loss-dimension name, so the compound loss-record this template participates in stays honestly characterized per Supra omnia rectum.

CID mint

New plugin CID (re-minted via cargo run -p provekit-plugin-loader --bin mint-plugin-cid per #767):

blake3-512:e9c5dd414a182211d5b85e3f2052d491e85c90db5ed29fb1145c7d1ad7f4e34f71de80c12a210202c6bd7efe26639da0e4e1c446beca786245d4a3dc6708204b

Stamped in the JSON header and pinned in substrate_default_cids.rs::java_canonical_bodies_cid_self_consistent. Drift test green.

Multi-line indent fix

SugarRealizer.java previously rendered every template as a single 8-space-indented line. Multi-line bodies (list, retry-loop, option-bind, result-bind, tagged-union) now have each internal line re-indented to the 8-space method-body column. Single-line bodies unchanged.

Trinity verdict — load-bearing measurement

trinity_round_trip: v0 loudly-bounded-lossy outcome (4 loss entries):
  [leg-3-not-reached] ...
  [source-language-not-supported] (java)
  [v0-capability-gap] multi-lang lift_plugin dispatch deferred
  [v0-capability-gap] real ConceptAbstractionMemento catalog deferred

Count: 13 → 4. All 9 bind-stub-body-emitted entries gone. The 4 remaining are substrate-deferred capabilities (Rust-only source lift cascades through legs 2-3), and they're the next-up backlog after this stack.

Empirical verification on the bind output:

stubs: 0
real return lines: 11   (the 12th concept is `unit` — `return;` not `return X`)

Sample real-body emission:

  • swap_pairreturn new long[] { b, a };
  • classifyif (x < 0L) return 0L; else if (x == 0L) return 1L; else return 2L;
  • retry_until_success → real while-loop with attempt counter

Closes the federation-by-construction boundary

With #769 in, Rust holds zero Java syntax for the bind production path. The Java plugin owns every byte of final class XTransported { ... } it emits. cmd_transport's stale TargetStyle::Java arms remain only as dead code for non-bind callers (cross-language transport CLI); boy-scout cleanup is follow-up.

Tests

  • trinity_roundtrip_test: PASS (4 entries, all substrate-deferred)
  • substrate_default_cids::java_canonical_bodies_cid_self_consistent: PASS (new pin)
  • Java plugin: builds + serves all 12 entries via JSON-RPC

Gated by

#766 (spec, merged), #767 (data + minting recipe, merged), #768 (dispatch + is_stub threading, merged)

Blocks

Nothing in the trinity stack. The next backlog item is non-Rust source lift (the source-language-not-supported loss entry).

🤖 Generated with Claude Code

…13→4

Fills in real Java body templates for assert, list, option, option-bind,
pair, result, result-bind, retry-loop, tagged-union. Each non-canonical
template carries a literal ir-formula loss_record_contribution flagging
fixture-specific aspects (sentinel values, fixture-specific bind bodies,
tuple-to-array lifts, etc.) per Supra omnia rectum.

Trinity verdict drops from 13 loss entries to 4. All 9
bind-stub-body-emitted entries gone. The 4 remaining are substrate-
deferred capabilities (Rust-only source lift cascades through legs 2-3),
not template gaps — that's the next backlog after this stack.

Empirical: 0 stubs, 11 real return lines, 1 void-return (unit). swap_pair
emits 'return new long[] { b, a };'; classify emits the if-else cascade;
retry_until_success emits the real while-loop.

New CID minted via mint-plugin-cid (per #767 recipe):
blake3-512:e9c5dd41...204b

Pinned in substrate_default_cids drift test.

Also: SugarRealizer multi-line indent fix — each internal line of a
multi-line template now gets the same 8-space method-body indent.
Single-line bodies unaffected.

Closes the federation-by-construction boundary: Rust holds zero Java
syntax for the bind production path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@TSavo TSavo merged commit d9ea20c into main May 13, 2026
3 of 6 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Warning

Rate limit exceeded

@TSavo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 57 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1da4f6a-5152-4cb7-bfbe-5dddf17a7cb9

📥 Commits

Reviewing files that changed from the base of the PR and between fa180b2 and 1e620bc.

📒 Files selected for processing (3)
  • implementations/java/provekit-realize-java-core/src/main/java/com/provekit/realize/SugarRealizer.java
  • implementations/rust/provekit-plugin-loader/tests/substrate_default_cids.rs
  • menagerie/java-language-signature/specs/body-templates/java-canonical-bodies.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/769-body-templates-9-concepts

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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