chore(voyage): release v5.0.0 — remove bespoke playground + /trekrevise + Handover 8; render produced artifacts to HTML + link, annotate via /playground

The v4.2/v4.3 bespoke playground SPA (~388 KB), the /trekrevise command,
Handover 8 (annotation → revision), the supporting lib/ modules
(anchor-parser, annotation-digest, markdown-write, revision-guard), the
Playwright e2e suite, and the @playwright/test / @axe-core/playwright
devDeps are removed. A browser walkthrough found the playground borderline
unusable, and it duplicated the official /playground plugin's
document-critique / diff-review templates.

In their place: scripts/render-artifact.mjs — a small, zero-dependency
renderer that turns a brief/plan/review .md into a self-contained,
design-system-styled, zero-network .html (frontmatter folded into a
<details> block). /trekbrief, /trekplan, and /trekreview call it on their
last step and print the file:// link; to annotate, run /playground
(document-critique) on the .md and paste the generated prompt back.

Resolves the v4.3.1-deferred findings as moot (their target files are
deleted). npm test green: 509 tests, 507 pass, 0 fail, 2 skipped.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-05-12 14:05:07 +02:00
commit 916d30f63e
96 changed files with 620 additions and 14716 deletions

View file

@ -726,47 +726,6 @@ After both complete:
- If only **minor** issues or clean: proceed without changes. Note the
review result in the plan.
### Inject plan_critic verdict into plan frontmatter (post-dedup, post-revise)
After the dedup pass completes and any blocker/major revisions are folded
in, atomically update the plan's frontmatter with the plan-critic verdict
so downstream surfaces (notably `playground/voyage-playground.html`
`buildArtifactKeyStat`) can read it without re-parsing the review JSON.
Phase 8 (write plan) precedes Phase 9 (adversarial review), so the
verdict cannot be in Phase 8's frontmatter template — it must be
injected here, after the verdict exists.
Read the verdict from `/tmp/plan-critic-out.json` and apply it via
`lib/util/markdown-write.mjs` `readAndUpdate`:
```js
import { readFileSync } from 'node:fs';
import { readAndUpdate } from `${CLAUDE_PLUGIN_ROOT}/lib/util/markdown-write.mjs`;
const criticVerdict = JSON.parse(readFileSync('/tmp/plan-critic-out.json', 'utf-8')).verdict;
const result = readAndUpdate(planPath, ({ frontmatter, body }) => {
frontmatter.plan_critic = criticVerdict;
return { frontmatter, body };
});
if (!result.valid) {
// Non-fatal: log warning. plan.md already exists from Phase 8;
// missing plan_critic is degraded UX, not blocking.
console.warn('plan_critic injection failed:', result.errors);
}
```
Field semantics:
- `plan_critic` — string. One of `APPROVE`, `APPROVE_WITH_NOTES`,
`REVISE`, or `BLOCK`. Matches the rubric in `plan-critic` agent
output. Omitted when the inject failed (Phase 9 surfaces a warning
in that case but does not abort).
Schema compatibility: `plan_critic` is **additive and optional**. The
plan validator (`lib/validators/plan-validator.mjs`) tolerates unknown
frontmatter keys, so this addition does NOT require a `plan_version`
bump. Plans written before this field was added validate identically.
## Phase 10 — Present and refine
Present a summary to the user:
@ -810,6 +769,29 @@ If the user asks questions or requests changes:
- Show what changed
- Re-present the summary
### Render to HTML + link (annotation via /playground)
After `plan.md` is final, render it to a self-contained HTML view in the
same project directory and print the `file://` link:
```bash
node ${CLAUDE_PLUGIN_ROOT}/scripts/render-artifact.mjs "{plan_path}"
```
This writes `{plan_dir}/plan.html` — a zero-network, design-system-styled
page (frontmatter folded into a `<details>` block, code fences in styled
`<pre>`). Print:
```
Plan rendered: file://{abs path to plan.html}
To annotate: open it, then run the `/playground` plugin
(document-critique template) on plan.md and paste the generated
prompt back here. Claude revises plan.md freehand from your notes.
```
If `render-artifact.mjs` exits non-zero, surface a one-line warning and
continue — the rendered view is a convenience, not a gate.
## Phase 11 — Handoff
### "save" / "later" / "done"