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
{{ message }}
Repository navigation
fix(work-items): preflight reports false additionalDirectories gap for tilde-form grants #1206
The work-items work/babysit permission preflight (plugins/work-items/skills/work/scripts/preflight.sh) reports a false-positive (c)additionalDirectories gap when the grant is written in tilde (~/…) form.
normalize_path folds backslashes and lower-cases/de-colons a leading Windows drive letter, but it never expands a leading ~. A permissions.additionalDirectories entry stored as ~/… is therefore compared literally against the absolute worktree root the harness derives from that same home, they never match, and the preflight emits its (c) gap ("no permissions.additionalDirectories entry covers the worktree root …") even though the directory is actually authorized.
Impact
The preflight exists to surface, once up front, the permission gaps that would otherwise appear as mid-cycle prompts. A false (c) gap on a tilde-form grant tells an operator to "fix" a grant that is already live, undermining trust in the report and potentially triggering a needless settings edit. Report-only, so it does not block runs, but the guidance is wrong.
Evidence (reported by an autonomous work-loop lane, 2026-07-23, verified live)
The grant is live: the harness expands the tilde, and workers wrote out-of-tree for an entire session with no permission prompts.
The D:/repos entry matches (drive-letter fold), but the ~/.claude-loop-worktrees entry never matches the absolute probed root because normalize_path leaves ~ unexpanded, so the preflight wrongly reports the grant missing via its (c) gap.
Lane telemetry for this observation is recorded in melodic-software/ci-workflows issue #231's wind-down comment.
Expected
A tilde-form additionalDirectories entry (~ alone or ~/…) should compare equal to the absolute worktree root beneath the user home, so a live grant is not reported as a gap.
Fix
Expand a leading ~ to the user home (HOME, then USERPROFILE, forward-slash normalized) inside normalize_path before the existing backslash/drive folding, and add a regression case (tilde entry matches an absolute child; a root outside the home still gaps; non-tilde behavior unchanged).
Activity