Skip to content

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
mainfrom
engineer/advance-rysweet-agent-kgpacks-rs-to-full-parity-f29bb15c-1785203198-ec7ee7
Open

feat(kgpacks-rs): pack_info reports computed db_exists/urls_file_exists (KGP-M2 / #4321 F2)#4931
rysweet wants to merge 1 commit into
mainfrom
engineer/advance-rysweet-agent-kgpacks-rs-to-full-parity-f29bb15c-1785203198-ec7ee7

Conversation

@rysweet

@rysweet rysweet commented Jul 28, 2026

Copy link
Copy Markdown
Owner

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_info augments the pack manifest with two computed filesystem flags:

manifest["db_exists"]        = (pack_dir / "pack.db").exists()
manifest["urls_file_exists"] = (pack_dir / "urls.txt").exists()

The Rust knowledge.pack_info handler previously returned only name/description/article_count/section_countomitting both computed fields. This PR closes that gap.

Changes

  • Server (src/native_knowledge.rs): knowledge.pack_info now emits db_exists (db_path.exists()) and urls_file_exists (new PACK_URLS_FILE const + pack_urls_file_exists helper). +2 transport tests; extended existing one.
  • Client (src/knowledge_client.rs): KnowledgePackInfo gains db_exists / urls_file_exists (#[serde(default)] so list_packs responses that omit them decode as false, matching upstream which computes them only in pack_info). +1 test; extended existing.
  • Consumer (src/knowledge_context.rs): test literals updated for the new fields.
  • Integration (tests/knowledge.rs): mock + roundtrip assertions extended.
  • Docs: docs/reference/rpc-wire-protocol.md pack_info example + note.
  • Spec: Specs/agent-kgpacks-rs-parity.md KGP-M2 row + progress-log entry.

Merge-ready evidence

Criterion 1 — qa-team scenario (validated + run):
tests/qa-scenarios/kgpacks-rs-pack-info-computed-fields.yamlgadugi-test validate = valid; gadugi-test run = 1/1 passed.

Criterion 2 — docs: docs/reference/rpc-wire-protocol.md and Specs/agent-kgpacks-rs-parity.md updated for the user-facing RPC surface change.

Criterion 3 — quality-audit (≥3 SEEK→VALIDATE→FIX cycles, ended clean):

  • Cycle 1: fixed struct-literal compile breaks (Default derive + ..Default::default()).
  • Cycle 2: cargo fmt --all -- --check clean; cargo clippy --all-targets --all-features --locked -D warnings clean; rust-only gate pass; tests/knowledge.rs 15 passed.
  • Cycle 3: docs_integrity 4 passed. Zero critical/high; zero medium correctness/security. Clean final cycle.
  • Suites: native_knowledge 49 passed, knowledge_client 9 passed, knowledge_context 13 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

…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>
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.

1 participant