Skip to content

MigrateApprove.ts resolves feedback-memory paths through a literal, never-interpolated "${HARNESS_USER_DIR}" #1932

Description

@jbmml

Summary

LIFEOS/TOOLS/MigrateApprove.ts (~line 89), in the memory/feedback branch:

return join(HOME, ".claude", "projects", "${HARNESS_USER_DIR}", "memory");

The ${...} sits inside an ordinary double-quoted TypeScript string — it is never interpolated, so the branch resolves to a directory literally named ${HARNESS_USER_DIR}. No real slug can ever match; every path this branch produces is wrong, silently. This is a wrong-path/silent-miswrite bug rather than dead code: the branch runs and returns a path that cannot correspond to any real session directory.

Suggested fix

SessionHarvester.ts in the same directory already implements the pattern this branch meant to use: it derives the project slug with CLAUDE_DIR.replace(/[\/\.]/g, "-") and builds join(CLAUDE_DIR, "projects", CWD_SLUG). (HARNESS_USER_DIR exists nowhere as a real symbol or env var — it's only a doc-comment placeholder for that slug.) The fix is to compute the slug the same way and interpolate it, rather than embedding the literal string — likely join(HOME, ".claude", "projects", <cwd-slug>, "memory").

Note: the unguarded join(LIFEOS_DIR, target) in the same function (accepts ../absolute segments) is a potential path-traversal if proposed_target is model-influenced. That one is being routed to the maintainer through GitHub private vulnerability reporting rather than this public issue, per upstream's SECURITY.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions