@arcforge/types 2.0.169 → 2.0.171

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcforge/types",
3
- "version": "2.0.169",
3
+ "version": "2.0.171",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./src/index.ts",
@@ -115,19 +115,46 @@ export function decideShell(
115
115
 
116
116
  const { program, shell: isShell } = resolveProgram(argv)
117
117
 
118
- // A shell turns one grant into arbitrary execution. Gated on its own switch
119
- // so `allow: ["git"]` cannot be quietly widened by `sh` being on the box.
118
+ /**
119
+ * A shell turns one grant into arbitrary execution. Gated on its own switch
120
+ * so `allow: ["git"]` cannot be quietly widened by `sh` being on the box.
121
+ *
122
+ * ESCALATES rather than denying when `raw` is simply unset. `raw: false`
123
+ * is still an absolute refusal — a user who wrote it said no — but silence
124
+ * is not a decision, and a hard deny here bricked the common case: every
125
+ * `process.run(...)` goes through `/bin/sh -c`, so an agent with no shell
126
+ * policy could not run a single command and the error named a rule its
127
+ * author had never written. Asking is the honest answer to a question
128
+ * nobody has answered, and the prompt can say what a shell actually is.
129
+ */
120
130
  if (isShell && shell.raw !== true) {
121
- return { verdict: "deny", program, reason: "raw-shell" }
131
+ if (shell.raw === false) return { verdict: "deny", program, reason: "raw-shell" }
132
+ return { verdict: "escalate", program, reason: "raw-shell" }
122
133
  }
123
134
 
135
+ // Deny always beats allow, and always means DENY: this one is a rule
136
+ // somebody wrote, naming this program. There is nothing to ask about.
124
137
  if (shell.deny?.some(pattern => policyGlobMatch(pattern, program))) {
125
138
  return { verdict: "deny", program, reason: "denied" }
126
139
  }
127
140
 
128
141
  if (shell.allow !== undefined) {
142
+ /**
143
+ * An allowlist that names nothing matching ESCALATES.
144
+ *
145
+ * It used to be a flat denial, on the "declared, matched nothing" rule
146
+ * the glob resolver uses. That rule is right for a resolver and wrong
147
+ * here: `allow: ["git"]` states that git is permitted and says nothing
148
+ * whatsoever about `axon`, and reading its silence as a refusal left a
149
+ * user with no way forward but to go and edit a config file — the
150
+ * moment a new user gives up and uses something else.
151
+ *
152
+ * Escalation is what the ceiling is FOR. The prompt names the program,
153
+ * and answering "always" writes the grant the user would have gone
154
+ * looking for.
155
+ */
129
156
  const admitted = shell.allow.some(pattern => policyGlobMatch(pattern, program))
130
- if (!admitted) return { verdict: "deny", program, reason: "not-allowed" }
157
+ if (!admitted) return { verdict: "escalate", program, reason: "not-allowed" }
131
158
  }
132
159
 
133
160
  // Argument patterns — advisory, and only consulted once the program itself
package/src/scope.ts CHANGED
@@ -21,26 +21,6 @@ export type AxonScopeModule = {
21
21
  description?: string
22
22
  members: readonly AxonScopeMember[]
23
23
  ambientTypes?: readonly string[]
24
- /**
25
- * How these members are ADDRESSED — flat globals, or under `name`.
26
- *
27
- * Derived from the tool's origin at `toScopeModule()`: the agent's own
28
- * src/tools and the shared workspace's are flat, a MODULE's live under the
29
- * module's name, so an installed module cannot claim a bare name in the
30
- * author's scope.
31
- *
32
- * Carried on the scope rather than re-derived by each renderer, because
33
- * three surfaces spell this one decision — the model's `<scope>` block,
34
- * the editor's `tool-globals.d.ts`, and the runtime's actual global
35
- * installation — and they must not be able to disagree. They did: both
36
- * renderers declared every tool flat while the runtime namespaced module
37
- * ones, so the model was told `openPr()` for a function that only ever
38
- * existed as `github.openPr()`.
39
- *
40
- * Optional, defaulting to flat where absent, so a hand-built scope in a
41
- * test need not state it.
42
- */
43
- flat?: boolean
44
24
  }
45
25
 
46
26
  /** The complete TypeScript scope implemented by one live capsule. */