Jonathan Haas commited on
Commit
bacd421
·
1 Parent(s): 5aa6a63

Expand operations runbooks and add release checklist

Browse files
README.md CHANGED
@@ -90,6 +90,7 @@ Smart home safety defaults:
90
  - `HOME_PERMISSION_PROFILE=readonly` disables mutating `smart_home` actions but keeps `smart_home_state`.
91
  - Operational runbook: [`docs/operations/home-control-policy.md`](docs/operations/home-control-policy.md).
92
  - Integration runbook: [`docs/operations/integration-policy.md`](docs/operations/integration-policy.md).
 
93
  - Todoist integration:
94
  - `TODOIST_PERMISSION_PROFILE=readonly|control`
95
  - `readonly` allows `todoist_list_tasks` and denies `todoist_add_task`
@@ -99,6 +100,23 @@ Smart home safety defaults:
99
  - `off` denies `pushover_notify`
100
  - `allow` enables `pushover_notify`
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  ## Usage
103
 
104
  ```bash
@@ -147,6 +165,18 @@ Workflow linting and YAML hygiene run via
147
  Nightly soak coverage is scheduled in
148
  [`nightly-soak.yml`](.github/workflows/nightly-soak.yml).
149
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  ## Project Structure
151
 
152
  ```
 
90
  - `HOME_PERMISSION_PROFILE=readonly` disables mutating `smart_home` actions but keeps `smart_home_state`.
91
  - Operational runbook: [`docs/operations/home-control-policy.md`](docs/operations/home-control-policy.md).
92
  - Integration runbook: [`docs/operations/integration-policy.md`](docs/operations/integration-policy.md).
93
+ - Release checklist: [`docs/operations/release-checklist.md`](docs/operations/release-checklist.md).
94
  - Todoist integration:
95
  - `TODOIST_PERMISSION_PROFILE=readonly|control`
96
  - `readonly` allows `todoist_list_tasks` and denies `todoist_add_task`
 
100
  - `off` denies `pushover_notify`
101
  - `allow` enables `pushover_notify`
102
 
103
+ ### First-Time Operator Checklist
104
+
105
+ 1. Copy `.env.example` to `.env`, then set required keys: `ANTHROPIC_API_KEY` and `ELEVENLABS_API_KEY`.
106
+ 2. If using integrations, set both values for each pair:
107
+ - `HASS_URL` and `HASS_TOKEN`
108
+ - `PUSHOVER_API_TOKEN` and `PUSHOVER_USER_KEY`
109
+ 3. Choose explicit permission profiles before first run:
110
+ - `HOME_PERMISSION_PROFILE=readonly` (recommended first boot)
111
+ - `TODOIST_PERMISSION_PROFILE=readonly`
112
+ - `NOTIFICATION_PERMISSION_PROFILE=off`
113
+ 4. Run local validation gates:
114
+ - `make check`
115
+ - `make test-faults`
116
+ 5. Start in simulation mode and confirm no startup warnings are emitted:
117
+ - `uv run python -m jarvis --sim --no-vision`
118
+ 6. If Home Assistant is enabled, run a `dry_run=true` smart-home request first before any live execute.
119
+
120
  ## Usage
121
 
122
  ```bash
 
165
  Nightly soak coverage is scheduled in
166
  [`nightly-soak.yml`](.github/workflows/nightly-soak.yml).
167
 
168
+ ### CI Workflow Intent and Failure Routing
169
+
170
+ | Workflow | Intent | Failure routing (first stop) |
171
+ |---|---|---|
172
+ | `ci.yml` / `lint` | Static checks (`ruff`) | `src/`, `tests/`, and Python style issues in the failing path |
173
+ | `ci.yml` / `tests` | Full regression (`pytest`) | Failing test module and corresponding implementation area |
174
+ | `ci.yml` / `faults` | Fault-injection taxonomy + error-path contract | `tests/test_tools.py` fault tests and `src/jarvis/tools/services.py` normalization paths |
175
+ | `workflow-sanity.yml` | Workflow hygiene (`actionlint`, tabs, script executability/shebang) | `.github/workflows/*` and `scripts/*.sh` |
176
+ | `shellcheck.yml` | Shell script linting | `scripts/*.sh` syntax/quoting/safety |
177
+ | `security.yml` | Scheduled/PR CodeQL scan | Security findings in SARIF report; route by file ownership |
178
+ | `nightly-soak.yml` | Long-run stability signal | `tests/test_main_audio.py -k soak`, audio/runtime regressions |
179
+
180
  ## Project Structure
181
 
182
  ```
TODO.md CHANGED
@@ -117,11 +117,11 @@ Files: `tests/conftest.py`, `tests/test_tools.py`, `tests/test_*.py`
117
  - [x] `D01` Create external integrations runbook (Todoist/Pushover policy + troubleshooting).
118
  - [x] `D02` Update home-control runbook with redaction and cooldown semantics.
119
  - [x] `D03` Reconcile architecture diagram MCP/tool labels with current capabilities.
120
- - [ ] `D04` Add runbook section for CI workflow intent and failure routing.
121
- - [ ] `D05` Add operator checklist for first-time env setup validation.
122
- - [ ] `D06` Add troubleshooting matrix mapping common errors to likely fixes.
123
- - [ ] `D07` Add short section on audit location/rotation/redaction guarantees.
124
- - [ ] `D08` Add release checklist doc for safe rollout of policy changes.
125
 
126
  Files: `README.md`, `docs/operations/home-control-policy.md`, `docs/operations/integration-policy.md`, `docs/operations/release-checklist.md`
127
 
 
117
  - [x] `D01` Create external integrations runbook (Todoist/Pushover policy + troubleshooting).
118
  - [x] `D02` Update home-control runbook with redaction and cooldown semantics.
119
  - [x] `D03` Reconcile architecture diagram MCP/tool labels with current capabilities.
120
+ - [x] `D04` Add runbook section for CI workflow intent and failure routing.
121
+ - [x] `D05` Add operator checklist for first-time env setup validation.
122
+ - [x] `D06` Add troubleshooting matrix mapping common errors to likely fixes.
123
+ - [x] `D07` Add short section on audit location/rotation/redaction guarantees.
124
+ - [x] `D08` Add release checklist doc for safe rollout of policy changes.
125
 
126
  Files: `README.md`, `docs/operations/home-control-policy.md`, `docs/operations/integration-policy.md`, `docs/operations/release-checklist.md`
127
 
docs/operations/integration-policy.md CHANGED
@@ -47,11 +47,29 @@ This runbook covers operational setup and policy behavior for Todoist and Pushov
47
  - `pushover_configured`
48
  - policy snapshot for todoist/notification profiles
49
 
50
- ## 5) Security and Audit
51
- - Todoist and Pushover audits intentionally store metadata only.
52
- - Smart-home service payloads are sensitive-key redacted before audit write.
 
 
 
 
 
 
53
 
54
- ## 6) Troubleshooting
 
 
 
 
 
 
 
 
 
 
 
 
55
  1. Check credential env vars are set and non-empty.
56
  2. Check profile env vars:
57
  - `TODOIST_PERMISSION_PROFILE`
 
47
  - `pushover_configured`
48
  - policy snapshot for todoist/notification profiles
49
 
50
+ ## 5) Audit Location, Rotation, and Redaction Guarantees
51
+ - Audit path: `~/.jarvis/audit.jsonl`
52
+ - Rotation settings:
53
+ - `AUDIT_LOG_MAX_BYTES` default is `1000000`
54
+ - `AUDIT_LOG_BACKUPS` default is `3`
55
+ - Backups roll as `audit.jsonl.1` through `audit.jsonl.N`
56
+ - Todoist and Pushover audits intentionally store metadata-only summaries.
57
+ - Smart-home payload data is redacted by sensitive key token matching before audit write (`token`, `secret`, `code`, `pin`, `password`, etc.).
58
+ - Redacted values are persisted as `***REDACTED***`.
59
 
60
+ ## 6) Troubleshooting Matrix
61
+
62
+ | Symptom | Likely cause | Operator action |
63
+ |---|---|---|
64
+ | `Todoist not configured. Set TODOIST_API_TOKEN.` | Missing/empty `TODOIST_API_TOKEN` | Set token in `.env` and restart process |
65
+ | `Todoist authentication failed. Check TODOIST_API_TOKEN.` | Invalid or revoked Todoist token | Rotate token and retest with `todoist_list_tasks` |
66
+ | `Pushover not configured. Set PUSHOVER_API_TOKEN and PUSHOVER_USER_KEY.` | One or both Pushover fields are missing | Set both values and restart process |
67
+ | `Notification policy blocks pushover_notify` (tool denied) | `NOTIFICATION_PERMISSION_PROFILE=off` | Switch to `allow` if operationally approved |
68
+ | `Todoist policy blocks todoist_add_task` (tool denied) | `TODOIST_PERMISSION_PROFILE=readonly` | Switch to `control` for write access |
69
+ | `invalid_json` result from Todoist/Pushover path | Upstream payload shape changed or transient invalid response | Retry once, then inspect API response and update parser tests |
70
+ | Repeated `http_error` / `network_client_error` | Upstream outage, DNS, connectivity, or timeout issue | Validate network path, check service status page, rerun `make test-faults` |
71
+
72
+ ## 7) Triage Flow
73
  1. Check credential env vars are set and non-empty.
74
  2. Check profile env vars:
75
  - `TODOIST_PERMISSION_PROFILE`
docs/operations/release-checklist.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Release Checklist
2
+
3
+ Use this checklist for policy or integration behavior changes before merging to `main` and before deploying to a live robot environment.
4
+
5
+ ## 1) Pre-merge Validation
6
+
7
+ - [ ] `make check` passes locally.
8
+ - [ ] `make test-faults` passes locally.
9
+ - [ ] New/changed policy behavior has test coverage for:
10
+ - allow path
11
+ - deny path
12
+ - failure normalization path
13
+ - [ ] `TODO.md` items touched in this release are updated (`[x]` / `[ ]`) to reflect current status.
14
+ - [ ] Any new GitHub Action usage is pinned to a full commit SHA.
15
+
16
+ ## 2) Configuration Review
17
+
18
+ - [ ] Required environment variables for changed integrations are documented in `README.md`.
19
+ - [ ] Permission profiles are explicitly reviewed:
20
+ - `HOME_PERMISSION_PROFILE`
21
+ - `TODOIST_PERMISSION_PROFILE`
22
+ - `NOTIFICATION_PERMISSION_PROFILE`
23
+ - [ ] Defaults are still safe for first boot (`readonly`/`off` where applicable).
24
+ - [ ] Startup warning behavior remains accurate for incomplete configs.
25
+
26
+ ## 3) Audit and Safety Review
27
+
28
+ - [ ] Audit output verified at `~/.jarvis/audit.jsonl`.
29
+ - [ ] Sensitive fields are redacted in audit records (`***REDACTED***`).
30
+ - [ ] Audit rotation tested or confirmed:
31
+ - `AUDIT_LOG_MAX_BYTES`
32
+ - `AUDIT_LOG_BACKUPS`
33
+ - [ ] Destructive smart-home actions still require `confirm=true` where expected.
34
+ - [ ] Dry-run paths (`dry_run=true`) were exercised before execute paths.
35
+
36
+ ## 4) CI and Workflow Health
37
+
38
+ - [ ] `ci.yml` completes (`lint`, `tests`, and `faults` when applicable).
39
+ - [ ] `workflow-sanity.yml` completes (actionlint + script checks).
40
+ - [ ] `shellcheck.yml` completes for shell script changes.
41
+ - [ ] `security.yml` has no new actionable CodeQL alerts for changed files.
42
+ - [ ] Artifacts are present for test diagnostics:
43
+ - junit XML
44
+ - optional coverage XML (if manually requested)
45
+
46
+ ## 5) Rollout Steps
47
+
48
+ 1. Merge to `main` only after all required checks pass.
49
+ 2. Deploy and run an initial startup in simulation mode:
50
+ - `uv run python -m jarvis --sim --no-vision`
51
+ 3. Execute a low-risk live smoke test:
52
+ - read-only status path (`system_status`)
53
+ - integration read path (`todoist_list_tasks` if configured)
54
+ - smart-home dry-run path (if Home Assistant configured)
55
+ 4. Validate audit log writes for the smoke-test actions.
56
+
57
+ ## 6) Rollback Triggers and Actions
58
+
59
+ Trigger rollback when any of the following occur:
60
+ - Repeated `auth`, `http_error`, or `network_client_error` in a newly changed path.
61
+ - Incorrect allow/deny policy behavior versus documented profiles.
62
+ - Sensitive content appears in audit output.
63
+
64
+ Rollback actions:
65
+ 1. Revert the release commit(s) from `main`.
66
+ 2. Re-run `make check` and `make test-faults`.
67
+ 3. Redeploy previous known-good revision.
68
+ 4. Capture incident notes and add missing regression tests before retrying release.