Repository navigation
ci: verify browser sign-in and CLI login with Clerk - #159
Conversation
Astra reviewReviewed StandardsNo merge-blocking method or YAGNI findings. The test-only harness supports the requested checkout server, isolated seed, packed CLI and resource teardown. I would not require an abstraction or idiomatic rewrite before merging. SpecNo merge-blocking intent findings. Both workflows cover the requested portal handshake, expired-token reload, cross-company refusal, browser-confirmed CLI login and browser revocation. Testing Tokens, serial sign-ins, run-scoped cleanup, CI wiring and headed local-run instructions are present. Surfaces checked: test runner/dev-loop documentation and CI; no production wire contract, CLI behavior, migrations or rendered-page behavior changed. Evidence
Summary: Standards 0 blockers; Spec 0 blockers. No worst issue on either axis. |
Code review — PR 159 vs issue 144Pinned against This review is two separate axes (Standards vs Spec) plus the extra questions asked of it: issue 144's intent, the implementation method, and whether the code is the smallest model that makes the behavior unsurprising. SpecSpec-axis review, PR 159 vs issue 144. (a) Missing / partialNone of the specified workflows are absent. Wiring matches the ticket: two Playwright files, serial one-worker run, checkout server with The signed-out 401, handshake, and first shell render live only in (b) Scope creepSpec: “be refused the seeded company's patch with the 404 a missing id gets.” After that 404, login-door also requires Spec: “open the (c) Looks implemented, looks wrongSpec: “a reload after the token expires is not a sign-in.” The test decodes Spec: “revoke on No other specified login-door / patchy-login / sweep / CI-app isolation behavior looks unimplemented. StandardsNo documented-standard violations. Effect ( ESLint: Surfaces: Judgement-call smells (not defects; repo harness shape wins): Duplicated Code — Duplicated Code — publishable-key Frontend API decode: // packages/auth/live/fixtures.ts
if (publishableKey.startsWith("pk_test_")) frontendApi = atob(publishableKey.slice(8));
// test/browser/fixtures.ts
const frontendHost = Buffer.from(
process.env.CLERK_PUBLISHABLE_KEY!.replace(/^pk_test_/, ""),
"base64"
)
.toString()
.replace(/\$$/, "");Could live on Intent (issue 144)Issue 144's problem: live Clerk only had Backend-API vitest. CI needed to make the Account Portal handshake and packed The PR solves that problem, not a different one. Faithful. Two serial specs, isolated checkout server + packed CLI, seed bound to a Backend-API Looks like drift; implements the ticket. Worker-shared sign-in is the “few and serial” budget and Extra adjacent, not a different product. CI publishable-key fingerprint ( Under-aim. None material. Intent matched. MethodThe method matches issue 144 and the #119 facts. It is the smallest path that actually proves both workflows; most of the weight is Clerk/CI constraints, not taste.
Caveats, not a rewrite.
Method is sound with caveats. The one method change worth making: always bind a held ephemeral port (packed-cli-e2e’s reservation-until-listen) and stop inheriting the job’s YAGNIYAGNI mixed. Worst extra: Windows process-group / pnpm / env in Reusing the 3550-line packed-cli-e2e script is not simpler. It is a top-level-await program (fake Clerk, probe modes, not a library). Extracting a shared harness would drag that monster into Playwright and live keys. A 416-line subset that packs the CLI, boots postgres/server, seeds a Clerk user, and tears down a process group is the spec. Justified copy. Do not extract a third supervisor. Fat inside
Necessary: worker-scoped Borderline: four The extra confirm-page and Summary
Axes kept separate on purpose: the code can follow every convention and still encode Clerk’s current JWT lifetime as a pass/fail, which is a spec-axis problem, not a style one. |
Review dispositionsAddressed the concrete gaps from both reviews in 2602396. No product behavior or branch-protection changes. Fixed
Kept as is, with reasons
Verification
Latest-head CI / merge readinessCI run 33970043136 completed successfully for 2602396. All seven reported checks passed: The live-tier log shows both Vitest tests and both browser specs passing; the runner and separate GitHub reports no required checks configured for this stacked target; none were added or bypassed. All available checks are green, mergeability is |
f8839ef to
c89c326
Compare
2602396 to
7c075c1
Compare
## What changed The auth build is complete, but its docs still mix the old publishing model, shipped auth behavior and future plans. This pass reconciles the map, glossaries, product, ADRs and setup recipes so a fresh agent can sign in, log in the CLI, publish and open a page without reading an issue. **Rebased onto `main` after the auth stack merged.** This PR contains the final documentation pass over PRs #147–#159, preserving the newer invitation-expiry and current-public-version rules throughout the docs and skills. Closes #145. ## Surface audit | Surface | What this pass found | | --- | --- | | Wire contract | Corrected deletion cleanup timing in endpoint prose and regenerated `docs/API.md`; wire shapes unchanged. | | CLI | Aligned login completion, credential precedence, sharing and browser-only company reads across README, skill and onboarding; refreshed the skill hash. | | Dev loop | Reconciled Clerk keys, seed binding, isolated CLI state, lifecycle and both live test tiers. | | Vocabulary and product | Unified the five glossaries, corrected context relationships, separated shipped behavior from future plans and audited ADRs 0002–0008; none is superseded. | | Migrations | Verified the three baselines at server, dev-runner and Vitest composition sites; documentation clarified, migrations unchanged. | | Served pages | Corrected the example's publishing/access copy; no product UI or HTML-policy changes. | | Reverse states | Covered denial, logout, revocation, reactivation and sharing reversal. | | Repository layout | Updated package responsibilities, agent guidance and authoritative versus generated skill paths. | Removed obsolete route assertions while retaining general API-guard coverage. The retired-concept sweep leaves only legitimate lexical matches: dependency/origin pinning, sharing/cookie scopes and Effect's `Command.unlisted`. ## How it was verified - [x] `pnpm lint`, `pnpm typecheck`, `pnpm test` — 322 tests across 38 files. - [x] `pnpm test:packed-cli-e2e` — complete packed CLI real-server contract. - [x] `pnpm test:clerk` — two Backend-API tests and two Playwright workflows; cleanup confirmed zero test users remain. - [x] Local dev startup, publishing, both sharing transitions at both URL shapes, login handoff/pending/logout and rendered-example inspection. - [x] Skill hash and generated-bundle parity; relative Markdown file links; 62 unique glossary headings with no duplicates. - Standards review: two vocabulary findings fixed. Spec review: state-directory default clarified. No open findings. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — documentation, endpoint-description and obsolete-test cleanup only; runtime behavior and wire shapes unchanged. Model: OpenAI GPT-6 Astra. Harness: Oh My Pi. Integration verification: local formatting, lint, typecheck and all 322 offline tests pass. Reconciled both rounds of rebase conflicts, refreshed the public skill hash, corrected ADR-0007’s stale no-expiry claim, and documented the invitation-expiry migration. Final-head CI, including live Clerk/browser and packed CLI checks, is the merge gate. Integration: GPT-6 in the Codex harness.
The live Clerk tier did not exercise the Account Portal login door or a browser-confirmed
patchy loginend to end.Add serial Playwright specs for both workflows against an isolated, seeded server and the packed CLI. Cover session renewal, cross-company refusal, machine revocation and run-scoped Clerk cleanup. Run them through
pnpm test:clerkand the gatedclerk-livejob, with local headed-run instructions.Stacked on #158 (
auth/143-live-clerk-vitest-tier); this PR targets that branch, notmain.Closes #144.
Validation: combined live tier passed locally (2 Vitest tests and both browser specs), final device-login spec passed after review, and cleanup verified zero run-scoped users. All 322 offline tests, typechecking, lint and formatting passed. Standards and spec reviews completed; the 401 assertion finding was fixed. CI results for this PR are pending.
Implemented with OpenAI GPT-6 Astra in the Oh My Pi harness.