From 69bda5b7cb6e7c730c15be4dcc5b614c5d24f626 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Wed, 2 Sep 2026 13:50:19 -0700 Subject: [PATCH] =?UTF-8?q?test(find):=20a=20vector-leg=20find=20is=20proj?= =?UTF-8?q?ected=20too=20=E2=80=94=20the=20answer=20is=20uniform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The seam hydrates the metadata and graph page paths; a vector or text leg builds its own entities and is trimmed after the integrity guard instead. That is a COST difference, and this pin exists so it can never quietly become an ANSWER difference. --- tests/integration/find-fields-projection.test.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/find-fields-projection.test.ts b/tests/integration/find-fields-projection.test.ts index df94e942..5d339f08 100644 --- a/tests/integration/find-fields-projection.test.ts +++ b/tests/integration/find-fields-projection.test.ts @@ -198,6 +198,20 @@ describe('find/get({ fields }) — projection', () => { expect(reads).toBe(0) }) + it('projects a vector-leg find too — the ANSWER is uniform, only the cost is not', async () => { + // The seam hydrates the metadata and graph page paths. A vector or text leg + // builds its own entities, so those rows are trimmed after the integrity + // guard instead. That difference is a COST difference, and this pin exists + // so it can never quietly become an ANSWER difference. + const rows = await brain.find({ query: 'post', fields: ['title'], limit: 3 }) + for (const r of rows) { + const meta = (r.entity.metadata ?? {}) as Record + expect(Object.keys(meta)).toEqual(['title']) + expect(meta.body).toBeUndefined() + expect(r.entity.id).toBe(r.id) + } + }) + it('get({ fields }) projects a single row through the same seam', async () => { const full = await brain.get(ids[0]) const projected = await brain.get(ids[0], { fields: ['title', 'slug'] })