feat(runtime): agent process runtime — persistent records, lifecycle, and verb pack - #1700
Merged
Conversation
… and verb pack Implements the agentic process runtime: a runtime-owned agents table with enum-checked state columns and partial unique indexes enforcing one non-terminal record per provider session and per-owner idempotency keys; shared AgentState/ TerminalReason/AgentRecord types in khive-types and the AgentStore trait in khive-storage following the existing store-trait convention; a single normative lifecycle transition function with per-row tests including explicit no-op and illegal-transition arms; canonical spawn fingerprinting (ordered-key JSON, BLAKE3); and the khive-pack-agent verb pack exposing agent.spawn/observe/ suspend/resume/kill, with handlers delegating all legality decisions to the one transition function. 44 new tests across the five crates.
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.
Implements the agent process runtime per ADR-142: persistent agent records in a runtime-owned table (enum-checked columns; partial unique indexes for one-non-terminal-per-provider-session and per-owner idempotency), shared types in khive-types and the AgentStore trait in khive-storage (matching GraphStore/NoteStore/EventStore convention), a single normative transition function covering every row of the lifecycle table including no-op and illegal-transition arms, canonical spawn fingerprinting, and the khive-pack-agent verb pack (agent.spawn/observe/suspend/resume/kill) whose handlers delegate all legality decisions to that one transition function.
Testing: 10 store tests (including the actor-scoped idempotency pair test and provider-session uniqueness incl. suspended holders), 27 lifecycle tests (every transition-table row; mutation-checked — inverting the five no-op/error rows reddens exactly the five predicted tests), 7 pack integration tests through a real VerbRegistry dispatch, plus doc builds clean under -D warnings. Full workspace check passes.