Skip to content

fix(scripts): normalize Windows paths in capability boundary file checks - #14

Open
Tim0085 wants to merge 1 commit into
CodeSoul-co:devfrom
Tim0085:fix/windows-boundary-paths
Open

Tim0085 wants to merge 1 commit into
CodeSoul-co:devfrom
Tim0085:fix/windows-boundary-paths

Conversation

@Tim0085

@Tim0085 Tim0085 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Problem

auditCapabilitySource (scripts/lib/capability-boundary.ts) normalizes backslashes before checking for /capabilities/, but its two file-name checks use the raw path:

  • !file.endsWith("/fixtures.ts"): on Windows this is always true, so fixtures.ts files get the fetch( rule. examples/capabilities/tools/fixtures.ts fails it, and the all twelve capability categories compose public nodes through Runtime test fails on Windows with model/service transport belongs in a registered adapter.
  • file.endsWith("/shared.ts"): on Windows this is always false, so the "compose Graphs through Loop" rule is silently skipped for every shared.ts. The audit is weaker on Windows rather than failing.

This is one of the Windows-only failures mentioned in #10 and #12.

Change

  • Normalize the path once and use it for all three checks.
  • New test in test/capability-boundary.test.ts with Windows-style paths: shared.ts must still reject runtime.run(, and fixtures.ts may call fetch(. The path strings are literals, so the test covers this on Linux CI too.

Validation

Run with npm run check on Windows 11, Node 24.14.0, on top of dev at 9c0b7ee:

  • Typecheck and builds pass. Tests: 520 total, 514 passed, 3 skipped, 3 failed.
  • All four tests in capability-boundary.test.ts now pass on Windows. With the script change reverted, both the full audit test and the new test fail.
  • The 3 remaining failures are the other Windows-only ones (symlink EPERM ×2 and the sandbox environment-key assertion) and are unrelated to this change.

This branch has not been deployed

No deployments
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