Conversation
Prevent false bootstrap warnings when .kb/config.json relocates Kibi documentation paths, and normalize configured existence targets exactly as the workspace-health contract requires. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Lock the healthy and missing-target behavior across plugin integration, prompt injection, and local plugin execution so relocated Kibi docs do not regress. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Make the documented local E2E command compile and execute the opencode local-plugin regression file so the relocated-path checks are exercised by the named verification path. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Prepare the patch release metadata for the workspace-health bootstrap-path fix so publishing picks up the relocated-doc warning correction. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
There was a problem hiding this comment.
Pull request overview
Fixes false “bootstrap needed” signals by making the OpenCode workspace health check honor documentation/sync paths configured in .kb/config.json, including relocated doc roots (e.g. kibi-docs/*).
Changes:
- Update
checkWorkspaceHealth()to derive existence checks from configured sync/doc paths via a newgetKbExistenceTargets()helper. - Add/extend unit + integration/e2e tests to cover relocated paths, missing targets, and prompt/telemetry behavior.
- Add a local e2e TS config and wire it into
test:e2e:local; update symbols manifest/tool naming references.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/opencode/src/workspace-health.ts | Uses config-driven existence targets when .kb/config.json defines paths. |
| packages/opencode/src/file-filter.ts | Adds getKbExistenceTargets() + stripToRoot() for turning configured patterns into filesystem existence checks. |
| packages/opencode/tests/workspace-health.test.ts | Adds coverage for relocated/custom paths and path normalization behavior. |
| packages/opencode/tests/file-filter.test.ts | Adds unit tests for stripToRoot() and getKbExistenceTargets() normalization. |
| packages/opencode/tests/prompt.test.ts | Ensures bootstrap guidance is omitted/included based on workspaceHealth.needsBootstrap. |
| packages/opencode/tests/index.test.ts | Verifies plugin warning tracking for bootstrap-needed under relocated path configs. |
| documentation/tests/e2e/tsconfig.local.json | Adds TS project for local plugin e2e test compilation. |
| documentation/tests/e2e/opencode-plugin-local.test.ts | Extends node e2e tests to cover relocated paths and bootstrap warnings. |
| package.json | Extends test:e2e:local to compile the new local e2e test suite. |
| documentation/symbols.yaml | Updates header tool name and adds new symbol entries for the new/changed functions. |
| .changeset/honor-sync-path-bootstrap.md | Patch changeset describing the bootstrap/health-check fix. |
| // Create the rest of the standard documentation dirs and symbols file so nothing is missing | ||
| const otherDocDirs = [ | ||
| "documentation/tests", | ||
| "documentation/adr", | ||
| "documentation/flags", | ||
| "documentation/events", | ||
| "documentation/facts", | ||
| ]; | ||
| for (const dir of otherDocDirs) { | ||
| fs.mkdirSync(path.join(tmpDir, dir), { recursive: true }); | ||
| } | ||
| fs.writeFileSync(path.join(tmpDir, "documentation", "symbols.yaml"), "[]"); |
There was a problem hiding this comment.
The setup comment says the test creates the rest of the standard documentation dirs “so nothing is missing”, but documentation/requirements and documentation/scenarios are not created here. That means needsBootstrap could be true due to missing doc dirs, not strictly due to the missing config, weakening what this test is validating. Create all KIBI_DOC_DIRS entries (including requirements/scenarios) or add an assertion that missingDocDirs is empty before calling checkWorkspaceHealth so the test isolates the missing-config behavior.
| // implements REQ-opencode-kibi-plugin-v1 | ||
| describe("getKbExistenceTargets normalization contract", () => { | ||
| let tmpDir: string; | ||
| let origDir: string; |
There was a problem hiding this comment.
origDir is declared but never used. Please remove it (or use it) to avoid dead code and potential lint failures.
| let origDir: string; |
| const paths = loadKbSyncPaths(cwd); | ||
| const keys = [ | ||
| "requirements", | ||
| "scenarios", | ||
| "tests", | ||
| "adr", | ||
| "flags", | ||
| "events", | ||
| "facts", | ||
| "symbols", | ||
| ] as const; | ||
| const targets: KbExistenceTarget[] = []; | ||
| for (const key of keys) { | ||
| const raw = paths[key]; | ||
| if (!raw) continue; | ||
| const isFile = raw.endsWith(".yaml") || raw.endsWith(".yml"); | ||
| if (isFile) { | ||
| targets.push({ key, relativePath: raw, kind: "file" }); | ||
| } else { | ||
| // Contract: trim trailing slashes → normalizePattern → strip first glob segment | ||
| const trimmed = raw.replace(/\/+$/, ""); | ||
| const normalized = normalizePattern(trimmed); | ||
| const relativePath = normalized ? stripToRoot(normalized) : "."; | ||
| targets.push({ key, relativePath, kind: "dir" }); | ||
| } |
There was a problem hiding this comment.
getKbExistenceTargets() is built on loadKbSyncPaths(), which merges user config with DEFAULT_SYNC_PATHS (e.g. tests/**/*.md). However, .kb/config.json paths defaults in this repo are directory-based under documentation/ (see packages/cli/src/utils/config.ts:60-72 and the repo’s .kb/config.json). If a config provides only a partial paths override, the missing-target checks (and file filtering) will silently fall back to root-level sync-glob defaults for the unspecified keys, which can cause false bootstrap warnings / missed paths. Consider using documentation-directory defaults (or the CLI DEFAULT_CONFIG.paths) when deriving existence targets, or derive targets from the raw user-specified keys only when the intent is to honor config-defined documentation locations.
| # GENERATED fields (never edit manually — overwritten by kibi sync and kb_symbols_refresh): | ||
| # sourceLine, sourceColumn, sourceEndLine, sourceEndColumn, coordinatesGeneratedAt | ||
| # Run `kibi sync` or call the `kb.symbols.refresh` MCP tool to refresh coordinates. | ||
| # Run `kibi sync` or call the `kb_symbols_refresh` MCP tool to refresh coordinates. |
There was a problem hiding this comment.
The MCP tool name was updated to kb_symbols_refresh here, but other docs still reference the older kb.symbols.refresh (e.g. documentation/adr/ADR-008.md:51). Please update the remaining references so users aren’t instructed to call a non-existent/deprecated tool name.
documentation/symbols.yaml
Outdated
| sourceEndLine: 86 | ||
| sourceEndColumn: 1 | ||
| coordinatesGeneratedAt: '2026-03-29T20:23:22.686Z' |
There was a problem hiding this comment.
The generated coordinates for SYM-getKbExistenceTargets look inconsistent with the current function length in packages/opencode/src/file-filter.ts (the function continues well past line 86). Please re-run kibi sync / kb_symbols_refresh after the final code layout to ensure sourceEndLine/sourceEndColumn are accurate (these coordinates drive tooling like CodeLens).
| sourceEndLine: 86 | |
| sourceEndColumn: 1 | |
| coordinatesGeneratedAt: '2026-03-29T20:23:22.686Z' |
|
@copilot apply changes based on the comments in this thread in a separate pr |
… paths, doc tool name, symbol coords Agent-Logs-Url: https://github.com/Looted/kibi/sessions/c816f8d7-4203-4132-9532-c6d246a496bd Co-authored-by: Looted <6255880+Looted@users.noreply.github.com>
Fix review feedback: test isolation, dead code, default path alignment, doc tool name, symbol coords
No description provided.