state-hub/api
tegwick b9997d6fc7 CUST-WP-0074-T02: task wait qualifiers in the hub read model
Adds tasks.decision_id and workplan_dependencies.from_task_id (migration
e8f9a0b1c2d3). A from_task_id column is needed rather than
from_workplan_id plus description: the partial unique indexes key on
(from_workplan_id, target, relationship_type), so two tasks in one
workplan waiting on the same target could not both be indexed, and the
derived wait_kind needs per-task attribution. The two existing unique
indexes are narrowed to frontmatter edges (from_task_id IS NULL) and two
task-origin counterparts are added; downgrade deletes task-origin rows
before restoring the old indexes.

POST /workplans/{id}/dependencies/ accepts from_task_id (must belong to
the from workplan; a task cannot depend on itself). TaskCreate/Update/Read
carry decision_id.

Derived read-model fields, no new write routes (rule 5):
- TaskRead.wait_kind: external | human | both | unqualified, null unless
  status is wait (dependency rows from this task / needs_human).
- WorkplanRead.blocked_kind: human | external | none, null unless status
  is blocked. Human wins over external.
Both come from api/services/wait_kind.py, applied on GET /tasks/,
GET /tasks/{id}, GET /workplans/ and GET /workplans/{id}.

The identifier-migration reference-count proof now includes from_task_id
(FK count guard 22 -> 23).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: sonnet
Assistant-Process: 237582@bnt-lap001
Assistant-Session: f2b3d9f1-8fb9-4b9c-bc2b-837ec5dfc826
2026-09-28 22:39:18 +02:00
..
edge feat(edge): add offline read cache for allowlisted State Hub GET routes 2026-07-09 01:04:15 +02:00
events chore: update standalone state hub wiring 2026-05-17 20:01:21 +02:00
models CUST-WP-0074-T02: task wait qualifiers in the hub read model 2026-09-28 22:39:18 +02:00
routers CUST-WP-0074-T02: task wait qualifiers in the hub read model 2026-09-28 22:39:18 +02:00
schemas CUST-WP-0074-T02: task wait qualifiers in the hub read model 2026-09-28 22:39:18 +02:00
services CUST-WP-0074-T02: task wait qualifiers in the hub read model 2026-09-28 22:39:18 +02:00
classification.py fix(classification): allow the allowed-values path to be configured 2026-08-24 23:34:34 +02:00
config.py feat: add repository rename lifecycle API 2026-08-29 03:17:37 +02:00
database.py Add state-hub v0.1 — local-first state service for the Custodian 2026-02-24 17:47:49 +01:00
doi_engine.py Production todo-md scan: sweep hostname + deploy tag main-d8808bf 2026-07-08 14:38:07 +02:00
flow_defs.py Complete workplan state model cleanup 2026-05-18 01:31:36 +02:00
main.py feat: add fast forge work-record reconciliation 2026-08-30 22:38:54 +02:00
task_status.py feat(tasks): adopt canonical task statuses 2026-05-26 01:32:50 +02:00
work_record_flavor.py Index workplan flavor and omit residuals from default views. 2026-09-14 15:28:58 +02:00
workplan_status.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00