refactor(types): extract shared portSchema for env validators#23
Merged
Conversation
account-engine/src/config/env.ts and alpha-etl/src/config/environment.ts both defined an identical z.coerce.number().int().min(1).max(65535) for validating TCP-port env vars. Lifting it to packages/types/src/shared/env.ts gives both services one source of truth and matches the precedent of the existing shared/wallet.ts helper. alpha-etl's parsePort keeps its inline range schema — its string-default→transform chain does not compose cleanly with the coerced shared schema under zod v4 pipe typing.
…tion apps/account-engine/CLAUDE.md (Architecture boundary) forbids any account-engine code outside the plan-orchestration module from importing @zapengine/intent-engine, but container.ts was reaching for createIntentEngine and LiFiAdapter directly to wire the service. The identity plane was leaking into the intent plane at the DI root. A new createPlanOrchestrationModule factory now owns those instantiations and accepts only env-derived primitives (lifi config + public clients). The container calls it with config and never sees intent-engine types, restoring the boundary. createPlanOrchestrationService stays exported from ./service for test ergonomics — unit tests keep injecting mocked IntentEngine/LiFiAdapter through it.
- Delete apps/alpha-etl/scripts/diagnose-debank-portfolio.ts and validate-vip-users.ts; neither is invoked from production code, CI workflows, or any package.json script. validate-vip-users.ts was only self-referenced in its own usage docstring. - Update the alpha-etl source-manifest hygiene test to drop the two scanner-import entries and adjust the count from 45 to 43. - Remove the frontend "start" script, which was byte-identical to "preview" (same `vite preview --host 0.0.0.0 --port 4173`). Frontend deploys via Vercel's own pipeline; nothing in the repo invokes `pnpm --filter @zapengine/frontend start`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
c5c1ad6 added packages/types/src/shared/env.ts but no test, which dropped the package coverage from 100% to 98.79% and tripped the coverage:regression gate. Add parse-level tests for valid ports, string coercion, boundary values (1/65535), out-of-range, non-integer, and uncoercible strings, and extend the test-hygiene manifest entry + count to include the new source file.
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.
account-engine/src/config/env.ts and alpha-etl/src/config/environment.ts
both defined an identical z.coerce.number().int().min(1).max(65535) for
validating TCP-port env vars. Lifting it to packages/types/src/shared/env.ts
gives both services one source of truth and matches the precedent of the
existing shared/wallet.ts helper. alpha-etl's parsePort keeps its inline
range schema — its string-default→transform chain does not compose cleanly
with the coerced shared schema under zod v4 pipe typing.