Дмитрий
d75c8922aa
fix(router-gate-v4): Stream H Task 9 — cosmetic path-format fixes (Cygwin /c/ prefix + PowerShell $env:VAR expansion)
...
Closes Stream H Task 9 (H3). Two cosmetic fixes in tools/path-normalization.mjs
for gate error messages observed during Smoke 5 Real Fix Re-test 2026-05-30
(steps 4 and 5). Both purely affect human-readable display in block messages
— security behaviour is unchanged (path-deny still fires correctly in all
the original test scenarios).
1. Cygwin/git-bash `/c/Users/...` prefix collapsed before path.resolve.
On win32, path.resolve('/c/Users/x') treats `/c/...` as drive-relative
and prepends cwd's drive letter, producing display paths like
`c:/c/users/...` (doubled drive). The fix inserts a single-letter-drive
normalization step BEFORE resolve when the input looks Cygwin-style.
Guarded by `homedir matches ^[a-zA-Z]:` so POSIX test fixtures
(homedir='/h') still get the original behaviour.
2. PowerShell `$env:USERPROFILE` syntax expanded in expandEnvVars.
The expander handled `%NAME%`, `${NAME}`, and bare `$NAME` but not
the PowerShell-native `$env:NAME` form, so messages displayed the
literal `$env:USERPROFILE` instead of the expanded path. Added a
case-insensitive matcher (PowerShell is case-insensitive) covering
all ENV_WHITELIST names. Non-whitelisted `$env:SECRET` still passes
through unchanged.
Regression: vitest tools 1776/1776 GREEN (was 1772; +4 new tests across
"pathNormalize" (+1 cygwin), "expandEnvVars — PowerShell $env:VAR
(Stream H Task 9 cosmetic)" (+3)). One pre-existing test ("case-folds on
win32") would have broken without the homedir-drive guard — guard
preserves it.
Stream H Task 9 of 11. Plan: docs/superpowers/plans/2026-05-30-router-gate-v4-stream-H.md
2026-05-30 11:43:31 +03:00
..
2026-05-23 10:16:32 +03:00
2026-05-23 09:46:28 +03:00
2026-05-23 09:41:48 +03:00
2026-05-27 18:09:38 +03:00
2026-05-30 11:28:13 +03:00
2026-05-30 11:28:13 +03:00
2026-05-29 19:50:14 +03:00
2026-05-29 19:50:14 +03:00
2026-05-29 19:44:55 +03:00
2026-05-29 19:48:49 +03:00
2026-05-19 16:23:51 +03:00
2026-05-19 16:23:52 +03:00
2026-05-19 16:23:45 +03:00
2026-05-30 11:39:47 +03:00
2026-05-30 11:39:47 +03:00
2026-05-26 10:49:28 +03:00
2026-05-28 07:48:20 +03:00
2026-05-28 07:48:20 +03:00
2026-05-25 14:28:26 +03:00
2026-05-25 14:28:26 +03:00
2026-05-29 19:49:38 +03:00
2026-05-29 19:49:38 +03:00
2026-05-28 16:21:39 +03:00
2026-05-28 16:21:39 +03:00
2026-05-28 16:21:39 +03:00
2026-05-28 16:21:39 +03:00
2026-05-28 16:21:39 +03:00
2026-05-28 16:21:39 +03:00
2026-05-19 07:29:43 +03:00
2026-05-19 07:29:43 +03:00
2026-05-29 20:22:26 +03:00
2026-05-29 20:22:26 +03:00
2026-05-24 13:25:05 +03:00
2026-05-24 13:25:05 +03:00
2026-05-30 11:28:13 +03:00
2026-05-30 11:28:13 +03:00
2026-05-25 18:16:29 +03:00
2026-05-25 18:16:29 +03:00
2026-05-25 18:19:03 +03:00
2026-05-25 18:19:03 +03:00
2026-05-30 11:31:00 +03:00
2026-05-30 11:31:00 +03:00
2026-05-30 05:55:46 +03:00
2026-05-30 05:55:46 +03:00
2026-05-30 06:11:21 +03:00
2026-05-30 06:11:21 +03:00
2026-05-25 18:15:31 +03:00
2026-05-25 18:15:31 +03:00
2026-05-29 20:48:51 +03:00
2026-05-29 20:48:51 +03:00
2026-05-26 11:16:16 +03:00
2026-05-26 11:16:16 +03:00
2026-05-30 11:34:44 +03:00
2026-05-30 11:34:44 +03:00
2026-05-29 20:29:23 +03:00
2026-05-29 20:20:35 +03:00
2026-05-25 18:20:08 +03:00
2026-05-25 18:20:08 +03:00
2026-05-29 18:47:21 +03:00
2026-05-29 18:47:21 +03:00
2026-05-30 08:01:49 +03:00
2026-05-30 08:01:49 +03:00
2026-05-29 20:45:23 +03:00
2026-05-30 05:06:58 +03:00
2026-05-30 06:08:19 +03:00
2026-05-30 06:08:19 +03:00
2026-05-29 20:07:58 +03:00
2026-05-29 20:07:58 +03:00
2026-05-25 18:22:12 +03:00
2026-05-25 18:22:12 +03:00
2026-05-30 06:05:17 +03:00
2026-05-30 06:05:17 +03:00
2026-05-30 06:00:00 +03:00
2026-05-30 06:00:00 +03:00
2026-05-27 08:23:17 +03:00
2026-05-27 08:23:17 +03:00
2026-05-26 19:25:44 +03:00
2026-05-26 19:25:44 +03:00
2026-05-30 10:50:50 +03:00
2026-05-30 10:50:50 +03:00
2026-05-29 19:56:09 +03:00
2026-05-29 19:56:09 +03:00
2026-05-20 13:47:43 +03:00
2026-05-29 19:45:33 +03:00
2026-05-29 19:45:33 +03:00
2026-05-28 04:50:10 +03:00
2026-05-28 04:50:10 +03:00
2026-05-19 07:36:21 +03:00
2026-05-19 07:36:21 +03:00
2026-05-29 20:01:48 +03:00
2026-05-29 20:01:48 +03:00
2026-05-29 20:10:23 +03:00
2026-05-29 20:10:23 +03:00
2026-05-29 20:55:20 +03:00
2026-05-29 19:50:01 +03:00
2026-05-29 19:50:01 +03:00
2026-05-29 19:56:09 +03:00
2026-05-29 19:56:09 +03:00
2026-05-25 14:28:25 +03:00
2026-05-25 14:28:25 +03:00
2026-05-21 06:06:25 +03:00
2026-05-21 06:06:25 +03:00
2026-05-21 06:06:26 +03:00
2026-05-21 06:06:26 +03:00
2026-05-23 09:41:48 +03:00
2026-05-19 13:39:09 +03:00
2026-05-19 13:39:09 +03:00
2026-05-25 14:28:24 +03:00
2026-05-21 09:59:56 +03:00
2026-05-25 17:07:23 +03:00
2026-05-25 17:07:23 +03:00
2026-05-23 13:49:42 +03:00
2026-05-23 13:49:42 +03:00
2026-05-19 10:27:23 +03:00
2026-05-19 06:36:13 +03:00
2026-05-19 06:36:13 +03:00
2026-05-23 12:26:24 +03:00
2026-05-23 12:26:24 +03:00
2026-05-23 13:22:55 +03:00
2026-05-23 13:22:55 +03:00
2026-05-21 06:06:27 +03:00
2026-05-21 06:06:27 +03:00
2026-05-19 10:27:23 +03:00
2026-05-19 10:27:23 +03:00
2026-05-27 06:46:55 +03:00
2026-05-27 06:46:55 +03:00
2026-05-25 16:32:30 +03:00
2026-05-25 16:32:30 +03:00
2026-05-26 07:57:25 +03:00
2026-05-26 07:57:25 +03:00
2026-05-26 19:25:16 +03:00
2026-05-26 19:25:16 +03:00
2026-05-30 11:34:44 +03:00
2026-05-30 11:34:44 +03:00
2026-05-30 11:43:31 +03:00
2026-05-30 11:43:31 +03:00
2026-05-23 14:18:52 +03:00
2026-05-28 05:33:22 +03:00
2026-05-23 14:26:34 +03:00
2026-05-23 14:31:34 +03:00
2026-05-24 06:45:27 +03:00
2026-05-24 06:45:27 +03:00
2026-05-25 14:28:25 +03:00
2026-05-27 06:46:55 +03:00
2026-05-27 06:46:55 +03:00
2026-05-28 12:12:39 +03:00
2026-05-28 12:13:54 +03:00
2026-05-25 14:28:24 +03:00
2026-05-25 14:28:24 +03:00
2026-05-25 14:28:25 +03:00
2026-05-25 14:28:25 +03:00
2026-05-25 14:28:25 +03:00
2026-05-29 21:26:10 +03:00
2026-05-29 21:26:10 +03:00
2026-05-27 06:46:55 +03:00
2026-05-27 06:46:55 +03:00
2026-05-24 15:26:18 +03:00
2026-05-24 15:26:18 +03:00
2026-05-24 15:36:14 +03:00
2026-05-24 15:36:14 +03:00
2026-05-24 10:40:20 +03:00
2026-05-27 06:46:55 +03:00
2026-05-27 06:46:55 +03:00
2026-05-15 15:28:18 +03:00
2026-05-15 15:28:18 +03:00
2026-05-15 17:25:09 +03:00
2026-05-15 17:25:09 +03:00
2026-05-15 15:34:33 +03:00
2026-05-15 15:34:33 +03:00
2026-05-29 20:01:00 +03:00
2026-05-29 20:01:00 +03:00
2026-05-29 21:01:56 +03:00
2026-05-29 21:01:56 +03:00
2026-05-30 10:25:15 +03:00
2026-05-30 10:25:15 +03:00
2026-05-29 20:10:41 +03:00
2026-05-29 20:10:41 +03:00
2026-05-29 19:42:51 +03:00
2026-05-29 19:42:51 +03:00
2026-05-28 10:45:45 +03:00
2026-05-28 10:46:00 +03:00
2026-05-29 20:15:12 +03:00
2026-05-29 20:01:57 +03:00
2026-05-29 20:15:12 +03:00
2026-05-18 10:18:54 +03:00
2026-05-28 10:46:00 +03:00
2026-05-28 10:46:00 +03:00
2026-05-29 21:12:33 +03:00
2026-05-29 21:12:33 +03:00
2026-05-25 14:28:01 +03:00
2026-05-25 14:28:01 +03:00
2026-05-29 20:46:54 +03:00
2026-05-29 20:46:54 +03:00
2026-05-20 10:32:31 +03:00