You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ports the M2M-side round-1 review fixes (commit 88d7d21 on
sea-auth-m2m) onto the U2M worktree so the two branches stay aligned
in review quality. The U2M-specific work in 5eba37f is unchanged;
this commit is pure cleanup applied across all three SEA-auth test
files (PAT / M2M / U2M).
- Extracted `makeFakeBinding()` to
`tests/unit/sea/_helpers/fakeBinding.ts` and refactored all three
auth-*.test.ts files to import it. The U2M-worktree commit had
THREE copies of the closure (the third was the cause for the
bloat reviewer's "rule of three" call-out that the M2M-worktree
fixup was meant to forestall).
- Dropped the unused `SeaAuthMode` type alias from `SeaAuth.ts` —
zero callers; inlined literals already power the discriminated
union.
- Tightened `SeaNativeBinding.openSession` parameter type to consume
the discriminated `SeaNativeConnectionOptions` union from
`SeaAuth.ts`, restoring compile-time per-mode field enforcement
at the FFI seam.
- Augmented the Rust `AuthMode` doc-comment with the napi-emission
explanation (PascalCase verbatim, not kebab-case) plus the
cross-reference reminder to extend `open_session()`'s match on
every new variant.
- Added the const-enum hazard note to `SeaNativeConnectionOptions`'
doc-comment, locking in the duplicated-literal pattern as
deliberate (importing the napi `const enum AuthMode` breaks
`isolatedModules`).
- Cleaned up the conditional-type-cast lobotomy in `auth-pat.test.ts`
on the token-provider fixture; plain `as any` + eslint-disable.
Skipped findings (same justification as M2M-worktree commit):
F-3 borderline error-class taxonomy, F-4 cosmetic arg-order,
F-5 redundant comment-anchor (compiler already enforces), F-8 null
vs undefined paranoia, F-9 mocha named-function style.
Tests:
- Unit: 55/55 pass (same count as 5eba37f — pure restructure).
- Native build: clean (1m04s release profile).
- Type-check: clean (tsc --noEmit).
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
0 commit comments