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

Closed
matou-build-agent wants to merge 1 commit from agent/issue-238 into main

closes #238

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

Adds the board's Done column data as a new additive done[] field on the
v5 snapshot (no version bump — BT-1/#237 did 4→5). Area: collector only.

What changed

  • fleet-tui/repostats.py — new fleet_done(api, repos, token, now), the
    one genuinely new read. Per repo it paginates
    state=closed&since=<now-24h>&type=issues&limit=50&page=N the same
    page-until-short-page way tracker.fetch_open_issues walks open issues.
    since is only a server-side pre-filter (it matches updated_at), so the
    authoritative 24 h cutoff is re-applied Python-side on each row's
    closed_at — never the browser's job; a long-open issue merely edited inside
    the window is dropped. Rows are shaped {repo, number, title, closed_at}.
    Per-repo isolation, Done-column flavour: a failed (or mid-pagination-failed)
    read leaves THAT repo's done[] empty and emits no error row — the Done
    column has no error lane — never blanking the snapshot.
  • fleet-tui/collector.py — build_document composes it behind an
    injectable done_fn (default repostats.fleet_done), fed the document's own
    now so the 24 h cutoff anchors to generated_at; done is [] when no
    api/token (never absent — no downstream KeyError).
  • fleet-tui/floor/server/fixtures/snapshot.json — a representative v5
    done[] (two rows closed within 24 h of its generated_at).

Tests (red first, then green)

  • fleet-tui/tests/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.
  • fleet-tui/tests/test_collector.py: done rides the document / is empty
    without a tracker / is fed the document clock.
  • Root tests/collector-test.sh: mocks done_fn (stays offline) and asserts
    the Done column + its row shape.

Run:

cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py

→ 31 passed. The full offline bash suite loop is green end-to-end, and the
node floor tests (floor/server, 11) still pass (the fixture change is
additive).

Scope

No version bump, no backlog reconstruction (Done is a rolling 24 h read), no
board page / server / tui/** / writes. fleet-tui/** is vendor-excluded — no
re-vendor. STATUS.md header line + docs/journal/2026-10-16-238.md. Advances
#235.

Screenshots: none — collector data-layer only; the Done column has no
visible surface in this ticket (the board page that renders done[] is a
separate, out-of-scope ticket). The data shape is proven by the named tests and
the committed v5 fixture.

closes #238 ## MVP Factory Board: collector — `done[]` closed-in-24h read (#238) Adds the board's **Done** column data as a new additive `done[]` field on the v5 snapshot (no version bump — BT-1/#237 did 4→5). Area: **collector** only. ### What changed - **`fleet-tui/repostats.py`** — new `fleet_done(api, repos, token, now)`, the one genuinely new read. Per repo it paginates `state=closed&since=<now-24h>&type=issues&limit=50&page=N` the same page-until-short-page way `tracker.fetch_open_issues` walks open issues. `since` is only a server-side pre-filter (it matches `updated_at`), so the **authoritative 24 h cutoff is re-applied Python-side** on each row's `closed_at` — never the browser's job; a long-open issue merely edited inside the window is dropped. Rows are shaped `{repo, number, title, closed_at}`. Per-repo isolation, Done-column flavour: a failed (or mid-pagination-failed) read leaves THAT repo's `done[]` empty and emits **no error row** — the Done column has no error lane — never blanking the snapshot. - **`fleet-tui/collector.py`** — `build_document` composes it behind an injectable `done_fn` (default `repostats.fleet_done`), fed the document's own `now` so the 24 h cutoff anchors to `generated_at`; `done` is `[]` when no api/token (never absent — no downstream `KeyError`). - **`fleet-tui/floor/server/fixtures/snapshot.json`** — a representative v5 `done[]` (two rows closed within 24 h of its `generated_at`). ### Tests (red first, then green) - `fleet-tui/tests/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`. - `fleet-tui/tests/test_collector.py`: `done` rides the document / is empty without a tracker / is fed the document clock. - Root `tests/collector-test.sh`: mocks `done_fn` (stays offline) and asserts the Done column + its row shape. Run: ``` cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py tests/test_repostats.py ``` → `31 passed`. The full offline bash suite loop is green end-to-end, and the node floor tests (`floor/server`, 11) still pass (the fixture change is additive). ### Scope No version bump, no backlog reconstruction (Done is a rolling 24 h read), no board page / server / `tui/**` / writes. `fleet-tui/**` is vendor-excluded — no re-vendor. STATUS.md header line + `docs/journal/2026-10-16-238.md`. Advances #235. **Screenshots:** none — collector data-layer only; the Done column has no visible surface in this ticket (the board page that renders `done[]` is a separate, out-of-scope ticket). The data shape is proven by the named tests and the committed v5 fixture.
sandcastle: #238 — MVP Factory Board: collector done[] closed-in-24h read
All checks were successful
ci / static (pull_request) Successful in 2m24s
ci / test (pull_request) Successful in 5m24s
4fdb359eab
Add the board's Done column data as an additive done[] field on the v5
snapshot (no version bump — BT-1/#237 did 4→5).

Key decisions / files:
- fleet-tui/repostats.py: new fleet_done(api, repos, token, now) — the one
  genuinely new read. Per repo it paginates state=closed&since=<now-24h>
  the same page-until-short-page way tracker.fetch_open_issues walks open
  issues; `since` is only a server-side pre-filter (matches updated_at), so
  the authoritative 24 h cutoff is re-applied Python-side on each row's
  closed_at. Rows shaped {repo,number,title,closed_at}. Per-repo isolation,
  Done-column flavour: a failed/mid-page-fail read leaves that repo's done[]
  empty and emits NO error row (the Done column has no error lane), never
  blanking the snapshot.
- fleet-tui/collector.py: build_document composes it behind an injectable
  done_fn (default repostats.fleet_done), fed the document's own `now` so the
  cutoff anchors to generated_at; done is [] when no api/token (never absent).
- fleet-tui/floor/server/fixtures/snapshot.json: representative done[] (two
  rows closed within 24 h of generated_at).
- Tests red-first then green: tests/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) + tests/test_collector.py (done rides the
  document / empty without a tracker / fed the document clock). Root
  tests/collector-test.sh mocks done_fn (stays offline) + asserts the column.
  Run: cd fleet-tui && .venv/bin/python -m pytest -q tests/test_collector.py
  tests/test_repostats.py -> 31 passed.

No board page / server / tui/** / writes. fleet-tui/** vendor-excluded — no
re-vendor. STATUS.md header line + docs/journal/2026-10-16-238.md. Advances

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Author
Member
close-report gates passed for #238 — every claim verified; this PR is cleared for merge.
<!-- close-report: gates-passed --> close-report gates passed for #238 — every claim verified; this PR is cleared for merge.
Owner

Superseded, close unmerged (Ben, 2026-10-17). This PR's commit 4fdb359e was rebased onto main (only STATUS.md's header conflicted) and fast-forwarded as 25fbe5c — now on main at a3c9f50. Tests re-run on the rebased commit: tests/collector-test.sh rc 0, fleet-tui pytest 31 passed. Nothing left to merge here; #238 is done by that commit.

Superseded, close unmerged (Ben, 2026-10-17). This PR's commit `4fdb359e` was rebased onto `main` (only `STATUS.md`'s header conflicted) and fast-forwarded as `25fbe5c` — now on `main` at `a3c9f50`. Tests re-run on the rebased commit: `tests/collector-test.sh` rc 0, `fleet-tui` pytest 31 passed. Nothing left to merge here; #238 is done by that commit.
ben closed this pull request 2026-10-17 05:03:53 +00:00
All checks were successful
ci / static (pull_request) Successful in 2m24s
ci / test (pull_request) Successful in 5m24s

Pull request closed

Sign in to join this conversation.
No reviewers
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.

Dependencies

No dependencies set.

Reference
Matou/dev-factory!252
No description provided.