Skip to content

fix(provider): refuse the footprint laws runtime admission refuses - #1024

Merged
flyingrobots merged 8 commits into
mainfrom
fix/runtime-provider-admission-agreement
Nov 24, 2026
Merged

flyingrobots merged 8 commits into
mainfrom
fix/runtime-provider-admission-agreement

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Closes #1023.

Change kind: bug fix. The provider lowerer and verifier now refuse what warp-core admission refuses. Admission refusals now carry reason codes.

Root cause

jedit#296's basis-read witness (package 8e99859a…, Amblicit 738d3da7) declares a footprint law with max_writes = 1024. warp-core's EffectFootprintLaw refuses any law with max_writes above 256. Admission reported only InvalidStructure: invalid authored-effect program, because EchoOperationProgram::from_canonical_bytes discarded the cause. The provider verifier's envelope checked only that the graph schema and footprint law were canonical ("their contents are the runtime's to admit"). The lowerer's policy_bytes checked only that they decode. So both provider judges accepted a law that no runtime admits.

The provider was wrong. docs/architecture/authored-operation-effects.md (Footprint law; Required tests, "Footprint law ceilings") states that max_writes is at most 256 and that admission refuses anything above it. The runtime enforces exactly that. The reasoning is in the PR comment below.

What changes

  • Provider: effect_contract.rs, byte-identical in the lowerer and the verifier, judges the graph schema and footprint law with the runtime's exact shape, canonical form and ceilings (4,096 reads, 256 writes, 65,536 range edges).

    • The lowerer refuses at publication with EffectPublicationError::Contract(ContractRefusal). Its wire message is the code.
    • The verifier refuses with EffectPackageRefusal::Contract(ContractRefusal). The verification report stays rejected with the existing refused code.
  • warp-core reason codes: EchoOperationAdmissionError::reason_code() and EchoOperationArtifactErrorV1::{reason, reason_code}. They return:

    • an effect-program.* code, in the Name the failing check in provider lowerer and verifier refusals #1018 scheme, for authored-effect program refusals: program-envelope, graph-schema, footprint-law, footprint-law.max-{reads,writes,range-edges}, resource-limits, compiled-program, graph-read-declaration, compiled-binding;
    • an artifact.* code for other artifact refusals;
    • an admission.* code for policy refusals.

    The graph-schema and footprint-law codes are the provider's codes for the same check. EffectLawError gains MaxReads, MaxWrites and MaxRangeEdges. The detail text now names the code.

  • Corpus: adds footprint-writes-at-ceiling (accepted) and footprint-writes-over-ceiling (refused by all three judges), regenerated by warp-core's builder. No existing entry's bytes changed.

Tests

  • public_basis_read_effect::admission_refuses_the_basis_read_law_above_the_write_ceiling (warp-core, public_effect_host_tests): admits the retained witness bytes through EffectPackageHost under exact policies at 1,048,576 and 2^53−1 steps. It expects ArtifactInvalid with effect-program.footprint-law.max-writes.
  • runtime_admission_agreement.rs (verifier):
    • the_provider_and_runtime_admission_agree_on_the_whole_corpus covers all 76 corpus packages. Each package is admitted through EffectPackageHost under an exact policy built from its own pins and ceiling. Provider-accepted packages must be admitted. Refusals on both sides must fall in the same reason class. The 11 entries that warp-core's corpus marks Runtime::Executes are refused only at run time; they are the named exception, and a separate test checks that exception.
    • both_judges_refuse_the_basis_read_law_above_the_write_ceiling.
  • publication_refuses_a_law_above_the_write_ceiling (lowerer): 256 publishes and 257 is refused, naming the check.
  • typed_effect_law_refuses_noncanonical_sets_shapes_and_oversized_counts now expects each ceiling's own variant and admits each count at its ceiling.
  • RED:
    • Before the fix, the warp-core admission test failed with the generic refusal, and the reason-code tests did not compile.
    • Calibration: with the provider's law judgment disabled, both_judges_refuse… and publication_refuses_a_law_above_the_write_ceiling fail. Before compiled-binding had a code, 37 corpus refusals fell into the wrong class.
  • GREEN:
    • cargo test -p echo-edict-provider-lowerer -p echo-edict-provider-verifier (all suites).
    • cargo test -p warp-core --features trusted_runtime,native_rule_bootstrap --test public_effect_host_tests --test edict_effect_package_tests --test executable_operation_pipeline_tests.
    • clippy -D warnings on the libraries and touched test targets.

Components

The lowerer and verifier component bytes change. They will be promoted from this PR's G4 candidates in a follow-up commit, following 678e5d2 and 9a42d08.

Docs

  • authored-operation-effects.md has a new "Admission refusal reasons" subsection, and its law-ceiling text and row now say that the provider applies the same check.
  • The lowerer README, verifier README, corpus README and CHANGELOG (Fixed) are updated.

Follow-up for jedit#296

The witness must declare max_writes ≤ 256 in its lawpack's Echo operation configuration. After that, the lowerer, the verifier and admission all accept it. Echo cannot admit the current package as published.

Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code

warp-core admission refused jedit#296's basis-read witness (package
8e99859a) with a generic "InvalidStructure: invalid authored-effect
program" while Echo's provider lowerer and verifier accepted it. The
package's footprint law declares max_writes = 1024; the effect profile
caps it at 256 (docs/architecture/authored-operation-effects.md), and
admission enforces that. Both provider judges deferred the graph schema's
and footprint law's contents to the runtime, so the provider was wrong.

The lowerer and verifier now judge both with the runtime's exact shape
and ceilings (effect_contract.rs, byte-identical in each crate), and
refuse with a Contract variant naming the check. warp-core admission
refusals now carry stable reason codes in the #1018 scheme:
EchoOperationAdmissionError::reason_code returns an effect-program.* code
for authored-effect program refusals (for example
effect-program.footprint-law.max-writes), an artifact.* code for other
artifact refusals and an admission.* code for policy refusals.
EffectLawError names each ceiling.

The shared effect corpus gains footprint-writes-at-ceiling and
footprint-writes-over-ceiling. A new verifier test admits every corpus
package through EffectPackageHost and requires the provider and runtime
to agree, in the same reason class; the corpus's executed entries, which
only running refuses, are the named exception.

Component bytes change; they are promoted from G4 in a follow-up commit.

Refs #1023.

Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

@flyingrobots

Copy link
Copy Markdown
Owner Author

Which judge was wrong, and why

Evidence. I instrumented EchoOperationProgram::from_canonical_bytes locally and kept none of that code. The witness's refusal comes from EffectFootprintLaw::from_canonical_bytes. The decoded law has max_reads = 512, max_writes = 1024 and max_range_edges = 512. Only max_writes breaks a ceiling: law.rs refuses max_writes > 256. Every other stage of EffectProgram::from_value passes.

The spec. docs/architecture/authored-operation-effects.md, section "Footprint law", lists "the unsigned counts max_reads (at most 4,096), max_writes (at most 256), and max_range_edges (per range read, at most 65,536), which admission checks against these effect-profile ceilings so no law can overflow the arena's sizing arithmetic". The Required-tests row "Footprint law ceilings" requires a law with max_writes above 256 to be "refused at admission". The ceiling is part of the effect profile's arena sizing, not a runtime option. Amblicit's side only carries the lawpack's configured law. It sets no ceiling of its own and cannot widen Echo's.

The provider. It never looked inside the law. The verifier's effect_package::envelope said so explicitly: "The runtime parses both; the verifier requires each to be one canonical value. Their contents are the runtime's to admit." The lowerer's policy_bytes only decoded the law. So the provider published and verified a package that no conforming runtime admits. That breaks the three-judge agreement the corpus exists to hold.

Decision. The runtime is right, so I fixed the provider. Raising the runtime ceiling would change the effect profile's arena law, and nothing asks for that. The provider now applies the runtime's exact law and schema judgment. The graph schema had the same gap, so the provider now judges it too. warp-core keeps its behaviour but names the check. jedit#296 needs its configuration to declare max_writes ≤ 256.

Rejected alternative. Making the provider depend on warp-core's parser is not possible: the lowerer and verifier ship as dependency-free wasm components. The shared judgment is therefore one small module, byte-identical in both crates, as #1021 does with refusal_reason.rs. The corpus agreement test pins it to the runtime.

…sion agreement

Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code
Promote the lowerer and verifier components from the two byte-equal G4
designated candidates built at 1f68a8d (CI run 44454007264), approving
lowerer a21744de... and verifier 394b4431..., and update the provider
package manifests, assets, identity goldens and component READMEs.

Refs #1023.

Agent-Session: AFC0A5E0-B032-49DC-8B18-CB932831DCC2
Agent-Tool: Claude Code
Resolves conflicts with main's refusal reasons (UnsupportedProgram now
carries a ProgramRefusal): the provider keeps both the Contract refusal
and the named program refusal, and the corpus reasons list names the
footprint-writes-over-ceiling entry. The runtime agreement test matches
the new UnsupportedProgram(_) shape.

Agent-Session: 2DF514AD-94C9-4689-89DC-C6B7F7FE50DD
Agent-Tool: claude-code
Cross-tests the provider's judge_footprint_law against warp-core's
EffectFootprintLaw at each ceiling (4,096 reads, 256 writes, 65,536
range edges) and one past it, requiring the same verdict and code, and
requires the lowerer's and verifier's effect_contract.rs to stay
byte-identical. Raising the verifier's MAX_READS to 4,097 fails both.

Agent-Session: 2DF514AD-94C9-4689-89DC-C6B7F7FE50DD
Agent-Tool: claude-code
@flyingrobots

Copy link
Copy Markdown
Owner Author

Review at af6abf6 (stage A; merges after #1028, #1012, #1007)

Merge of origin/main: finished the in-progress merge (2c807e9). The six conflicted files keep both sides: main's UnsupportedProgram(ProgramRefusal) plus this PR's Contract(ContractRefusal). reasons.txt names footprint-writes-over-ceiling → effect-program.footprint-law.max-writes. The merge broke one thing outside the conflicts: runtime_admission_agreement.rs matched the old unit variant UnsupportedProgram. Fixed in the merge commit.

Claim checked: the provider refuses exactly the footprint laws that warp-core admission refuses.

  • The ceilings are 4,096 reads, 256 writes and 65,536 range edges. In warp-core/src/edict_effects/law.rs they are literals. In the provider they are the MAX_* consts in effect_contract.rs, which is byte-identical in the lowerer and the verifier. Both sides use > comparisons, so a value at the ceiling is accepted and one past it is refused. The provider codes match EffectProgramRefusal::code().
  • Gap found: the corpus probed only max_writes (256 / 257). Nothing tested reads or range edges at their ceilings, and nothing stopped the three copies from drifting apart.
  • Fix (af6abf6, tests only):
    • the_provider_and_runtime_agree_at_and_past_each_footprint_ceiling runs judge_footprint_law and EffectFootprintLaw::from_canonical_bytes on each field at its ceiling and at ceiling+1, and requires the same verdict and the same code.
    • the_lowerer_and_verifier_share_one_contract_judgment requires the two effect_contract.rs copies to stay byte-identical.
    • RED was observed: setting the verifier's MAX_READS to 4097 fails both tests.

Local runs (shared Echo target, under lock): every test in echo-edict-provider-lowerer and echo-edict-provider-verifier passes. warp-core edict_effect_package_tests passes 143 (1 ignored) and the --lib tests pass 1014, both with trusted_runtime,native_rule_bootstrap.

Verdict: sound. Approve once the dependency PRs land and the provider components are re-promoted. Component-digest checks may stay red until then.

Keeps both CHANGELOG Fixed entries (#1023 and #1025).

Agent-Session: 2DF514AD-94C9-4689-89DC-C6B7F7FE50DD
Agent-Tool: claude-code
Agent-Session: 2DF514AD-94C9-4689-89DC-C6B7F7FE50DD
Agent-Tool: claude-code
Candidates from det-gates run 45404360103 match the digests CI printed: lowerer 165b41a8, verifier 6872448b. Regenerated per the echo-wesley-gen README; package goldens, READMEs and CHANGELOG follow.

Agent-Session: 2DF514AD-94C9-4689-89DC-C6B7F7FE50DD
Agent-Tool: claude-code
@flyingrobots
flyingrobots marked this pull request as ready for review November 24, 2026 14:08
@flyingrobots
flyingrobots merged commit d9f620a into main Nov 24, 2026
42 checks passed
@flyingrobots
flyingrobots deleted the fix/runtime-provider-admission-agreement branch November 24, 2026 14:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 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-24T14:08:56.314468Z 6d15879 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.

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.

warp-core admission refuses a package the provider judges accept (InvalidStructure)

1 participant