Repository navigation
fix(check): drop an inherited HERDR_CONFIG_PATH from isolated runs - #1872
Conversation
isolate() kept HERDR_CONFIG_PATH, so the run's herdr and every server a check script started without its own herdrConfigPath read the developer's real herdr config (found in #1810's review). It now goes with the live-herdr variables.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merge pass review-work report. Overall: PASSED. This PR changes test tooling only. Under the maintainer's token rule, it merges on the code review, the merge pass's own check and CI, without the gate reviewer.
What was checked
Follow-up (LOW): the comment at All required checks are green and no review thread is open. CodeRabbit did not review this PR (rate-limited or skipped). The reviews above stand in for it. |
## Change Follow up on #1817's native Web Push review: - Reject `rs < 18` in both aes128gcm decryptors, including an otherwise authenticated empty payload at `rs = 17`. - Add rejection coverage for truncated headers and bodies, a wrong key-ID length, a compressed point marker, a record exceeding `rs`, and authenticated missing/non-final delimiters. Keep the RFC 8291 known-answer test and exercise valid zero padding at the minimum record size. - Recover damaged iOS keychain data only when the app subscribes: delete the damaged item, generate fresh keys, and save them. Invalid private scalars now become the same damaged-store error as wrong-length items. Other keychain errors, including a locked keychain, still propagate without deleting keys. - Mirror recovery on Android for malformed Base64, wrong lengths, partial keys, invalid scalars and mismatched key halves. Replace the three stored fields together and refuse to return keys after a failed save, including cached keys left by a failed SharedPreferences commit. The FCM receiver now only reads; it never generates or rotates keys. - Return no subscription when a saved key store is damaged rather than exposing unusable keys. An `endpointOnly` option lets removal read the retained endpoint without loading keys, so turning alerts off still deletes the PC subscription. A failed PC deletion retains the endpoint. The relay endpoints stay intact. `src/lib/push.ts` already calls native `subscribe` and posts its returned keys to the open PC on every load; `server/push.ts` replaces the record for that endpoint, preserving alert preferences. No PC HTTP/WS contract change is needed. The user opens each PC in the app to refresh its subscription after recovery, without reinstalling. Until a PC has been opened, pushes encrypted with its old keys may show only the fallback notification text. A changelog fragment records that behavior. ## Validation - Copied the unpushed Swift package to the test MacBook Air (`ssh eamac`) and ran `swift test`: **20 tests, 0 failures** (13 decryption/key-generation tests and 7 key-store tests). - Swift guard mutations in disposable copies: all six mutants built and failed their tests. Removing the length guard failed the short-body assertion and trapped on the truncated header; removing key-ID length, point marker, minimum `rs`, record-size bound, or delimiter checks failed the corresponding rejection tests. - Eamac cleanup receipt: `CLEANUP removed /tmp/ovis-pushcore.fKkobw`. - Android: `:ovis-push:testDebugUnitTest` passed with the local JDK 21 and Android SDK: **22 tests, 0 failures** (13 decryptor/key-generation tests and 9 recovery-store tests). - Android mutation baseline passed all 13 decryptor tests. Removing each of the same six guards in isolated Java source copies made the corresponding tests fail; no mutant survived. - The first Codex review (`gpt-6.1-sol`, fast tier, xhigh reasoning) found two P2 bugs: damaged-key alert removal skipped the PC deletion, and Android returned cached unpersisted keys after a failed save. Both were reproduced before fixes. Two client removal tests and the Android failed-save test failed before the fixes; all pass afterwards. The native plugins now support endpoint-only reads for removal, and failed saves clear the cached key fields before throwing. The SharedPreferences stand-in now models memory updates on failed commits. - After the review fixes, `bun test src/lib/push-removal.test.ts src/lib/push.test.ts` passed: **28 tests, 0 failures**. Android's full 22-test module suite passed again. The Swift package source is unchanged from the eamac test and mutation runs. - Final Codex review of commit `b5c8634dcd86e2ac304d9530afb8a775ea24dadd`, with the requested model/settings and `Review origin/main...HEAD for crypto and key-recovery bugs`: **"No actionable crypto or key-recovery bugs found in `origin/main...HEAD`."** The reviewer independently passed 28 client and 22 Java tests; its iOS review was static. - Final `UNIT_TEST_WORKERS=2 dori heavy merge-followups -- bun run check fast` on that same head exited **1**, with **unchanged source**. Workflow syntax, generated types/themes, typecheck and build passed. The unit lane printed no failing assertions, then ended with `check: ended processes left running in step process group 1762541`; the report records `unit tests terminated by SIGKILL` and does **not** claim successful verification. This is being handed off under the maintainer's explicit allowance for the pre-existing origin/main process-group failure (#1864), as in #1872; it is **not a clean fast-check pass**. Report: `node_modules/.cache/check/b956557d-d78a-40db-aba5-4e0f95568288/report.json`. Earlier interrupted/invalidated attempts are retained locally but are not claimed as final verification. An earlier complete pass preceded the two review fixes. - Native language servers are unavailable locally; Swift compilation on eamac and the Android Gradle compilation/test run supplied compiler diagnostics. - Not verified: physical-device APNs/FCM delivery or an installed app's full recovery flow. - Per the maintainer's instruction, the `omo-native-code-reviewer` review is deferred to the maintainer after opening this PR because this session cannot spawn it at the nesting limit. Guard-removal receipts (each mutant compiled; all exited nonzero): | Guard removed | Swift result | Android result | | --- | --- | --- | | Minimum header/body length | Short-body assertion failed; truncated header trapped | 2 tests failed | | Key-ID length | 1 test failed | 1 test failed | | Uncompressed-point marker | 1 test failed | 1 test failed | | `rs >= 18` | 1 test failed | 1 test failed | | Body length bounded by `rs` | 1 test failed | 1 test failed | | Final delimiter | 2 tests failed | 2 tests failed | Local receipts are retained under `/tmp/ovis-push-recovery.MbdzIf/`: `swift-tests.log`, `mutants/*.log`, `java-mutants/*/result.log`, `android-after-fix.log`, and `removal-before.log` / `removal-after.log`. --------- Co-authored-by: mp <mp@local>
Change
isolate()inscripts/check.tsdropped only the variables that point at the live herdr (its socket and pane). An inheritedHERDR_CONFIG_PATHstill reached everybun run checkcommand. So the run's herdr, and any server a check script started without its ownherdrConfigPath, read the developer's real herdr config. #1810's review hit this: withcopy_on_select = falsein the user's config,terminal-copy-regression.ts's "herdr's default copies on release" tested the wrong thing. #1810 patched that one script. This PR closes the gap for every run:HERDR_CONFIG_PATHis now dropped with the live-herdr variables, so an isolated run finds herdr's config only under its ownXDG_CONFIG_HOME.It is one of the merge pass's follow-ups. It changes test tooling only, and users see nothing, so there is no changelog fragment.
Validation
scripts/check.test.ts("refuses to run in the herdr the user works in…") now passesHERDR_CONFIG_PATHin the base env. It fails on the oldcheck.ts(one extra key,HERDR_CONFIG_PATH) and passes with the fix.bun test scripts/check.test.ts scripts/disposable-config.test.ts: 60 pass.tsc -p tsconfig.tools.jsonis clean.HERDR_CONFIG_PATH=~/.config/herdr/config.toml bun run check run sh -c 'echo ${HERDR_CONFIG_PATH-unset}'printsunset, withXDG_CONFIG_HOMEin the run's own directory. The run directory was removed afterwards.bun run check fast: workflow syntax, generated files, typecheck and build are ok. Every unit test file reports 0 fail, but the unit step ends withcheck: ended processes left running in step process group. That failure is pre-existing: the samecheck faston untouched origin/main 427f5d3 fails the same way on this PC. fix(tests): run each unit test file in a process group of its own, and never signal pid 0 #1864 addresses it.LIVE_HERDRname is deliberate: its doc comment now names both kinds.