state-hub/api/services
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
..
token_sources Fixed and improved token tracking 2026-05-23 13:59:05 +02:00
__init__.py Implement RecentlyOnScope domain digest 2026-05-22 13:45:53 +02:00
consistency_sweep.py finish(STATE-WP-0064): cut over scheduler and split sweep errors from failures 2026-06-22 01:20:59 +02:00
execution_queue.py fix(retirement): close projection and launch contract gaps 2026-08-23 00:52:18 +02:00
fabric_graph.py add Fabric read model rollback activation 2026-08-31 23:07:10 +02:00
forge_credential.py feat(forge): resolve an optional forge read credential (STATE-WP-0084-T02/T03) 2026-08-27 23:12:57 +02:00
forge_projection.py fix: preserve source task sections and explicit empty notes 2026-09-10 15:11:03 +02:00
forge_repository.py Recover external repository renames through verified Forgejo redirects 2026-09-05 18:57:15 +02:00
legacy_compat.py feat(api): retire phase-1/2 /workstreams REST aliases with 410 stranglers 2026-07-10 13:31:57 +02:00
legacy_meter.py feat(legacy-meter): scale retirement quiet period to call volume 2026-08-20 07:13:44 +02:00
lifecycle.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
markitect_templates.py Implement RecentlyOnScope domain digest 2026-05-22 13:45:53 +02:00
message_receipts.py STATE-WP-0093: per-recipient broadcast receipts and standing notices (T01-T06). 2026-09-22 00:26:33 +02:00
ops_run_projection.py Prepare State Hub retirement baseline 2026-08-09 16:19:53 +02:00
recently_on_scope.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
reconciliation.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
repo_manager_dual_run.py feat(retirement): route SBOM scans through repo-manager 2026-08-21 23:15:34 +02:00
repository_aliases.py fix: bound repository collection identity projection 2026-09-05 02:03:52 +02:00
repository_identity.py feat: persist repository rename identity 2026-08-28 22:08:21 +02:00
repository_rename.py Recover external repository renames through verified Forgejo redirects 2026-09-05 18:57:15 +02:00
review_contracts.py feat(review): add multi-owner contracts and receipts 2026-08-22 20:57:51 +02:00
sbom_nexus.py feat: route SBOM writes to Nexus behind flag 2026-08-22 19:55:08 +02:00
schema_state.py feat(deploy): run migrations as part of the release, and report schema state 2026-08-26 00:00:09 +02:00
suggestion_relevance.py Finish CUST-WP-0011 and implement STATE-WP-0061 suggestion backlog. 2026-07-06 10:52:49 +02:00
suggestion_wsjf.py Finish CUST-WP-0011 and implement STATE-WP-0061 suggestion backlog. 2026-07-06 10:52:49 +02:00
summary_cache.py feat: project Nexus SBOM state into summaries 2026-08-22 20:12:16 +02:00
task_record_id_backfill.py fix(backfill): qualify short task ids with their workplan 2026-08-26 02:17:46 +02:00
wait_kind.py CUST-WP-0074-T02: task wait qualifiers in the hub read model 2026-09-28 22:39:18 +02:00
work_record_identifier_migration.py CUST-WP-0074-T02: task wait qualifiers in the hub read model 2026-09-28 22:39:18 +02:00
workplan_files.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
write_idempotency.py feat: add fast forge work-record reconciliation 2026-08-30 22:38:54 +02:00