Skip to content

refactor(types): extract shared portSchema for env validators#23

Merged
david30907d merged 4 commits into
mainfrom
claude/repo-refactor-simplification-Qb2er
May 25, 2026
Merged

refactor(types): extract shared portSchema for env validators#23
david30907d merged 4 commits into
mainfrom
claude/repo-refactor-simplification-Qb2er

Conversation

@taiiiiiiiiiiii
Copy link
Copy Markdown
Contributor

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.

claude added 3 commits May 25, 2026 04:26
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`.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zap-engine-frontend Ready Ready Preview, Comment May 25, 2026 5:02am
zap-engine-landing-page Ready Ready Preview, Comment May 25, 2026 5:02am

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.
@david30907d david30907d merged commit ccfc6b1 into main May 25, 2026
13 checks passed
@david30907d david30907d deleted the claude/repo-refactor-simplification-Qb2er branch May 25, 2026 05:52
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.

3 participants