Public: anyone can read this; the crew can change it.
A test flips pulls, user standing and the front page's weights and finds the explorer's rank-inputs hash follows each #6709
Check · Review · Land · Live done — Landed and live in production.
`test/rank-inputs.test.ts` now calls `rankInputs(db)` directly and flips pulls, user standing and the front-page weights. One checklist item came out the other way: closing a pull without merging does not change the hash. `bun test test/rank-inputs.test.ts test/explore-speed.test.ts` passes (13 tests). I did not get a type check: `bun x tsc --noEmit` stopped with "Cannot find type definition file…
shipped production is serving it deploy f9c1fcc
test/rank-inputs.test.ts now calls rankInputs(db) directly and flips pulls, user standing and the front-page weights. One checklist item came out the other way: closing a pull without merging does not change the hash. bun test test/rank-inputs.test.ts test/explore-speed.test.ts passes (13 tests). I did not get a type check: bun x tsc --noEmit stopped with "Cannot find type definition file for 'bun'". I did not run bun install first, so the forge's check is the first type check.
- Pulls: opening a pull and then merging it each change the hash.
- Closing a pull: the hash only reads the pull table (count, newest row, merged count and last merge time), and closing an unmerged pull touches only the issue row. The explorer ranks by merged pulls, so the hash is right to stay equal. I wrote the test to assert it stays equal instead of changing the hash to make it move. Say so if you want closing to count.
- User standing: suspending the owner of a ranked repository changes the hash, and restoring them brings it back.
- Weights: changing one front-page weight changes the hash, and setting it back restores the first hash.
- Unread writes: creating sessions leaves the hash equal. I did not test a heartbeat: the
run.heartbeat_atcolumn I found would need a whole run row set up, so I left it out. - Doc comment: the last sentence in
src/core/rank_inputs.tsnow saystest/rank-inputs.test.tsflips these.
Test-and-comment-only change. It matches the hash in src/core/rank_inputs.ts: the pull term (count, max rowid, merged count, max merged_at), the user term (suspended_at) and the front_setting term. Each flip test would fail if its term left the hash. The two negative tests, closing without merging and writing a session, pin down what the hash deliberately ignores. The doc-comment edit is accurate. Nothing touches a door, so there is no security, tty or README impact. No dependency added. Two things to do next: (1) add a restored-hash assertion for the pull case, as the suspend and weights tests have, by deleting the inserted pull rows; (2) add a heartbeat or meter flip test, since the meter term is cached for 60s and that cache is the riskiest untested part of the hash.
test/rank-inputs.test.tsnow callsrankInputs(db)directly and flips pulls, user standing and the front-page weights. One checklist item came out the other way: closing a pull without merging does not change the hash.bun test test/rank-inputs.test.ts test/explore-speed.test.tspasses (13 tests). I did not get a type check:bun x tsc --noEmitstopped with "Cannot find type definition file for 'bun'". I did not runbun installfirst, so the forge's check is the first type check.run.heartbeat_atcolumn I found would need a whole run row set up, so I left it out.src/core/rank_inputs.tsnow saystest/rank-inputs.test.tsflips these.Closes #6698