Skip to content

Add evidence spine phase one#31

Merged
TerminallyLazy merged 24 commits into
mainfrom
codex/evidence-spine-roadmap-design
Jul 9, 2026
Merged

Add evidence spine phase one#31
TerminallyLazy merged 24 commits into
mainfrom
codex/evidence-spine-roadmap-design

Conversation

@TerminallyLazy

@TerminallyLazy TerminallyLazy commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a typed Evidence Spine reader for local certification evidence
  • write target/tree-ring-certification/evidence-index.json beside existing metrics.json and summary.md
  • add TUI /evidence and /proof browsing plus confirmation-gated /evidence refresh
  • render certification evidence, install size, recall speeds, and missing Phase 1 categories in the TUI
  • document the Phase 1 evidence-spine status

Stack note

This PR targets main as requested and is currently stacked on top of #30 (codex/shared-action-foundation). Once #30 merges, this PR should show only the evidence-spine commits.

Verification

  • cargo fmt --check
  • cargo test --locked
  • cargo clippy --locked --all-targets
  • git diff --check
  • sh scripts/certify-tree-ring.sh
  • inspected target/tree-ring-certification/evidence-index.json

Certification snapshot

  • release binary: 6,217,872 bytes
  • project install: 6144 KB
  • global install: 6100 KB
  • CLI import: 10,000 memories in 5s (2000/s)
  • 10k recall: avg 3.731 ms, max 6.756 ms
  • 30k recall: avg 8.220 ms, max 14.685 ms
  • evidence index: overall_status: pass, path: metrics.json, summary_path: summary.md, missing: [harness, recall_quality]

Summary by CodeRabbit

  • New Features

    • Added a new /evidence view in the TUI for browsing certification status and details.
    • Added smoother command handling for remember, recall, export, import, audit, sync, and maintenance flows.
    • Export and import now support cleaner JSON/JSONL output options.
  • Bug Fixes

    • Improved dry-run behavior so preview actions no longer create or modify storage.
    • Added better handling when audit or evidence data is missing, returning a clear empty-state result.
  • Chores

    • Refreshed certification output to include a machine-readable evidence index.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements Phase 1 of the Tree Ring Evidence Spine and establishes a shared action foundation to unify CLI and TUI durable operations. It introduces a file-backed evidence reader and index (evidence-index.json), integrates an /evidence browser mode into the TUI, and refactors the SQLite storage layer to split private internals into dedicated modules (schema, write, search, lifecycle) behind the public SQLiteMemoryStore facade. Additionally, the CLI commands have been refactored to delegate execution to these shared actions, ensuring behavior-stable execution across interfaces. As there are no review comments provided, we have no feedback on the reviewer's comments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Caution

Review failed

An error occurred during the review process. Please try again later.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/evidence-spine-roadmap-design

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.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c6726429-f852-4735-b08e-b486fdce9a03

📥 Commits

Reviewing files that changed from the base of the PR and between 7d00800 and a753258.

📒 Files selected for processing (28)
  • .gitignore
  • crates/tree-ring-memory-cli/src/actions/adapters.rs
  • crates/tree-ring-memory-cli/src/actions/audit.rs
  • crates/tree-ring-memory-cli/src/actions/export_import.rs
  • crates/tree-ring-memory-cli/src/actions/integrations.rs
  • crates/tree-ring-memory-cli/src/actions/lifecycle.rs
  • crates/tree-ring-memory-cli/src/actions/mod.rs
  • crates/tree-ring-memory-cli/src/actions/recall.rs
  • crates/tree-ring-memory-cli/src/actions/remember.rs
  • crates/tree-ring-memory-cli/src/commands/mod.rs
  • crates/tree-ring-memory-cli/src/commands/scriptable.rs
  • crates/tree-ring-memory-cli/src/evidence.rs
  • crates/tree-ring-memory-cli/src/main.rs
  • crates/tree-ring-memory-cli/src/tui/actions.rs
  • crates/tree-ring-memory-cli/src/tui/app.rs
  • crates/tree-ring-memory-cli/src/tui/input.rs
  • crates/tree-ring-memory-cli/src/tui/render.rs
  • crates/tree-ring-memory-sqlite/src/lib.rs
  • crates/tree-ring-memory-sqlite/src/lifecycle.rs
  • crates/tree-ring-memory-sqlite/src/schema.rs
  • crates/tree-ring-memory-sqlite/src/search.rs
  • crates/tree-ring-memory-sqlite/src/write.rs
  • docs/architecture/rust-core-status.md
  • docs/superpowers/plans/2026-07-09-tree-ring-evidence-spine-phase-1-implementation-plan.md
  • docs/superpowers/plans/2026-07-09-tree-ring-shared-action-foundation-implementation-plan.md
  • docs/superpowers/specs/2026-07-09-tree-ring-evidence-spine-roadmap-design.md
  • docs/superpowers/specs/2026-07-09-tree-ring-shared-action-foundation-design.md
  • scripts/certify-tree-ring.sh

📝 Walkthrough

Walkthrough

Introduces a shared actions layer in tree-ring-memory-cli (remember, recall, export/import, audit, lifecycle, adapters, integrations) consumed by both CLI and TUI, adds commands::scriptable printers, splits tree-ring-memory-sqlite internals into schema/write/search/lifecycle submodules, and adds an evidence spine with evidence.rs, a TUI /evidence mode, and certification script updates writing evidence-index.json.

Changes

Shared action layer, SQLite internal split, and CLI/TUI wiring

Layer / File(s) Summary
Actions module scaffolding
crates/tree-ring-memory-cli/src/actions/mod.rs, .../commands/mod.rs, .gitignore
Declares the actions module tree with ActionResult<T> alias and exposes a new commands submodule.
Remember action
.../actions/remember.rs
Adds RememberRequest/RememberReport and remember() performing sensitivity detection, validation, and persistence.
Recall action
.../actions/recall.rs
Adds RecallRequest/RecallReport and recall() delegating to MemoryRetriever.
Export/import action
.../actions/export_import.rs
Adds export/import request/report types, export_jsonl, import_jsonl (with dry-run), and import_json_payload.
Audit action
.../actions/audit.rs
Adds AuditActionRequest/Report and audit_store() with missing-DB fallback.
Integrations scan action
.../actions/integrations.rs
Adds IntegrationScanRequest/Report and scan().
Lifecycle action
.../actions/lifecycle.rs
Adds consolidate/maintain request types and consolidate, consolidate_dry_run_from_path, maintain supporting store-less dry runs.
DOX/Revolve sync adapters
.../actions/adapters.rs
Adds sync_dox/sync_revolve with dry-run support and store-write gating.
Scriptable CLI printers
.../commands/scriptable.rs
Adds print_recall_report, print_export_report, print_import_report for JSON/text output.
main.rs rewired
.../src/main.rs
Rewires CLI command handlers (integrations, import, maintain, sync, remember, recall, export/import, consolidate) to use the new actions and printers; updates tests.
SQLite internal module split
crates/tree-ring-memory-sqlite/src/lib.rs, .../schema.rs, .../write.rs, .../search.rs, .../lifecycle.rs
Extracts connection setup, write transactions, search row-mapping, and lifecycle helpers into private submodules; removes obsolete local helpers; adds facade test.
TUI shared-action wiring
crates/tree-ring-memory-cli/src/tui/app.rs
Updates remember/export/integrations flows in the TUI to call the shared actions instead of inline logic; adds tests.

Estimated code review effort: 4 (Complex) | ~75 minutes

Evidence spine and TUI /evidence mode

Layer / File(s) Summary
Evidence snapshot model and loader
crates/tree-ring-memory-cli/src/evidence.rs
Adds EvidenceStatus, EvidenceIndex, CertificationEvidence, EvidenceSnapshot, and load_snapshot() with index/metrics fallback logic and tests.
Certification script evidence index
scripts/certify-tree-ring.sh
Writes evidence-index.json alongside metrics.json/summary.md and prints its path.
/evidence slash command and pending refresh
crates/tree-ring-memory-cli/src/tui/input.rs, .../tui/actions.rs
Adds SlashCommand::Evidence, /evidence help text, ActionKind::RefreshCertification, and PendingAction::refresh_certification.
Evidence app mode wiring
crates/tree-ring-memory-cli/src/tui/app.rs
Adds AppMode::Evidence, evidence_snapshot field, and slash-command handling for evidence view/refresh.
Evidence list/detail rendering
crates/tree-ring-memory-cli/src/tui/render.rs
Adds render_evidence_list/render_evidence_detail, header labeling, and routing in results/detail panes; adds tests.
Architecture status and design/plan docs
docs/architecture/rust-core-status.md, docs/superpowers/plans/*, docs/superpowers/specs/*
Updates status doc with shared-action and evidence bullets and refreshed certification metrics; adds implementation-plan and design-spec documents.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TUI as tui::app
  participant Render as tui::render
  participant Evidence as evidence.rs
  participant Cert as certify-tree-ring.sh

  User->>TUI: "/evidence refresh"
  TUI->>TUI: schedule PendingAction::refresh_certification(command)
  User->>TUI: confirm pending action
  TUI->>TUI: set status "run externally: sh scripts/certify-tree-ring.sh"
  Note over Cert: user runs script externally
  Cert->>Cert: write evidence-index.json
  User->>TUI: "/evidence"
  TUI->>Evidence: load_snapshot(certification_dir)
  Evidence-->>TUI: EvidenceSnapshot
  TUI->>Render: render_evidence_list/detail(evidence_snapshot)
  Render-->>User: certification status and metrics
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/evidence-spine-roadmap-design

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.

@TerminallyLazy TerminallyLazy merged commit 788ebcc into main Jul 9, 2026
2 checks passed
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