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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# These four files carry every user's request path, including users of no optional
# subsystem. Optional subsystems (Compatibility Lab and anything added later) register
# into core-owned slots at activation instead of being imported here; the invariant is
# enforced by tests/core-lab-boundary.test.ts and designed in
# enforced by tests/lab/core-lab-boundary.test.ts and designed in
# devlog/_fin/260814_lab_core_decoupling/.
# Last-match-wins: this block must stay below /src/server/ to take effect.
/src/router.ts @lidge-jun
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ directly or transitively:
- `src/server/lifecycle.ts`
- `src/server/responses/core.ts`

`tests/core-lab-boundary.test.ts` enforces this by walking the runtime import
`tests/lab/core-lab-boundary.test.ts` enforces this by walking the runtime import
graph and printing the offending chain on failure. It is not a style rule: the
original violation hid in a six-hop chain
(`assemble → quota → auth-api → native-main-admission → lifecycle → lab`) where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
- `src/providers/registry.ts` — declares and resolves the built-in per-model terminal-repair policy.
- `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-terminal-repair.test.ts` — unit state-machine and stream-race coverage.
- `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/ws-endpoint.test.ts` — WebSocket event parity for real and repaired terminals.
- `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 Down Expand Up @@ -153,7 +153,7 @@ git commit -m "fix(deepseek): restore Responses upstream streaming"

**Files:**
- Create: `src/server/responses-terminal-repair.ts`
- Create: `tests/responses-terminal-repair.test.ts`
- Create: `tests/responses/responses-terminal-repair.test.ts`

**Interfaces:**
- Consumes: `ResponsesTerminalRepairPolicy`
Expand Down Expand Up @@ -201,7 +201,7 @@ terminal followed by one `[DONE]`.
Run:

```bash
bun test tests/responses-terminal-repair.test.ts
bun test tests/responses/responses-terminal-repair.test.ts
```

Expected: module-not-found failure for
Expand Down Expand Up @@ -251,7 +251,7 @@ an item and release every remaining charge during disposal.
Run:

```bash
bun test tests/responses-terminal-repair.test.ts
bun test tests/responses/responses-terminal-repair.test.ts
```

Expected: healthy pass-through and five-second grace completion both pass;
Expand All @@ -260,7 +260,7 @@ translator-budget current bytes return to zero after drain.
- [ ] **Step 5: Commit**

```bash
git add src/server/responses-terminal-repair.ts tests/responses-terminal-repair.test.ts
git add src/server/responses-terminal-repair.ts tests/responses/responses-terminal-repair.test.ts
git commit -m "feat(responses): repair complete terminal-less streams"
```

Expand All @@ -270,7 +270,7 @@ git commit -m "feat(responses): repair complete terminal-less streams"

**Files:**
- Modify: `src/server/responses-terminal-repair.ts`
- Modify: `tests/responses-terminal-repair.test.ts`
- Modify: `tests/responses/responses-terminal-repair.test.ts`

**Interfaces:**
- Preserves Task 2 public signatures.
Expand Down Expand Up @@ -305,7 +305,7 @@ cancellation, an empty scheduler queue, and
Run:

```bash
bun test tests/responses-terminal-repair.test.ts
bun test tests/responses/responses-terminal-repair.test.ts
```

Expected: the newly added boundary tests fail because Task 2 implements only
Expand Down Expand Up @@ -366,7 +366,7 @@ abort/cancel, taint, and candidate completeness immediately before enqueueing.
Run:

```bash
bun test tests/responses-terminal-repair.test.ts tests/sse-failed-tail.test.ts tests/relay-eager.test.ts
bun test tests/responses/responses-terminal-repair.test.ts tests/responses/sse-failed-tail.test.ts tests/relay-eager.test.ts
```

Expected: all tests pass with no duplicate terminal, timer leak, or retained
Expand All @@ -375,7 +375,7 @@ budget after teardown.
- [ ] **Step 5: Commit**

```bash
git add src/server/responses-terminal-repair.ts tests/responses-terminal-repair.test.ts
git add src/server/responses-terminal-repair.ts tests/responses/responses-terminal-repair.test.ts
git commit -m "fix(responses): fail closed on unsafe terminal repair"
```

Expand All @@ -388,7 +388,7 @@ git commit -m "fix(responses): fail closed on unsafe terminal repair"
- 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/ws-endpoint.test.ts`
- Modify: `tests/responses/ws-endpoint.test.ts`

**Interfaces:**
- Consumes: `providerModelResponsesTerminalRepair(...)`
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/ws-endpoint.test.ts
bun test tests/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/ws-endpoint.test.ts tests/responses-state.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/deepseek-reasoning-replay.test.ts
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
```

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/ws-endpoint.test.ts
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 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-terminal-repair.test.ts tests/deepseek-inbound-wire.test.ts tests/ws-endpoint.test.ts tests/sse-failed-tail.test.ts tests/relay-eager.test.ts tests/responses-item-id-repair.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/deepseek-reasoning-replay.test.ts tests/responses-state.test.ts
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
```

Expected: 0 failures.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ git commit -m "docs(codex): explain routed local tool access"
Run:

```bash
bun test tests/responses-parser.test.ts tests/bridge.test.ts tests/multi-agent-compat.test.ts
bun test tests/responses/responses-parser.test.ts tests/adapters/bridge.test.ts tests/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-terminal-repair.test.ts tests/deepseek-inbound-wire.test.ts tests/deepseek-responses-item-id-repair.test.ts tests/passthrough-abort.test.ts
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
```

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/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/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 All @@ -259,7 +259,7 @@ Expected: captions replace raw image parts in passthrough bodies, empty referenc
Run:

```bash
bun test tests/images/plan.test.ts tests/images/synthetic-tool.test.ts tests/images/z-handler-activation.test.ts tests/images/loop-reasoning-replay.test.ts tests/responses-image-gen-repair.test.ts
bun test tests/images/plan.test.ts tests/images/synthetic-tool.test.ts tests/images/z-handler-activation.test.ts tests/images/loop-reasoning-replay.test.ts tests/responses/responses-image-gen-repair.test.ts
```

Expected: image tool planning, activation, alias restoration, replay, and result repair pass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
- Create: `src/lab/public/project.ts`
- Create: `src/lab/public/index.ts`
- Modify: `src/lab/index.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: `tests/lab/lab-public-evidence.test.ts`

**Interfaces:**
- Produces: `PublicEvidenceBundleUnsignedV1`, `PublicEvidenceRecordV1`, `PublicEvidenceSubjectV1`, `PublicRouteRegistryManifestV1`, `projectPublicEvidence()`, `validatePublicEvidenceBundle()`.

- [ ] **Step 1: Write RED tests** for closed-schema rejection, deterministic public IDs/day buckets, protocol/route/task subject discrimination, exact route allowlist, private-route `not_exportable`, IC-only incident refs, no local ID leakage, and secret/PII canaries.
- [ ] **Step 2: Run focused test and verify expected RED failures.**
Run: `bun test tests/lab-public-evidence.test.ts`
Run: `bun test tests/lab/lab-public-evidence.test.ts`
- [ ] **Step 3: Implement minimal closed public types/registry/validator/projector.**
Public identities use domain-separated SHA-256 over JCS public-safe bytes. The registry manifest is repo-owned, versioned, digested, and cannot be supplied by an imported bundle as trust authority.
- [ ] **Step 4: Run focused test and verify GREEN.**
Expand All @@ -67,7 +67,7 @@
- Create: `src/lab/public/signature.ts`
- Create: `src/lab/public/storage.ts`
- Modify: `src/lab/paths.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: `tests/lab/lab-public-evidence.test.ts`

**Interfaces:**
- Produces: `getOrCreatePublicPublisher()`, `signPublicEvidenceBundle()`, `verifyPublicEvidenceBundle()`, `writePublicEvidenceBundle()`, `readPublicEvidenceBundle()`.
Expand All @@ -82,7 +82,7 @@
**Files:**
- Create: `src/lab/public/revocation.ts`
- Create: `src/lab/public/community.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: `tests/lab/lab-public-evidence.test.ts`

**Interfaces:**
- Produces: `PublicEvidenceRevocationV1`, `verifyPublicEvidenceRevocation()`, `importCommunityBundle()`, `listCommunityBundles()`.
Expand All @@ -97,8 +97,8 @@
**Files:**
- Modify: `src/lab/ledger/purge.ts`
- Modify: `src/lab/paths.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: `tests/lab-evidence-ledger.test.ts`
- Test: `tests/lab/lab-public-evidence.test.ts`
- Test: `tests/lab/lab-evidence-ledger.test.ts`

**Interfaces:**
- Consumes: existing `purgeSensitiveEvidence()` and `purgeActions: export`.
Expand All @@ -114,7 +114,7 @@
**Files:**
- Modify: `src/cli/lab.ts`
- Modify: `src/server/management/lab-routes.ts`
- Test: `tests/lab-public-evidence.test.ts`
- Test: `tests/lab/lab-public-evidence.test.ts`
- Test: relevant Lab CLI/management tests discovered in repository.

**Interfaces:**
Expand Down Expand Up @@ -147,7 +147,7 @@
**Files:**
- Modify docs only if validation findings require factual updates.

- [ ] **Step 1:** Run `bun test tests/lab-public-evidence.test.ts tests/lab-evidence-ledger.test.ts`.
- [ ] **Step 1:** Run `bun test tests/lab/lab-public-evidence.test.ts tests/lab/lab-evidence-ledger.test.ts`.
- [ ] **Step 2:** Run `bun x tsc --noEmit`.
- [ ] **Step 3:** Run `bun run privacy:scan`.
- [ ] **Step 4:** Run relevant Lab query/ledger/CLI/GUI tests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
### Task 1: Add adversarial RED coverage

**Files:**
- Create: `tests/lab-public-deep-review-regressions.test.ts`
- Create: `tests/lab/lab-public-deep-review-regressions.test.ts`
- Modify: `tests/ci-workflows.test.ts`

**Interfaces:**
Expand Down Expand Up @@ -135,7 +135,7 @@
- Modify: `src/lab/public/operator.ts`
- Modify: `src/cli/lab.ts`
- Modify: `src/server/management/lab-routes.ts`
- Modify: `tests/lab-public-surfaces.test.ts`
- Modify: `tests/lab/lab-public-surfaces.test.ts`

**Interfaces:**
- Produces: preview/export results that expose exclusion indices/reasons and `stored.created` only, never local event IDs or filesystem paths.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ The implementation is expected to touch these responsibility boundaries:
wrapper.
- `src/server/responses/core.ts`: resolve the provider policy and wrap the SSE
body before transport-specific relay branches.
- `tests/responses-terminal-repair.test.ts`: unit state-machine coverage.
- `tests/responses/responses-terminal-repair.test.ts`: unit state-machine coverage.
- `tests/deepseek-inbound-wire.test.ts`: end-to-end wire, progressive delivery,
repair composition, and WebSocket/HTTP activation.
- Existing relay and item-id tests only where an explicit integration contract
Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/claude-manual-env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Pure manual-env builder for the Claude Code page (devlog
* 260720_claude_authmode_persist/020): extracted from ClaudeCode.tsx so the
* copy-paste shell block is directly unit-testable (tests/claude-manual-env.test.ts).
* copy-paste shell block is directly unit-testable (tests/gui/claude-manual-env.test.ts).
*/
import { AUTO_COMPACT_WINDOW_DEFAULT } from "./claude-code-types";

Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/dashboard-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export function visionTimeoutPatch(timeoutMs: number): SidecarPatch {

/**
* Dashboard names for the runtime timeout contract in `src/vision/timeout-bounds.ts`.
* Pinned by `tests/vision-sidecar-timeout-bounds.test.ts`.
* Pinned by `tests/gui/vision-sidecar-timeout-bounds.test.ts`.
*/
export const VISION_TIMEOUT_MS_DEFAULT = DEFAULT_VISION_TIMEOUT_MS;
export const VISION_TIMEOUT_MS_MAX = MAX_VISION_TIMEOUT_MS;
Expand Down
2 changes: 1 addition & 1 deletion gui/src/pages/integrations/integration-tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A separate module rather than exports on Integrations.tsx, because a file that
* exports both a component and constants breaks React fast refresh
* (react/only-export-components). These need to be importable: they are the only
* client lists in the GUI that neither tests/integrations-invariants.test.ts
* client lists in the GUI that neither tests/gui/integrations-invariants.test.ts
* compares nor the compiler forces, so a client added everywhere else still gets
* no tab and nothing fails. gui/tests/integrations-tab-coverage.test.ts stands in
* that gap and reads them from here.
Expand Down
2 changes: 1 addition & 1 deletion gui/tests/integrations-tab-coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { INTEGRATION_TAB_HASHES } from "../src/app-routing";
/*
* The gap this closes.
*
* tests/integrations-invariants.test.ts compares five client lists, and the
* tests/gui/integrations-invariants.test.ts compares five client lists, and the
* per-page label maps are Record<FileIntegrationClientId, TKey> so the compiler
* forces those. TABS and FILE_CLIENTS are neither: they are a plain array and a
* plain Set, so a client added everywhere else still gets no tab and nothing
Expand Down
2 changes: 1 addition & 1 deletion gui/tests/models-workspace-panels.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Models tab workspace — mounted behaviour.
*
* The routing helpers are unit-tested at `tests/models-workspace-tabs.test.ts`. This file
* The routing helpers are unit-tested at `tests/gui/models-workspace-tabs.test.ts`. This file
* exists because those assertions cannot see the failures that actually happened here:
* a component-level early return that unmounted the whole tab tree while the catalog
* loaded, and a disabled resource that swapped the combo editor for an empty state and
Expand Down
20 changes: 10 additions & 10 deletions scripts/openai-provider-option-final-gates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ export async function runGateSequence(plan: GateSpec[], deps: GateDeps): Promise
}

const focusedTests = [
"tests/openai-provider-option.test.ts",
"tests/openai-provider-option-migration.test.ts",
"tests/openai-provider-option-startup.test.ts",
"tests/openai-provider-option-e2e.test.ts",
"tests/openai-provider-option-tooling.test.ts",
"tests/adapters/openai/openai-provider-option.test.ts",
"tests/adapters/openai/openai-provider-option-migration.test.ts",
"tests/adapters/openai/openai-provider-option-startup.test.ts",
"tests/adapters/openai/openai-provider-option-e2e.test.ts",
"tests/adapters/openai/openai-provider-option-tooling.test.ts",
"tests/provider-registry-parity.test.ts",
"tests/provider-payload.test.ts",
"tests/codex-account-mode-state.test.ts",
"tests/gui/provider-payload.test.ts",
"tests/gui/codex-account-mode-state.test.ts",
"tests/routing/router.test.ts",
"tests/codex-routing.test.ts",
"tests/server-auth.test.ts",
Expand All @@ -70,7 +70,7 @@ export function finalGatePlan(root: string, evidenceDir: string, unitRoot = dirn
const env = { ...process.env, OCX_EVIDENCE_DIR: evidenceDir } as Record<string, string>;
const unitPath = relative(root, unitRoot);
return [
{ name: "openai-provider-option-e2e", command: ["bun", "test", "tests/openai-provider-option-e2e.test.ts"], cwd: root, env },
{ name: "openai-provider-option-e2e", command: ["bun", "test", "tests/adapters/openai/openai-provider-option-e2e.test.ts"], cwd: root, env },
{ name: "provider-option-focused", command: ["bun", "test", "--isolate", ...focusedTests], cwd: root, env },
{ name: "isolated-runtime-smoke", command: ["bun", "scripts/openai-provider-option-runtime-smoke.ts", "--unit-root", unitPath, "--evidence-dir", evidenceDir], cwd: root },
{ name: "live-key-status", command: ["bun", "scripts/openai-provider-option-runtime-smoke.ts", "--check-live-key", "--unit-root", unitPath, "--evidence-dir", evidenceDir], cwd: root },
Expand All @@ -91,8 +91,8 @@ export function finalGatePlan(root: string, evidenceDir: string, unitRoot = dirn
{
name: "scoped-diff-check",
command: ["git", "diff", "--check", "--", "README.md", "readme/README.ko.md", "readme/README.zh-CN.md", "structure",
"docs-site/src/content/docs", "devlog/_chase/_model", "tests/openai-provider-option-e2e.test.ts",
"tests/openai-provider-option-tooling.test.ts", "tests/fixtures/openai-provider-option-migration-child.ts",
"docs-site/src/content/docs", "devlog/_chase/_model", "tests/adapters/openai/openai-provider-option-e2e.test.ts",
"tests/adapters/openai/openai-provider-option-tooling.test.ts", "tests/fixtures/openai-provider-option-migration-child.ts",
"scripts/openai-provider-option-runtime-child.ts", "scripts/openai-provider-option-runtime-smoke.ts",
"scripts/openai-provider-option-evidence-scan.ts", "scripts/openai-provider-option-final-gates.ts",
"scripts/openai-hardening-live-policy.ts", "scripts/openai-hardening-runtime-env.ts",
Expand Down
Loading
Loading