@gotgenes/pi-permission-system 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [4.0.1](https://github.com/gotgenes/pi-permission-system/compare/v4.0.0...v4.0.1) (2026-05-04)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* skip bare-slash tokens in bash external-directory extraction ([#68](https://github.com/gotgenes/pi-permission-system/issues/68)) ([84f9a88](https://github.com/gotgenes/pi-permission-system/commit/84f9a88243c0033ddf1ca72894ceb42eb0f5f298))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
* plan skip bare-slash tokens in external-directory extraction ([#68](https://github.com/gotgenes/pi-permission-system/issues/68)) ([f4fded8](https://github.com/gotgenes/pi-permission-system/commit/f4fded847ab7f4c8b82ebcd08edb0cb640d18fa7))
|
|
19
|
+
* plan skip bare-slash tokens in external-directory extraction ([#68](https://github.com/gotgenes/pi-permission-system/issues/68)) ([f33964a](https://github.com/gotgenes/pi-permission-system/commit/f33964a34da726e3667319bf2015193de171767c))
|
|
20
|
+
* **retro:** add retro notes for issue [#66](https://github.com/gotgenes/pi-permission-system/issues/66) ([61d7e5c](https://github.com/gotgenes/pi-permission-system/commit/61d7e5ca30c20c48f52152f9443ede1900010410))
|
|
21
|
+
|
|
8
22
|
## [4.0.0](https://github.com/gotgenes/pi-permission-system/compare/v3.11.0...v4.0.0) (2026-05-04)
|
|
9
23
|
|
|
10
24
|
|
package/package.json
CHANGED
|
@@ -184,6 +184,10 @@ function classifyTokenAsPathCandidate(token: string): string | null {
|
|
|
184
184
|
// Skip @scope/package patterns
|
|
185
185
|
if (token.startsWith("@") && !token.startsWith("@/")) return null;
|
|
186
186
|
|
|
187
|
+
// Skip bare-slash tokens (// JS comments, lone /, etc.) — they resolve to root
|
|
188
|
+
// and are never meaningful path arguments in practice.
|
|
189
|
+
if (/^\/+$/.test(token)) return null;
|
|
190
|
+
|
|
187
191
|
// Must look like a path: starts with /, ~/, or contains ..
|
|
188
192
|
if (token.startsWith("/")) return token;
|
|
189
193
|
if (token.startsWith("~/")) return token;
|
|
@@ -279,6 +279,37 @@ describe("extractExternalPathsFromBashCommand", () => {
|
|
|
279
279
|
});
|
|
280
280
|
});
|
|
281
281
|
|
|
282
|
+
describe("bare-slash tokens are skipped", () => {
|
|
283
|
+
test("does not flag // token", () => {
|
|
284
|
+
const result = extractExternalPathsFromBashCommand("echo //", cwd);
|
|
285
|
+
expect(result).toHaveLength(0);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
test("does not flag / token", () => {
|
|
289
|
+
const result = extractExternalPathsFromBashCommand("echo /", cwd);
|
|
290
|
+
expect(result).toHaveLength(0);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
test("does not flag /// token", () => {
|
|
294
|
+
const result = extractExternalPathsFromBashCommand("echo ///", cwd);
|
|
295
|
+
expect(result).toHaveLength(0);
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
test("does not flag // in echo with other args", () => {
|
|
299
|
+
const result = extractExternalPathsFromBashCommand("echo // hello", cwd);
|
|
300
|
+
expect(result).toHaveLength(0);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
test("still flags real external path alongside //", () => {
|
|
304
|
+
const result = extractExternalPathsFromBashCommand(
|
|
305
|
+
"cat /etc/hosts; echo //",
|
|
306
|
+
cwd,
|
|
307
|
+
);
|
|
308
|
+
expect(result).toContain("/etc/hosts");
|
|
309
|
+
expect(result).toHaveLength(1);
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
282
313
|
describe("deduplication", () => {
|
|
283
314
|
test("returns deduplicated paths", () => {
|
|
284
315
|
const result = extractExternalPathsFromBashCommand(
|