Skip to content

fix(runtime): update(properties=...) merges instead of replaces (#71) + kg-swarm skills/agents#72

Closed
ohdearquant wants to merge 2 commits into
mainfrom
fix/update-merge-semantics
Closed

fix(runtime): update(properties=...) merges instead of replaces (#71) + kg-swarm skills/agents#72
ohdearquant wants to merge 2 commits into
mainfrom
fix/update-merge-semantics

Conversation

@ohdearquant
Copy link
Copy Markdown
Owner

Summary

Two complementary changes:

  1. fix(runtime): properties update is now deep-merge instead of replace. Fixes BUG: update() returns ok=true but properties writes silently do not persist (polisher cycle-1 → cycle-2 evidence) #71update(id, properties={status: "X"}) was silently dropping all other property keys (domain, repo, crate, type). The docstring on EntityPatch promised "patch" semantics but the implementation replaced. Now uses merge_properties() with MergeStrategy::PreferFrom.

  2. feat(marketplace): kg-plugin skills + agents for the kg-swarm pattern. Two new skills (gap, expand) + five new agents (digester, polisher, gap-analyst, expander, librarian). Each agent picks up GTD tasks assigned to it, processes, then assigns follow-up tasks downstream — no central orchestrator.

Why bundled

The swarm pattern needs the merge fix to be safe — any agent doing update(properties={status: ...}) was clobbering sibling properties under the old semantics. Verified empirically during a dogfood session (unimpl-adr-sweep show, 2026-05-19).

Test plan

  • cargo test -p khive-runtime --release --lib curation:: — 13 tests pass including new update_entity_properties_merges_preserving_existing_keys
  • make build — release binary compiles in ~48s
  • Manually reproduced the bug pre-fix; verified post-fix that update(id, properties={status: "X"}) preserves all other keys
  • Smoke test (python3 tests/smoke_test.py) — pending

Refs

🤖 Generated with Claude Code

ohdearquant and others added 2 commits May 19, 2026 21:18
…d kg-swarm skills/agents (#71)

Two complementary changes for the kg-swarm dogfood loop:

1. fix(runtime): properties update is now deep-merge instead of replace.
   Previously update(id, properties={status: "X"}) silently dropped all
   other property keys (domain, repo, crate, type). The docstring on
   EntityPatch promised "patch" semantics but the implementation replaced.
   Switched to merge_properties() with MergeStrategy::PreferFrom — patch
   keys override existing on conflict, absent keys preserved.

   Fixes #71. Added update_entity_properties_merges_preserving_existing_keys
   regression test. All 13 curation tests pass.

2. feat(marketplace): new kg-plugin skills (gap, expand) and agents
   (digester, polisher, gap-analyst, expander, librarian).
   Designs the kg swarm pattern where each agent picks up GTD tasks
   assigned to it, processes them, then assigns follow-up tasks to the
   next agent in the chain. README updated to document the swarm
   pipeline + 6-agent table.

   See marketplace/kg/skills/{gap,expand}/SKILL.md and the agent files
   for the per-role pickup/handoff protocols.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pre-existing format drift in ADRs 029, 035-041 introduced by PR #64.
CI's Docs lint step (deno fmt --check) was failing on every PR until
fixed. Pure whitespace + emphasis-style (`*` → `_`); no semantic changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ohdearquant
Copy link
Copy Markdown
Owner Author

Closing in favor of the 3 split PRs (per Ocean's PR-split rule — code/marketplace/docs as separate PRs for cleaner iterative codex review):

All 3 are off origin/main, scoped to one logical concern each. Will iterate codex pr review on each independently and merge on approve.

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.

BUG: update() returns ok=true but properties writes silently do not persist (polisher cycle-1 → cycle-2 evidence)

1 participant