Skip to content

Commit 757d668

Browse files
release: v1.2.1 (#13)
* refactor(commands): consolidate slash commands from 16 to 5 Council decision (@Hermes, @Themis, @athena): keep only commands with unique multi-phase workflows not covered by MCP tools or skills. MANTER (5): pantheon, audit, deepwork, optimize, consolidate DELETAR (11): cancel, focus, forget, install, reflect, remember, search, sketch, status, update, verify Apollo audit verified alternative coverage for all deleted commands. Docs: INSTALLATION.md updated (14→5), ADR-006 created. * chore(release): v1.1.2 * chore: remove redundant model configs — agents inherit default deepseek-v4-flash * feat(zeus): enforce Fusion-style delegation — edit:deny, bash:deny, never touch files * feat: add fallback chains, auto CI retry (2x), and token tracking - Fallback chains: hermes→talos→athena, apollo→athena→hermes, etc. evaluated left-to-right; all fail → escalate with error context - Auto CI retry: 1→2 retries with exponential backoff + fallback agent - Token tracking: agents now report estimated token usage in subtask_summary - routing.yml: new fallback_chains section mapping agent→[fallbacks] * perf(persistence): add index, stats, auto-purge, FTS fix, delete_namespace - Index on (namespace, expires_at): O(n)→O(log n) on all TTL queries - kv_stats tool: total entries, expired count, per-namespace breakdown - Opportunistic auto-purge: purge expired when namespace >500 entries - FTS soft-delete trigger: fixes phantom results after purge - FTS query safety: re.escape() prevents syntax injection - kv_delete_namespace: bulk cleanup by namespace * docs(persistence): update docs with new tools and auto-purge behavior * feat(persistence): add context checkpoint tools — session-scoped state storage Adds 4 new MCP tools to pantheon-persistence for session context management: - context_save(slug, key, content): saves checkpoint with auto-TTL (4h) - context_get(slug, key): retrieves checkpoint (key defaults to 'latest') - context_list(slug): lists all checkpoints for a session - context_stats(slug): returns entry count, size, TTL remaining All state in namespace "checkpoint:{slug}" — no file I/O, TTL auto-cleanup. Replaces file-based checkpoint_session.py pattern. Zeus anti-stall instructions updated to use context_save/context_get instead of python checkpoint_session.py. * fix(council): 4 correções: UUID isolation, pré-compactação, quality floor, context_get 1. UUID isolation: context tools agora usam namespace checkpoint:{slug}:{session_id} — previne leitura cross-session 2. Pré-compactação: gatilho que salva estado antes da compactação nativa do OpenCode disparar (75-96% do context window) 3. Quality floor: validação de summaries flash — se <10 chars ou CRITICAL <60 chars, fallback automático para Zeus (pro) 4. Instruir agents (hermes, aphrodite, demeter, hephaestus): chamar context_get(slug, 'latest') no startup para recuperar estado da sessão anterior Council: @athena, @Themis, @Hermes — 3/3 com High confidence * fix(ci): add missing scopes to commitlint; skip auto-release if version exists * fix(ci): remove push triggers — only pull_request to eliminate duplicate checks All validation workflows (CI, commitlint, CodeQL, hotfix, docs) now trigger on pull_request ONLY. This eliminates the duplicate (push) + (pull_request) checks that caused 'Expected — Waiting' perma-pending status. Auto Release keeps push: [main] only — it publishes releases, not validates code. * chore(release): v1.2.0 * feat(ci): new release system — beta from PR label, stable from main push Council decision (@prometheus, @Themis, @iris — unanimous): - release-beta.yml: label 'release:beta' no PR → publica beta npm + GitHub Pre-release Versão: X.Y.Z-beta.<PR>.<SHA> (única por commit) - release-stable.yml: push na main com chore(release): → publica stable npm + GitHub Release - auto-release.yml removido (era push-to-develop quebrado) - Hotfix/docs workflows mantidos (independentes) Novo fluxo: PR aberto → label release:beta → beta publicado Merge na main → stable publicado * docs: add RELEASE.md — beta from PR label, stable from main push * chore: trigger fresh checks for branch protection sync * refactor(ci): unified release workflow — beta from PR label, stable from main push Single release.yml handles both channels: - PR with label 'release:beta' → beta npm + pre-release - Push to main → stable npm + release - Checks if version exists before publishing - Same permissions, same provenance, same pattern - Removed duplicate release-beta.yml and release-stable.yml * fix(ci): remove NODE_AUTH_TOKEN — uses OIDC Trusted Publisher for npm auth * chore: remove stale release workflows brought back by merge * feat: add built-in model routing presets + interactive picker - 4 presets: go-deepseek (tiered Pro/Flash), go-premium (all Pro), go-fast (all Flash/low), go-free (free-tier endpoints) - Zero-mutation default: plugin only injects when an active-preset.json exists (env > file > none) - set-tier CLI in bin/pantheon-init.mjs with API-key fail-fast + --project/--dry-run - Interactive picker in scripts/install/model-picker.mjs with atomic write + .bak backup - validate-routing.mjs section F validates preset defs against routing.yml agents - Packaging fix: src/pantheon/** now included in published tarball (was missing) - 21 node tests + pytest wrapper * Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Potential fix for pull request finding 'CodeQL / Clear-text logging of sensitive information' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * feat: add go-claude, go-openai, go-olympus, go-muses presets + capability table - 4 new provider families: Anthropic (Claude Opus 4.8/Sonnet 5/Haiku 4.5), OpenAI (GPT-5.6 Sol/Terra/Luna Fast), OpenCode Go, OpenCode Zen free - 8 presets total: go-deepseek, go-premium, go-fast, go-free, go-claude, go-openai, go-olympus, go-muses - CAPABILITY_TABLE: +11 entries (glm-5.1/5.2, kimi-k2.6, qwen3.7-max/plus, minimax-m2.7/m2.5, bare deepseek-v4-pro/flash, big-pickle, nemotron-3-ultra-free, north-mini-code-free) - tests: 25/25 node tests pass, 86 pytest, validate-routing 8 presets 46 checks - themis PASS on incremental * test: adapt T16 assertion to redacted API key error message The automated CodeQL fix (4082bcc) replaced the clear-text env-var hint in bin/pantheon-init.mjs with a generic message. Update T16 to assert the new stable marker, preserving fail-fast semantics (exit 1, no file written). * refactor: route go-deepseek via OpenCode Zen, drop go-premium/go-free (8→6 presets) go-deepseek now opencode provider (zen/v1), premium/free superseded by olympus/muses, +mimo-v2.5 capability entry, 26 tests, themis PASS. * refactor: rename olympus/muses presets to go-premium/go-free user naming decision — premium lineup = OpenCode Go, free lineup = Zen free; 26 tests * refactor: route go-fast via OpenCode Go (drop native deepseek provider) all 6 presets now via OpenCode/anthropic/openai; PANTHEON_DEEPSEEK_API_KEY removed; 27 tests * fix: resolve commitlint failures (CodeQL ignores, body-max-line-length) + typecheck - commitlint: add ignore pattern for CodeQL auto-fix commits (Potential fix for pull request finding...) - commitlint: disable body-max-line-length rule (body lines may exceed 100 chars) - tsconfig: drop path aliases, add allowImportingTsExtensions, noEmit, types: [node] - add src/opencode.d.ts ambient declaration for opencode PluginConfig - background-job-board: fix optional objective property (undefined guard) - package-lock: updated from npm install * docs: document model routing presets (presets, commands, env vars) 6 presets table, set-tier/init --preset usage, PANTHEON_* env vars, local smoke test, picker + active-preset.json explanation * feat: vendor todo-progress + usage-bar into pantheon-tui (v1.1.0) todo progress bar (session_prompt_right slot, live from api.state.session.todo), AI subscription usage gauges (app_bottom slot, Claude Pro/Max + ChatGPT Plus/Pro via Codex, status incidents, usage-bar.toml), removed duplicate ContextBar from sidebar (native opencode footer covers it), detectVersion SDK v2 signature fix, bold now applies via attributes={1} (TextAttributes.BOLD), MIT attribution (satas20/opencode-todo-progress, satas20/opencode-usage-bar), dist rebuilt, presets regression 27/27, themis PASS. * fix: export pantheon plugin as function for opencode 1.18.11 API old object export failed to load ("Plugin export is not a function"); function-export format per @opencode-ai/plugin types; hooks.config mutates config in place (return value discarded in 1.18.11); preset hook verified loading with "[Pantheon Plugin] Model preset active" log; published 1.2.0 has same bug (candidate for v1.2.1 release). * feat(tui): show active model preset in sidebar reads PANTHEON_MODEL_PRESET env + .pantheon/active-preset.json (cwd/XDG/HOME candidates), env > file > default, 30s live refresh, display-only, themis PASS. * feat: vision routing — per-turn multimodal fallback for image turns CAPABILITY_TABLE vision flags verified via models.dev (2026-08-02); `vision:` key per preset (go-deepseek→opencode-go/qwen3.7-plus, go-fast→opencode-go/mimo-v2.5, go-premium→opencode-go/qwen3.7-plus, go-free→opencode/mimo-v2.5-free, go-claude→anthropic/claude-sonnet-5, go-openai→openai/gpt-5.6-sol); chat.message hook routes image-bearing turns to the vision model (FilePart mime image/*), fail-open; validator enforces vision provider declared in preset providers; shallow-merge overrides; council 2026-08-02 + themis PASS; 32 tests. * fix: import uuid in mcp_persistence_server.py (context_save NameError) * refactor(tui): remove todo-progress bar (redundant with native TODO + sidebar), v1.1.1 session_prompt_right slot dropped; slots now sidebar_content + app_bottom only; attribution updated; 32/32 tests. * feat(tui): track OpenCode Go/Zen usage quota (5h/7d/1m dollars), v1.2.0 opencodeGoProvider reads PANTHEON_OPENCODE_API_KEY (fallback OPENCODE_API_KEY), queries opencode.ai/zen/go/v1/usage (proposed endpoint, hides gracefully if unshipped — anomalyco/opencode#31084); windows 5h $12 / 7d $30 / 1m $60 with reset countdown; [opencodego] toml config; token only in Authorization header, never logged; themis PASS. * fix(plugin): default vision fallback for image turns without active preset image turns route to opencode-go/qwen3.7-plus (env PANTHEON_VISION_MODEL override) when no preset (or preset without vision) is active; preset vision still wins when present; fail-open; typecheck 0, 32/32. * fix(plugin): default vision fallback -> opencode-go/mimo-v2.5 (multimodal, cheaper) User decision: mimo-v2.5 is multimodal (text+image+audio+video) with tool calling, cheaper than qwen3.7-plus. Env PANTHEON_VISION_MODEL override kept. Presets vision config unchanged. * fix(plugin): silence vision routing hook logs (no chat pollution) * fix(presets): vision fallbacks go-deepseek/go-premium -> minimax-m3 (qwen3.7-plus 500 on Go gateway) * fix: declare opencode-go/mimo-v2.5 image-capable in config (attachment+modalities) * fix: declare deepseek-v4-flash image-capable (fix image stripping at source) root cause: OpenCode strips images before the chat.message hook fires unless the default model is image-capable; this fix ensures deepseek-v4-flash passes image pixels through, then the hook routes to mimo-v2.5 which reads them. * feat(plugin): normalize image history with multimodal fallback Port do padrão zensi-dev sem instalar dependência; experimental.chat.messages.transform; descrição auxiliar usando SDK oficial; cache/recursion guard; substituição in-place; remove o chat.message que causava image_url no turno seguinte; tests. * feat(plugin): vision via MCP tool pattern (paste-and-ask for text-only models) Port do padrão DavidEasden/opencode-vision implementado originalmente; chat.message intercepta FileParts image/*, salva data: em /tmp/pantheon-vision, remove imagem, injeta TextPart instruindo modelo a chamar tool de visão (default mcp__bifrost__describe_image, configurável); imagem nunca chega ao provider (elimina erro image_url); cleanup session.idle/disposed; remove zensi transform + sessão auxiliar; themis PASS_WITH_NOTES; tests. * feat(plugin): native vision via provider gateway (mimo-v2.5), MCP tool as fallback PANTHEON_VISION_MODE native|tool|auto; plugin chama opencode-go/mimo-v2.5 (ou preset vision) direto no gateway OpenAI-compatible com a chave do usuário — SEM bifrost/MCP; descrição injetada em texto, imagem removida; fallback tool pattern preservado; cap 25MB, timeout 20s, key só no header, nunca logada; themis PASS. * feat(mcp): add canonical pantheon-vision stdio server * refactor(plugin): consolidate vision routing and remove legacy duplicates * test(vision): cover image history and image_url wire rejection * security: remove hardcoded provider credentials and add secret scan * chore(install): register pantheon-vision and harden doctor * test(security): add secret scan regression test * feat(vision): fix image pipeline and add description cache/intent routing Complete end-to-end multimodal vision pipeline: images are detected, described, and injected into the turn; text-only models (deepseek-v4-flash) never receive image_url. Fixes: - Plugin boot failure: legacy OpenCode 1.18.11 loader invoked every function export as a plugin factory. plugin.ts now exports only the default plugin; helpers live in src/pantheon/vision.ts and are imported directly. - MCP vision tool ID: real runtime ID is pantheon_vision_vision_describe (underscores, no mcp__ prefix). DEFAULT_IMAGE_ANALYSIS_TOOL fixed; tool regex accepts _ and -; successful detection never returns null. - Gateway 401 "Model not supported": strip provider prefix from model ID (opencode-go/mimo-v2.5 -> mimo-v2.5) in MCP server and native path. - Temp file race between turns: session.idle fired between loop steps and cleanup removed files unconditionally (+ rm -rf of the dir). Cleanup is now age-guarded (TEMP_FILE_GRACE_MS=120s); disposed clears everything; the directory is never removed. - Presets no longer auto-apply in hooks.config (explicit CLI concern, not a per-turn routing policy). Improvements: - Session description cache (sha256(prompt) + content hashes, TTL 30min, cleared on idle/deleted/disposed) — eliminates re-calls on retry. - SHA-256 dedup + LRU cap (TEMP_MAX_FILES=200) for temp images. - Intent-calibrated prompts (compare/ocr/reconstruct/bugs/describe, PT/EN) with structured <item>/<context> responses and a resilient parser. - Sanitized gateway error logging (no keys, no image bytes) to stderr. Files: src/plugin.ts, src/pantheon/vision.ts, src/mcp/pantheon_vision_server.py, tests/test_plugin_vision.mjs, tests/test_pantheon_vision_server.py, commands/pantheon-vision.md Tests: JS vision-tool suite passes (306 asserts: boot contract, tool ID, strip, grace, dedup/LRU, cache hit/miss/TTL, PT/EN intent, parser, multi-image); pytest 11/11 vision server; typecheck 0 errors; biome clean on changed files; secret-scan clean. * Potential fix for pull request finding 'CodeQL / Double escaping or unescaping' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * chore: add PR template in English and ignore coverage artifacts * chore: extend commitlint scope-enum for plugin/vision/presets * chore: allow security type and disable footer-max-line-length * ci: sync workflow triggers with base develop * ci(release): add workflow_dispatch with pr_number input * ci(release): remove empty env block breaking workflow parse * ci(release): restore NODE_AUTH_TOKEN — OIDC publisher not configured on npm * chore(release): bump version to 1.2.1 * chore: strengthen secret-scan regression test and dedupe scrubber - tests/test_secret_scan.mjs: assert masked Bifrost header/prefix absent from opencode.json, cover dummy token pattern - scripts: remove duplicate scrub_secrets.py (underscore); canonical is scrub-secrets.py (referenced by install/opencode.mjs, test-context-compression.sh, SKILL.md) - package.json/lock: keep self-referencing devDependency pantheon-opencode@^1.2.0-beta.9.f641862 (user decision); unicode->literal encoding in description/postpublish * ci(security): add fail-closed secret scan gates (gitleaks + custom scan) * ci(security): fix github_pat_ self-match in grep scan * chore(hooks): add pre-commit gates for secrets and code quality * fix(security): upgrade fast-uri to patched version and untrack dist artifacts * chore(ci): add hooks scope to commitlint scope-enum * fix(install): point project MCP commands at real venv * fix(plugin): apply active preset in config hook * fix(vision): restrict temp image permissions * fix(vision): decode file URLs with fileURLToPath * fix(vision): gateway-aware qwen image interception * fix(vision): verify MCP availability before defaulting tool * fix(vision): refcount shared temp images * style(scripts): apply biome formatting and typecheck narrowing * ci(security): touch workflow to refresh parser * fix(plugin): sanitize preset error logging (CodeQL) * ci(security): rename workflow file to refresh parser * fix(plugin): use fully static preset failure log * ci: refresh mergeability * ci: refresh checks after removing stale app * ci: regenerate checks on fresh sha --------- Co-authored-by: ils15 <[email protected]> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent e8e69c3 commit 757d668

84 files changed

Lines changed: 9499 additions & 3205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
name: Pull Request
3+
about: Standard pull request for pantheon-opencode
4+
title: 'feat(scope): <short imperative summary>'
5+
---
6+
7+
<!--
8+
Title convention — Conventional Commits, in English:
9+
feat(scope): ... new feature fix(scope): ... bug fix
10+
chore(scope): ... maintenance refactor(scope): ... no behavior change
11+
docs(scope): ... documentation test(scope): ... tests only
12+
release: ... version/release PR
13+
Scope examples: vision, plugin, mcp, presets, tui, ci, install
14+
-->
15+
16+
## Summary
17+
<!-- 2-3 sentences: what this PR does, why, and the outcome. -->
18+
19+
## Changes
20+
<!-- List by area (e.g. core, plugin, mcp, tests, docs). Bullet points. -->
21+
22+
## Root causes fixed
23+
<!-- If this PR fixes bugs, fill the table. Otherwise delete this section. -->
24+
25+
| Issue | Root cause | Fix |
26+
|-------|-----------|-----|
27+
| | | |
28+
29+
## Testing
30+
<!-- Commands run + results. Examples:
31+
- `python3 -m pytest tests/ -q` — N passed
32+
- `node tests/test_plugin_vision.mjs` — N asserts
33+
- `npm run typecheck` — 0 errors
34+
- `npm run lint` — clean
35+
- `npm run secret-scan` — clean
36+
-->
37+
38+
## Files changed
39+
<!-- List of files, one per line. -->
40+
41+
## Notes
42+
<!-- Blockers, decisions, follow-ups, external dependencies. -->
43+
44+
## Quality checklist
45+
- [ ] Tests pass locally
46+
- [ ] Lint clean (`npm run lint`)
47+
- [ ] Typecheck clean (`npm run typecheck`)
48+
- [ ] Secret scan clean (`npm run secret-scan`)
49+
- [ ] No new dependencies without justification
50+
- [ ] No secrets or credentials committed

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@ jobs:
3737
- name: Security audit
3838
run: npm audit --audit-level=high 2>&1 || echo "audit warnings"
3939

40+
- name: Scan versionable files for credentials
41+
run: npm run test:security
42+
4043
- name: Verify package
4144
run: npm pack --dry-run 2>&1 | tail -3

‎.github/workflows/release.yml‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ name: Release
33
on:
44
workflow_dispatch:
55
inputs:
6-
version:
7-
description: 'Version to publish (from package.json)'
6+
pr_number:
7+
description: 'PR number for beta release labeling'
88
required: false
9+
default: '9'
910
pull_request:
1011
types: [labeled]
1112
push:
@@ -19,9 +20,9 @@ permissions:
1920
jobs:
2021
release:
2122
if: >
22-
github.event_name == 'workflow_dispatch' ||
2323
(github.event_name == 'push' && github.actor != 'github-actions[bot]') ||
24-
(github.event_name == 'pull_request' && github.event.label.name == 'release:beta')
24+
(github.event_name == 'pull_request' && github.event.label.name == 'release:beta') ||
25+
github.event_name == 'workflow_dispatch'
2526
runs-on: ubuntu-latest
2627
concurrency:
2728
group: release-${{ github.ref_name }}
@@ -36,13 +37,14 @@ jobs:
3637
- uses: actions/setup-node@v4
3738
with:
3839
node-version: '22'
40+
registry-url: 'https://registry.npmjs.org'
3941

4042
- run: npm ci --ignore-scripts 2>/dev/null || npm install
4143

4244
- name: Determine release type
4345
id: type
4446
run: |
45-
if [ "${{ github.event_name }}" = "push" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
47+
if [ "${{ github.event_name }}" = "push" ]; then
4648
echo "channel=stable" >> "$GITHUB_OUTPUT"
4749
echo "tag=latest" >> "$GITHUB_OUTPUT"
4850
else
@@ -54,7 +56,7 @@ jobs:
5456
if: steps.type.outputs.channel == 'beta'
5557
id: betaver
5658
run: |
57-
PR=${{ github.event.number || '0' }}
59+
PR=${{ github.event.number || github.event.inputs.pr_number }}
5860
SHA=$(git rev-parse --short HEAD)
5961
BASE=$(node -p "require('./package.json').version")
6062
echo "version=${BASE}-beta.${PR}.${SHA}" >> "$GITHUB_OUTPUT"
@@ -74,18 +76,16 @@ jobs:
7476
NPM_VER=$(npm view pantheon-opencode version --tag ${{ steps.type.outputs.tag }} 2>/dev/null || echo "none")
7577
if [ "$NPM_VER" = "$VER" ]; then
7678
echo "exists=true" >> "$GITHUB_OUTPUT"
79+
echo "⚠️ Version $VER already published"
7780
else
7881
echo "exists=false" >> "$GITHUB_OUTPUT"
7982
fi
8083
81-
- name: Configure npm auth
82-
run: |
83-
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
84-
echo "registry=https://registry.npmjs.org/" >> .npmrc
85-
8684
- name: Publish to npm
8785
if: steps.npm_check.outputs.exists == 'false'
8886
run: npm publish --tag ${{ steps.type.outputs.tag }} --access public --provenance 2>&1
87+
env:
88+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8989

9090
- name: Create GitHub Release
9191
if: steps.npm_check.outputs.exists == 'false'
@@ -94,7 +94,7 @@ jobs:
9494
run: |
9595
VERSION="v$(node -p "require('./package.json').version")"
9696
if [ "${{ steps.type.outputs.channel }}" = "beta" ]; then
97-
PR=${{ github.event.number || '0' }}
97+
PR=${{ github.event.number || github.event.inputs.pr_number }}
9898
gh release create "$VERSION" \
9999
--title "Pantheon ${VERSION} (PR #${PR})" \
100100
--prerelease \
@@ -112,9 +112,9 @@ jobs:
112112
with:
113113
script: |
114114
const ver = '${{ steps.betaver.outputs.version }}';
115-
const pr = ${{ github.event.number || '0' }};
115+
const pr = ${{ github.event.number || github.event.inputs.pr_number }};
116116
github.rest.issues.createComment({
117117
...context.repo,
118118
issue_number: pr,
119-
body: `Beta \`${ver}\` published.\n\nnpm install pantheon-opencode@${ver}\nnpm install pantheon-opencode@beta`
119+
body: `📦 Beta \`${ver}\` published.\n\n\`\`\`\nnpm install pantheon-opencode@${ver}\nnpm install pantheon-opencode@beta\n\`\`\``
120120
});
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# security gates
2+
# Fail-closed secret scanning gates.
3+
#
4+
# - gitleaks (action v2): PR diff on pull_request, pushed commit range on
5+
# push, full repo scan on workflow_dispatch. Auto-uses .gitleaks.toml.
6+
# - gitleaks CLI full-history scan on push to main (the action only covers
7+
# the pushed range; this guarantees the entire reachable history is clean).
8+
# - Custom Bifrost/API credential scan (scripts/secret-scan.mjs) + its
9+
# regression test (tests/test_secret_scan.mjs).
10+
# - Critical-pattern grep scan over tracked files (private keys, GitHub/npm/
11+
# AWS/Google/Slack tokens, sk-* keys, tracked .env files).
12+
#
13+
# ANY finding (any severity) fails the job: exit != 0.
14+
15+
name: Security
16+
17+
on:
18+
pull_request:
19+
push:
20+
branches: [main, develop]
21+
workflow_dispatch:
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.ref }}
25+
cancel-in-progress: true
26+
27+
permissions:
28+
contents: read
29+
pull-requests: read
30+
31+
jobs:
32+
security-scan:
33+
name: security-scan
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout with full history
37+
uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
41+
- name: gitleaks (action) — PR diff / pushed commits / dispatch
42+
uses: gitleaks/gitleaks-action@v2
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
GITLEAKS_VERSION: 8.24.3
46+
GITLEAKS_CONFIG: .gitleaks.toml
47+
GITLEAKS_ENABLE_COMMENTS: 'false'
48+
GITLEAKS_ENABLE_UPLOAD_ARTIFACT: 'false'
49+
50+
- name: gitleaks CLI — full history scan on push to main
51+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
52+
run: |
53+
gitleaks detect --config .gitleaks.toml --redact -v \
54+
--exit-code=2 --log-opts=--all --log-level=info
55+
56+
- name: Setup Node
57+
uses: actions/setup-node@v4
58+
with:
59+
node-version: '20'
60+
61+
- name: Custom credential scan (Bifrost + API keys)
62+
run: |
63+
node scripts/secret-scan.mjs
64+
node tests/test_secret_scan.mjs
65+
66+
- name: Critical secret patterns scan (tracked files)
67+
run: |
68+
set -uo pipefail
69+
LEAKS=0
70+
# Tracked files, excluding allowlisted test fixtures / scan tooling
71+
FILES="$(git ls-files | grep -vE '(^|/)(tests/test_secret_scan\.mjs|scripts/secret-scan\.mjs|\.gitleaks\.toml|\.gitleaksignore|SECURITY\.md)$' || true)"
72+
73+
PATTERNS=(
74+
'-----BEGIN (RSA|EC|OPENSSH|PRIVATE) KEY'
75+
'ghp_[A-Za-z0-9]{36}'
76+
'github_pat_[A-Za-z0-9_]{22,}'
77+
'npm_[A-Za-z0-9]{36}'
78+
'AKIA[0-9A-Z]{16}'
79+
'AIza[0-9A-Za-z_-]{35}'
80+
'xox[baprs]-'
81+
'sk-[A-Za-z0-9]{20,}'
82+
)
83+
84+
if [ -n "$FILES" ]; then
85+
for PAT in "${PATTERNS[@]}"; do
86+
while IFS= read -r HIT; do
87+
echo "::error::CRITICAL-SECRET ${HIT} (pattern: ${PAT})"
88+
LEAKS=1
89+
done < <(grep -nIE -e "$PAT" $FILES | cut -d: -f1,2)
90+
done
91+
fi
92+
93+
# Tracked .env files (allow documented templates only)
94+
ENVHITS="$(git ls-files | grep -E '(^|/)\.env([.-]|$)' | grep -vE '\.env\.(example|sample|template)($|\.)' || true)"
95+
if [ -n "$ENVHITS" ]; then
96+
while IFS= read -r F; do
97+
echo "::error::TRACKED-ENV-FILE ${F}"
98+
LEAKS=1
99+
done <<< "$ENVHITS"
100+
fi
101+
102+
if [ "$LEAKS" -ne 0 ]; then
103+
echo "::error::Critical secret pattern scan FAILED — rotate or remove secrets before committing."
104+
exit 1
105+
fi
106+
echo "Critical secret pattern scan passed: no high-risk patterns in tracked files."

‎.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
node_modules/
2+
dist/
23
.venv/
34
.pantheon/
45
.env
56
*.tgz
67
*.pyc
78
__pycache__/
9+
.coverage*
810
.DS_Store
911
.vscode/
1012
opencode.zen.json
1113
opencode.multimodal.json
1214
opencode.deepseek-only.json
15+
opencode.local.json
16+
opencode.json.backup
17+
.mcp.json.backup

‎.gitleaks.toml‎

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Pantheon OpenCode — gitleaks configuration (fail-closed secret scan)
2+
#
3+
# Used by .github/workflows/security.yml (job: security-scan).
4+
# Auto-discovered by the gitleaks-action from the repo root and by the
5+
# gitleaks CLI full-history scan.
6+
#
7+
# Policy: ANY finding (any severity) fails the scan. No .gitleaksignore.
8+
9+
title = "Pantheon OpenCode gitleaks config"
10+
11+
# Merge the embedded default gitleaks ruleset (no network access needed).
12+
[extend]
13+
useDefault = true
14+
15+
# --- Bifrost MCP credentials (incident 2026-08-03, keys revoked) ---
16+
# Only the VALUE pattern is scanned here (sk-bf-*). The header NAME
17+
# (x-bf-vk) is intentionally NOT a gitleaks rule: it remains a legitimate
18+
# config key in old commits (values were scrubbed), and its detection is
19+
# enforced on the working tree by scripts/secret-scan.mjs.
20+
[[rules]]
21+
id = "bifrost-mcp-token"
22+
description = "Bifrost MCP credential token value (sk-bf- prefix)"
23+
regex = '''(?i)sk-bf-[A-Za-z0-9_-]{8,}'''
24+
keywords = ["sk-bf-"]
25+
26+
# --- Critical infrastructure credentials ---
27+
[[rules]]
28+
id = "pem-private-key"
29+
description = "PEM/OpenSSH private key block (RSA/EC/OPENSSH/PRIVATE)"
30+
regex = '''-----BEGIN (?:RSA|EC|OPENSSH|PRIVATE) KEY-----'''
31+
keywords = ["BEGIN"]
32+
33+
[[rules]]
34+
id = "github-classic-pat"
35+
description = "GitHub classic personal access token (ghp_)"
36+
regex = '''ghp_[A-Za-z0-9]{36}'''
37+
keywords = ["ghp_"]
38+
39+
[[rules]]
40+
id = "github-fine-grained-pat"
41+
description = "GitHub fine-grained personal access token (github_pat_)"
42+
regex = '''github_pat_[A-Za-z0-9_]{22,}'''
43+
keywords = ["github_pat_"]
44+
45+
[[rules]]
46+
id = "npm-access-token"
47+
description = "npm access token (npm_)"
48+
regex = '''npm_[A-Za-z0-9]{36}'''
49+
keywords = ["npm_"]
50+
51+
[[rules]]
52+
id = "aws-access-key-id"
53+
description = "AWS Access Key ID (AKIA)"
54+
regex = '''AKIA[0-9A-Z]{16}'''
55+
keywords = ["AKIA"]
56+
57+
[[rules]]
58+
id = "google-api-key"
59+
description = "Google API key (AIza)"
60+
regex = '''AIza[0-9A-Za-z_-]{35}'''
61+
keywords = ["AIza"]
62+
63+
[[rules]]
64+
id = "slack-token"
65+
description = "Slack bot/user/app token (xox[baprs]-)"
66+
regex = '''xox[baprs]-[A-Za-z0-9-]{10,}'''
67+
keywords = ["xox"]
68+
69+
[[rules]]
70+
id = "openai-style-key"
71+
description = "OpenAI-style secret token (sk- prefix, 20+ chars)"
72+
regex = '''sk-[A-Za-z0-9]{20,}'''
73+
keywords = ["sk-"]
74+
75+
# Test fixtures, documentation and scan tooling intentionally contain dummy
76+
# credentials, documented examples and pattern literals. They must NEVER hold
77+
# real secrets. If a real secret is found in these files, rotate it
78+
# immediately — the allowlist does not make it safe.
79+
[allowlist]
80+
description = "Test fixtures, documented examples and scan tooling (dummy values only)"
81+
paths = [
82+
'''tests/test_secret_scan\.mjs''',
83+
'''scripts/secret-scan\.mjs''',
84+
'''\.gitleaks\.toml''',
85+
'''\.gitleaksignore''',
86+
'''SECURITY\.md''',
87+
# Docs example with the AWS-documented dummy key (e.g. AKIAIOSFODNN7EXAMPLE)
88+
'''\.github/hooks/README\.md''',
89+
# Playwright MCP snapshot fixtures (contain a JWT screenshot URL)
90+
'''\.playwright-mcp/page-.*\.yml''',
91+
# Committed environment template (no real values)
92+
'''\.env\.example''',
93+
]
94+
regexes = [
95+
# Dummy fixture values: any value that is composed of [a-z0-9_-] and
96+
# contains a test/example/dummy marker. Real secrets with these markers are
97+
# NOT covered — rotate them instead of relying on this.
98+
'''(?i)[a-z0-9_-]*(test|example|do-not-use|dummy|fixture)[a-z0-9_-]*''',
99+
]

‎.opencode/plugins/pantheon-notify/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ function errorMessage(event) {
6363
}
6464

6565
/** Named export consumed by the opencode plugin runtime. */
66-
export const NotifyPlugin = async ({ project, client, $, directory, worktree }) => {
66+
export const NotifyPlugin = async ({ client, $ }) => {
6767
return {
6868
event: async ({ event }) => {
6969
try {
70-
const { type, ctx, payload } = event
70+
const { type, ctx } = event
7171

7272
switch (type) {
7373
case 'session.created':

0 commit comments

Comments
 (0)