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
69 changes: 69 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.PHONY: help install dev start build build-release lint typecheck typecheck-strict \
test test-unit test-vitest test-coverage test-all test-integration test-e2e \
check check-cycles check-docs env-sync clean

# OmniRoute — convenience wrapper around the npm scripts.
# All targets delegate to the canonical package.json scripts (single source of truth).

help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'

install: ## Install dependencies (auto-generates .env from .env.example)
npm install

dev: ## Dev server at http://localhost:20128
npm run dev

start: ## Production server (requires a prior build)
npm run start

build: ## Production build (Next.js 16 standalone)
npm run build

build-release: ## Release build
npm run build:release

lint: ## ESLint (0 errors expected)
npm run lint

typecheck: ## TypeScript check (core)
npm run typecheck:core

typecheck-strict: ## Strict check (no implicit any)
npm run typecheck:noimplicit:core

test: ## Unit tests (Node native runner)
npm run test:unit

test-unit: ## Alias for `test`
npm run test:unit

test-vitest: ## Vitest (MCP server, autoCombo, cache)
npm run test:vitest

test-coverage: ## Unit tests + coverage gate (60/60/60/60)
npm run test:coverage

test-all: ## All suites (unit + vitest + ecosystem + e2e)
npm run test:all

test-integration: ## Integration tests
npm run test:integration

test-e2e: ## E2E (Playwright)
npm run test:e2e

check: ## lint + test combined
npm run check

check-cycles: ## Detect circular dependencies
npm run check:cycles

check-docs: ## Validate documentation (incl. fabricated-docs)
npm run check:docs-all

env-sync: ## Sync .env from .env.example
npm run env:sync

clean: ## Remove build artifacts
rm -rf .build dist coverage .eslintcache
15 changes: 5 additions & 10 deletions src/lib/db/migrationRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,16 +472,11 @@ function isSchemaAlreadyApplied(
return hasColumn(db, "version_manager", "auto_restart_adopted");
case "138":
return hasColumn(db, "upstream_proxy_config", "fallback_backend");
case "140":
// Retroactive guard for the connection_runtime_state migration renumbered
// 135 -> 140 (#9449 landed onto the slot already taken by #8908's
// 135_migrate_model_capability_max_token.sql — the same recurring
// numbering-race class as the 135/136 -> 137/138 renumber above). A DB
// that already ran this under the old 135 number has the table, and a
// bare CREATE TABLE re-run would otherwise just no-op (IF NOT EXISTS)
// but still burn a version-tracking slot mismatch — guard it the same
// way as the other renumbers for consistency.
return hasTable(db, "connection_runtime_state");
case "139":
// Retroactive guard for the 134 → 139 renumber: ccr_blocks landed on the 134
// slot already taken by proxy_logs_egress_ip. A DB that already applied
// ccr_blocks under the old 134 number has the table — skip the re-run.
return hasTable(db, "ccr_blocks");
default:
return false;
}
Expand Down
32 changes: 32 additions & 0 deletions tests/unit/antigravity-project-persist-pool-filter.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import test from "node:test";
import assert from "node:assert/strict";
import { preferAntigravityConnectionsWithStoredProject } from "@omniroute/open-sse/services/antigravityProjectPersist.ts";

test("keeps connections with a projectId on the column or in providerSpecificData", () => {
const kept = preferAntigravityConnectionsWithStoredProject([
{ id: "a", projectId: "projects/a" },
{ id: "b", providerSpecificData: { projectId: "projects/b" } },
]);

assert.deepEqual(
kept.map((c) => c.id),
["a", "b"]
);
});

test("drops connections whose projectId is missing, blank or not a string", () => {
const kept = preferAntigravityConnectionsWithStoredProject([
{ id: "missing" },
{ id: "blank", projectId: " " },
{ id: "null", projectId: null },
{ id: "numeric", projectId: 42 },
{ id: "blank-psd", providerSpecificData: { projectId: "" } },
{ id: "null-psd", providerSpecificData: null },
]);

assert.deepEqual(kept, []);
});

test("returns an empty pool for an empty input instead of throwing", () => {
assert.deepEqual(preferAntigravityConnectionsWithStoredProject([]), []);
});
Loading