WIP: MCP: CRUD endpoints for agent goals + expose entity schemas/types #286
Closed
toasterson
wants to merge 2 commits from
claude/wi-019e480e-mcp-crud-endpoints-for-agent-goals-expos into main
pull from: claude/wi-019e480e-mcp-crud-endpoints-for-agent-goals-expos
merge into: toasterson:main
toasterson:main
toasterson:claude/wi-019fa8f0-adr-081-s0-pay-the-r2-empirical-bet-prob
toasterson:claude/wi-019f90cc-p27-2-tripleverbalizer-kg-triples-divers
toasterson:claude/wi-019f90cc-p26-5-wire-the-neural-bridge-into-the-in
toasterson:ptah/hip-qwen2-device-gating
toasterson:claude/wi-019fa44f-sessions-on-one-akh-still-serialise-on-t
toasterson:claude/wi-019fff96-periodic-snapshots-have-failed-390-day-s
toasterson:claude/wi-019fe620-dispatch-trap-triage-as-an-agent-tool-po
toasterson:claude/wi-019dd0c5-phase-42b-longmemeval-locomo-harness-wit
toasterson:claude/wi-019f90cb-p26-4-neural-vsa-encoder-project-layer-n
toasterson:claude/wi-019fdd22-the-learn-on-new-triples-trigger-fires-4
toasterson:docs/babysit-lane-skill
toasterson:claude/wi-019f90cb-p26-3-polarquant-kv-cache-compression-in
toasterson:claude/wi-019fa8eb-wi-4-diagnostics-provider-dispatched-bla
toasterson:claude/wi-019fa8f0-librarian-consolidation-is-ungated-unbat
toasterson:claude/wi-019fe636-sleep-relocate-leave-the-akh-advisory-lo
toasterson:claude/wi-019fe260-any-acp-call-against-a-non-resident-work
toasterson:fix/upstream-mcp-initialized
toasterson:fix/librarian-cloud-endpoint
toasterson:feat/curation-tasks
toasterson:feat/wake-on-open-hydration
toasterson:feat/exec-none-backend
toasterson:fix/chart-workspace-seed-initcontainer
toasterson:feat/chart-akh-declarative-config
toasterson:claude/wi-019fe1b4-the-akhomed-image-ships-no-protoc-so-eve
toasterson:feat/local-drop-launchdaemon
toasterson:archive/wi-019fa44f-rebased-onto-main
toasterson:claude/wi-019fdd21-ci-never-builds-the-akh-medu-crate-it-on
toasterson:claude/wi-019fa83d-compile-feedback-lints-the-whole-workspa
toasterson:claude/wi-019fbe82-the-akh-emits-tool-activity-as-prose-in
toasterson:claude/wi-019fbf62-phase-44n-context-rot-curve-bench-per-mo
toasterson:claude/wi-019fcce4-per-turn-dispatch-mode-akh-dispatch-mode
toasterson:agent/e138bd65c5aa
toasterson:claude/wi-019fcd3d-akhomed-on-arm64-should-run-pvc-less-in
toasterson:claude/wi-019fce1e-kg-delete-shipped-with-zero-tests-a-dang
toasterson:claude/wi-019f579f-add-kg-delete-triple-delete-capability-t
toasterson:claude/wi-019fba6a-turn-completion-waits-for-the-sink-refco
toasterson:claude/wi-019fcbb6-wire-remotebackend-into-akhomed-the-48c
toasterson:claude/wi-019dcaac-phase-38i-otlp-tracing-skeleton-first-oo
toasterson:claude/wi-019dcaad-phase-38j-otlp-metrics-seshat-instrument
toasterson:claude/wi-019dcaad-phase-38k-otel-logs-to-alloy-w3c-trace-p
toasterson:archive/2026-08-03-38i-pre-reset
toasterson:claude/wi-019fb9d6-panic-in-the-turn-completion-path-tokio
toasterson:claude/wi-019fba6a-the-agentic-loop-wedges-when-the-model-r
toasterson:claude/wi-019fb9d7-a-turn-can-receive-bytes-for-57-minutes
toasterson:claude/wi-019fb44f-the-watchdog-is-blind-while-the-model-ge
toasterson:claude/wi-019fb44f-a-turn-goes-silent-after-its-work-is-don
toasterson:archive/wi-019fa44f-sessions-on-one-akh-still-serialise-on-t
toasterson:claude/wi-019faa3e-a-reset-upstream-stream-drops-the-turn-i
toasterson:claude/wi-019f85d6-wave-r2-ownership-autostart-owner-host-c
toasterson:claude/wi-019f85d6-wave-w1-ritual-genesis-pantheon-packs-di
toasterson:claude/wi-019f85d7-wave-w2-the-wizard-akh-onboard-verbs-akh
toasterson:claude/wi-019f85d7-wave-w4-render-tier-psyche-render-pipeli
toasterson:claude/wi-019f85d6-wave-r1-config-spine-config-crate-typed
toasterson:archive/2026-07-28-wave-r2-ownership-autostart-owner-host-c
toasterson:archive/2026-07-28-wave-w4-render-tier-psyche-render-pipeli
toasterson:archive/2026-07-28-wave-w2-the-wizard-akh-onboard-verbs-akh
toasterson:archive/2026-07-28-wave-w1-ritual-genesis-pantheon-packs-di
toasterson:archive/2026-08-03-38j-pre-reset
toasterson:claude/wi-019db1bd-anima-integration-workspace-daemon-that
toasterson:archive/2026-08-03-38k-pre-reset
toasterson:claude/wi-019dc599-phase-39-distributed-inference-fabric-ll
toasterson:claude/wi-019dc57a-replace-continuous-learning-wikipedia-wi
toasterson:claude/adr-094-operating-guidance
toasterson:claude/wi-019dd0c6-phase-42c-drawer-ingest-path-embed-worke
toasterson:claude/wi-019f9f56-sessions-report-the-wrong-work-item-teac
toasterson:claude/agent-sandbox-workspace-root
toasterson:claude/wi-019f9a1e-17-work-items-frozen-since-2026-07-23-ag
toasterson:claude/wi-019f85d6-wave-r4-akh-doctor-read-only-7-sections
toasterson:claude/wi-019f85d7-wave-w3-birth-extras-procedural-avatar-f
toasterson:claude/wi-019f85d6-wave-r3-akhadvertisement-akh-daemon-akhs
toasterson:claude/wi-019f85b9-adversarial-review-distributed-inference
toasterson:claude/wi-019f85ba-adversarial-review-mcp-tools-kg-operatio
toasterson:claude/wi-019f8589-wi-3-session-registry-akh-session-list-i
toasterson:claude/wi-019f8589-wi-2-implement-peer-dispatch-in-delegati
toasterson:claude/wi-019f85b9-adversarial-review-heka-long-term-memory
toasterson:claude/wi-019f85b9-adversarial-review-observability-stack-3
toasterson:claude/wi-019e2501-define-fluent-infrastructure-home-state
toasterson:claude/cool-carson-b63ef4
toasterson:feat/macmini
toasterson:claude/wi-019db054-phase-36-delegation-external-scheduling
toasterson:claude/wi-019db054-phase-32-llm-knowledge-extraction
toasterson:claude/wi-019db054-phase-30-procedural-skills
toasterson:claude/wi-019db054-phase-28-n-akh-semantic-router
toasterson:claude/wi-019db054-phase-24-sensory-grounding
toasterson:claude/wi-019db054-phase-23-affective-system
toasterson:claude/wi-019db054-phase-27-live-kg-llm-training
toasterson:claude/wi-019db054-phase-26-llm-vsa-deep-integration
toasterson:claude/wi-019db054-release-alpha-kubernetes-deployment
toasterson:claude/wi-019e3397-bug-infer-rules-creates-indiscriminate-p
toasterson:claude/wi-019dbc03-bootstrap-embedding-nlu-llm-models-via-o
toasterson:claude/wi-019db054-phase-20-active-inference
toasterson:claude/wi-019dd0c7-phase-42h-cross-tool-bridge-daemon-opena
toasterson:claude/wi-019dd0c6-phase-42g-akhipedia-auto-extraction-from
toasterson:claude/wi-019e5982-akhomed-migrate-from-redb-to-postgres-fo
toasterson:claude/wi-019e481e-mcp-provenance-filter-find-triples-by-de
toasterson:claude/wi-019e481d-bounded-snapshot-mcp-workspace-snapshot
toasterson:claude/wi-019dd122-phase-41i-unified-trace-envelope-joining
toasterson:claude/wi-019dd122-phase-41h-ooda-thinkingloop-integration
toasterson:claude/wi-019dd121-2026-04-28-synthesis-prompt-plan-tool-ca
toasterson:claude/wi-019dd0c6-phase-42f-akh-awakening-per-tool-init-cl
toasterson:claude/wi-019dd0c6-phase-42e-heka-mcp-server-8-tools-rememb
toasterson:claude/wi-019dd0c6-phase-42d-hybrid-retrieval-pgvec-vsa-kg
toasterson:claude/wi-019dd0c5-phase-41-the-thinking-engine-unified-thi
toasterson:claude/wi-019dc9c9-phase-39a-llmbackend-trait-candlelocal-i
toasterson:claude/wi-019dc9c9-phase-38a-workspace-entity-lifecycle-loa
toasterson:claude/wi-019dc614-custom-cnpg-image-bake-with-age-pgvector
toasterson:claude/wi-019dc599-phase-38-relocatable-session-based-akh-w
toasterson:claude/wi-019db054-phase-35-t5-training-infrastructure
toasterson:claude/wi-019db054-phase-34-communicative-intelligence
toasterson:claude/wi-019db054-phase-29-capability-exposure
toasterson:claude/wi-019e26ba-bug-byte-index-panic-on-utf-8-boundary-i
toasterson:claude/wi-019e1598-high-fix-agent-memory-rs-456-byte-index
toasterson:claude/wi-019e3b34-fix-akhomed-llm-integration-for-teacher
toasterson:claude/wi-019e4909-ennead-agents-lack-proper-identity-no-ri
toasterson:claude/wi-019e4909-vsa-symbols-never-grounded-ground-symbol
toasterson:claude/wi-019e3eb9-ground-vsa-symbols-in-tecton-workspace-a
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
toasterson/akh-medu!286
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/wi-019e480e-mcp-crud-endpoints-for-agent-goals-expos"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Anima work item
019e480e-44e8-7213-b072-bdfacd98af68.Part 1 — Goal CRUD (MCP tools)
Currently akhomed exposes
agent_goals(read-only list) andlist_workspaces, but there is no way to create, update, suspend, cancel, or delete agent goals through MCP. The agent creates goals autonomously viainfer_rules/ OODA gap detection, and they accumulate indefinitely (16 active goals observed May 20, with 53 total and 44 canceled from prior sessions).New MCP tools:
create_goal:{workspace, goal_text, criteria_text, priority, parent_goal_id?}→ creates a new goal with explicit criteriaupdate_goal:{workspace, goal_id, goal_text?, criteria_text?, priority?, status?}→ modify existing goalcancel_goal:{workspace, goal_id}→ mark goal as cancelled/archived (soft-delete)prioritize_goals:{workspace, goal_ids: [...], priorities: [...]}→ batch re-prioritizeagent_goals: extend response to include goal status (active/dormant/cancelled/completed), created_at, cycles_spent, triples_created, parent_goal chainGoal lifecycle:
This enables:
Part 2 — Entity Schema Exposure
Currently entity type information is buried in triples — to find what an entity is you have to call
triples_ofand filter foris-arelations. There's no MCP-level concept of entity schemas/types.New MCP tools:
entity_schema:{entity, workspace}→ returns the entity's type hierarchy, outgoing and incoming relation types, confidence scores, and provenance summaryentity_types:{workspace}→ list all unique entity types (values ofis-arelations) with countsentity_type_filter:{workspace, type, page, page_size}→ list all entities of a given type with their core attributesExample response for
entity_schema entity=Tecton:This enables:
Relationship to bounded daemon WI (019e480d)
Goal CRUD is a prerequisite for bounded daemon runs — you need to be able to inject a specific goal before running N cycles, then read results after. The goal lifecycle + entity schema exposure together make the MCP interface a complete management surface for the daemon.
2026-05-21 01:10 UTCSummary
Implement MCP tooling to expose full CRUD lifecycle management for agent goals and querying capabilities for entity schemas. This will allow granular manipulation of daemon states, selective goal prioritization, and easier inspection of triple-based entity relationships.
Approach
First, update the gRPC schema in
anima-prototo define the new messages for Goal CRUD (create_goal,update_goal,cancel_goal,prioritize_goals) and Entity Schema exposure (entity_schema,entity_types,entity_type_filter). Next, inanima-core, introduce the expanded domain models for the goal lifecycle (enums for Proposed, Active, Dormant, Completed, Cancelled, Suspended) and structured entity representations. Inanima-db, create a SQL migration adding the newly required fields (criteria_text,status,priority,parent_goal_id) to the existing goals table, and write repository methods that can aggregate triple data to extract entity types and relationship provenance. Finally, implement the gRPC service methods inanima-serverand register the new MCP tool handlers in theanima-agentdaemon, passing commands down to the structured backend and ensuring the OODA loop logic halts or resumes based on the updated goal statuses.Files likely to change
proto/anima/v1/agent.protocrates/anima-core/src/domain/agent.rscrates/anima-db/migrations/005_agent_goals_and_entities.sql(incremented NNN prefix)crates/anima-db/src/repo/agent.rscrates/anima-server/src/services/agent.rscrates/anima-agent/src/mcp.rs(guess)crates/anima-agent/src/main.rsOpen questions
anima-agent, or just be ignored on the next tick?episodesmentioned in the provenance summary (e.g.,episodes_referencing) already tracked in the activeanima-dbschema, or does this require new tracking infrastructure?is-atypes) need aggressive caching, or is querying the raw triples table on every MCP tool invocation sufficiently performant?anima-agentdirectly handle the JSON-RPC and proxy toanima-servervia gRPC, or doesanima-serverhost the MCP endpoints directly?Complexity
M: The implementation touches the full stack from database migrations to gRPC definitions and daemon MCP bindings. While CRUD operations are straightforward, constructing the entity schemas from raw graph triples in PostgreSQL will require somewhat complex aggregation queries.
REQUEUE POINTERS (2026-07-23)
Requeued from
parked/human-parked(parked since May, 9 prior sessions, all failed, last 2026-05-21).1. ⚠ THE TRIAGE SECTION ABOVE POINTS AT THE WRONG REPOSITORY. The auto-generated "Approach" and "Files likely to change" list ANIMA paths —
proto/anima/v1/agent.proto,crates/anima-core/...,crates/anima-db/...,crates/anima-server/...,crates/anima-agent/.... This is an akh-medu work item; akh-medu is a separate repo (https://code.aopc.cloud/toasterson/akh-medu) with its OWN crates.anima-agentandanima-aiare retired in Anima anyway (ADR 0018). Ignore that file list entirely and locate the real akhomed MCP surface in akh-medu. This mis-generation affects several April/May akh-medu WIs and is a plausible contributor to the repeated failures.2. This is TWO independent deliverables — land Part 1 first. Part 1 = Goal CRUD MCP tools. Part 2 = entity schema exposure. They share nothing but the MCP registration surface. If the exit bar is tight, split Part 2 into a follow-up WI rather than holding Part 1 hostage.
3. Executor is now
tecton(2026-07-23) — the akh works on its own MCP surface and has direct knowledge ofagent_goals,list_workspaces,triples_ofand the OODA goal lifecycle. Verify the CURRENT live tool surface before trusting this description's inventory; it was written in May.4. The motivating numbers are stale — "16 active goals, 53 total, 44 cancelled" was observed 2026-05-20. Re-measure before designing cleanup semantics.
5. Implement the lifecycle as written (
proposed → active → dormant → completed | cancelled | suspended). It is deliberately richer than Anima's phase axis and unrelated to it — do not try to align the two.6. If you hit the same wall twice, STOP and report rather than burning turns. This WI was parked because it looped.
Pull request closed