@ibartel74/pi-automode-ext 1.0.0
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 +81 -0
- package/LICENSE.md +22 -0
- package/README.md +262 -0
- package/docs/GLOSSARY.md +41 -0
- package/docs/adr/ADR-001-permission-precedence-and-trust-boundaries.md +46 -0
- package/docs/adr/ADR-002-global-config-in-extension-data-directory.md +60 -0
- package/docs/adr/INDEX.md +6 -0
- package/docs/automode-classifier-flow.md +449 -0
- package/docs/configuration.md +226 -0
- package/docs/defaults.md +178 -0
- package/docs/diagnostics.md +90 -0
- package/docs/observability-logging.md +160 -0
- package/examples/automode.local.json +45 -0
- package/extensions/auto-mode/bash.ts +692 -0
- package/extensions/auto-mode/classifier.ts +940 -0
- package/extensions/auto-mode/config.ts +948 -0
- package/extensions/auto-mode/constants.ts +232 -0
- package/extensions/auto-mode/extension.ts +1118 -0
- package/extensions/auto-mode/hard-deny.ts +429 -0
- package/extensions/auto-mode/jev.ts +338 -0
- package/extensions/auto-mode/log.ts +173 -0
- package/extensions/auto-mode/model-selector.ts +113 -0
- package/extensions/auto-mode/model.ts +13 -0
- package/extensions/auto-mode/paths.ts +303 -0
- package/extensions/auto-mode/permissions.ts +667 -0
- package/extensions/auto-mode/state.ts +106 -0
- package/extensions/auto-mode/transcript.ts +236 -0
- package/extensions/auto-mode/types.ts +210 -0
- package/extensions/auto-mode/utils.ts +54 -0
- package/extensions/auto-mode.ts +27 -0
- package/package.json +61 -0
- package/skills/automode-diagnostics/SKILL.md +63 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: automode-diagnostics
|
|
3
|
+
description: Diagnose unexpected pi-automode decisions from active state, effective rules, and observability logs. Use when auto mode blocks a safe action, allows an unsafe action, or needs a narrowly scoped rule correction.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Automode diagnostics
|
|
7
|
+
|
|
8
|
+
Use this skill to investigate a pi-automode decision. Read [Agent diagnostics](../../docs/diagnostics.md), [Classifier flow](../../docs/automode-classifier-flow.md), [Defaults](../../docs/defaults.md), and [Observability logging](../../docs/observability-logging.md) before you change configuration.
|
|
9
|
+
|
|
10
|
+
## Safety rules
|
|
11
|
+
|
|
12
|
+
- Investigate before you edit configuration.
|
|
13
|
+
- Do not evade a denial with another tool, path, or disabled safety control.
|
|
14
|
+
- Do not weaken a rule only to make one action pass.
|
|
15
|
+
- Do not print credentials, tokens, private keys, signed URLs, or sensitive tool input.
|
|
16
|
+
- Preserve unrelated working-tree and configuration changes.
|
|
17
|
+
- Do not run an unsafe rejected action because auto mode is off.
|
|
18
|
+
|
|
19
|
+
`automode_inspect` is read-only. It cannot change auto mode or configuration. Its output is model-visible and omits denial reasons and action payloads. Treat truncated output as incomplete.
|
|
20
|
+
|
|
21
|
+
## Investigation
|
|
22
|
+
|
|
23
|
+
1. Call `automode_inspect` with `status`, `config`, and `denials`.
|
|
24
|
+
2. Read the reported log path only when observability logging is enabled.
|
|
25
|
+
3. Use the denial timestamp, enforcement kind, and tool name to locate the relevant decision entry.
|
|
26
|
+
4. Inspect a decision reason only after you verify that it cannot contain sensitive input.
|
|
27
|
+
5. Identify the enforcement layer before you propose a change:
|
|
28
|
+
- `permissions.deny` and `permissions.ask` are local rules.
|
|
29
|
+
- `deterministic-hard-deny` is extension code.
|
|
30
|
+
- `read-only` is a local allow.
|
|
31
|
+
- `classifier` is a model decision.
|
|
32
|
+
6. Do not tune classifier rules to solve a permission or deterministic denial.
|
|
33
|
+
|
|
34
|
+
For a classifier decision, use the effective configuration and the logged classifier metadata when available. Do not dump full prompts or raw responses. They can contain session context and tool input.
|
|
35
|
+
|
|
36
|
+
## Configuration correction
|
|
37
|
+
|
|
38
|
+
Only change configuration when the user explicitly requests a correction.
|
|
39
|
+
|
|
40
|
+
1. Explain the proposed narrow change.
|
|
41
|
+
2. Ask the user to run `/automode off`.
|
|
42
|
+
3. Wait for confirmation.
|
|
43
|
+
4. While auto mode is off, edit only the requested automode configuration and related evidence files.
|
|
44
|
+
5. Validate JSON syntax and the exact diff.
|
|
45
|
+
6. Ask the user to run `/automode reload` and then `/automode on`.
|
|
46
|
+
7. Call `automode_inspect` with `status` and `config` to confirm that auto mode is enabled and the new configuration is active.
|
|
47
|
+
8. Retry an action only when the user requested it and the action is safe.
|
|
48
|
+
|
|
49
|
+
When a correction replaces a rule list, check whether it retains `$defaults`. Keep unrelated protections. Test the corrected non-secret case, the secret-bearing variant, an unapproved destination, and an unrelated hard-deny case.
|
|
50
|
+
|
|
51
|
+
## Report
|
|
52
|
+
|
|
53
|
+
Report:
|
|
54
|
+
|
|
55
|
+
- the active configuration and log paths;
|
|
56
|
+
- the decision timestamp, ID, and enforcement layer;
|
|
57
|
+
- the evidence for the decision;
|
|
58
|
+
- the proposed or applied narrow change;
|
|
59
|
+
- validation performed and expected regression cases;
|
|
60
|
+
- remaining uncertainty; and
|
|
61
|
+
- whether auto mode is enabled.
|
|
62
|
+
|
|
63
|
+
If the session ends while auto mode is off, tell the user to run `/automode on`.
|