@bonesofspring/ai-rules 0.2.35 → 0.2.36

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.
@@ -151,6 +151,15 @@ function stripContribution(config, record) {
151
151
  }
152
152
  }
153
153
  }
154
+ if (Array.isArray(config.policies) && Array.isArray(added.policies) && added.policies.length > 0) {
155
+ const addedKeys = new Set(added.policies);
156
+ config.policies = config.policies.filter(
157
+ (statement) => !addedKeys.has(`${statement?.action}\u0000${statement?.resource}`),
158
+ );
159
+ if (config.policies.length === 0) {
160
+ delete config.policies;
161
+ }
162
+ }
154
163
  if (isPlainObject(config.hooks) && isPlainObject(added.hooks)) {
155
164
  stripHooks(config.hooks, added.hooks);
156
165
  }
@@ -219,6 +219,42 @@ function mergePermission(existingPermission, presetPermission) {
219
219
  return merged;
220
220
  }
221
221
 
222
+ function policyKey(statement) {
223
+ const action = isPlainObject(statement) && typeof statement.action === 'string' ? statement.action : '';
224
+ const resource = isPlainObject(statement) && typeof statement.resource === 'string' ? statement.resource : '';
225
+ return `${action}\u0000${resource}`;
226
+ }
227
+
228
+ /**
229
+ * Merge preset `policies` (V2 `tool.use` hard-denies) into existing statements.
230
+ * Mirrors `mergePermission`: preset statements fill gaps; consumer statements
231
+ * with the same `action:resource` override. Returns `undefined` when there is
232
+ * nothing to add.
233
+ */
234
+ function mergePolicies(existingPolicies, presetPolicies) {
235
+ const preset = Array.isArray(presetPolicies) ? presetPolicies : [];
236
+ const existing = Array.isArray(existingPolicies) ? existingPolicies : [];
237
+ if (preset.length === 0) return existing.length > 0 ? existing : undefined;
238
+ if (existing.length === 0) return preset;
239
+ const byKey = new Map();
240
+ for (const statement of preset) byKey.set(policyKey(statement), statement);
241
+ for (const statement of existing) byKey.set(policyKey(statement), statement);
242
+ return [...byKey.values()];
243
+ }
244
+
245
+ /**
246
+ * Preset policy `action:resource` keys absent from `existing` — the subset init
247
+ * introduced, so `clean` can strip exactly those. Stored as strings so the
248
+ * merged-record `unionAdded` deduplicates them correctly.
249
+ */
250
+ function addedPolicyKeys(existingPolicies, presetPolicies) {
251
+ const existing = Array.isArray(existingPolicies) ? existingPolicies : [];
252
+ const keys = new Set(existing.map(policyKey));
253
+ return (Array.isArray(presetPolicies) ? presetPolicies : [])
254
+ .map(policyKey)
255
+ .filter((key) => !keys.has(key));
256
+ }
257
+
222
258
  /**
223
259
  * @returns {{ merged: object, extrasKept: string[], added: object }} `added` is what this
224
260
  * merge introduced (see lib/merged-config.js) so clean can strip exactly that.
@@ -233,7 +269,7 @@ function mergeOpencodeConfig(presetObj, existingObj) {
233
269
  for (const key of ownKeys(presetMcp)) {
234
270
  mergedMcp[key] = mergeServerEntry(existingMcp[key], presetMcp[key]);
235
271
  }
236
- const added = { keys: [], instructions: [], bash: {} };
272
+ const added = { keys: [], instructions: [], bash: {}, policies: [] };
237
273
  const merged = { ...existing };
238
274
  if (!merged.$schema && preset.$schema) {
239
275
  merged.$schema = preset.$schema;
@@ -278,6 +314,15 @@ function mergeOpencodeConfig(presetObj, existingObj) {
278
314
  }
279
315
  merged.permission = permission;
280
316
  }
317
+ const prevPolicies = merged.policies;
318
+ const policies = mergePolicies(prevPolicies, preset.policies);
319
+ if (policies !== undefined) {
320
+ if (prevPolicies == null) {
321
+ added.keys.push('policies');
322
+ }
323
+ added.policies = addedPolicyKeys(prevPolicies, preset.policies);
324
+ merged.policies = policies;
325
+ }
281
326
  return { merged, extrasKept, added };
282
327
  }
283
328
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonesofspring/ai-rules",
3
- "version": "0.2.35",
3
+ "version": "0.2.36",
4
4
  "description": "Presets of Cursor, Claude, Mavis, and OpenCode rules/commands for Revy Ross personal use",
5
5
  "license": "MIT",
6
6
  "author": "Revy Ross",
@@ -31,12 +31,13 @@ Examples:
31
31
  2. **Router** — invoke subagent **task-router** with the task description and slug path.
32
32
  3. **Plan** — show the user the table from `pipeline.json`: intent, steps, skipped, humanGates.
33
33
  4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
34
- 5. **Start** — after router:
34
+ 5. **Confirm plan** — **stop** and ask the user to confirm the plan before any specialist runs. Wait for explicit approval before invoking `steps[0]`. A change to the plan at this point is a named `planRevision` (see Plan contract), not a silent edit. Record the confirmation verbatim in `prompt-log.md`.
35
+ 6. **Start** — after confirmation:
35
36
  - confirm `pipeline.json` and `active-task.json`;
36
37
  - **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
37
38
  - invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
38
- 6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`).
39
- 7. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug>`.
39
+ 7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until hook returns `followup_message`).
40
+ 8. **Human gate** — if there is a gate in `humanGates` after the current step (`after:<agent>`), **stop** after the agent finishes and ask for `/task-continue <slug>`.
40
41
 
41
42
  ## Plan contract
42
43
 
@@ -47,6 +48,7 @@ The producer closes each wave with a **pre-receipt self-review** — a `## Self-
47
48
  ## Do not
48
49
 
49
50
  - Invoke developer before router and (if in pipeline) analyst/architect.
51
+ - Invoke `steps[0]` before the user confirms the plan.
50
52
  - Hardcode role order — only `pipeline.json`.
51
53
  - Skip human gate without explicit continue.
52
54
 
@@ -31,12 +31,13 @@ Examples:
31
31
  2. **Router** — invoke subagent **task-router** with the task description and slug path.
32
32
  3. **Plan** — show the user the table from `pipeline.json`: intent, steps, skipped, humanGates.
33
33
  4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
34
- 5. **Start** — after router:
34
+ 5. **Confirm plan** — **stop** and ask the user to confirm the plan before any specialist runs. Wait for explicit approval before invoking `steps[0]`. A change to the plan at this point is a named `planRevision` (see Plan contract), not a silent edit. Record the confirmation verbatim in `prompt-log.md`.
35
+ 6. **Start** — after confirmation:
35
36
  - confirm `pipeline.json` and `active-task.json`;
36
37
  - **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
37
38
  - invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
38
- 6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
39
- 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
39
+ 7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
40
+ 8. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
40
41
 
41
42
  ## Plan contract
42
43
 
@@ -47,6 +48,7 @@ The producer closes each wave with a **pre-receipt self-review** — a `## Self-
47
48
  ## Do not
48
49
 
49
50
  - Invoke developer before router and (if in pipeline) analyst/architect.
51
+ - Invoke `steps[0]` before the user confirms the plan.
50
52
  - Hardcode role order — only `pipeline.json`.
51
53
  - Skip human gate without explicit continue.
52
54
 
@@ -3,7 +3,7 @@
3
3
  "platform": "mavis",
4
4
  "stack": "next",
5
5
  "semanticSource": "cursor/next",
6
- "sourceRevision": "a1b393a2d1c774e279fa025af57ceb9799ee7a6332c8d949d2e34fc69def6492",
6
+ "sourceRevision": "36616af944554e54b909a50f24b317c5ae008d0c67cc04062d489a825dc1d569",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -26,12 +26,13 @@ Examples:
26
26
  2. **Router** — invoke subagent **task-router** with the task description and slug path.
27
27
  3. **Plan** — show the user the table from `pipeline.json`: intent, steps, skipped, humanGates.
28
28
  4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
29
- 5. **Start** — after router:
29
+ 5. **Confirm plan** — **stop** and ask the user to confirm the plan before any specialist runs. Wait for explicit approval before invoking `steps[0]`. A change to the plan at this point is a named `planRevision` (see Plan contract), not a silent edit. Record the confirmation verbatim in `prompt-log.md`.
30
+ 6. **Start** — after confirmation:
30
31
  - confirm `pipeline.json` and `active-task.json`;
31
32
  - **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
32
33
  - invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
33
- 6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
34
- 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
34
+ 7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
35
+ 8. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
35
36
 
36
37
  ## Plan contract
37
38
 
@@ -42,6 +43,7 @@ The producer closes each wave with a **pre-receipt self-review** — a `## Self-
42
43
  ## Do not
43
44
 
44
45
  - Invoke developer before router and (if in pipeline) analyst/architect.
46
+ - Invoke `steps[0]` before the user confirms the plan.
45
47
  - Hardcode role order — only `pipeline.json`.
46
48
  - Skip human gate without explicit continue.
47
49
 
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -3,7 +3,7 @@
3
3
  "platform": "opencode",
4
4
  "stack": "next",
5
5
  "semanticSource": "cursor/next",
6
- "sourceRevision": "a1b393a2d1c774e279fa025af57ceb9799ee7a6332c8d949d2e34fc69def6492",
6
+ "sourceRevision": "36616af944554e54b909a50f24b317c5ae008d0c67cc04062d489a825dc1d569",
7
7
  "entries": [
8
8
  {
9
9
  "source": "AGENTS.md",
@@ -34,12 +34,13 @@ Examples:
34
34
  2. **Router** — invoke subagent **task-router** with the task description and slug path.
35
35
  3. **Plan** — show the user the table from `pipeline.json`: intent, steps, skipped, humanGates.
36
36
  4. **Intent retro** — if `intent === "retro"`, run `/technical-retro` and **stop**.
37
- 5. **Start** — after router:
37
+ 5. **Confirm plan** — **stop** and ask the user to confirm the plan before any specialist runs. Wait for explicit approval before invoking `steps[0]`. A change to the plan at this point is a named `planRevision` (see Plan contract), not a silent edit. Record the confirmation verbatim in `prompt-log.md`.
38
+ 6. **Start** — after confirmation:
38
39
  - confirm `pipeline.json` and `active-task.json`;
39
40
  - **do not** write lifecycle fields in `status.json` / `metrics.json` yourself — orchestration runtime/hook owns them (see **agent-artifact-contracts**). If `status.json` is missing, only minimal bootstrap is allowed (`slug`, `intent`, `pipelineIndex: 0`, `currentAgent: steps[0]`, `state: in_progress`) — **do not** increment `pipelineIndex` manually;
40
41
  - invoke subagent for `pipeline.steps[0].agent` (slug, artifact paths, scope).
41
- 6. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
42
- 7. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
42
+ 7. **After each agent** — wait for hook handoff / reconciliation terminal receipt → `status.state`; do not start the next step until `status.json` reflects handoff (or until there is a `followup_message` from the hook).
43
+ 8. **Human gate** — if after the current step there is a gate in `humanGates` (`after:<agent>`), after the agent finishes **stop** and ask for `/task-continue <slug>`.
43
44
 
44
45
  ## Plan contract
45
46
 
@@ -50,6 +51,7 @@ The producer closes each wave with a **pre-receipt self-review** — a `## Self-
50
51
  ## Do not
51
52
 
52
53
  - Invoke developer before router and (if in pipeline) analyst/architect.
54
+ - Invoke `steps[0]` before the user confirms the plan.
53
55
  - Hardcode role order — only `pipeline.json`.
54
56
  - Skip human gate without explicit continue.
55
57
 
@@ -19,6 +19,18 @@
19
19
  "npx jest*": "deny"
20
20
  }
21
21
  },
22
+ "policies": [
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git commit *",
26
+ "effect": "deny"
27
+ },
28
+ {
29
+ "action": "tool.use",
30
+ "resource": "shell:git push *",
31
+ "effect": "deny"
32
+ }
33
+ ],
22
34
  "mcp": {
23
35
  "context7": {
24
36
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -19,6 +19,18 @@
19
19
  "npx jest*": "deny"
20
20
  }
21
21
  },
22
+ "policies": [
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git commit *",
26
+ "effect": "deny"
27
+ },
28
+ {
29
+ "action": "tool.use",
30
+ "resource": "shell:git push *",
31
+ "effect": "deny"
32
+ }
33
+ ],
22
34
  "mcp": {
23
35
  "context7": {
24
36
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -14,6 +14,18 @@
14
14
  "git push *": "deny"
15
15
  }
16
16
  },
17
+ "policies": [
18
+ {
19
+ "action": "tool.use",
20
+ "resource": "shell:git commit *",
21
+ "effect": "deny"
22
+ },
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git push *",
26
+ "effect": "deny"
27
+ }
28
+ ],
17
29
  "mcp": {
18
30
  "context7": {
19
31
  "type": "local",
@@ -34,10 +34,12 @@ See `.opencode/rules/README.md` for the full catalog and loading strategy.
34
34
  ## Harness wiring
35
35
 
36
36
  - `opencode.json` carries a compact `instructions` list (always-on rule
37
- paths + `.opencode/AGENTS.md`) and a harness-level `permission.bash`
38
- block. On re-init, `mergeOpencodeConfig` unions preset instruction paths
39
- into the consumer list and fills missing bash keys. Extra paths and
40
- same-key overrides stay.
37
+ paths + `.opencode/AGENTS.md`), a harness-level `permission.bash`
38
+ block, and a top-level `policies` hard-deny — `git commit`/`git push`
39
+ are non-overridable, even by an `allow` rule or a saved `Always allow`
40
+ approval. On re-init, `mergeOpencodeConfig` unions preset instruction
41
+ paths into the consumer list and fills missing bash keys and policy
42
+ statements. Extra paths and same-key overrides stay.
41
43
  - **Subagent rules** are re-declared inside every `.opencode/agents/*.md`
42
44
  via the `## Rules to load (subagent context)` block (always-on + zone
43
45
  rules filtered to stems that exist for this stack). `Task`-launched
@@ -19,6 +19,18 @@
19
19
  "npx jest*": "deny"
20
20
  }
21
21
  },
22
+ "policies": [
23
+ {
24
+ "action": "tool.use",
25
+ "resource": "shell:git commit *",
26
+ "effect": "deny"
27
+ },
28
+ {
29
+ "action": "tool.use",
30
+ "resource": "shell:git push *",
31
+ "effect": "deny"
32
+ }
33
+ ],
22
34
  "mcp": {
23
35
  "context7": {
24
36
  "type": "local",