Skip to content

Redact home directories and secrets from discovery output; close Phase 2 - #13

Merged
andrecoliveira merged 3 commits into
mainfrom
feat/export-redaction
Nov 16, 2026
Merged

andrecoliveira merged 3 commits into
mainfrom
feat/export-redaction

Conversation

@andrecoliveira

Copy link
Copy Markdown
Owner

Summary

  • Manifest package and dependency names are untrusted. The CLI inventory removes known secret shapes (whole tokens) and home directories (the running user's real home plus the generic /Users/<name> and X:\Users\<name> shapes), repeating until stable.
  • The archwise.graph validator gains home-path for generic home shapes in labels. Route labels such as /home/feed and GET /users/:id stay valid. The graph-contracts spec records the amendment.
  • --json no longer prints the absolute workspace root. Its output now comes from an explicit allowlist of fields.
  • Docs: a security section on redaction, a store-failure section in the user guide, and Phase 2 marked complete in the roadmap with exit-gate evidence. Phase 2 work packages without a caller move to Phases 3, 5 and 9.

Review

A fresh independent review found two Important issues, both fixed with failing tests first:

  • Redaction could reassemble [redacted]/Users/x.
  • Route-like labels were rejected.

The fix pass also covers partial secret redaction, which left a private-key body and a JWT signature in the output.

Deferred minors, recorded here:

  • Directory names shaped like secrets are not redacted. The validator rejects such a revision, so sessions are not saved for that run. This is documented.
  • WSL, UNC and Solaris home forms are matched only through the real home directory.
  • Two distinct names that redact to the same text can produce a false ambiguity diagnostic.
  • When the scanned root is the home directory itself, the repository label is the username.

Test plan

  • pnpm check: 400 Vitest tests and 18 integration tests pass.
  • Built CLI: --json and --graph print neither the root, the real home directory nor a secret.
  • The reviewer's reassembly input AKIA…/Users/alex/app gives [redacted]~/app.
  • CI matrix (Linux, macOS, Windows × Node 24 and 26), CodeQL, browser smoke.

🤖 Generated with Claude Code

andrecoliveira and others added 2 commits November 16, 2026 10:06
Manifest package and dependency names are untrusted text. The inventory
now replaces home-directory prefixes with `~` and known secret shapes
with `[redacted]` before they reach the graph, store, API or CLI output.
The archwise.graph validator rejects labels that still contain a home
directory (`home-path`), and `--json` no longer prints the absolute
workspace root.

Closes Phase 2: the roadmap records the exit-gate evidence, and the user
guide gains a store-failure section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: André Oliveira <coliveira.andre@gmail.com>
Review findings on the redaction change:
- Secrets are removed before home paths and redaction repeats until
  stable, so `[redacted]/Users/x` can no longer appear.
- Secret redaction removes the whole token: a private-key block through
  its end marker and a JWT including its signature.
- Generic detection is limited to `/Users/<name>` (case-sensitive) and
  `X:\Users\<name>`, so route labels such as `GET /users/:id` and
  `/home/feed` stay valid. The CLI passes the running user's real home
  directory for exact redaction instead.

The graph-contracts spec records the `home-path` amendment, and the
security docs state what is and is not redacted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: André Oliveira <coliveira.andre@gmail.com>
Comment thread packages/domain/src/primitives.ts Fixed
CodeQL js/polynomial-redos flagged the anchored trailing-separator regex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: André Oliveira <coliveira.andre@gmail.com>
@andrecoliveira
andrecoliveira merged commit dbcc5a0 into main Nov 16, 2026
12 checks passed
@andrecoliveira
andrecoliveira deleted the feat/export-redaction branch November 16, 2026 13:17
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