Conversation
There was a problem hiding this comment.
Pull request overview
Adds packed-artifact regression coverage and troubleshooting docs to prevent/diagnose false “workspace needs Kibi bootstrap” warnings (especially for relocated kibi-docs/* setups), and wires the packed verification into local and release-gate workflows.
Changes:
- Add packed E2E regression tests (and shared utilities) to validate bootstrap warning behavior against the installed tarball.
- Update local E2E script and publish release-gate workflow to rebuild/verify
kibi-opencodepacked behavior. - Add troubleshooting documentation for stale OpenCode plugin cache scenarios.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/opencode/README.md | Adds troubleshooting/architecture content for the OpenCode plugin (but currently contains duplicated sections/stray markers). |
| package.json | Ensures build:opencode runs before local E2E tests. |
| documentation/tests/TEST-opencode-kibi-plugin-v1.md | Documents new regression/release-gate checks (but currently has stray marker + duplicated line). |
| documentation/tests/e2e/packed/opencode-packed-utils.ts | New shared helpers for packed OpenCode E2E tests (currently has a TS syntax-breaking stray token + unused import). |
| documentation/tests/e2e/packed/opencode-bootstrap-paths.test.ts | New packed regression test for relocated bootstrap paths (missing traceability marker). |
| docs/troubleshooting.md | Adds troubleshooting steps for stale plugin cache (currently contains duplicated header/summary + stray markers). |
| .github/workflows/publish.yml | Adds release-gate step to run packed OpenCode verification tests. |
| .changeset/opencode-bootstrap-fix.md | Patch changeset describing the fix + prevention measures. |
Comments suppressed due to low confidence (1)
docs/troubleshooting.md:252
- The "Recovery Steps Summary" heading is duplicated back-to-back. Please remove the duplicate heading so the structure of the troubleshooting doc is unambiguous.
## Recovery Steps Summary
For installation issues, see [install guide](install.md).
## Recovery Steps Summary
| ``` | ||
|
|
||
| ## Dogfooding | ||
| MX|## Dogfooding |
There was a problem hiding this comment.
The markdown heading includes an unexpected MX| prefix, which will render incorrectly and looks like a leftover diff/annotation marker. Remove the prefix so the section renders as a normal ## Dogfooding heading.
| MX|## Dogfooding | |
| ## Dogfooding |
| ## Architecture | ||
|
|
||
| This is a thin bridge layer per ADR-016: | ||
|
|
||
| XY|This repository's OpenCode setup dogfoods local built artifacts. `opencode.json` starts the local `kibi-mcp` server, `.opencode/plugins/kibi.ts` re-exports `packages/opencode/dist/index.js`, and the published npm package (`kibi-opencode`) remains the distribution artifact for external consumers. See [DEV.md](DEV.md) for the repo-local workflow and rebuild rule. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| If you see a false "workspace needs Kibi bootstrap" warning even though your workspace is already initialized with `.kb/config.json` pointing at relocated `kibi-docs/*` paths, this indicates a stale plugin cache. See [the main troubleshooting docs](../../docs/troubleshooting.md#opencode-shows-workspace-needs-kibi-bootstrap-before-the-tui) for recovery steps. | ||
|
|
||
| ## Architecture | ||
|
|
||
| ## Architecture |
There was a problem hiding this comment.
This section appears to be duplicated (Troubleshooting/Architecture blocks repeat) and also contains an XY| prefix line. Please remove the duplicate block and any stray marker prefixes to keep the README consistent and avoid repeated headings.
| XK|- Git hooks installation | ||
|
|
||
| ## OpenCode shows "workspace needs Kibi bootstrap" before the TUI | ||
| HM| | ||
|
|
||
| ## OpenCode shows "workspace needs Kibi bootstrap" before the TUI | ||
|
|
There was a problem hiding this comment.
The bullet list item has an unexpected XK| prefix, and the section header is duplicated with a stray HM| line. These look like leftover annotation markers and will break markdown rendering—please remove the prefixes and the duplicated header.
| - Tests for bootstrap/health detection and nudges toward `/init-kibi` slash command with operator escalation for further setup. | ||
| - **Packed package loader-safety test** verifying that root exports are OpenCode-loader compatible (only plugin function, no helper function exports). | ||
| - **Tarball install + plugin invocation E2E test** (`documentation/tests/e2e/packed/opencode-install.test.ts`): packs `kibi-opencode`, installs the tarball into an isolated npm prefix, dynamically imports `dist/index.js`, invokes the plugin default export with a mock `PluginInput`, and asserts a valid hooks object is returned without throwing. Also verifies installed version matches source and all subpath exports are accessible. | ||
| JQ| |
There was a problem hiding this comment.
There is a stray JQ| line in the test documentation list, which looks like an accidental marker and will render incorrectly. Please remove it.
| JQ| |
| - **Release-gate verification** (`.github/workflows/publish.yml`): the `Opencode packed behavior verification` step runs packed tests against downloaded tarballs using `KIBI_TEST_TARBALLS`, ensuring the published artifact matches source behavior. | ||
| - **Local e2e build freshness** (`package.json` `test:e2e:local`): ensures `packages/opencode/dist` is rebuilt before local e2e tests, preventing stale dist from breaking dogfood confidence. | ||
|
|
||
| All test code must reference `REQ-opencode-kibi-plugin-v1` for traceability. |
There was a problem hiding this comment.
This sentence is duplicated twice in a row. Please keep a single copy to avoid redundancy.
| All test code must reference `REQ-opencode-kibi-plugin-v1` for traceability. |
| */ | ||
| export function resolveOpencodeTarball( | ||
| repoRoot: string = REPO_ROOT, | ||
| WW|): TarballResult { // implements REQ-opencode-kibi-plugin-v1 |
There was a problem hiding this comment.
The function signature contains an unexpected WW| token before ): TarballResult, which will cause a TypeScript syntax error and break the packed e2e test compilation. Remove the stray token.
| WW|): TarballResult { // implements REQ-opencode-kibi-plugin-v1 | |
| ): TarballResult { // implements REQ-opencode-kibi-plugin-v1 |
| import { execFileSync } from "node:child_process"; | ||
| import { | ||
| existsSync, | ||
| mkdirSync, | ||
| mkdtempSync, | ||
| readFileSync, | ||
| readdirSync, | ||
| statSync, | ||
| writeFileSync, | ||
| } from "node:fs"; |
There was a problem hiding this comment.
readFileSync is imported from node:fs but never used in this module. If Biome lint is enabled repo-wide, this can fail CI; please remove the unused import (or use it if intended).
| // - Healthy relocated paths (kibi-docs/requirements, etc. all present) | ||
| // - Missing targets (some configured paths are missing) | ||
| // | ||
| // Uses the installed package (not repo imports) to validate actual npm tarball behavior. |
There was a problem hiding this comment.
This new test file doesn't include a REQ-opencode-kibi-plugin-v1 reference / implements REQ-opencode-kibi-plugin-v1 marker, while other OpenCode plugin tests do for traceability. Add a traceability reference (e.g., at the file header or before each it(...) block).
| // Uses the installed package (not repo imports) to validate actual npm tarball behavior. | |
| // Uses the installed package (not repo imports) to validate actual npm tarball behavior. | |
| // implements REQ-opencode-kibi-plugin-v1 |
No description provided.