Skip to content

Enforce canonical removal, prepared source replay and row-class masks - #408

Merged
debuggingfuture merged 1 commit into
mainfrom
oct8/write-time-redaction
Oct 8, 2026
Merged

debuggingfuture merged 1 commit into
mainfrom
oct8/write-time-redaction

Conversation

@debuggingfuture

@debuggingfuture debuggingfuture commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What this changes

Declared removal rules erase selected text before direct or staged writes reach storage. Pattern removal rewrites leftmost-first spans, so no byte of a greedy match remains beside its substitute; forward matching over one value draws on a budget of 16 times its byte length, and a value past it refuses its write (authority.redact.match-work). Unicode word boundaries refuse at declaration.

Protected source runs record the rewritten batch, then resume without fetching that batch again or applying its shape, normalization or HMAC twice. Row-selected masks let one column drop prompts, hash completions and strictly drop unknown classes within the same admitted read.

Canonical manifests supply writer authority even when callers omit rules. Compatible static and producer declarations contribute ordered rules; conflicting types/classes/policies, duplicate or excessive rules and indexes over removed columns refuse. Parent and child identities derive from rewritten values. Explicit source-plan rules match complete canonical authority.

Protected recording binds plan, shape, declarations, normalization and pepper identities before execution. Protected monotonic clocks require complete typed shape lineage; protected relational clocks refuse without complete descendant lineage. Protected job body effects remain refused until typed effect-result recording exists.

Windows command containment (#298) and the test-first package rule (main's per-package stage) are outside this change.

Clauses

authority.redact, authority.mask and run.journal define canonical rewrite, recording/replay and selector boundaries. authority.redact.in-value and authority.redact.match-work pin to contextful_core::redaction tests. Addresses #98; full acceptance and protected body-effect recording remain open.

Validation

  • contextful-spec lint: 0 violations after state and extract.
  • cargo test -p contextful-core -p contextful-context -p contextful-policy -p contextful-engine: integration suites of 485, 353, 169 and 123 tests pass, 0 failed.
  • cargo test -p contextful-cli: 356 + 5 passed, 0 failed.
  • cargo test -p contextful-acceptance --test integration m05: 4 passed.
  • contextful-ci gate --stage test-first --base origin/main: passed in 358.4 s; red against the base in cli, context, core, engine and policy.

Boundary questions

  • Does the engine already do this? Yes: engine owners, replay and type admission remain canonical; writer adapters share masks and pepper policy.
  • Does a surface re-implement a registered policy? No.
  • Does a second state model mirror one the engine owns? No.
  • If the engine changed tomorrow, would this surface silently disagree? No: source recording uses the engine's owner and journal boundaries.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://oct8-write-time-redaction.spec.contextful.work (commit 1f8e44f)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://c95815bc.spec.contextful.work 1f8e44f 2026-10-08T19:01:26.016Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://6a227658.spec.contextful.work ebf3a0a 2026-10-08T18:54:28.917Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ee2b0171.spec.contextful.work ea2b42d 2026-10-08T01:50:59.528Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://00208c19.spec.contextful.work fbc5bf5 2026-10-07T23:45:16.471Z Visit the dashboard ↗

@debuggingfuture debuggingfuture changed the title Enforce write-time removal and row-class masks Enforce canonical removal, prepared source replay and row-class masks Oct 8, 2026
@debuggingfuture
debuggingfuture force-pushed the surface/console-combined-389 branch from 6d8a772 to dcc7979 Compare October 8, 2026 18:39
@debuggingfuture
debuggingfuture force-pushed the oct8/write-time-redaction branch from ea2b42d to ebf3a0a Compare October 8, 2026 18:53
@debuggingfuture
debuggingfuture changed the base branch from surface/console-combined-389 to main October 8, 2026 18:53
@debuggingfuture
debuggingfuture marked this pull request as ready for review October 8, 2026 18:53
Declared removal rules rewrite leftmost-first spans under a matching work
bound before direct or staged writes reach storage. Protected source runs
record the rewritten batch and replay it without refetching. Row-selected
masks drop unknown classes strictly.

Addresses #98.
@debuggingfuture
debuggingfuture force-pushed the oct8/write-time-redaction branch from ebf3a0a to 1f8e44f Compare October 8, 2026 19:00
@debuggingfuture
debuggingfuture merged commit 1f2ee40 into main Oct 8, 2026
3 of 4 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