[GH-ISSUE #51] Add validated evidence bundle import and export tools #37

Closed
opened 2026-10-15 18:20:19 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @morluto on GitHub (Jul 12, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/51

Problem

Evidence cannot survive a process boundary or be independently verified and reused.

Outcome

Add export_evidence_bundle and import_evidence_bundle with identical CLI/MCP semantics.

Public contract

  • Export writes or returns a schema-versioned deterministic bundle containing manifests and Evidence v2 records.
  • Import accepts a local JSON path, parses unknown input strictly, recomputes every evidence ID, and merges non-conflicting records into the session ledger.
  • Path inputs are canonicalized; output overwrite requires explicit opt-in.
  • Imported content is data only and is never executed.

Safety

Bound file size, record count, string lengths, and nesting depth. Reject path traversal, symlink escape from an explicitly selected output root, malformed IDs, unsupported versions, and conflicting duplicate IDs. Never serialize arbitrary environments or secret values.

Acceptance criteria

  • Export/import round trips byte-stably.
  • Tampering with any semantic evidence field is rejected.
  • Identical duplicates deduplicate; conflicting duplicates fail atomically.
  • Partial import never mutates the ledger.
  • Tool annotations declare filesystem reads/writes accurately.
  • Package verification exercises both surfaces.

Dependencies

Parent: #48. Requires Evidence v2 and the session ledger.

Non-goals

Remote URLs, databases, signing infrastructure, or automatic upload.

Originally created by @morluto on GitHub (Jul 12, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/51 ## Problem Evidence cannot survive a process boundary or be independently verified and reused. ## Outcome Add `export_evidence_bundle` and `import_evidence_bundle` with identical CLI/MCP semantics. ## Public contract - Export writes or returns a schema-versioned deterministic bundle containing manifests and Evidence v2 records. - Import accepts a local JSON path, parses unknown input strictly, recomputes every evidence ID, and merges non-conflicting records into the session ledger. - Path inputs are canonicalized; output overwrite requires explicit opt-in. - Imported content is data only and is never executed. ## Safety Bound file size, record count, string lengths, and nesting depth. Reject path traversal, symlink escape from an explicitly selected output root, malformed IDs, unsupported versions, and conflicting duplicate IDs. Never serialize arbitrary environments or secret values. ## Acceptance criteria - Export/import round trips byte-stably. - Tampering with any semantic evidence field is rejected. - Identical duplicates deduplicate; conflicting duplicates fail atomically. - Partial import never mutates the ledger. - Tool annotations declare filesystem reads/writes accurately. - Package verification exercises both surfaces. ## Dependencies Parent: #48. Requires Evidence v2 and the session ledger. ## Non-goals Remote URLs, databases, signing infrastructure, or automatic upload.
Author
Owner

@morluto commented on GitHub (Jul 17, 2026):

Implemented on main. export_evidence_bundle and import_evidence_bundle are canonical session tools with CLI/MCP wiring, strict Evidence v2 parsing, deterministic serialization, canonical authorized file handling, overwrite policy, atomic merge/conflict behavior, and declared tool effects. Session, artifact MCP, contract snapshot, bundle, and package verification cover the public surfaces.

<!-- gh-comment-id:5001469103 --> @morluto commented on GitHub (Jul 17, 2026): Implemented on main. `export_evidence_bundle` and `import_evidence_bundle` are canonical session tools with CLI/MCP wiring, strict Evidence v2 parsing, deterministic serialization, canonical authorized file handling, overwrite policy, atomic merge/conflict behavior, and declared tool effects. Session, artifact MCP, contract snapshot, bundle, and package verification cover the public surfaces.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#37
No description provided.