Skip to content

refactor(core): redaction flag policy as its own module (#1520) - #1525

Merged
ajianaz merged 1 commit into
developfrom
refactor/redaction-flag-policy
Oct 22, 2026
Merged

ajianaz merged 1 commit into
developfrom
refactor/redaction-flag-policy

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

What

update_memory_detailed decided which redacted / redactions flags survive an edit with an inline five-arm match inside a 200-line function. That policy is now redaction_flags::resolve, a pure function (new content, caller metadata, current metadata, what was masked in, flags out), with the [REDACTED: literal as a named constant. The three flag helpers moved to the same module and are still reachable as uteke_core::privacy::{with,without,carry}_redaction_flags. Item 7 of the round-2 deepening epic (#1523).

Why

The policy table could only be tested through a store. It is now tested rule by rule without SQLite, and update_memory_detailed shrinks to validate, mask and write. No behaviour change. Refs #1520.

Testing

  • clippy -D warnings, fmt, cargo test --workspace pass; cargo run -p docgen changes nothing
  • the existing update tests in privacy_write_tests.rs and privacy_field_tests.rs pass unchanged and are the guard for equal behaviour
  • 6 new pure tests, one per rule (masked, clean content, kept marker, metadata-only, content with metadata, nothing)
  • reviewed locally with the Cora MCP agent reviewer before pushing: no blocking finding (the deterministic notes are clone hints in code that moved verbatim)

@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit b157b72 into develop Oct 22, 2026
15 checks passed
@ajianaz
ajianaz deleted the refactor/redaction-flag-policy branch October 22, 2026 00:51
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