Repository navigation
refactor(host-kit): move settleWithin to a dependency-free leaf module - #4816
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
|
This PR is ready at 1944ae2. CI is green and the review found no code problems. Live device evidence was not needed, because both migrated waits (xctrace stop and screenshot rotation grace) keep the same settle and rejection behavior and only clear their timer earlier. Not blocking, take or leave:
Not verified here: the eager-closure-budgets test and |
The primitive sat in retry.ts, so a caller that wanted only the deadline race also evaluated the retry policy, the deadline class, the diagnostics edge and the kernel error vocabulary. That is why #4788 reverted the capture-kit grace wait and both perf-xctrace waits: the eager-closure budget went up. settleWithin and its outcome type now live in host-kit/settle-within, which imports nothing. retry.ts re-exports them, so every importer of host-kit/retry keeps working and its closure is unchanged. Both migrated sites import the leaf. The capture-kit grace wait reaches it through the first call, which keeps that facade's closure at one module. The perf waits previously left the 45 s grace timer armed for its whole budget after xctrace had exited; the primitive clears it on every settle path. Behaviour is otherwise the same.
…d race guidance R11's host-kit export-surface enumeration lists the new subpath, and R88's guidance names the leaf as the deadline primitive's home.
…lidator compile wait through it Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Follow-up on the three optional notes at
Local: build, typecheck, eager-closure budgets, layering, fallow, production-exports, check:package, and the host-kit, capture-kit, platform-apple core, daemon and CLI tests pass. |
1944ae2 to
79513fc
Compare
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
packages/host-kit/src/retry.ts:1 |
🆕 PR claims host-kit/retry keeps re-exporting settleWithin; the diff removes the export instead |
Reviewed with this repository's own Sentinel configuration (b52a5cded59b).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 79513fc. The verdict and the full list are in the summary comment.
| @@ -6,8 +6,6 @@ export { | |||
| openScope, | |||
There was a problem hiding this comment.
🆕 🟡 Minor · PR claims host-kit/retry keeps re-exporting settleWithin; the diff removes the export instead
import { settleWithin } from '@agent-device/host-kit/retry' no longer resolves: src/retry.ts drops settleWithin and type SettleWithinOutcome from its re-export list, and internal/retry.ts deletes the definitions with no replacement re-export. The PR description claims the façade keeps its old surface, so any importer outside this branch silently breaks. The package-boundaries export list also keeps ./retry without noting the narrowed surface.
Suggested change
Either re-export settleWithin and SettleWithinOutcome from packages/host-kit/src/retry.ts (from ../settle-within.ts) so the façade keeps its old surface, or update the PR description and migration notes to record that @agent-device/host-kit/retry no longer exports them.
Details
persona: maintainability, javascript, senior-developer
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
There was a problem hiding this comment.
Correct, the body was stale. At 79513fc064 the re-export is deliberately removed (review note 1): every production importer now uses @agent-device/host-kit/settle-within. The PR body is updated to say so.
Summary
settleWithinsat inretry.ts, so a caller wanting only the deadline race also evaluated the retry policy, theDeadlineclass, the diagnostics edge and the kernel error vocabulary. That is why #4788 reverted two migrations: the eager-closure budget went up.settleWithinandSettleWithinOutcomenow live inpackages/host-kit/src/settle-within.ts, which imports nothing, published as@agent-device/host-kit/settle-within. Every production importer uses that subpath;host-kit/retryno longer exports them.Newly migrated sites:
capture-kit/capture-fact-grace.ts, through a function-scopedawait import. A static import fails the eager-closure budget (2 modules against 1 at the merge-base).platform-apple/core/perf-xctrace.tsexit waits. They no longer leave the 45 s grace timer armed after xctrace exits; a fake-timer test proves it and fails when the migration is reverted.waitForValidatorCompileincapture-kit/recording/video.ts, same timeout error as before.provider-limrunhas one such race but does not depend on host-kit, so it is untouched. No budget raised, no allowlist, no baseline regenerated. 23 files changed, 241 insertions(+), 201 deletions(-).Validation
Tested at
79513fc064.Promise.race(total: 34 → 30.pnpm build,check:quick,check:layering,check:fallow,check:package,check:production-exports: pass.eager-closure-budgets.test.tsand the host-kit, capture-kit, platform-apple core, daemon, daemon-client and CLI tests: pass.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.