Skip to content

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

Merged
Coding-Dev-Tools merged 11 commits into
mainfrom
fix/receipt-chain-diagnostics
Nov 5, 2026
Merged

Coding-Dev-Tools merged 11 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

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.
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.
@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.
@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
## Why upgrade to Pro or Team in the README

- Adds a prominent upgrade section after the local feature list.
- Explains memory health analytics, scheduled upkeep, encrypted sync, team roles/audit, and the included Jev allowance.
- Shows how Jev helps agentic memory: safe vs risky actions, contradictory vs reinforcing memories, supported vs unsupported answers, and complete vs unfinished work.
- Adds pricing, no-card trial details, comparison link, and Pro/Team signup links.

Tests: documentation contracts, Pro CTA, plugin distribution, and skill package pass; ruff clean.
Bring the branch current with main.
@Coding-Dev-Tools
Coding-Dev-Tools force-pushed the fix/receipt-chain-diagnostics branch from 0341cf7 to 00f89b4 Compare November 5, 2026 07:07
@Coding-Dev-Tools
Coding-Dev-Tools deleted the branch main-tmp November 5, 2026 07:22
@Coding-Dev-Tools
Coding-Dev-Tools changed the base branch from main-tmp to main November 5, 2026 07:23
- Read receipt rows and the chain anchor in one snapshot so a live writer
  cannot make a healthy chain look damaged.
- Run the read-only receipt check before the write probe, so a preserved
  read-only copy still gets a receipt diagnosis.
- Check the most recently written scopes, not the largest ones.
- Share the factory's exact-backend policy with the doctor, including
  ENGRAPHIS_ENV=prod.
- Give key-file failures their own actionable message and document the
  nonzero exit on a damaged sampled chain.
…octor

The read transaction and shared exactness policy change two producer files.
Re-record their hashes, recompute the suite digest and artifact SHA, and
repin the README, benchmark guide, tests, and both SVG/PNG provenance pairs.
Bring the branch current for the gate.
@Coding-Dev-Tools
Coding-Dev-Tools merged commit ec00ec3 into main Nov 5, 2026
30 checks passed
@Coding-Dev-Tools
Coding-Dev-Tools deleted the fix/receipt-chain-diagnostics branch November 5, 2026 10:03
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