feat: DoX assessment recording and soft visibility (STATE-WP-0077)
All checks were successful
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 2s

Add quality_doc/dor/dod recording convention, quality-debt CLI, promote-intake
and C-34 soft warnings, agent protocol notes, and DoD policy badge language.
Mark STATE-WP-0077 finished.
This commit is contained in:
tegwick 2026-07-22 21:18:40 +02:00
parent d356fde41c
commit fe4cfe22c9
13 changed files with 786 additions and 103 deletions

View file

@ -1,6 +1,6 @@
# Work-record quality gates (Definition family)
Status: active convention (STATE-WP-0076)
Status: active convention (STATE-WP-0076 policies; STATE-WP-0077 recording + soft visibility)
Related: `dashboard/src/docs/work-records.md`, `policies/intake-doc.md`,
`policies/work-item-dor.md`, `policies/workstream-dod.md`,
`policies/repo-doi.md`, `policies/service-dom.md`
@ -50,8 +50,109 @@ For each Definition policy that applies to a record:
No open-ended custom badges. New badge families require a new Definition policy
in `policies/`.
Assessment in v1 is **manual/convention** (agent or human notes, PR description,
progress event). No badge engine or hard API block ships with STATE-WP-0076.
## Recording assessments (STATE-WP-0077)
Canonical storage is **file fields** (preferred) plus optional **progress
events**. No badge DB table.
### Field names
| Policy | Field | Values |
|--------|-------|--------|
| DoC | `quality_doc` | `DoC-Ok` \| `DoC-Failed` (or bare `Ok` / `Failed`) |
| DoR | `quality_dor` | `DoR-Ok` \| `DoR-Failed` (or bare `Ok` / `Failed`) |
| DoD | `quality_dod` | `DoD-Ok` \| `DoD-Failed` (or bare `Ok` / `Failed`) |
Optional companions (same prefix): `quality_*_at` (ISO date), `quality_*_by`,
`quality_*_note`.
### Workplan frontmatter example (DoR + later DoD)
```yaml
---
id: STATE-WP-0077
status: ready
quality_dor: DoR-Ok
quality_dor_at: "2026-07-22"
quality_dor_by: "grok"
# quality_dod: DoD-Ok # when finishing with quality complete
---
```
### Task block example (DoR)
````markdown
```task
id: STATE-WP-0077-T01
status: todo
priority: high
quality_dor: DoR-Ok
quality_dor_at: "2026-07-22"
quality_dor_by: "grok"
```
````
### Intake YAML example (DoC)
Use a real `{PREFIX}-IN-NNNN` id only in the owning repo file — not in docs
(examples with live id patterns get registered by fix-consistency). Field shape:
```text
id: <PREFIX>-IN-NNNN
status: routed
quality_doc: DoC-Ok
quality_doc_at: "YYYY-MM-DD"
quality_doc_by: "agent-or-human"
quality_doc_note: "optional"
```
Hub-only intakes (no file yet): add a note whose body includes `DoC-Ok` or
`quality_doc: DoC-Ok`, and/or post a progress event (below).
### Progress event (optional audit)
```bash
curl -s -X POST http://127.0.0.1:8000/progress/ \
-H "Content-Type: application/json" \
-d '{
"event_type": "quality_assessment",
"summary": "DoR-Ok for workplan STATE-WP-0077",
"author": "grok",
"topic_id": "<uuid>",
"workplan_id": "<uuid>",
"detail": {
"policy": "DoR",
"outcome": "Ok",
"badge": "DoR-Ok",
"record_kind": "workplan",
"record_id": "STATE-WP-0077",
"assessed_by": "grok",
"note": null
}
}'
```
Helpers: `scripts/quality_assessment.py` (`badge()`, `progress_event_body()`).
## Soft visibility
```bash
statehub quality-debt # cwd repo + hub intakes
statehub quality-debt --json --no-hub
python scripts/quality_debt.py --here
```
Reports:
- workplans `status=ready` without `quality_dor` DoR-Ok
- workplans `status=finished` without `quality_dod` DoD-Ok
- file intakes `vetted`/`routed` without `quality_doc` DoC-Ok
- hub intakes `vetted`/`routed` without DoC-Ok in notes
`fix-consistency` soft warns **C-34** (ready without DoR-Ok). Finished
plans without DoD-Ok appear in `quality-debt` only (not C-warns), so historical
finished workplans do not flood every consistency run. Never fixable
auto-write; never FAIL.
## Unit vs structure (reminder)
@ -82,10 +183,17 @@ outside / sparse signal
→ DoD assessment (DoD-Ok when claiming quality-complete)
```
## Enforcement level
## Enforcement level (STATE-WP-0077)
Convention + documentation. Soft warnings and metrics may follow once policies
are in daily use. Task-flow assertions must implement policy, not replace it.
| Mechanism | Behaviour |
|-----------|-----------|
| Convention + this doc | Primary |
| `statehub quality-debt` | Read-only debt list |
| C-34 | Soft WARN in fix-consistency (ready without DoR-Ok) |
| `promote-intake` | Soft WARNING on stderr if no DoC-Ok; **still promotes** |
| Hard API / status blocks | **None** |
Task-flow assertions must implement policy, not replace it.
## Non-goals