pantheon-opencode 1.5.2 → 1.6.0-beta.10

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.
Files changed (146) hide show
  1. package/.pantheon/code-mode/README.md +4 -2
  2. package/.pantheon/code-mode/checkpoint_session.py +138 -102
  3. package/.pantheon/code-mode/compress-inline.py +102 -57
  4. package/.pantheon/code-mode/manifest.json +2 -8
  5. package/AGENTS.global.md +182 -0
  6. package/AGENTS.md +10 -891
  7. package/CHANGELOG.md +343 -0
  8. package/README.md +577 -79
  9. package/README.pt-BR.md +345 -60
  10. package/bin/pantheon-init.mjs +26 -3
  11. package/commands/pantheon-audit.md +7 -1
  12. package/commands/pantheon-consolidate.md +1 -1
  13. package/commands/pantheon-deepwork.md +14 -3
  14. package/commands/pantheon-focus.md +17 -0
  15. package/commands/pantheon-optimize.md +2 -2
  16. package/commands/pantheon-vision.md +61 -12
  17. package/package.json +30 -11
  18. package/plugin.json +2 -2
  19. package/pyproject.toml +11 -16
  20. package/scripts/build-agents-md.mjs +376 -58
  21. package/scripts/changelog-merge.mjs +161 -0
  22. package/scripts/check-plugin-v2-coverage.mjs +213 -0
  23. package/scripts/ci-validate-yaml.py +7 -5
  24. package/scripts/{code_mode_server.py → code_mode.py} +119 -27
  25. package/scripts/cost.mjs +244 -41
  26. package/scripts/doctor.mjs +236 -29
  27. package/scripts/install/agents-md.mjs +4 -4
  28. package/scripts/install/cli-ui.mjs +1 -1
  29. package/scripts/install/config-migration.mjs +319 -6
  30. package/scripts/install/health-check.mjs +26 -37
  31. package/scripts/install/interactive.mjs +7 -7
  32. package/scripts/install/migrate.mjs +1 -1
  33. package/scripts/install/opencode-version.mjs +246 -4
  34. package/scripts/install/opencode.mjs +627 -179
  35. package/scripts/install/plugin.mjs +43 -9
  36. package/scripts/install/shared.mjs +120 -12
  37. package/scripts/install/vision-prompt.mjs +161 -0
  38. package/scripts/install-mcp.mjs +28 -9
  39. package/scripts/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
  40. package/{src/mcp/mcp_resources_server.py → scripts/mcp_resources.py} +2 -2
  41. package/scripts/{memory_mcp_server.py → memory_mcp.py} +372 -198
  42. package/scripts/postinstall.mjs +0 -7
  43. package/scripts/probe-context-rehydrate.mjs +36 -13
  44. package/scripts/probe-pantheon-cost.mjs +71 -15
  45. package/scripts/prune.mjs +2 -2
  46. package/scripts/run-node-tests.mjs +189 -0
  47. package/scripts/sync-artifacts.mjs +26 -13
  48. package/scripts/sync-tui.mjs +24 -3
  49. package/scripts/test-opencode-v2-sandbox.sh +1913 -0
  50. package/scripts/validate-routing.mjs +43 -3
  51. package/scripts/validate-sandbox-install.mjs +138 -0
  52. package/scripts/versioning.mjs +13 -1
  53. package/scripts/vision-status.mjs +682 -0
  54. package/skills-lock.json +15 -16
  55. package/src/agents/aphrodite.md +20 -37
  56. package/src/agents/apollo.md +7 -3
  57. package/src/agents/athena.md +63 -35
  58. package/src/agents/demeter.md +8 -28
  59. package/src/agents/gaia.md +1 -1
  60. package/src/agents/hephaestus.md +10 -21
  61. package/src/agents/hermes.md +15 -38
  62. package/src/agents/iris.md +1 -1
  63. package/src/agents/mnemosyne.md +23 -60
  64. package/src/agents/nyx.md +1 -1
  65. package/src/agents/prometheus.md +16 -20
  66. package/src/agents/talos.md +10 -2
  67. package/src/agents/themis.md +5 -5
  68. package/src/agents/zeus.md +99 -130
  69. package/src/instructions/agent-return-format.instructions.md +18 -3
  70. package/src/instructions/backend-standards.instructions.md +2 -0
  71. package/src/instructions/frontend-standards.instructions.md +3 -1
  72. package/src/instructions/memory-protocol.instructions.md +11 -110
  73. package/src/instructions/zeus-anti-stall.instructions.md +14 -61
  74. package/src/instructions/zeus-communication-rules.instructions.md +0 -1
  75. package/src/instructions/zeus-council-synthesis.instructions.md +32 -260
  76. package/src/instructions/zeus-memory-operations.instructions.md +26 -0
  77. package/src/instructions/zeus-timeout-retry.instructions.md +40 -87
  78. package/src/mcp/{code_mode_server.py → code_mode.py} +119 -27
  79. package/src/mcp/eval_store.py +2 -2
  80. package/src/mcp/mcp_codemap_module.py +559 -129
  81. package/src/mcp/{mcp_persistence_server.py → mcp_persistence.py} +392 -78
  82. package/{scripts/mcp_resources_server.py → src/mcp/mcp_resources.py} +2 -2
  83. package/src/mcp/{memory_mcp_server.py → memory_mcp.py} +373 -250
  84. package/src/mcp/{pantheon_vision_server.py → pantheon_vision.py} +396 -40
  85. package/src/mcp/requirements-mcp.txt +10 -6
  86. package/src/mcp/requirements-vision.txt +4 -2
  87. package/src/pantheon/cost-command.ts +399 -101
  88. package/src/pantheon/delegation-enforce.ts +10 -1
  89. package/src/pantheon/model-command.ts +18 -7
  90. package/src/pantheon/presets.d.mts +0 -8
  91. package/src/pantheon/presets.mjs +5 -32
  92. package/src/pantheon/todo-enforcer.ts +1 -1
  93. package/src/pantheon/v2-bounded-read.ts +640 -0
  94. package/src/pantheon/v2-delegation-enforce.ts +214 -0
  95. package/src/pantheon/v2-execute-after.ts +186 -0
  96. package/src/pantheon/v2-tools.ts +429 -0
  97. package/src/pantheon/v2-unsupported.d.mts +11 -0
  98. package/src/pantheon/v2-unsupported.mjs +90 -0
  99. package/src/pantheon/v2-vision.ts +622 -0
  100. package/src/pantheon/vision-local.ts +531 -0
  101. package/src/pantheon/vision.ts +1161 -116
  102. package/src/plugin-v2.ts +1244 -288
  103. package/src/plugin.ts +12 -9
  104. package/src/plugins/tui/dist/server.d.ts +1 -2
  105. package/src/plugins/tui/dist/server.d.ts.map +1 -1
  106. package/src/plugins/tui/dist/tui-v2.d.ts +154 -0
  107. package/src/plugins/tui/dist/tui-v2.d.ts.map +1 -0
  108. package/src/plugins/tui/dist/tui-v2.js +659 -0
  109. package/src/plugins/tui/dist/tui-v2.js.map +1 -0
  110. package/src/plugins/tui/dist/tui.d.ts +85 -82
  111. package/src/plugins/tui/dist/tui.d.ts.map +1 -1
  112. package/src/plugins/tui/dist/tui.js +72 -59
  113. package/src/plugins/tui/index-v2.ts +6 -0
  114. package/src/plugins/tui/package-lock.json +5504 -1341
  115. package/src/plugins/tui/package.json +25 -15
  116. package/src/plugins/tui/src/index-v2.tsx +734 -0
  117. package/src/plugins/tui/src/index.tsx +106 -85
  118. package/src/plugins/tui/src/opencode-v2.d.ts +13 -0
  119. package/src/plugins/tui/tsconfig.build.json +5 -0
  120. package/src/plugins/tui/tsconfig.typecheck.json +5 -0
  121. package/src/plugins/tui/tsdown.config.ts +22 -2
  122. package/src/plugins/tui/tui-v2.ts +2 -0
  123. package/src/plugins/tui/tui.ts +3 -0
  124. package/src/routing.yml +11 -22
  125. package/src/skills/README.md +34 -39
  126. package/src/skills/agent-coordination/SKILL.md +7 -2
  127. package/src/skills/artifact-management/SKILL.md +12 -5
  128. package/src/skills/auto-continue/SKILL.md +54 -95
  129. package/src/skills/code-review-checklist/SKILL.md +5 -5
  130. package/src/skills/context-compression/SKILL.md +26 -879
  131. package/src/skills/session-goal/SKILL.md +14 -5
  132. package/src/skills/spec-driven-development/SKILL.md +3 -1
  133. package/src/skills/tdd-with-agents/SKILL.md +18 -10
  134. package/.pantheon/code-mode/eval-llm-judge.py +0 -255
  135. package/.pantheon/code-mode/eval-monte-carlo.py +0 -368
  136. package/.pantheon/code-mode/eval-run.py +0 -197
  137. package/.pantheon/code-mode/eval-static.py +0 -321
  138. package/.pantheon/code-mode/session-end-save.py +0 -186
  139. package/.pantheon/code-mode/session-end-save.sh +0 -18
  140. package/opencode.json +0 -58
  141. package/scripts/recover-zenodo-deposition.mjs +0 -146
  142. package/scripts/test-opencode-v1-v2-sandbox.sh +0 -862
  143. package/scripts/validate-zenodo-release.mjs +0 -154
  144. package/scripts/zenodo-artifact.mjs +0 -94
  145. package/scripts/zenodo-release-state.mjs +0 -53
  146. package/src/skills/orchestration-workflow/SKILL.md +0 -311
@@ -34,8 +34,8 @@ Route tasks to optimized agents based on category instead of specifying agents m
34
34
 
35
35
  ```
36
36
  1. User describes feature
37
- 2. @athena creates PLAN with phases and agents
38
- 3. User approves PLAN (GATE 1)
37
+ 2. @athena returns the complete PLAN to Zeus (no approval prompt from the child session)
38
+ 3. Zeus displays the full PLAN in the main conversation, then asks the user to approve it (GATE 1)
39
39
  4. Zeus dispatches agents to phases (parallel when possible)
40
40
  5. Each agent: TDD cycle → writes IMPL artifact
41
41
  6. @themis reviews all phases (GATE 2)
@@ -67,6 +67,11 @@ All phase outputs go to `.pantheon/memory-bank/.tmp/`. See `skill: artifact-mana
67
67
 
68
68
  ## Safety Gates
69
69
 
70
+ For every requested plan, Gate 1 is not satisfied by a child-agent approval
71
+ question or a link to a hidden artifact: the complete plan must be visible in
72
+ the main conversation before Zeus asks for approval. If the user requests
73
+ changes, Zeus presents the complete revised plan and repeats Gate 1.
74
+
70
75
  | Gate | When | Why |
71
76
  |------|------|-----|
72
77
  | **GATE 1** | After PLAN | User confirms scope |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: artifact-management
3
- description: "Structured artifact trail for feature implementations — plans, implementations, reviews, and decisions."
3
+ description: "Structured artifacts for planned, multi-phase, or materially risky implementation work."
4
4
  context: fork
5
5
  globs: []
6
6
  alwaysApply: false
@@ -8,7 +8,7 @@ alwaysApply: false
8
8
 
9
9
  # Artifact Management
10
10
 
11
- Structured artifact trail system for documenting feature implementations. Defines what, where, and how agents produce phase outputs.
11
+ Structured artifact trail for planned, multi-phase, or materially risky implementation work. Artifacts are not a prerequisite for simple fixes or read-only investigation.
12
12
 
13
13
  ---
14
14
 
@@ -55,6 +55,13 @@ All ephemeral artifacts live in `.pantheon/memory-bank/.tmp/` — gitignored and
55
55
 
56
56
  > **Zeus does NOT generate artifacts.** He orchestrates agents that generate them.
57
57
 
58
+ ## Proportional Use
59
+
60
+ - Create PLAN/IMPL/REVIEW artifacts for planned multi-phase work or when risk, auditability, or an explicit request needs a durable phase trail.
61
+ - A bounded, reversible fix should be investigated only as far as needed, implemented, verified with focused checks, and returned as a concise summary. Do not create PLAN, IMPL, or REVIEW artifacts for it.
62
+ - Read-only lookup or trivial discovery needs no DISC artifact; use one only when findings are broad enough to be reused or drive a material decision.
63
+ - The absence of an artifact never waives Themis review or human approval for auth/security, data/schema/migrations, production-impacting work, or sensitive actions.
64
+
58
65
  ---
59
66
 
60
67
  ## Templates
@@ -103,9 +110,9 @@ All ephemeral artifacts live in `.pantheon/memory-bank/.tmp/` — gitignored and
103
110
 
104
111
  ## Human Pause Points
105
112
 
106
- 1. **After PLAN** → user reads `.tmp/PLAN-<feature>.md` and approves
107
- 2. **After REVIEW** → user reads `.tmp/REVIEW-<feature>.md` and validates focus items
108
- 3. **Before git commit** → user executes manually
113
+ 1. **After a required PLAN** → pause only when a material scope/risk decision needs approval.
114
+ 2. **After required REVIEW** → preserve auth/security/data/schema and other sensitive approval gates.
115
+ 3. **Before commit/push/merge/deploy or destructive/global action** → require explicit human approval.
109
116
 
110
117
  ---
111
118
 
@@ -18,16 +18,16 @@ Disciplined automatic continuation through multi-step tasks. Eliminates unnecess
18
18
 
19
19
  ---
20
20
 
21
- ## Mandatory Gates (ALWAYS STOP)
21
+ ## Risk-Proportional Gates
22
22
 
23
23
  | Gate | Trigger | What happens |
24
24
  |---|---|---|
25
- | **GATE 0 — Agora Gate** | Agora outputs `AWAITING_APPROVAL` OR `## 🏛️ Agora Council` synthesis block appears | **HARD STOP.** Do not call any tool, do not continue any todo, do not suggest next steps. Wait for user to type: APPROVE / REQUEST CHANGES / DISCARD. "ok", "yes", "sure", "continue" are NOT valid. |
26
- | **GATE 1 — Plan Approval** | Athena generates a plan | User confirms scope before code is written |
27
- | **GATE 2 — Phase Review** | Themis reviews implementation | User sees changes before next phase |
28
- | **GATE 3 — Git Commit** | After each phase is approved | User controls git history; no auto-commit |
25
+ | **GATE 0 — Explicit Council** | User explicitly invokes council and it returns `AWAITING_APPROVAL` | Stop and follow the approval the council requests; do not launch a council automatically for ordinary implementation. |
26
+ | **GATE 1 — Plan Approval** | A plan was requested or scope/risk makes planning necessary | Ask before implementation only when the plan introduces a material choice or risk; omit this gate for a bounded, clear fix. |
27
+ | **GATE 2 — Risk Review** | Auth/security, data/schema/migration, API contract, production configuration, or other material risk | Themis review and human approval before sensitive or irreversible action. For a trivial, isolated, reversible edit, provide a concise result instead of manufacturing a review phase. |
28
+ | **GATE 3 — Git / External Action** | Commit, push, merge, production deploy, destructive operation, global configuration, or broad permission change | Always stop for explicit human approval. Full-auto never authorizes these actions by implication. |
29
29
 
30
- > **Agora is always GATE 0**: any response containing `AWAITING_APPROVAL` or a `## 🏛️ Agora Council` block overrides all auto-continue rules.
30
+ An explicit `AWAITING_APPROVAL` from an invoked council remains a hard stop. Authentication/security and data/schema changes retain their review and approval gates even in full-auto.
31
31
 
32
32
  ---
33
33
 
@@ -36,28 +36,31 @@ Disciplined automatic continuation through multi-step tasks. Eliminates unnecess
36
36
  **Continue automatically when:**
37
37
  - Next todo is a direct consequence of the current one
38
38
  - Action is reversible (file edits, tests, linting)
39
- - Scope is within the approved plan
39
+ - Scope is within the user's explicitly authorized task (a prior plan is not required for a small clear fix)
40
40
  - No new ambiguity has emerged
41
41
 
42
42
  **Stop and ask when:**
43
43
  - A todo requires a decision not covered by the plan
44
44
  - An unexpected error changes the approach
45
45
  - A dependency is missing or broken
46
- - A task would exceed remaining `steps` budget
46
+ - Remaining context is too thin to carry the task through — write an explicit handoff instead
47
+ - The task reaches a sensitive gate in the table above; full-auto does not override it
47
48
 
48
- ---
49
+ ### Full-auto Authorization
50
+
51
+ Full-auto may continue only within a task and scope the user explicitly authorized. It may run reversible edits and proportionate verification; it must stop for auth/security, data/schema changes with risk, destructive or global changes, broad permissions, deploy, push, or merge. Never infer permission to expand the scope from a full-auto request.
49
52
 
50
53
  ---
51
54
 
52
55
  ## Implementation Pattern
53
56
 
54
57
  ```
55
- 1. Create todos for all steps at start
58
+ 1. Create todos only for multi-step work; a one-step fix needs no todo ceremony
56
59
  2. Mark first todo in_progress
57
60
  3. Complete work → mark completed immediately
58
61
  4. Mark next todo in_progress → repeat
59
62
  5. Do NOT ask "should I continue?" between clear steps
60
- 6. Stop at Gate 1, 2, or 3
63
+ 6. Stop at any applicable risk gate; do not require a plan/review gate for a low-risk edit
61
64
  7. After gate approval, resume with next todo
62
65
  ```
63
66
 
@@ -70,7 +73,7 @@ Disciplined automatic continuation through multi-step tasks. Eliminates unnecess
70
73
  - [ ] Previous step completed successfully (tests pass, no errors)
71
74
  - [ ] Next step is within approved plan scope
72
75
  - [ ] No new blocking issues emerged
73
- - [ ] `steps` counter has sufficient budget remaining
76
+ - [ ] Remaining context can carry the next step, or an explicit handoff will be written
74
77
 
75
78
  ---
76
79
 
@@ -89,9 +92,9 @@ Phase N complete. Summary:
89
92
 
90
93
  ### Cooldown Rules
91
94
  1. **Between parallel waves (no dependency):** No cooldown needed — wave results are independent
92
- 2. **Between sequential waves (with dependency):** Always run cooldown — dependencies may have changed context
93
- 3. **After Themis review (GATE 2):** Cooldown is mandatory — review findings may change the plan
94
- 4. **Session reuse check:** Before starting next phase, check if a specialist session from a previous phase can be reused (see session-goal skill)
95
+ 2. **Between sequential phases:** Summarize when dependencies or risk changed; skip ceremony for one-step work
96
+ 3. **After required Themis review:** Reassess findings before continuing
97
+ 4. **Session reuse check:** Reuse a prior specialist session only when it reduces real context duplication
95
98
 
96
99
  ### Abbreviated Cooldown
97
100
  When auto-continuing between sequential non-gated phases, the cooldown is abbreviated to one line:
@@ -104,27 +107,18 @@ Only expand to full cooldown when hitting a mandatory gate.
104
107
 
105
108
  ## Timeout & Retry Enforcement
106
109
 
107
- When a delegated agent does not respond in time, enforce the timeout policy from routing.yml.
108
-
109
- ### Behavior by Agent Role
110
-
111
- | Agent Role | Timeout | Retry Policy | Fallback | Timeout Parcial? |
112
- |------------|---------|-------------|----------|------------------|
113
- | Explorer (apollo) | 60s | 2 retries, exponential backoff | athena | ✅ Yes — partial results OK |
114
- | Implementer (hermes, aphrodite) | 180s | 3 retries, exponential backoff | talos | ❌ No — must produce artifact |
115
- | Reviewer (themis) | 120s | 2 retries, exponential backoff | zeus | ❌ No — must produce verdict |
116
- | Infrastructure (prometheus) | 300s | 2 retries, exponential backoff | hermes | ❌ No |
117
- | Hotfix (talos) | 30s | 1 retry, no backoff | hermes | ✅ Yes — one-liner fix OK |
110
+ When a delegated agent does not respond in time, enforce the timeout policy defined in
111
+ `src/instructions/zeus-timeout-retry.instructions.md`.
118
112
 
113
+ **That file is the single authority** for per-role timeouts, retry counts, fallback chains, and
114
+ whether partial results are acceptable. It is force-fed into every session via `AGENTS.md`; this
115
+ skill is opt-in. Do not restate those values here — a copy in this skill is precisely what drifted
116
+ out of sync with them. If a dispatch times out, read the role's row from the instruction file.
119
117
 
120
118
  ### Timeout Parcial (Partial Results)
121
119
 
122
- Timeout parcial is **only** allowed for read-only, independent agents:
123
- - ✅ @apollo (codebase search) — can return partial file list
124
- - ✅ @gaia (literature review) — can return partial findings
125
- - ✅ @talos (hotfix confirmation) — can return without fix if timeout
126
- - ❌ Never for implementers (@hermes, @aphrodite, @demeter) — must complete or fail
127
- - ❌ Never for reviewers (@themis) — must produce a verdict
120
+ Whether an agent may return partial results is the **Partial Results OK?** column in that table.
121
+ Only agents marked ✅ there may return partial — never implementers, never reviewers.
128
122
 
129
123
  **How to signal timeout parcial:**
130
124
  When dispatching, set the expectation explicitly:
@@ -167,69 +161,34 @@ Ready for Phase 2? Waiting for go-ahead.
167
161
  Should I now run the migration tests? [waiting]
168
162
  ```
169
163
 
170
- ## Session Heartbeat
171
-
172
- Auto-save checkpoint every N turns (configurable, default 5).
173
-
174
- ### Heartbeat File
175
-
176
- `.pantheon/deepwork/<slug>/heartbeat.json`
177
-
178
- ### Heartbeat JSON Format
179
-
180
- ```json
181
- {
182
- "slug": "task-identifier",
183
- "last_action": "2026-07-16T20:00:00Z",
184
- "turn_count": 10,
185
- "current_phase": 2,
186
- "status": "alive | warning | stalled | paused | completed",
187
- "next_action": "brief description of next planned action"
188
- }
189
- ```
190
-
191
- ### Heartbeat Rules
192
- 1. Update every 5 turns minimum (by default)
193
- 2. Contains NO context — only timestamps and counters
194
- 3. Single file, always overwritten (not versioned)
195
- 4. Used for quick "is this session alive?" checks
164
+ ## Session Heartbeat & Checkpoints
196
165
 
197
- ---
166
+ Session state is **not** file-based. It lives in **pantheon-persistence** under the
167
+ `checkpoint:<slug>` namespace and is cleaned up automatically by a 4h TTL.
198
168
 
199
- ## Checkpoint Persistence
169
+ Use checkpoints only when `context_save` and `context_get` are explicitly
170
+ present in the active session's tool list. If unavailable, do not attempt a
171
+ checkpoint or guess a session ID; carry the handoff in the normal response.
200
172
 
201
- ### Checkpoint File Structure
173
+ When available, call `context_save` with `content=JSON.stringify(state)` and an
174
+ explicit `session_id`. A successful save needs no immediate `context_get`; read
175
+ only when resuming or when the save result is uncertain. Reuse the same session
176
+ ID so the `latest` pointer survives compaction. `state` must be an object — never pass a bare string as `content`: its
177
+ `goal`/`phase`/`delegations`/`heartbeat` values are objects and `tail` is an array.
178
+ `goal` is optional; when unset, omit the key rather than passing a string placeholder.
202
179
 
203
- Each deepwork task maintains:
204
-
205
- ```
206
- .pantheon/deepwork/<slug>/
207
- ├── PLAN.md # Immutable plan (created at start)
208
- ├── STATUS.md # Human-readable current state (updated every phase)
209
- ├── heartbeat.json # Lightweight ping (updated every N turns)
210
- ├── checkpoint-<N>.json # Full state snapshot (created at phase boundaries)
211
- ├── session.json # Session metadata (created at start, updated on stop)
212
- └── REVIEW.md # Final Themis review (created at end)
213
- ```
214
-
215
- ### Checkpoint JSON Schema
216
-
217
- ```json
218
- {
219
- "slug": "string — unique task identifier",
220
- "phase": "integer — current phase number",
221
- "turn_count": "integer — total turns elapsed",
222
- "timestamp": "string — ISO 8601 timestamp",
223
- "context_hash": "string — first 8 hex chars of SHA-256 of STATUS.md",
224
- "version": "integer — schema version (current: 2)"
225
- }
226
- ```
180
+ ### Heartbeat Check
181
+ - Check heartbeat only when checkpoint tools are available and the workflow needs a durable resume.
182
+ - Write a heartbeat after anti-stall recovery only when the current session exposes checkpoint tools.
227
183
 
228
184
  ### Checkpoint Rules
229
- 1. Save at every phase boundary AND before any delegate dispatch
230
- 2. Numbered sequentially (`checkpoint-1.json`, `checkpoint-2.json`, …)
231
- 3. Keep last 10 checkpoints; archive older ones
232
- 4. On resume: read the highest-numbered checkpoint for full state
185
+ 1. Save checkpoints only for long-running/multi-phase work, context-loss risk, or substantive parallel work — not a one-off command or bounded fix
186
+ 2. Include current phase and remaining tasks when a checkpoint is warranted
187
+ 3. On resume, read the latest checkpoint only with a known session ID; otherwise request the missing handoff context.
188
+
189
+ > Do not create `heartbeat.json`, `checkpoint-<N>.json`, or `session.json` under
190
+ > `.pantheon/deepwork/`. That file-based mechanism is retired — TTL handles cleanup, and reading
191
+ > a file that nothing writes back returns stale state.
233
192
 
234
193
  ---
235
194
 
@@ -239,10 +198,10 @@ Configurable gates for different platforms and risk levels:
239
198
 
240
199
  | Gate | Default | Auto-Approval Condition |
241
200
  |------|---------|------------------------|
242
- | GATE 0 — Council/Plan | Always Ask | N/A — always requires human |
243
- | GATE 1 — Plan Approval | Always Ask | Plan matches acceptance criteria + no risks flagged |
244
- | GATE 2 — Themis Review | Ask by Default | Auto-approve if: Themis APPROVED + no CRITICAL/HIGH issues + coverage ≥80% |
245
- | GATE 3 — Git Commit | Never Auto | N/A — always manual |
201
+ | Council | Only when explicitly invoked | Never auto-start a council for ordinary implementation |
202
+ | Plan approval | Only for requested or risk-required plans | Skip for bounded, clear work |
203
+ | Themis review | Required for sensitive/material changes | May omit for trivial isolated edits; never auto-bypass required findings |
204
+ | Git / external actions | Never Auto | Commit, push, merge, deploy, destructive/global changes require explicit approval |
246
205
  | Deploy | Always Ask | N/A — always requires human |
247
206
  | Destructive DB Ops | Always Ask | N/A — always requires human |
248
207
 
@@ -255,8 +214,8 @@ auto-continue:
255
214
  idle_stall: 120 # seconds before stall detection
256
215
  idle_pause: 300 # seconds before auto-pause
257
216
  gates:
258
- plan_approval: always_ask
259
- themis_review: auto_approve_if_clean
217
+ plan_approval: when_required_by_scope_or_risk
218
+ themis_review: required_for_sensitive_or_material_changes
260
219
  git_commit: never_auto
261
220
  deploy: always_ask
262
221
  destructive_ops: always_ask
@@ -52,11 +52,11 @@ biome check --write --unsafe <files>
52
52
  - [ ] Proper file sizes (<300 lines)
53
53
 
54
54
  ### Testing
55
- - [ ] Unit tests written
56
- - [ ] Coverage ≥80%
57
- - [ ] Integration tests for workflows
58
- - [ ] Edge cases tested
59
- - [ ] Error conditions tested
55
+ - [ ] Tests cover the changed behavior where meaningful; documentation/format-only changes do not need invented tests
56
+ - [ ] Apply an explicit repository coverage threshold only when measurable and relevant to the changed code
57
+ - [ ] Integration tests where the change crosses workflow boundaries
58
+ - [ ] Relevant edge cases tested for the changed behavior/risk
59
+ - [ ] Relevant error conditions tested
60
60
 
61
61
  ### Security (OWASP Top 10)
62
62
  - [ ] Input validation present