Skip to content

fix(appkit): unify typegen warehouse readiness + sanitize timeout (PR1)#422

Draft
atilafassina wants to merge 1 commit into
mainfrom
typegen-fixes
Draft

fix(appkit): unify typegen warehouse readiness + sanitize timeout (PR1)#422
atilafassina wants to merge 1 commit into
mainfrom
typegen-fixes

Conversation

@atilafassina

Copy link
Copy Markdown
Contributor

PR1 of the stacked typegen-hardening plan — hardens the non-blocking typegen redesign (#406). Readiness correctness only (F1 + F3 + F6).

What & why

  • F1 — single ensureRunning owner. Collapses the two blocking-preflight branches (startWaitProceed / waitThenProceed) into one routine: a STARTING→STOPPED regression now restarts and waits instead of going fatal; only DELETED/DELETING or a genuine wait-timeout are fatal. Fatal/timeout messages are sanitized (raw getErrorDiagnostic text moves to logger.debug, closing a CWE-209 info leak).
  • F3 — cold-start feedback. waitUntilRunning gained a caller-supplied report hook that fires once before the wait, so a cold-start --wait build is no longer silent for up to 5 minutes. The CLI prints one line to stdout; dev/non-CLI callers default to logger.debug (the library stays pure).
  • F6 — docs. docs/docs/development/type-generation.md now states the bounded 5-minute ceiling and the correct failure contract (deleted/deleting or timeout).

Does not touch F2/F4/F5 — those are separate PRs in the stack.

Verification

  • pnpm exec vitest run packages/appkit/src/type-generator packages/shared/src/cli476 passed (+6 new: sanitized-timeout, start-on-regression, reporter-fires-once)
  • pnpm -r typecheck — clean
  • pnpm check (biome) — exit 0 (pre-existing warnings only)
  • pnpm build + pnpm docs:build — green

8 files changed, +443 / −38.

This pull request and its description were written by Isaac.

F1: collapse startWaitProceed/waitThenProceed into one ensureRunning owner. A
STARTING->STOPPED regression now restarts and waits instead of going fatal; only
DELETED/DELETING or a genuine wait-timeout is fatal. Timeout and auth/config
fatals emit a distinct sanitized message; the raw getErrorDiagnostic text moves
to logger.debug (CWE-209).

F3: waitUntilRunning gains a caller-supplied report hook that fires once before
the wait. The CLI --wait path prints one cold-start line; dev/non-CLI callers
default to logger.debug so the library stays pure.

F6: corrected the --wait docs (5-min ceiling; fails on deleted/deleting OR timeout).

Decomposed from prd/typegen-review-fixes (PR1 of the stacked-PR plan).

Co-authored-by: Isaac
Signed-off-by: Atila Fassina <atila@fassina.eu>
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