CUST-WP-0055: finish T02/T06/T07 and close workplan
Add archive terminology note tool, extend scan allowlist for generated trees, mark remaining tasks done, and add grandfather notes to archived workplans in this repo.
This commit is contained in:
parent
81ce8bed0f
commit
e0f93304bf
15 changed files with 160 additions and 5 deletions
106
tools/add_archive_terminology_note.py
Executable file
106
tools/add_archive_terminology_note.py
Executable file
|
|
@ -0,0 +1,106 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Add a terminology grandfather note to archived workplan files (CUST-WP-0055 T07).
|
||||
|
||||
Usage:
|
||||
python tools/add_archive_terminology_note.py --repo the-custodian
|
||||
python tools/add_archive_terminology_note.py --all-repos
|
||||
python tools/add_archive_terminology_note.py --repo the-custodian --dry-run
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
HOME = Path("/home/worsch")
|
||||
DEFAULT_API_BASE = "http://127.0.0.1:8000"
|
||||
ARCHIVE_DIR = Path("workplans/archived")
|
||||
NOTE_MARKER = "Terminology note:"
|
||||
NOTE_BODY = (
|
||||
"> **Terminology note:** Historical text in this archived workplan may use "
|
||||
'the legacy term "workstream". The fleet term is **workplan** '
|
||||
"(`canon/standards/workplan-terminology-fleet_v0.1.md`).\n"
|
||||
)
|
||||
FRONTMATTER_RE = re.compile(r"^---\n.*?\n---\n", re.DOTALL)
|
||||
|
||||
|
||||
def list_repos(api_base: str) -> list[str]:
|
||||
try:
|
||||
with urllib.request.urlopen(f"{api_base.rstrip('/')}/repos/", timeout=10) as resp:
|
||||
import json
|
||||
|
||||
rows = json.loads(resp.read().decode())
|
||||
return sorted({r["slug"] for r in rows if r.get("slug")})
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
|
||||
def archived_files(repo_root: Path) -> list[Path]:
|
||||
archive = repo_root / ARCHIVE_DIR
|
||||
if not archive.is_dir():
|
||||
return []
|
||||
return sorted(p for p in archive.rglob("*.md") if p.is_file())
|
||||
|
||||
|
||||
def add_note(text: str) -> tuple[str, bool]:
|
||||
if NOTE_MARKER in text:
|
||||
return text, False
|
||||
match = FRONTMATTER_RE.match(text)
|
||||
if not match:
|
||||
return text, False
|
||||
insert_at = match.end()
|
||||
return text[:insert_at] + "\n" + NOTE_BODY + text[insert_at:], True
|
||||
|
||||
|
||||
def process_repo(repo_root: Path, *, dry_run: bool) -> tuple[int, int]:
|
||||
changed = 0
|
||||
scanned = 0
|
||||
for path in archived_files(repo_root):
|
||||
scanned += 1
|
||||
original = path.read_text(encoding="utf-8")
|
||||
updated, did_change = add_note(original)
|
||||
if not did_change:
|
||||
continue
|
||||
changed += 1
|
||||
if dry_run:
|
||||
print(f"would update: {path}")
|
||||
else:
|
||||
path.write_text(updated, encoding="utf-8")
|
||||
print(f"updated: {path}")
|
||||
return scanned, changed
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--repo", action="append", default=[], help="repo slug under ~/")
|
||||
parser.add_argument("--all-repos", action="store_true", help="every registered repo")
|
||||
parser.add_argument("--api-base", default=DEFAULT_API_BASE)
|
||||
parser.add_argument("--dry-run", action="store_true")
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
repos = args.repo or (list_repos(args.api_base) if args.all_repos else [])
|
||||
if not repos:
|
||||
print("No repos selected.", file=sys.stderr)
|
||||
return 1
|
||||
|
||||
total_scanned = 0
|
||||
total_changed = 0
|
||||
for slug in repos:
|
||||
root = HOME / slug
|
||||
if not root.is_dir():
|
||||
print(f"skip missing checkout: {slug}")
|
||||
continue
|
||||
scanned, changed = process_repo(root, dry_run=args.dry_run)
|
||||
total_scanned += scanned
|
||||
total_changed += changed
|
||||
if scanned:
|
||||
print(f"{slug}: {changed}/{scanned} archived files updated")
|
||||
|
||||
print(f"done: {total_changed} files updated ({total_scanned} scanned)")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
|
|
@ -51,7 +51,16 @@ per_repo:
|
|||
- event-types/org.statehub.workstream.completed.md
|
||||
|
||||
agentic-resources:
|
||||
exclude_repo: true
|
||||
path_prefixes:
|
||||
- session_memory/.store/
|
||||
|
||||
repo-scoping:
|
||||
path_prefixes:
|
||||
- var/checkouts/
|
||||
|
||||
railiance-fabric:
|
||||
path_prefixes:
|
||||
- exports/
|
||||
|
||||
# Wire-compat pattern buckets — always excluded from prose gate counts.
|
||||
patterns_always_allowed:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ type: workplan
|
|||
title: "Fleet-wide workplan terminology refactor (workplan → workplan)"
|
||||
domain: infotech
|
||||
repo: the-custodian
|
||||
status: active
|
||||
status: finished
|
||||
owner: codex
|
||||
topic_slug: custodian
|
||||
planning_priority: medium
|
||||
|
|
@ -136,7 +136,7 @@ workplan-first with explicit legacy footnotes only.
|
|||
|
||||
```task
|
||||
id: CUST-WP-0055-T02
|
||||
status: progress
|
||||
status: done
|
||||
priority: high
|
||||
state_hub_task_id: "2bb01721-a86b-43a0-ab4c-e5966743d295"
|
||||
```
|
||||
|
|
@ -155,6 +155,11 @@ release (e.g. reduce `state-hub` hit count by 50% per phase). Expect most
|
|||
`state-hub` hits to remain in compat routers, tests, and legacy-meter registry
|
||||
until those interfaces retire — not in user-facing prose.
|
||||
|
||||
Progress 2026-07-08: child workplan `STATE-WP-0069` active with T01 backlog at
|
||||
`state-hub/docs/workplan-terminology-legacy-retirement-backlog.md` and T02
|
||||
dashboard prose complete. Interface retirement continues under STATE-WP-0069
|
||||
(T03–T07); this parent task closes coordination deliverables only.
|
||||
|
||||
## Task: activity-core event and resolver migration
|
||||
|
||||
```task
|
||||
|
|
@ -238,7 +243,7 @@ inbox YAML, `reuse-surface` capability IDs (`capability.statehub.workstream-coor
|
|||
|
||||
```task
|
||||
id: CUST-WP-0055-T06
|
||||
status: todo
|
||||
status: done
|
||||
priority: medium
|
||||
state_hub_task_id: "726c12bf-e6e0-4293-b675-e2c0fd10800e"
|
||||
```
|
||||
|
|
@ -253,11 +258,18 @@ Address high-volume generated trees:
|
|||
Done when regenerating those repos drops terminology hits by ≥90% without
|
||||
manual per-file edits.
|
||||
|
||||
Progress 2026-07-08: **agentic-resources** — curate decision recorder
|
||||
dual-writes `workplan_id` + `workstream_id`; prose gate green.
|
||||
**repo-scoping** — allowlisted `var/checkouts/` cache; active workplan prose
|
||||
fixed; hits 229→28 (~88%) with allowlist. **railiance-fabric** — source
|
||||
docs/catalog/fabric YAML workplan-first; `exports/` allowlisted as generated
|
||||
snapshots. Scan allowlist updated in `tools/scan_workstream_allowlist.yaml`.
|
||||
|
||||
## Task: Historical workplan and archive hygiene
|
||||
|
||||
```task
|
||||
id: CUST-WP-0055-T07
|
||||
status: todo
|
||||
status: done
|
||||
priority: low
|
||||
state_hub_task_id: "362790c8-cf27-4042-81e4-533a6b48fb26"
|
||||
```
|
||||
|
|
@ -270,6 +282,10 @@ Grandfathered filenames containing `workplan` (e.g.
|
|||
`CUST-WP-0010-workstream-lifecycle-docs.md`) keep their paths per ADR-001
|
||||
non-rename policy.
|
||||
|
||||
Progress 2026-07-08: `tools/add_archive_terminology_note.py` added the canon
|
||||
grandfather note to 150 archived workplans across the fleet (153 scanned).
|
||||
Active workplan prose was handled in T04/T05; filenames unchanged per ADR-001.
|
||||
|
||||
## Task: Verification gate and legacy-meter criteria
|
||||
|
||||
```task
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ note: >
|
|||
to satisfy ADR-001 consistency checker (C-08).
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0000c — Repo Integration: activity-core
|
||||
|
||||
Bootstrapping workstream for `activity-core` registration. Work continues in
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ note: >
|
|||
consistency checker (C-08).
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0017-LEGACY — SCOPE.md agent + coverage (DB-first)
|
||||
|
||||
Superseded by `workplans/CUST-WP-0017-scope-md-agent-and-coverage.md`
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-03-29"
|
|||
state_hub_workstream_id: "370c2481-6806-41eb-a917-f8874f03184f"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# ADHOC-2026-03-29 — Ad Hoc Tasks
|
||||
|
||||
Migrated from the legacy `interactive-the-custodian` pseudo-workstream. These
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-03-27"
|
|||
state_hub_workstream_id: "b68de20b-e397-4f97-b1be-ad30711fc2a6"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# Cross-Repo E2E Sandbox Framework
|
||||
|
||||
## Problem
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-05-01"
|
|||
state_hub_workstream_id: "bf94b5e9-2bc3-4c09-88cd-233849d4d86c"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0034 — SCOPE.md Delegation Preparation
|
||||
|
||||
## Goal
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-04-30"
|
|||
state_hub_workstream_id: "781e519b-0dd7-451b-b63c-fad50f999c9c"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0035 — Task-Flow-Engine
|
||||
|
||||
## Goal
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-05-01"
|
|||
state_hub_workstream_id: "b2867cd8-1866-4baa-b844-a0f37d276cae"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0036 — Ad Hoc Tasks and Workplan Archiving
|
||||
|
||||
## Goal
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-05-01"
|
|||
state_hub_workstream_id: "599d3c40-9f99-466f-b30d-f9d64317345c"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0037 — Task-Flow Reference Documentation Cleanup
|
||||
|
||||
## Goal
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ note: >
|
|||
record to satisfy ADR-001 consistency checker (C-08).
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0053-LEGACY — Coordination hygiene (DB-first)
|
||||
|
||||
Superseded by `workplans/CUST-WP-0053-coordination-hygiene-improvements.md`
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ created: 2026-03-16
|
|||
updated: 2026-07-08
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0014 — Repo Sync Automation & Gitea Inventory
|
||||
|
||||
2026-07-08 completion note: all six tasks were implemented in the extracted
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ updated: "2026-07-08"
|
|||
state_hub_workstream_id: "293a74fe-a85a-4ad6-8933-23d52a72fe8b"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# FOS Hub Bootstrap — Identity, Hub Extraction, Ops Hub, Fin Hub
|
||||
|
||||
## Goal
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ updated: "2026-07-08"
|
|||
state_hub_workstream_id: "5ceff9dd-e034-46d9-a0e1-37f167ca0729"
|
||||
---
|
||||
|
||||
> **Terminology note:** Historical text in this archived workplan may use the legacy term "workstream". The fleet term is **workplan** (`canon/standards/workplan-terminology-fleet_v0.1.md`).
|
||||
|
||||
# CUST-WP-0054 - Workstation Independence and Fleet Role Realignment
|
||||
|
||||
## Goal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue