state-hub/workplans/STATE-WP-0097-unlinked-decision-supersession.md
tegwick 0cf51f8fb1
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Document interim decision contest convention (STATE-WP-0097-T02)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 356991@bnt-lap001
Assistant-Session: 5d99ea69-ed55-4a1e-8d97-f4f312db247f
2026-10-13 22:35:11 +02:00

76 lines
3.2 KiB
Markdown

---
id: STATE-WP-0097
type: workplan
title: "Flag resolved decisions that a later decision supersedes without a link"
domain: infotech
repo: state-hub
status: finished
owner: claude-code
topic_slug: infotech
created: "2026-10-13"
updated: "2026-10-13"
flavor: implementation
related: [STATE-WP-0094]
state_hub_workstream_id: "69eb5013-c103-5d2a-8d58-9da1e2c2042f"
---
Owner response to activity-core suggestion ff7d2152-75dd-4a49-8dac-e0ebe7343039
(contest path for resolved decisions).
Disposition: State Hub does not add a first-class `contested` decision state or
a `/decisions/{id}/contest` route. State Hub is in retirement
(`prj-state-hub-retirement`). Decisions are file-first work records whose
writer convention is repo-manager (RMGR-WP-0008). The worked example was
settled the same day by a superseding decision. The defect was that the hub
never linked the two decisions. 1c9817ee (Activity Core owns the publisher)
remained `resolved` with `superseded_by: null` after c6f23433 superseded it.
The link was set by hand on 2026-10-13 with founder approval.
The existing model already expresses re-assignment (`status: superseded`,
`superseded_by`). This plan makes a missing link visible. It does not add a new
authoring surface.
## Add a consistency check for unlinked supersession
```task
id: STATE-WP-0097-T01
status: done
priority: medium
state_hub_task_id: "dd2d184a-9bfd-5578-b7ce-cc487f1a8a0a"
```
Add C-43 (WARN, not auto-fixable) to `scripts/consistency_check.py`. It fires
when a resolved decision's title or rationale cites another decision id with
"supersedes"/"superseding" while that cited decision is still `resolved`, or
has `superseded_by` unset or pointing elsewhere. Report both ids. The fix stays
a deliberate founder/decider action: PATCH `status: superseded` and
`superseded_by`. Add tests for the linked, unlinked and mismatched cases.
Document C-43 in the checker header table.
2026-10-13 done: `find_unlinked_supersessions` and `_check_unlinked_supersession`
in `scripts/consistency_check.py`, scoped to decisions on the repo's own
workplans (one `GET /decisions/` per run). The check matches "supersedes
[decision] <8-hex|uuid>" and ignores "superseded by". It skips ambiguous
prefixes. Five new tests pass, and the full module passes (168 tests).
Live scan across all decisions: zero findings now that 1c9817ee is linked.
## Document the interim contest convention
```task
id: STATE-WP-0097-T02
status: done
priority: low
state_hub_task_id: "04d384e0-7bd8-5157-9c36-648372f8fb39"
```
Document the convention in `docs/`. An owner whose checked-in charter
(INTENT.md, SCOPE.md, ADRs) excludes an assigned decision replies on the
relaying thread with `CONTEST <decision_id>` and charter refs. Only the founder
or the original decider re-resolves. Re-assignment is a new decision that
supersedes the old one, followed by the link that C-43 checks. A first-class
contest state is routed to the-custodian canon and repo-manager as the
long-term owners. It is not built here.
2026-10-13 done: `docs/decision-contest-convention.md` covers who may contest
and on what grounds, the CONTEST reply format, re-resolution by supersession,
the link step and C-43 detection, with the 1c9817ee → c6f23433 worked example.