fix(create-app): ship logger and shutdown in the scaffold, drop @o3co/auth.utils - #22
Merged
Merged
Conversation
…/auth.utils Both generators emitted @o3co/auth.utils and had their templates import createLogger / gracefulShutdown from it. That package treats pino as an optional peer and falls back to console, and the generator never emitted pino — so every generated instance has been logging bare `[name] …` console lines rather than NDJSON. Its gracefulShutdown also had no drain deadline (one stuck request meant SIGTERM never completed and SIGKILL cut the process mid-flight) and always exited zero. Each scaffold now carries src/logger.mts (pino, direct exact-pinned dependency; honours logging.level with LOG_LEVEL fallback; serialises `err`) and src/shutdown.mts (the contract auth.provider #290, auth.proxy #81 and auth.policy-verifier #210 adopted: bounded drain and cleanup, non-zero exit on a truncated drain, deferred exit so the last lines flush, `reason` naming what set the exit code). Both ship with tests that run under the instance's own `pnpm run test`. shutdown declares a structural Logger so the template does not depend on which upstream version the generator pins. The provider template reads logging.level defensively: the HOCON carries it but DplaaxAppConfig does not declare it, which the scaffold typecheck against the pinned module caught. Generator suites 97 / 110 (four new cases: no auth.utils emitted, pino emitted at a literal exact pin). Generated instances against the pinned develop module ref: typecheck clean, 18 / 26 tests. This was auth.utils' last consumer across the auth family. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
y1o1
added a commit
to o3co/auth
that referenced
this pull request
Sep 6, 2026
…tils-free develop Provin's scaffolds stopped emitting @o3co/auth.utils in provin-line/auth#22 (develop 74e22644): the create-provider and create-policy-verifier templates now ship their own logger and shutdown, the same way auth.provider (#290), auth.proxy (#81) and auth.policy-verifier (#210) do. That was the package's last consumer across the family, so the harness no longer needs to pack it, pin its revision, or carry the lockfile snapshot that stood in for the one its repo does not track. The override list is back to the five Provider/Verifier packages. The provin-compatibility job on this PR is the cross-repo check: Provin at the new pin, built and tested against the candidate auth tarballs, with no utils override to fall back on. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both generators emitted
@o3co/auth.utilsinto generatedpackage.json, and both templates importedcreateLogger/gracefulShutdownfrom it. This was the package's last consumer across the auth family — auth.provider left in #290, auth.proxy in #81, auth.policy-verifier in #210.Two defects this fixes in generated instances
They never logged NDJSON.
@o3co/auth.utilstreats pino as an optional peer and falls back toconsolewhen the import fails. The generator never emitted pino, so every instance created by either CLI has been logging bare[name] …console lines that no aggregator parses. The scaffold now shipssrc/logger.mtson pino — a direct, exact-pinned runtime dependency like the rest — honouringlogging.levelfrom the application config withLOG_LEVELas the override, and serialisingerrso an Error keeps its stack.They could hang on SIGTERM and always exited zero.
gracefulShutdowncalledserver.close()with no deadline; one stuck request meant the process never exited on its own and the orchestrator's SIGKILL cut it mid-flight. Cleanup failures went toconsole.error. The scaffold now shipssrc/shutdown.mtswith the contract the three o3co components adopted: drain fordrainTimeoutMs(10s), boundcleanupbycleanupTimeoutMs, force-close past the deadline and exit non-zero, log through the instance logger, yield the loop once before exiting so the last lines flush, and name inreasonwhatever set the exit code (drain outcome kept under its owndrainkey).shutdown.mtsdeclares a small structuralLoggerrather than importing one, so the template does not depend on which upstream version the generator pins.What the scaffold typecheck caught
Run against the pinned module ref, the provider instance failed typecheck: the HOCON template carries
logging.levelbutDplaaxAppConfigdoes not declare it. The template reads it defensively ((config as { logging?: { level?: string } }).logging?.level), same as the verifier template already did for itsAppConfigSchemaat the 0.3.x pin.Verification
does not emit @o3co/auth.utilsandemits pinoper generator. The pino assertion is a literal"10.3.1", notDEFAULT_DEP_VERSIONS.pino: sharing the oracle with the implementation let a missing key pass asundefined === undefinedon the first run.--dplaax-module-ref <origin/develop sha>, then inside each:pnpm install→pnpm run typecheck(exit 0) →pnpm run test(provider 18, policy-verifier 26). Emittedpackage.json: no@o3co/auth.utils,pino: 10.3.1, zero caret specifiers.docs/requirements.md§ 6 and the CHANGELOG (Fixed×2,Changed) are updated.🤖 Generated with Claude Code