Skip to content

fix(diagnostics): classify encrypted-database failures and surface damaged receipt chains - #316

Open
Coding-Dev-Tools wants to merge 6 commits into
mainfrom
fix/receipt-chain-diagnostics
Open

Coding-Dev-Tools wants to merge 6 commits into
mainfrom
fix/receipt-chain-diagnostics

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Summary

Preserves the receipt-chain diagnostics work from the closed #310 and adds the doctor exactness fix:

  1. Encrypted-database failure classification — EncryptionError now carries stable codes (database_damaged, database_busy, database_unavailable, key_rejected, driver_missing, key-file codes) so a damaged or locked SQLCipher file is no longer reported as a wrong key.
  2. Read-only receipt-chain verification — engraphis-init --check verifies operation-receipt chains through its own read-only connection and reports damage with recovery guidance, bounded to 25 scopes and 20k receipts. Receipt damage remains audit-only; memory writes and recall continue.
  3. Doctor exactness policy — the embedder check now uses settings.require_exact_backends, matching the factory, instead of inferring exact mode from a non-empty embed_model.
  4. Evidence refresh — the immutable receipt-diagnostics artifact is rebound to the merged tree with canonical LF producer bytes, and the README, benchmark guide, tests, and SVG/PNG provenance are repinned.

Verification

  • tests/test_receipts.py, tests/test_init.py, tests/test_encryption_dependency.py — passed.
  • The doctor exactness regression test — passed.
  • Artifact producer hashes, suite digest, artifact SHA, sidecar, SVG/PNG provenance — verified consistent.
  • This branch is based on current main (6c75758a).

This supersedes closed #310. The earlier PR was closed after its branch was rebased and pushed past the closed head.

Agent: commandcode

Coding-Dev-Tools and others added 5 commits November 3, 2026 05:49
A user-host report showed a forked receipt chain followed by the provider going unavailable with EncryptionError. Since 1.7.6 receipt damage is audit-only, but there was no supported way to see it outside the host log, and every encrypted-open failure was reported as a wrong key.

Extract receipt_chain_state/verify_receipt_chain so the install doctor verifies chains read-only through its own connection and reports damage with recovery guidance, bounded to 20k receipts and 25 scopes. Classify EncryptionError with stable codes; driver text is still never rendered because it can echo paths or the PRAGMA key.

Refresh the checksum-bound offline evidence artifact and its rendered SVG/PNG surfaces because tracked producer files changed.

Refs discussion #151.

Agent: opencode
Main now carries the 1.7.12 release, the sync/manifest hardening, and the
canonical evidence artifact. Rebind the receipt-diagnostics evidence to the
three producer files main changed (__init__, routes/v2_api, chunking_eval),
recompute the suite digest and artifact SHA, and repin the README, benchmark
guide, tests, and both rendered SVG/PNG pairs.
The merge that brought main's 1.7.12 release into this branch rewrote BENCHMARKS.md, README.md, and both benchmark SVGs with CRLF line endings, which changed their exact bytes under the repository's -text policy, and left the PNG provenance hashes bound to the pre-normalization SVG bytes.

Restore LF bytes, rebuild the sidecar with its required LF terminator, and re-stamp the artifact/SVG SHA-256 tEXt chunks so the checksum-bound evidence tests compare the committed bytes.

Agent: opencode
The embedder check inferred exact mode from a non-empty embed_model, while
the factory uses the explicit require_exact_backends setting. Honor the same
policy so a configured model may fall back when exact mode is off, and a
deployment that requires exact backends is checked strictly even with the
default model. The regression test sets the policy it exercises.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
CVE-2026-115557 in the Python 3.11.17 runtime is fixed in 3.11.18.
Pin the new multi-arch digest so the release grype gate can pass.

Co-authored-by: coding-dev-tools <coding-dev-tools@users.noreply.github.com>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T05:24:17.900175Z
We couldn’t complete this review. Comment @codex review to try again.
27a38ea PR opened
ℹ️ 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.

Bring the branch current with main for review.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
@Coding-Dev-Tools
Coding-Dev-Tools force-pushed the main branch 2 times, most recently from 3d330e8 to 8ef46b6 Compare November 4, 2026 06:12

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.

1 participant