pantheon-opencode 2.1.2 → 2.1.4
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/AGENTS.global.md +7 -7
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +77 -0
- package/README.md +10 -0
- package/package.json +7 -4
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/build-plugin.mjs +35 -9
- package/scripts/build-roster.mjs +139 -0
- package/scripts/doctor.mjs +111 -2
- package/scripts/install/opencode.mjs +16 -0
- package/scripts/sync-tui.mjs +2 -0
- package/scripts/test-slice.mjs +352 -0
- package/skills-lock.json +1 -1
- package/src/agents/aphrodite.md +8 -6
- package/src/agents/apollo.md +9 -7
- package/src/agents/athena.md +21 -18
- package/src/agents/demeter.md +7 -5
- package/src/agents/gaia.md +7 -8
- package/src/agents/hephaestus.md +7 -5
- package/src/agents/hermes.md +20 -16
- package/src/agents/iris.md +10 -8
- package/src/agents/mnemosyne.md +17 -19
- package/src/agents/nyx.md +7 -5
- package/src/agents/prometheus.md +7 -5
- package/src/agents/talos.md +11 -5
- package/src/agents/themis.md +11 -4
- package/src/agents/zeus.md +23 -2
- package/src/instructions/agent-return-format.instructions.md +1 -1
- package/src/instructions/test-economy.instructions.md +6 -6
- package/src/mcp/pantheon_vision.py +24 -0
- package/src/pantheon/auto-permissions.ts +328 -0
- package/src/pantheon/deepwork/deepwork-tool.ts +14 -0
- package/src/pantheon/delegation-enforce.ts +43 -12
- package/src/pantheon/native-vision.ts +54 -2
- package/src/pantheon/tools.ts +102 -3
- package/src/plugin/index.js +342 -16
- package/src/plugin.ts +7 -0
- package/src/plugins/tui/dist/tui.js +5 -5
- package/src/plugins/tui/package-lock.json +2 -2
- package/src/plugins/tui/package.json +1 -1
- package/src/skills/test-slicing/SKILL.md +44 -15
|
@@ -3,20 +3,51 @@ name: test-slicing
|
|
|
3
3
|
description: "Targeted test execution — map changed files directly to their narrow test slice instead of running full suites."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Test Slicing
|
|
6
|
+
# Test Slicing (Observable & Enforceable)
|
|
7
7
|
|
|
8
|
-
> **Never run
|
|
8
|
+
> **Never run unconstrained repository-wide test suites for isolated edits. Map modified files directly to their narrow, sub-10s test slice to eliminate test fatigue, conserve tokens, and maintain high developer velocity.**
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Core Rules & Protocol (Issue #437)
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
### 1. Repository-First Selector Discovery
|
|
15
|
+
Always prefer the repository's own focused selector or diff-aware command over guessing paths:
|
|
16
|
+
1. Inspect `package.json` / `pyproject.toml` / `Makefile` for focused slice runners:
|
|
17
|
+
- Node/TypeScript: `npm run test:quick`, `npm run test:slice`, `npm run test:fast`, `node scripts/test-slice.mjs`
|
|
18
|
+
- Python: `pytest -k <selector>`, `pytest tests/test_<slice>.py`
|
|
19
|
+
2. If a project-defined focused selector exists, execute it directly.
|
|
20
|
+
3. If absent, map the modified file directly to its corresponding test file.
|
|
21
|
+
|
|
22
|
+
### 2. Scope Escalation & Mapping Gap Protocol
|
|
23
|
+
- **No Silent Escalation:** NEVER silently broaden a test run from a modified file to an entire package or global suite.
|
|
24
|
+
- **Explicit Justification:** If an expansion beyond the narrow slice is genuinely warranted (e.g. cross-cutting auth change, schema migration affecting multiple handlers), state visibly before running:
|
|
25
|
+
`[Test Scope Expansion] Scope: <files> | Selected: <tests> | Reason: <concrete risk/integration rationale>`
|
|
26
|
+
- **Mapping Gap Handling:** If a modified file has no direct test counterpart:
|
|
27
|
+
1. Report the mapping gap explicitly: `[Test Mapping Gap] No direct test file for <file>.`
|
|
28
|
+
2. Execute a bounded risk-appropriate fallback (static lint/typecheck gate e.g. `npx biome check <file>` or `ruff check <file>` plus the closest integration slice).
|
|
29
|
+
3. DO NOT escalate to running the entire repository test suite.
|
|
30
|
+
|
|
31
|
+
### 3. Failure/Fix Loop (Rerun Only Failed Tests)
|
|
32
|
+
- After an initial edit, run only the selected slice.
|
|
33
|
+
- When an assertion or test fails:
|
|
34
|
+
1. Diagnose and apply the fix to the target file.
|
|
35
|
+
2. **Rerun ONLY the failed test** (e.g. `pytest tests/test_foo.py -k <failing_func>` or `node --test tests/foo.test.mjs --test-name-pattern="<failing_test>"`).
|
|
36
|
+
3. **DO NOT rerun checks that already passed** when their covered code did not change.
|
|
37
|
+
4. Once the targeted test passes, rerun the single slice file once to confirm no regressions within the file.
|
|
38
|
+
|
|
39
|
+
### 4. Observable Task Receipt Summary
|
|
40
|
+
Every implementation specialist MUST include the detailed test receipt in the `subtask_summary`:
|
|
41
|
+
```markdown
|
|
42
|
+
**tests:** [PASS | WARN | FAIL] `<command>` (targets: N, duration: <X>s, selection: <reason or repo selector>)
|
|
43
|
+
**test_scope_justification:** <required ONLY if broader than a focused slice>
|
|
44
|
+
```
|
|
45
|
+
*Example:*
|
|
46
|
+
`**tests:** [PASS] npx tsx tests/pantheon/auto-permissions.test.ts (targets: 10, duration: 0.12s, selection: direct file slice for auto-permissions.ts)`
|
|
47
|
+
|
|
48
|
+
### 5. Preserving CI and Release Gates
|
|
49
|
+
- Full-suite checks (`npm test`, unconstrained `pytest`, full CI pipelines) remain required and intact for release gates and PR validations.
|
|
50
|
+
- Developer loops run narrow slices exclusively.
|
|
20
51
|
|
|
21
52
|
---
|
|
22
53
|
|
|
@@ -25,6 +56,7 @@ description: "Targeted test execution — map changed files directly to their na
|
|
|
25
56
|
| Runtime / Framework | Changed Source File | Sliced Test Command |
|
|
26
57
|
|---|---|---|
|
|
27
58
|
| **Node.js (Built-in test runner)** | `src/foo.ts` / `src/foo.js` | `node --test tests/foo.test.mjs` (or `npm test -- tests/foo.test.mjs`) |
|
|
59
|
+
| **Pantheon Engine** | `src/pantheon/<module>.ts` | `npx tsx tests/pantheon/<module>.test.ts` or `npm run test:quick` |
|
|
28
60
|
| **Vitest** | `src/components/Button.tsx` | `npx vitest run src/components/Button.test.tsx` |
|
|
29
61
|
| **Jest** | `src/utils/calc.ts` | `npx jest src/utils/calc.test.ts` |
|
|
30
62
|
| **Pytest** | `src/service/auth.py` | `pytest tests/test_auth.py -k <test_func>` |
|
|
@@ -34,21 +66,18 @@ description: "Targeted test execution — map changed files directly to their na
|
|
|
34
66
|
|
|
35
67
|
## Lint-First Fast Gate (< 50ms)
|
|
36
68
|
|
|
37
|
-
Before launching the test runner
|
|
69
|
+
Before launching the test runner, run a static syntax/linter check on the modified file:
|
|
38
70
|
- **Python:** `ruff check <file>` (~20ms)
|
|
39
71
|
- **TypeScript / JavaScript:** `npx biome check <file>` (~30ms) or `tsc --noEmit`
|
|
40
72
|
|
|
41
|
-
Catching syntax errors, missing imports, and broken brackets at the lint gate saves
|
|
73
|
+
Catching syntax errors, missing imports, and broken brackets at the lint gate saves test loop latency and avoids test runner crashes.
|
|
42
74
|
|
|
43
75
|
---
|
|
44
76
|
|
|
45
77
|
## Execution Guardrails
|
|
46
78
|
|
|
47
79
|
1. **Timeout Budget:** A sliced check must complete in < 10 seconds. If a test hangs or takes > 30s, abort immediately and check background task/locks.
|
|
48
|
-
2. **Failure Isolation:**
|
|
49
|
-
- Read the exact assertion failure and stack trace.
|
|
50
|
-
- Do NOT run unrelated test suites hoping for clues.
|
|
51
|
-
- Fix the targeted failure and re-run only the failing slice.
|
|
80
|
+
2. **Failure Isolation:** Read the exact assertion failure and stack trace. Do NOT run unrelated test suites hoping for clues.
|
|
52
81
|
3. **No Flaky Re-runs:** Do not blindly re-run the same failing test in a loop without inspecting code or diffs.
|
|
53
82
|
4. **Token Economy:** Pass flags that suppress noise:
|
|
54
83
|
- Node: `node --test tests/foo.test.mjs` (clean output).
|