Skip to content

fix(pack-test): a deadline on every wait, and each pack in a process it can stop - #110

Merged
lucasbraum merged 1 commit into
mainfrom
claude/magical-davinci-vozmm0
Oct 13, 2026
Merged

lucasbraum merged 1 commit into
mainfrom
claude/magical-davinci-vozmm0

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

UPT-19

What and why

The first Packs run on #107 (job 115419620128) spent 40+ minutes in uptide pack test and ignored cancel and force-cancel. Its log was never uploaded (404). A rerun of the same commit passed in 10.5 minutes.

I reproduced pack test locally at #107's head (3a63539) and no pack hangs:

pack alone peak RSS
ai 210 s, pass 5.2 GB
react (excalidraw, tldraw) 518 s, pass (incl. a 3 min tldraw install) ~4 GB
stripe 230 s, pass 4.9 GB
vitest 385 s, pass 3 GB
zod 173 s, pass 4.5 GB

I also ran every pack in one process, as CI does: 1,135 s, all pass. Memory levels off at 5.7 GB rather than growing across packs.

The companion fetching added in #107 is bounded: each dependency is decided once and the compile loop is capped at 5 rounds. Nothing in the analysis loops.

What could wait without end was the network:

  • Registry requests had no deadline of ours. Node's fetch falls back to undici's 300 s header and 300 s body timeouts, and we retry 4 times, so one stalled connection could block for about 20 minutes. Two in a row exceed the 40 minutes observed.
  • The shallow git fetch of a ground-truth repository ran through a synchronous execFileSync with no timeout, and that also blocks the event loop.

A runner whose network degraded would also miss the cancel and fail to upload its log, which matches the 404. That last point is an inference: the log that would prove it does not exist.

What changed

  • Registry (fetch/registry.ts): every request attempt gets its own deadline, REQUEST_TIMEOUT_MS (120 s), and it also covers reading the body. A stall fails with the new REGISTRY_TIMEOUT, which is handled like REGISTRY_UNREACHABLE: an expired cache entry still answers, list marks the package blocked, and the CLI groups it with registry failures.
  • Child processes:
    • The ground-truth fetch runs through command(), which kills the whole process group at its deadline (10 min, fetchTimeoutMs). That includes git-remote-https, which could otherwise hold the pipe open.
    • git() gets a 5-minute timeout for local work.
    • The other sync git calls (version.ts, verify.ts) get 30 to 60 s.
    • Installs, the runtime and behavior probes, and the memory probe already had timeouts.
  • GitHub requests (token exchange, open PRs, bot lookup, results) already had 30 s deadlines; unchanged.
  • Per-pack timeout: uptide pack test runs each pack in a child process, in its own process group. Past --pack-timeout <minutes> (default 20) the group is killed with SIGKILL. The pack then fails by name with the last line it logged, through the new unfinishedPack, so pack-test-report.ts renders it like any failure. The other packs still run. A SIGINT or SIGTERM to the parent kills the child's group first, then the parent exits on the same signal. The parent only waits, so the deadline fires even when the child is stuck in a synchronous compile or GC thrash.

docs/packs.md describes the deadlines and the option, and a changeset is included.

How it was verified

  • New tests:
    • pack-isolate.test.ts:
      • a child's stdout and log come through;
      • a child stuck in a busy loop that never yields, and that started a grandchild, is stopped at the deadline, and the grandchild is gone too;
      • a child that dies without a report is described by its exit code and last line.
    • npm-fetcher.test.ts: a registry that never answers and one whose body stalls halfway both end with REGISTRY_TIMEOUT instead of hanging.
  • Real CLI:
    • pnpm uptide pack test ai --pack-timeout 0.5 stopped at 32 s and printed pack test ai: timed out after 30s and was stopped; last: checking ai 6.0.116 → 7.0.9 in vercel/chatbot@77d362e596e2. Exit was 1 and no process was left behind.
    • pnpm uptide pack test zod through the child-process path: verified, passed, 110 s, rendered by scripts/pack-test-report.ts.
  • Gate: pnpm lint && pnpm typecheck && pnpm test pass on top of main: core 1395 passed (32 skipped), CLI 437. Lint has one warning, which is already on main. scripts/public-tree.mjs and scripts/check-links.mjs are clean.

Also seen in the passing rerun's log, and not fixed here: the job summary was 2,163 KB, over GitHub's 1,024 KB limit, so it was dropped ($GITHUB_STEP_SUMMARY upload aborted). It predates this change and belongs in its own PR.

Checklist

  • Tests for the change (a bug fix starts with a failing test)
  • pnpm lint && pnpm typecheck && pnpm test pass
  • README and docs updated if behavior changed (docs/packs.md)
  • Changeset added if a user would notice (pnpm changeset)
  • No new dependency, or it was agreed in an issue
  • No private code, names or paths in fixtures, tests or docs
  • The rules in CONTRIBUTING.md ("Rules that do not bend") still hold

🤖 Generated with Claude Code

https://claude.ai/code/session_01RniwUAvitpghJF4MuodRZz


Generated by Claude Code

…it can stop

The Packs job on #107 ran 40+ minutes and ignored cancel; a rerun of the
same commit passed in 10.5. Every pack passes locally at that commit, alone
and all in one process as CI runs them (19 min, 5.7 GB peak), so nothing
in the analysis loops. What could wait without end was the network:
registry requests carried no deadline of ours (undici's 300 s header and
body timeouts, times four attempts), and the shallow fetch of a ground-truth
repository ran through a synchronous git with no timeout.

- Registry requests: a deadline per attempt that covers the body
  (REQUEST_TIMEOUT_MS, 120 s). A stall fails with REGISTRY_TIMEOUT, which
  falls back to an expired cache entry like REGISTRY_UNREACHABLE.
- Child processes: local git commands time out (5 min), the ground-truth
  fetch runs through `command()` so its whole process group is killed at
  its deadline (10 min), and the remaining sync git calls have one too.
- `uptide pack test` runs each pack in a child process. Past
  --pack-timeout (default 20 min) the child's process group is killed
  and the pack fails by name with the last line it logged; the other
  packs still run. A cancelled job takes the child down with it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RniwUAvitpghJF4MuodRZz
Signed-off-by: Claude <[email protected]>
@lucasbraum
lucasbraum merged commit bb4c4d3 into main Oct 13, 2026
10 checks passed
@lucasbraum
lucasbraum deleted the claude/magical-davinci-vozmm0 branch October 13, 2026 19:08
@uptide-release uptide-release Bot mentioned this pull request Oct 13, 2026
lucasbraum pushed a commit that referenced this pull request Oct 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#109](#109)
[`7cf3bb8`](7cf3bb8)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Uptide no longer
opens a pull request for an upgrade it could not analyze. A major
upgrade
that no verified pack covers is never published: `uptide fix --pr`
refuses it before anything
changes, `uptide pr` refuses a stored run of one, and the Action reports
it as `skipped` with
`analysis: "none"` and the reason `no pack yet` instead of migrating it.
A minor or patch
without a pack is published only when the repository's own `build`
script and tests pass
after the bump; `fix` now runs the build for runs without a pack and
records it in
`verification.build`. Every PR description has a **Verified by** row
naming what vouched for
it (the pack, the type-check, the build, the tests) and what did not
run.

### Patch Changes

- [#110](#110)
[`bb4c4d3`](bb4c4d3)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Nothing Uptide
waits on can hang a run any more. Every registry request has a deadline
that
covers its body, and a stalled one fails with `REGISTRY_TIMEOUT`
(answered from the cache
when an expired entry exists). Local git commands have one too, and so
does the shallow fetch
of a ground-truth repository. `uptide pack test` runs each pack in a
process of its own: one
that runs longer than `--pack-timeout` (minutes, default 20) is stopped
with everything it
  started and fails with the pack's name, and the other packs still run.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
lucasbraum added a commit that referenced this pull request Oct 14, 2026
Release-group members now move with the lead even when they have no
dependency/peer edge or their installed range already accepts the
target. This fixes the exif-photo-blog and wortkarte shapes where Next
companions remained on 15.x.

Adds the source-backed `releaseGroup` pack contract and uses one planner
in check, peer/range preflight, fix, and pack verification. List reports
declared members through `movesWith`. The lead's exact version wins; if
unpublished for a member, the newest stable release with a published
dependency/peer range accepting the lead is selected. A missing
compatible release blocks the plan. Ordinary companions retain their
existing behavior.

Regression tests cover exif-photo-blog @3f1a363 (three members),
wortkarte @e3bd367, compatible installed peers, missing edges,
compatible fallback, missing compatible releases, unused-member
compilation, fix installation, inventory-independent list grouping, and
contract validation. The four planner regressions failed before the
implementation. Core suite: 1,418 passed / 32 skipped; additional
focused integration and contract tests passed. Core typecheck,
changed-file Biome, and diff checks passed.

## Full pack gate

Ran `pnpm uptide pack test` with per-pack process isolation from #110,
exit 0. All five verified packs retain exactly their recorded breaking
metrics. No ground-truth expectations or verification records changed.

| Pack | Status | Public repos | Breaking TP / FP / FN | Precision |
Recall | Recorded recall | Overall TP / FP / FN |
| --- | --- | ---: | --- | ---: | ---: | ---: | --- |
| ai | verified | 2 | 9 / 0 / 2 | 100% | 81.82% | 81.82% | 54 / 0 / 7 |
| react | verified | 2 | 89 / 0 / 40 | 100% | 68.99% | 68.99% | 92 / 6 /
40 |
| stripe | verified | 2 | 18 / 0 / 2 | 100% | 90% | 90% | 18 / 0 / 2 |
| vitest | verified | 2 | 16 / 0 / 16 | 100% | 50% | 50% | 16 / 18,938 /
16 |
| zod | verified | 3 | 59 / 0 / 21 | 100% | 73.75% | 73.75% | 120 / 0 /
21 |

The overall score includes non-breaking findings: React has six false
positives and Vitest has 18,938 `unverified` false positives. These do
not count toward the recorded breaking gate. A separate clean-main run
(`d0dea2a`) reproduced exactly the same Vitest overall counts (16 TP /
18,938 FP / 16 FN) and breaking counts (16 / 0 / 16). This overall noise
predates the PR; no expectations have been adjusted.

Next's candidate is still on #114, not main. Its release-group
declaration will use eslint-config-next, @next/eslint-plugin-next,
@next/bundle-analyzer, @next/mdx, and @next/third-parties when the
requested post-merge follow-up is applied. This PR does not activate the
candidate or change its expectations.

UPT-6

Signed-off-by: Lucas Braum <[email protected]>
lucasbraum added a commit that referenced this pull request Oct 14, 2026
Packs can declare `requiresBuild: true` when compiler checks cannot
establish that the upgraded repository builds. Fix runs the existing
repository build runner after migration, using the same
credential-filtered environment as tests. Missing, failed, timed-out, or
unrun required builds block publication with a reason. The PR's
**Verified by** row displays the build result, and reverification reruns
the required build rather than reusing a stale pass. Other packs retain
their existing behavior.

Regression tests cover successful, failed and missing builds; actual
execution without inherited secrets; failure during reverification; and
unchanged behavior for ordinary packs. The four initial regression cases
failed before implementation. Core suite: 1,417 passed / 32 skipped. Six
focused required-build tests, the existing generic-build tests, core
typecheck, changed-file Biome, and diff checks passed.

## Full pack gate

Ran `pnpm uptide pack test` with per-pack process isolation from #110,
exit 0. All five verified packs retain exactly their recorded breaking
metrics. No ground-truth expectations or verification records changed.

| Pack | Status | Public repos | Breaking TP / FP / FN | Precision |
Recall | Recorded recall | Overall TP / FP / FN |
| --- | --- | ---: | --- | ---: | ---: | ---: | --- |
| ai | verified | 2 | 9 / 0 / 2 | 100% | 81.82% | 81.82% | 54 / 0 / 7 |
| react | verified | 2 | 89 / 0 / 40 | 100% | 68.99% | 68.99% | 92 / 6 /
40 |
| stripe | verified | 2 | 18 / 0 / 2 | 100% | 90% | 90% | 18 / 0 / 2 |
| vitest | verified | 2 | 16 / 0 / 16 | 100% | 50% | 50% | 16 / 18,938 /
16 |
| zod | verified | 3 | 59 / 0 / 21 | 100% | 73.75% | 73.75% | 120 / 0 /
21 |

The overall score includes non-breaking findings: React has six false
positives and Vitest has 18,938 `unverified` false positives. These do
not count toward the recorded breaking gate. A separate clean-main run
(`d0dea2a`) reproduced exactly the same Vitest overall counts (16 TP /
18,938 FP / 16 FN) and breaking counts (16 / 0 / 16). This overall noise
predates the PR; no expectations have been adjusted.

Next's candidate remains on #114, not main. Set `requiresBuild` there in
the requested follow-up after the first two engine PRs merge, then rerun
its unchanged ground truth. No pack expectations or verification records
are edited here.

UPT-6

Signed-off-by: Lucas Braum <[email protected]>
lucasbraum added a commit that referenced this pull request Oct 14, 2026
Packs can declare a scoped file inventory independent of imported
usages, so runtime rules can inspect configuration, scripts and file
conventions even when the dependency has no imported call sites. Rules
can return writes, creates, deletes and renames together. The engine
prevalidates all paths, applies the edits as one verified transaction,
and restores all affected files when compilation or related tests reject
it. Renames retain the old path as the finding anchor, and formatting
handles the resulting paths.

Regression tests cover inventory-only check results, brace/glob scopes,
all four edit operations, executable-mode preservation, rollback after
rejected verification or exceptions, invalid paths, and a real fix
rename that preserves its old anchor. The initial inventory and
multi-file regression tests failed before implementation. Core suite:
1,419 passed / 32 skipped, then the additional executable-mode
regression passed with the six transaction tests. Core typecheck, Biome
and diff checks passed.

## Full pack gate

Ran `pnpm uptide pack test` with per-pack process isolation from #110,
exit 0. All five verified packs retain exactly their recorded breaking
metrics. No ground-truth expectations or verification records changed.

| Pack | Status | Public repos | Breaking TP / FP / FN | Precision |
Recall | Recorded recall | Overall TP / FP / FN |
| --- | --- | ---: | --- | ---: | ---: | ---: | --- |
| ai | verified | 2 | 9 / 0 / 2 | 100% | 81.82% | 81.82% | 54 / 0 / 7 |
| react | verified | 2 | 89 / 0 / 40 | 100% | 68.99% | 68.99% | 92 / 6 /
40 |
| stripe | verified | 2 | 18 / 0 / 2 | 100% | 90% | 90% | 18 / 0 / 2 |
| vitest | verified | 2 | 16 / 0 / 16 | 100% | 50% | 50% | 16 / 18,938 /
16 |
| zod | verified | 3 | 59 / 0 / 21 | 100% | 73.75% | 73.75% | 120 / 0 /
21 |

The overall score includes non-breaking findings: React has six false
positives and Vitest has 18,938 `unverified` false positives. These do
not count toward the recorded breaking gate. A separate clean-main run
(`d0dea2a`) reproduced exactly the same Vitest overall counts (16 TP /
18,938 FP / 16 FN) and breaking counts (16 / 0 / 16). This overall noise
predates the PR; no expectations have been adjusted.

Next's middleware/proxy and removed eslint configuration rules remain a
follow-up commit on #114 after this engine PR merges. No Next
expectations are changed here.

UPT-6

Signed-off-by: Lucas Braum <[email protected]>
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.

2 participants