Skip to content

[ADR-025] Event-Sourced Proposals #332

@ohdearquant

Description

@ohdearquant

Summary

Add proposal verbs, proposal payload/event kinds, aggregate references, proposal storage indexes, and kind-spec resolution needed by ADR-046.

Source ADRs

  • F143 ADR-025 (MAJ): KG registers 11 verbs and lacks propose, review, and withdraw. (from audit-platform/e1/ADR-025.md)
  • F242 ADR-046 (MAJ): KG_VERBS is [VerbDef; 11] and declares create, get, list, update, delete, merge, search, link, neighbors, traverse, and query; the dispatch match handles the same 11 verbs (from audit-rest/r6/ADR-046.md)
  • F243 ADR-046 (MAJ): MIGRATIONS contains only versions 1-4; no proposals_open, idx_proposals_open_*, or idx_events_payload_proposal_id DDL exists in the migration ledger. (from audit-rest/r6/ADR-046.md)
  • F244 ADR-046 (MAJ): The only event-consumer-style runtime extension found is DispatchHook::on_dispatch(&Event), and PackRuntime only defines metadata plus verb dispatch (from audit-rest/r6/ADR-046.md)
  • F245 ADR-046 (MAJ): resolve_kind_spec recognizes only substrate-level entity, note, edge, and event (from audit-rest/r6/ADR-046.md)

Files affected

  • crates/khive-pack-kg/src/lib.rs (163 sampled LOC)
  • crates/khive-db/src/migrations.rs (506 sampled LOC)
  • crates/khive-runtime/src/pack.rs (2677 sampled LOC)
  • crates/khive-pack-kg/src/handlers.rs (1216 sampled LOC)
  • crates/khive-types/src/event.rs (159 sampled LOC)
  • crates/khive-db/src/stores/event.rs (645 sampled LOC)

Acceptance criteria

  • All source findings listed above are addressed exactly once in this cluster.
  • Public types, handlers, schema, and docs touched by the affected files agree on the ADR contract.
  • Regression tests cover happy path and edge cases for the changed public APIs or schema behavior.
  • cargo test -p khive-types -p khive-db -p khive-runtime -p khive-pack-kg passes.
  • cargo clippy --workspace -- -D warnings passes.
  • make ci passes.

Dependencies

  • Depends on: #[ADR-001] Entity Kind and Type Contract
  • Depends on: #[ADR-002] Edge Ontology, Lifecycle, and Bulk Link Semantics
  • Depends on: #[ADR-004] Note Kind, Storage, and Curation Operations
  • Depends on: #[ADR-004] Event Observable and Provenance Model
  • Depends on: #[ADR-007] Namespace Token and Runtime API Migration
  • Depends on: #[ADR-004] HandlerDef Pack Contract
  • Depends on: #[ADR-017] Pack Verb Registry, Wire Names, and Introspection
  • Depends on: #[ADR-016] Request Execution Modes and Presentation Envelope
  • Depends on: #[ADR-023] Dynamic Pack Loading, Template, and Pack Binary Inclusion
  • Depends on: #[ADR-004] GTD Pack Schema Plan and Lifecycle Audit
  • Depends on: #[ADR-043] Embedding Model Registry and Vector Engine Migration
  • Blocks: #[ADR-035] Import, Export, Remote Resolver, and Sync
  • Blocks: #[ADR-015] Schema Migration Ledger

LOC estimate

~140 lines added/60 removed; 6 existing affected file(s) sampled at 5366 current LOC via wc -l, plus 0 new/planned path(s).

Risk notes

  • Same-file dependencies must merge first; dependency list includes the exact overlapping paths.

Auto-generated by ADR alignment triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    adr-alignmentADR v1 series alignment workadvancedAdvanced layer (ADR-031..046)platformPlatform layer (ADR-016..030)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions