Skip to content

style: satisfy prettier across the repo - #113

Merged
hishboy merged 2 commits into
mainfrom
chore/prettier-repo-clean
Aug 26, 2026
Merged

hishboy merged 2 commits into
mainfrom
chore/prettier-repo-clean

Conversation

@hishboy

@hishboy hishboy commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

What

prettier --write over the 11 files the CI verify job's Format check step reports. Formatting only — no logic changes.

Why this is a separate PR, not a push to #112

The task was to fix this on chore/drop-root-skills-link-layer (PR #112). #112 was merged to main by @hishboy at 2026-08-26T13:22:54Z (squash → 5d737b3) while this work was being picked up, and the branch and its worktree are gone. So the same fix lands here, off current main, instead.

Scope

main has failed CI on its last 5 commits, not just #112. Of the 11 files, only AGENTS.md was ever in #112's diff — the other 10 were already failing on main beforehand:

scalping-playbook.md                        tests/services/SigningCause.test.ts
skills/trade-execution/SKILL.md             tests/services/SizingLockService.test.ts
skills/trailing-stop/SKILL.md               tests/services/TrailingStopService.test.ts
tests/helpers/AsyncControl.test.ts          tests/utils/RoundTripPairs.test.ts
tests/services/EntryGateService.test.ts     tests/services/HyperliquidService.test.ts

Per hish's ruling — nothing red merges, and main does not rot — all 11 are fixed here.

Proof it is formatting only

Every changed file was compared old-vs-new with all whitespace stripped and quotes normalised. Six files are byte-identical under that normalisation. The five that are not:

  • 3 markdown files — list-marker, table-padding, and hard-break reflow (adds/removes real characters by design).

  • HyperliquidService.test.ts (2 tokens), TrailingStopService.test.ts (8 tokens) — the only code-token change in the entire diff is ; separators inside inline TypeScript type literals turning into newlines when prettier reflows them onto multiple lines, e.g.

    // before
    closeCalls: Array<{ coin: string; amount: string; side: string; reduceOnly: boolean; dex: string | null }>
    // after
    closeCalls: Array<{
      coin: string
      amount: string
      ...
    }>

    ; and newline are interchangeable member separators in a TS type literal. No runtime or type-semantics effect. Driven by the repo's own semi: false in prettier.config.mjs.

No statement-terminating semicolon was removed anywhere — grep -nE ';\s*$' finds zero such lines in either file at the base commit.

Verification

bun run format:check — the exact CI command — is clean:

Checking formatting...
All matched files use Prettier code style!    (exit 0)

Non-vacuity controls, because a formatter that silently checks nothing looks identical to a passing one:

  • the glob matches 260 tracked files (git ls-files cross-check agrees);
  • --list-different returns 0 files;
  • a deliberately malformed control file still trips --check and exits 1, proving the instrument reads files rather than passing by default;
  • every one of the 11 was individually confirmed to parse (prettier <file> → exit 0, non-empty output) before any --write, so no blind write ran against an unparseable file.

One quirk worth recording: HyperliquidService.test.ts needed two --write passes to converge. Pass 1 left it still failing --check; pass 2 reached a fixed point, stable on a third check.

Caveat on "green"

Format check is step 3 of 6 in verify (install → format → lint → build → vitest → skills digest). Steps 4-6 have not run on main in 5 commits because format aborted the job first. This PR unblocks the job to reach lint; whether lint, build, vitest, and the skills digest then pass is unknown until CI runs here. Not asserting green beyond what CI reports.

🤖 Generated with Claude Code


Second commit: placeholder PRIVY_APP_ID for the test step

Fixing format exposed a second, latent red on main: Format check is step 3 and aborted the job before tests ever ran, so main has never surfaced it. First run here: Format check ✅ Lint ✅ Build ✅ then 22 failures, all one cause — Error: PRIVY_APP_ID is not set (5 collection-time suite failures + 17 test failures; 6 failed | 36 passed (42)). Zero SyntaxError / Unexpected token / Cannot find anywhere, i.e. not the reformat.

Presence, not identity — established from the source, not by trial. src/common/Env.ts:37:

export const PRIVY_APP_ID =
  process.env.PRIVY_APP_ID ??
  (IS_PRODUCTION ? 'cmiwpjw6y0001l80b2er4lqzu' : ensureString(process.env.PRIVY_APP_ID, '...'))

Any non-undefined process.env.PRIVY_APP_ID short-circuits the ?? and is returned unvalidated — ensureString is only reachable when the variable is unset. Under vitest NODE_ENV is 'test', so IS_PRODUCTION is false and that branch threw at module-import time, which is why the suites died during collection, before any in-test vi.stubEnv could run.

Nothing in the suite contacts Privy: the tests that do exercise it already stub their own fakes ('privy-app-id', 'test-privy-app-id' in Env.test.ts, LoginService.test.ts, WalletService.test.ts) and pass today. So the fix is one plain env: line on the test step — deliberately not a secret, since a real app id would be both unnecessary and a live credential sitting in CI.

CI result — fully green

Run 32974881241, every step, none skipped:

step result
Install dependencies ✅
Format check ✅
Lint ✅
Build the world ✅
Tests (unit + skills contract) ✅ 42 passed (42)
Skills release digest verification ✅

gh pr checks 113 → verify pass. Test files went 6 failed | 36 passed → 42 passed, and the digest step ran for the first time rather than being skipped behind an earlier failure.

hishboy and others added 2 commits August 26, 2026 06:27
Mechanical reformat only — prettier --write over the 11 files the CI
"Format check" step reports. No logic changes: the sole token-level
deltas are semicolon separators inside inline TypeScript type literals
becoming newlines when prettier reflows them (semi: false), plus
markdown reflow and quote normalisation.

Ten of the eleven were already failing on main before PR #112.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Env.ts returns process.env.PRIVY_APP_ID unvalidated whenever it is set, so
presence alone satisfies it. Under vitest NODE_ENV is 'test', so the
non-production branch threw at module-import time and five suites failed
during collection, before any in-test vi.stubEnv could run.

Latent on main, not new: Format check is step 3 and aborted the job before
tests ever ran, so this red has never surfaced. Making format pass exposed it.

Plain env, not a secret — no test contacts Privy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@hishboy
hishboy merged commit 7b9fde5 into main Aug 26, 2026
1 check passed
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