Conversation
…e codec toPrologString - buildManifestLookup() now pre-populates the manifest lookup from the working-tree config.paths.symbols file before processing staged manifests. This prevents code-only staged changes from incorrectly failing traceability when symbols.yaml is not staged but is already linked in the KB. - Remove duplicate toPrologString() in temp-kb.ts and import the shared implementation from ../prolog/codec to keep Prolog serialisation consistent. - Add .changeset/fix-manifest-lookup-and-prolog-codec.md for release tracking. Agent-Logs-Url: https://github.com/Looted/kibi/sessions/d11497ec-c000-4b40-978d-2f5d5eb012e4 Co-authored-by: Looted <6255880+Looted@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Looted/kibi/sessions/d11497ec-c000-4b40-978d-2f5d5eb012e4 Co-authored-by: Looted <6255880+Looted@users.noreply.github.com>
…ew-comments fix(cli): merge working-tree manifest into staged lookup + dedup toPrologString
There was a problem hiding this comment.
Pull request overview
This PR improves kibi check --staged traceability resolution by incorporating existing symbol IDs/relationships from the working tree manifest (before applying staged-manifest overrides), and removes duplicated Prolog string encoding to keep serialization consistent across the CLI.
Changes:
- Pre-populate
manifestLookupfrom the working-treeconfig.paths.symbolsmanifest, then apply stagedsymbols.yamloverrides. - Deduplicate
toPrologStringby reusing the shared implementation from../prolog/codec. - Add a Changeset for a
kibi-clipatch release describing both fixes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/cli/src/traceability/temp-kb.ts | Removes the local toPrologString helper and imports the shared Prolog codec version. |
| packages/cli/src/commands/check.ts | Enhances staged-check manifest lookup by seeding it from the working tree manifest prior to staged override parsing. |
| .changeset/fix-manifest-lookup-and-prolog-codec.md | Documents the behavior change and Prolog codec deduplication for release notes. |
| } catch (e) { | ||
| // Ignore working-tree manifest parsing errors; staged-only fallback still applies | ||
| const msg = e instanceof Error ? e.message : String(e); | ||
| console.debug(`[kibi] skipping working-tree manifest ${absSymbolsPath}: ${msg}`); |
There was a problem hiding this comment.
console.debug here will emit output unconditionally when the working-tree manifest is invalid, even if the user didn’t enable tracing. Elsewhere (e.g. traceability/git-staged.ts) debug logging is gated behind KIBI_TRACE/KIBI_DEBUG; consider gating this message similarly or routing it through the existing trace mechanism to avoid noisy/unstable CLI output.
| console.debug(`[kibi] skipping working-tree manifest ${absSymbolsPath}: ${msg}`); | |
| if (process.env.KIBI_TRACE || process.env.KIBI_DEBUG) { | |
| console.debug(`[kibi] skipping working-tree manifest ${absSymbolsPath}: ${msg}`); | |
| } |
| // Pre-populate lookup from working-tree manifests so that code-only changes | ||
| // (where symbols.yaml is not staged) still resolve to the correct symbol IDs | ||
| // and relationships already defined on disk. | ||
| const config = loadConfig(process.cwd()); | ||
| const symbolsRelPath = config.paths.symbols; | ||
| if (symbolsRelPath) { | ||
| const absSymbolsPath = path.resolve(process.cwd(), symbolsRelPath); | ||
| if (existsSync(absSymbolsPath)) { | ||
| try { | ||
| const entries = extractFromManifest(absSymbolsPath); |
There was a problem hiding this comment.
This change is meant to fix the case where code is staged but symbols.yaml is not; however, the existing --staged tests appear to stage symbols.yaml along with the code. Please add a test that commits a valid symbols.yaml, then stages only a code change, and asserts kibi check --staged still resolves the symbol ID/relationships from the working tree manifest (no hash fallback).
|
@copilot apply changes based on the comments in this thread |
|
@Looted I can’t apply these changes because the pull request’s branch is the repository’s default branch, which I’m not allowed to push to directly. You can ask me to create a new pull request with the requested changes instead and I'll open a separate PR on a new branch. |
@copilot Please create a new PR with this work. |
…_DEBUG and add test for code-only staged check Agent-Logs-Url: https://github.com/Looted/kibi/sessions/93b43b29-7204-4f56-82c3-399980819276 Co-authored-by: Looted <6255880+Looted@users.noreply.github.com>
fix(cli): gate working-tree manifest debug log and add code-only staged check test
- Use path.resolve instead of path.join in repo-posture.ts and workspace-health.ts so absolute configured doc roots in .kb/config.json are honored and no longer trigger false-positive bootstrap warnings. - Rebuild packages/cli/src/prolog/codec.js so toPrologAtom and toPrologString are available as named exports at runtime, fixing CLI traceability test imports. - Add missing toPrologAtom/toPrologString mock exports in service.test.ts to prevent Bun mock.module leakage breaking other test files in full-suite runs. - Add regression test for healthy absolute custom doc roots and add staged symbol traceability comments to codec.js.
- workspace-health.ts: restore the legacy >2 missing dirs threshold for root_partial workspaces so small gaps (e.g. flags/events) do not trigger bootstrap nags. This fixes the ~/projects/align regression. - opencode-comment-guidance e2e: bootstrap temp projects with .kb/config.json and required doc directories so the packed plugin sees root_active posture and injects comment guidance as expected.
- discovery-shared.test.ts: add mock.restore() in afterEach to prevent
the MockPrologProcess mock from leaking into temp-kb.test.ts during
full-suite runs.
- service.test.ts: add mock.restore() in beforeEach to prevent the
prolog/codec mock from leaking into other tests.
This fixes the suite-order-dependent Prolog query failure in temp-kb
(projectStagedEntities retract timeout) that only occurred in bun test v1.3.6 (d530ed99)
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ .kb/ directory already exists, skipping creation
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ .kb/ directory already exists, skipping creation
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
📦 Packing packages...
Packing packages/core...
→ kibi-core-0.4.0.tgz
Packing packages/cli...
→ kibi-cli-0.5.0.tgz
Packing packages/mcp...
→ kibi-mcp-0.6.0.tgz
📥 Bootstrapping shared packed test installation...
✓ Created .kb/ directory structure
✓ Created branches/my-branch/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Added .kb/ to .gitignore
✓ Copied 1 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents but not in isolation.
The script and Docker entrypoint were running bun test v1.3.6 (d530ed99)
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ .kb/ directory already exists, skipping creation
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ .kb/ directory already exists, skipping creation
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
📦 Packing packages...
Packing packages/core...
→ kibi-core-0.4.0.tgz
Packing packages/cli...
→ kibi-cli-0.5.0.tgz
Packing packages/mcp...
→ kibi-mcp-0.6.0.tgz
📥 Bootstrapping shared packed test installation...
✓ Created .kb/ directory structure
✓ Created branches/my-branch/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Added .kb/ to .gitignore
✓ Copied 1 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents
✓ Created .kb/ directory structure
✓ Created branches/main/ directory
✓ Created config.json with default paths
✓ Added .kb/ to .gitignore
✓ Copied 3 schema files
✓ Installed git hooks (pre-commit, post-checkout, post-merge, post-rewrite)
Kibi initialized successfully!
Next steps:
1. Run 'kibi doctor' to verify setup
2. Run 'kibi sync' to extract entities from documents without , so they used Bun's default 5000ms per-test
timeout. Under full-suite load, integration tests that spawn swipl processes
(e.g. ) can exceed 5 seconds and fail intermittently.
The script already used ; snip this change makes
and the Docker test runner consistent with that configuration,
fixing the last intermittent timeout failure.
|
@copilot apply changes based on the comments in this thread in a new pr |
No description provided.