Skip to content

Commit 8c46a17

Browse files
committed
fix(spec,qa): repoint the anchors engine.ts lost to the find/findOne move
engine.ts no longer imports planFormulaProjection, ENGINE_QUERY_SLOTS or applyFormulaPlan, so the query.fields and query.top liveness rows and the api-backend checklist item cite their declarations in engine-top-level.ts, and the alias fold its new call site in engine-find.ts. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2fL8RrJDkowuFhXUPG
1 parent df1ae02 commit 8c46a17

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎.changeset/30020-objectql-find-findone-facet.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
'@objectstack/objectql': patch
3+
'@objectstack/spec': patch
34
---
45

56
refactor(objectql): the `ObjectQL#find` and `ObjectQL#findOne` bodies move into the find facet
@@ -9,3 +10,4 @@ Metadata-protocol: none
910

1011
- The bodies of `find` and `findOne` move out of `engine.ts` into `engine-find.ts`, the facet that already holds their read helpers. Each method stays on the class as a one-call stub with its signature and its docblock. Where a body handed the engine itself on (`ql: this` in the before/after hook context), it reads the same engine through the host's `facade` entry.
1112
- No behaviour changes and nothing to do on upgrade. The built declaration files keep every member and every docblock; the source maps move.
13+
- The `query.fields` and `query.top` liveness rows in `@objectstack/spec` now cite `engine-top-level.ts`, where `planFormulaProjection` and `ENGINE_QUERY_SLOTS` are declared, and `engine-find.ts`, where the `find` / `findOne` bodies fold the `top` alias, since `engine.ts` no longer imports those names; the evidence they cite is unchanged.

‎docs/qa/platform-checklist/areas/api-backend.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@
22642264
"packages/formula/src/stdlib.ts#registerStdLib (registerStdLib — the 29 chained registerFunction calls, isoDate / isoDatetime since #22347, plus label(), the macro bindOptionLabel registers (#26608): 30 bare-callable; the receiver methods `can` and `hasCapability`, from bindPermissionPredicate and bindCapabilityPredicate, are outside the count; calendarDayUtc ADR-0053 D1; addMonthsUtc clamp; the floor/ceil #3306 note), (registerNumericCoercions #1928)",
22652265
"packages/formula/src/validate.ts#CEL_STDLIB_FUNCTIONS (the advertised bare-callable list; its docblock tallies the 30 registerStdLib adds and why a receiver-only name such as `can` is never in it)",
22662266
"packages/lint/src/authoring-rules.ts#EXPRESSION_INVALID (the expression-invalid rule the object save door now dispatches on a formula field, #22031) + packages/metadata-protocol/src/protocol.runtime-authoring-gate.test.ts (the #22019 block: sqrt(record.amount) refused 422 INVALID_METADATA on an active save and on a draft's promotion, nothing lands) + packages/lint/src/runtime-gate.object-formula-writes.test.ts + packages/objectql/src/engine-formula-fault-log.test.ts (the read-path residual: a pre-gate row still reads null, one warn line per object and field)",
2267-
"packages/objectql/src/engine.ts#applyFormulaPlan (applyFormulaPlan — evaluate-fault → null, the silent-null contract; the evaluateFormulaField docblock states the compile-throws vs evaluate-nulls split)",
2267+
"packages/objectql/src/engine-top-level.ts#applyFormulaPlan (applyFormulaPlan — evaluate-fault → null, the silent-null contract; the evaluateFormulaField docblock states the compile-throws vs evaluate-nulls split)",
22682268
"content/docs/data-modeling/formulas.mdx (the advertised catalog the matrix cross-checks)",
22692269
"examples/app-showcase/src/data/objects/field-zoo.object.ts + project.object.ts (the stock live-leg formulas)",
22702270
"ADR-0053 Phase 2 D1 (calendar-day timezone contract)",

‎packages/spec/liveness/query.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"fields": {
1212
"status": "live",
1313
"verifiedAt": "2026-08-28",
14-
"evidence": "packages/drivers/driver-sql/src/sql-driver.ts#findRows (`builder.select(query.fields.map(...))`, else `select('*')`, with the unknown-column ladder that retries all-columns rather than answering an empty page); packages/objectql/src/engine.ts#planFormulaProjection (rewrites `ast.fields` to drop virtual formula fields before the driver sees them, and adds back the stored fields they read)",
15-
"note": "2026-08-28: RE-ANCHORED (commit 8cb96ec41) and REPOINTED — `sql-driver.ts:1353-1354` had rotted onto `) as Error & { code?: string; status?: number };` inside an error-constructor helper, ~4,200 lines above the projection. sql-driver.ts is 16,289 lines; the whole find path moved into `findRows` under a citation nothing re-read. The `driver-memory projectFields` / `objectql formula projection` halves were prose with no path at all and are now a repo-rooted anchor on the formula side. Re-closed by hand against 93ea19bca."
14+
"evidence": "packages/drivers/driver-sql/src/sql-driver.ts#findRows (`builder.select(query.fields.map(...))`, else `select('*')`, with the unknown-column ladder that retries all-columns rather than answering an empty page); packages/objectql/src/engine-top-level.ts#planFormulaProjection (rewrites `ast.fields` to drop virtual formula fields before the driver sees them, and adds back the stored fields they read)",
15+
"note": "2026-08-28: RE-ANCHORED (commit 8cb96ec41) and REPOINTED — `sql-driver.ts:1353-1354` had rotted onto `) as Error & { code?: string; status?: number };` inside an error-constructor helper, ~4,200 lines above the projection. sql-driver.ts is 16,289 lines; the whole find path moved into `findRows` under a citation nothing re-read. The `driver-memory projectFields` / `objectql formula projection` halves were prose with no path at all and are now a repo-rooted anchor on the formula side. Re-closed by hand against 93ea19bca. 2026-11-07: REPOINTED to `engine-top-level.ts#planFormulaProjection`, its declaration: since #30020 E2 moved the `find` / `findOne` bodies that call it into `engine-find.ts`, engine.ts no longer imports the name."
1616
},
1717
"where": {
1818
"status": "live",
@@ -53,8 +53,8 @@
5353
"top": {
5454
"status": "live",
5555
"verifiedAt": "2026-08-28",
56-
"evidence": "packages/objectql/src/engine.ts#ENGINE_QUERY_SLOTS (the engine's slot set — the `where` and `limit` canonicals, of which `top` is the OData alias); packages/objectql/src/engine.ts#foldEngineOptionAliases (applied on `find`/`findOne` before anything reads the AST, so the driver only ever sees `limit`); packages/metadata-protocol/src/protocol-list-query-params.ts#WIRE_DOLLAR_ALIASES (`['$top', 'top']` — the wire spelling folded on the REST list path)",
57-
"note": "2026-08-28: RE-ANCHORED (commit 8cb96ec41), REPOINTED, and the MECHANISM had moved too — this is the one entry in the batch where re-closing the call graph changed the story rather than just the coordinates. `engine.ts:2850-2853` claimed an inline `top → limit` normalization; both citations had rotted onto docblocks (`:2853` in engine.ts, `:3486` in protocol.ts), and the inline fold no longer exists: the alias now lives in the spec's ONE alias table (`RPC_QUERY_ALIAS_SLOTS`), filtered into `ENGINE_QUERY_SLOTS` and applied by `foldEngineOptionAliases` at every engine entry point (#4346/#4371). The verdict `live` was never in doubt; the pointer had stopped describing how. Re-closed by hand against 93ea19bca."
56+
"evidence": "packages/objectql/src/engine-top-level.ts#ENGINE_QUERY_SLOTS (the engine's slot set — the `where` and `limit` canonicals, of which `top` is the OData alias); packages/objectql/src/engine-find.ts#foldEngineOptionAliases (applied on `find`/`findOne` before anything reads the AST, so the driver only ever sees `limit`); packages/metadata-protocol/src/protocol-list-query-params.ts#WIRE_DOLLAR_ALIASES (`['$top', 'top']` — the wire spelling folded on the REST list path)",
57+
"note": "2026-08-28: RE-ANCHORED (commit 8cb96ec41), REPOINTED, and the MECHANISM had moved too — this is the one entry in the batch where re-closing the call graph changed the story rather than just the coordinates. `engine.ts:2850-2853` claimed an inline `top → limit` normalization; both citations had rotted onto docblocks (`:2853` in engine.ts, `:3486` in protocol.ts), and the inline fold no longer exists: the alias now lives in the spec's ONE alias table (`RPC_QUERY_ALIAS_SLOTS`), filtered into `ENGINE_QUERY_SLOTS` and applied by `foldEngineOptionAliases` at every engine entry point (#4346/#4371). The verdict `live` was never in doubt; the pointer had stopped describing how. Re-closed by hand against 93ea19bca. 2026-11-07: REPOINTED the two engine legs: the slot set to its declaration, `engine-top-level.ts#ENGINE_QUERY_SLOTS`, and the fold to `engine-find.ts`, where the `find` / `findOne` bodies that apply it have lived since #30020 E2 moved them out of engine.ts, which no longer imports `ENGINE_QUERY_SLOTS`."
5858
},
5959
"cursor": {
6060
"status": "dead",

0 commit comments

Comments
 (0)