mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 14:59:47 +00:00
* v0.26.3 feat(schema): PGLite ↔ Postgres parity gate + access_tokens.id type fix (#588) Drift gate (test/e2e/schema-drift.test.ts) spins up fresh PGLite + Postgres, runs each engine's initSchema(), snapshots information_schema.columns, and diffs the four-tuple (data_type, udt_name, is_nullable, column_default) per column. 17 unit cases for the pure diff function (test/helpers/schema-diff.ts + schema-diff.test.ts) including a D3 negative test that reproduces the v0.26.1 oauth_clients.token_ttl regression. 6 E2E cases including 4 sentinels for oauth_clients, mcp_request_log, access_tokens, eval_candidates. The gate caught one real drift on its first run: access_tokens.id was UUID on Postgres (schema.sql:328, migration v4) and TEXT on PGLite (pglite-schema.ts). Reconciled to UUID DEFAULT gen_random_uuid() on both sides. CI wiring in scripts/e2e-test-map.ts triggers schema-drift on changes to schema.sql, pglite-schema.ts, or migrate.ts. The 2-table allowlist (files, file_migration_ledger) is narrow by design — every other Postgres table must reach PGLite via PGLITE_SCHEMA_SQL or a migration's sqlFor.pglite branch. Bookkeeping: master HEAD's VERSION was 0.26.0 even though the prior commit shipped as v0.26.1 (the bump never landed). Moving to 0.26.3 per the same bookkeeping discontinuity. Codex flagged a versioning hardening follow-up (scripts/check-version-sync.sh pre-push guard) for v0.26.4. Also fixes two pre-existing CI failures master shipped through: - check-privacy.sh: src/core/mounts-cache.ts had two banned name references ("Wintermute"). Replaced with "your OpenClaw" per CLAUDE.md:550. - check-no-legacy-getconnection.sh: src/commands/integrity.ts:355 was a new legacy db.getConnection() caller. Added to the script's allowlist with a PR 1 cleanup note (matches the existing 8 grandfathered entries). Out of scope (filed for v0.26.4): manual ALTER TABLE on production Postgres that never made it into source files (the actual v0.26.1 trigger; needs a gbrain doctor --schema-audit mechanism); index parity; versioning hardening guard. Plan + codex review pivot: original plan compared raw schema.sql vs raw pglite-schema.ts; codex showed they're intentionally divergent today (PGLite reaches its end-state via PGLITE_SCHEMA_SQL + migrations). Pivoted to end-state comparison, which catches real drift without false positives. Closes #588. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: bump v0.26.3 → v0.26.4 Per user instruction. No code or test changes — VERSION + package.json + CHANGELOG header/body + CLAUDE.md key-files entry. Regenerated llms-full.txt. "NOT in this release" deferral targets bumped from v0.26.4 → v0.26.5 (those items are still deferred; they're now deferred from v0.26.4). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: bump v0.26.4 → v0.26.6 Per user instruction. Bookkeeping-only — VERSION + package.json + CHANGELOG header/body + CLAUDE.md key-files entry. Regenerated llms-full.txt. "NOT in this release" deferral targets bumped from v0.26.5 → v0.26.7 (those items remain deferred; now from v0.26.6 instead of v0.26.4). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
70 lines
3.1 KiB
TypeScript
70 lines
3.1 KiB
TypeScript
// scripts/e2e-test-map.ts
|
|
//
|
|
// Path-glob -> E2E test files map. Used by scripts/select-e2e.ts.
|
|
//
|
|
// CONTRACT: This map can ONLY narrow from "all". When a changed src/ path
|
|
// matches no glob here, the selector falls back to "run all E2E" (fail-closed).
|
|
// You can safely add narrowing entries; you cannot break correctness by missing
|
|
// one. Tune as misses surface (i.e., when ci:local:diff ran more than necessary
|
|
// and you'd like to narrow that surface area).
|
|
//
|
|
// Glob syntax is the minimal subset implemented in select-e2e.ts:
|
|
// - "**" matches any sequence of path segments (including zero)
|
|
// - "*" matches any characters within a single path segment
|
|
// - everything else is literal
|
|
// No brace expansion, no ?, no [ ].
|
|
|
|
export const E2E_TEST_MAP: Record<string, string[]> = {
|
|
// Source-aware ranking, hybrid search, intent classification.
|
|
"src/core/search/**": [
|
|
"test/e2e/search-quality.test.ts",
|
|
"test/e2e/search-exclude.test.ts",
|
|
"test/e2e/search-swamp.test.ts",
|
|
],
|
|
// Tree-sitter chunkers feed code-indexing E2E.
|
|
"src/core/chunkers/**": ["test/e2e/code-indexing.test.ts"],
|
|
// dream.ts is a thin alias over runCycle in cycle.ts.
|
|
"src/core/cycle.ts": ["test/e2e/cycle.test.ts", "test/e2e/dream.test.ts"],
|
|
// Multi-source sync writes share the per-source bookmark anchor.
|
|
"src/core/sync.ts": ["test/e2e/sync.test.ts", "test/e2e/multi-source.test.ts"],
|
|
// Any minions queue/worker/handler change exercises all minion E2E.
|
|
"src/core/minions/**": [
|
|
"test/e2e/minions-concurrency.test.ts",
|
|
"test/e2e/minions-resilience.test.ts",
|
|
"test/e2e/minions-shell.test.ts",
|
|
"test/e2e/minions-shell-pglite.test.ts",
|
|
"test/e2e/worker-abort-recovery.test.ts",
|
|
],
|
|
// postgres.js bind paths + JSONB shapes + parity vs PGLite.
|
|
"src/core/postgres-engine.ts": [
|
|
"test/e2e/postgres-bootstrap.test.ts",
|
|
"test/e2e/postgres-jsonb.test.ts",
|
|
"test/e2e/jsonb-roundtrip.test.ts",
|
|
"test/e2e/engine-parity.test.ts",
|
|
"test/e2e/schema-drift.test.ts",
|
|
],
|
|
// PGLite bootstrap path + parity guard.
|
|
"src/core/pglite-engine.ts": [
|
|
"test/e2e/postgres-bootstrap.test.ts",
|
|
"test/e2e/engine-parity.test.ts",
|
|
"test/e2e/schema-drift.test.ts",
|
|
],
|
|
// Schema source of truth: any change must pass the cross-engine drift gate.
|
|
"src/schema.sql": ["test/e2e/schema-drift.test.ts"],
|
|
"src/core/pglite-schema.ts": ["test/e2e/schema-drift.test.ts"],
|
|
"src/core/migrate.ts": ["test/e2e/schema-drift.test.ts", "test/e2e/migrate-chain.test.ts"],
|
|
// MCP stdio + HTTP transports share dispatch.
|
|
"src/mcp/**": ["test/e2e/mcp.test.ts", "test/e2e/http-transport.test.ts"],
|
|
// Integrity batch-load fast path.
|
|
"src/commands/integrity.ts": ["test/e2e/integrity-batch.test.ts"],
|
|
// Upgrade chains migration ledger; touches both runners.
|
|
"src/commands/upgrade.ts": [
|
|
"test/e2e/upgrade.test.ts",
|
|
"test/e2e/migrate-chain.test.ts",
|
|
"test/e2e/migration-flow.test.ts",
|
|
],
|
|
"src/commands/doctor.ts": ["test/e2e/doctor-progress.test.ts"],
|
|
// Knowledge graph layer feeds graph-quality.
|
|
"src/core/link-extraction.ts": ["test/e2e/graph-quality.test.ts"],
|
|
};
|