Skip to content

Plan: Local safety defaults for redaction and purge (1.1.2) - #10

Draft
lodyai[bot] wants to merge 3 commits into
mainfrom
1-1-2-local-safety-defaults-for-redaction-and-purge
Draft

Plan: Local safety defaults for redaction and purge (1.1.2)#10
lodyai[bot] wants to merge 3 commits into
mainfrom
1-1-2-local-safety-defaults-for-redaction-and-purge

Conversation

@lodyai

@lodyai lodyai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the pre-implementation ExecPlan for roadmap item 1.1.2 at
    docs/execplans/1-1-2-local-safety-defaults-for-redaction-and-purge.md.
    The plan settles Memoryd's local safety defaults for workspace identity,
    redaction, and purge before any provider adapter, evidence inbox, or recall
    use case is implemented.
  • The plan is documentation-only and pre-approval. No Rust code or
    configuration changes ship in this branch; the ADRs, source-document
    alignment, and roadmap completion happen in later commits once the plan is
    approved.
  • A Logisphere community-of-experts design review was run against the draft;
    its eight must-fix concerns plus unresolved-risk signposts and improvements
    were applied, and the rationale is captured in the plan's Decision Log.

Decision split (review direction)

On review, the 1.1.2 decision is split into two ADRs, both written in the
same milestone
, so the difference in confidence is legible:

  • ADR 014 (Accepted): workspace identity and purge. Settled now because
    these gate workspace derivation (roadmap 2.2.4) and purge (roadmap 5.3.1)
    without depending on real transcript content.
  • ADR 015 (Proposed): redaction defaults. The first-release detector
    classes, entropy thresholds, deny-pattern syntax, and raw-text mode are
    captured in full now but marked Proposed, to be ratified or revised
    against real Codex/Claude transcripts in roadmap task 2.2.3.

The relevant roadmap tasks (2.2.3, 2.2.4, 5.3.1) are signposted with the
decisions they inherit.

Highlights

  • Workspace identity (ADR 014) uses BLAKE3 derive_key with context
    "memoryd v1 workspace-id". The full 32-byte output is the storage
    identifier; the first 12 hex chars are presentational only. Git origin
    normalization includes a documented case-insensitive host list; non-Git
    workspaces hash a canonical configured root-path tuple; collision detection
    runs at workspace registration.
  • Redaction (ADR 015, proposed) records the first-release detector
    classes, truffleHog-derived starting entropy thresholds (b64 ≥ 4.5,
    hex ≥ 3.0, length ≥ 20), globset deny patterns, a none | redacted
    store_raw_text enum, and redact_before_* flags that stay non-disablable
    in every tenant mode (with an explicit unsafe_disable_redaction escape
    hatch).
  • Purge (ADR 014) uses a small per-invocation randomised challenge against
    the resolved scope as the primary confirmation, defeating clipboard-paste
    mistakes. MCP and internal RPC surfaces refuse PurgeTenant; tenant-wide
    purge is operator-CLI-only behind --force-tenant-scope. Pre-purge backup
    steps (SQLite VACUUM INTO, PostgreSQL pg_dump, per-collection Qdrant
    snapshots) must complete with audited (collection, snapshot_id) pairs
    before any tenant-owned row is touched; partial failure aborts the purge.

Test plan

  • make markdownlint
  • make nixie
  • make check-fmt
  • make typecheck
  • make lint
  • make test
  • User approves the pre-implementation plan before any milestone is executed.

References

  • ExecPlan: `docs/execplans/1-1-2-local-safety-defaults-for-redaction-and-purge.md`
  • Roadmap item 1.1.2: `docs/roadmap.md`
  • Constraining prior ADRs: ADR 005 (hexagonal), ADR 006 (tenant + workspace
    identity), ADR 008 (source health), ADR 013 (evidence store + manual backup
    policy).
  • Lody session: https://lody.ai/leynos/sessions/8abb69b0-4997-49e2-b11a-8a48021b63a2

Add the pre-implementation ExecPlan for roadmap item 1.1.2 that will
ratify ADR 014, covering local safety defaults for workspace identity
(normalized Git origins, BLAKE3-derived storage identifiers with a
12-hex presentational short form, non-Git canonical-path hashing,
registration-time collision diagnostics), redaction (first-release
detector classes, truffleHog-derived starting entropy thresholds,
`globset` deny patterns, the two-value `store_raw_text` enum), and
purge (typed-scope confirmation with a randomised challenge plus an
irreversibility flag, MCP/RPC refusal of tenant-wide purge, and
binding pre-purge SQLite/PostgreSQL/Qdrant backup completion).

The plan is documentation-only and pre-approval. It records the
Logisphere design review's eight must-fix concerns and six nice-to-have
refinements that have already been applied to the draft, and signposts
the documentation gates, hexagonal boundaries, and prior art the
implementer must honour.
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c3833ede-7cd6-4001-9ef0-48dc4c6e9f0e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1-1-2-local-safety-defaults-for-redaction-and-purge

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a comprehensive pre-implementation ExecPlan document that formalises how ADR 014 will define workspace identity, redaction defaults, and purge behaviour, including architecture targets, constraints, validation, and implementation milestones, without making any Rust or configuration changes.

File-Level Changes

Change Details Files
Introduce an ExecPlan that specifies future workspace identity semantics and hashing strategy.
  • Defines normalized Git-origin URL rules, including handling of git+ schemes, scp-like syntax, case-insensitive host list, and .git/trailing-slash stripping.
  • Establishes BLAKE3 derive_key with context "memoryd v1 workspace-id" as the workspace ID hash, using full 32-byte output for storage and 12-hex-character truncation for presentational IDs.
  • Specifies canonical identity tuples for Git and non-Git workspaces, how profile names compose, operator override semantics, and registration-time collision detection with auditable diagnostics.
docs/execplans/1-1-2-local-safety-defaults-for-redaction-and-purge.md
Define redaction policy defaults and configuration contracts for the first release.
  • Locks in the first-release detector classes (API keys, tokens, JWTs, private keys, .env content, passwords, cookies, cloud credentials, DB URLs, high-entropy blobs).
  • Sets truffleHog-derived entropy thresholds (base64 ≥ 4.5, hex ≥ 3.0, length ≥ 20) as starting defaults and describes that the concrete engine is an adapter concern.
  • Specifies per-workspace globset-based deny patterns, enumerates store_raw_text as exactly none
redacted for v1 with redacted as default, and requires redact_before_store and redact_before_embedding to be always-on except via an explicit unsafe_disable_redaction escape hatch.
Define purge behaviour, confirmation UX, and pre-purge backup expectations.
  • Separates purge surfaces so MCP/internal RPC only support workspace-level purge while tenant-wide purge is CLI-only with additional gating.
  • Requires typed scope confirmation strings plus a randomised challenge and an --i-understand-this-is-irreversible flag (and --force-tenant-scope for tenant purge) to mitigate fat-finger and clipboard-paste failures.
  • Mandates completion or explicit skipping of pre-purge backups (SQLite VACUUM INTO, PostgreSQL pg_dump, per-collection Qdrant snapshots) with audited (collection, snapshot_id) pairs, aborting on partial snapshot failure, and records detailed audit-log content including hashed confirmation strings.
docs/execplans/1-1-2-local-safety-defaults-for-redaction-and-purge.md
Lay out the process, milestones, and validation strategy for turning the plan into ADR 014 and aligned docs.
  • Specifies three milestones: write ADR 014, update all dependent docs (design, ToR, RFC 0001, contents, developers guide, roadmap), then mark roadmap item 1.1.2 done.
  • Defines constraints, tolerances, risks, and idempotence rules, including when to stop for scope creep, architecture coupling, or repeated gate failures.
  • Details required gate runs (check-fmt, typecheck, lint, test, markdownlint, nixie) and future test matrix expectations (unit, BDD, snapshot, property, and end-to-end tests) for the eventual implementation slices.
docs/execplans/1-1-2-local-safety-defaults-for-redaction-and-purge.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

leynos added 2 commits June 14, 2026 06:48
Split the 1.1.2 decision into two ADRs, both written in milestone 1:
ADR 014 (workspace identity and purge, Accepted) and ADR 015 (redaction
defaults, Proposed), with ADR 015 explicitly revisited and ratified in
roadmap task 2.2.3 so the redaction detector list and entropy thresholds
are confirmed against real transcripts. Make a small randomised challenge
the primary purge confirmation. Commit to one short users-guide
subsection. Signpost the inherited open questions in roadmap tasks 2.2.3,
2.2.4, and 5.3.1.

Update the Decision Log, Progress, milestones, tolerances, risks, and
interface sections to match, and accept the review's unresolved-risk
signposts and improvements.
Add `.claude/` to `.gitignore` so transient agent state such as
`scheduled_tasks.lock` (which carries a session ID and PID) is never
committed to the repository.
@leynos leynos changed the title Draft safety-defaults ExecPlan (1.1.2) Plan: Local safety defaults for redaction and purge (1.1.2) Jun 15, 2026
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