You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
source:self-discovery — undirected maintainer review pass over the repository itself (no diff trigger).
sourceLinkOrEvidence
Concrete evidence in the current tree (main @ 587fb20):
The home-directory collapse used across every redacted display surface tests p.startsWith(home) with no path-boundary check, so a sibling directory whose name merely begins with the home string is misread as being under the home directory:
src/permission-impact.ts:248-253 — the shared redactHomePath:
Minimal reproduction: with HOME=/home/alice, the path /home/alice2/proj satisfies "/home/alice2/proj".startsWith("/home/alice"), so it renders as ~2/proj — i.e. the listing claims the session lives under the user's home when it actually lives in a sibling directory. HOME=/root + /rootfs/x → ~fs/x is the same defect.
redactHomePath is imported by 35+ modules (attention-summary, sessions-overview, evidence-archive, provider-invocation, session-inspect, session-picker, tui-shell, …), so every surface that prints a workspace/config path inherits the over-match.
problemStatement
The ~ collapse is meant to hide the current user's home prefix. Because the match is a bare startsWith(home) with no separator/end boundary, a path that is a sibling of the home directory (shares the home string as a strict prefix but is not inside it) is also collapsed, producing a misleading ~… path that misrepresents where the session/workspace/config actually lives. This affects the session list, attention summary, doctor, health inventory, session search, sandbox diagnostics, and readline store warnings — every redacted path display.
userValue
--list-sessions, --attention, --doctor, --health-inventory, --search-sessions, and the store/sandbox diagnostics show a truthful location: paths under the home collapse to ~, sibling directories are shown as the (secret-redacted) paths they really are, so a user can correctly tell which repository/workspace a session belongs to.
scope
Make redactHomePath (src/permission-impact.ts) boundary-safe: collapse only when p === home or p starts with home followed by a path separator (use the platform separator, e.g. node:pathsep).
Make the six local copies boundary-safe as well (session-summary.ts, session-search.ts, sandbox-diag.ts, health-inventory.ts, doctor.ts, readline-store-warnings.ts). Prefer routing them through the shared redactHomePath where the surrounding redactSecrets wrap allows; otherwise apply the same boundary check in place.
Add regression tests for the boundary behavior (see testPlan).
nonGoals
Not changing redactSecrets (secret-pattern redaction) or the order in which sites apply it.
Not changing the ~ display format, the set of surfaces that collapse, or any trust/workspace-identity logic (folder-trust keys are unaffected — this is display-only).
Not addressing Windows case-insensitive home matching or a HOME value with a trailing separator beyond keeping the boundary check correct for the common forms — separate, speculative concerns.
A sibling path (strict-prefix match without a following separator) is not collapsed: redactHomePath("/home/alice2/proj") with HOME=/home/alice returns /home/alice2/proj (and sites that wrap redactSecrets still secret-redact it).
A path under the home is collapsed: redactHomePath("/home/alice/proj") → ~/proj; redactHomePath("/home/alice") → ~.
All seven sites (shared helper + six local copies) are boundary-safe; no sibling over-match remains.
Inputs unaffected by the boundary (under-home, outside-home non-sibling) behave as before.
Unit tests against the exported redactHomePath in tests/unit/permission-impact.test.ts (currently zero tests reference it): sibling not collapsed, under-home collapsed, home-alone → ~, and a HOME with a trailing separator if the implementation normalizes one.
Cover at least one local copy through its exported surface (e.g. readline-store-warnings.ts's redactStorePath, which already accepts an injectable home) to prove the boundary holds there too.
Gate: npm run typecheck, npm run build, npm test.
dogfoodPlan
Post-merge, run the permission-impact unit suite plus npm run smoke, and run --list-sessions / --attention against a real store to confirm under-home workspace paths still render with ~ and no surface regresses.
riskAndSecurityNotes
Display-only; the collapse becomes strictly more conservative. A sibling path that was wrongly collapsed to a misleading ~… now renders its secret-redacted real path — this is more correct and does not leak the current user's home (the sibling is, by definition, outside it).
redactSecrets still runs wherever a site wraps it, so no secret surface is widened.
Behavior for paths genuinely under the home is unchanged (~ collapse preserved), so the privacy intent of the helper is intact.
Low risk: pure string-boundary change in display helpers; no I/O, trust, or mutation path touched.
duplicateSearchEvidence
Searched open + closed Issues and PRs for home-path / redactHomePath / tilde / sibling / boundary:
grep -rn redactHomePath tests/ returns nothing: the helper has zero test coverage; tests/unit/permission-impact.test.ts covers redactSecrets, neutralizeSpoofing, and analyzeImpact but not redactHomePath.
Conclusion: distinct, unfixed, untested boundary defect in a shared display helper plus six local copies — not a duplicate.
parentChildRelationship
Standalone leaf Issue. Independent of any parent; not part of the surrogate/truncation series or the secret-redaction line (#805).
dependencyOrder
No blocking dependencies; executable immediately (redactHomePath already exists and is exported). Single vertical slice: one boundary fix applied across the shared helper and six copies, plus focused regression tests.
sourceType
source:self-discovery— undirected maintainer review pass over the repository itself (no diff trigger).sourceLinkOrEvidence
Concrete evidence in the current tree (
main@ 587fb20):The home-directory collapse used across every redacted display surface tests
p.startsWith(home)with no path-boundary check, so a sibling directory whose name merely begins with the home string is misread as being under the home directory:src/permission-impact.ts:248-253— the sharedredactHomePath:src/session-summary.ts:482(redactPath, thenredactSecrets)src/session-search.ts:218(redactWorkspacePath, thenredactSecrets)src/sandbox-diag.ts:75(redactPath)src/health-inventory.ts:424(redactPath)src/doctor.ts:266(redactPath)src/readline-store-warnings.ts:15(redactStorePath, injectablehome)Minimal reproduction: with
HOME=/home/alice, the path/home/alice2/projsatisfies"/home/alice2/proj".startsWith("/home/alice"), so it renders as~2/proj— i.e. the listing claims the session lives under the user's home when it actually lives in a sibling directory.HOME=/root+/rootfs/x→~fs/xis the same defect.redactHomePathis imported by 35+ modules (attention-summary, sessions-overview, evidence-archive, provider-invocation, session-inspect, session-picker, tui-shell, …), so every surface that prints a workspace/config path inherits the over-match.problemStatement
The
~collapse is meant to hide the current user's home prefix. Because the match is a barestartsWith(home)with no separator/end boundary, a path that is a sibling of the home directory (shares the home string as a strict prefix but is not inside it) is also collapsed, producing a misleading~…path that misrepresents where the session/workspace/config actually lives. This affects the session list, attention summary, doctor, health inventory, session search, sandbox diagnostics, and readline store warnings — every redacted path display.userValue
--list-sessions,--attention,--doctor,--health-inventory,--search-sessions, and the store/sandbox diagnostics show a truthful location: paths under the home collapse to~, sibling directories are shown as the (secret-redacted) paths they really are, so a user can correctly tell which repository/workspace a session belongs to.scope
redactHomePath(src/permission-impact.ts) boundary-safe: collapse only whenp === homeorpstarts withhomefollowed by a path separator (use the platform separator, e.g.node:pathsep).session-summary.ts,session-search.ts,sandbox-diag.ts,health-inventory.ts,doctor.ts,readline-store-warnings.ts). Prefer routing them through the sharedredactHomePathwhere the surroundingredactSecretswrap allows; otherwise apply the same boundary check in place.nonGoals
redactSecrets(secret-pattern redaction) or the order in which sites apply it.~display format, the set of surfaces that collapse, or any trust/workspace-identity logic (folder-trust keys are unaffected — this is display-only).acceptanceCriteria
redactHomePath("/home/alice2/proj")withHOME=/home/alicereturns/home/alice2/proj(and sites that wrapredactSecretsstill secret-redact it).redactHomePath("/home/alice/proj")→~/proj;redactHomePath("/home/alice")→~.testPlan
redactHomePathintests/unit/permission-impact.test.ts(currently zero tests reference it): sibling not collapsed, under-home collapsed, home-alone →~, and aHOMEwith a trailing separator if the implementation normalizes one.readline-store-warnings.ts'sredactStorePath, which already accepts an injectablehome) to prove the boundary holds there too.npm run typecheck,npm run build,npm test.dogfoodPlan
Post-merge, run the
permission-impactunit suite plusnpm run smoke, and run--list-sessions/--attentionagainst a real store to confirm under-home workspace paths still render with~and no surface regresses.riskAndSecurityNotes
~…now renders its secret-redacted real path — this is more correct and does not leak the current user's home (the sibling is, by definition, outside it).redactSecretsstill runs wherever a site wraps it, so no secret surface is widened.~collapse preserved), so the privacy intent of the helper is intact.duplicateSearchEvidence
Searched open + closed Issues and PRs for home-path / redactHomePath / tilde / sibling / boundary:
redactHomePathmatches only TUI: present sequential Workflow runs as an execution console #262 and Trust posture: compose workspace trust, sandbox isolation, approval mode, and extension readiness into one redacted, read-only view without core changes #124, which discuss redaction generally (TUI workflow console / trust posture), not the path-boundary defect.grep -rn redactHomePath tests/returns nothing: the helper has zero test coverage;tests/unit/permission-impact.test.tscoversredactSecrets,neutralizeSpoofing, andanalyzeImpactbut notredactHomePath.Conclusion: distinct, unfixed, untested boundary defect in a shared display helper plus six local copies — not a duplicate.
parentChildRelationship
Standalone leaf Issue. Independent of any parent; not part of the surrogate/truncation series or the secret-redaction line (#805).
dependencyOrder
No blocking dependencies; executable immediately (
redactHomePathalready exists and is exported). Single vertical slice: one boundary fix applied across the shared helper and six copies, plus focused regression tests.