pantheon-opencode 2.1.1 → 2.1.3

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 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-13T10:55:59-03:00 sha=7d3bb91 -->
4
+ <!-- pantheon:agents-md v2 artifact=global generated-at=2026-11-14T10:35:21-03:00 sha=0200775 -->
5
5
 
6
6
  # Pantheon Agent System — OpenCode
7
7
 
@@ -37,7 +37,7 @@ All agents check each result against the request and evidence; remove unrelated
37
37
  ## subtask_summary
38
38
  **files_changed:** [list of file paths, one per line]
39
39
  **summary:** What was done, in 2-3 sentences
40
- **tests:** [PASS] All passing / [WARN] X failing / [FAIL] Not run (reason)
40
+ **tests:** [PASS | WARN | FAIL] `<command>` (targets: N, duration: <X>s, selection: <reason>)
41
41
  **coverage:** X% (if applicable)
42
42
  **tokens:** ~N input / ~M output (estimated)
43
43
  **status:** complete | partial (reason) | escalated (reason)
@@ -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
- - Prefer unit/integration checks; use E2E, install, or network tests only when a change affects that path.
94
- - Avoid assertions on copy/formatting or tests that merely restate the implementation.
95
- - Default to focused tests; run the full suite only for scope, risk, or CI/release gates. Bug fixes need one regression test unless existing coverage catches them.
96
- - Test slicing: In dev loops, run ONLY the test slice for the changed file (`node --test tests/foo.test.mjs`, `pytest -k <func>`); avoid full suites.
97
- - Keep slow install/E2E suites opt-in, never per edit or phase; reserve them for release gates.
93
+ - **Test Slicing**: In dev loops, run ONLY the narrowest slice (<10s) for changed code (`node --test <slice>`, `pytest -k`); avoid unconstrained suites.
94
+ - **Repo Selector & Receipt**: Prefer repo selectors (`test:quick`, `test:slice`); record command, targets, duration, and selection reason in `subtask_summary`.
95
+ - **Failure/Fix Loops**: Rerun ONLY failed checks; never rerun passing tests without code changes.
96
+ - **Mapping Gaps**: If a file lacks tests, run static check fallback plus nearest slice.
97
+ - Slow install/E2E suites are opt-in, never per edit; reserve for release gates.
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-13T10:55:59-03:00 sha=7d3bb91 -->
4
+ <!-- pantheon:agents-md v2 artifact=project generated-at=2026-11-14T10:35:21-03:00 sha=0200775 -->
5
5
 
6
6
  # Pantheon — Repository Setup
7
7
 
package/CHANGELOG.md CHANGED
@@ -13,6 +13,53 @@ 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.3] - 2026-11-14
17
+
18
+ ### 🆕 What's New
19
+
20
+ - **Enforceable Test Slicing (#437)**: Added `test:slice` with selector discovery, duration tracking, and loop interception.
21
+ - **Workspace Auto-Permissions**: Scope governance auto-approves safe commands while preserving strict security boundaries.
22
+ - **Complete Todo Suite**: Activated `todoread` alongside `todowrite` with real-time TUI sidebar synchronization.
23
+ - **Declarative Agent Roster**: Centralized manifest `src/agents/roster.json` mechanically compiling all 14 specialist prompts.
24
+ - **Runtime Bug Fixes**: Added `shell` tool alias for OpenCode `bash` and removed wildcard restrictions in `zeusReadGuard`.
25
+
26
+ ### Added
27
+
28
+ - **skills** — upgraded `test-slicing` skill with repo-first selector discovery, scope escalation protocol, failure/fix loop rules, and observable task receipts.
29
+ - **scripts** — added `scripts/test-slice.mjs` CLI (`npm run test:slice`) and `scripts/build-roster.mjs` compiler (`npm run build:roster`, `npm run check:roster`).
30
+ - **pantheon** — added `shell` execution tool alias and `todoread` session tool with status filtering in `src/pantheon/tools.ts`.
31
+ - **auto-permissions** — added `src/pantheon/auto-permissions.ts` with unconstrained test suite interception (`isUnconstrainedTestSuite`).
32
+
33
+ ### Changed
34
+
35
+ - **agents** — synchronized all 14 agent prompts from typed `src/agents/roster.json` manifest.
36
+ - **instructions** — updated `test-economy.instructions.md` and `agent-return-format.instructions.md` to require observable test execution receipts.
37
+ - **roadmap** — updated `ROADMAP.md` reflecting 2.1.3 active deliveries and 2.2.0 horizons.
38
+
39
+ ### Fixed
40
+
41
+ - **tools** — added `shell` tool alias in V2 tools to eliminate `No tool named "shell" is currently available`.
42
+ - **guards** — replaced `hasGlobMeta` with semantic `isDeniedGlobPattern` in `zeusReadGuard` to allow `glob("*")` and `glob("**/package.json")` while strictly defending code roots.
43
+ ## [v2.1.2] - 2026-11-14
44
+
45
+ ### 🆕 What's New
46
+
47
+ - **Search & Worktree Freedom**: Removed search and read limits on .pantheon and active worktrees across Apollo, Themis, Athena, and Zeus.
48
+ - **Bilingual Portal & SVG Diagrams**: Added native EN/PT-BR language switcher and interactive Mermaid SVG diagram rendering to documentation.
49
+ - **Overhauled Quick Start**: Clarified Council vs Deepwork command roles, Fast-Track bypass, and interactive question gate in EN and PT-BR.
50
+
51
+ ### Added
52
+
53
+ - **docs** — added `pt-BR/COMPATIBILITY.md`, expanded `pt-BR/INSTALLATION.md` with CLI flag matrix and flowchart, and expanded `cookbook.md` to 12 practical recipes in EN and PT-BR.
54
+
55
+ ### Changed
56
+
57
+ - **docs** — revised Quick Start in EN and PT-BR with accurate routing, Fast-Track vs Deepwork distinction, native question gate flow, and Mermaid execution lifecycle diagrams.
58
+
59
+ ### Fixed
60
+
61
+ - **agents** — removed all search and read restrictions on the `.pantheon/` folder and active worktrees in `@apollo`, `@themis`, `@athena`, and `@zeus`, excluding only `.git` and `node_modules`.
62
+
16
63
  ## [v2.1.1] - 2026-11-13
17
64
 
18
65
  ### 🆕 What's New
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantheon-opencode",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Multi-agent orchestration for OpenCode \u2014 14 specialized agents, TDD, Themis review gates.",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -19,6 +19,8 @@
19
19
  "prepare": "git rev-parse --is-inside-work-tree >/dev/null 2>&1 && husky",
20
20
  "setup": "node scripts/setup.mjs",
21
21
  "build:agents-md": "node scripts/build-agents-md.mjs",
22
+ "build:roster": "node scripts/build-roster.mjs",
23
+ "check:roster": "node scripts/build-roster.mjs --check",
22
24
  "build:decision-router": "node scripts/build-decision-router.mjs",
23
25
  "build:plugin": "node scripts/build-plugin.mjs",
24
26
  "check:decision-router": "node scripts/build-decision-router.mjs --check",
@@ -29,8 +31,8 @@
29
31
  "init": "node bin/pantheon-init.mjs init --yes",
30
32
  "opencode": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
31
33
  "start": "OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true opencode",
32
- "prepack": "npm run build:plugin && npm run check:decision-router",
33
- "prepublishOnly": "node scripts/validate-routing.mjs && npm run build:plugin && npm run check:decision-router",
34
+ "prepack": "npm run build:plugin && npm run check:decision-router && npm run check:roster",
35
+ "prepublishOnly": "node scripts/validate-routing.mjs && npm run build:plugin && npm run check:decision-router && npm run check:roster",
34
36
  "postpublish": "node -e \"console.log('\u2705 Published pantheon-opencode v' + require('./package.json').version + ' to npm')\"",
35
37
  "version:status": "node scripts/versioning.mjs status",
36
38
  "version:apply": "node scripts/versioning.mjs apply",
@@ -49,7 +51,8 @@
49
51
  "hooks:install": "pre-commit install",
50
52
  "hooks:update": "pre-commit autoupdate",
51
53
  "test:security": "npm run secret-scan",
52
- "test:quick": "node --test tests/skill-decision-proactive.test.mjs tests/plan-visibility-contract.test.mjs tests/proportional-execution-contract.test.mjs tests/memory-delegation-prompt.test.mjs tests/tui-settings-draft.test.mjs tests/tui-settings-i18n.test.mjs",
54
+ "test:quick": "node --test tests/skill-decision-proactive.test.mjs tests/plan-visibility-contract.test.mjs tests/proportional-execution-contract.test.mjs tests/memory-delegation-prompt.test.mjs tests/tui-settings-draft.test.mjs tests/tui-settings-i18n.test.mjs tests/test-slicing-contract.test.mjs",
55
+ "test:slice": "node scripts/test-slice.mjs",
53
56
  "test:node": "node scripts/run-node-tests.mjs --label 'test:node' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs' 'tests/eval/*.mjs'",
54
57
  "test:install": "PANTHEON_RUN_INSTALL_TESTS=1 node scripts/run-node-tests.mjs --label 'test:install' 'tests/install-opencode.test.mjs' 'tests/install-e2e.test.mjs'",
55
58
  "coverage": "echo 'Node coverage (report-only, NO threshold is enforced).' && echo 'Covers: the .mjs/.js modules under scripts/, src/ and bin/ that test:node exercises.' && echo 'Does NOT cover: test:ts (hand-rolled tsx loop, no node --test runner) and test:ci (pytest).' && echo ' TypeScript under src/ (41 files) is therefore entirely unmeasured here.' && echo '' && node scripts/run-node-tests.mjs --label 'coverage' --exclude 'tests/install-opencode.test.mjs' --exclude 'tests/install-e2e.test.mjs' -- --experimental-test-coverage --test-coverage-include='scripts/**/*.mjs' --test-coverage-include='src/**/*.mjs' --test-coverage-include='src/**/*.js' --test-coverage-include='bin/**/*.mjs' 'tests/*.mjs' 'tests/pantheon/*.mjs'",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pantheon",
3
3
  "publisher": "ils15",
4
- "version": "2.1.1",
4
+ "version": "2.1.3",
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.1"
7
+ version = "2.1.3"
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
@@ -7,20 +7,46 @@
7
7
  * without triggering ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING on Node 22+.
8
8
  */
9
9
 
10
+ import { execFileSync } from 'node:child_process'
11
+ import { existsSync } from 'node:fs'
10
12
  import { dirname, join } from 'node:path'
11
13
  import { fileURLToPath } from 'node:url'
12
- import { buildSync } from 'esbuild'
13
14
 
14
15
  const __dirname = dirname(fileURLToPath(import.meta.url))
15
16
  const root = join(__dirname, '..')
17
+ const entry = join(root, 'src', 'plugin.ts')
18
+ const outfile = join(root, 'src', 'plugin', 'index.js')
16
19
 
17
- buildSync({
18
- entryPoints: [join(root, 'src', 'plugin.ts')],
19
- outfile: join(root, 'src', 'plugin', 'index.js'),
20
- bundle: true,
21
- platform: 'node',
22
- format: 'esm',
23
- packages: 'external',
24
- })
20
+ let built = false
21
+ try {
22
+ const { buildSync } = await import('esbuild')
23
+ buildSync({
24
+ entryPoints: [entry],
25
+ outfile,
26
+ bundle: true,
27
+ platform: 'node',
28
+ format: 'esm',
29
+ packages: 'external',
30
+ })
31
+ built = true
32
+ } catch {
33
+ // Fallback to local node_modules binary
34
+ const localBin = join(root, 'node_modules', '.bin', 'esbuild')
35
+ if (existsSync(localBin)) {
36
+ execFileSync(localBin, [
37
+ entry,
38
+ `--outfile=${outfile}`,
39
+ '--bundle',
40
+ '--platform=node',
41
+ '--format=esm',
42
+ '--packages=external',
43
+ ])
44
+ built = true
45
+ }
46
+ }
47
+
48
+ if (!built) {
49
+ throw new Error('Could not find esbuild to bundle src/plugin.ts')
50
+ }
25
51
 
26
52
  console.log('Built src/plugin/index.js via esbuild.')
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * build-roster.mjs — Declarative Roster Generator.
4
+ *
5
+ * Compiles specialist agent markdown files (`src/agents/*.md`) mechanically
6
+ * from the single source of truth: `src/agents/roster.json`.
7
+ *
8
+ * Eliminates copy-paste drift, ensures frontmatter conformance, and enables
9
+ * centralized governance over permissions, model reasoning effort, and skills.
10
+ *
11
+ * Usage:
12
+ * node scripts/build-roster.mjs # compiles all agents
13
+ * node scripts/build-roster.mjs --check # verifies zero drift; exits 1 if stale
14
+ */
15
+
16
+ import { existsSync, readFileSync, writeFileSync } from 'node:fs'
17
+ import { dirname, join } from 'node:path'
18
+ import { fileURLToPath } from 'node:url'
19
+
20
+ const __dirname = dirname(fileURLToPath(import.meta.url))
21
+ const ROOT = join(__dirname, '..')
22
+ const ROSTER_PATH = join(ROOT, 'src', 'agents', 'roster.json')
23
+ const AGENTS_DIR = join(ROOT, 'src', 'agents')
24
+
25
+ export function formatFrontmatter(agent) {
26
+ const lines = ['---']
27
+
28
+ if (agent.name) lines.push(`name: ${agent.name}`)
29
+ if (agent.description) {
30
+ lines.push(`description: ${JSON.stringify(agent.description)}`)
31
+ }
32
+ if (agent.mode) lines.push(`mode: ${agent.mode}`)
33
+ if (agent.reasoning_effort) lines.push(`reasoning_effort: ${agent.reasoning_effort}`)
34
+ if (agent.temperature !== undefined && agent.temperature !== null) {
35
+ lines.push(`temperature: ${agent.temperature}`)
36
+ }
37
+
38
+ if (agent.permission && Object.keys(agent.permission).length > 0) {
39
+ lines.push('permission:')
40
+ for (const [key, val] of Object.entries(agent.permission)) {
41
+ if (typeof val === 'object' && val !== null && !Array.isArray(val)) {
42
+ lines.push(` ${key}:`)
43
+ for (const [subKey, subVal] of Object.entries(val)) {
44
+ const formattedSubVal =
45
+ typeof subVal === 'string' && subVal.includes('*') ? `"${subVal}"` : subVal
46
+ const formattedSubKey = subKey.includes('*') ? `"${subKey}"` : subKey
47
+ lines.push(` ${formattedSubKey}: ${formattedSubVal}`)
48
+ }
49
+ } else {
50
+ lines.push(` ${key}: ${val}`)
51
+ }
52
+ }
53
+ }
54
+
55
+ if (agent.mcp_tools && Object.keys(agent.mcp_tools).length > 0) {
56
+ lines.push('mcp_tools:')
57
+ for (const [server, tools] of Object.entries(agent.mcp_tools)) {
58
+ if (Array.isArray(tools)) {
59
+ if (server === 'pantheon-memory' && tools.length > 2) {
60
+ lines.push(` ${server}:`)
61
+ for (const t of tools) {
62
+ lines.push(` - ${t}`)
63
+ }
64
+ } else {
65
+ lines.push(` ${server}: [${tools.join(', ')}]`)
66
+ }
67
+ } else {
68
+ lines.push(` ${server}: ${tools}`)
69
+ }
70
+ }
71
+ }
72
+
73
+ if (Array.isArray(agent.skills) && agent.skills.length > 0) {
74
+ lines.push('skills:')
75
+ for (const skill of agent.skills) {
76
+ lines.push(` - ${skill}`)
77
+ }
78
+ }
79
+
80
+ lines.push('---')
81
+ return lines.join('\n')
82
+ }
83
+
84
+ export function generateAgentMarkdown(agent) {
85
+ const fm = formatFrontmatter(agent)
86
+ const body = (agent.body ?? '').trim()
87
+ return `${fm}\n\n${body}\n`
88
+ }
89
+
90
+ export function buildRoster({ check = false } = {}) {
91
+ if (!existsSync(ROSTER_PATH)) {
92
+ console.error(`Roster manifest not found at ${ROSTER_PATH}`)
93
+ process.exit(1)
94
+ }
95
+
96
+ const raw = readFileSync(ROSTER_PATH, 'utf8')
97
+ const manifest = JSON.parse(raw)
98
+ const agents = manifest.agents ?? {}
99
+ const agentKeys = Object.keys(agents).sort()
100
+
101
+ let hasDrift = false
102
+
103
+ for (const key of agentKeys) {
104
+ const agent = agents[key]
105
+ const targetFile = join(AGENTS_DIR, `${key}.md`)
106
+ const expected = generateAgentMarkdown(agent)
107
+
108
+ if (check) {
109
+ if (!existsSync(targetFile)) {
110
+ console.error(`[DRIFT] Missing agent file: ${targetFile}`)
111
+ hasDrift = true
112
+ continue
113
+ }
114
+ const actual = readFileSync(targetFile, 'utf8')
115
+ if (actual.trim() !== expected.trim()) {
116
+ console.error(`[DRIFT] Content mismatch in: ${key}.md`)
117
+ hasDrift = true
118
+ }
119
+ } else {
120
+ writeFileSync(targetFile, expected, 'utf8')
121
+ }
122
+ }
123
+
124
+ if (check) {
125
+ if (hasDrift) {
126
+ console.error('\n❌ Roster drift detected. Run `npm run build:roster` to synchronize.')
127
+ process.exit(1)
128
+ } else {
129
+ console.log(`[OK] All ${agentKeys.length} agents are synchronized with roster.json.`)
130
+ }
131
+ } else {
132
+ console.log(`[OK] Successfully compiled ${agentKeys.length} agents from roster.json.`)
133
+ }
134
+ }
135
+
136
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
137
+ const check = process.argv.includes('--check')
138
+ buildRoster({ check })
139
+ }