Skip to content

[ADR-004] GTD Pack Schema Plan and Lifecycle Audit #325

@ohdearquant

Description

@ohdearquant

Summary

Move GTD task lifecycle/status behavior into explicit schema-plan and handler semantics after the pack contract and wire-name surfaces are settled.

Source ADRs

  • F023 ADR-004 (MAJ): GTD task creation writes lifecycle state into properties["status"] (from audit-foundation/e2/ADR-004.md)
  • F100 ADR-019 (MAJ): GtdPack declares NAME, NOTE_KINDS, ENTITY_KINDS, VERBS, EDGE_RULES, and REQUIRES (from audit-platform/e4/ADR-019.md)
  • F101 ADR-019 (MAJ): handle_transition writes the updated task note with upsert_note and returns a delta envelope (from audit-platform/e4/ADR-019.md)

Files affected

  • crates/khive-pack-gtd/src/hook.rs (212 sampled LOC)
  • crates/khive-pack-gtd/src/lib.rs (166 sampled LOC)
  • crates/khive-pack-gtd/src/handlers.rs (593 sampled LOC)
  • crates/khive-db/src/migrations.rs (506 sampled LOC)
  • crates/khive-types/src/pack.rs (121 sampled LOC)
  • crates/khive-runtime/src/pack.rs (2677 sampled LOC)
  • crates/khive-db/src/backend.rs (627 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-pack-gtd -p khive-runtime 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-005] Storage Capabilities, Sparse Store, and Vector Contract
  • Depends on: #[ADR-004] Event Observable and Provenance Model
  • Depends on: #[ADR-007] Namespace Token and Runtime API Migration
  • Depends on: #[ADR-003] Runtime Backend and Substrate Coordinator
  • 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
  • Blocks: #[ADR-043] Embedding Model Registry and Vector Engine Migration
  • Blocks: #[ADR-025] Event-Sourced Proposals
  • Blocks: #[ADR-015] Schema Migration Ledger

LOC estimate

~100 lines added/40 removed; 7 existing affected file(s) sampled at 4902 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 workfoundationFoundation layer (ADR-001..015)platformPlatform layer (ADR-016..030)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions