pantheon-opencode 1.7.0 → 2.0.0-beta.2
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 +2 -2
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +85 -59
- package/README.md +74 -48
- package/README.pt-BR.md +19 -19
- package/bin/pantheon-init.mjs +11 -48
- package/package.json +9 -13
- package/plugin.json +2 -2
- package/pyproject.toml +1 -1
- package/scripts/build-agents-md.mjs +7 -6
- package/scripts/{check-plugin-v2-coverage.mjs → check-plugin-coverage.mjs} +7 -7
- package/scripts/{decision-router-v2-budget.mjs → decision-router-budget-gates.mjs} +1 -1
- package/scripts/{decision-router-v2-egress.mjs → decision-router-egress.mjs} +1 -1
- package/scripts/decision-router.mjs +2 -2
- package/scripts/docs-media.mjs +1 -1
- package/scripts/doctor.mjs +225 -136
- package/scripts/install/behavior-overrides.bundle.mjs +123 -0
- package/scripts/install/{v2-capabilities.mjs → capabilities.mjs} +7 -7
- package/scripts/install/config-migration.mjs +60 -253
- package/scripts/install/file-inventory.mjs +6 -4
- package/scripts/install/interactive.mjs +1 -1
- package/scripts/install/opencode-state.mjs +13 -12
- package/scripts/install/opencode-version.mjs +97 -162
- package/scripts/install/opencode.mjs +271 -428
- package/scripts/install/plan.mjs +1 -9
- package/scripts/install/plugin.mjs +19 -35
- package/scripts/install/shared.mjs +40 -1
- package/scripts/package-evidence.mjs +1 -4
- package/scripts/probe-pantheon-cost.mjs +1 -1
- package/scripts/reconcile.mjs +5 -7
- package/scripts/release-gates.mjs +22 -61
- package/scripts/setup-v2-config.mjs +10 -8
- package/scripts/setup.mjs +12 -22
- package/scripts/sync-tui.mjs +9 -17
- package/scripts/{test-opencode-v2-sandbox.sh → test-opencode-sandbox.sh} +9 -9
- package/scripts/update-skills-lock.mjs +24 -12
- package/scripts/update.mjs +17 -1
- package/scripts/validate-routing.mjs +79 -4
- package/scripts/validate-sandbox-install.mjs +3 -3
- package/skills-lock.json +25 -8
- package/src/agents/zeus.md +1 -0
- package/src/pantheon/behavior-overrides.ts +191 -0
- package/src/pantheon/{v2-bounded-read.ts → bounded-read.ts} +1 -1
- package/src/pantheon/cost-command.ts +1 -1
- package/src/pantheon/{v2-decision-contracts.ts → decision-contracts.ts} +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p1-agent.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p10-claims.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p11-catalog.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p2-skill.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p3-complexity.ts +6 -6
- package/src/pantheon/{v2-decision-points → decision-points}/p4-memory.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p5-themis-verify.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p6-council.ts +3 -3
- package/src/pantheon/{v2-decision-points → decision-points}/p7-loop.ts +5 -5
- package/src/pantheon/{v2-decision-points → decision-points}/p8-guardrail.ts +2 -2
- package/src/pantheon/{v2-decision-points → decision-points}/p9-memory-compaction.ts +2 -2
- package/src/pantheon/{v2-decision-points.ts → decision-points.ts} +5 -5
- package/src/pantheon/{v2-decision-policy.ts → decision-policy.ts} +2 -2
- package/src/pantheon/{v2-decision-prompt-surface.ts → decision-prompt-surface.ts} +3 -3
- package/src/pantheon/{v2-decision-registry.ts → decision-registry.ts} +10 -13
- package/src/pantheon/{v2-decision-resource-ids.ts → decision-resource-ids.ts} +1 -1
- package/src/pantheon/{v2-decision-shadow.ts → decision-shadow.ts} +1 -1
- package/src/pantheon/{v2-decision-telemetry.ts → decision-telemetry.ts} +1 -1
- package/src/pantheon/{v2-execute-after.ts → execute-after.ts} +4 -4
- package/src/pantheon/goal-store.ts +7 -0
- package/src/pantheon/{v2-hook-engine.ts → hook-engine.ts} +3 -3
- package/src/pantheon/jev-decision-tool.ts +3 -3
- package/src/pantheon/jev-decisions.ts +12 -6
- package/src/pantheon/jev-escalation.ts +6 -6
- package/src/pantheon/jev-quality-score.ts +2 -2
- package/src/pantheon/jev-rank-verify.ts +2 -2
- package/src/pantheon/jev-risk-gate.ts +4 -4
- package/src/pantheon/local-decision-agents.ts +1 -1
- package/src/pantheon/local-decision-router.ts +1 -1
- package/src/pantheon/local-decision-tool.ts +2 -2
- package/src/pantheon/local-orchestration.ts +1 -1
- package/src/pantheon/model-command.ts +1 -1
- package/src/pantheon/{v2-vision.ts → native-vision.ts} +12 -15
- package/src/pantheon/pantheon-decision-catalog.ts +12 -0
- package/src/pantheon/{v2-shell-hooks.ts → shell-hooks.ts} +4 -4
- package/src/pantheon/{v2-tools.ts → tools.ts} +4 -4
- package/src/pantheon/{v2-unsupported.d.mts → unsupported.d.mts} +3 -3
- package/src/pantheon/{v2-unsupported.mjs → unsupported.mjs} +8 -8
- package/src/pantheon/update-notifier.ts +101 -0
- package/src/pantheon/vision-local.ts +12 -3
- package/src/pantheon/vision.ts +120 -2
- package/src/{plugin-v2 → plugin}/index.ts +7 -7
- package/src/plugin.ts +2870 -500
- package/src/plugins/hook-runner.ts +3 -3
- package/src/plugins/tui/dist/server.d.ts +23 -9
- package/src/plugins/tui/dist/server.d.ts.map +1 -1
- package/src/plugins/tui/dist/server.js +25 -12
- package/src/plugins/tui/dist/server.js.map +1 -1
- package/src/plugins/tui/dist/tui.d.ts +1023 -494
- package/src/plugins/tui/dist/tui.d.ts.map +1 -1
- package/src/plugins/tui/dist/tui.js +5612 -2086
- package/src/plugins/tui/dist/tui.js.map +1 -1
- package/src/plugins/tui/{index-v2.ts → index.ts} +1 -1
- package/src/plugins/tui/package-lock.json +2 -42
- package/src/plugins/tui/package.json +4 -10
- package/src/plugins/tui/src/cost-data.ts +1 -1
- package/src/plugins/tui/src/decision-router-state.ts +242 -0
- package/src/plugins/tui/src/doctor-state.ts +198 -0
- package/src/plugins/tui/src/index.tsx +4222 -2822
- package/src/plugins/tui/src/j1-gate-status.ts +85 -0
- package/src/plugins/tui/src/pantheon-settings-state.ts +245 -0
- package/src/plugins/tui/src/pantheon-settings.tsx +442 -0
- package/src/plugins/tui/src/preset-state.ts +143 -0
- package/src/plugins/tui/src/server.ts +23 -10
- package/src/plugins/tui/src/update-notice.ts +90 -0
- package/src/plugins/tui/src/update-status.ts +98 -0
- package/src/plugins/tui/tsconfig.typecheck.json +9 -2
- package/src/plugins/tui/tsdown.config.ts +3 -5
- package/src/plugins/tui/tui.ts +1 -2
- package/src/routing.yml +36 -0
- package/src/skills/README.md +16 -1
- package/src/skills/artifact-management/SKILL.md +10 -67
- package/src/skills/artifact-management/references/artifact-templates.md +71 -0
- package/src/skills/auto-continue/SKILL.md +10 -0
- package/src/skills/code-review-checklist/SKILL.md +11 -44
- package/src/skills/code-review-checklist/references/review-checklists.md +54 -0
- package/src/skills/instruction-forge/SKILL.md +57 -0
- package/src/skills/instruction-forge/references/agents-md-doctrine.md +50 -0
- package/src/skills/instruction-forge/references/eval-doctrine.md +37 -0
- package/src/skills/instruction-forge/references/skill-doctrine.md +62 -0
- package/src/skills/memory-bank/SKILL.md +11 -90
- package/src/skills/memory-bank/references/anti-patterns.md +33 -0
- package/src/skills/memory-bank/references/product-adoption.md +19 -0
- package/src/skills/memory-bank/references/storage-model.md +21 -0
- package/src/skills/memory-bank/references/structure-and-frequency.md +44 -0
- package/src/skills/reflect/SKILL.md +1 -0
- package/src/skills/session-goal/SKILL.md +7 -54
- package/src/skills/session-goal/references/goal-format.md +26 -0
- package/src/skills/session-goal/references/session-reuse.md +44 -0
- package/src/skills/tdd-with-agents/SKILL.md +11 -101
- package/src/skills/tdd-with-agents/references/advanced-testing-patterns.md +58 -0
- package/src/skills/tdd-with-agents/references/testing-by-layer.md +60 -0
- package/src/skills/visual-review-pipeline/SKILL.md +11 -120
- package/src/skills/visual-review-pipeline/references/findings-schema.md +49 -0
- package/src/skills/visual-review-pipeline/references/workflow-steps.md +111 -0
- package/scripts/hooks/log-session-start.sh +0 -48
- package/scripts/hooks/validate-post-conditions.sh +0 -21
- package/scripts/hooks/validate-talos-scope.sh +0 -50
- package/scripts/hooks/validate-tool-safety.sh +0 -49
- package/src/pantheon/goal-loop.ts +0 -314
- package/src/pantheon/idle-continuation.ts +0 -52
- package/src/pantheon/todo-preserve.ts +0 -301
- package/src/pantheon/tool-ceiling.ts +0 -159
- package/src/pantheon/v2-bridge.ts +0 -153
- package/src/plugin-v2.ts +0 -2954
- package/src/plugins/pantheon-hooks.ts +0 -1433
- package/src/plugins/tui/dist/server-v2.d.ts +0 -30
- package/src/plugins/tui/dist/server-v2.d.ts.map +0 -1
- package/src/plugins/tui/dist/server-v2.js +0 -33
- package/src/plugins/tui/dist/server-v2.js.map +0 -1
- package/src/plugins/tui/dist/tui-v2.d.ts +0 -1039
- package/src/plugins/tui/dist/tui-v2.d.ts.map +0 -1
- package/src/plugins/tui/dist/tui-v2.js +0 -4597
- package/src/plugins/tui/dist/tui-v2.js.map +0 -1
- package/src/plugins/tui/src/index-v2.tsx +0 -4496
- package/src/plugins/tui/src/server-v2.ts +0 -28
- package/src/plugins/tui/tui-v2.ts +0 -2
- /package/src/pantheon/{v2-decision-budget.ts → decision-budget.ts} +0 -0
- /package/src/pantheon/{v2-decision-egress.ts → decision-egress.ts} +0 -0
- /package/src/pantheon/{v2-decision-events.ts → decision-events.ts} +0 -0
- /package/src/pantheon/{v2-decision-heuristic.ts → decision-heuristic.ts} +0 -0
- /package/src/pantheon/{v2-decision-premises.ts → decision-premises.ts} +0 -0
- /package/src/pantheon/{v2-decision-rank.ts → decision-rank.ts} +0 -0
- /package/src/pantheon/{v2-decision-verify.ts → decision-verify.ts} +0 -0
- /package/src/pantheon/{v2-delegation-enforce.ts → delegation-policy.ts} +0 -0
- /package/src/pantheon/{v2-model-overrides.ts → model-overrides.ts} +0 -0
- /package/src/pantheon/{v2-native-decisions.ts → native-decisions.ts} +0 -0
- /package/src/plugins/tui/src/{opencode-v2.d.ts → opencode.d.ts} +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update notifier core (TUI-local copy — the bundle must stay self-contained,
|
|
3
|
+
* same precedent as cost-data.ts/model-pricing.ts).
|
|
4
|
+
*
|
|
5
|
+
* Pin + notify, never silent auto-update: one notice per newer version,
|
|
6
|
+
* TTL-cached, offline-safe, and a stable install is never advertised a beta
|
|
7
|
+
* (the update guard owns that crossing). docs/design/2.0-settings-and-install.md
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const UPDATE_CHECK_TTL_MS = 6 * 60 * 60 * 1000
|
|
11
|
+
|
|
12
|
+
export interface UpdateCheckState {
|
|
13
|
+
/** Last version a notice was surfaced for (no repeats per version). */
|
|
14
|
+
lastNotifiedVersion?: string
|
|
15
|
+
/** Last time the registry was queried, for the TTL. */
|
|
16
|
+
lastCheckMs?: number
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface UpdateNoticeInput {
|
|
20
|
+
currentVersion: string
|
|
21
|
+
latestVersion: string
|
|
22
|
+
state?: UpdateCheckState
|
|
23
|
+
nowMs?: number
|
|
24
|
+
ttlMs?: number
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface UpdateNotice {
|
|
28
|
+
version: string
|
|
29
|
+
message: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Semver-ish compare for X.Y.Z[-beta.N]; betas sort before their release. */
|
|
33
|
+
export function comparePantheonVersions(left: string, right: string): number {
|
|
34
|
+
const parse = (version: string) => {
|
|
35
|
+
const match = String(version)
|
|
36
|
+
.trim()
|
|
37
|
+
.match(/^(\d+)\.(\d+)\.(\d+)(?:-beta\.(\d+))?$/)
|
|
38
|
+
if (!match) return null
|
|
39
|
+
const [, major = '', minor = '', patch = '', beta = ''] = match
|
|
40
|
+
return {
|
|
41
|
+
core: [+major, +minor, +patch] as [number, number, number],
|
|
42
|
+
beta: beta === '' ? Number.POSITIVE_INFINITY : +beta,
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const a = parse(left)
|
|
46
|
+
const b = parse(right)
|
|
47
|
+
if (!a || !b) return 0
|
|
48
|
+
const [aMajor, aMinor, aPatch] = a.core
|
|
49
|
+
const [bMajor, bMinor, bPatch] = b.core
|
|
50
|
+
if (aMajor !== bMajor) return aMajor - bMajor
|
|
51
|
+
if (aMinor !== bMinor) return aMinor - bMinor
|
|
52
|
+
if (aPatch !== bPatch) return aPatch - bPatch
|
|
53
|
+
return a.beta - b.beta
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function pickUpdateNotice(input: UpdateNoticeInput): UpdateNotice | null {
|
|
57
|
+
const { currentVersion, latestVersion, state = {}, nowMs = Date.now() } = input
|
|
58
|
+
const ttlMs = input.ttlMs ?? UPDATE_CHECK_TTL_MS
|
|
59
|
+
|
|
60
|
+
const lastCheck = state.lastCheckMs ?? 0
|
|
61
|
+
if (nowMs - lastCheck < ttlMs) return null
|
|
62
|
+
if (state.lastNotifiedVersion === latestVersion) return null
|
|
63
|
+
|
|
64
|
+
const stable = (version: string) => !/-beta\.\d+$/.test(version)
|
|
65
|
+
// A stable install is never advertised a beta: the update guard owns that
|
|
66
|
+
// crossing and requires explicit opt-in there.
|
|
67
|
+
if (stable(currentVersion) && !stable(latestVersion)) return null
|
|
68
|
+
|
|
69
|
+
if (comparePantheonVersions(latestVersion, currentVersion) <= 0) return null
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
version: latestVersion,
|
|
73
|
+
message:
|
|
74
|
+
`pantheon-opencode ${latestVersion} available — ` +
|
|
75
|
+
'changelog in /pantheon-settings, adopt with `pantheon-opencode update`',
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The state to persist after a check (notified or not) for the TTL. */
|
|
80
|
+
export function nextCheckState(
|
|
81
|
+
previous: UpdateCheckState,
|
|
82
|
+
notice: UpdateNotice | null,
|
|
83
|
+
nowMs: number,
|
|
84
|
+
): UpdateCheckState {
|
|
85
|
+
const lastNotifiedVersion = notice?.version ?? previous.lastNotifiedVersion
|
|
86
|
+
return {
|
|
87
|
+
lastCheckMs: nowMs,
|
|
88
|
+
...(lastNotifiedVersion !== undefined ? { lastNotifiedVersion } : {}),
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* update-status.ts — the Updates section of the settings window.
|
|
3
|
+
*
|
|
4
|
+
* TUI-local; derives rows from the update-notice.ts primitives. The registry
|
|
5
|
+
* fetch and state persistence stay in the .tsx glue (host side) — this module
|
|
6
|
+
* only classifies the channel and builds rows from injected state, so the
|
|
7
|
+
* whole thing is testable without network.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { SettingsRow, SettingsSection } from './pantheon-settings-state.ts'
|
|
11
|
+
import {
|
|
12
|
+
comparePantheonVersions,
|
|
13
|
+
UPDATE_CHECK_TTL_MS,
|
|
14
|
+
type UpdateCheckState,
|
|
15
|
+
} from './update-notice.ts'
|
|
16
|
+
|
|
17
|
+
export type UpdateChannel = 'stable' | 'beta'
|
|
18
|
+
|
|
19
|
+
/** The running version's channel: a `-beta.N` suffix rides the beta dist-tag. */
|
|
20
|
+
export function updateChannelFor(version: string): UpdateChannel {
|
|
21
|
+
return /-beta\.\d+$/.test(version) ? 'beta' : 'stable'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The npm dist-tag the registry check should query for the channel. */
|
|
25
|
+
export function registryTagForChannel(channel: UpdateChannel): string {
|
|
26
|
+
return channel === 'beta' ? 'beta' : 'latest'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function registryUrlForChannel(channel: UpdateChannel): string {
|
|
30
|
+
return `https://registry.npmjs.org/pantheon-opencode/${registryTagForChannel(channel)}`
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function formatAgo(ms: number): string {
|
|
34
|
+
if (ms < 60_000) return 'just now'
|
|
35
|
+
if (ms < 3_600_000) return `${Math.floor(ms / 60_000)}m ago`
|
|
36
|
+
if (ms < 86_400_000) return `${Math.floor(ms / 3_600_000)}h ago`
|
|
37
|
+
return `${Math.floor(ms / 86_400_000)}d ago`
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface UpdatesSectionInput {
|
|
41
|
+
currentVersion: string
|
|
42
|
+
state: UpdateCheckState
|
|
43
|
+
/** Latest version seen this session (a check-now inside this window). */
|
|
44
|
+
lastCheckedVersion?: string
|
|
45
|
+
/** A check-now is in flight (this window). */
|
|
46
|
+
checking?: boolean
|
|
47
|
+
nowMs?: number
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function buildUpdatesSection(input: UpdatesSectionInput): SettingsSection {
|
|
51
|
+
const nowMs = input.nowMs ?? Date.now()
|
|
52
|
+
const channel = updateChannelFor(input.currentVersion)
|
|
53
|
+
const lastCheckMs = input.state.lastCheckMs
|
|
54
|
+
const latest = input.lastCheckedVersion ?? input.state.lastNotifiedVersion
|
|
55
|
+
|
|
56
|
+
const rows: SettingsRow[] = [
|
|
57
|
+
{
|
|
58
|
+
id: 'update.channel',
|
|
59
|
+
title: `Channel: ${channel}`,
|
|
60
|
+
description: 'stable tracks npm `latest`; beta tracks npm `beta`',
|
|
61
|
+
selectable: false,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'update.check',
|
|
65
|
+
title: 'Check now',
|
|
66
|
+
description: input.checking
|
|
67
|
+
? 'checking…'
|
|
68
|
+
: lastCheckMs
|
|
69
|
+
? `last check ${formatAgo(nowMs - lastCheckMs)}`
|
|
70
|
+
: 'never checked',
|
|
71
|
+
marker: ' → ',
|
|
72
|
+
selectable: true,
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
if (latest) {
|
|
77
|
+
// Same guard as pickUpdateNotice: a stable install is never advertised a
|
|
78
|
+
// beta — the update CLI owns that crossing (explicit opt-in).
|
|
79
|
+
const stable = (version: string) => !/-beta\.\d+$/.test(version)
|
|
80
|
+
const newer =
|
|
81
|
+
comparePantheonVersions(latest, input.currentVersion) > 0 &&
|
|
82
|
+
!(stable(input.currentVersion) && !stable(latest))
|
|
83
|
+
rows.push({
|
|
84
|
+
id: 'update.latest',
|
|
85
|
+
title: newer ? `Update available: v${latest}` : `Up to date (latest seen v${latest})`,
|
|
86
|
+
description: newer ? 'adopt with `pantheon-opencode update`' : 'checked against the registry',
|
|
87
|
+
marker: newer ? '[!]' : '[✓]',
|
|
88
|
+
selectable: false,
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
id: 'updates',
|
|
94
|
+
title: 'Updates',
|
|
95
|
+
hint: `refresh = \`pantheon-opencode update\` · notice TTL ${UPDATE_CHECK_TTL_MS / 3_600_000}h`,
|
|
96
|
+
rows,
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"//": "Typecheck gate for the
|
|
2
|
+
"//": "Typecheck gate for the settings window sources. `tsc --noEmit` at the package root was a no-op: with no tsconfig in this directory tsc walked up to the repo tsconfig.json, which excludes src/plugins/tui entirely — so nothing here was checked. tsdown bundles without type-checking, which is how a missing SettingsRow import type shipped unnoticed. This config points tsc at the settings modules (pure state + view + sections) so a type error there fails `npm run typecheck`. The legacy entry (src/index.tsx) is intentionally NOT included: it carries pre-existing type errors out of scope for this gate. Keep this file strict JSON — the repo pre-commit `check-json` hook rejects comments.",
|
|
3
3
|
"extends": "./tsconfig.build.json",
|
|
4
|
-
"include": [
|
|
4
|
+
"include": [
|
|
5
|
+
"src/pantheon-settings.tsx",
|
|
6
|
+
"src/pantheon-settings-state.ts",
|
|
7
|
+
"src/j1-gate-status.ts",
|
|
8
|
+
"src/update-status.ts",
|
|
9
|
+
"src/update-notice.ts",
|
|
10
|
+
"src/opencode.d.ts"
|
|
11
|
+
]
|
|
5
12
|
}
|
|
@@ -29,13 +29,13 @@ async function finalizeDistArtifacts(): Promise<void> {
|
|
|
29
29
|
|
|
30
30
|
/** Keep Rolldown's vendor source labels stable when a clean build uses a node_modules symlink. */
|
|
31
31
|
function normalizeHqtuiBundlePaths(name: string, contents: string): string {
|
|
32
|
-
if (name === 'tui
|
|
32
|
+
if (name === 'tui.js') {
|
|
33
33
|
return contents.replace(
|
|
34
34
|
/\/\/#region [^\n]*node_modules\/@profullstack\/hqtui\/dist\//g,
|
|
35
35
|
'//#region ../../../node_modules/@profullstack/hqtui/dist/',
|
|
36
36
|
)
|
|
37
37
|
}
|
|
38
|
-
if (name !== 'tui
|
|
38
|
+
if (name !== 'tui.js.map') return contents
|
|
39
39
|
|
|
40
40
|
const map = JSON.parse(contents) as { sources?: string[]; [key: string]: unknown }
|
|
41
41
|
if (!Array.isArray(map.sources)) return contents
|
|
@@ -50,9 +50,7 @@ function normalizeHqtuiBundlePaths(name: string, contents: string): string {
|
|
|
50
50
|
export default defineConfig({
|
|
51
51
|
entry: {
|
|
52
52
|
tui: 'src/index.tsx',
|
|
53
|
-
'tui-v2': 'src/index-v2.tsx',
|
|
54
53
|
server: 'src/server.ts',
|
|
55
|
-
'server-v2': 'src/server-v2.ts',
|
|
56
54
|
},
|
|
57
55
|
format: ['esm'],
|
|
58
56
|
platform: 'node',
|
|
@@ -61,7 +59,7 @@ export default defineConfig({
|
|
|
61
59
|
outExtensions: () => ({ js: '.js' }),
|
|
62
60
|
dts: {
|
|
63
61
|
tsconfig: join(__dirname, 'tsconfig.build.json'),
|
|
64
|
-
entry: ['src/index.tsx', 'src/
|
|
62
|
+
entry: ['src/index.tsx', 'src/server.ts'],
|
|
65
63
|
},
|
|
66
64
|
define: {
|
|
67
65
|
__PANTHEON_VERSION__: JSON.stringify(pkg.version),
|
package/src/plugins/tui/tui.ts
CHANGED
package/src/routing.yml
CHANGED
|
@@ -179,6 +179,7 @@ agents:
|
|
|
179
179
|
- auto-continue
|
|
180
180
|
- codemap
|
|
181
181
|
- prompt-refinery
|
|
182
|
+
- instruction-forge
|
|
182
183
|
- context-compression
|
|
183
184
|
- incremental-implementation
|
|
184
185
|
- loop-engineering
|
|
@@ -666,3 +667,38 @@ full_auto:
|
|
|
666
667
|
# for a bounded fix; use focused verification. This section documents guards
|
|
667
668
|
# and defaults only; the plugin uses GOAL_LOOP_DEFAULTS directly.
|
|
668
669
|
# Wave 3 (PR #46): one active goal per session (pending → in_progress → done).
|
|
670
|
+
|
|
671
|
+
# ─── Named behaviors: the only override surface (2.0) ─────────────────────
|
|
672
|
+
# Each id is the SINGLE addressable behavior a user may disable or replace
|
|
673
|
+
# via .pantheon/overrides.json (project) or pantheon-overrides.json in the
|
|
674
|
+
# global config dir (project wins per id). kind: install → owner is the file
|
|
675
|
+
# the installer writes ("disable" skips the copy, "replace" writes content
|
|
676
|
+
# instead of the canonical body, 8000-char cap). kind: runtime → a named gate
|
|
677
|
+
# the plugin reads at setup ("disable" turns it off; "replace" is not
|
|
678
|
+
# supported for runtime behaviors in 2.0).
|
|
679
|
+
# Override FILES are never inventoried: reconcile, uninstall and upgrades
|
|
680
|
+
# leave them alone. Anything not listed here is NOT overridable — add the id
|
|
681
|
+
# here first, then the override. secret-scan is deliberately absent: it is
|
|
682
|
+
# not user-overridable.
|
|
683
|
+
behaviors:
|
|
684
|
+
- id: skill-auto-continue
|
|
685
|
+
kind: install
|
|
686
|
+
owner: src/skills/auto-continue/SKILL.md
|
|
687
|
+
- id: skill-tdd-with-agents
|
|
688
|
+
kind: install
|
|
689
|
+
owner: src/skills/tdd-with-agents/SKILL.md
|
|
690
|
+
- id: skill-code-review-checklist
|
|
691
|
+
kind: install
|
|
692
|
+
owner: src/skills/code-review-checklist/SKILL.md
|
|
693
|
+
- id: skill-prompt-refinery
|
|
694
|
+
kind: install
|
|
695
|
+
owner: src/skills/prompt-refinery/SKILL.md
|
|
696
|
+
- id: gate-idle-todo-enforcer
|
|
697
|
+
kind: runtime
|
|
698
|
+
owner: src/plugin.ts (idle todo enforcer)
|
|
699
|
+
- id: gate-context-pruner
|
|
700
|
+
kind: runtime
|
|
701
|
+
owner: src/pantheon/context-pruner.ts
|
|
702
|
+
- id: gate-j1-risk-gate
|
|
703
|
+
kind: runtime
|
|
704
|
+
owner: src/pantheon/jev-risk-gate.ts
|
package/src/skills/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Skills are reference modules loaded on demand by agents. Each skill provides domain-specific knowledge — architecture patterns, security checklists, optimization strategies, and implementation guides. Agents load skills when their task matches the skill's description, keeping context focused and token-efficient.
|
|
6
6
|
|
|
7
|
-
There are **
|
|
7
|
+
There are **23 skills** divided into **6 domains**.
|
|
8
8
|
|
|
9
9
|
## Skills by Domain
|
|
10
10
|
|
|
@@ -98,6 +98,18 @@ There are **22 skills** divided into **5 domains**.
|
|
|
98
98
|
- Automated visual review pipeline — Playwright screenshots, self-analysis, fix loop, escalation.
|
|
99
99
|
- Used by: Aphrodite
|
|
100
100
|
|
|
101
|
+
### Domain 6: Meta
|
|
102
|
+
|
|
103
|
+
21. **agent-forge** — `agent-forge/SKILL.md`
|
|
104
|
+
- Forge a new OpenCode agent on demand — interview, canonical draft, confirm, write to project or user scope; never shadows a specialist.
|
|
105
|
+
- Used by: Zeus
|
|
106
|
+
22. **prompt-refinery** — `prompt-refinery/SKILL.md`
|
|
107
|
+
- Turn a vague multi-concern request into a usable brief — silent internal adjust by default; the full contract is only via `>>`.
|
|
108
|
+
- Used by: Zeus
|
|
109
|
+
23. **instruction-forge** — `instruction-forge/SKILL.md`
|
|
110
|
+
- Write and maintain AI instructions — where a rule lives, the contract, and testing that it fires (references/ for the doctrine).
|
|
111
|
+
- Used by: Zeus
|
|
112
|
+
|
|
101
113
|
## Skills File Structure
|
|
102
114
|
|
|
103
115
|
Each skill follows a consistent layout:
|
|
@@ -145,6 +157,9 @@ agent grants, and skill inventory.
|
|
|
145
157
|
| 18 | spec-driven-development | Planning | Athena |
|
|
146
158
|
| 19 | verification-planning | Planning | Athena, Zeus |
|
|
147
159
|
| 20 | visual-review-pipeline | Frontend Development | Aphrodite |
|
|
160
|
+
| 21 | agent-forge | Meta | Zeus |
|
|
161
|
+
| 22 | prompt-refinery | Meta | Zeus |
|
|
162
|
+
| 23 | instruction-forge | Meta | Zeus, Athena |
|
|
148
163
|
|
|
149
164
|
---
|
|
150
165
|
|
|
@@ -9,29 +9,6 @@ Structured artifact trail for planned, multi-phase, or materially risky implemen
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
## Temp Folder
|
|
13
|
-
|
|
14
|
-
All ephemeral artifacts live in `.pantheon/memory-bank/.tmp/` — gitignored and wiped on sprint close.
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
.pantheon/memory-bank/
|
|
18
|
-
├── .tmp/ ← GITIGNORED — ephemeral artifacts
|
|
19
|
-
│ ├── PLAN-<feature>.md
|
|
20
|
-
│ ├── IMPL-phase1-hermes.md
|
|
21
|
-
│ ├── IMPL-phase1-aphrodite.md
|
|
22
|
-
│ └── REVIEW-<feature>.md
|
|
23
|
-
├── _notes/ ← permanent ADRs; Git tracking follows repository policy
|
|
24
|
-
│ └── ADR-<topic>.md
|
|
25
|
-
├── 01-active-context.md
|
|
26
|
-
└── 02-progress-log.md
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Memory Bank files are not automatically versioned or shared across clones.
|
|
30
|
-
Check the repository's ignore/commit policy before relying on `_tasks/` records
|
|
31
|
-
or other files being tracked; `_tasks/` may be Git-ignored.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
12
|
## Artifact Types
|
|
36
13
|
|
|
37
14
|
| Prefix | Location | Ephemeral? | Produced by |
|
|
@@ -65,50 +42,6 @@ or other files being tracked; `_tasks/` may be Git-ignored.
|
|
|
65
42
|
|
|
66
43
|
---
|
|
67
44
|
|
|
68
|
-
## Templates
|
|
69
|
-
|
|
70
|
-
### PLAN
|
|
71
|
-
```markdown
|
|
72
|
-
# PLAN-<feature>
|
|
73
|
-
**Date:** YYYY-MM-DD **Status:** Awaiting Approval
|
|
74
|
-
|
|
75
|
-
## Goal
|
|
76
|
-
[One sentence]
|
|
77
|
-
|
|
78
|
-
## Phases
|
|
79
|
-
1. Phase 1 — @hermes
|
|
80
|
-
2. Phase 2 — @aphrodite
|
|
81
|
-
|
|
82
|
-
## Risks
|
|
83
|
-
- [Risk]
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### IMPL
|
|
87
|
-
```markdown
|
|
88
|
-
# IMPL-<phase>-<agent>
|
|
89
|
-
**Date:** YYYY-MM-DD **Status:** Awaiting Themis Review
|
|
90
|
-
|
|
91
|
-
## What Was Implemented
|
|
92
|
-
- [file] — [what changed]
|
|
93
|
-
|
|
94
|
-
## Tests
|
|
95
|
-
- ✅ X tests / Coverage: Y%
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### REVIEW
|
|
99
|
-
```markdown
|
|
100
|
-
# REVIEW-<feature>
|
|
101
|
-
**Status:** APPROVED | NEEDS_REVISION | FAILED
|
|
102
|
-
|
|
103
|
-
## Verdict
|
|
104
|
-
[APPROVED | NEEDS_REVISION | FAILED]
|
|
105
|
-
|
|
106
|
-
## Issues
|
|
107
|
-
- CRITICAL: X / HIGH: Y / MEDIUM: Z
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
45
|
## Human Pause Points
|
|
113
46
|
|
|
114
47
|
1. **After a required PLAN** → pause only when a material scope/risk decision needs approval.
|
|
@@ -124,3 +57,13 @@ or other files being tracked; `_tasks/` may be Git-ignored.
|
|
|
124
57
|
@mnemosyne Clean tmp # Wipes .tmp/ without closing sprint
|
|
125
58
|
@mnemosyne List artifacts # Check what's in .tmp/
|
|
126
59
|
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Routing
|
|
64
|
+
|
|
65
|
+
| Action / trigger | Reference |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Creating an artifact: the `.tmp/` layout or the PLAN/IMPL/REVIEW templates | [references/artifact-templates.md](references/artifact-templates.md) |
|
|
68
|
+
|
|
69
|
+
A missing reference interrupts the action — read nothing in its place, never improvise from memory.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Artifact Management — Templates
|
|
2
|
+
|
|
3
|
+
Detail companion for `SKILL.md`. Read on demand when creating an artifact and
|
|
4
|
+
you need the `.tmp/` layout or a PLAN/IMPL/REVIEW template. Artifact types,
|
|
5
|
+
who-generates-what, proportional-use rules, pause points, and cleanup stay in
|
|
6
|
+
`SKILL.md`.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Temp Folder
|
|
11
|
+
|
|
12
|
+
All ephemeral artifacts live in `.pantheon/memory-bank/.tmp/` — gitignored and wiped on sprint close.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
.pantheon/memory-bank/
|
|
16
|
+
├── .tmp/ ← GITIGNORED — ephemeral artifacts
|
|
17
|
+
│ ├── PLAN-<feature>.md
|
|
18
|
+
│ ├── IMPL-phase1-hermes.md
|
|
19
|
+
│ ├── IMPL-phase1-aphrodite.md
|
|
20
|
+
│ └── REVIEW-<feature>.md
|
|
21
|
+
├── _notes/ ← permanent ADRs; Git tracking follows repository policy
|
|
22
|
+
│ └── ADR-<topic>.md
|
|
23
|
+
├── 01-active-context.md
|
|
24
|
+
└── 02-progress-log.md
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Memory Bank files are not automatically versioned or shared across clones.
|
|
28
|
+
Check the repository's ignore/commit policy before relying on `_tasks/` records
|
|
29
|
+
or other files being tracked; `_tasks/` may be Git-ignored.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
### PLAN
|
|
34
|
+
```markdown
|
|
35
|
+
# PLAN-<feature>
|
|
36
|
+
**Date:** YYYY-MM-DD **Status:** Awaiting Approval
|
|
37
|
+
|
|
38
|
+
## Goal
|
|
39
|
+
[One sentence]
|
|
40
|
+
|
|
41
|
+
## Phases
|
|
42
|
+
1. Phase 1 — @hermes
|
|
43
|
+
2. Phase 2 — @aphrodite
|
|
44
|
+
|
|
45
|
+
## Risks
|
|
46
|
+
- [Risk]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### IMPL
|
|
50
|
+
```markdown
|
|
51
|
+
# IMPL-<phase>-<agent>
|
|
52
|
+
**Date:** YYYY-MM-DD **Status:** Awaiting Themis Review
|
|
53
|
+
|
|
54
|
+
## What Was Implemented
|
|
55
|
+
- [file] — [what changed]
|
|
56
|
+
|
|
57
|
+
## Tests
|
|
58
|
+
- ✅ X tests / Coverage: Y%
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### REVIEW
|
|
62
|
+
```markdown
|
|
63
|
+
# REVIEW-<feature>
|
|
64
|
+
**Status:** APPROVED | NEEDS_REVISION | FAILED
|
|
65
|
+
|
|
66
|
+
## Verdict
|
|
67
|
+
[APPROVED | NEEDS_REVISION | FAILED]
|
|
68
|
+
|
|
69
|
+
## Issues
|
|
70
|
+
- CRITICAL: X / HIGH: Y / MEDIUM: Z
|
|
71
|
+
```
|
|
@@ -84,6 +84,16 @@ placeholder.
|
|
|
84
84
|
|
|
85
85
|
---
|
|
86
86
|
|
|
87
|
+
## Routing
|
|
88
|
+
|
|
89
|
+
| Action / trigger | Reference |
|
|
90
|
+
|---|---|
|
|
91
|
+
| A delegation times out, you need a cooldown template or the tracking-table format, or you are about to checkpoint | [references/auto-continue-details.md](references/auto-continue-details.md) |
|
|
92
|
+
|
|
93
|
+
A missing reference interrupts the action — read nothing in its place, never improvise from memory.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
87
97
|
## Details under demand
|
|
88
98
|
|
|
89
99
|
The cooldown templates, timeout/retry enforcement (the single authority is
|
|
@@ -35,40 +35,7 @@ biome check --write --unsafe <files>
|
|
|
35
35
|
|
|
36
36
|
## Review Checklist
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
- [ ] Logic is correct and complete
|
|
40
|
-
- [ ] Edge cases handled
|
|
41
|
-
- [ ] Error handling appropriate
|
|
42
|
-
- [ ] Performance acceptable
|
|
43
|
-
|
|
44
|
-
### Code Quality
|
|
45
|
-
- [ ] No duplication (DRY principle)
|
|
46
|
-
- [ ] Single responsibility functions
|
|
47
|
-
- [ ] Clear and descriptive naming
|
|
48
|
-
- [ ] Reasonable complexity (no god functions)
|
|
49
|
-
- [ ] Proper file sizes (<300 lines)
|
|
50
|
-
|
|
51
|
-
### Testing
|
|
52
|
-
- [ ] Tests cover the changed behavior where meaningful; documentation/format-only changes do not need invented tests
|
|
53
|
-
- [ ] Apply an explicit repository coverage threshold only when measurable and relevant to the changed code
|
|
54
|
-
- [ ] Integration tests where the change crosses workflow boundaries
|
|
55
|
-
- [ ] Relevant edge cases tested for the changed behavior/risk
|
|
56
|
-
- [ ] Relevant error conditions tested
|
|
57
|
-
|
|
58
|
-
### Security (OWASP Top 10)
|
|
59
|
-
- [ ] Input validation present
|
|
60
|
-
- [ ] No hardcoded secrets/credentials
|
|
61
|
-
- [ ] No XXE, CSRF, XSS vulnerabilities
|
|
62
|
-
- [ ] Authentication/authorization proper
|
|
63
|
-
- [ ] Sensitive data encrypted
|
|
64
|
-
- [ ] Rate limiting on sensitive endpoints
|
|
65
|
-
- [ ] Audit logging for security events
|
|
66
|
-
|
|
67
|
-
### Documentation
|
|
68
|
-
- [ ] Public functions documented
|
|
69
|
-
- [ ] Comments explain WHY not WHAT
|
|
70
|
-
- [ ] README/guides accurate
|
|
71
|
-
- [ ] API documentation complete
|
|
38
|
+
Run the itemized pass (Correctness, Code Quality, Testing, Security/OWASP, Documentation) and the SOLID check from [references/review-checklists.md](references/review-checklists.md) before issuing a verdict.
|
|
72
39
|
|
|
73
40
|
---
|
|
74
41
|
|
|
@@ -117,16 +84,6 @@ For comprehensive reviews, run 5 checks simultaneously:
|
|
|
117
84
|
|
|
118
85
|
---
|
|
119
86
|
|
|
120
|
-
## SOLID Principles Check
|
|
121
|
-
|
|
122
|
-
- **S**ingle Responsibility: Each class/function does one thing
|
|
123
|
-
- **O**pen/Closed: Extensible without modification
|
|
124
|
-
- **L**iskov Substitution: Subtypes behave like base types
|
|
125
|
-
- **I**nterface Segregation: Small, focused interfaces
|
|
126
|
-
- **D**ependency Inversion: Depend on abstractions, not concretions
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
87
|
## Anti-Patterns
|
|
131
88
|
|
|
132
89
|
- ❌ Reviewing entire file instead of diff
|
|
@@ -134,3 +91,13 @@ For comprehensive reviews, run 5 checks simultaneously:
|
|
|
134
91
|
- ❌ Ignoring security implications
|
|
135
92
|
- ❌ Vague feedback ("looks good", "needs work")
|
|
136
93
|
- ❌ Nitpicking style over substance
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Routing
|
|
98
|
+
|
|
99
|
+
| Action / trigger | Reference |
|
|
100
|
+
|---|---|
|
|
101
|
+
| Executing the itemized review pass (Correctness, Quality, Testing, Security, Documentation) or the SOLID check | [references/review-checklists.md](references/review-checklists.md) |
|
|
102
|
+
|
|
103
|
+
A missing reference interrupts the action — read nothing in its place, never improvise from memory.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Code Review — Itemized Checklists and SOLID
|
|
2
|
+
|
|
3
|
+
Detail companion for `SKILL.md`. Read on demand when executing the itemized
|
|
4
|
+
review pass. The review scope, automated-check-first rule, feedback format,
|
|
5
|
+
severity definitions, and anti-patterns stay in `SKILL.md`.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Review Checklist
|
|
10
|
+
|
|
11
|
+
### Correctness
|
|
12
|
+
- [ ] Logic is correct and complete
|
|
13
|
+
- [ ] Edge cases handled
|
|
14
|
+
- [ ] Error handling appropriate
|
|
15
|
+
- [ ] Performance acceptable
|
|
16
|
+
|
|
17
|
+
### Code Quality
|
|
18
|
+
- [ ] No duplication (DRY principle)
|
|
19
|
+
- [ ] Single responsibility functions
|
|
20
|
+
- [ ] Clear and descriptive naming
|
|
21
|
+
- [ ] Reasonable complexity (no god functions)
|
|
22
|
+
- [ ] Proper file sizes (<300 lines)
|
|
23
|
+
|
|
24
|
+
### Testing
|
|
25
|
+
- [ ] Tests cover the changed behavior where meaningful; documentation/format-only changes do not need invented tests
|
|
26
|
+
- [ ] Apply an explicit repository coverage threshold only when measurable and relevant to the changed code
|
|
27
|
+
- [ ] Integration tests where the change crosses workflow boundaries
|
|
28
|
+
- [ ] Relevant edge cases tested for the changed behavior/risk
|
|
29
|
+
- [ ] Relevant error conditions tested
|
|
30
|
+
|
|
31
|
+
### Security (OWASP Top 10)
|
|
32
|
+
- [ ] Input validation present
|
|
33
|
+
- [ ] No hardcoded secrets/credentials
|
|
34
|
+
- [ ] No XXE, CSRF, XSS vulnerabilities
|
|
35
|
+
- [ ] Authentication/authorization proper
|
|
36
|
+
- [ ] Sensitive data encrypted
|
|
37
|
+
- [ ] Rate limiting on sensitive endpoints
|
|
38
|
+
- [ ] Audit logging for security events
|
|
39
|
+
|
|
40
|
+
### Documentation
|
|
41
|
+
- [ ] Public functions documented
|
|
42
|
+
- [ ] Comments explain WHY not WHAT
|
|
43
|
+
- [ ] README/guides accurate
|
|
44
|
+
- [ ] API documentation complete
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## SOLID Principles Check
|
|
49
|
+
|
|
50
|
+
- **S**ingle Responsibility: Each class/function does one thing
|
|
51
|
+
- **O**pen/Closed: Extensible without modification
|
|
52
|
+
- **L**iskov Substitution: Subtypes behave like base types
|
|
53
|
+
- **I**nterface Segregation: Small, focused interfaces
|
|
54
|
+
- **D**ependency Inversion: Depend on abstractions, not concretions
|