feat(kgpacks-rs): pack_info reports computed db_exists/urls_file_exists (KGP-M2 / #4321 F2) - #4931
Open
rysweet wants to merge 1 commit into
Conversation
…ts (KGP-M2 / #4321 F2) Close the last "⚠️ verify" row in the agent-kgpacks-rs parity done-gate (issue #4321, feature F2). The upstream agent-kgpacks `mcp_server.pack_info` returns the pack manifest **plus** two computed on-disk status fields: manifest["db_exists"] = (pack_dir / "pack.db").exists() manifest["urls_file_exists"] = (pack_dir / "urls.txt").exists() The Rust `knowledge.pack_info` handler returned only name/description/ article_count/section_count, omitting both — so a caller could not tell a manifest-only pack (metadata present, not yet built/installed) from a fully materialised one. That is a genuine parity gap with the original runtime. Changes: - native_knowledge.rs: `knowledge.pack_info` now appends `db_exists` (`DiscoveredPack::db_path.exists()`) and `urls_file_exists` (new `pack_urls_file_exists` helper resolving `<pack_dir>/urls.txt`, gated by the `PACK_URLS_FILE` constant), matching the upstream contract. - knowledge_client.rs: `KnowledgePackInfo` gains `db_exists`/`urls_file_exists` (`#[serde(default)]`, so `list_packs` — which, like upstream, does not compute them — still deserializes). - Docs: rpc-wire-protocol.md pack_info example; Specs/agent-kgpacks-rs-parity.md KGP-M2 row + progress log. - qa-team: tests/qa-scenarios/kgpacks-rs-pack-info-computed-fields.yaml. Acceptance tests (all green): native_knowledge_transport_pack_info, native_knowledge_transport_pack_info_reports_computed_file_flags, native_knowledge_transport_pack_info_manifest_only_pack_reports_missing_db, knowledge_client pack_info_returns_metadata / list_packs_defaults_computed_fields_to_false, tests/knowledge.rs pack_info_returns_metadata / knowledge_pack_info_serializes_roundtrip. Done-gate: `cargo test --lib native_knowledge` + `cargo test --lib knowledge_client` remain green. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Advances kgpacks-rs (Simard's native Rust knowledge-pack client) one focused step toward full parity with upstream
agent-kgpacks. Closes done-gate #4321 feature F2 / completes parity item KGP-M2.Upstream
agent-kgpacks/mcp_server.py::pack_infoaugments the pack manifest with two computed filesystem flags:The Rust
knowledge.pack_infohandler previously returned onlyname/description/article_count/section_count— omitting both computed fields. This PR closes that gap.Changes
src/native_knowledge.rs):knowledge.pack_infonow emitsdb_exists(db_path.exists()) andurls_file_exists(newPACK_URLS_FILEconst +pack_urls_file_existshelper). +2 transport tests; extended existing one.src/knowledge_client.rs):KnowledgePackInfogainsdb_exists/urls_file_exists(#[serde(default)]solist_packsresponses that omit them decode asfalse, matching upstream which computes them only inpack_info). +1 test; extended existing.src/knowledge_context.rs): test literals updated for the new fields.tests/knowledge.rs): mock + roundtrip assertions extended.docs/reference/rpc-wire-protocol.mdpack_infoexample + note.Specs/agent-kgpacks-rs-parity.mdKGP-M2 row + progress-log entry.Merge-ready evidence
Criterion 1 — qa-team scenario (validated + run):
tests/qa-scenarios/kgpacks-rs-pack-info-computed-fields.yaml—gadugi-test validate= valid;gadugi-test run= 1/1 passed.Criterion 2 — docs:
docs/reference/rpc-wire-protocol.mdandSpecs/agent-kgpacks-rs-parity.mdupdated for the user-facing RPC surface change.Criterion 3 — quality-audit (≥3 SEEK→VALIDATE→FIX cycles, ended clean):
Defaultderive +..Default::default()).cargo fmt --all -- --checkclean;cargo clippy --all-targets --all-features --locked -D warningsclean; rust-only gate pass;tests/knowledge.rs15 passed.Criterion 4 — CI: to be confirmed 100% green on this PR (see checks below).
Criterion 6 — focused diff: 7 files, 263 insertions / 3 deletions, all F2-related. No unrelated edits.
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com