Skip to content

feat(integrity): the server loads the solver manifest and attaches the checker - #540

Open
hyperpolymath wants to merge 5 commits into
claude/new-session-th4e9w-gate-unlistedfrom
claude/new-session-th4e9w-integrity-wire
Open

hyperpolymath wants to merge 5 commits into
claude/new-session-th4e9w-gate-unlistedfrom
claude/new-session-th4e9w-integrity-wire

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Stacked on #539. This is step 2 of three for the last fail-open path in the dispatch integrity gate (owner ruling 2026-11-30: wire a checker in before closing the no-checker path). echidna server now loads the solver manifest at start-up, attaches the integrity checker to its shared dispatcher, and refuses to start when the manifest cannot be read.

Changes

  • src/rust/server/mod.rs: build_dispatcher(manifest) attaches IntegrityChecker::from_manifest_file. On a missing or unreadable manifest the server stops, with an error that names the path, ECHIDNA_SOLVER_MANIFEST and echidna integrity pin. start_server uses default_manifest_path().
  • src/rust/server/verify.rs: /api/verify_parallel used to build a bare ProverDispatcher::new() per request, with no checker. It now uses the shared dispatcher from AppState.
  • src/rust/integrity/solver_integrity.rs: IntegrityChecker::verify_for(prover) hashes only the manifest entries that name the dispatching prover. Before, every dispatch read and hashed all 17 listed binaries (verify_all), a cost that becomes real once a checker is attached.
  • src/rust/dispatch.rs: the three gate sites call verify_for.
  • All six Containerfiles (Containerfile, container/Containerfile, .containerization/Containerfile{,.full,.mcp,.wave3}; nine runtime stages) copy config/solver-manifest.toml to /app/config/ and set ECHIDNA_SOLVER_MANIFEST.
  • Docs: docs/ARCHITECTURE.adoc (integrity step status), docs/ENV-VARS.adoc, docs/PROOF-STATUS.adoc R1.

What this changes for a running server

Together with #537 and #538 (D9: Verified only), a server dispatch now fails the gate for every prover whose binary is not pinned. The shipped manifest is all placeholders, so until an operator runs echidna integrity pin, /api/verify_parallel and, under verisim, /api/prove return verified: false (Level1 is below the default minimum, Level2). This is the D9 outcome the owner chose. The images do not pin at build yet. I propose that as its own PR (a RUN /app/bin/echidna integrity pin once each stage has installed its provers), and it should land together with this one.

Not covered, found while wiring: /api/verify does not go through the dispatcher at all. It runs the prover backends directly, so neither the integrity step nor any other trust-pipeline step applies to it. It is recorded in docs/ARCHITECTURE.adoc and PROOF-STATUS.adoc R1, and it needs its own fix.

RSR Quality Checklist

Required

  • Tests pass (see Testing)
  • Code is formatted (cargo fmt)
  • Linter is clean (cargo clippy --all-targets -- -D warnings: exit 0)
  • No banned language patterns
  • No unsafe blocks
  • No banned functions
  • SPDX headers present (no new files)
  • No secrets

As Applicable

  • Documentation updated (ARCHITECTURE, ENV-VARS, PROOF-STATUS)
  • Container images built: not run. Podman is not available in this session. The Containerfile changes are a COPY and an ENV placed after each existing COPY … /app/bin/echidna, and config/ is in the build context (there is no .containerignore).

Testing

New tests:

  • verify_for_checks_only_the_named_prover: only z3's entry is hashed for Z3; Lean gets no report and fails the gate.
  • a_missing_manifest_stops_the_server: the error names ECHIDNA_SOLVER_MANIFEST and echidna integrity pin.
  • the_shipped_manifest_loads.

Full suite: cargo test ran 40 test binaries, 1897 passed and 0 failed. cargo clippy --all-targets -- -D warnings exits 0.

CI note: Rust CI ends in startup_failure on main too (#533 is investigating), so CI/gate will not report until that is fixed. The results above are local runs on this commit.


Generated by Claude Code

…anifest

Every entry in config/solver-manifest.toml holds
PLACEHOLDER_COMPUTE_ON_FIRST_RUN, and nothing computed a hash. Owner
decision D9 makes an unpinned binary fail the dispatch gate, so a pinning
step has to exist before a checker is attached at startup.

`echidna integrity pin` is an explicit operator step. Dispatch never pins
(no trust on first use). It replaces a placeholder with the SHAKE3-512
of the binary found now. It refuses, and writes nothing, when a real hash
differs from the binary, which may be tampering, unless --force is given.
It also refuses when a binary cannot be read, or when a solver named with
--solver is not found. --dry-run reports without writing. The rewrite
goes through toml_edit, so comments and field order survive.

`echidna integrity check` hashes every listed binary, prints its status
and fails on Tampered.

The manifest path is $ECHIDNA_SOLVER_MANIFEST, or else
config/solver-manifest.toml (docs/ENV-VARS.adoc). toml_edit 0.25 becomes
a direct dependency; it was already in Cargo.lock.

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

Owner ruling 2026-11-30: wire a checker in before closing the no-checker
path of the dispatch integrity gate.

- echidna server loads the manifest from $ECHIDNA_SOLVER_MANIFEST, or
  else config/solver-manifest.toml, through build_dispatcher. It attaches
  the IntegrityChecker to the shared dispatcher, and it refuses to start
  when the manifest cannot be read. The error names the path, the
  variable and `echidna integrity pin`.
- /api/verify_parallel used a fresh ProverDispatcher::new() per request,
  with no checker. It now uses the shared dispatcher in AppState.
- Each dispatch hashes only the dispatching prover's binaries
  (IntegrityChecker::verify_for), not all 17 listed binaries
  (verify_all).
- All six Containerfiles (nine runtime stages) copy the manifest to
  /app/config/ and set ECHIDNA_SOLVER_MANIFEST.
- ARCHITECTURE, ENV-VARS and PROOF-STATUS R1 say what now runs. They also
  record that /api/verify does not go through the dispatcher.

Tests: verify_for_checks_only_the_named_prover,
a_missing_manifest_stops_the_server, the_shipped_manifest_loads. cargo
test: 40 test binaries, 1897 passed, 0 failed. Clippy --all-targets with
-D warnings is clean. Container images were not built (no podman here).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
SonarCloud rust:S2208 on #539: the module glob-imported its parent.
It uses only IntegrityOp from it.

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

gitnotebooks Bot commented Dec 1, 2026

Copy link
Copy Markdown

Review these changes at https://app.gitnotebooks.com/hyperpolymath/echidna/pull/540

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You'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 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 86dd5399-cd2b-43d8-834f-6df5a6e3816e
Commits

Reviewing files that changed from the base of the PR and between b9b9357 and 6f22f93.

Files selected for processing: 13

  • .containerization/Containerfile
  • .containerization/Containerfile.full
  • .containerization/Containerfile.mcp
  • .containerization/Containerfile.wave3
  • Containerfile
  • container/Containerfile
  • docs/ARCHITECTURE.adoc
  • docs/ENV-VARS.adoc
  • docs/PROOF-STATUS.adoc
  • src/rust/dispatch.rs
  • src/rust/integrity/solver_integrity.rs
  • src/rust/server/mod.rs
  • src/rust/server/verify.rs
  • 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

Copy link
Copy Markdown
Owner Author

"Dependency audit" fails on this head because of main, not this PR. cargo-audit.yml is red on main for the last runs: Cargo.lock and fuzz/Cargo.lock report vulnerabilities. #534 fixes it, and its own audit is green. Rust CI ends in startup_failure on main too (#533), so CI/gate cannot report on any PR yet. I will merge main up this stack once both land.


Generated by Claude Code

Base automatically changed from claude/new-session-th4e9w-integrity-pin to claude/new-session-th4e9w-gate-unlisted December 1, 2026 20:11
@hyperpolymath
hyperpolymath marked this pull request as ready for review December 1, 2026 20:11
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-12-01T20:12:03.369956Z
We couldn’t complete this review. Comment @codex review to try again.
138eca1 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.

@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.

@hyperpolymath
hyperpolymath added this pull request to stack #541 December 1, 2026 20:12
…w-session-th4e9w-integrity-wire

# Conflicts:
#	docs/ENV-VARS.adoc
#	src/rust/integrity/solver_integrity.rs
@hyperpolymath
hyperpolymath enabled stacked auto-merge (squash) December 1, 2026 20:16
@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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