Skip to content

Enhance impact diagnostics and improve CLI documentation - #205

Merged
Looted merged 73 commits into
masterfrom
develop
Jul 5, 2026
Merged

Enhance impact diagnostics and improve CLI documentation#205
Looted merged 73 commits into
masterfrom
develop

Conversation

@Looted

@Looted Looted commented Jul 3, 2026

Copy link
Copy Markdown
Owner

No description provided.

Looted added 30 commits June 25, 2026 22:22
Copilot AI review requested due to automatic review settings July 3, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Kibi’s “impact diagnostics / audit-quality diagnostics” surface area across the CLI, MCP server, and editor adapters (OpenCode, Cursor, Codex), while also updating documentation, tests, and package versions to match the new contracts.

Changes:

  • Add/propagate impact-enabled kb_check guidance and tracking (including follow-up messages) in OpenCode/Cursor/Codex integrations.
  • Introduce/standardize “advisory quality diagnostics” alongside existing hard violations, plus new/updated validation rules and richer typed fields (e.g., test verification metadata).
  • Improve sync/status behavior around documentation README.md files and update docs/test entities to reflect the new behaviors.

Reviewed changes

Copilot reviewed 171 out of 172 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/vscode/package.json Bump extension version/deps (kibi-cli) and reformat metadata arrays.
packages/vscode/CHANGELOG.md Add 0.4.7 entry for dependency updates.
packages/opencode/tests/smart-enforcement-policy.test.ts Update assertions for new advisory guidance text.
packages/opencode/tests/prompt.coverage.test.ts Add coverage for degraded-mode/cache/impact guidance behaviors.
packages/opencode/tests/file-operation-reminders.test.ts Update reminder expectations; add test for impact-enabled kb_check guidance.
packages/opencode/src/scheduler.ts Run kibi check in JSON mode and surface advisory quality diagnostics in logs.
packages/opencode/src/enforcement-policy.ts Emit impact-enabled kb_check(...) guidance for edited source files.
packages/opencode/README.md Document impact-enabled completion reminders and semantic-review intent.
packages/opencode/package.json Bump version and kibi-cli dependency; reformat files list.
packages/opencode/CHANGELOG.md Document advisory diagnostics surfacing + dependency bumps.
packages/mcp/tsconfig.json Add path alias for public impact diagnostics types.
packages/mcp/tests/tools/validate-upsert.test.ts Add integration preflight coverage for relationship validation.
packages/mcp/tests/tools/upsert.test.ts Extend upsert tests for new metadata fields and improved errors.
packages/mcp/tests/tools/skills.test.ts Assert declared skill resources are reported and hinted on errors.
packages/mcp/tests/tools/relationship-validation.test.ts New test for actionable invalid-relationship formatting.
packages/mcp/tests/tools/find-gaps.test.ts Add timeouts / formatting tweaks for integration stability.
packages/mcp/tests/tools/coverage.test.ts Assert new coverage-depth fields and typed verification behavior.
packages/mcp/tests/tools/check-error-paths.test.ts Update expectations for aggregated checks query behavior.
packages/mcp/tests/tools/check-aggregated-defaults.test.ts New tests ensuring strict rules stay off by default.
packages/mcp/tests/tools/check-aggregated-config.test.ts New tests ensuring explicit rule opt-in overrides config disables.
packages/mcp/tests/server/tools-coverage.test.ts Align tool runtime signatures and ensure validate-upsert is invoked with prolog.
packages/mcp/tests/semantic-advisor/prose-coverage-fixture.ts Add new corpus items for strict/predicate suggestions.
packages/mcp/tests/semantic-advisor/analyze-prose.test.ts Add coverage for non-req payload and “already modeled” behavior.
packages/mcp/tests/diagnostics-helpers.test.ts Add deterministic hinting for contradiction failures.
packages/mcp/tests/diagnostics-core.test.ts Classify contradiction errors + extract semantic fields in diagnostics.
packages/mcp/src/tools/validate-upsert.ts Add optional live relationship preflight (when invoked via MCP/prolog).
packages/mcp/src/tools/upsert.ts Add live relationship target validation + improved error formatting + metadata fields.
packages/mcp/src/tools/skills.ts Include declared resources in load output and hint on missing-resource errors.
packages/mcp/src/tools/query-plan-safety.ts New helper to detect unsafe Prolog negation/generator ordering.
packages/mcp/src/tools/check-types.ts New shared types for check args/results incl. quality/impact diagnostics.
packages/mcp/src/tools/check-prolog.ts New aggregated Prolog check runner with allowlisting.
packages/mcp/src/tools/check-impact.ts New bridge for impact diagnostics analysis in MCP check flows.
packages/mcp/src/tools/check-format.ts New formatting/structured-content builder for violations/quality/impact output.
packages/mcp/src/tools/check-config.ts New .kb/config.json loader + effective rule resolution for MCP checks.
packages/mcp/src/tools-config.ts Expand kb_check schema/docs to cover impact options + new rules.
packages/mcp/src/server/tool-types.ts Update runtime signature for kb_validate_upsert.
packages/mcp/src/server/tool-registration.ts Ensure kb_validate_upsert is invoked with an ensured prolog instance.
packages/mcp/src/server/docs.ts Update docs to distinguish targeted vs final unfiltered kb_check.
packages/mcp/src/semantic-advisor/prose-coverage-evaluator.ts Extend prose coverage case schema with optional source.
packages/mcp/src/semantic-advisor/analyze-prose.ts Add new strict-property and predicate detections (decisecond slot, merge policy).
packages/mcp/src/diagnostics-helpers.ts Classify semantic contradictions and add actionable hints/id extraction.
packages/mcp/package.json Bump version and update kibi-cli/kibi-core dependencies.
packages/mcp/CHANGELOG.md Document coverage depth + quality diagnostics contract + rule additions.
packages/cursor/tests/messages.test.ts Update stop follow-up behavior tests for impact-enabled guidance.
packages/cursor/tests/hook-runner.test.ts Add stop-follow-up scenarios for missing vs completed impact checks.
packages/cursor/src/path-policy.ts Treat .pl as source; add source-impact relevance predicate.
packages/cursor/src/messages.ts Emit impact-check follow-up messaging for source edits.
packages/cursor/src/kb-mcp-tools.ts Parse kb_check calls and detect impact-enabled runs + affected sourceFiles.
packages/cursor/src/hook-state.ts Track impact-check completion + paths in persisted hook state.
packages/cursor/src/hook-runner.ts Record parsed MCP tool calls (including impact-check metadata).
packages/cursor/src/guidance.ts Add explicit impact-enabled kb_check line in write guidance.
packages/cursor/skills/kibi-usage/SKILL.md Update skill guidance for qualityDiagnostics + impact-enabled kb_check workflows.
packages/cursor/skills/kibi-traceability/SKILL.md Add impact-check step and semantic-review interpretation guidance.
packages/cursor/rules/kibi-traceability.mdc Add impact-check step to traceability rule.
packages/cursor/README.md Update behavior description to include impact-check follow-up.
packages/cursor/package.json Bump package version.
packages/cursor/CHANGELOG.md Document quality diagnostics support in Cursor adapter.
packages/cursor/.cursor-plugin/plugin.json Bump plugin version.
packages/core/src/status.pl Ignore documentation README files in freshness checks.
packages/core/schema/entities.pl Add typed symbol metadata + typed test verification fields to schema.
packages/core/package.json Bump version and reformat files list.
packages/core/CHANGELOG.md Document coverage depth, diagnostics, and README ignore behavior.
packages/codex/tests/hook-state.test.ts Update empty-state expectations to include impact-check state.
packages/codex/tests/hook-runner.test.ts Add stop-follow-up tests for missing vs completed impact checks.
packages/codex/src/path-policy.ts Treat .pl as source; add source-impact relevance predicate.
packages/codex/src/messages.ts Add impact-check reminder message builder.
packages/codex/src/kb-mcp-tools.ts New: parse kb_check calls and detect impact-enabled runs + sourceFiles.
packages/codex/src/hook-runner.ts Record MCP tool calls and emit impact/freshness reminders on stop.
packages/codex/skills/kibi-usage/SKILL.md Update skill guidance for qualityDiagnostics + impact-enabled kb_check workflows.
packages/codex/skills/kibi-traceability/SKILL.md Add impact-check step and semantic-review interpretation guidance.
packages/codex/package.json Bump package version.
packages/codex/CHANGELOG.md Document quality diagnostics support in Codex adapter.
packages/codex/.codex-plugin/plugin.json Bump plugin version.
packages/cli/tests/utils/rule-registry.test.ts Add tests for new rule registry entries and enablement defaults.
packages/cli/tests/utils/prolog-query-plan-safety.test.ts New tests for Prolog query plan safety analyzer.
packages/cli/tests/traceability/symbol-extract.test.ts Add coverage for class property/accessor symbol extraction.
packages/cli/tests/traceability/staged-symbols-manifest.test.ts Add evidence collection for changed authored manifest entries.
packages/cli/tests/traceability/staged-impact-contract.test.ts Update staged diagnostics contract for docs/suggestions/blocking semantics.
packages/cli/tests/traceability/impact-symbol-quality-fixtures.ts New fixtures for symbol quality diagnostics tests.
packages/cli/tests/traceability/impact-symbol-mixed-purpose.test.ts New tests for mixed-purpose symbol review diagnostics.
packages/cli/tests/traceability/evidence-model.test.ts Update staged evidence diagnostics to include blocking/category and new docs link.
packages/cli/tests/skills-content.test.ts Update skill content expectations and add coverage for new guidance sections.
packages/cli/tests/extractors/symbols-ts.test.ts Add coordinate enrichment fallback coverage for class members.
packages/cli/tests/commands/sync/discovery.test.ts Assert README ignore behavior in markdown discovery.
packages/cli/tests/commands/sync.test.ts Improve sync error context assertions (source/fact_kind/value field).
packages/cli/tests/commands/status.test.ts Add regression test for README ignore keeping status fresh.
packages/cli/tests/commands/coverage.test.ts Assert coverage-depth fields and ensure table renders depth labels.
packages/cli/tests/commands/check-staged-enforcement.test.ts Add tests for advisory quality diagnostics printing without failing.
packages/cli/tests/commands/check-impact-contract.test.ts Add tests for blocking vs advisory quality diagnostics semantics.
packages/cli/src/utils/rule-registry.ts Register new rules (predicate-verifiability, query-plan-safety).
packages/cli/src/utils/prolog-query-plan-safety.ts New analyzer for unsafe negation/generator ordering in Prolog clauses.
packages/cli/src/types/entities.ts Add typed test verification metadata to TestEntity.
packages/cli/src/traceability/symbol-extract.ts Extract class properties/accessors as member symbols for impact/traceability.
packages/cli/src/traceability/staged-symbols-manifest.ts Only report authored symbol IDs whose staged metadata actually changed.
packages/cli/src/traceability/staged-impact-contract.ts Clarify staged evidence guidance (MCP writes don’t stage artifacts).
packages/cli/src/traceability/staged-diagnostics.ts Expand diagnostics to QualityDiagnostic shape with blocking/category/docs updates.
packages/cli/src/traceability/evidence-model.ts Add dedicated staged-impact docs anchor constant.
packages/cli/src/public/symbol-granularity.ts Treat property/accessor as behavioral symbol kinds.
packages/cli/src/public/skills/kibi-usage/SKILL.md Update examples to supported typed values + add “Small Behavior Fix” recipe.
packages/cli/src/public/skills/kibi-usage/resources/workflows.md Add workflow for behavior fixes without existing requirements.
packages/cli/src/public/skills/kibi-usage/resources/relationship-directions.md Add explicit “invalid test-fact shortcut” guidance.
packages/cli/src/public/skills/kibi-usage/resources/fact-lanes.md Clarify strict fact schema value types and update examples.
packages/cli/src/public/schemas/entity.ts Allow typed test verification fields only for type: test entities.
packages/cli/src/public/impact/types.ts New: public impact/quality diagnostic types.
packages/cli/src/public/impact/summaries.ts New: summarize extracted symbols, linked entities, and next actions.
packages/cli/src/public/impact/manifest.ts New: read/normalize manifest results for impact analysis.
packages/cli/src/public/impact/analyzer.ts New: compute changed-file impact diagnostics from staged/working tree inputs.
packages/cli/src/public/impact-diagnostics.ts New: public entrypoint exports for impact diagnostics.
packages/cli/src/extractors/symbols-ts.ts Include class properties/accessors in TS symbol extraction + coordinate lookup.
packages/cli/src/extractors/symbols-coordinator.ts Add property/accessor symbol kinds to coordinator contract.
packages/cli/src/extractors/markdown.ts Extend extracted entity shape to include symbol coordinate/kind/role fields.
packages/cli/src/extractors/manifest.ts Pass through additional symbol metadata fields from manifest records.
packages/cli/src/commands/sync/persistence.ts Persist typed test verification fields; enrich error context with semantic details.
packages/cli/src/commands/sync/discovery.ts Ignore **/README.md during markdown discovery and filter residual README paths.
packages/cli/src/cli.ts Add `--format text
packages/cli/schema/entities.pl Add typed symbol metadata fields to CLI schema copy.
packages/cli/package.json Bump version, add public impact-diagnostics export, update deps, reformat files list.
documentation/tests/TEST-opencode-advisory-diagnostics.md New KB test entity documenting OpenCode advisory diagnostics coverage.
documentation/tests/TEST-mcp-quality-diagnostics-contract.md New KB test entity documenting MCP quality diagnostics contract coverage.
documentation/tests/TEST-coverage-depth-labels.md New KB test entity for coverage-depth labels/diagnostics.
documentation/tests/TEST-cli-sync-discovery-readme-ignore.md New KB test entity for README ignore regression.
documentation/tests/TEST-cli-symbol-quality-diagnostics.md New KB test entity for CLI symbol quality diagnostics coverage.
documentation/tests/TEST-cli-status-pre-first-sync.md Expand description to include README ignore freshness behavior.
documentation/tests/TEST-cli-requirement-quality-diagnostics.md New KB test entity for requirement quality diagnostics coverage.
documentation/tests/TEST-cli-quality-diagnostics-contract.md New KB test entity for CLI quality diagnostics contract coverage.
documentation/tests/TEST-cli-mixed-purpose-diagnostics.md New KB test entity for mixed-purpose symbol diagnostics coverage.
documentation/tests/TEST-audit-quality-diagnostics-v1.md New rollup test entity for audit-quality diagnostics scenario.
documentation/tests/TEST-002.md Fix link type (change specifies to validates).
documentation/tests/e2e/packed/fixtures/README.md Add frontmatter (but README is now treated specially by discovery/freshness).
documentation/scenarios/SCEN-release-automation.md Remove incorrect/unused specified_by link block.
documentation/scenarios/SCEN-audit-quality-diagnostics-v1.md New scenario defining the two-lane diagnostics behavior.
documentation/scenarios/SCEN-001.md Remove validates links (leaving verified_by links).
documentation/requirements/REQ-audit-quality-diagnostics-v1.md New requirement describing two-lane diagnostics contract across surfaces.
docs/symbol-traceability-taxonomy.md Document member-level behavioral anchors + semantic review after source edits + audit diagnostics lane.
docs/prompts/llm-rules.md Update guidance on targeted vs final unfiltered kb_check.
docs/modeling-cheatsheet.md Add guidance on small behavior fixes and qualityDiagnostics lane semantics.
docs/error-reference.md Document invalid relationship tuples + advisory diagnostics lane semantics.
docs/entity-schema.md Document coverageDepth labels and two-lane check output contract; clarify fact/test relationship shapes.
AGENTS.md Update non-negotiables to allow CLI-only workflows when MCP has no equivalent; strengthen freshness handoff requirement.
.cursor/rules/kibi-traceability.mdc Mirror impact-check guidance in root Cursor ruleset.

Comment thread packages/opencode/src/scheduler.ts
Comment thread packages/opencode/src/enforcement-policy.ts Outdated
Comment thread packages/vscode/CHANGELOG.md
Comment thread documentation/tests/e2e/packed/fixtures/README.md Outdated
Looted added 25 commits July 4, 2026 19:10
@Looted
Looted merged commit fface56 into master Jul 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants