Skip to content

fix(check): drop an inherited HERDR_CONFIG_PATH from isolated runs - #1872

Merged
devswha merged 1 commit into
mainfrom
fix/check-isolate-herdr-config
Oct 24, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/check-isolate-herdr-config

Conversation

@devswha

@devswha devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Change

isolate() in scripts/check.ts dropped only the variables that point at the live herdr (its socket and pane). An inherited HERDR_CONFIG_PATH still reached every bun run check command. So the run's herdr, and any server a check script started without its own herdrConfigPath, read the developer's real herdr config. #1810's review hit this: with copy_on_select = false in 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_PATH is now dropped with the live-herdr variables, so an isolated run finds herdr's config only under its own XDG_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 passes HERDR_CONFIG_PATH in the base env. It fails on the old check.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.json is clean.
  • Run through the real surface: HERDR_CONFIG_PATH=~/.config/herdr/config.toml bun run check run sh -c 'echo ${HERDR_CONFIG_PATH-unset}' prints unset, with XDG_CONFIG_HOME in 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 with check: ended processes left running in step process group. That failure is pre-existing: the same check fast on 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.
  • Code review (omo-native-code-reviewer): APPROVE, no blockers. Of its two LOW notes, the stale comment beside the env copy is updated. Keeping the LIVE_HERDR name is deliberate: its doc comment now names both kinds.

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.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 427f5d3 and 82aef76.

Files selected for processing: 2
  • scripts/check.test.ts
  • scripts/check.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 24, 2026

Copy link
Copy Markdown
Owner Author

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.

Lane Verdict
Code review (omo-native-code-reviewer, programming + remove-ai-slops) PASS (CLEAR)
Merge pass's own check 60 check and disposable-config tests pass; typecheck passes; LIVE_HERDR is only the filter in isolate(); git merge-tree is clean with #1864, which shares scripts/check.test.ts

What was checked

  • Callers: all three isolate() callers pass the user's process.env (check.ts:1076, check.ts:1148, ui-contexts-regression.ts:11). Nothing sets HERDR_CONFIG_PATH on purpose through that base env.
  • Disposable config: scripts/disposable-config.ts uses XDG_CONFIG_HOME. With the variable dropped, an isolated run reads herdr's config only from its own scratch directory.
  • Test: it fails at check.test.ts:162 without the fix.

Follow-up (LOW): the comment at scripts/ui-contexts-checks.ts:82 still mentions an inherited HERDR_CONFIG_PATH.

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.

@devswha
devswha merged commit b3458d0 into main Oct 24, 2026
9 checks passed
@devswha
devswha deleted the fix/check-isolate-herdr-config branch October 24, 2026 19:01
devswha added a commit that referenced this pull request Oct 24, 2026
## 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>
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