@gotgenes/pi-permission-system 27.1.0 → 27.1.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,13 @@ 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
+ ## [27.1.1](https://github.com/gotgenes/pi-packages/compare/pi-permission-system-v27.1.0...pi-permission-system-v27.1.1) (2026-08-28)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **pi-permission-system:** project glob-bearing bash path tokens to the path surfaces ([706c75d](https://github.com/gotgenes/pi-packages/commit/706c75da10d03c61ef0d53f9571d249b91986db5)), closes [#821](https://github.com/gotgenes/pi-packages/issues/821)
14
+
8
15
  ## [27.1.0](https://github.com/gotgenes/pi-packages/compare/pi-permission-system-v27.0.1...pi-permission-system-v27.1.0) (2026-08-27)
9
16
 
10
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotgenes/pi-permission-system",
3
- "version": "27.1.0",
3
+ "version": "27.1.1",
4
4
  "description": "Permission enforcement extension for the Pi coding agent.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -16,9 +16,17 @@
16
16
  * `docs/decisions/0009-bash-path-projection-completeness-contract.md`.
17
17
  *
18
18
  * All three classifiers share the private `rejectNonPathToken` predicate that
19
- * captures the six rejection cases common to them (the production clone this
19
+ * captures the five rejection cases common to them (the production clone this
20
20
  * module was extracted to eliminate).
21
21
  *
22
+ * None of them reads a token's glob or regex metacharacters. A shell bracket
23
+ * glob and a regex character class are spelled identically, so "contains a
24
+ * metacharacter" cannot decide path-hood — and it silently dropped tokens the
25
+ * shell really does expand into filesystem paths (`/etc/[p]asswd`,
26
+ * `rm -rf /tmp/tmp.*`, #821). What a pattern argument is instead settled by
27
+ * *position*: `PATTERN_FIRST_COMMANDS` in `token-collection.ts` skips a
28
+ * pattern-first command's inline pattern positional at collection time.
29
+ *
22
30
  * Both `classifyTokenAsPathCandidate` and `classifyTokenAsRuleCandidate` recognize
23
31
  * Windows drive-letter absolute paths (`C:/…`, `C:\…`) unconditionally on all
24
32
  * platforms. On POSIX the token resolves as a real in-CWD relative path and is
@@ -106,8 +114,8 @@ export function classifyTokenAsRuleCandidate(
106
114
  * *shape* name a path at all?
107
115
  *
108
116
  * It runs only the shared `rejectNonPathToken` prelude, so a flag,
109
- * env-assignment, URL, `@scope` token, or regex-shaped token is never a
110
- * candidate. Everything else is returned for the caller to probe.
117
+ * env-assignment, URL, or `@scope` token is never a candidate. Everything else
118
+ * is returned for the caller to probe.
111
119
  *
112
120
  * Deliberately consults no policy: candidacy is settled by the filesystem and
113
121
  * the decision by the ruleset, which keeps this module a pure shape function
@@ -137,19 +145,14 @@ const WINDOWS_DRIVE_PATH_PATTERN = /^[a-zA-Z]:[/\\]/;
137
145
  */
138
146
  const URL_PATTERN = /^[a-z][a-z0-9+.-]*:\/\//i;
139
147
 
140
- /**
141
- * Regex metacharacter sequences that are never found in real filesystem paths.
142
- * If a token contains any of these, it is almost certainly a regex pattern
143
- * (e.g. a grep argument) rather than a path.
144
- */
145
- const REGEX_METACHAR_PATTERN = /\.\*|\.\+|\\\||\\\(|\\\)|\[.*?\]|\^\//;
146
-
147
148
  /**
148
149
  * Shared rejection prelude: returns `true` when a token can never be a
149
150
  * filesystem path, regardless of which classifier is asking.
150
151
  *
151
152
  * Rejects: empty tokens, flags (leading `-`), env assignments (`FOO=/bar`),
152
- * URLs, `@scope/package` patterns, and regex metacharacter sequences.
153
+ * URLs, and `@scope/package` patterns. Each rules a token out by syntax; a
154
+ * glob or regex metacharacter does not, since the two are indistinguishable
155
+ * and the shell expands the former into real paths (#821).
153
156
  *
154
157
  * A bare `/` (or `//`, `///`) is NOT rejected: it denotes the filesystem root,
155
158
  * a deliberate external-directory access (`find /`, `ls /`), so it must reach
@@ -172,7 +175,5 @@ function rejectNonPathToken(token: string): boolean {
172
175
  // since it looks like an absolute-rooted path, not an npm scope.
173
176
  if (token.startsWith("@") && !token.startsWith("@/")) return true;
174
177
 
175
- if (REGEX_METACHAR_PATTERN.test(token)) return true;
176
-
177
178
  return false;
178
179
  }