feat(maintenance): add stale-task cleanup scheme

- scripts/cleanup_stale_tasks.py: daily script that cancels open tasks
  in completed/archived workstreams; handles 307 redirects; emits a
  cleanup progress event summarising results
- Makefile: add cleanup-stale target (also suitable for cron)
- ADR-001: append Workstream Closure Protocol section — mandatory closure
  review before marking workstream completed, with task classification
  table (done/cancelled/carry-forward) and Closure Review file format
- WP-0002 + WP-0005: append Closure Review sections documenting the
  2026-03-02 cleanup run (26 stale DB rows cancelled — all were legacy
  pre-ADR-001 DB-first records; file status was already done)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 00:32:35 +01:00
parent 412b7e6bf8
commit d96ed44c57
5 changed files with 271 additions and 1 deletions

View File

@@ -292,3 +292,33 @@ SBOM-specific additions to the workflow:
SBOM MCP tools, and `make ingest-sbom` target.
Prerequisite: v0.5 P2.3 (updated registration workflow) must be complete.
---
## Closure Review — 2026-03-02
**Outcome:** All 15 tasks completed. No carry-forwards. No dropped tasks.
**Context:** This workplan was created DB-first on 2026-02-28, before ADR-001 was formalised. The workplan file correctly recorded all tasks as `status: done`, but the DB rows were never synced from the file — they remained in their initial `todo` state in the database. The daily stale-task cleanup script (`scripts/cleanup_stale_tasks.py`) detected these 15 stale DB rows and cancelled them on 2026-03-02. No actual work was lost: all deliverables in Phase 14 were shipped as part of State Hub v0.3.
### Completed (DB updated at delivery time; file status = done)
- CUST-WP-0002-T01 — Write canon/standards/contribution-convention_v0.1.md
- CUST-WP-0002-T02 — Create contrib/ templates for BR, FR, EP, UPR
- CUST-WP-0002-T03 — Store Observable Framework TOC sidebar UPR as first artifact
- CUST-WP-0002-T04 — Align Railiance EP convention docs with canon master spec
- CUST-WP-0002-T05 — Design and implement contributions DB table + migration
- CUST-WP-0002-T06 — sbom_entries table + migration
- CUST-WP-0002-T07 — Implement /contributions/ router (CRUD + status patch)
- CUST-WP-0002-T08 — Implement /sbom/ router
- CUST-WP-0002-T09 — Write make ingest-sbom tooling
- CUST-WP-0002-T10 — New MCP tools: register_contribution, update_contribution_status, get_contributions
- CUST-WP-0002-T11 — New MCP tools: ingest_sbom, get_licence_report
- CUST-WP-0002-T12 — Dashboard: contributions.md page
- CUST-WP-0002-T13 — Dashboard: sbom.md page
- CUST-WP-0002-T14 — Update index.md overview to surface contribution and SBOM health
- CUST-WP-0002-T15 — Add sbom_source prompt + ingest-sbom step to registration workflow
### Cancelled (DB records only — legacy stale rows, not real cancellations)
All 15 DB task rows were cancelled by the cleanup script. The workplan file was authoritative; the DB rows were artefacts of the pre-ADR-001 DB-first creation pattern. This does not reflect a change in work outcome.

View File

@@ -304,3 +304,29 @@ Check if `WorkstreamRead` already exposes `domain_slug`; add if missing.
The rename endpoint cascades updates to these columns.
- `sync_workplans.py` (future, v0.3 Phase 4) will be able to ingest this
file and reconcile it with the DB rows created during the planning session.
---
## Closure Review — 2026-03-02
**Outcome:** All 11 tasks completed. No carry-forwards. No dropped tasks.
**Context:** This workplan was created DB-first on 2026-02-28, before ADR-001 was formalised. The workplan file correctly recorded all tasks as `status: done`, but the DB rows were never synced from the file — they remained in their initial `todo` state in the database. The daily stale-task cleanup script (`scripts/cleanup_stale_tasks.py`) detected these 11 stale DB rows and cancelled them on 2026-03-02. No actual work was lost: all deliverables in Phase 14 were shipped as part of State Hub v0.5.
### Completed (DB updated at delivery time; file status = done)
- CUST-WP-0005-T01 — Create `domains` table + Alembic migration
- CUST-WP-0005-T02 — Domain ORM model + Pydantic schemas
- CUST-WP-0005-T03 — Domain API router: list, get, create, rename, archive
- CUST-WP-0005-T04 — Update seed.py + TopicCreate schema for new domain model
- CUST-WP-0005-T05 — Create `managed_repos` table + migration
- CUST-WP-0005-T06 — Repo API router: register, list, update, archive
- CUST-WP-0005-T07 — Update registration workflow: multi-repo + dynamic domains
- CUST-WP-0005-T08 — MCP tools: domain lifecycle + repo registration
- CUST-WP-0005-T09 — Live domain validation for EP/TD + domain stats in state summary
- CUST-WP-0005-T10 — Dashboard: domains.md page
- CUST-WP-0005-T11 — Dashboard: domain filter on workstreams, EP, TD pages
### Cancelled (DB records only — legacy stale rows, not real cancellations)
All 11 DB task rows were cancelled by the cleanup script. The workplan file was authoritative; the DB rows were artefacts of the pre-ADR-001 DB-first creation pattern. This does not reflect a change in work outcome.