feat(recall): add portable history recovery - #11
Conversation
3metaJun
left a comment
There was a problem hiding this comment.
Reviewed second in the #10 → #11 → #12 order. Verified locally on Windows: npm test passes with 107 passing tests and the one expected Unix-only skip.
The privacy posture is the strong part of this PR, and it is tested rather than just claimed: metadata-first discovery, workspace-scoped roots (including the Claude project slug and the pi workspace slug), metadata re-checked when the selected file is opened, the 16 MiB selected-file cap, and warnings that never embed raw record contents (asserted with doesNotMatch). The newest-first character budget returned in conversation order is documented in history-sources.md and matches the implementation, including the maxChars: 12 case that truncates a message mid-string. The symlinked-entry CLI test covering both the default and --preserve-symlinks-main resolution is a nice touch.
Non-blocking nits:
argumentsForlets value flags repeat with last-one-wins (e.g. two--limitflags). #10 introduces a shared parser that rejects duplicate options; consider unifying the behavior later.- Identical warnings can repeat when several directories fail, and Codex scans two roots — deduplicating warnings before returning would keep CLI output tidy.
- On win32 the OpenCode wrapper hardcodes
& opencodein the generated PowerShell script. Fine today since it is a standalone script by design; only worth revisiting if customopencodeshims ever need to be honored.
Merge note: this shares the conflict set with #10 (package.json test line, skills/reflect/SKILL.md, the reflect target in profiles/upstream-manifest.json). Keeping both test registrations and recomputing the reflect digest against the combined body, as described in the PR description, is the right resolution.
c867590 to
c2fbad4
Compare
[gpt-6] RESPONDING ON BEHALF OF 3metajunVerified all three review notes against the standalone helper.
After rebasing onto #10, both test registrations and both sets of |
History recovery depended on informal Harness-specific instructions and helpers that did not exist in a skills-only installation.
recallnow ships a standalone Node reader for Codex, Claude Code, OpenCode, and pi. It lists workspace-scoped metadata before reading a selected session, supports exclusions and time bounds, reconstructs Claude/pi branches, and limits output to recent conversation text. The CLI handles symlinked installation paths and closes file handles before returning, so callers can immediately move or delete a history store.OpenCode defaults to sanitized export and reports when the text is redacted. Explicit
--local-textenables private local recovery after workspace and session selection. Unsupported formats, large files, missing parents, and malformed records have documented behavior. The bundled authoring playbook now includes draft, description-review, and validation steps;automate-meandreflecthave working fallbacks when sibling skills or repository scripts are absent.Validation: eleven history tests cover all four adapters, scope/exclusion boundaries, branches, corruption, output limits, standalone installation, symlinked entry paths, side-effect-free imports, and immediate store removal. They pass on Node 18 and Node 24. Sanitized and local-text reads were also verified against a real disposable OpenCode 1.18.30 session. The combined result with #10 and #12 passed 120 tests with one expected Windows skip on Node 18, plus package and both upstream checks. Independent review found no blockers. No unrelated user conversation body was inspected.
This PR can be reviewed independently of #10. Combining them requires keeping both test registrations and recomputing the
reflecttarget digest from the combined body. Merge #12 afterward and refresh its reviewed baseline. npm publication remains deferred.Agent: GPT-6 via Codex