pmo: loop quality audit — default_class=code, reopen 522/495, park 497, verify 524

This commit is contained in:
2026-08-29 09:04:45 -05:00
parent f2698b741c
commit eeeb05e733
5 changed files with 54 additions and 0 deletions
@@ -0,0 +1,51 @@
# REPORT — 20260829 08:30 — mred `version update` (Redmine 524 finish turn)
Repo: ukrrs/mopac-redmine-go, branch `main`, pushed `788f6fe..5abd352`.
Prior state: main@788f6fe clean, zero delivered from the study turn; this
turn implemented the full scope. All dev ran inside the digest-pinned
Docker builder (`./dev.sh`); TDD (tests red first, then implementation).
## Diff summary (3 atomic conventional commits, pushed to origin/main)
| Commit | Content |
|---|---|
| `26824c3` feat(redmine) | `Client.UpdateVersion` (PUT /versions/N.json — partial: only set fields serialized; the 204 empty body is never parsed, `out=nil` path) and `Client.GetVersion` (GET /versions/N.json, backs the `-o json` re-fetch). Fake Redmine gained the matching PUT/GET endpoints (partial apply, 204-with-empty-body, 404 on unknown id) plus a `Version(id)` assertion accessor. |
| `37118f0` feat(cli) | `mred version update ID [--status open|closed] [--due YYYY-MM-DD] [--name NAME]`. At least one flag required → exit 1 usage error otherwise; `--status` validated to open\|closed; only provided flags sent. Text mode prints `updated version #N`; `-o json` re-fetches and emits the stored version; exit codes 0/1/2 per house convention; help/usage text updated. |
| `5abd352` docs(readme) | Command-reference row, quickstart example, library-surface signatures (`GetVersion`/`UpdateVersion`), partial-update + 204 note, status-table line. |
## Verification
- `./dev.sh check` (build + vet + test, Docker): **green**, all packages.
- `./dev.sh smoke` (real CLI vs containerized fake, port 8601): **smoke: OK**
(existing surface unregressed; redaction pass clean).
- New tests, all table-driven against the existing fake:
- Library: `TestUpdateVersionPartial` (4 cases: status flip, due change,
name change, combined — each pins the exact PUT request body so
"only provided flags are sent" is asserted, plus untouched-attribute
survival; every case round-trips the 204-empty-body reply),
`TestGetVersion` (round-trip + 404→`ErrNotFound`),
`TestUpdateVersionMissing` (404 mapping with parseable `http 404`).
- CLI: `TestVersionUpdate` (8 cases: status flip, due change, name
change, combined flags with stored-state assertions, no-flags usage
error, bad-status usage error, non-numeric id usage error, unknown id
→ exit 2 with `http 404` on stderr) and `TestVersionUpdateJSONRefetches`
(json mode re-fetches and emits the updated version).
- Count: 22 passing test entries (4 top-level functions, 12 table
subtests). Full suite: 3 packages ok, 0 failures.
## Production read verification (read-only, after push)
Using the 0600 config derived from `~/.creds/redmine.env`
(`~/.config/mred/env`, per the documented bootstrap):
- `mred version list -p MOPAC`**exit 0**, all **5** versions present
(34 closed V1 Core due 2026-08-28; 35 open Beta due 2026-08-31;
36 open Production due 2026-09-01; 37 closed Phase 3 - Integrations
due 2026-09-07; 38 open Selfhost Alpha due 2026-08-29).
- `mred version list -p MOPAC -o json` → 5 ids, exit 0.
- **No mutation of production**: the only commands run against the live
tracker are `version list` reads (GET). `version update` was exercised
exclusively against the fake.
No journal/status writes were made to Redmine 524 — left Resolved for
PMO re-verification per protocol.
@@ -0,0 +1,19 @@
# TASK: mred `version update` — finish 524 (loop flash turn round-limited, delivered nothing)
## Context
Redmine 524. The loop's study-class turn burned 12 rounds reading and shipped zero; repo untouched at main@788f6fe. You are the finish turn. Repo: `~/projects/meta/MOPAC/redmine-go` (ukrrs/mopac-redmine-go, branch main, clean).
## Scope (small, surgical)
1. `mred version update ID [--status open|closed] [--due YYYY-MM-DD] [--name NAME]`:
- API: PUT /versions/{id}.json — note: Redmine returns **204 empty body** on success (handle it; do not parse).
- Only provided flags are sent; at least one required (usage error otherwise).
- Same output/exit-code conventions as existing subcommands (`updated version #N` line, `-o json` emits the re-fetched version).
2. Table-driven tests against the existing fake (it already serves versions): status flip, due change, combined flags, 204 handling, error mapping. Red first, then implement.
3. README command reference row + status table line.
4. Verify read-only against production after push: `mred version list -p MOPAC` must still show all 5 versions (no mutation of prod).
## Build discipline
ALL DEV IN DOCKER via ./dev.sh (digest-pinned builder). NEVER broad pkill. TDD. Atomic conventional commits, push origin main. Exit 0 only if tests green + pushed.
## Deliverable
`REPORT-20260829-0830-mred-version-update.md` in `~/.coordinate/inbox-pmo/`: diff summary, test counts, prod read verification. No journal/status writes to Redmine — PMO handles 524's ticket (it is currently Resolved; PMO re-verifies on your REPORT).