feat: runtime smoke test, gitea actions workflows, runtime-checks record
check / check (push) Successful in 49s
check / check (push) Successful in 49s
This commit is contained in:
1 parent
d301ef5a62
commit
c92fe4db73
15 files changed
+847
-137
No files matched your search
+16
-16
@@ -55,7 +55,7 @@ Generator scope (deliberately small):
|
||||
|
||||
- strip non-OpenCode harness files (`agents/openai.yaml`, Claude plugin metadata) from the output tree
|
||||
- parse each SKILL.md frontmatter → `manifest.json` entry: `{ id, name, description, autoinvoke,
|
||||
slash, path, files[] }`; `autoinvoke=false` when upstream sets `disable-model-invocation: true`
|
||||
slash, path, files[] }`; `autoinvoke=false` when upstream sets `disable-model-invocation: true`
|
||||
- render `agents/*.md` from templates + `classification.json` (skill allow/deny lists, version stamp)
|
||||
- regenerate `docs/skill-mapping.md` from `classification.json` (docs never drift from data)
|
||||
|
||||
@@ -68,14 +68,14 @@ D6), deprecated 0. Full table with classification + rationale: `docs/skill-mappi
|
||||
|
||||
Verified against V2 (`@opencode/plugin` ^2.x, `Plugin.define`):
|
||||
|
||||
| Requirement | V2 mechanism |
|
||||
| --- | --- |
|
||||
| Stable identity | `Plugin.define({ id: "haylan.pocock", setup })` |
|
||||
| Inject all skills | `await ctx.skill.transform(editor => editor.add({ id, name, description, path, content, autoinvoke, slash }))` per manifest entry; `path` = absolute SKILL.md location inside the installed package so supporting-file references resolve |
|
||||
| Options | `ctx.options` — validate and fail loudly (fastcrw pattern) |
|
||||
| Dangerous-git guardrails (D7) | `await ctx.tool.hook("execute.before", ...)` on shell tool; opt-in `{ guardrails: true }` |
|
||||
| Agent staleness hint | `await ctx.agent.list()` in setup; one-line console warning if `pocock`/`pocock-worker` missing or stamped version ≠ package version |
|
||||
| Packaging | `type: module`, `exports["."]`, dependency `@opencode/plugin`; installed via bun by OpenCode at startup |
|
||||
| Requirement | V2 mechanism |
|
||||
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Stable identity | `Plugin.define({ id: "haylan.pocock", setup })` |
|
||||
| Inject all skills | `await ctx.skill.transform(editor => editor.add({ id, name, description, path, content, autoinvoke, slash }))` per manifest entry; `path` = absolute SKILL.md location inside the installed package so supporting-file references resolve |
|
||||
| Options | `ctx.options` — validate and fail loudly (fastcrw pattern) |
|
||||
| Dangerous-git guardrails (D7) | `await ctx.tool.hook("execute.before", ...)` on shell tool; opt-in `{ guardrails: true }` |
|
||||
| Agent staleness hint | `await ctx.agent.list()` in setup; one-line console warning if `pocock`/`pocock-worker` missing or stamped version ≠ package version |
|
||||
| Packaging | `type: module`, `exports["."]`, dependency `@opencode/plugin`; installed via bun by OpenCode at startup |
|
||||
|
||||
Not needed: custom tools, MCP, websearch, auth. Keep the plugin surface minimal.
|
||||
|
||||
@@ -83,12 +83,12 @@ Not needed: custom tools, MCP, websearch, auth. Keep the plugin surface minimal.
|
||||
|
||||
Hierarchy (D5) — two core agents, one likely addition, rest rejected unless the matrix proves value:
|
||||
|
||||
| Agent | Mode | Role | Key V2 config |
|
||||
| --- | --- | --- | --- |
|
||||
| `pocock` | primary | Orchestrator: routes via `ask-matt`, walks grill→spec→tickets→build→review→retro, gates user-invoked skills behind explicit proposals, runs the `implement-spec` dispatch loop (integration branch + one worktree per ticket + frontier scheduling from its own merge record) | `permissions`: edit/shell allow; shell deny for destructive git on the main checkout; `skill` allow `*`; task allow |
|
||||
| `pocock-worker` | subagent | Builds one ticket test-first inside its prepared worktree, merges integration tip into its branch, reports; never pushes/stashes/worktrees/PRs; asks nothing | `permissions`: skill deny `*` + allow-list (tdd, codebase-design, diagnosing-bugs, stack skills); shell deny push/stash/reset --hard/clean/worktree/switch, `gh pr`/`gh issue close`; edit allow |
|
||||
| `pocock-reviewer` (candidate) | subagent | Read-only `code-review` fan-out over the integration branch; findings go back to the orchestrator, fixes run in a fresh worker | `permissions`: edit deny; shell allow git read commands only; skill allow code-review only |
|
||||
| `pocock-researcher` (likely reject) | subagent | Exploration notes | Built-in `explore`/`general` subagents already do this; a branded one adds drift risk, no capability |
|
||||
| Agent | Mode | Role | Key V2 config |
|
||||
| ----------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `pocock` | primary | Orchestrator: routes via `ask-matt`, walks grill→spec→tickets→build→review→retro, gates user-invoked skills behind explicit proposals, runs the `implement-spec` dispatch loop (integration branch + one worktree per ticket + frontier scheduling from its own merge record) | `permissions`: edit/shell allow; shell deny for destructive git on the main checkout; `skill` allow `*`; task allow |
|
||||
| `pocock-worker` | subagent | Builds one ticket test-first inside its prepared worktree, merges integration tip into its branch, reports; never pushes/stashes/worktrees/PRs; asks nothing | `permissions`: skill deny `*` + allow-list (tdd, codebase-design, diagnosing-bugs, stack skills); shell deny push/stash/reset --hard/clean/worktree/switch, `gh pr`/`gh issue close`; edit allow |
|
||||
| `pocock-reviewer` (candidate) | subagent | Read-only `code-review` fan-out over the integration branch; findings go back to the orchestrator, fixes run in a fresh worker | `permissions`: edit deny; shell allow git read commands only; skill allow code-review only |
|
||||
| `pocock-researcher` (likely reject) | subagent | Exploration notes | Built-in `explore`/`general` subagents already do this; a branded one adds drift risk, no capability |
|
||||
|
||||
Design requirements coverage (per mission): purpose/scope/IO contract in each agent's system body;
|
||||
skills via `action: skill` permission patterns; primary vs subagent via `mode`; spawn rights — only
|
||||
@@ -112,7 +112,7 @@ methodology depends on, e.g. grilling facts feeding `to-spec`).
|
||||
- Diff old vs new snapshot → added/removed/changed skill list → written into the changelog entry and
|
||||
`status.md`; changed skills are matched against `classification.json` to flag affected agents
|
||||
(regeneration is full but cheap and deterministic; "regenerate only what is necessary" is satisfied
|
||||
by determinism — unchanged inputs produce byte-identical outputs, so the git diff *is* the
|
||||
by determinism — unchanged inputs produce byte-identical outputs, so the git diff _is_ the
|
||||
affected-set report).
|
||||
- New upstream skills appear in the manifest automatically but land unclassified:
|
||||
`classification.json` defaults them to `skill` + `status: "needs-review"`, and the drift test fails
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Runtime checks — verified against real OpenCode v2
|
||||
|
||||
Environment: Windows 11, `opencode v2.0.29`, `@opencode/plugin@2.0.29`, 2026-10-14.
|
||||
Method: `scripts/smoke.ts` boots `opencode serve` (private server, Basic auth user `opencode`,
|
||||
password printed on stdout) in a temp fixture and asserts against the HTTP API. Result: **PASS**.
|
||||
|
||||
## Verified
|
||||
|
||||
- **Plugin loads and activates** from a local directory entry (`plugins: ["<abs path>/dist"]`);
|
||||
`GET /api/plugin` shows `haylan.pocock` with `state.status: "active"`.
|
||||
- A **file** entry (`file://.../dist/index.js`) is IGNORED — local plugin entries must be
|
||||
directories with a root `index`/`server` file (confirms fastcrw research). npm-name entries
|
||||
resolve through `exports` (to be re-verified after first registry publish, TODO 1.10).
|
||||
- **Skill injection works**: all 31 manifest skills registered (`GET /api/skill`); the 16
|
||||
user-invoked ones carry `autoinvoke: false`. The API **omits `autoinvoke` when true** (default).
|
||||
- **DMI honored natively**: file-loaded skills with upstream `disable-model-invocation: true`
|
||||
(e.g. a global `~/.agents/skills` install) show `autoinvoke: false` without our plugin.
|
||||
- **ID collisions**: when the same skill id also exists as a file-based skill (global install), the
|
||||
file-based entry is what `/api/skill` reports; plugin injection coexists without errors.
|
||||
(`pr`, absent from the tester's global install, was served from our package path.)
|
||||
- **Injected content must have frontmatter stripped** to match file-based loading
|
||||
(`markdown.content`); the plugin does this since 2026-10-14.
|
||||
- **Agent markdown with V2-native frontmatter decodes correctly** from `.opencode/agents/`:
|
||||
`pocock` (primary), `pocock-worker` / `pocock-reviewer` (subagent), descriptions intact, and the
|
||||
full `permissions` array survived decoding in order — verified on `pocock-worker`:
|
||||
`skill * deny` + `tdd/codebase-design/diagnosing-bugs allow`, `subagent * deny`, and all
|
||||
git/gh/glab shell denies present.
|
||||
- **Default permission floor** (v2.0.29): agents start with `{action:"*",resource:"*",effect:"allow"}`
|
||||
plus specific rules, among them `external_directory /tmp` and `/tmp/*` **allow** — the
|
||||
`/tmp/pocock-workers` worktree root needs no extra user config on this build (README still
|
||||
documents the rule for other setups/subagents).
|
||||
- **Injected skills do NOT become slash commands** (`GET /api/command` shows none for them;
|
||||
`Skill.Info` has no `slash` field). User-invoked steps are started via conversation with `pocock`
|
||||
(propose → yes → load) or by any agent explicitly loading the skill. File-based installs (global
|
||||
`~/.agents/skills`, or a `skills: [...]` directory source) keep slash behavior.
|
||||
- **Server API**: prefix `/api/*`, Basic auth (`opencode` + printed password); SPA HTML answers
|
||||
unknown non-/api paths with 200 — assert JSON, not status. `POST /api/location/reload` exists.
|
||||
Plugin loading is lazy (appears seconds after boot); `/openapi.json` requires auth.
|
||||
|
||||
## Known environment quirks (tester machine, not product issues)
|
||||
|
||||
- Windows: `server.kill()` under `shell:true` only kills `cmd.exe`; smoke uses
|
||||
`taskkill /PID <pid> /T /F`. Temp fixture deletion can lag behind handle release (EPERM warning);
|
||||
harmless, retried on next run.
|
||||
- The user's global `~/.agents/skills` already contains most Matt Pocock skills — smoke assertions
|
||||
are written to tolerate id collisions (presence + flags, not source path).
|
||||
Reference in new issue
Block a user