MVP Factory Board: collector — done[] closed-in-24h read #238

Closed
opened 2026-10-15 16:58:02 +00:00 by matou-build-agent · 5 comments

Part of the MVP Factory Board pipeline (#234 scope, this ticket's spec in #235).

Priority tonight: worked ahead of the general queue this evening for Ben's morning test (NZ). Depends on BT-1 (the v5 bump).

What

Add the board's Done column data: a new done[] field on the snapshot listing issues closed in the last 24 h. Area: collector only. This is the one genuinely new read, kept separate so its pagination and per-repo isolation are reviewed on their own.

  • fleet-tui/collector.py emits done[], one row per repo-closed-issue {repo, number, title, closed_at}.
  • The rows come from a new per-repo read state=closed&since=<nowMs-24h>, paginated like fetch_open_issues, isolated per repo (a failed read leaves that repo's done[] empty, never blanks the snapshot). The 24 h cutoff is computed in collector.py, not the browser.
  • Add done[] to the committed v5 fixture fleet-tui/floor/server/fixtures/snapshot.json. done[] is additive to v5 (no further version bump).

Test (red first)

fleet-tui/tests/test_collector.py (+ test_repostats.py): test_done_rows_closed_within_24h, test_done_excludes_older_than_24h, test_done_degrades_to_empty_on_repo_error, test_done_shape.
Run: cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py.

Acceptance

  • done[] lists only issues closed ≤ 24 h, shaped {repo,number,title,closed_at}, isolated per repo.
  • Committed v5 fixture includes a representative done[].
  • Named tests exist and pass; close-report includes the run command + pass line.

out_of_scope

No version bump (BT-1 did 4→5; done[] is additive). No backlog reconstruction — "Done" is a rolling 24 h read. No board page / server / tui/** / writes. Touch STATUS.md with one short header line only + journal (hazard #230). fleet-tui/** vendor-excluded — no re-vendor.

Advances #235.

Part of the MVP Factory Board pipeline (#234 scope, this ticket's spec in #235). **Priority tonight:** worked ahead of the general queue this evening for Ben's morning test (NZ). Depends on BT-1 (the v5 bump). ## What Add the board's **Done** column data: a new `done[]` field on the snapshot listing issues **closed in the last 24 h**. Area: **collector** only. This is the one genuinely new read, kept separate so its pagination and per-repo isolation are reviewed on their own. - `fleet-tui/collector.py` emits `done[]`, one row per repo-closed-issue `{repo, number, title, closed_at}`. - The rows come from a new per-repo read `state=closed&since=<nowMs-24h>`, paginated like `fetch_open_issues`, isolated per repo (a failed read leaves that repo's `done[]` empty, never blanks the snapshot). The 24 h cutoff is computed in `collector.py`, not the browser. - Add `done[]` to the committed v5 fixture `fleet-tui/floor/server/fixtures/snapshot.json`. `done[]` is additive to v5 (no further version bump). ## Test (red first) `fleet-tui/tests/test_collector.py` (+ `test_repostats.py`): `test_done_rows_closed_within_24h`, `test_done_excludes_older_than_24h`, `test_done_degrades_to_empty_on_repo_error`, `test_done_shape`. Run: `cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py`. ## Acceptance - `done[]` lists only issues closed ≤ 24 h, shaped `{repo,number,title,closed_at}`, isolated per repo. - Committed v5 fixture includes a representative `done[]`. - Named tests exist and pass; close-report includes the run command + pass line. ## out_of_scope No version bump (BT-1 did 4→5; `done[]` is additive). No backlog reconstruction — "Done" is a rolling 24 h read. No board page / server / `tui/**` / writes. Touch `STATUS.md` with **one short header line only** + journal (hazard #230). `fleet-tui/**` vendor-excluded — no re-vendor. Advances #235.
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Decision: delete the stale remote branch agent/issue-238 so land-pr.sh can push a fresh branch for this PR.

Why it was blocking: the remote branch agent/issue-238 pre-existed at 0d638e1 (an ancestor of origin/main, with no associated PR — a placeholder, same state as agent/issue-230/agent/issue-239). On a non-force push to that existing branch, the pre-push language gate (.sandcastle/gate-lib.sh::gate_files_from_prepush) scopes its changed-file diff against the remote branch head 0d638e1 rather than the merge-base with main, so it saw ~183 commits of unrelated history — including package.json/*.ts — and refused the push (TypeScript change detected ... no supported TS gate resolved; this sandbox carries no nix/pnpm). My actual slice (fleet-tui/** + a journal entry + a STATUS header line) touches no TypeScript.

Why two-way: reversible — 0d638e1 is fully contained in main, so deleting the placeholder loses no unique commits and it is trivially recreatable from main (and land-pr recreates it with my commit). Provable — verified git merge-base --is-ancestor 0d638e1 origin/main = true, and no open or closed PR has head agent/issue-238. Not on the one-way-door list (no personal credentials, security-posture widening, member-facing trust accept, data destruction, or non-routine spend). Once deleted, the fresh push scopes the gate to merge-base(HEAD, main) = my 8 changed files → no TS → the gate passes.

Follow-up: filing a ready-for-session harness ticket for the pre-push gate over-scoping when the target agent/issue-<N> branch is stale at an old ancestor.

Ruled by agent under ADR 0174 — veto anytime. **Decision:** delete the stale remote branch `agent/issue-238` so `land-pr.sh` can push a fresh branch for this PR. **Why it was blocking:** the remote branch `agent/issue-238` pre-existed at `0d638e1` (an ancestor of `origin/main`, with **no** associated PR — a placeholder, same state as `agent/issue-230`/`agent/issue-239`). On a non-force push to that existing branch, the pre-push language gate (`.sandcastle/gate-lib.sh::gate_files_from_prepush`) scopes its changed-file diff against the remote branch head `0d638e1` rather than the merge-base with `main`, so it saw ~183 commits of unrelated history — including `package.json`/`*.ts` — and refused the push (`TypeScript change detected ... no supported TS gate resolved`; this sandbox carries no `nix`/pnpm). My actual slice (`fleet-tui/**` + a journal entry + a STATUS header line) touches **no** TypeScript. **Why two-way:** reversible — `0d638e1` is fully contained in `main`, so deleting the placeholder loses no unique commits and it is trivially recreatable from `main` (and `land-pr` recreates it with my commit). Provable — verified `git merge-base --is-ancestor 0d638e1 origin/main` = true, and no open or closed PR has head `agent/issue-238`. Not on the one-way-door list (no personal credentials, security-posture widening, member-facing trust accept, data destruction, or non-routine spend). Once deleted, the fresh push scopes the gate to `merge-base(HEAD, main)` = my 8 changed files → no TS → the gate passes. **Follow-up:** filing a `ready-for-session` harness ticket for the pre-push gate over-scoping when the target `agent/issue-<N>` branch is stale at an old ancestor.
Author
Member

⏩ independent reviewer for #238 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #238 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>
Author
Member

close-report for #238 — status success

✅ close-report gates passed — every claim verified against the PR head. PR #252 (#252) is open and green; a human merges it and the merge closes this issue via closes #238 (MERGE_AUTHORITY=human).

envelope
{
  "issue": 238,
  "status": "success",
  "commits": [
    "4fdb359eabb4ab7039dc0b04456371898a750ea3"
  ],
  "changed_files": [
    "STATUS.md",
    "docs/journal/2026-10-16-238.md",
    "fleet-tui/collector.py",
    "fleet-tui/floor/server/fixtures/snapshot.json",
    "fleet-tui/repostats.py",
    "fleet-tui/tests/test_collector.py",
    "fleet-tui/tests/test_repostats.py",
    "tests/collector-test.sh"
  ],
  "tests": [
    {
      "command": "cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py",
      "exit_code": 0
    },
    {
      "command": "bash tests/collector-test.sh",
      "exit_code": 0
    },
    {
      "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done",
      "exit_code": 0
    }
  ],
  "criteria": {
    "done[] lists only issues closed <= 24 h, shaped {repo,number,title,closed_at}, isolated per repo": "repostats.fleet_done re-applies the 24 h cutoff on each row's closed_at (test_done_rows_closed_within_24h, test_done_excludes_older_than_24h), emits {repo,number,title,closed_at} (test_done_shape), and isolates per-repo failures to an empty Done with no error row (test_done_degrades_to_empty_on_repo_error) — fleet-tui/repostats.py",
    "Committed v5 fixture includes a representative done[]": "fleet-tui/floor/server/fixtures/snapshot.json gained a done[] of two rows closed within 24 h of generated_at; still a valid v5 doc (node floor tests green, additive, no version bump)",
    "Named tests exist and pass; close-report includes the run command + pass line": "test_done_rows_closed_within_24h, test_done_excludes_older_than_24h, test_done_degrades_to_empty_on_repo_error, test_done_shape in tests/test_repostats.py; run: cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py -> 31 passed"
  },
  "summary": "Added repostats.fleet_done (state=closed&since=now-24h, paginated, per-repo-isolated, closed_at cutoff) and an additive done[] on the v5 snapshot, wired through collector.build_document, with a representative fixture done[] and red-first tests.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #238 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the PR head. PR #252 (https://git.matou.nz/Matou/dev-factory/pulls/252) is open and green; a human merges it and the merge closes this issue via `closes #238` (MERGE_AUTHORITY=human). <details><summary>envelope</summary> ```json { "issue": 238, "status": "success", "commits": [ "4fdb359eabb4ab7039dc0b04456371898a750ea3" ], "changed_files": [ "STATUS.md", "docs/journal/2026-10-16-238.md", "fleet-tui/collector.py", "fleet-tui/floor/server/fixtures/snapshot.json", "fleet-tui/repostats.py", "fleet-tui/tests/test_collector.py", "fleet-tui/tests/test_repostats.py", "tests/collector-test.sh" ], "tests": [ { "command": "cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py", "exit_code": 0 }, { "command": "bash tests/collector-test.sh", "exit_code": 0 }, { "command": "for t in tests/*.sh onboarding/tests/*.sh; do case \"$t\" in *fakebin*|*fixtures*) continue;; esac; bash \"$t\" || echo FAIL: $t; done", "exit_code": 0 } ], "criteria": { "done[] lists only issues closed <= 24 h, shaped {repo,number,title,closed_at}, isolated per repo": "repostats.fleet_done re-applies the 24 h cutoff on each row's closed_at (test_done_rows_closed_within_24h, test_done_excludes_older_than_24h), emits {repo,number,title,closed_at} (test_done_shape), and isolates per-repo failures to an empty Done with no error row (test_done_degrades_to_empty_on_repo_error) — fleet-tui/repostats.py", "Committed v5 fixture includes a representative done[]": "fleet-tui/floor/server/fixtures/snapshot.json gained a done[] of two rows closed within 24 h of generated_at; still a valid v5 doc (node floor tests green, additive, no version bump)", "Named tests exist and pass; close-report includes the run command + pass line": "test_done_rows_closed_within_24h, test_done_excludes_older_than_24h, test_done_degrades_to_empty_on_repo_error, test_done_shape in tests/test_repostats.py; run: cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py -> 31 passed" }, "summary": "Added repostats.fleet_done (state=closed&since=now-24h, paginated, per-repo-isolated, closed_at cutoff) and an additive done[] on the v5 snapshot, wired through collector.build_document, with a representative fixture done[] and red-first tests.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Member

Follow-up harness ticket filed: #253 (ready-for-session) — the pre-push gate over-scoping that this ruling worked around. PR for #238 is #252, awaiting human merge.

Follow-up harness ticket filed: #253 (ready-for-session) — the pre-push gate over-scoping that this ruling worked around. PR for #238 is #252, awaiting human merge.
Owner

Landed on main as 25fbe5c (rebase of PR #252's 4fdb359e, 2026-10-17, by Ben's session). PR #252 is superseded and closed unmerged. Verification on the rebased commit: tests/collector-test.sh rc 0; fleet-tui pytest test_collector.py + test_repostats.py 31 passed. Closing by hand — the closes #238 body on PR #252 never fires because that PR is not merged.

Landed on `main` as `25fbe5c` (rebase of PR #252's `4fdb359e`, 2026-10-17, by Ben's session). PR #252 is superseded and closed unmerged. Verification on the rebased commit: `tests/collector-test.sh` rc 0; `fleet-tui` pytest `test_collector.py` + `test_repostats.py` 31 passed. Closing by hand — the `closes #238` body on PR #252 never fires because that PR is not merged.
ben closed this issue 2026-10-17 05:04:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/dev-factory#238
No description provided.