fix(review): close the three gaps found in stack review #23
No reviewers
Labels
No labels
autopilot:pending-human
source:analyste
source:defenseur
source:human
source:medic
status:approved
status:blocked
status:in-progress
status:needs-clarification
status:needs-fix
status:ready
status:review
status:triage
type:bug
type:feature
type:infra
type:refactor
type:schema
type:security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: maximus/vps-health-api#23
Loading…
Reference in a new issue
No description provided.
Delete branch "review-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to the
/pr-reviewpass on the #18-#22 stack. Three findings wereraised, none blocking, none behavioural — each one weakened a guarantee the
stack was meant to provide. All three are closed here, plus a doc claim the
review proved false.
1. The safety net from #12 did not cover the routes #13 added
auth.test.jscarriesconst ROUTES = [...]under the comment "Any new routemust be added here." When #13 introduced
GET /hostsandPOST /hosts/<id>,that array was not updated, so no test asserted
GET /hosts-> 401 on amissing Authorization header. Structurally the exposure was near-nil
(
checkAuthis a single choke point), but this is exactly the drift class thefile exists to catch, and it slipped on its first outing.
ROUTESnow includes/hosts, and a dedicated block pins both directions ofthe token separation: a read token cannot write, an ingest token cannot read.
Verified by mutation: collapsing
checkAuthto a single expected token turns72 tests red, including the new ingest-route cases.
2. The oversized-body tests could not fail for the right reason
ingestOversized()mapped any transport error to413, so all four ceilingtests would have stayed green if the server had stopped writing the status and
merely destroyed the socket - on the one path where "a status code, not a dead
socket" is the entire client contract.
Transport errors are now surfaced instead of swallowed.
Verified by mutation: replacing the
413write with a barereq.destroy()turns 3 tests red with
expected 'transport error instead of a status: ...' to be 413. Before this change, that same mutation left them green.3.
HOST_AGENT_TIMEOUT_MSwas dead under the documented installpush-metrics.jsreads it, butrun-push.shexported onlyHOSTS_API_URL,HOSTS_INGEST_TOKENandHOST_ID. Setting it in the env file did nothing andthe agent always ran on its 10s default. It was also absent from the README, so
nothing promised it worked. Now exported and documented.
4. A security claim the review disproved
agent/README.mdstated the ingest/read token split protects the Defenseursreports if the workstation is stolen. It does not: the ThinkPad already stores
HEALTH_TOKENin cleartext for thedefenseur-autocron, so losing that laptopcompromises both tokens. The separation is still worth having - independent
rotation, and future hosts that only push never need the read token - but the
containment claim is gone, replaced by the instruction to rotate both together.
Verification
export, and one README
Generated autonomously by /autopilot run of 2026-08-16 (review follow-up)
Mergee localement sur
mainen fast-forward (pile chainee : l API de merge Forgejo ne peut pas traiter une pile dont la base n est pasmain). Tip integre :e181a96. Forgejo ne detecte pas un merge ff local, donc cette PR est fermee a la main — le code EST surmain.Pull request closed