Repository navigation
Description
Part of #292.
Problem
exportMemories scrubs content and issue at serialization (src/portable/export.ts:174, :178) but writes scope (:173), tags (:176) and kw (:177) exactly as stored. New writes cannot carry a credential in those fields — the schema rejects control characters and the write boundary rejects credential-shaped metadata (src/tools/schema.ts:26-35, README "Credential-shaped scope, tags or issue metadata is rejected rather than silently rewritten") — but a row stored before those checks, or hand-edited into the store, exports its credential verbatim into a file meant to leave the machine. #74's criteria named only content and issue, so this is the same slice-1 pattern left half-applied, not a regression against #74.
Separately, README.md:231 still claims "memory_export writes what is already stored verbatim" — stale since slice 1 added the content/issue scrub (src/portable/export.ts:165-168). The sentence is now wrong in both directions: content/issue are scrubbed, metadata is not.
Fix direction
Apply redactSecrets to scope and to each tags/kw element in the export serialization (src/portable/export.ts:171-182), matching the slice-1 rule already stated there: "Redaction is applied to the value being serialised, never to the row." Leave repo/repoPath (derived stamps, not free prose). Update the README limits bullet so the export claim states what is actually scrubbed.
Acceptance
RED: on main 7405dc61d919e7eee7033dea6e4324eda58ee669, hand-write a store row whose scope (or a tag) contains a recognized synthetic credential pattern (per src/store/secrets.ts), run exportMemories, and the JSONL line carries the token verbatim — the test fails.
GREEN: bun run test passes; the exported scope/tags/kw values carry the redaction marker while the store file is byte-unchanged; the README limits bullet no longer claims export writes everything verbatim.
Activity
chore(release): 0.22.1 [skip ci]
abogartz-opencode-self-improvement commentedon Nov 9, 2026
🎉 This issue has been resolved in version 0.22.1 🎉
The release is available on:
Your semantic-release bot 📦🚀