pantheon-opencode 2.1.4 → 2.1.5
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 +6 -6
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +31 -0
- package/README.md +9 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/pyproject.toml +1 -1
- package/scripts/test-slice.mjs +34 -2
- package/skills-lock.json +1 -1
- package/src/agents/aphrodite.md +3 -1
- package/src/agents/apollo.md +1 -0
- package/src/agents/athena.md +1 -0
- package/src/agents/demeter.md +2 -0
- package/src/agents/gaia.md +1 -0
- package/src/agents/hephaestus.md +1 -0
- package/src/agents/hermes.md +2 -1
- package/src/agents/iris.md +1 -0
- package/src/agents/mnemosyne.md +1 -0
- package/src/agents/nyx.md +1 -0
- package/src/agents/prometheus.md +1 -0
- package/src/agents/talos.md +1 -0
- package/src/agents/themis.md +1 -0
- package/src/agents/zeus.md +4 -1
- package/src/instructions/test-economy.instructions.md +6 -6
- package/src/pantheon/auto-permissions.ts +4 -3
- package/src/pantheon/skill-search-tool.ts +131 -11
- package/src/pantheon/tools.ts +2 -1
- package/src/plugin/index.js +104 -15
- 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 +14 -8
package/AGENTS.global.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- pantheon:generated:begin — Pantheon-managed region; regenerated on install/upgrade, never edit inside -->
|
|
2
2
|
<!-- Generated by scripts/build-agents-md.mjs — do not edit directly. -->
|
|
3
3
|
<!-- Source of truth: src/instructions/*.instructions.md + the static sections in this script. -->
|
|
4
|
-
<!-- pantheon:agents-md v2 artifact=global generated-at=2026-11-
|
|
4
|
+
<!-- pantheon:agents-md v2 artifact=global generated-at=2026-11-14T14:44:27-03:00 sha=053433e -->
|
|
5
5
|
|
|
6
6
|
# Pantheon Agent System — OpenCode
|
|
7
7
|
|
|
@@ -90,11 +90,11 @@ Required: position, reasoning, trade_offs, risks, confidence. Optional `agreemen
|
|
|
90
90
|
|
|
91
91
|
Write one focused test per behavior; do not duplicate coverage.
|
|
92
92
|
|
|
93
|
-
- **
|
|
94
|
-
- **
|
|
95
|
-
- **Failure/Fix Loops**: Rerun ONLY failed checks; never
|
|
96
|
-
- **Mapping Gaps
|
|
97
|
-
-
|
|
93
|
+
- **Risk-Based Slicing**: Run narrowest slice (<10s) first; broaden only on cross-module, contract, auth, or DB risk.
|
|
94
|
+
- **Suite Escalation**: Full suites are for CI/release; state if execution is agent recommendation or mandatory gate.
|
|
95
|
+
- **Failure/Fix Loops**: Rerun ONLY failed checks; never repeat passing tests. Never delete tests to speed up checks.
|
|
96
|
+
- **Mapping Gaps & Receipts**: Missing tests use static check plus nearest slice; record command, duration, and pending gates.
|
|
97
|
+
- **CLI vs Code**: Run CLI binaries (`opencode-quota`, `git`, `npm`) via `shell`/`bash`, not eval; on failure, never glob `~/.config`.
|
|
98
98
|
- Test economy does NOT weaken stronger gates: auth, security, data-integrity, and required coverage.
|
|
99
99
|
|
|
100
100
|
<!-- Source: src/instructions/yagni.instructions.md -->
|
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- pantheon:generated:begin — Pantheon-managed region; regenerated on install/upgrade, never edit inside -->
|
|
2
2
|
<!-- Generated by scripts/build-agents-md.mjs — do not edit directly. -->
|
|
3
3
|
<!-- Source of truth: project sections in scripts/build-agents-md.mjs. -->
|
|
4
|
-
<!-- pantheon:agents-md v2 artifact=project generated-at=2026-11-
|
|
4
|
+
<!-- pantheon:agents-md v2 artifact=project generated-at=2026-11-14T14:44:27-03:00 sha=053433e -->
|
|
5
5
|
|
|
6
6
|
# Pantheon — Repository Setup
|
|
7
7
|
|
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
13
13
|
`node scripts/versioning.mjs apply --notes` pre-fills the generated sections from conventional commits.
|
|
14
14
|
Running apply will move this section to a versioned entry and reset the template below. -->
|
|
15
15
|
|
|
16
|
+
## [v2.1.5] - 2026-11-14
|
|
17
|
+
|
|
18
|
+
### 🆕 What's New
|
|
19
|
+
|
|
20
|
+
- **Risk-Based Validation (#444)**: Protocol distinguishes focused test slices, package suites, and mandatory repository CI gates.
|
|
21
|
+
- **Tool Execution Fallback**: Added `execute` alias executing commands via bash, preventing JS eval syntax errors on CLI commands.
|
|
22
|
+
- **CLI Execution Mandate**: Enforced CLI execution via `shell`/`bash` for binaries like `opencode-quota` with anti-panic search ban.
|
|
23
|
+
- **Scope Transparency (#444)**: `subtask_summary` explicitly reports validation scope and deferred pending repository CI pipeline gates.
|
|
24
|
+
- **Unified Skill Discovery**: Dynamic filesystem indexing of local and global skills; Zeus handoff passes explicit skill file paths.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **tools** — added `execute` fallback alias executing workspace commands and scripts via `/bin/bash` in `src/pantheon/tools.ts`.
|
|
29
|
+
- **permissions** — whitelisted `opencode-quota` in `SAFE_DEV_BINARIES` and installer bash permission rules.
|
|
30
|
+
- **skills** — added dynamic filesystem scanner for `.opencode/skills` and `.agents/skills` returning real path and scope.
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- **tests (#444)** — enhanced `test-slice.mjs` with risk escalation triggers, validation scope reporting, and pending CI gate receipts.
|
|
35
|
+
- **instructions (#444)** — updated `test-economy` and `test-slicing` with risk-based validation protocol, anti-panic rules, and CLI mandate.
|
|
36
|
+
- **agents** — updated Zeus and specialist agent prompts in `roster.json` to mandate `SKILL.md` inspection before implementation.
|
|
37
|
+
|
|
38
|
+
### ✅ Closed Issues
|
|
39
|
+
|
|
40
|
+
- #444 - define risk-based validation protocol for pantheon agents
|
|
41
|
+
|
|
42
|
+
<!-- Add new changes here.
|
|
43
|
+
Canonical sections (docs/RELEASING.md): ### 🆕 What's New (curated highlights, ≤6 bullets ≤140 chars) →
|
|
44
|
+
### Added / Changed / Deprecated / Removed / Fixed / Security → ### ⚠️ Known Issues / ### ✅ Closed Issues.
|
|
45
|
+
`node scripts/versioning.mjs apply --notes` pre-fills the generated sections from conventional commits.
|
|
46
|
+
Running apply will move this section to a versioned entry and reset the template below. -->
|
|
16
47
|
## [v2.1.4] - 2026-11-14
|
|
17
48
|
|
|
18
49
|
### 🆕 What's New
|
package/README.md
CHANGED
|
@@ -225,6 +225,15 @@ Working runnable reference projects demonstrating Pantheon orchestration in prac
|
|
|
225
225
|
|
|
226
226
|
---
|
|
227
227
|
|
|
228
|
+
## What's New in v2.1.5
|
|
229
|
+
|
|
230
|
+
- **Risk-Based Validation Protocol (#444):** Explicit multi-tier protocol distinguishing focused test slices (<10s), package integration suites, and mandatory repository CI gates. Escalation to broad suites requires explicit triggers (cross-module, breaking contracts, auth, DB migrations).
|
|
231
|
+
- **Tool Execution Resilience & Fallback:** Added `execute` fallback tool alias executing commands directly in `/bin/bash`, preventing `SyntaxError: Assigning to rvalue` when models call `execute` with CLI commands or scripts.
|
|
232
|
+
- **CLI Execution Mandate:** Enforced CLI execution via `shell`/`bash` for binaries like `opencode-quota` with an anti-panic ban on speculative recursive `glob`/`grep` in `~/.config`.
|
|
233
|
+
- **Validation Scope Transparency (#444):** `subtask_summary` observable receipts report `validation_scope` and deferred `pending_validation` repository CI pipeline gates.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
228
237
|
## What's New in v2.1.4
|
|
229
238
|
|
|
230
239
|
- **Global Install Shadowing & PATH Hygiene (#424):** Doctor check (H2b) detects multiple global binaries, dangling symlinks, and prefix skew. Version skew validation prevents `_npx` from binding to older global packages.
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon",
|
|
3
3
|
"publisher": "ils15",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.5",
|
|
5
5
|
"displayName": "Pantheon",
|
|
6
6
|
"description": "Conductor-Delegate orchestration platform with 14 specialized agents, 25 skills, and OpenCode support.",
|
|
7
7
|
"agents": "./src/agents",
|
package/pyproject.toml
CHANGED
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.backends._legacy:_Backend"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pantheon"
|
|
7
|
-
version = "2.1.
|
|
7
|
+
version = "2.1.5"
|
|
8
8
|
description = "Multi-agent orchestration framework"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
# Python sources under src/mcp/ import fastmcp/pydantic at runtime, but those
|
package/scripts/test-slice.mjs
CHANGED
|
@@ -200,6 +200,15 @@ export function mapFileToSlice(filePath, cwd = process.cwd()) {
|
|
|
200
200
|
export function resolveTestSlice(files = [], options = {}) {
|
|
201
201
|
const cwd = options.cwd || process.cwd()
|
|
202
202
|
const failedOnly = options.failedOnly
|
|
203
|
+
const trigger =
|
|
204
|
+
options.trigger ||
|
|
205
|
+
(options.crossModule
|
|
206
|
+
? 'cross-module'
|
|
207
|
+
: options.security
|
|
208
|
+
? 'security-boundary'
|
|
209
|
+
: options.migration
|
|
210
|
+
? 'schema-migration'
|
|
211
|
+
: undefined)
|
|
203
212
|
|
|
204
213
|
// Filter for relevant source or test files
|
|
205
214
|
const relevantFiles = files.filter((f) => {
|
|
@@ -207,8 +216,19 @@ export function resolveTestSlice(files = [], options = {}) {
|
|
|
207
216
|
return SOURCE_EXTENSIONS.has(ext) || TEST_EXTENSIONS.has(ext) || f.includes('.test.')
|
|
208
217
|
})
|
|
209
218
|
|
|
210
|
-
// 1. If
|
|
219
|
+
// 1. If an explicit escalation trigger is present and repo has a suite selector, escalate (Issue #444)
|
|
211
220
|
const repoScript = findRepoSliceScript(cwd)
|
|
221
|
+
if (trigger && repoScript) {
|
|
222
|
+
return {
|
|
223
|
+
command: repoScript.command,
|
|
224
|
+
type: 'package-suite-escalation',
|
|
225
|
+
selection: `package suite (escalation trigger: ${trigger})`,
|
|
226
|
+
files: relevantFiles,
|
|
227
|
+
scopeJustification: `Escalated from local slice due to ${trigger}`,
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// 2. If repo has a predefined focused script and multiple files changed, prefer it
|
|
212
232
|
if (repoScript && (relevantFiles.length === 0 || relevantFiles.length > 2)) {
|
|
213
233
|
return {
|
|
214
234
|
command: repoScript.command,
|
|
@@ -299,6 +319,16 @@ export function executeTestSlice(slicePlan, options = {}) {
|
|
|
299
319
|
const passLines = output.split('\n').filter((line) => /✔|PASS|passed/i.test(line))
|
|
300
320
|
const targets = Math.max(1, passLines.length)
|
|
301
321
|
|
|
322
|
+
const validationScope =
|
|
323
|
+
options.validationScope ||
|
|
324
|
+
(slicePlan.type === 'package-suite-escalation'
|
|
325
|
+
? 'package_suite'
|
|
326
|
+
: slicePlan.type === 'repo-selector'
|
|
327
|
+
? 'package_suite'
|
|
328
|
+
: 'focused_slice')
|
|
329
|
+
const pendingValidation =
|
|
330
|
+
options.pendingValidation || 'none (CI gates deferred to repository pipeline)'
|
|
331
|
+
|
|
302
332
|
const receipt = {
|
|
303
333
|
status: isPass ? 'PASS' : 'FAIL',
|
|
304
334
|
command: slicePlan.command,
|
|
@@ -306,11 +336,13 @@ export function executeTestSlice(slicePlan, options = {}) {
|
|
|
306
336
|
durationSec,
|
|
307
337
|
durationMs,
|
|
308
338
|
selection: slicePlan.selection,
|
|
339
|
+
validationScope,
|
|
340
|
+
pendingValidation,
|
|
309
341
|
exitCode: result.status,
|
|
310
342
|
output: isPass ? output.trim().split('\n').slice(-5).join('\n') : output,
|
|
311
343
|
}
|
|
312
344
|
|
|
313
|
-
const summaryLine = `**tests:** [${receipt.status}] \`${receipt.command}\` (targets: ${receipt.targets}, duration: ${receipt.durationSec}s, selection: ${receipt.selection})`
|
|
345
|
+
const summaryLine = `**tests:** [${receipt.status}] \`${receipt.command}\` (targets: ${receipt.targets}, duration: ${receipt.durationSec}s, selection: ${receipt.selection})\n**validation_scope:** ${validationScope}\n**pending_validation:** ${pendingValidation}`
|
|
314
346
|
|
|
315
347
|
return { ...receipt, summaryLine }
|
|
316
348
|
}
|
package/skills-lock.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"src/skills/tdd-with-agents/references/advanced-testing-patterns.md": "4aac82748bb670a61d67732168f8a265d5e66895a9183029e3da03de8e024788",
|
|
35
35
|
"src/skills/tdd-with-agents/references/testing-by-layer.md": "545291301661e57d846b2db2acca1edb1219a102dce4aad7e0c3cc1a250b570a",
|
|
36
36
|
"src/skills/tdd-with-agents/SKILL.md": "107495b0473a561dd570d2c25420329d68712776524a736ccc415171f7aa6c00",
|
|
37
|
-
"src/skills/test-slicing/SKILL.md": "
|
|
37
|
+
"src/skills/test-slicing/SKILL.md": "3d6f78719ee7d426f8082fd703c26a0433804c60fd3cd181d3a6886c4e94075b",
|
|
38
38
|
"src/skills/verification-planning/SKILL.md": "6a3c6cb5bd5076862d369885bf0b3ba086b625495fe7a42f3f5116d07b470f3e",
|
|
39
39
|
"src/skills/visual-review-pipeline/references/findings-schema.md": "776511757c0d8387fab232fced8ac9ce031a03f62b6ca539e3c38b0d45035c8e",
|
|
40
40
|
"src/skills/visual-review-pipeline/references/workflow-steps.md": "13796a32076dd4d04d37a50927169929ba44a332302bd98f72ec61482ceedc09",
|
package/src/agents/aphrodite.md
CHANGED
|
@@ -18,6 +18,7 @@ permission:
|
|
|
18
18
|
"*": deny
|
|
19
19
|
todowrite: allow
|
|
20
20
|
todoread: allow
|
|
21
|
+
execute: allow
|
|
21
22
|
mcp_tools:
|
|
22
23
|
pantheon-resources: all
|
|
23
24
|
pantheon-memory: [memory_search]
|
|
@@ -90,7 +91,8 @@ You are a frontend implementation specialist. You BUILD UI. You do NOT design ar
|
|
|
90
91
|
|
|
91
92
|
### Before Implementation
|
|
92
93
|
1. Inspect relevant component/test/API files directly using `grep`, `glob`, and `read`; when broad or unfamiliar discovery materially reduces risk, send the discovery need to Zeus for routing
|
|
93
|
-
2. Read relevant frontend standards; load `skill: visual-review-pipeline`
|
|
94
|
+
2. Read relevant frontend standards; load `skill: visual-review-pipeline`
|
|
95
|
+
3. When the handoff brief names an installed skill (or relevant project skill exists in `.opencode/skills/` or `.agents/skills/`), read its `SKILL.md` before writing code only when visual behavior changed
|
|
94
96
|
3. Plan component/data flow when scope or risk warrants it; do not require a design phase for a bounded fix
|
|
95
97
|
4. For a supplied image/screenshot, use the original reference and Zeus's visual notes as acceptance context; call `vision_describe` if the image is addressable but not directly visible. One pass per image: `vision_describe` for visual review, `vision_ocr` only when text extraction is the goal — never two vision calls on the same screenshot (each call is real gateway spend). Inspect the current state first and preserve unrelated existing work—do not delete or revert it just to match the reference unless that replacement is explicitly in scope.
|
|
96
98
|
- Investigate beyond the assigned context only when necessary to resolve the task or when broader discovery materially reduces risk; verify changed behavior proportionally to its scope and risk, using focused checks for bounded changes and broader checks only when integration boundaries or risk warrant them.
|
package/src/agents/apollo.md
CHANGED
package/src/agents/athena.md
CHANGED
package/src/agents/demeter.md
CHANGED
|
@@ -16,6 +16,7 @@ permission:
|
|
|
16
16
|
"*": deny
|
|
17
17
|
todowrite: allow
|
|
18
18
|
todoread: allow
|
|
19
|
+
execute: allow
|
|
19
20
|
mcp_tools:
|
|
20
21
|
pantheon-resources: all
|
|
21
22
|
pantheon-memory: [memory_search]
|
|
@@ -81,6 +82,7 @@ A child session has a parent and must not dispatch another Pantheon agent. Inspe
|
|
|
81
82
|
### Before Migration
|
|
82
83
|
1. Inspect relevant schema/migrations directly; ask Zeus to route any needed broad discovery to @apollo when the schema is broad or unfamiliar enough that parallel discovery reduces risk
|
|
83
84
|
2. Read the relevant model/migration context to understand relationships
|
|
85
|
+
3. When a skill is specified in the brief or exists in `.opencode/skills/` (e.g. database/ORM conventions), read its `SKILL.md` before generating migrations
|
|
84
86
|
3. Plan migration: what changes, impact on existing data, rollback strategy
|
|
85
87
|
|
|
86
88
|
### Migration Development (TDD)
|
package/src/agents/gaia.md
CHANGED
package/src/agents/hephaestus.md
CHANGED
package/src/agents/hermes.md
CHANGED
|
@@ -17,6 +17,7 @@ permission:
|
|
|
17
17
|
apollo: allow
|
|
18
18
|
todowrite: allow
|
|
19
19
|
todoread: allow
|
|
20
|
+
execute: allow
|
|
20
21
|
mcp_tools:
|
|
21
22
|
pantheon-resources: all
|
|
22
23
|
pantheon-memory: [memory_search]
|
|
@@ -163,7 +164,7 @@ See `skill: tdd-with-agents` for the full TDD cycle.
|
|
|
163
164
|
|
|
164
165
|
## Implementation & Verification Workflow
|
|
165
166
|
|
|
166
|
-
1. **Focused Context**: Inspect targeted files directly using `grep`, `glob`, and `read`.
|
|
167
|
+
1. **Focused Context**: Inspect targeted files directly using `grep`, `glob`, and `read`. When the brief specifies a skill (or a relevant project skill exists in `.opencode/skills/`), **read its `SKILL.md` first** before implementing.
|
|
167
168
|
2. **Implementation**: Implement clean async endpoints and services using Pydantic schemas, dependency injection, and parameterized queries.
|
|
168
169
|
3. **Verification**: Run focused unit tests via `bash` using test slicing (e.g. `pytest tests/test_item.py -k test_create -q --tb=short`). Never run full unbounded repository suites during implementation loops.
|
|
169
170
|
4. **Dependencies**: Use modern stdlib equivalents (`zoneinfo`, `tomllib`) where applicable; pin stable LTS versions.
|
package/src/agents/iris.md
CHANGED
package/src/agents/mnemosyne.md
CHANGED
package/src/agents/nyx.md
CHANGED
package/src/agents/prometheus.md
CHANGED
package/src/agents/talos.md
CHANGED
package/src/agents/themis.md
CHANGED
package/src/agents/zeus.md
CHANGED
|
@@ -19,6 +19,7 @@ permission:
|
|
|
19
19
|
todoread: allow
|
|
20
20
|
task:
|
|
21
21
|
"*": allow
|
|
22
|
+
execute: deny
|
|
22
23
|
mcp_tools:
|
|
23
24
|
pantheon-resources: all
|
|
24
25
|
pantheon-memory: [memory_search]
|
|
@@ -81,6 +82,7 @@ skills:
|
|
|
81
82
|
- **DO NOT invoke @athena.** DO NOT force planning or ask for plan approval on direct coding requests.
|
|
82
83
|
- **DO NOT invoke Council synthesis.** Council is reserved strictly for `/pantheon-council` or explicit multi-perspective trade-off requests.
|
|
83
84
|
- When the specialist returns, report the concise deliverable and test result directly to the user.
|
|
85
|
+
- **Skill-Informed Handoff**: When a task involves an installed skill (built-in Pantheon skill or external in `.opencode/skills/` / `.agents/skills/`), Zeus includes `Skill: <name> (Path: .opencode/skills/<name>/SKILL.md)` in the brief and instructs the specialist to read `SKILL.md` before implementation.
|
|
84
86
|
- **Asynchronous parallel subagents**: When running long test suites, heavy builds, or independent exploratory research, use `task(..., background: true)` where supported by the runtime so the main workflow does not block.
|
|
85
87
|
- **Planning via @athena is strictly gated**:
|
|
86
88
|
- ONLY invoke Athena when the user explicitly runs `/pantheon-deepwork` or explicitly requests a plan in the prompt ("plan this first", "create a plan", "planeje").
|
|
@@ -125,7 +127,7 @@ These rules are economic, measured against the 2026-11-05 usage audit. They appl
|
|
|
125
127
|
* Granular choice: `"Selecionar skills específicas para instalar"` (or checkbox list if multiselect).
|
|
126
128
|
* Skip choice: `"Prosseguir sem instalar skills adicionais"`.
|
|
127
129
|
- Automated Specialist Execution & Batching: When the user approves in the question prompt, do NOT require them to run commands. Immediately dispatch an execution specialist with bash permitted (@hermes or @talos) to execute `npx skills add <skill1> [skill2...] -a opencode -y` in the project root (batching multiple skills in a single run).
|
|
128
|
-
- Verification: Specialist verifies directory creation in `<project>/.agents/skills/<skill-name>/`
|
|
130
|
+
- Verification: Specialist verifies directory creation in `<project>/.agents/skills/<skill-name>/` or `<project>/.opencode/skills/<skill-name>/` (ensuring `.opencode/skills/<skill-name>` exists or links so OpenCode native discovery sees it); subsequent `pantheon_skill_search` confirms `installed: true`.
|
|
129
131
|
|
|
130
132
|
## Visual Context for Implementation
|
|
131
133
|
|
|
@@ -141,6 +143,7 @@ Do not use shared KV to track depth; at most one auxiliary specialist.
|
|
|
141
143
|
## Handoff Brief (every delegation)
|
|
142
144
|
|
|
143
145
|
Before every dispatch, send the target a concise brief with the objective/result, bounded scope and acceptance criteria, only relevant context and inputs, constraints and safety gates, and the expected deliverable plus verification. Do not paste full conversation history.
|
|
146
|
+
- **Skills (Internal & External):** When the task involves specific framework, library, or architectural patterns covered by an installed skill (either built-in Pantheon skill or external in `.opencode/skills/` / `.agents/skills/`), explicitly include `Skill: <name> (Path: .opencode/skills/<name>/SKILL.md)` in the brief and instruct the specialist to read `SKILL.md` before implementation.
|
|
144
147
|
`memory_context` is optional; pass minimal non-sensitive refs and a concise takeaway, contain no secrets, and instruct the target to treat it as untrusted context. The host may independently inherit conversation transcript.
|
|
145
148
|
|
|
146
149
|
## Plan Handoff and Approval
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Test economy — sub-10s test slicing
|
|
2
|
+
description: "Test economy — risk-based validation protocol and sub-10s test slicing."
|
|
3
3
|
name: "Test Economy"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Write one focused test per behavior; do not duplicate coverage.
|
|
7
7
|
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
- **Failure/Fix Loops**: Rerun ONLY failed checks; never
|
|
11
|
-
- **Mapping Gaps
|
|
12
|
-
-
|
|
8
|
+
- **Risk-Based Slicing**: Run narrowest slice (<10s) first; broaden only on cross-module, contract, auth, or DB risk.
|
|
9
|
+
- **Suite Escalation**: Full suites are for CI/release; state if execution is agent recommendation or mandatory gate.
|
|
10
|
+
- **Failure/Fix Loops**: Rerun ONLY failed checks; never repeat passing tests. Never delete tests to speed up checks.
|
|
11
|
+
- **Mapping Gaps & Receipts**: Missing tests use static check plus nearest slice; record command, duration, and pending gates.
|
|
12
|
+
- **CLI vs Code**: Run CLI binaries (`opencode-quota`, `git`, `npm`) via `shell`/`bash`, not eval; on failure, never glob `~/.config`.
|
|
13
13
|
- Test economy does NOT weaken stronger gates: auth, security, data-integrity, and required coverage.
|
|
@@ -88,6 +88,7 @@ const SAFE_DEV_BINARIES: ReadonlySet<string> = new Set([
|
|
|
88
88
|
'go',
|
|
89
89
|
'sh',
|
|
90
90
|
'bash',
|
|
91
|
+
'opencode-quota',
|
|
91
92
|
])
|
|
92
93
|
|
|
93
94
|
/** Check if a resource target points to an excluded or sensitive path (.git, node_modules, traversal). */
|
|
@@ -258,7 +259,7 @@ export function evaluateAutoPermission(
|
|
|
258
259
|
|
|
259
260
|
// 2. Read-only agents are strictly prohibited from mutating tools or shell
|
|
260
261
|
if (READ_ONLY_AGENTS.has(agent)) {
|
|
261
|
-
if (['edit', 'write', 'hashline_edit', 'bash', 'shell'].includes(action)) {
|
|
262
|
+
if (['edit', 'write', 'hashline_edit', 'bash', 'shell', 'execute'].includes(action)) {
|
|
262
263
|
event.effect = 'deny'
|
|
263
264
|
event.message = `Pantheon auto-permissions denied: read-only agent '${agent}' cannot execute mutating action '${action}'`
|
|
264
265
|
return { decision: 'deny', reason: 'read-only-role-violation' }
|
|
@@ -283,8 +284,8 @@ export function evaluateAutoPermission(
|
|
|
283
284
|
return { decision: 'allow', reason: 'safe-read-action' }
|
|
284
285
|
}
|
|
285
286
|
|
|
286
|
-
// 4. Shell commands
|
|
287
|
-
if (action === 'bash' || action === 'shell') {
|
|
287
|
+
// 4. Shell and execution commands
|
|
288
|
+
if (action === 'bash' || action === 'shell' || action === 'execute') {
|
|
288
289
|
const rawCmd =
|
|
289
290
|
Array.isArray(event.resources) && typeof event.resources[0] === 'string'
|
|
290
291
|
? event.resources[0]
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* @module pantheon/skill-search-tool
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
18
|
+
import { homedir } from 'node:os'
|
|
19
|
+
import { join } from 'node:path'
|
|
17
20
|
// @ts-expect-error scripts/skill-search.mjs is a plain Node ESM script without bundled .d.ts
|
|
18
21
|
import { searchSkillSources } from '../../scripts/skill-search.mjs'
|
|
19
22
|
import { PANTHEON_SKILL_CATALOG } from './pantheon-decision-catalog.ts'
|
|
@@ -27,6 +30,101 @@ export interface SkillSearchResult {
|
|
|
27
30
|
readonly installs?: number | null
|
|
28
31
|
readonly url?: string
|
|
29
32
|
readonly installCommand?: string | null
|
|
33
|
+
readonly path?: string | null
|
|
34
|
+
readonly scope?: 'internal' | 'project' | 'global'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InstalledSkillRecord {
|
|
38
|
+
readonly id: string
|
|
39
|
+
readonly description: string
|
|
40
|
+
readonly path: string
|
|
41
|
+
readonly scope: 'internal' | 'project' | 'global'
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function extractSkillMetadata(
|
|
45
|
+
content: string,
|
|
46
|
+
fallbackName: string,
|
|
47
|
+
): { name: string; description: string } {
|
|
48
|
+
let name = fallbackName
|
|
49
|
+
let description = ''
|
|
50
|
+
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/)
|
|
51
|
+
const yaml = fmMatch?.[1]
|
|
52
|
+
if (yaml) {
|
|
53
|
+
const nameMatch = yaml.match(/^name:\s*["']?([^"'\r\n]+)["']?/m)
|
|
54
|
+
if (nameMatch?.[1]) name = nameMatch[1].trim()
|
|
55
|
+
const descMatch = yaml.match(/^description:\s*["']?([^"'\r\n]+)["']?/m)
|
|
56
|
+
if (descMatch?.[1]) description = descMatch[1].trim()
|
|
57
|
+
}
|
|
58
|
+
if (!description) {
|
|
59
|
+
const withoutFm = content.replace(/^---\r?\n[\s\S]*?\r?\n---/, '').trim()
|
|
60
|
+
const lines = withoutFm.split('\n')
|
|
61
|
+
for (const l of lines) {
|
|
62
|
+
const trimmed = l.trim()
|
|
63
|
+
if (trimmed && !trimmed.startsWith('#')) {
|
|
64
|
+
description = trimmed.slice(0, 160)
|
|
65
|
+
break
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { name, description }
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function scanInstalledSkills(
|
|
73
|
+
cwd: string = process.cwd(),
|
|
74
|
+
): Map<string, InstalledSkillRecord> {
|
|
75
|
+
const map = new Map<string, InstalledSkillRecord>()
|
|
76
|
+
|
|
77
|
+
// 1. Built-in Pantheon catalog (internal base)
|
|
78
|
+
for (const entry of PANTHEON_SKILL_CATALOG) {
|
|
79
|
+
map.set(entry.id.toLowerCase(), {
|
|
80
|
+
id: entry.id,
|
|
81
|
+
description: entry.description,
|
|
82
|
+
path: `src/skills/${entry.id}/SKILL.md`,
|
|
83
|
+
scope: 'internal',
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const scanDir = (baseDir: string, scope: 'project' | 'global') => {
|
|
88
|
+
try {
|
|
89
|
+
if (!existsSync(baseDir)) return
|
|
90
|
+
const entries = readdirSync(baseDir, { withFileTypes: true })
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
if (!entry.isDirectory() && !entry.isSymbolicLink()) continue
|
|
93
|
+
const skillName = entry.name
|
|
94
|
+
if (skillName.startsWith('.')) continue
|
|
95
|
+
const skillMd = join(baseDir, skillName, 'SKILL.md')
|
|
96
|
+
if (existsSync(skillMd)) {
|
|
97
|
+
try {
|
|
98
|
+
const raw = readFileSync(skillMd, 'utf8')
|
|
99
|
+
const { name, description } = extractSkillMetadata(raw, skillName)
|
|
100
|
+
const id = (name || skillName).trim()
|
|
101
|
+
map.set(id.toLowerCase(), {
|
|
102
|
+
id,
|
|
103
|
+
description: description || skillName,
|
|
104
|
+
path: skillMd,
|
|
105
|
+
scope,
|
|
106
|
+
})
|
|
107
|
+
} catch {
|
|
108
|
+
// ignore unreadable files
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
} catch {
|
|
113
|
+
// ignore directory errors
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// 2. Global directories
|
|
118
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), '.config')
|
|
119
|
+
scanDir(join(xdgConfig, 'opencode', 'skills'), 'global')
|
|
120
|
+
scanDir(join(homedir(), '.agents', 'skills'), 'global')
|
|
121
|
+
|
|
122
|
+
// 3. Project directories (override global/internal)
|
|
123
|
+
scanDir(join(cwd, '.opencode', 'skills'), 'project')
|
|
124
|
+
scanDir(join(cwd, '.agents', 'skills'), 'project')
|
|
125
|
+
scanDir(join(cwd, 'skills'), 'project')
|
|
126
|
+
|
|
127
|
+
return map
|
|
30
128
|
}
|
|
31
129
|
|
|
32
130
|
export interface SkillSearchOutput {
|
|
@@ -74,7 +172,10 @@ const SKILL_SEARCH_INPUT_SCHEMA: Record<string, unknown> = {
|
|
|
74
172
|
},
|
|
75
173
|
}
|
|
76
174
|
|
|
77
|
-
export function executeSkillSearch(
|
|
175
|
+
export function executeSkillSearch(
|
|
176
|
+
input: Record<string, unknown>,
|
|
177
|
+
options: { cwd?: string } = {},
|
|
178
|
+
): SkillSearchOutput {
|
|
78
179
|
const query = typeof input.query === 'string' ? input.query.trim() : ''
|
|
79
180
|
if (query.length === 0) {
|
|
80
181
|
return { ok: false, query: '', count: 0, results: [], failures: ['query must be non-empty'] }
|
|
@@ -97,7 +198,10 @@ export function executeSkillSearch(input: Record<string, unknown>): SkillSearchO
|
|
|
97
198
|
const results: SkillSearchResult[] = []
|
|
98
199
|
const failures: string[] = []
|
|
99
200
|
|
|
100
|
-
|
|
201
|
+
const cwd = options.cwd ?? process.cwd()
|
|
202
|
+
const installedMap = scanInstalledSkills(cwd)
|
|
203
|
+
|
|
204
|
+
// 1. Tier 1: Installed skills (Pantheon catalog + local filesystem .opencode/skills and .agents/skills)
|
|
101
205
|
if (sources.has('installed')) {
|
|
102
206
|
const tokens = query
|
|
103
207
|
.toLowerCase()
|
|
@@ -105,7 +209,7 @@ export function executeSkillSearch(input: Record<string, unknown>): SkillSearchO
|
|
|
105
209
|
.filter((t) => t.length > 2)
|
|
106
210
|
|
|
107
211
|
if (tokens.length > 0) {
|
|
108
|
-
for (const entry of
|
|
212
|
+
for (const entry of installedMap.values()) {
|
|
109
213
|
const idLower = entry.id.toLowerCase()
|
|
110
214
|
const descLower = entry.description.toLowerCase()
|
|
111
215
|
const matchScore = tokens.reduce((score, t) => {
|
|
@@ -129,6 +233,8 @@ export function executeSkillSearch(input: Record<string, unknown>): SkillSearchO
|
|
|
129
233
|
installed: true,
|
|
130
234
|
installs: null,
|
|
131
235
|
installCommand: null,
|
|
236
|
+
path: entry.path,
|
|
237
|
+
scope: entry.scope,
|
|
132
238
|
})
|
|
133
239
|
}
|
|
134
240
|
}
|
|
@@ -152,15 +258,26 @@ export function executeSkillSearch(input: Record<string, unknown>): SkillSearchO
|
|
|
152
258
|
|
|
153
259
|
if (Array.isArray(extRes.entries)) {
|
|
154
260
|
for (const entry of extRes.entries) {
|
|
155
|
-
|
|
261
|
+
const bareName = (
|
|
262
|
+
entry.skill.includes('@') ? entry.skill.split('@')[1] : entry.skill
|
|
263
|
+
).toLowerCase()
|
|
264
|
+
const isInstalled =
|
|
265
|
+
installedMap.has(entry.skill.toLowerCase()) || installedMap.has(bareName)
|
|
266
|
+
const installedRecord =
|
|
267
|
+
installedMap.get(entry.skill.toLowerCase()) || installedMap.get(bareName)
|
|
268
|
+
|
|
269
|
+
const pushItem: SkillSearchResult = {
|
|
156
270
|
skill: entry.skill,
|
|
157
271
|
description: entry.skill,
|
|
158
272
|
source: entry.source as 'anthropic' | 'skills-sh' | 'github',
|
|
159
|
-
installed:
|
|
273
|
+
installed: isInstalled,
|
|
160
274
|
installs: entry.installs ?? null,
|
|
161
|
-
url: entry.url,
|
|
162
|
-
installCommand: `npx skills add ${entry.skill} -a opencode -y`,
|
|
163
|
-
|
|
275
|
+
...(entry.url ? { url: entry.url } : {}),
|
|
276
|
+
installCommand: isInstalled ? null : `npx skills add ${entry.skill} -a opencode -y`,
|
|
277
|
+
path: isInstalled && installedRecord ? installedRecord.path : null,
|
|
278
|
+
...(isInstalled && installedRecord ? { scope: installedRecord.scope } : {}),
|
|
279
|
+
}
|
|
280
|
+
results.push(pushItem)
|
|
164
281
|
}
|
|
165
282
|
}
|
|
166
283
|
} catch (err) {
|
|
@@ -186,8 +303,11 @@ export function createV2SkillSearchDefinition(): V2ToolDef {
|
|
|
186
303
|
description: TOOL_DESCRIPTION,
|
|
187
304
|
input: SKILL_SEARCH_INPUT_SCHEMA,
|
|
188
305
|
output: {},
|
|
189
|
-
execute: async (input: Record<string, unknown
|
|
190
|
-
|
|
191
|
-
|
|
306
|
+
execute: async (input: Record<string, unknown>, context?: unknown) => {
|
|
307
|
+
const cwd = (context as { directory?: string } | undefined)?.directory || process.cwd()
|
|
308
|
+
return {
|
|
309
|
+
output: JSON.stringify(executeSkillSearch(input, { cwd }), null, 2),
|
|
310
|
+
}
|
|
311
|
+
},
|
|
192
312
|
}
|
|
193
313
|
}
|
package/src/pantheon/tools.ts
CHANGED
|
@@ -567,7 +567,8 @@ const shellTool: V2ToolDef = {
|
|
|
567
567
|
input: SHELL_INPUT,
|
|
568
568
|
output: {},
|
|
569
569
|
execute: async (input, context) => {
|
|
570
|
-
const
|
|
570
|
+
const raw = (input as Record<string, unknown>) ?? {}
|
|
571
|
+
const command = String(raw.command ?? raw.cmd ?? '')
|
|
571
572
|
if (!command.trim()) {
|
|
572
573
|
return { output: '', ok: false, error: 'Command cannot be empty' }
|
|
573
574
|
}
|
package/src/plugin/index.js
CHANGED
|
@@ -51,7 +51,8 @@ var SAFE_DEV_BINARIES = /* @__PURE__ */ new Set([
|
|
|
51
51
|
"cargo",
|
|
52
52
|
"go",
|
|
53
53
|
"sh",
|
|
54
|
-
"bash"
|
|
54
|
+
"bash",
|
|
55
|
+
"opencode-quota"
|
|
55
56
|
]);
|
|
56
57
|
function isExcludedReadPath(rawPath) {
|
|
57
58
|
const trimmed = rawPath.trim();
|
|
@@ -144,7 +145,7 @@ function evaluateAutoPermission(event, options = {}) {
|
|
|
144
145
|
return { decision: "allow", reason: "pantheon-native-tool" };
|
|
145
146
|
}
|
|
146
147
|
if (READ_ONLY_AGENTS.has(agent)) {
|
|
147
|
-
if (["edit", "write", "hashline_edit", "bash", "shell"].includes(action)) {
|
|
148
|
+
if (["edit", "write", "hashline_edit", "bash", "shell", "execute"].includes(action)) {
|
|
148
149
|
event.effect = "deny";
|
|
149
150
|
event.message = `Pantheon auto-permissions denied: read-only agent '${agent}' cannot execute mutating action '${action}'`;
|
|
150
151
|
return { decision: "deny", reason: "read-only-role-violation" };
|
|
@@ -163,7 +164,7 @@ function evaluateAutoPermission(event, options = {}) {
|
|
|
163
164
|
event.effect = "allow";
|
|
164
165
|
return { decision: "allow", reason: "safe-read-action" };
|
|
165
166
|
}
|
|
166
|
-
if (action === "bash" || action === "shell") {
|
|
167
|
+
if (action === "bash" || action === "shell" || action === "execute") {
|
|
167
168
|
const rawCmd = Array.isArray(event.resources) && typeof event.resources[0] === "string" ? event.resources[0] : "";
|
|
168
169
|
if (rawCmd) {
|
|
169
170
|
if (isDangerousCommand(rawCmd)) {
|
|
@@ -13799,6 +13800,11 @@ function createModelCommand(options = {}) {
|
|
|
13799
13800
|
};
|
|
13800
13801
|
}
|
|
13801
13802
|
|
|
13803
|
+
// src/pantheon/skill-search-tool.ts
|
|
13804
|
+
import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync7 } from "node:fs";
|
|
13805
|
+
import { homedir as homedir8 } from "node:os";
|
|
13806
|
+
import { join as join18 } from "node:path";
|
|
13807
|
+
|
|
13802
13808
|
// scripts/skill-search.mjs
|
|
13803
13809
|
import { spawnSync } from "node:child_process";
|
|
13804
13810
|
import { pathToFileURL } from "node:url";
|
|
@@ -14018,6 +14024,75 @@ var invokedDirectly = process.argv[1] !== void 0 && import.meta.url === pathToFi
|
|
|
14018
14024
|
if (invokedDirectly) main();
|
|
14019
14025
|
|
|
14020
14026
|
// src/pantheon/skill-search-tool.ts
|
|
14027
|
+
function extractSkillMetadata(content, fallbackName) {
|
|
14028
|
+
let name = fallbackName;
|
|
14029
|
+
let description = "";
|
|
14030
|
+
const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
14031
|
+
const yaml = fmMatch?.[1];
|
|
14032
|
+
if (yaml) {
|
|
14033
|
+
const nameMatch = yaml.match(/^name:\s*["']?([^"'\r\n]+)["']?/m);
|
|
14034
|
+
if (nameMatch?.[1]) name = nameMatch[1].trim();
|
|
14035
|
+
const descMatch = yaml.match(/^description:\s*["']?([^"'\r\n]+)["']?/m);
|
|
14036
|
+
if (descMatch?.[1]) description = descMatch[1].trim();
|
|
14037
|
+
}
|
|
14038
|
+
if (!description) {
|
|
14039
|
+
const withoutFm = content.replace(/^---\r?\n[\s\S]*?\r?\n---/, "").trim();
|
|
14040
|
+
const lines = withoutFm.split("\n");
|
|
14041
|
+
for (const l of lines) {
|
|
14042
|
+
const trimmed = l.trim();
|
|
14043
|
+
if (trimmed && !trimmed.startsWith("#")) {
|
|
14044
|
+
description = trimmed.slice(0, 160);
|
|
14045
|
+
break;
|
|
14046
|
+
}
|
|
14047
|
+
}
|
|
14048
|
+
}
|
|
14049
|
+
return { name, description };
|
|
14050
|
+
}
|
|
14051
|
+
function scanInstalledSkills(cwd = process.cwd()) {
|
|
14052
|
+
const map = /* @__PURE__ */ new Map();
|
|
14053
|
+
for (const entry of PANTHEON_SKILL_CATALOG) {
|
|
14054
|
+
map.set(entry.id.toLowerCase(), {
|
|
14055
|
+
id: entry.id,
|
|
14056
|
+
description: entry.description,
|
|
14057
|
+
path: `src/skills/${entry.id}/SKILL.md`,
|
|
14058
|
+
scope: "internal"
|
|
14059
|
+
});
|
|
14060
|
+
}
|
|
14061
|
+
const scanDir = (baseDir, scope) => {
|
|
14062
|
+
try {
|
|
14063
|
+
if (!existsSync8(baseDir)) return;
|
|
14064
|
+
const entries = readdirSync2(baseDir, { withFileTypes: true });
|
|
14065
|
+
for (const entry of entries) {
|
|
14066
|
+
if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;
|
|
14067
|
+
const skillName = entry.name;
|
|
14068
|
+
if (skillName.startsWith(".")) continue;
|
|
14069
|
+
const skillMd = join18(baseDir, skillName, "SKILL.md");
|
|
14070
|
+
if (existsSync8(skillMd)) {
|
|
14071
|
+
try {
|
|
14072
|
+
const raw = readFileSync7(skillMd, "utf8");
|
|
14073
|
+
const { name, description } = extractSkillMetadata(raw, skillName);
|
|
14074
|
+
const id = (name || skillName).trim();
|
|
14075
|
+
map.set(id.toLowerCase(), {
|
|
14076
|
+
id,
|
|
14077
|
+
description: description || skillName,
|
|
14078
|
+
path: skillMd,
|
|
14079
|
+
scope
|
|
14080
|
+
});
|
|
14081
|
+
} catch {
|
|
14082
|
+
}
|
|
14083
|
+
}
|
|
14084
|
+
}
|
|
14085
|
+
} catch {
|
|
14086
|
+
}
|
|
14087
|
+
};
|
|
14088
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME || join18(homedir8(), ".config");
|
|
14089
|
+
scanDir(join18(xdgConfig, "opencode", "skills"), "global");
|
|
14090
|
+
scanDir(join18(homedir8(), ".agents", "skills"), "global");
|
|
14091
|
+
scanDir(join18(cwd, ".opencode", "skills"), "project");
|
|
14092
|
+
scanDir(join18(cwd, ".agents", "skills"), "project");
|
|
14093
|
+
scanDir(join18(cwd, "skills"), "project");
|
|
14094
|
+
return map;
|
|
14095
|
+
}
|
|
14021
14096
|
var TOOL_DESCRIPTION3 = "Advisory discovery tool for skills. Queries installed Pantheon skills and external registries (Anthropic catalog, skills.sh, GitHub). Returns matched skill IDs, descriptions, install counts, and provenance tiers. Zeus uses this to recommend project-scoped skills (.agents/skills/) before proactively prompting the user via the question tool.";
|
|
14022
14097
|
var SKILL_SEARCH_INPUT_SCHEMA = {
|
|
14023
14098
|
type: "object",
|
|
@@ -14047,7 +14122,7 @@ var SKILL_SEARCH_INPUT_SCHEMA = {
|
|
|
14047
14122
|
}
|
|
14048
14123
|
}
|
|
14049
14124
|
};
|
|
14050
|
-
function executeSkillSearch(input) {
|
|
14125
|
+
function executeSkillSearch(input, options = {}) {
|
|
14051
14126
|
const query = typeof input.query === "string" ? input.query.trim() : "";
|
|
14052
14127
|
if (query.length === 0) {
|
|
14053
14128
|
return { ok: false, query: "", count: 0, results: [], failures: ["query must be non-empty"] };
|
|
@@ -14063,10 +14138,12 @@ function executeSkillSearch(input) {
|
|
|
14063
14138
|
);
|
|
14064
14139
|
const results = [];
|
|
14065
14140
|
const failures = [];
|
|
14141
|
+
const cwd = options.cwd ?? process.cwd();
|
|
14142
|
+
const installedMap = scanInstalledSkills(cwd);
|
|
14066
14143
|
if (sources.has("installed")) {
|
|
14067
14144
|
const tokens = query.toLowerCase().split(/[^a-z0-9]+/).filter((t) => t.length > 2);
|
|
14068
14145
|
if (tokens.length > 0) {
|
|
14069
|
-
for (const entry of
|
|
14146
|
+
for (const entry of installedMap.values()) {
|
|
14070
14147
|
const idLower = entry.id.toLowerCase();
|
|
14071
14148
|
const descLower = entry.description.toLowerCase();
|
|
14072
14149
|
const matchScore = tokens.reduce((score, t) => {
|
|
@@ -14080,7 +14157,9 @@ function executeSkillSearch(input) {
|
|
|
14080
14157
|
source: "installed",
|
|
14081
14158
|
installed: true,
|
|
14082
14159
|
installs: null,
|
|
14083
|
-
installCommand: null
|
|
14160
|
+
installCommand: null,
|
|
14161
|
+
path: entry.path,
|
|
14162
|
+
scope: entry.scope
|
|
14084
14163
|
});
|
|
14085
14164
|
}
|
|
14086
14165
|
}
|
|
@@ -14099,15 +14178,21 @@ function executeSkillSearch(input) {
|
|
|
14099
14178
|
}
|
|
14100
14179
|
if (Array.isArray(extRes.entries)) {
|
|
14101
14180
|
for (const entry of extRes.entries) {
|
|
14102
|
-
|
|
14181
|
+
const bareName = (entry.skill.includes("@") ? entry.skill.split("@")[1] : entry.skill).toLowerCase();
|
|
14182
|
+
const isInstalled = installedMap.has(entry.skill.toLowerCase()) || installedMap.has(bareName);
|
|
14183
|
+
const installedRecord = installedMap.get(entry.skill.toLowerCase()) || installedMap.get(bareName);
|
|
14184
|
+
const pushItem = {
|
|
14103
14185
|
skill: entry.skill,
|
|
14104
14186
|
description: entry.skill,
|
|
14105
14187
|
source: entry.source,
|
|
14106
|
-
installed:
|
|
14188
|
+
installed: isInstalled,
|
|
14107
14189
|
installs: entry.installs ?? null,
|
|
14108
|
-
url: entry.url,
|
|
14109
|
-
installCommand: `npx skills add ${entry.skill} -a opencode -y
|
|
14110
|
-
|
|
14190
|
+
...entry.url ? { url: entry.url } : {},
|
|
14191
|
+
installCommand: isInstalled ? null : `npx skills add ${entry.skill} -a opencode -y`,
|
|
14192
|
+
path: isInstalled && installedRecord ? installedRecord.path : null,
|
|
14193
|
+
...isInstalled && installedRecord ? { scope: installedRecord.scope } : {}
|
|
14194
|
+
};
|
|
14195
|
+
results.push(pushItem);
|
|
14111
14196
|
}
|
|
14112
14197
|
}
|
|
14113
14198
|
} catch (err) {
|
|
@@ -14131,9 +14216,12 @@ function createV2SkillSearchDefinition() {
|
|
|
14131
14216
|
description: TOOL_DESCRIPTION3,
|
|
14132
14217
|
input: SKILL_SEARCH_INPUT_SCHEMA,
|
|
14133
14218
|
output: {},
|
|
14134
|
-
execute: async (input) =>
|
|
14135
|
-
|
|
14136
|
-
|
|
14219
|
+
execute: async (input, context) => {
|
|
14220
|
+
const cwd = context?.directory || process.cwd();
|
|
14221
|
+
return {
|
|
14222
|
+
output: JSON.stringify(executeSkillSearch(input, { cwd }), null, 2)
|
|
14223
|
+
};
|
|
14224
|
+
}
|
|
14137
14225
|
};
|
|
14138
14226
|
}
|
|
14139
14227
|
|
|
@@ -14452,7 +14540,8 @@ var shellTool = {
|
|
|
14452
14540
|
input: SHELL_INPUT,
|
|
14453
14541
|
output: {},
|
|
14454
14542
|
execute: async (input, context) => {
|
|
14455
|
-
const
|
|
14543
|
+
const raw = input ?? {};
|
|
14544
|
+
const command = String(raw.command ?? raw.cmd ?? "");
|
|
14456
14545
|
if (!command.trim()) {
|
|
14457
14546
|
return { output: "", ok: false, error: "Command cannot be empty" };
|
|
14458
14547
|
}
|
|
@@ -2062,7 +2062,7 @@ async function readChangelogForBundle(bundleUrl) {
|
|
|
2062
2062
|
}
|
|
2063
2063
|
/** The ambient build-time version, or null outside a tsdown build. */
|
|
2064
2064
|
function embeddedVersion() {
|
|
2065
|
-
return "2.1.
|
|
2065
|
+
return "2.1.5";
|
|
2066
2066
|
}
|
|
2067
2067
|
/**
|
|
2068
2068
|
* Resolve the running Pantheon version for the what's-new window: the plugin
|
|
@@ -2287,7 +2287,7 @@ function persistUpdateCheckState(previous, latest) {
|
|
|
2287
2287
|
} catch {}
|
|
2288
2288
|
}
|
|
2289
2289
|
function resolveRunningVersion() {
|
|
2290
|
-
return "2.1.
|
|
2290
|
+
return "2.1.5";
|
|
2291
2291
|
}
|
|
2292
2292
|
const VALUE_WIDTH = 24;
|
|
2293
2293
|
function SettingsWindow(props) {
|
|
@@ -6513,7 +6513,7 @@ async function checkForPantheonUpdate(context) {
|
|
|
6513
6513
|
const latest = String((await response.json())?.version ?? "");
|
|
6514
6514
|
if (!latest) return;
|
|
6515
6515
|
const notice = pickUpdateNotice({
|
|
6516
|
-
currentVersion: "2.1.
|
|
6516
|
+
currentVersion: "2.1.5",
|
|
6517
6517
|
latestVersion: latest,
|
|
6518
6518
|
state: readState(),
|
|
6519
6519
|
nowMs: Date.now()
|
|
@@ -7325,7 +7325,7 @@ function Sidebar(props) {
|
|
|
7325
7325
|
get children() {
|
|
7326
7326
|
var _el$13 = createElement("text");
|
|
7327
7327
|
setProp(_el$13, "attributes", 1);
|
|
7328
|
-
insert(_el$13, `Pantheon v2.1.
|
|
7328
|
+
insert(_el$13, `Pantheon v2.1.5`);
|
|
7329
7329
|
effect((_$p) => setProp(_el$13, "fg", text(), _$p));
|
|
7330
7330
|
return _el$13;
|
|
7331
7331
|
}
|
|
@@ -8097,7 +8097,7 @@ function HomeStatus(props) {
|
|
|
8097
8097
|
},
|
|
8098
8098
|
get children() {
|
|
8099
8099
|
var _el$73 = createElement("text");
|
|
8100
|
-
insert(_el$73, () => `Pantheon v2.1.
|
|
8100
|
+
insert(_el$73, () => `Pantheon v2.1.5${preset().name ? ` ▸ ${preset().name}` : ""}`);
|
|
8101
8101
|
effect((_$p) => setProp(_el$73, "fg", muted(), _$p));
|
|
8102
8102
|
return _el$73;
|
|
8103
8103
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pantheon-tui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pantheon-tui",
|
|
9
|
-
"version": "2.1.
|
|
9
|
+
"version": "2.1.5",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@opencode/plugin": "2.0.26",
|
|
@@ -19,13 +19,18 @@ Always prefer the repository's own focused selector or diff-aware command over g
|
|
|
19
19
|
2. If a project-defined focused selector exists, execute it directly.
|
|
20
20
|
3. If absent, map the modified file directly to its corresponding test file.
|
|
21
21
|
|
|
22
|
-
### 2. Scope Escalation &
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
25
|
-
|
|
22
|
+
### 2. Scope Escalation & Risk-Based Protocol (Issue #444)
|
|
23
|
+
- **Focused Slice First:** Identify affected files/behaviors and run the narrowest slice (<10s).
|
|
24
|
+
- **Triggers for Package-Level Expansion:** Broaden beyond the local slice ONLY when changes:
|
|
25
|
+
1. Cross module/package boundaries
|
|
26
|
+
2. Alter public API/contracts or data schemas/migrations
|
|
27
|
+
3. Touch authentication, authorization, or security boundaries
|
|
28
|
+
- **Broad Suite Distinction:** When running a broad suite, state explicitly whether it is an agent recommendation or a mandatory repository/CI gate.
|
|
29
|
+
- **Never Delete Tests to Speed Up:** Propose test removal only with concrete evidence of duplication, flakiness, or zero detection value.
|
|
30
|
+
- **CLI vs Code Execution:** Execute CLI binaries (`opencode-quota`, `git`, `npm`, `pytest`) via `shell`/`bash`, never JS eval (`execute`); on failure, never glob `~/.config`.
|
|
26
31
|
- **Mapping Gap Handling:** If a modified file has no direct test counterpart:
|
|
27
32
|
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
|
|
33
|
+
2. Execute a bounded risk-appropriate fallback (static lint/typecheck gate plus closest slice).
|
|
29
34
|
3. DO NOT escalate to running the entire repository test suite.
|
|
30
35
|
|
|
31
36
|
### 3. Failure/Fix Loop (Rerun Only Failed Tests)
|
|
@@ -36,11 +41,12 @@ Always prefer the repository's own focused selector or diff-aware command over g
|
|
|
36
41
|
3. **DO NOT rerun checks that already passed** when their covered code did not change.
|
|
37
42
|
4. Once the targeted test passes, rerun the single slice file once to confirm no regressions within the file.
|
|
38
43
|
|
|
39
|
-
### 4. Observable Task Receipt Summary
|
|
40
|
-
Every implementation specialist MUST include the detailed test receipt in
|
|
44
|
+
### 4. Observable Task Receipt Summary (Issue #444)
|
|
45
|
+
Every implementation specialist MUST include the detailed test receipt in `subtask_summary`, distinguishing agent-executed tests from CI gates and pending validations:
|
|
41
46
|
```markdown
|
|
42
47
|
**tests:** [PASS | WARN | FAIL] `<command>` (targets: N, duration: <X>s, selection: <reason or repo selector>)
|
|
43
|
-
**
|
|
48
|
+
**validation_scope:** focused_slice | package_suite | ci_gate_required
|
|
49
|
+
**pending_validation:** none | [deferred broad suites / CI gates]
|
|
44
50
|
```
|
|
45
51
|
*Example:*
|
|
46
52
|
`**tests:** [PASS] npx tsx tests/pantheon/auto-permissions.test.ts (targets: 10, duration: 0.12s, selection: direct file slice for auto-permissions.ts)`
|