Skip to content

test(knowledge-pgvector): the live PostgreSQL pin reads the runtime-composed mark beside the deployment store - #38523

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-38514-live-pg-knowledge-pin
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/issue-38514-live-pg-knowledge-pin

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #38514
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户无感:主干上必过的"真实 PostgreSQL 时间一致性"检查从上一次知识服务改动起一直是红的,本单把它修回绿。
  • 原因是上一单让运行时自动挂载的知识服务多带一个"由运行时组装"的标记(按知识库检索线的既定决定),而一条只在真实数据库任务里跑的测试还按旧的单一参数断言。
  • 修法只改这一条测试的期望值并写明原因,产品代码不动;出错也只影响测试本身,可直接撤回。
  • 没有跳过、删除或放宽任何用例;要你做的:无。

What changes

packages/plugins/knowledge-pgvector/src/__tests__/capability-mount.live-postgres.test.ts, one assertion: the knowledge service argument that resolveCapabilityArgument('knowledge', …) builds is now pinned as { deploymentAdapter: 'pgvector', runtimeComposed: { declared: false } }, with a comment saying why the argument carries the runtime-composed mark (ADR-0161 K8, the dated note on item 12) and why declared is false (this stack writes no requires: ['knowledge']).

No product code changes. Nothing in the package's shipped files[] changes, so this PR carries skip-changeset and no changeset (measured: after pnpm --filter @objectstack/knowledge-pgvector build, a test-only symbol has 0 hits across dist, README.md and CHANGELOG.md; the positive control KnowledgePgvectorPlugin hits 4 files in dist).

The reading

  • The extra key is the intended mark, not a leak. packages/core/src/capability-composition.ts returns runtimeComposed: { declared: stackDeclaredCapabilities(input.stack).includes('knowledge') } beside deploymentAdapter, and its doc comment names it as the "enabled by configuration" mark of ADR-0161 K8. The service reads it: KnowledgeServicePlugin (packages/services/service-knowledge/src/knowledge-service-plugin.ts) declares runtimeComposed?: { declared: boolean } and uses it for the reap-guard switch, enabledByConfiguration, the kernel:bootstrapped hold and the boot-line level. The core unit test packages/core/src/capability-composition.test.ts already pins the two-key shape.
  • With the mark, the service serves only when an embedder and the deployment's store are present. This test registers a fake embedder and mounts the pgvector store, so the two later cases of the block (the source bound to the marked store; passages land in the pgvector tables and search_knowledge returns them) still hold at the new shape, and they now actually run instead of being skipped behind the failed beforeAll.
  • Other pins of the one-key argument: none. Every other test that names resolveCapabilityArgument('knowledge', …) is in capability-composition.test.ts, already at the new shape; the remaining deploymentAdapter: '…' hits in tests are constructor options, not pins of the resolver's answer.

Tests

Live PostgreSQL (pgvector 0.6.0, a private cluster), whole live suite — 7 files / 91 tests passed

OS_TEST_POSTGRES_URL=… OS_EXPECT_LIVE_DIALECT_MATRIX=1 pnpm --filter @objectstack/knowledge-pgvector exec vitest run --maxWorkers=2 live-postgres at 4055713:

 Test Files  7 passed (7)
      Tests  91 passed (91)
os-verify-lock: VERDICT command-exit 0
The red, reproduced at the base, and green at the head — capability-mount file alone

Head (4055713): Test Files 1 passed (1), Tests 4 passed (4).

Base file restored (dccf836), same live database:

 FAIL  src/__tests__/capability-mount.live-postgres.test.ts > a knowledge_source with no adapter and no requires — mounted by the item, bound to the marked store
AssertionError: expected { deploymentAdapter: 'pgvector', …(1) } to deeply equal { deploymentAdapter: 'pgvector' }
 Test Files  1 failed (1)
      Tests  2 passed | 2 skipped (4)

That is the exact signature on the failing main runs.

Non-live suite and typecheck

pnpm --filter @objectstack/knowledge-pgvector test: Test Files 4 passed | 7 skipped (11), Tests 19 passed | 91 skipped (110) (the skipped are the live files, no URL set).
pnpm --filter @objectstack/knowledge-pgvector typecheck: exit 0, check:test-typecheck: OK.

Verification

Two-minute check: with a pgvector PostgreSQL at OS_TEST_POSTGRES_URL, run pnpm --filter @objectstack/knowledge-pgvector exec vitest run capability-mount; expect 4 passed.

CI evidence line: the Temporal Conformance (live PG + MySQL) job is never on pull_request (its if: in .github/workflows/ci.yml excludes pull_request), so this PR's own checks publish it as skipped. It runs in the merge queue, because this path matches the temporal_live filter (packages/plugins/knowledge-pgvector/**), and on the main push after landing; the card closes on a green main push that runs the job.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb

…omposed mark beside the deployment's store

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oQLfL8thb6wtUHnTb
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 5684ee878e14fb0e8038c3218f76371490f064e9 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nNJM8FQkBco82NDFb

席位核对 — L1 ACCEPT · head 4055713 · 2026-11-29T07:37Z

Verdict: ACCEPT at 4055713e11 (p0: main is red on a required context).

When I read the head it had 33 success, 0 failed and 5 still pending. This ACCEPT is on the diff. The area enqueues only once every check at this head has finished green, as the landing rule already requires.

The PR is one test file, +6/−1, Tier S, not governed. Declarations are Clause-②: no · Metadata-protocol: none, and it carries skip-changeset. Its premise holds: it touches test code only, nothing in the package's files[] changes, and the body measures 0 dist hits with a positive control.

The assertion is the intended shape, not a loosened one.

  • On main, packages/core/src/capability-composition.ts:309 returns runtimeComposed: { declared: stackDeclaredCapabilities(input.stack).includes('knowledge') } beside deploymentAdapter. Its docblock (:259-265) names it the runtime-composed mark.
  • capability-composition.test.ts:362-384 already pins the two-key shape, with { declared: false } for a stack that writes no requires.
  • This test's stack writes no requires: ['knowledge'], so declared: false is the exact value.
  • It is still toEqual on the whole argument. No case is skipped or deleted, and the expectation is not widened beyond the one key the composition adds.
  • The comment says why, citing ADR-0161 K8, the dated note on item 12.

It is the red the card records. #38514 quotes AssertionError: expected { deploymentAdapter: 'pgvector', …(1) } to deeply equal { deploymentAdapter: 'pgvector' } from capability-mount.live-postgres.test.ts, on every main push since 91fc3980 (#38470). On main, a git grep finds no other pin of resolveCapabilityArgument('knowledge', …) outside the core test, which is already at the new shape.

Fixes and the card's close condition. The card says "Close this card when a main push that runs the job is green". Fixes closes it at merge. That is acceptable here: ci.yml runs Temporal Conformance (live PG + MySQL) on a merge_group entry whose diff hits the temporal_live filter, and that filter lists packages/plugins/knowledge-pgvector/**. So the merge itself is gated on the live job going green on this change. The PR's own CI cannot run that job (it never runs on pull_request), so the body's live readings are the only pre-queue evidence: 7 files, 91/91 on PG16 with pgvector, and the base red reproduced. The area should still glance at the first main push run after the merge.

Landing (area, Tier S, ahead of the queue as p0): Fixes, so #38514 closes on merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5oQLfL8thb6wtUHnTb

Landing: head 4055713 · L1-a ACCEPT 7252588855 · Clause-②: no, Metadata-protocol: none, skip-changeset (test-only), no contract review owed · CI on this head: every check run success or expected skip, none failed · check-governed-merges --pr 38523: NOT governed. p0 main-red fix (#38514), landed by the area on the seat's order. The PR cannot run Temporal Conformance (live PG + MySQL) (never on pull_request); the merge-queue entry runs it through the temporal_live filter (packages/plugins/knowledge-pgvector/**), and the area reads the first main push run after the merge. Root-cause follow-up: #38528 (the filter misses the sources the live pins import).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 29, 2026 07:52
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 430a311 Nov 29, 2026
61 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-38514-live-pg-knowledge-pin branch November 29, 2026 08:13
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…closure gate (objectstack-ai#38560)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_

Fixes objectstack-ai#38528

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 用户能看到什么变化:用户无感;合并队列里,凡是改到实时数据库测试实际依赖的源码的条目,都会先跑实时数据库一致性检查,再进主干。
- 为什么做:修掉主干变红的根因(实时数据库测试的触发名单只列了测试本身,没列它们加载的源码,一次改动因此绕过检查合入,主干随即变红)。
-
出错会怎样:最坏是队列多跑一个约十分钟、与其它检查并行的作业(近三百个条目里约三成会触发,原来约百分之六);新守卫若误报只会让检查线变红,整个改动可直接撤回。
- 要你做的:审批(本改动触及受治理的流水线文件,须你批准后由席位落地)。

## The measured closure, row by row

`node scripts/check-temporal-live-filter.mjs --list` at the PR head. The
population is read out of the `temporal-conformance` job: every step
that hands a test run `OS_TEST_POSTGRES_URL` / `OS_TEST_MYSQL_URL`
(positional-selected files are live; in a whole-suite step a test is
live when its own closure reads one of those URLs), plus every
`*live-postgres*` / `*live-mysql*` test. 164 live tests: 125 driver-sql
matrix files, 22 service-analytics files, 9 metadata-protocol files, 7
knowledge-pgvector files, 1 runtime file. The derivation reproduces the
22 service-analytics files the list used to name by hand, exactly.

The closure is every file vitest loads for those tests: the test
package's real `resolve.alias` (loaded from its `vitest.config.*`),
`dist/` imports followed to the `src/` the job's build steps compile,
relative imports, the config itself and its `setupFiles` /
`globalSetup`. "Example test" names one live test that loads a file
under the row, and the file it loads.

| Row | New? | Closure files | Live tests loading it | Example test
(file it loads) |
|:--|:--|--:|--:|:--|
| `packages/plugins/knowledge-pgvector/**` | kept | 13 | 7 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`)
|
| `packages/drivers/driver-sql/**` | kept | 188 | 150 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`drivers/driver-sql/src/index.ts`) |
|
`packages/runtime/src/**/cascade-delete-multivalue-lookup-real-driver*`
| kept | 1 | 1 |
`runtime/src/cascade-delete-multivalue-lookup-real-driver.integration.test.ts`
(`runtime/src/cascade-delete-multivalue-lookup-real-driver.integration.test.ts`)
|
| `packages/services/service-knowledge/src/**` | new | 20 | 7 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`services/service-knowledge/src/index.ts`) |
| `packages/metadata-protocol/src/**` | new | 165 | 34 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`)
|
| `packages/metadata-protocol/package.json` | new | 1 | 25 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`metadata-protocol/package.json`) |
| `packages/services/service-analytics/src/**` | new | 74 | 22 |
`services/service-analytics/src/__tests__/analytics-faces-one-lowering.test.ts`
(`services/service-analytics/src/__tests__/analytics-faces-one-lowering.test.ts`)
|
| `packages/core/src/**` | new | 137 | 154 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`core/src/index.ts`) |
| `packages/objectql/src/**` | new | 188 | 25 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`objectql/src/index.ts`) |
| `packages/types/src/**` | new | 37 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`types/src/index.ts`) |
| `packages/formula/src/**` | new | 26 | 26 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`formula/src/index.ts`) |
| `packages/metadata/src/**` | new | 35 | 26 |
`metadata-protocol/src/migrations/identity-index.live-postgres.test.ts`
(`metadata/src/errors.ts`) |
| `packages/metadata-core/src/**` | new | 41 | 155 |
`metadata-protocol/src/migrations/identity-index.live-postgres.test.ts`
(`metadata-core/src/index.ts`) |
| `packages/metadata-fs/src/**` | new | 6 | 25 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`metadata-fs/src/index.ts`) |
| `packages/lint/src/**` | new | 170 | 25 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`lint/src/runtime.ts`) |
| `packages/sdui-parser/src/**` | new | 10 | 25 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`sdui-parser/src/index.ts`) |
| `packages/observability/src/**` | new | 8 | 149 |
`plugins/knowledge-pgvector/src/__tests__/reconcile-purge.live-postgres.test.ts`
(`observability/src/index.ts`) |
| `packages/services/service-settings/src/**` | new | 47 | 6 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`services/service-settings/src/index.ts`) |
| `packages/plugins/embedder-openai/src/**` | new | 1 | 6 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`plugins/embedder-openai/src/index.ts`) |
| `packages/platform-objects/src/system/**` | new | 20 | 6 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`platform-objects/src/system/index.ts`) |
| `packages/drivers/driver-sqlite-wasm/src/**` | new | 5 | 1 |
`services/service-analytics/src/__tests__/objectql-echo-bucket-enumeration.test.ts`
(`drivers/driver-sqlite-wasm/src/index.ts`) |
| `packages/spec/src/*.ts` | new | 3 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/stack.zod.ts`) |
| `packages/spec/src/ai/**` | new | 25 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/ai/object-query-source.zod.ts`) |
| `packages/spec/src/api/**` | new | 39 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/api/index.ts`) |
| `packages/spec/src/automation/**` | new | 34 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/automation/node-executor.zod.ts`) |
| `packages/spec/src/contracts/**` | new | 57 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/contracts/rls-membership-resolver.ts`) |
| `packages/spec/src/conversions/**` | new | 132 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/conversions/walk.ts`) |
| `packages/spec/src/data/**` | new | 126 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/data/index.ts`) |
| `packages/spec/src/identity/**` | new | 13 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/identity/identity-assignment-body-writes.ts`) |
| `packages/spec/src/integration/**` | new | 3 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/integration/connector.zod.ts`) |
| `packages/spec/src/kernel/**` | new | 49 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/kernel/metadata-protection.zod.ts`) |
| `packages/spec/src/marketplace/**` | new | 3 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/marketplace/marketplace.zod.ts`) |
| `packages/spec/src/meta-spelling/**` | new | 4 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/meta-spelling/metadata-url-spelling.ts`) |
| `packages/spec/src/qa/**` | new | 2 | 154 |
`plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts`
(`spec/src/qa/index.ts`) |
| `packages/spec/src/security/**` | new | 13 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/security/index.ts`) |
| `packages/spec/src/shared/**` | new | 42 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/shared/refusal-head.ts`) |
| `packages/spec/src/system/**` | new | 57 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/system/index.ts`) |
| `packages/spec/src/ui/**` | new | 53 | 162 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`spec/src/ui/view.zod.ts`) |
| `packages/spec/package.json` | new | 1 | 155 |
`metadata-protocol/src/migrations/identity-index.live-postgres.test.ts`
(`spec/package.json`) |
| `packages/metadata-protocol/vitest.config.ts` | new | 1 | 9 |
`metadata-protocol/src/migrations/connector-connection-packageless-index.live-mysql.test.ts`
(`metadata-protocol/vitest.config.ts`) |
| `packages/runtime/vitest.config.ts` | new | 1 | 1 |
`runtime/src/cascade-delete-multivalue-lookup-real-driver.integration.test.ts`
(`runtime/vitest.config.ts`) |
| `packages/services/service-analytics/vitest.config.ts` | new | 1 | 22
|
`services/service-analytics/src/__tests__/analytics-faces-one-lowering.test.ts`
(`services/service-analytics/vitest.config.ts`) |
| `packages/qa/vitest-filter-preflight/src/**` | new | 2 | 1 |
`runtime/src/cascade-delete-multivalue-lookup-real-driver.integration.test.ts`
(`qa/vitest-filter-preflight/src/index.ts`) |
| `packages/runtime/src/expected-read-refusal-noise.ts` | new | 1 | 1 |
`runtime/src/cascade-delete-multivalue-lookup-real-driver.integration.test.ts`
(`runtime/src/expected-read-refusal-noise.ts`) |
| `scripts/vitest-memory-tmp.mjs` | new | 1 | 126 |
`drivers/driver-sql/src/live-dialect-matrix.budget.test.ts`
(`scripts/vitest-memory-tmp.mjs`) |
| `scripts/js-comment-mask.mjs` | new | 1 | 1 |
`drivers/driver-sql/src/live-dialect-matrix.isolation.test.ts`
(`scripts/js-comment-mask.mjs`) |
| `scripts/invoked-as.mjs` | new | 1 | 1 |
`drivers/driver-sql/src/live-dialect-matrix.isolation.test.ts`
(`scripts/invoked-as.mjs`) |
| `scripts/check-temporal-live-filter.mjs` | new | 0 | 0 | not a closure
file (the list's own trigger) |
| `.github/workflows/ci.yml` | kept | 0 | 0 | not a closure file (the
list's own trigger) |

Totals: 164 live tests, 1858 closure files, 49 rows; removed rows: 25

Why each grain:

- **A package's `src/**`** where the closure enters through the package
barrel. The barrel re-exports nearly every module (core 137 of 143
non-test modules, objectql 188 of 194, lint 170 of 171,
metadata-protocol 155 of 163), so a file-by-file list would go red on
the next re-export. These rows are narrower than `packages/PKG/**`:
manifests, configs, scripts and docs outside `src/` do not trigger the
job.
- **`packages/spec/src/` per namespace, not `src/**`.**
`src/migrations/` (1,270 of 1,947 non-test modules, the conversion kits)
and `src/studio/` are in no closure. The 16 namespace directories the
barrel reaches are listed, plus `src/*.ts` for the barrel and its root
modules.
- **A narrower directory** where a test reaches one corner of a package:
`platform-objects/src/system/**`, the 20 objects
`KnowledgeServicePlugin` registers.
- **A literal path** for a single file: the three vitest configs outside
a `src/**` row, `spec/package.json` and `metadata-protocol/package.json`
(imported as JSON), `runtime/src/expected-read-refusal-noise.ts`, and
the three root scripts the configs and driver-sql's isolation test
import.
- **Removed rows (25), each now covered by a wider row:**
`service-knowledge/src/testing.ts` (by `service-knowledge/src/**`), the
two `metadata-protocol/src/**/*live-*` globs (by
`metadata-protocol/src/**`), and the 22 per-file service-analytics rows
(by `service-analytics/src/**`). That also retires the "a NEW such file
must be added here by hand" step those rows carried.

Other live-tier filters: no other filter in `ci.yml` schedules a
live-server job. The `ui` group's reads below its "UI TEST READS OUTSIDE
ui/" heading are already held both ways by `check:ci-filter-parity`. The
guard covers `temporal_live` only.

## Dry run (dorny/paths-filter semantics)

picomatch 4.0.7 (from the workspace store) with `{ dot: true }`, the
options `dorny/paths-filter@v4` uses. A file matches when any row
matches. The rows were parsed out of `ci.yml` at each ref.

```text
0af813f   NO MATCH packages/core/src/capability-composition.ts
0af813f   NO MATCH packages/services/service-knowledge/src/knowledge-service-plugin.ts
0af813f   NO MATCH packages/metadata-protocol/src/migrations/seed-tenancy-backfill.ts
0af813f   NO MATCH packages/spec/src/data/field.zod.ts
0af813f   NO MATCH packages/runtime/src/route-ledger.ts
0af813f   NO MATCH packages/spec/src/migrations/registry.ts
0af813f   NO MATCH README.md
ac3dc22   MATCH    packages/core/src/capability-composition.ts
ac3dc22   MATCH    packages/services/service-knowledge/src/knowledge-service-plugin.ts
ac3dc22   MATCH    packages/metadata-protocol/src/migrations/seed-tenancy-backfill.ts
ac3dc22   MATCH    packages/spec/src/data/field.zod.ts
ac3dc22   NO MATCH packages/runtime/src/route-ledger.ts
ac3dc22   NO MATCH packages/spec/src/migrations/registry.ts
ac3dc22   NO MATCH README.md
```

Cross-check of the gate's own matcher against picomatch, over every
tracked file: all 28,936 tracked files at the head; picomatch matches
5,072 of them; the gate's literal / `*` / `**` matcher agrees on 28,936
of 28,936, 0 disagreements. Any row syntax outside that subset is
refused by the gate, never guessed.

## Ablation

The fix was committed first. One new row was deleted on disk at a time,
the gate was run, and the file was restored with `git checkout HEAD --`.

```text
$ (head ac3dc22, row 'packages/core/src/**' deleted on disk: 0+/1-) node scripts/check-temporal-live-filter.mjs
✗ check-temporal-live-filter: 137 workspace file(s) a live test loads are on no `temporal_live` row (164 live test(s), 1858 closure file(s)):
  packages/core/src/capability-composition.ts
      loaded by 154 test(s), e.g. packages/drivers/driver-sql/src/live-dialect-matrix.budget.test.ts -> packages/drivers/driver-sql/src/index.ts -> packages/drivers/driver-sql/src/sql-driver.ts -> packages/core/src/index.ts -> packages/core/src/capability-composition.ts
exit 1

$ (head ac3dc22, row 'packages/services/service-knowledge/src/**' deleted on disk: 0+/1-) node scripts/check-temporal-live-filter.mjs
✗ check-temporal-live-filter: 20 workspace file(s) a live test loads are on no `temporal_live` row (164 live test(s), 1858 closure file(s)):
  packages/services/service-knowledge/src/knowledge-service-plugin.ts
      loaded by 6 test(s), e.g. packages/plugins/knowledge-pgvector/src/__tests__/acceptance.live-postgres.test.ts -> packages/services/service-knowledge/src/index.ts -> packages/services/service-knowledge/src/knowledge-service-plugin.ts
--
  packages/services/service-knowledge/src/testing.ts
      loaded by 1 test(s), e.g. packages/plugins/knowledge-pgvector/src/__tests__/contract.live-postgres.test.ts -> packages/services/service-knowledge/src/testing.ts
exit 1

$ (restored with git checkout HEAD --) node scripts/check-temporal-live-filter.mjs
✓ check-temporal-live-filter: every workspace file the 164 live test(s) load (1858 file(s)) is on a `temporal_live` row of .github/workflows/ci.yml (49 row(s)).
exit 0
```

## What changes

- `.github/workflows/ci.yml`, in three places:
- The `temporal_live` filter gains the rows above, the subsumed rows go,
and the comment above the list says what the list must cover and which
gate holds it.
- Build Core gains one step before the build: `node
scripts/check-temporal-live-filter.mjs --self-test && node
scripts/check-temporal-live-filter.mjs`.
- A `core` row for the gate starts Build Core on a change to the gate
itself, which is what `check:ci-filter-parity` requires of a script
Build Core runs.
  No other job, step or `if:` changes.
- `scripts/check-temporal-live-filter.mjs` (new): the guard. It walks
each live test's run-time import closure the way vitest resolves it. It
goes red on any closure file that no `temporal_live` row matches, and
names the import chain. `--list` prints each closure and the row that
covers each file. `--match PATH...` answers whether a path schedules the
job. `--self-test` runs 7 named batteries with pinned floors and the
verdict handshake (AGENTS.md "Writing a `--self-test`"); battery 7 pins
the Build Core step and the `core` row. The gate refuses, never passes
clean, when its subject was not read. Its header has the full list of
refusals and the bounds.

Why Build Core and not a `Lint · *` lane: the claim's file surface was
narrowed to `ci.yml` and the guard. The house pattern (a root `check:*`
alias plus a `lint.yml` step, like `check:ci-filter-parity`) needs two
files outside that surface, so it is not used here. Build Core is in the
required set. It starts on every diff that can move a closure or the
list (`packages/**`, `ci.yml`, the gate itself). It installs the
workspace the gate needs to load vitest configs. Moving the step to a
lint lane later is a two-file follow-up; Acceptance notes has the
details.

## Why

`Temporal Conformance (live PG + MySQL)` never runs on `pull_request`.
On a `merge_group` entry it runs only when the diff matches
`temporal_live`. The list named the live test files but not the sources
they load from other packages. An entry that changed only
`packages/core/src/capability-composition.ts` skipped the job in the
queue, landed, and turned `main` red.

## Tests

All readings at head `ac3dc229a4` unless stated otherwise.

- `node scripts/check-temporal-live-filter.mjs --self-test`: exit 0, `✓
check-temporal-live-filter self-test: 59 case(s) across 7 batteries
hold.` The batteries cover the matcher (including refused syntax),
reading `ci.yml` (rows, live steps, 10 refusals), edges (parser rather
than regex: `import type` erased, strings and comments ignored, dynamic
import and `require`), resolution (alias first-match, prefix and RegExp,
`dist/` to `src/`, refusal on an unresolved target), the verdict over a
fixture tree, the real tree, and the wiring.
- `node scripts/check-temporal-live-filter.mjs`: exit 0, `✓ ... every
workspace file the 164 live test(s) load (1858 file(s)) is on a
temporal_live row ... (49 row(s)).`
- The same judge run against the base list (the 29 `temporal_live` rows
of `0af813f301`, read in memory over this tree): 1,623 of 1,858 closure
files are on no row, over the same 164 live tests.
`packages/core/src/capability-composition.ts` is among them, by the
chain
`knowledge-pgvector/src/__tests__/capability-mount.live-postgres.test.ts
-> core/src/index.ts -> core/src/capability-composition.ts`. That is the
main-red skip.
- Ablation (above): deleting `packages/core/src/**` reds the gate on 137
files including `capability-composition.ts`. Deleting
`packages/services/service-knowledge/src/**` reds it on 20 files
including `knowledge-service-plugin.ts` and `testing.ts`. Restored:
green.
- Self-test ablation, at `fc5b37fd97`: with `packages/core/src/**`
deleted, the self-test also goes red on `✗ a change to
packages/core/src/capability-composition.ts alone matches a
temporal_live row`.
- Matcher cross-check against picomatch 4.0.7: 0 disagreements over
28,936 tracked files (above).

## Acceptance notes

- **Queue cost (advisory, not a gate).** Over the last 300 first-parent
commits of `main` ending at `0af813f301` (2026-11-27 to 2026-11-29),
picomatch 4.0.7: the old list matched 18 (6.0%), the new list matches
109 (36.3%). The job's duration does not change: one sample is 467 s on
queue run 46233875645 and another is 684 s on main push run 46233316717.
The job runs in parallel with the rest of the queue build. The queue
baseline in `scripts/ci/queue-budget.json` is p50 21.7 min. The queue's
before/after median is NOT MEASURED: it needs a week of queue runs after
the merge, which `queue-duration-budget.yml` reads weekly.
- **Ruling it widens.** Ruling record 7146156389 accepted the queue leg
on path hits for the knowledge-pgvector package,
`packages/drivers/driver-sql`, the job's own test files and the
workflow, and 7238262118 read that other PRs skip it. This head adds
source rows for 16 more packages, so the maintainer's word on the reach
is asked at hand-off. Contract review 7254558729 ③ 3 measured 298
`merge_group` runs. Temporal Conformance is required and was never the
last-finishing required check. In the 16 runs where it ran, it finished
389–1,336 s before the slowest other required job. Of the 116 entries
the new list matches (38.9%), the 99 with a successful run had their
slowest other required job finish at 1,086 s or later, against its
observed maximum of 826 s. The cost is runner time (about 100 more runs
of about 10 min per 298 entries) and exposure (a red in this job now
ejects about 39% of entries, not 5%).
- **Build Core cost (advisory).** One step is added: the self-test, then
the gate. It took 58 s wall locally on a shared 4-vCPU box at load
average about 2; the closure walk runs twice, once in the self-test's
real-tree battery and once in the gate. It needs no `dist/`.
- **Wiring placement, and the follow-up.** The house pattern for a
repository gate is a root `check:*` alias plus a step in a `Lint · *`
lane of `lint.yml`, as `check:ci-filter-parity` is wired. Both files are
outside this PR's file surface. Without CI wiring,
`check:self-test-wired` (part of `Lint & Repo Gates`) goes red on this
script (`[self-test-not-run] scripts/check-temporal-live-filter.mjs`,
measured on this branch). The step therefore lives in Build Core, which
`ci.yml` owns. Moving it to a lint lane is a two-file follow-up
(`package.json` alias, `lint.yml` step), with battery 7 re-pointed in
the same edit.
- **Over-scheduling, the accepted direction.** A `src/**` row also
matches that package's own test files, so a test-only edit in `core/src`
now starts the live job in the queue. The `spec` namespace rows keep
`src/migrations/` and `src/studio/` out. If a live test starts importing
either, the gate goes red and names the file.
- **Guard bounds** (header of the script): it reads module loads only,
so a file a test reads with `readFileSync` is not counted (that axis is
`check:cross-package-test-inputs`'). A non-literal `import()` is not
followed. Third-party code is not followed. It never reports a row as
too wide.
- **Not in this PR.**
`packages/metadata-protocol/src/migrations/activation-ledger-packageless-index.live-dialects.test.ts`
reads both live URLs, but its name carries neither `live-mysql` nor
`live-postgres`. So the metadata-protocol live step (`vitest run
live-mysql live-postgres`) never selects it, and its live cells are
named skips everywhere in CI. Not changed here. Carrier: objectstack-ai#38561 (filed
by the area at the seat's request, on `pm:queue`, not claimed).
- **Carried, contract review nits N1 and N3** (build inputs of closure
packages on no row; a live step that selects no test is dropped
silently): objectstack-ai#38570, on `pm:queue`, not claimed.
- **The objectstack-ai#38514 pin** (PR objectstack-ai#38523) has landed on `main` and is merged into
this branch. This PR does not touch it.

## Verification

Read first, by risk:
1. `.github/workflows/ci.yml`, the `temporal_live` block: the hunk that
changes what the merge queue runs.
2. `scripts/check-temporal-live-filter.mjs`, `liveStepsOf` /
`candidatesOf`: the population is derived from the job's steps. A
misread there narrows what the guard judges.
3. `scripts/check-temporal-live-filter.mjs`, `closureOf` /
`workspaceSource`: the resolution rules.

Two-minute check: `node scripts/check-temporal-live-filter.mjs --match
packages/core/src/capability-composition.ts` prints `MATCH`, names the
row `packages/core/src/**`, and exits 0. Then delete that row and run
`node scripts/check-temporal-live-filter.mjs`: it exits 1 and names
`capability-composition.ts` with its import chain.

Gates, local subset at head `ac3dc229a4`:

- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 66 families from this tree.
- All 66 ran in one hold of the verify lock: `VERDICT command-exit 0 ·
held the lock 1801s`. Each exit code was captured before any pipe.
- `--ran`: `Run reconciliation — 66 derived, 66 run, 0 NOT-MEASURED, 0
UNRUN.`
- `check:nul-bytes`: OK.
- An earlier round on `2092fb3793` went red on three families:
`check:parse-guard` (a raw `ts.createSourceFile`),
`check:pnpm-filter-targets` (fixture `--filter` names that are not
workspace packages) and `bare-root-worklist --self-test` (an undeclared
bare population root). All three were fixed in `e0de164758` and are
green above.
- The repo-wide `pnpm lint`, Test Core and the rest of the CI battery
belong to CI; their check-runs were not available when this body was
written (NOT MEASURED).

<details><summary>The 66 commands and their exit codes</summary>

```text
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs :: exit 0
node scripts/check-declaration-mirrors.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-self-test-wired.mjs :: exit 0
node scripts/check-self-test-wired.mjs --self-test :: exit 0
node scripts/check-self-test-workflow-commands.mjs :: exit 0
node scripts/check-self-test-workflow-commands.mjs --self-test :: exit 0
node scripts/check-step-collectors.mjs :: exit 0
node scripts/check-step-collectors.mjs --self-test :: exit 0
node scripts/check-temporal-live-filter.mjs :: exit 0
node scripts/check-temporal-live-filter.mjs --self-test :: exit 0
node scripts/check-whole-set-label-write.mjs :: exit 0
node scripts/check-whole-set-label-write.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/scheduled-full-run.mjs --self-test :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/bare-root-worklist.mjs --self-test :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:agent-test-spelling :: exit 0
pnpm check:aggregator-roster :: exit 0
pnpm check:bash32-floor :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:declared-population-live :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:entry-guard :: exit 0
pnpm check:fetch-history :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:node-version :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:parse-guard :: exit 0
pnpm check:pm-close-cards :: exit 0
pnpm check:pm-expected-skips :: exit 0
pnpm check:pm-fleet-write-dispatch :: exit 0
pnpm check:pm-fleet-write-execute :: exit 0
pnpm check:pm-fleet-write-validate :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-issue-transfer :: exit 0
pnpm check:pm-post-stamped :: exit 0
pnpm check:pm-record-recognisers :: exit 0
pnpm check:pnpm-acquisition :: exit 0
pnpm check:pnpm-filter-targets :: exit 0
pnpm check:pnpm-flag-spellings :: exit 0
pnpm check:ratchet-remedy-authority :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:required-contexts :: exit 0
pnpm check:scripts-symbol-anchors :: exit 0
pnpm check:shard-attestation :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:stall-guard-budget :: exit 0
pnpm check:stall-guard-headroom :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:workflow-status-functions :: exit 0
pnpm check:workflow-step-name-quoting :: exit 0
pnpm check:pm-dispatch-gates :: exit 0
```

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(No spec change.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (CI-owned run.)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset. (Publishes
nothing: `skip-changeset`.)
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (Not touched.)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn)_

<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main red: Temporal Conformance (live PG + MySQL) fails capability-mount.live-postgres.test.ts since #38470

2 participants