Skip to content

feat(recall): add portable history recovery - #11

Merged
3metaJun merged 5 commits into
mainfrom
feat/portable-history-recovery
Sep 11, 2026
Merged

3metaJun merged 5 commits into
mainfrom
feat/portable-history-recovery

Conversation

@3metaJun

@3metaJun 3metaJun commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner

History recovery depended on informal Harness-specific instructions and helpers that did not exist in a skills-only installation. recall now 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-text enables 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-me and reflect have 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 reflect target digest from the combined body. Merge #12 afterward and refresh its reviewed baseline. npm publication remains deferred.


Agent: GPT-6 via Codex

@3metaJun 3metaJun left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. argumentsFor lets value flags repeat with last-one-wins (e.g. two --limit flags). #10 introduces a shared parser that rejects duplicate options; consider unifying the behavior later.
  2. Identical warnings can repeat when several directories fail, and Codex scans two roots — deduplicating warnings before returning would keep CLI output tidy.
  3. On win32 the OpenCode wrapper hardcodes & opencode in the generated PowerShell script. Fine today since it is a standalone script by design; only worth revisiting if custom opencode shims 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.

@3metaJun
3metaJun force-pushed the feat/portable-history-recovery branch from c867590 to c2fbad4 Compare September 11, 2026 10:39
@3metaJun

Copy link
Copy Markdown
Owner Author

[gpt-6] RESPONDING ON BEHALF OF 3metajun

Verified all three review notes against the standalone helper.

  1. Single-value flags and --local-text now reject duplicates, so a second --workspace cannot silently replace the first. --exclude remains repeatable. The helper keeps its own small parser so a skills-only installation still works.
  2. Identical diagnostics are deduplicated at the output boundary, while different warnings remain visible. The regressions reproduced both issues before the fix; all 12 history tests pass on Node 18 and Node 24.
  3. No change is needed for & opencode: PowerShell already resolves the command through the inherited PATH, including a same-named shim. Adding another configuration setting would not fix a current failure.

After rebasing onto #10, both test registrations and both sets of reflect instructions are retained, and its target digest is recomputed from the combined body. The full-tree baseline will be refreshed in #12.

@3metaJun
3metaJun merged commit 75baf80 into main Sep 11, 2026
9 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