diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 748e7c044a6..d8aea0d1764 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,14 +128,18 @@ concurrency: # carries it rather than first on `main`'s push run after it, and the red # ejects that entry: the context is in the required set again (below). # `main`'s 4-hourly `schedule` run, its `push` runs and an on-demand -# `workflow_dispatch` carry the FULL BATTERY: all of that plus the three jobs +# `workflow_dispatch` carry the FULL BATTERY: all of that plus the jobs # below that spell # # github.event_name != 'pull_request' && github.event_name != 'merge_group' # -# in their `if:` — `temporal-conformance`, `dogfood-verify` and -# `ui-published-artifacts`. Nothing is deleted: the jobs moved off the per-PR -# path, the last one never had one (#26717). A red in one of them is a main-red +# in their `if:` — `dogfood-verify` and `ui-published-artifacts` — and +# `temporal-conformance`, which since ruling record 7146156389 (#37095) +# also runs on a `merge_group` entry whose diff hits the filter's +# `temporal_live` paths (never on `pull_request`). It is NOT in the required +# set, so that queue run is advisory: a red does not eject the entry, it +# lands and shows on `main`. Nothing is deleted: the jobs moved off the per-PR +# path, `ui-published-artifacts` never had one (#26717). A red in one of them is a main-red # for the owning lane, and the publish lane reads the full battery before its # approval (release.yml's `full-battery` job, # `scripts/ci/scheduled-full-run.mjs --release-gate`). ⛔ No affected-only @@ -331,7 +335,7 @@ jobs: # # On merge_group the step RUNS (the diff is the queue base_sha against # the group head, see the step below), but only the three ui outputs - # read it. `docs`, `core` and `crosspkg` stay 'true' there through the + # and `temporal_live` (#37095) read it. `docs`, `core` and `crosspkg` stay 'true' there through the # `github.event_name != 'merge_group' &&` guard: the queue build is the # last validation before main, and those jobs run on every entry, as # they did before the step ran on this event. On any other event the @@ -340,12 +344,19 @@ jobs: docs: ${{ github.event_name != 'merge_group' && steps.changes.outputs.docs || 'true' }} # Read by `test-plan`, `test` (ORed with `crosspkg`) and `build-core`, # on merge_group / push / schedule by `dogfood`, and on push / schedule - # by `dogfood-verify` and `temporal-conformance` — see the `core` filter - # below and each job's `if:`. + # by `dogfood-verify` and `temporal-conformance` (which on merge_group + # reads `temporal_live` instead, #37095) — see the `core` filter below + # and each job's `if:`. core: ${{ github.event_name != 'merge_group' && steps.changes.outputs.core || 'true' }} # Gates the `test` job ONLY, ORed with `core` — see the `crosspkg` # filter below and the `test` job's `if:` (#9829, #10015). crosspkg: ${{ github.event_name != 'merge_group' && steps.changes.outputs.crosspkg || 'true' }} + # [#37095] Read by `temporal-conformance` on merge_group ONLY: the queue + # build runs that job when the merged diff touches the paths in the + # `temporal_live` filter below (ruling record 7146156389, which revises + # #22998 for this one job). Every other event ignores it. Fail-open like + # the ui outputs: a queue build whose step failed reads '' → 'true'. + temporal_live: ${{ steps.changes.outputs.temporal_live || 'true' }} # The objectui tree under `ui/` (objectstack#25677). Three outputs, read # together by the five `* UI` jobs at the bottom of this file (Type Check # UI, Test UI, Lint UI, Build & E2E UI and Live E2E UI): @@ -445,8 +456,10 @@ jobs: # THE FILTER CONTRACT's half 1 instead: the step is skipped, its outputs # are the empty string, `|| 'true'` fills them in, and everything runs. # - # `merge_group` joined the list for the ui outputs alone (#25867; the - # three core-side outputs above ignore the step on that event). Its + # `merge_group` joined the list for the ui outputs (#25867; the + # three core-side outputs above ignore the step on that event), and + # `temporal_live` reads it there too since ruling record 7146156389 + # (#37095: `temporal-conformance` runs on a queue entry that hits it). Its # `continue-on-error` is the fail-open half there: a queue build whose # base cannot be fetched reads as "run every ui job", never as a red # `filter` job. On pull_request and push a failure stays red, as before. @@ -770,6 +783,44 @@ jobs: - 'packages/lint/**' - 'packages/sdui-parser/**' - 'packages/types/**' + # [#37095] What makes the merge queue run `temporal-conformance` + # (ruling record 7146156389): the pgvector store, the driver whose + # whole suite that job runs against the live servers, the + # live-server files its filtered steps select (the two + # metadata-protocol globs spell that step's `live-mysql + # live-postgres` substrings), the service-analytics files whose + # live-PostgreSQL cells key on OS_TEST_POSTGRES_URL (#21564; no glob + # selects exactly these, so they are listed: a NEW such file must + # be added here by hand), and this file. + temporal_live: + - 'packages/plugins/knowledge-pgvector/**' + - 'packages/drivers/driver-sql/**' + - 'packages/metadata-protocol/src/**/*live-mysql*' + - 'packages/metadata-protocol/src/**/*live-postgres*' + - 'packages/runtime/src/**/cascade-delete-multivalue-lookup-real-driver*' + - 'packages/services/service-analytics/src/__tests__/analytics-faces-one-lowering.test.ts' + - 'packages/services/service-analytics/src/__tests__/cube-measure-field-type-door.test.ts' + - 'packages/services/service-analytics/src/__tests__/cube-measure-relationship-path-type.test.ts' + - 'packages/services/service-analytics/src/__tests__/dataset-duration-measure.test.ts' + - 'packages/services/service-analytics/src/__tests__/dataset-tools.test.ts' + - 'packages/services/service-analytics/src/__tests__/home-amount-consolidated-measure.test.ts' + - 'packages/services/service-analytics/src/__tests__/json-stored-door-live-drivers.test.ts' + - 'packages/services/service-analytics/src/__tests__/json-stored-door-undeclared-join.test.ts' + - 'packages/services/service-analytics/src/__tests__/list-at-scalar-operator-both-faces.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-aggregate-policies.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-base-column-qualify.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-boolean-comparand-door.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-empty-sum-order-window.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-measure-number-presentation.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-number-comparand-door.test.ts' + - 'packages/services/service-analytics/src/__tests__/native-sql-offset-only-window.test.ts' + - 'packages/services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts' + - 'packages/services/service-analytics/src/__tests__/objectql-echo-date-bucket.test.ts' + - 'packages/services/service-analytics/src/__tests__/objectql-echo-offset-only-window.test.ts' + - 'packages/services/service-analytics/src/__tests__/objectql-face-order-limit.test.ts' + - 'packages/services/service-analytics/src/__tests__/order-key-selected.test.ts' + - 'packages/services/service-analytics/src/__tests__/read-scope-temporal-coercion.test.ts' + - '.github/workflows/ci.yml' # ── WHICH TEST CORE SHARDS START (#26084) ───────────────────────────── # The `test` matrix used to be the literal 1..8, so every Test Core run @@ -2427,22 +2478,35 @@ jobs: name: Temporal Conformance (live PG + MySQL) needs: filter # See THE FILTER CONTRACT on the filter job's outputs (#4928). Full battery - # only: see THE TWO SPEEDS above `jobs:` (#22998). - if: ${{ !cancelled() && needs.filter.outputs.core != 'false' && github.event_name != 'pull_request' && github.event_name != 'merge_group' }} + # (see THE TWO SPEEDS above `jobs:`, #22998), plus the merge queue when the + # entry's diff hits the `temporal_live` paths ([#37095], ruling record + # 7146156389). Never on pull_request. + if: ${{ !cancelled() && needs.filter.outputs.core != 'false' && github.event_name != 'pull_request' && (github.event_name != 'merge_group' || needs.filter.outputs.temporal_live != 'false') }} runs-on: ubuntu-latest timeout-minutes: 30 permissions: contents: read # Both service images are pulled from mirror.gcr.io, Google's cache of - # Docker Hub: the same official image, tag and index digest. Pulled from + # Docker Hub: the same image, tag and index digest. Pulled from # Docker Hub directly they ride its anonymous per-IP quota, which shared # runner IPs exhaust, and `Initialize containers` then fails before any # step runs. A Docker Hub login is no fix: secrets never reach fork PRs # (#22541). services: postgres: - image: mirror.gcr.io/library/postgres:16 + # [#37095] pgvector's image, not the plain official one: it is + # `postgres:16` (same major, entrypoint, `pg_isready`, `psql`) with the + # `vector` extension built in, so the pgvector-backed knowledge store + # has a real server here. An EXACT tag (pgvector 0.8.7 on PG 16), not + # the moving `pg16`, AND its index digest (read 2026-11-24, the same on + # mirror.gcr.io and Docker Hub): with `tag@digest` Docker pulls by the + # digest, so a re-pushed tag cannot change the server under this job; + # a new pgvector release reaches it only by a reviewed edit of both. + # Pinned by `driver-sql`'s sql-driver-37095-pgvector-extension test, + # which the driver-sql step below runs: an image without the extension + # fails its CREATE EXTENSION. + image: mirror.gcr.io/pgvector/pgvector:0.8.7-pg16@sha256:484e838076e04939d27d3e176e91c86eea96236126023be8d3059761122e579f env: POSTGRES_PASSWORD: postgres ports: diff --git a/docs/agents/multi-agent-discipline.md b/docs/agents/multi-agent-discipline.md index dff6f19ee55..63d6f7a163c 100644 --- a/docs/agents/multi-agent-discipline.md +++ b/docs/agents/multi-agent-discipline.md @@ -134,8 +134,10 @@ A check outside those eleven is advisory and rides through, and an advisory red of wall per queue entry (median, 2026-11-05); `main`'s scheduled (4-hourly) and push runs carry the full battery — dogfood, e2e, `Temporal Conformance (live PG + MySQL)` — read by the publish lane before any approval. Queue runs also carry the three `Dogfood Regression Gate` shards (ruling record - 6663883327), so a dogfood red shows on the queue build; `Dogfood Verify CLI`, - Temporal Conformance and `UI Published Artifacts` stay full-battery only. The `Dogfood Regression + 6663883327), so a dogfood red shows on the queue build; `Dogfood Verify CLI` and + `UI Published Artifacts` stay full-battery only. One exception: Temporal Conformance also runs on a queue + entry whose diff hits `ci.yml`'s `temporal_live` paths (ruling record 7146156389); it is not a required + context, so that run is advisory and a red lands on `main`. The `Dogfood Regression Gate` context is in the required set again (ruling record 6669982756), so a dogfood red ejects the entry. **A push run borrows what the queue ran** (#31519). Every commit the queue lands was tested there on the same diff --git a/packages/drivers/driver-sql/src/sql-driver-37095-pgvector-extension.test.ts b/packages/drivers/driver-sql/src/sql-driver-37095-pgvector-extension.test.ts new file mode 100644 index 00000000000..c08cc39060e --- /dev/null +++ b/packages/drivers/driver-sql/src/sql-driver-37095-pgvector-extension.test.ts @@ -0,0 +1,107 @@ +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. + +/** + * [#37095] The live PostgreSQL this package is tested against ships the + * `vector` extension (pgvector). + * + * The `Temporal Conformance (live PG + MySQL)` CI job runs this whole suite + * against its postgres service, and that service is `pgvector/pgvector` (via + * `mirror.gcr.io`) rather than plain `postgres`, so the pgvector-backed + * knowledge store (#37100) has a real server to be tested on. This file is the + * pin on that provisioning: if the image ever goes back to one without the + * extension, `CREATE EXTENSION` fails here and the job turns red, instead of + * the store's live tests quietly becoming skips. + * + * It holds NO adapter code and asserts nothing about one: an extension install, + * one typed column, and the L2 distance operator ordering rows by it. + * + * ## The extension is database-wide; the table is this file's own + * + * An extension lives once per DATABASE, in one schema, and every live file in + * this package shares the database (each owns a schema, #9350). So the install + * is `IF NOT EXISTS` and is never dropped here (another file may be using it), + * and the type and operator are QUALIFIED with whatever schema the extension + * actually sits in — read back from `pg_extension`, not assumed to be ours — + * because a file that installed it first may have put it in its own schema, + * which is not on this session's `search_path`. (Measured: installed from here + * it lands in this file's schema, and the globalSetup's teardown — `drop + * schema … cascade` — takes it away with that schema, so each run installs it + * afresh.) + * + * ## Why this file is PG-only + * + * pgvector is a PostgreSQL extension; SQLite and MySQL have nothing to install. + * The cell list is exactly `pg`, declared through `declareDialectCell`, so an + * unprovisioned run (Test Core, a laptop without a server) is a NAMED skip and, + * under `OS_EXPECT_LIVE_DIALECT_MATRIX=1`, a named failure. + */ + +import { describe, it, expect, beforeAll, afterAll } from 'vitest'; +import { SqlDriver } from '../src/index.js'; +import { + PG_CELL, + currentLiveSchema, + declareDialectCell, + type DialectCell, +} from './live-dialect-matrix.testkit.js'; + +const MATRIX = 'pgvector extension'; + +const TABLE = 'os37095_embeddings'; + +function declarePgvectorSuite(cell: DialectCell): void { + describe(`pgvector extension — ${cell.label} (#37095)`, () => { + let driver: SqlDriver; + let here: string; + /** The schema the extension is installed in, quoted for SQL. */ + let ext: string; + + beforeAll(async () => { + here = currentLiveSchema(); + driver = new SqlDriver(cell.config()); + await driver.execute('create extension if not exists vector'); + const found: any = await driver.execute( + `select n.nspname as schema, e.extversion as version + from pg_extension e join pg_namespace n on n.oid = e.extnamespace + where e.extname = 'vector'`, + ); + expect(found.rows, 'CREATE EXTENSION returned but no `vector` row is in pg_extension').toHaveLength(1); + ext = `"${found.rows[0].schema}"`; + await driver.execute(`drop table if exists "${here}".${TABLE}`); + await driver.execute(`create table "${here}".${TABLE} (id integer primary key, embedding ${ext}.vector(3) not null)`); + await driver.execute( + `insert into "${here}".${TABLE} (id, embedding) values (1, '[1,0,0]'), (2, '[0,3,4]'), (3, '[1,1,0]')`, + ); + }); + + afterAll(async () => { + await driver?.execute(`drop table if exists "${here}".${TABLE}`).catch(() => {}); + await driver?.disconnect().catch(() => {}); + }); + + it('the server has the extension installed, with a version', async () => { + const r: any = await driver.execute(`select extversion from pg_extension where extname = 'vector'`); + expect(r.rows[0].extversion).toMatch(/^\d+\.\d+\.\d+$/); + }); + + it('orders rows by L2 distance to a query vector, and computes that distance', async () => { + const r: any = await driver.execute( + `select id, embedding OPERATOR(${ext}.<->) '[1,0,0]'::${ext}.vector as distance + from "${here}".${TABLE} + order by embedding OPERATOR(${ext}.<->) '[1,0,0]'::${ext}.vector + limit 2`, + ); + // Nearest first: the identical vector (0), then [1,1,0] (1). The far + // row [0,3,4] — sqrt(1 + 9 + 16) — is cut by the limit. + expect(r.rows.map((row: any) => row.id)).toEqual([1, 3]); + expect(r.rows.map((row: any) => Number(row.distance))).toEqual([0, 1]); + + const far: any = await driver.execute( + `select embedding OPERATOR(${ext}.<->) '[1,0,0]'::${ext}.vector as distance from "${here}".${TABLE} where id = 2`, + ); + expect(Number(far.rows[0].distance)).toBeCloseTo(Math.sqrt(26), 6); + }); + }); +} + +declareDialectCell(PG_CELL, MATRIX, declarePgvectorSuite);