Skip to content

Two doc corrections, a hostinfo test fix, and /api/requests tests - #9

Merged
T-Crypt merged 3 commits into
mainfrom
quality/2026-10-16
Oct 17, 2026
Merged

T-Crypt merged 3 commits into
mainfrom
quality/2026-10-16

Conversation

@T-Crypt

@T-Crypt T-Crypt commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

A quality pass over the repo. Two README claims contradicted the code, one
collector test failed on the GPU box, and the /api/requests endpoint had no
unit test.

Docs

  • The HTTP API table documented /api/requests?range=…. The handler reads
    since (epoch seconds) and limit (default 1000, clamped to 1000), so a
    range=… request is ignored and returns unfiltered rows. The table row now
    reads ?since=…&limit=….
  • The README said "the two test_hostinfo.py skips". The Windows ctypes
    backend holds three tests, so a Linux run skips three. The sentence now
    describes the gates with no count.

Tests

  • collector/test_hostinfo.py: test_processes_shape failed on the GPU box
    when a tiny launcher process matched an engine name. rss_gb is rounded to
    2 dp in GB, so a process of about 2 MB reports 0.0, which failed the > 0
    assertion. Both Linux process tests now accept >= 0.
  • collector/test_speculum.py: three tests for the /api/requests contract.
    They pin the default (since 0, limit 1000), the explicit pass-through,
    and the 400 for a non-integer value or limit < 1.

Test output

python3 -m py_compile collector/*.py                         # OK
python3 -m unittest discover -s collector -p "test_*.py"     # Ran 109 tests, OK (skipped=3)
node smoke/ui-primitives.mjs                                 # ALL PASS
node smoke/shell.mjs                                         # ALL PASS

The repo and CI configure no linter. The documented parse check is
py_compile. flake8 --select=E9,F63,F7,F82 collector/ is clean.

Issues

gh issue list --state all is empty. The repo has no open or closed issues,
so there was nothing to triage.

No dependency changes and no drive-by refactors.

The API reads `since` (epoch seconds) and `limit` (default 1000); it does
not take a `range` param, so a range request is silently ignored. The
test_hostinfo platform gates skip three Windows-only tests on Linux, not
two.
rss_gb is rounded to 2 dp in GB, so a tiny launcher/wrapper process that
matches an engine name reports 0.0 and tripped the `> 0` assertion on the
GPU box. Allow >= 0 for the matched processes in both Linux process tests.
Pin the documented params: default since=0/limit=1000, explicit
since/limit pass-through, and the 400 for a non-integer value or
limit < 1.
@T-Crypt T-Crypt changed the title Quality pass: docs accuracy, hostinfo test robustness, /api/requests tests Two doc corrections, a hostinfo test fix, and /api/requests tests Oct 17, 2026
@T-Crypt
T-Crypt marked this pull request as ready for review October 17, 2026 00:16
@T-Crypt
T-Crypt merged commit 6bdd4dd into main Oct 17, 2026
2 checks passed
@T-Crypt
T-Crypt deleted the quality/2026-10-16 branch October 17, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant