Skip to content

feat(domain): add operational evidence ledger#238

Merged
Neiland85 merged 1 commit into
mainfrom
feat/operational-evidence-ledger
Jun 26, 2026
Merged

feat(domain): add operational evidence ledger#238
Neiland85 merged 1 commit into
mainfrom
feat/operational-evidence-ledger

Conversation

@Neiland85

Copy link
Copy Markdown
Owner

Adds a domain-level operational evidence ledger for reconstructable event chains.

This introduces canonical operational evidence events, sensitive metadata redaction, deterministic payload hashes, event hashes, previousHash linking and chain verification.

The implementation is storage-agnostic and does not introduce a database migration. It prepares the codebase for later evidence bundle export, intake/consent/decision reconstruction and higher-assurance legal or expert review workflows.

Copilot AI review requested due to automatic review settings June 26, 2026 12:36
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
claritystructures-webapp Ready Ready Preview, Comment Jun 26, 2026 12:36pm

Request Review

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

Copilot AI 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.

Pull request overview

Adds a domain-layer “operational evidence ledger” to produce deterministic, reconstructable event hash chains (with metadata redaction) to support later reconstruction/audit workflows.

Changes:

  • Introduces operational-evidence-ledger domain module for canonical payload building, deterministic hashing, chain linking, and verification.
  • Adds Vitest coverage for determinism, linking, redaction, and broken-chain detection.
  • Documents the ledger and links it from the repository README.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Adds a new “Operational evidence ledger” capability section and points to the new doc.
docs/operational-evidence-ledger.md Documents purpose, scope, event types, hash model, and privacy posture.
packages/domain/src/operational-evidence-ledger.ts Implements payload redaction/canonicalization, event hashing, chain building, and chain verification.
packages/domain/src/index.ts Re-exports ledger APIs/types from the domain package entrypoint.
packages/domain/src/tests/operational-evidence-ledger.test.ts Adds unit tests for determinism, redaction, and verification behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +236 to +245
return inputs.map((input) => {
const event = buildOperationalEvidenceEvent({
...input,
previousHash: input.previousHash ?? previousHash,
});

previousHash = event.hash;

return event;
});
Comment on lines +94 to +98
function isSensitiveMetadataKey(key: string): boolean {
const normalized = key.toLowerCase();

return SENSITIVE_METADATA_KEY_PARTS.some((part) => normalized.includes(part));
}
Comment on lines +222 to +228
return {
...payload,
eventId: `oev_${hash.slice(0, 32)}`,
payloadHash,
previousHash,
hash,
};
@Neiland85 Neiland85 merged commit 45d5e86 into main Jun 26, 2026
9 checks passed
@Neiland85 Neiland85 deleted the feat/operational-evidence-ledger branch June 26, 2026 13:08
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