Skip to content

refactor(host-kit): accept only drive-absolute or plain UNC Windows destinations - #4747

Merged
thymikee merged 3 commits into
refactor/host-kit-destination-modulesfrom
refactor/windows-destination-allowlist
Nov 19, 2026
Merged

thymikee merged 3 commits into
refactor/host-kit-destination-modulesfrom
refactor/windows-destination-allowlist

Conversation

@thymikee

@thymikee thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Stacked on #4745. One positive rule replaces the Windows deny-list (\\?\, \\.\, root-relative \x, GLOBALROOT, IPC shares) in both the volume check and scriptEntryName: a rooted path must be drive-absolute (X:\…) or plain UNC (\\server\share\…) outside the pipe, IPC$ and mailslot shares. Everything else is refused up front with windows_path_form and the existing hint. Reserved device names, forbidden characters, the stream : rule and NAME_MAX are unchanged. 6 files, including the ADR 0016 sentence.

Changes:

  • IPC shares were already refused end to end. They now report windows_path_form instead of unnamed_entry (code stays INVALID_ARGS).
  • At the unit level only, scriptEntryName now refuses \\?\C:\dir\journey.ad and \\?\UNC\server\share\journey.ad (two table rows flip), plus \journey.ad and \\server\share.\journey.ad. Both routes already refused all four up front.
  • New refusal rows: \journey.ad, /journey.ad, and \\server\pipe\recorder at all three publication boundaries.

entry-name.ts: 175 → 169 lines (27 removed, 21 added). A single-caller helper folds into scriptEntryName so the eager-closure statement count stays flat.

Validation

At 388380b10a:

  • Name table: every other row keeps its result.
  • Old vs new rules over 4,564,560 generated Windows spellings: nothing newly accepted; end-to-end results identical.
  • eager-closure-budgets.test.ts: pass, no budget change (fixed after an earlier head failed it).
  • Unit suites: host-kit, remote, daemon (4549 tests). Typecheck and lint pass. fallow audit passed on the first head. CI validates the head.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.41 MB 6.41 MB -115 B
Package (unpacked) 6.41 MB 6.41 MB -115 B
Package (download) 1.95 MB 1.95 MB -60 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 25.3 ms 19.2 ms -6.2 ms
CLI --help 56.4 ms 44.1 ms -12.3 ms

@apex-sentinel-staging

This comment has been minimized.

thymikee and others added 3 commits November 19, 2026 14:34
…estinations

The Windows destination rules had grown into a deny-list of special forms:
extended-length and device-namespace prefixes, root-relative paths,
GLOBALROOT, and the pipe, IPC$ and mailslot shares. Replace it with one
positive rule shared by the up-front volume check and scriptEntryName: a
rooted Windows path is accepted only when it is drive-absolute (X:\...) or
a plain UNC path (\\server\share\...) whose share is not pipe, IPC$ or
mailslot. Every other rooted form is refused up front with
windows_path_form.

Reserved device names, forbidden characters, the stream colon rule and
NAME_MAX stay as they were.

The pipe, IPC$ and mailslot shares were already refused end to end; they
now report windows_path_form instead of unnamed_entry. Two table rows that
only the bare name rule accepted, the extended-length drive and UNC forms,
become refusals; every publication path already refused them up front.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Windows shape predicate added one top-level declaration. Fold the
single-caller name-length helper into scriptEntryName so the module carries
the same number of top-level statements as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee
thymikee force-pushed the refactor/windows-destination-allowlist branch from cd81a66 to 388380b Compare November 19, 2026 13:36
@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 388380b

Since the review of fce691d: 0 new · 0 still open · 0 no longer raised

No open findings.

Reviewed with this repository's own Sentinel configuration (83328f1d8aac).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready at 388380b. CI is green: all 14 checks pass. No conflicts. Merge the stacked base #4745 first.

Not blocking, and you can take or leave both:

Behavior was checked through path.win32 and a mocked process.platform, as the repository's tests do. A differential over about 30 path atoms, up to 5 deep, supports the claim that no new spelling is accepted. No real Win32 open of each accepted UNC spelling was run, so whether each one reaches a file rather than a pipe is unconfirmed.

An independent second pass compared 156,282 Windows path spellings at the base and this head and found no newly accepted spelling. It points to the same trailing-dot share test gap noted above.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee added this pull request to stack #4749 November 19, 2026 13:55
@thymikee
thymikee merged commit 7b6500c into main Nov 19, 2026
18 checks passed
@thymikee
thymikee deleted the refactor/windows-destination-allowlist branch November 19, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant