Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/scripts/pr-hygiene.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ describe("collectDeterministicHygieneFailures", () => {
const failures = collectDeterministicHygieneFailures({
files: [
{ filename: "src/codex/auth-api.ts", patch: "+change" },
{ filename: "tests/codex-auth-api.test.ts", patch: "+test" },
{ filename: "tests/codex-integration/codex-auth-api.test.ts", patch: "+test" },
],
authorHasPushPermission: true,
});
Expand Down
24 changes: 12 additions & 12 deletions docs/superpowers/plans/2026-07-26-oauth-reliability-integrity.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ EOF

**Files:**
- Modify: `src/oauth/index.ts` (`refreshAndPersistAccessToken` generic branch ~352–400)
- Test: `tests/oauth/oauth-refresh-generic-lock.test.ts` (new; mirror patterns from `tests/xai-refresh-lock.test.ts` / `tests/oauth/oauth-refresh.test.ts`)
- Test: `tests/oauth/oauth-refresh-generic-lock.test.ts` (new; mirror patterns from `tests/providers/xai/xai-refresh-lock.test.ts` / `tests/oauth/oauth-refresh.test.ts`)

**Interfaces:**
- Consumes: `createOAuthRefreshIntentLock`, `mergeAccountCredential`, `credentialGeneration`, `markAccountNeedsReauthIfGeneration`, `getAccountCredential`, `logOAuthEvent`
Expand Down Expand Up @@ -308,7 +308,7 @@ Also log `"OAuth refresh joined existing operation"` when `tokenRefreshes.get(ke
Run:

```bash
bun test tests/oauth/oauth-refresh-generic-lock.test.ts tests/oauth/oauth-refresh.test.ts tests/xai-refresh-lock.test.ts
bun test tests/oauth/oauth-refresh-generic-lock.test.ts tests/oauth/oauth-refresh.test.ts tests/providers/xai/xai-refresh-lock.test.ts
```

Expected: PASS (no regressions on xAI/Anthropic)
Expand Down Expand Up @@ -420,7 +420,7 @@ Set `action` strings:

- [ ] **Step 4: Run test to verify it passes**

Run: `bun test tests/oauth/oauth-health.test.ts tests/codex-routing.test.ts`
Run: `bun test tests/oauth/oauth-health.test.ts tests/codex-integration/codex-routing.test.ts`

Expected: PASS

Expand Down Expand Up @@ -502,7 +502,7 @@ EOF

**Files:**
- Modify: `src/cli/doctor.ts`
- Test: `tests/service/doctor-oauth.test.ts` (or extend `tests/doctor.test.ts`)
- Test: `tests/service/doctor-oauth.test.ts` (or extend `tests/codex-integration/doctor.test.ts`)

**Interfaces:**
- Consumes: `collectOAuthHealthEntries`, auth store writability checks, refresh lock path helpers if exported
Expand All @@ -529,7 +529,7 @@ Add `collectOAuthDoctorChecks(): Array<{ level: "OK" | "WARN"; message: string }

- [ ] **Step 4: Run tests**

Run: `bun test tests/service/doctor-oauth.test.ts tests/doctor.test.ts`
Run: `bun test tests/service/doctor-oauth.test.ts tests/codex-integration/doctor.test.ts`

Expected: PASS

Expand Down Expand Up @@ -607,9 +607,9 @@ EOF
### Task 8: Codex metadata integrity regressions + 401 replay invariants

**Files:**
- Test: `tests/codex-metadata-integrity.test.ts` (new)
- Test: `tests/codex-integration/codex-metadata-integrity.test.ts` (new)
- Modify only if a real gap is found: `src/codex/auth-context.ts`, `src/adapters/openai-responses.ts`
- Confirm existing: `tests/server-xai-oauth-401-replay.test.ts`, `tests/server-kiro-oauth-401-replay.test.ts`, `tests/codex-routing.test.ts` (policy A)
- Confirm existing: `tests/server-xai-oauth-401-replay.test.ts`, `tests/server-kiro-oauth-401-replay.test.ts`, `tests/codex-integration/codex-routing.test.ts` (policy A)

**Interfaces:**
- Consumes: `headersForCodexAuthContext`, `FORWARD_HEADERS`
Expand Down Expand Up @@ -644,7 +644,7 @@ test("preserves genuine originator", () => {

- [ ] **Step 2: Run tests**

Run: `bun test tests/codex-metadata-integrity.test.ts`
Run: `bun test tests/codex-integration/codex-metadata-integrity.test.ts`

Expected: FAIL only if implementation gap exists; if PASS immediately, keep tests as regressions and skip code changes.

Expand All @@ -655,15 +655,15 @@ If fabrication or account-id mismatch is found, fix the minimal header path. Do
- [ ] **Step 4: Run related suite**

```bash
bun test tests/codex-metadata-integrity.test.ts tests/codex-auth-context.test.ts tests/codex-routing.test.ts tests/session-affinity.test.ts tests/server-xai-oauth-401-replay.test.ts tests/server-kiro-oauth-401-replay.test.ts
bun test tests/codex-integration/codex-metadata-integrity.test.ts tests/codex-integration/codex-auth-context.test.ts tests/codex-integration/codex-routing.test.ts tests/session-affinity.test.ts tests/server-xai-oauth-401-replay.test.ts tests/server-kiro-oauth-401-replay.test.ts
```

Expected: PASS

- [ ] **Step 5: Commit**

```bash
git add tests/codex-metadata-integrity.test.ts src/codex/auth-context.ts src/adapters/openai-responses.ts
git add tests/codex-integration/codex-metadata-integrity.test.ts src/codex/auth-context.ts src/adapters/openai-responses.ts
git commit -m "$(cat <<'EOF'
test(codex): lock metadata pass-through and non-fabrication

Expand Down Expand Up @@ -713,8 +713,8 @@ EOF
- [ ] **Step 1: Run verification commands**

```bash
bun test tests/lib/privacy-mask-account.test.ts tests/oauth/oauth-log.test.ts tests/oauth/oauth-refresh-generic-lock.test.ts tests/oauth/oauth-health.test.ts tests/cli/cli-status-oauth-health.test.ts tests/service/doctor-oauth.test.ts tests/oauth/oauth-accounts-api.test.ts tests/codex-metadata-integrity.test.ts
bun test tests/oauth/oauth-refresh.test.ts tests/xai-refresh-lock.test.ts tests/codex-routing.test.ts tests/session-affinity.test.ts tests/codex-auth-context.test.ts
bun test tests/lib/privacy-mask-account.test.ts tests/oauth/oauth-log.test.ts tests/oauth/oauth-refresh-generic-lock.test.ts tests/oauth/oauth-health.test.ts tests/cli/cli-status-oauth-health.test.ts tests/service/doctor-oauth.test.ts tests/oauth/oauth-accounts-api.test.ts tests/codex-integration/codex-metadata-integrity.test.ts
bun test tests/oauth/oauth-refresh.test.ts tests/providers/xai/xai-refresh-lock.test.ts tests/codex-integration/codex-routing.test.ts tests/session-affinity.test.ts tests/codex-integration/codex-auth-context.test.ts
bun run test
bun run typecheck
bun run lint:gui
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- `src/server/responses-terminal-repair.ts` — owns SSE lifecycle tracking, bounded retained state, grace scheduling, and synthetic terminal creation.
- `src/server/responses/core.ts` — activates the repair before existing transport-specific relay branches.
- `tests/responses/responses-terminal-repair.test.ts` — unit state-machine and stream-race coverage.
- `tests/deepseek-inbound-wire.test.ts` — end-to-end official DeepSeek wire and HTTP activation.
- `tests/providers/deepseek-inbound-wire.test.ts` — end-to-end official DeepSeek wire and HTTP activation.
- `tests/responses/ws-endpoint.test.ts` — WebSocket event parity for real and repaired terminals.
- `structure/04_transports-and-sidecars.md` — architectural contract for the provider-scoped streaming repair.
- `docs/superpowers/specs/2026-08-06-deepseek-responses-streaming-terminal-repair-design.md` — approved design authority; implementation must remain consistent with it.
Expand All @@ -40,8 +40,8 @@
- Modify: `src/providers/registry.ts:150-170`
- Modify: `src/providers/registry.ts:1143-1162`
- Modify: `src/providers/registry.ts:1834-1842`
- Modify: `tests/deepseek-inbound-wire.test.ts:1-175`
- Modify: `tests/deepseek-responses-item-id-repair.test.ts`
- Modify: `tests/providers/deepseek-inbound-wire.test.ts:1-175`
- Modify: `tests/providers/deepseek-responses-item-id-repair.test.ts`

**Interfaces:**
- Produces: `ResponsesTerminalRepairPolicy`
Expand Down Expand Up @@ -74,7 +74,7 @@ test("Codex HTTP and WebSocket turns keep DeepSeek streaming upstream", async ()
Delete or rewrite the tests whose asserted contract is specifically
`stream:false`/bounded JSON for built-in DeepSeek. Keep the bounded-JSON helper
coverage that is provider-neutral. In
`tests/deepseek-responses-item-id-repair.test.ts`, retain the pure
`tests/providers/deepseek-responses-item-id-repair.test.ts`, retain the pure
`repairResponsesJsonItemIds()` unit test but remove the built-in-DeepSeek HTTP
activation assertion; Task 4 replaces it with streaming repair composition.

Expand All @@ -83,7 +83,7 @@ activation assertion; Task 4 replaces it with streaming repair composition.
Run:

```bash
bun test tests/deepseek-inbound-wire.test.ts
bun test tests/providers/deepseek-inbound-wire.test.ts
```

Expected: compile/test failure because `providerModelResponsesTerminalRepair`
Expand Down Expand Up @@ -134,7 +134,7 @@ export function providerModelResponsesTerminalRepair(
Run:

```bash
bun test tests/deepseek-inbound-wire.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/provider-registry-parity.test.ts
bun test tests/providers/deepseek-inbound-wire.test.ts tests/providers/deepseek-responses-item-id-repair.test.ts tests/providers/provider-registry-parity.test.ts
```

Expected: all selected tests pass; captured HTTP and WebSocket request bodies
Expand All @@ -143,7 +143,7 @@ carry `stream:true`.
- [ ] **Step 5: Commit**

```bash
git add src/providers/registry.ts tests/deepseek-inbound-wire.test.ts tests/deepseek-responses-item-id-repair.test.ts
git add src/providers/registry.ts tests/providers/deepseek-inbound-wire.test.ts tests/providers/deepseek-responses-item-id-repair.test.ts
git commit -m "fix(deepseek): restore Responses upstream streaming"
```

Expand Down Expand Up @@ -386,8 +386,8 @@ git commit -m "fix(responses): fail closed on unsafe terminal repair"
**Files:**
- Modify: `src/server/responses/core.ts:95-115`
- Modify: `src/server/responses/core.ts:2030-2230`
- Modify: `tests/deepseek-inbound-wire.test.ts:115-330`
- Modify: `tests/deepseek-responses-item-id-repair.test.ts`
- Modify: `tests/providers/deepseek-inbound-wire.test.ts:115-330`
- Modify: `tests/providers/deepseek-responses-item-id-repair.test.ts`
- Modify: `tests/responses/ws-endpoint.test.ts`

**Interfaces:**
Expand Down Expand Up @@ -432,7 +432,7 @@ WebSocket handling. Assert the client receives progressive delta frames, one
Run:

```bash
bun test tests/deepseek-inbound-wire.test.ts tests/responses/ws-endpoint.test.ts
bun test tests/providers/deepseek-inbound-wire.test.ts tests/responses/ws-endpoint.test.ts
```

Expected: requests now carry `stream:true` from Task 1 but no provider-scoped
Expand Down Expand Up @@ -482,7 +482,7 @@ streaming resolver still returns `false`.
Run:

```bash
bun test tests/deepseek-inbound-wire.test.ts tests/responses/ws-endpoint.test.ts tests/responses/responses-state.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/deepseek-reasoning-replay.test.ts
bun test tests/providers/deepseek-inbound-wire.test.ts tests/responses/ws-endpoint.test.ts tests/responses/responses-state.test.ts tests/providers/deepseek-responses-item-id-repair.test.ts tests/providers/deepseek-reasoning-replay.test.ts
```

Expected: progressive output precedes terminal, both transports close once,
Expand All @@ -491,7 +491,7 @@ item ids are stable, and continuation state retains reasoning/function output.
- [ ] **Step 6: Commit**

```bash
git add src/server/responses/core.ts tests/deepseek-inbound-wire.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/responses/ws-endpoint.test.ts
git add src/server/responses/core.ts tests/providers/deepseek-inbound-wire.test.ts tests/providers/deepseek-responses-item-id-repair.test.ts tests/responses/ws-endpoint.test.ts
git commit -m "fix(deepseek): repair terminal-less Responses streams"
```

Expand Down Expand Up @@ -560,7 +560,7 @@ git commit -m "docs(deepseek): describe streaming terminal repair"
Run:

```bash
bun test tests/responses/responses-terminal-repair.test.ts tests/deepseek-inbound-wire.test.ts tests/responses/ws-endpoint.test.ts tests/responses/sse-failed-tail.test.ts tests/relay-eager.test.ts tests/responses/responses-item-id-repair.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/deepseek-reasoning-replay.test.ts tests/responses/responses-state.test.ts
bun test tests/responses/responses-terminal-repair.test.ts tests/providers/deepseek-inbound-wire.test.ts tests/responses/ws-endpoint.test.ts tests/responses/sse-failed-tail.test.ts tests/relay-eager.test.ts tests/responses/responses-item-id-repair.test.ts tests/providers/deepseek-responses-item-id-repair.test.ts tests/providers/deepseek-reasoning-replay.test.ts tests/responses/responses-state.test.ts
```

Expected: 0 failures.
Expand Down
28 changes: 14 additions & 14 deletions docs/superpowers/plans/2026-08-09-routed-computer-use-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
## Task 1: Lock the routed catalog contract with failing tests

**Files:**
- Modify: `tests/codex-catalog.test.ts:280-300`
- Modify: `tests/codex-catalog.test.ts:1011-1045`
- Modify: `tests/codex-catalog.test.ts:1230-1255`
- Modify: `tests/codex-integration/codex-catalog.test.ts:280-300`
- Modify: `tests/codex-integration/codex-catalog.test.ts:1011-1045`
- Modify: `tests/codex-integration/codex-catalog.test.ts:1230-1255`

**Step 1: Change the combo assertion to require the explicit routed mode**

Expand Down Expand Up @@ -68,15 +68,15 @@ expect(rows.find(row => row.slug === "team/gpt-5.5")?.tool_mode).toBe("code");
Run:

```bash
bun test tests/codex-catalog.test.ts
bun test tests/codex-integration/codex-catalog.test.ts
```

Expected: routed/template/combo/fallback assertions fail because current production code deletes or omits `tool_mode`; native preservation assertions remain green.

**Step 6: Commit the red tests only**

```bash
git add tests/codex-catalog.test.ts
git add tests/codex-integration/codex-catalog.test.ts
git commit -m "test(codex): require code mode for routed models"
```

Expand All @@ -86,7 +86,7 @@ git commit -m "test(codex): require code mode for routed models"
- Modify: `src/codex/catalog/parsing.ts:341-375`
- Modify: `src/codex/catalog/sync.ts:33`
- Modify: `src/codex/catalog/sync.ts:276-310`
- Test: `tests/codex-catalog.test.ts`
- Test: `tests/codex-integration/codex-catalog.test.ts`

**Step 1: Add a named compatibility helper**

Expand Down Expand Up @@ -128,7 +128,7 @@ Do not call the full routed normalizer from the fallback branch; that would broa
**Step 4: Run the focused tests and confirm GREEN**

```bash
bun test tests/codex-catalog.test.ts
bun test tests/codex-integration/codex-catalog.test.ts
```

Expected: all catalog tests pass, including native/account preservation.
Expand All @@ -151,8 +151,8 @@ git commit -m "fix(codex): enable code mode for routed models"
## Task 3: Prove on-disk catalog synchronization preserves the policy

**Files:**
- Modify: `tests/codex-catalog-sync-hardening.test.ts`
- Test: `tests/codex-catalog-sync-hardening.test.ts`
- Modify: `tests/codex-integration/codex-catalog-sync-hardening.test.ts`
- Test: `tests/codex-integration/codex-catalog-sync-hardening.test.ts`

**Step 1: Add a real sync fixture assertion**

Expand All @@ -169,15 +169,15 @@ Also assert a generated native account-qualified row retains `"code"` if the fix
**Step 2: Run the sync test**

```bash
bun test tests/codex-catalog-sync-hardening.test.ts
bun test tests/codex-integration/codex-catalog-sync-hardening.test.ts
```

Expected: pass and prove the serialized catalog, not merely the in-memory builder.

**Step 3: Commit the persistence test**

```bash
git add tests/codex-catalog-sync-hardening.test.ts
git add tests/codex-integration/codex-catalog-sync-hardening.test.ts
git commit -m "test(codex): persist routed code mode policy"
```

Expand Down Expand Up @@ -229,7 +229,7 @@ git commit -m "docs(codex): explain routed local tool access"
Run:

```bash
bun test tests/responses/responses-parser.test.ts tests/adapters/bridge.test.ts tests/multi-agent-compat.test.ts
bun test tests/responses/responses-parser.test.ts tests/adapters/bridge.test.ts tests/codex-integration/multi-agent-compat.test.ts
```

Expected: custom declaration, streaming `custom_tool_call`, exact freeform input, and output replay remain green. Add no production protocol change unless one of these tests proves a real gap.
Expand All @@ -239,7 +239,7 @@ Expected: custom declaration, streaming `custom_tool_call`, exact freeform input
Run:

```bash
bun test tests/responses/responses-terminal-repair.test.ts tests/deepseek-inbound-wire.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/responses/passthrough-abort.test.ts
bun test tests/responses/responses-terminal-repair.test.ts tests/providers/deepseek-inbound-wire.test.ts tests/providers/deepseek-responses-item-id-repair.test.ts tests/responses/passthrough-abort.test.ts
```

Expected: progressive deltas, strict terminal repair, item IDs, and cancellation pass.
Expand All @@ -249,7 +249,7 @@ Expected: progressive deltas, strict terminal repair, item IDs, and cancellation
Run:

```bash
bun test tests/vision/vision-sidecar-e2e.test.ts tests/vision/vision-anthropic.test.ts tests/vision/vision-cache.test.ts tests/vision/vision-fail-closed.test.ts tests/catalog-vision-sidecar-modalities.test.ts tests/responses/openai-responses-passthrough.test.ts
bun test tests/vision/vision-sidecar-e2e.test.ts tests/vision/vision-anthropic.test.ts tests/vision/vision-cache.test.ts tests/vision/vision-fail-closed.test.ts tests/codex-integration/catalog-vision-sidecar-modalities.test.ts tests/responses/openai-responses-passthrough.test.ts
```

Expected: captions replace raw image parts in passthrough bodies, empty references do not consume captions, and partial/failure paths omit pixels safely.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
### Task 12: Move catalog timeout to the flaky test only

**Files:**
- Modify: `tests/codex-catalog-sync-hardening.test.ts`
- Modify: `tests/codex-integration/codex-catalog-sync-hardening.test.ts`
- Modify: `scripts/ci/run-bun-test-batches.sh`

**Interfaces:**
Expand Down
Loading
Loading