@volter/twin-turbopuffer 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +12 -139
  2. package/dist/generated/pack-facts.json +2 -16
  3. package/dist/journeys/coverage.json +60 -0
  4. package/dist/journeys/customer-life.json +7 -0
  5. package/dist/journeys/customer-life.outline.md +13 -0
  6. package/dist/journeys/decisions.json +83 -0
  7. package/dist/journeys/demand.json +27 -0
  8. package/dist/journeys/score.json +82 -0
  9. package/dist/journeys/unreachable.json +12 -0
  10. package/dist/journeys/vendor-examples.json +7 -0
  11. package/dist/spec/SOURCE.md +6 -9
  12. package/dist/spec/sources.json +25 -0
  13. package/dist/src/fetch.js +0 -6
  14. package/dist/src/generated/ui.gen.json +1 -1
  15. package/dist/src/index.js +5 -3
  16. package/dist/src/manifest.js +27 -88
  17. package/dist/src/semantics/index.js +1 -6
  18. package/dist/src/semantics/states.d.ts +1 -0
  19. package/dist/src/semantics/states.js +2 -0
  20. package/generated/pack-facts.json +2 -16
  21. package/journeys/coverage.json +60 -0
  22. package/journeys/customer-life.json +7 -0
  23. package/journeys/customer-life.outline.md +13 -0
  24. package/journeys/decisions.json +83 -0
  25. package/journeys/demand.json +27 -0
  26. package/journeys/score.json +82 -0
  27. package/journeys/unreachable.json +12 -0
  28. package/journeys/vendor-examples.json +7 -0
  29. package/package.json +4 -8
  30. package/spec/SOURCE.md +6 -9
  31. package/spec/sources.json +25 -0
  32. package/src/fetch.ts +0 -6
  33. package/src/generated/ui.gen.json +1 -1
  34. package/src/index.ts +6 -4
  35. package/src/manifest.ts +28 -122
  36. package/src/semantics/index.ts +0 -4
  37. package/src/semantics/states.ts +2 -0
  38. package/dist/src/engine/filter.d.ts +0 -57
  39. package/dist/src/engine/filter.js +0 -286
  40. package/dist/src/engine/namespace.d.ts +0 -67
  41. package/dist/src/engine/namespace.js +0 -1248
  42. package/dist/src/engine/stem.d.ts +0 -1
  43. package/dist/src/engine/stem.js +0 -133
  44. package/dist/src/engine/text.d.ts +0 -44
  45. package/dist/src/engine/text.js +0 -189
  46. package/dist/src/screens/dashboard.d.ts +0 -4
  47. package/dist/src/screens/dashboard.js +0 -145
  48. package/dist/src/semantics/around.d.ts +0 -2
  49. package/dist/src/semantics/around.js +0 -30
  50. package/dist/src/semantics/doors.d.ts +0 -9
  51. package/dist/src/semantics/doors.js +0 -31
  52. package/dist/src/semantics/namespaces.d.ts +0 -8
  53. package/dist/src/semantics/namespaces.js +0 -98
  54. package/dist/src/semantics/shared.d.ts +0 -24
  55. package/dist/src/semantics/shared.js +0 -57
  56. package/src/engine/filter.ts +0 -277
  57. package/src/engine/namespace.ts +0 -1107
  58. package/src/engine/stem.ts +0 -104
  59. package/src/engine/text.ts +0 -204
  60. package/src/screens/dashboard.tsx +0 -169
  61. package/src/semantics/around.ts +0 -28
  62. package/src/semantics/doors.ts +0 -33
  63. package/src/semantics/namespaces.ts +0 -105
  64. package/src/semantics/shared.ts +0 -63
@@ -1,94 +1,33 @@
1
1
  export const manifest = {
2
- vendor: 'turbopuffer',
3
- service: 'turbopuffer',
4
- body: {},
5
- // the core mints no id (it owns no operation); a document's id is the caller's
6
- ids: { template: '{prefix}_{n}' },
7
- time: 'iso',
2
+ vendor: 'turbopuffer', service: 'turbopuffer', body: {}, ids: { template: '{uuid}' }, time: 'iso',
3
+ // source: https://turbopuffer.com/docs/auth "all endpoints will return a JSON payload in the format"
8
4
  error: { status: 'error', error: '{message}' },
9
- readOnly: { status: 405, message: 'read_only: this twin was started read-only; writes are refused' },
10
- malformedBody: { status: 400, message: 'invalid request: body is not valid JSON' },
11
- notFound: { status: 404, message: 'not found' },
12
- // an operation the twin does not serve, or a path turbopuffer does not have, in turbopuffer's error body
13
- // (https://turbopuffer.com/docs/auth, "Error responses"). Where the documentation stops: no page prints the answer to
14
- // an unknown path or an operation the twin does not model; 404 is the twin's.
15
- gap: { status: 404, message: 'not found: {method} {path}' },
16
- // a leading region segment (`/aws-us-east-1/v2/...`): how TURBOPUFFER_BASE_URL=<twin>/{region} reaches the twin
17
- pathPrefix: '/(?:aws|gcp|azure)-[a-z0-9-]+(?=/v\\d+/)',
18
- discovery: {
19
- twinOf: 'the Turbopuffer API (v2 namespaces: write, query and multi-query, deleteAll, metadata, schema, namespace listing, cache warm hint)',
20
- stores: 'namespaces (schema, distance metric) and their documents; queries filter, BM25-rank, order and count them deterministically',
21
- identity: 'Send `Authorization: Bearer <any non-empty key>`, as the SDK does from TURBOPUFFER_API_KEY. A leading region path segment (/aws-us-east-1/v2/...) is accepted, which is how TURBOPUFFER_BASE_URL=<twin>/{region} reaches the twin.',
22
- },
23
- // the World's doors (./semantics/doors.ts)
24
- doors: [
25
- { id: 'setPassword', method: 'POST', path: '/_twin/users/{email}/password', note: "a person, their organization and its plan, as turbopuffer's sign-up makes them" },
26
- { id: 'appCredentials', method: 'POST', path: '/_twin/app-credentials', note: 'the API key the World\'s application holds, as the runtime issues it at every boot' },
27
- ],
28
- // GET /v1/namespaces answers `{namespaces, next_cursor}`, paged by `cursor` and `page_size`
29
- // (https://turbopuffer.com/docs/namespaces); the handler answers it. Required by the type; the core lists nothing.
30
- list: { style: 'envelope', envelope: { namespaces: '{data}' }, limit: { param: 'page_size', default: 100, max: 1000 } },
5
+ readOnly: { status: 403, message: 'This World is read-only.' },
6
+ // source: https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/core/error.ts "export class NotFoundError extends APIError<404, Headers> {}"
7
+ // The documentation specifies the error envelope but no unknown-path message; use not found in that envelope.
8
+ notFound: { status: 404, message: 'not found' }, gap: { status: 404, message: 'not found' },
9
+ // source: https://turbopuffer.com/docs/auth "The HTTP API expects the API key to be formatted as a standard Bearer token and passed in the Authorization header:"
10
+ // Where documentation stops: Bearer authentication is documented, but missing-key versus unknown-route precedence is not; the gap stands.
11
+ auth: { header: 'authorization', scheme: 'Bearer', gateWhenAbsent: true,
12
+ // source: https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/core/error.ts "export class AuthenticationError extends APIError<401, Headers> {}"
13
+ // Exact missing/invalid-key messages are not published.
14
+ missing: { status: 401, message: 'API key required' }, invalidKeys: [], invalid: { status: 401, message: 'Invalid API key' } },
31
15
  deleted: {},
32
- // turbopuffer's dashboard (https://turbopuffer.com/docs/auth: "You can create and expire tokens in the dashboard"):
33
- // its sign-in, and the page where an organization's API keys are made and expired (screens/dashboard.tsx)
34
- screens: [{
35
- id: 'login', kind: 'flow', host: 'turbopuffer.com', path: '/login',
36
- demand: 'every dashboard page asks who is signed in', status: 'done',
37
- controls: ['Email', 'Password', 'Continue'], source: 'https://turbopuffer.com/docs/auth',
38
- }, {
39
- id: 'api-keys', kind: 'workspace', host: 'turbopuffer.com', path: '/dashboard/api-keys',
40
- demand: 'every API key a customer uses is made here, and expired here when it is rotated or the customer leaves', status: 'done',
41
- controls: ['Name', 'Read', 'Write', 'List', 'Admin', 'Create API key', 'Expire'], source: 'https://turbopuffer.com/docs/auth',
42
- }, {
43
- // every page of the dashboard's host, the sign-in and the keys pages above among them
44
- id: 'dashboard', kind: 'workspace', host: 'turbopuffer.com', path: '/',
45
- demand: 'an API key is made and expired only on the dashboard', status: 'done', source: 'https://turbopuffer.com/docs/auth',
46
- }],
47
- // a query writes nothing: a read-only World answers it
48
- reads: ['post_v2_namespaces_namespace_query'],
49
- resources: {
50
- _seq_api_key: { idPrefix: '', ids: '{n}' },
51
- },
52
- // the descriptor, as data (twin-world's architecture, "The descriptor"): the pack registers packOf(manifest). No
53
- // state system: a World's writes are not performed against turbopuffer, nor its namespaces observed (the gap).
16
+ resources: {},
17
+ unmodeled: ['get_v1_namespaces', 'post_v1_namespaces_namespace_debug_recall', 'get_v1_namespaces_namespace_hint_cache_warm', 'get_v1_namespaces_namespace_metadata', 'patch_v1_namespaces_namespace_metadata', 'get_v1_namespaces_namespace_operations_token', 'get_v1_namespaces_namespace_schema', 'post_v1_namespaces_namespace_schema', 'post_v2_namespaces_namespace', 'delete_v2_namespaces_namespace', 'post_v2_namespaces_namespace_explain_query', 'get_v2_namespaces_namespace_metadata', 'post_v2_namespaces_namespace_query'],
18
+ vendorBacked: { none: 'No vendor resource or operation is served; every spec operation answers the gap.' },
19
+ discovery: { twinOf: 'turbopuffer namespaces API', stores: 'No vendor resources', behavior: 'Every spec operation answers the vendor-shaped gap; Dub indexing is demand and remains unserved; reads require an off-by-default flag.' },
20
+ // source: https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/client.ts "baseURL = baseURL.replace('{region}', region);"
21
+ pathPrefix: '/(?:aws|gcp|azure)-[a-z0-9-]+(?=/v\\d+/)',
54
22
  descriptor: {
55
- transport: 'rest',
56
- protocol: '3',
57
- archetype: 'crud',
58
- bin: 'world-turbopuffer',
59
- resources: ['namespace', 'document'],
60
- specSource: 'the OpenAPI document @turbopuffer/turbopuffer@2.8.0 was generated from (spec/openapi.yaml.gz, provenance in spec/SOURCE.md), with its generator pseudo-paths folded into the operations turbopuffer documents (spec/patches.json); the calls dubinc/dub makes (apps/web/lib/api/partners/search/providers/turbopuffer.ts).',
61
- description: 'Turbopuffer v2 namespaces twin — write (upsert/patch/delete rows or columns, delete/patch by filter, schema, distance_metric), query (filters, BM25 with last_as_prefix and Sum/Max/Product, attribute order, exact ANN, Count/Sum aggregates), multiQuery and deleteAll, as Dub\'s partner search calls them. Deterministic BM25 (textbook Okapi over a word_v2 approximation — not byte-equal to the vendor). Kernel-backed, no mirror; unmodelled surface answers 400/404 naming its todo.',
62
- // ADOPTION — the official Node client (`@turbopuffer/turbopuffer`, the scope is Turbopuffer's
63
- // alone), the official Python client (`turbopuffer` on PyPI), and the TURBOPUFFER_ env stem
64
- // (TURBOPUFFER_API_KEY / _REGION / _BASE_URL, all read by the SDK in client.ts).
65
- adoption: {
66
- sdks: ['@turbopuffer/turbopuffer'],
67
- pypi: ['turbopuffer'],
68
- scopes: ['@turbopuffer/'],
69
- envStems: ['TURBOPUFFER'],
70
- },
71
- // INTERCEPTION — the SDK's default base URL is `https://{region}.turbopuffer.com`
72
- // (client.ts:273), the region filled from the `region` option or TURBOPUFFER_REGION: regional
73
- // hosts such as aws-us-east-1.turbopuffer.com and gcp-us-central1.turbopuffer.com.
74
- hosts: [{ hostPattern: '^(?:aws|gcp|azure)-[a-z0-9-]+\\.turbopuffer\\.com$' },
75
- // the dashboard's sign-in and API keys pages and the World's sign-up door (screens/dashboard.tsx); the rest of
76
- // turbopuffer.com (its site and docs) is left alone
77
- { host: 'turbopuffer.com', pathPattern: '^/(login|dashboard|_twin/users)(/|$)' },
78
- ],
79
- // WORLD WIRING — under Node the SDK sends through undici's `Agent.request`
80
- // (internal/custom/fetch-node.ts, selected by the package's `#fetch` import map for the `node`
81
- // condition), which neither the injector's http/https/fetch patches nor HTTPS_PROXY reach. The
82
- // SDK's own `TURBOPUFFER_BASE_URL` (client.ts:253) is the interception. It must carry the
83
- // `{region}` placeholder: a client that passes `region` (Dub passes "aws-us-east-1") throws
84
- // "region is set, but would be ignored" against a base URL without one (client.ts:282-285). The
85
- // twin accepts and ignores that leading region segment.
86
- // the application's TURBOPUFFER_API_KEY, issued once the twin is up (./semantics/doors.ts)
87
- credentialDoor: { path: '/_twin/app-credentials', body: {}, fill: { TURBOPUFFER_API_KEY: 'api_key' } },
88
- endpointEnv: {
89
- name: 'TURBOPUFFER_TWIN_URL',
90
- templates: { TURBOPUFFER_BASE_URL: '${url}/{region}' },
91
- note: 'grounded in @turbopuffer/turbopuffer@2.8.0 src/client.ts:253-288 (TURBOPUFFER_BASE_URL, {region} placeholder substitution) and internal/custom/fetch-node.ts (undici Agent.request under node, outside the injector); the injector also claims the regional *.turbopuffer.com hosts for fetch-based runtimes.',
92
- },
23
+ protocol: '3', transport: 'rest', archetype: 'crud', bin: 'world-turbopuffer', resources: [],
24
+ specSource: 'The OpenAPI document for @turbopuffer/turbopuffer@2.8.0 (spec/openapi.yaml.gz), with provenance and hash in spec/SOURCE.md.',
25
+ description: 'turbopuffer API twin: every spec operation answers the vendor-shaped gap.',
26
+ adoption: { sdks: ['@turbopuffer/turbopuffer'], pypi: ['turbopuffer'], scopes: ['@turbopuffer/'], envStems: ['TURBOPUFFER'] },
27
+ // source: https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/client.ts "https://{region}.turbopuffer.com"
28
+ hosts: [{ hostPattern: '^(?:aws|gcp|azure)-[a-z0-9-]+\\.turbopuffer\\.com$' }],
29
+ // source: https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/client.ts "TURBOPUFFER_BASE_URL"
30
+ endpointEnv: { name: 'TURBOPUFFER_TWIN_URL', templates: { TURBOPUFFER_BASE_URL: '${url}/{region}' }, note: 'The pinned SDK requires the region placeholder when a region is supplied; its Node socket client reads TURBOPUFFER_BASE_URL.' },
31
+ clientCasesNone: 'Demanded calls remain unserved; no SDK case is claimed for the retained gap.',
93
32
  },
94
33
  };
@@ -1,6 +1 @@
1
- import * as namespaces from "./namespaces.js";
2
- export const turbopufferSemantics = {
3
- delete_v2_namespaces_namespace: namespaces.delete_v2_namespaces_namespace,
4
- post_v2_namespaces_namespace: namespaces.post_v2_namespaces_namespace,
5
- post_v2_namespaces_namespace_query: namespaces.post_v2_namespaces_namespace_query,
6
- };
1
+ export const turbopufferSemantics = {};
@@ -0,0 +1 @@
1
+ export declare const states: {};
@@ -0,0 +1,2 @@
1
+ // No stored vendor resources are served, so there are no state machines or notState rulings.
2
+ export const states = {};
@@ -19,10 +19,6 @@
19
19
  "hosts": [
20
20
  {
21
21
  "hostPattern": "^(?:aws|gcp|azure)-[a-z0-9-]+\\.turbopuffer\\.com$"
22
- },
23
- {
24
- "host": "turbopuffer.com",
25
- "pathPattern": "^/(login|dashboard|_twin/users)(/|$)"
26
22
  }
27
23
  ],
28
24
  "archetype": "crud",
@@ -32,23 +28,13 @@
32
28
  "standing": "current"
33
29
  },
34
30
  "transport": "rest",
35
- "resources": [
36
- "namespace",
37
- "document"
38
- ],
31
+ "resources": [],
39
32
  "endpointEnv": {
40
33
  "name": "TURBOPUFFER_TWIN_URL",
41
34
  "templates": {
42
35
  "TURBOPUFFER_BASE_URL": "${url}/{region}"
43
36
  },
44
- "note": "grounded in @turbopuffer/turbopuffer@2.8.0 src/client.ts:253-288 (TURBOPUFFER_BASE_URL, {region} placeholder substitution) and internal/custom/fetch-node.ts (undici Agent.request under node, outside the injector); the injector also claims the regional *.turbopuffer.com hosts for fetch-based runtimes."
45
- },
46
- "credentialDoor": {
47
- "path": "/_twin/app-credentials",
48
- "body": {},
49
- "fill": {
50
- "TURBOPUFFER_API_KEY": "api_key"
51
- }
37
+ "note": "The pinned SDK requires the region placeholder when a region is supplied; its Node socket client reads TURBOPUFFER_BASE_URL."
52
38
  },
53
39
  "serveExport": "createTurbopufferTwinServer"
54
40
  }
@@ -0,0 +1,60 @@
1
+ {
2
+ "vendor": "turbopuffer",
3
+ "missing": 0,
4
+ "stale": [],
5
+ "code": {
6
+ "lines": 46,
7
+ "run": 44,
8
+ "recorded": 2,
9
+ "missing": 0
10
+ },
11
+ "state": {
12
+ "declared": 0,
13
+ "reached": 0,
14
+ "recorded": 0,
15
+ "missing": [],
16
+ "undeclared": []
17
+ },
18
+ "files": [
19
+ {
20
+ "file": "semantics/index.ts",
21
+ "lines": {
22
+ "found": 2,
23
+ "hit": 2
24
+ },
25
+ "missing": []
26
+ },
27
+ {
28
+ "file": "manifest.ts",
29
+ "lines": {
30
+ "found": 23,
31
+ "hit": 23
32
+ },
33
+ "missing": []
34
+ },
35
+ {
36
+ "file": "index.ts",
37
+ "lines": {
38
+ "found": 7,
39
+ "hit": 7
40
+ },
41
+ "missing": []
42
+ },
43
+ {
44
+ "file": "server.ts",
45
+ "lines": {
46
+ "found": 4,
47
+ "hit": 2
48
+ },
49
+ "missing": []
50
+ },
51
+ {
52
+ "file": "fetch.ts",
53
+ "lines": {
54
+ "found": 10,
55
+ "hit": 10
56
+ },
57
+ "missing": []
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "vendor": "turbopuffer",
3
+ "host": "aws-us-east-1.turbopuffer.com",
4
+ "author": "Codex pack builder",
5
+ "about": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in.",
6
+ "steps": []
7
+ }
@@ -0,0 +1,13 @@
1
+ # turbopuffer customer life
2
+
3
+ Author: Codex pack builder.
4
+
5
+ Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in.
6
+
7
+ Dub at `7e0101363b2ab30afc537c1893f159d1dcba513a` checks the key in
8
+ `apps/web/lib/api/partners/search/provider.ts:13` and the read flag at line 34.
9
+ The key authenticates demanded indexing; `PARTNER_SEARCH_READ_ENABLED` is the separate default-off read choice in `apps/web/.env.example:32`.
10
+
11
+ The retained gap has no modeled customer acts, credentials, screens or stored state; demand.json records the unserved demand.
12
+ Every spec operation answers the vendor-shaped gap. Published examples stay
13
+ in the spec and are counted as unserved; the life has no steps.
@@ -0,0 +1,83 @@
1
+ {
2
+ "about": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in.",
3
+ "decisions": [
4
+ {
5
+ "operation": "get_v1_namespaces",
6
+ "demand": "None; Dub integration is opt-in.",
7
+ "mechanism": "unmodeled",
8
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
9
+ },
10
+ {
11
+ "operation": "post_v1_namespaces_namespace_debug_recall",
12
+ "demand": "None; Dub integration is opt-in.",
13
+ "mechanism": "unmodeled",
14
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
15
+ },
16
+ {
17
+ "operation": "get_v1_namespaces_namespace_hint_cache_warm",
18
+ "demand": "None; Dub integration is opt-in.",
19
+ "mechanism": "unmodeled",
20
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
21
+ },
22
+ {
23
+ "operation": "get_v1_namespaces_namespace_metadata",
24
+ "demand": "None; Dub integration is opt-in.",
25
+ "mechanism": "unmodeled",
26
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
27
+ },
28
+ {
29
+ "operation": "patch_v1_namespaces_namespace_metadata",
30
+ "demand": "None; Dub integration is opt-in.",
31
+ "mechanism": "unmodeled",
32
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
33
+ },
34
+ {
35
+ "operation": "get_v1_namespaces_namespace_operations_token",
36
+ "demand": "None; Dub integration is opt-in.",
37
+ "mechanism": "unmodeled",
38
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
39
+ },
40
+ {
41
+ "operation": "get_v1_namespaces_namespace_schema",
42
+ "demand": "None; Dub integration is opt-in.",
43
+ "mechanism": "unmodeled",
44
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
45
+ },
46
+ {
47
+ "operation": "post_v1_namespaces_namespace_schema",
48
+ "demand": "None; Dub integration is opt-in.",
49
+ "mechanism": "unmodeled",
50
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
51
+ },
52
+ {
53
+ "operation": "post_v2_namespaces_namespace",
54
+ "demand": "Shipped application call: apps/web/lib/api/partners/search/providers/turbopuffer.ts:405,416",
55
+ "mechanism": "unmodeled",
56
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
57
+ },
58
+ {
59
+ "operation": "delete_v2_namespaces_namespace",
60
+ "demand": "None; Dub integration is opt-in.",
61
+ "mechanism": "unmodeled",
62
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
63
+ },
64
+ {
65
+ "operation": "post_v2_namespaces_namespace_explain_query",
66
+ "demand": "None; Dub integration is opt-in.",
67
+ "mechanism": "unmodeled",
68
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
69
+ },
70
+ {
71
+ "operation": "get_v2_namespaces_namespace_metadata",
72
+ "demand": "None; Dub integration is opt-in.",
73
+ "mechanism": "unmodeled",
74
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
75
+ },
76
+ {
77
+ "operation": "post_v2_namespaces_namespace_query",
78
+ "demand": "None; Dub integration is opt-in.",
79
+ "mechanism": "unmodeled",
80
+ "why": "Demanded calls are recorded in demand.json and remain unserved in the retained gap. Scope is unchanged pending a separate implementation; supplying credentials is not opt-in."
81
+ }
82
+ ]
83
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "measured": "Application calls and optional settings are recorded below at the cited commits.",
3
+ "applications": [
4
+ {
5
+ "name": "dubinc/dub",
6
+ "client": "partner search indexing and reads",
7
+ "backend": [
8
+ {
9
+ "call": "namespace.write: index upserts and deletes",
10
+ "operation": "post_v2_namespaces_namespace",
11
+ "evidence": "apps/web/lib/api/partners/search/providers/turbopuffer.ts:405,416"
12
+ }
13
+ ],
14
+ "commit": "7e0101363b2a",
15
+ "gate": "Shipped indexing/sync jobs use the write provider once its credential is supplied; PARTNER_SEARCH_READ_ENABLED controls only reads, not indexing (apps/web/lib/api/partners/search/provider.ts:9-19,22-38; apps/web/lib/api/partners/search/sync.ts:36,98).",
16
+ "evidence": "apps/web/lib/api/partners/search/provider.ts:13,34"
17
+ }
18
+ ],
19
+ "optional": [
20
+ {
21
+ "application": "dubinc/dub",
22
+ "what": "Index reads for partner search, separately from demanded indexing writes",
23
+ "setting": "Configuration (1): PARTNER_SEARCH_READ_ENABLED=true replaces false; read provider is separate from write provider (apps/web/lib/api/partners/search/provider.ts:22-38; apps/web/.env.example:32).",
24
+ "evidence": "apps/web/lib/api/partners/search/provider.ts:34"
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "vendor": "turbopuffer",
3
+ "life": {
4
+ "steps": 0,
5
+ "verdict": "unjudged",
6
+ "judge": null,
7
+ "authors": []
8
+ },
9
+ "failures": [],
10
+ "flags": [],
11
+ "coverage": {
12
+ "vendor": "turbopuffer",
13
+ "missing": 0,
14
+ "stale": [],
15
+ "code": {
16
+ "lines": 46,
17
+ "run": 44,
18
+ "recorded": 2,
19
+ "missing": 0
20
+ },
21
+ "state": {
22
+ "declared": 0,
23
+ "reached": 0,
24
+ "recorded": 0,
25
+ "missing": [],
26
+ "undeclared": []
27
+ },
28
+ "files": [
29
+ {
30
+ "file": "semantics/index.ts",
31
+ "lines": {
32
+ "found": 2,
33
+ "hit": 2
34
+ },
35
+ "missing": []
36
+ },
37
+ {
38
+ "file": "manifest.ts",
39
+ "lines": {
40
+ "found": 23,
41
+ "hit": 23
42
+ },
43
+ "missing": []
44
+ },
45
+ {
46
+ "file": "index.ts",
47
+ "lines": {
48
+ "found": 7,
49
+ "hit": 7
50
+ },
51
+ "missing": []
52
+ },
53
+ {
54
+ "file": "server.ts",
55
+ "lines": {
56
+ "found": 4,
57
+ "hit": 2
58
+ },
59
+ "missing": []
60
+ },
61
+ {
62
+ "file": "fetch.ts",
63
+ "lines": {
64
+ "found": 10,
65
+ "hit": 10
66
+ },
67
+ "missing": []
68
+ }
69
+ ]
70
+ },
71
+ "examples": {
72
+ "done": false,
73
+ "replayed": true,
74
+ "verdict": "unjudged",
75
+ "failures": [],
76
+ "line": "examples: 99 published, 0 of patch-removed operations, 99 of operations the twin does not serve, 0 replayed, 0 recorded; 0 failing done: no"
77
+ },
78
+ "breadth": {
79
+ "operations": 13,
80
+ "gap": 13
81
+ }
82
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "code": [
3
+ {
4
+ "file": "server.ts",
5
+ "declarations": [
6
+ "createTurbopufferTwinServer"
7
+ ],
8
+ "world": "host-process",
9
+ "why": "The journeys use the pack fetch in process; the server factory binds the external HTTP host, outside an in-process World walk."
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "vendor": "turbopuffer",
3
+ "host": "aws-us-east-1.turbopuffer.com",
4
+ "author": "Codex pack builder",
5
+ "about": "No demanded application calls turbopuffer; Dub partner search requires an operator-supplied TURBOPUFFER_API_KEY, and reads also require PARTNER_SEARCH_READ_ENABLED=true. Both ship empty. Published examples are retained and counted as unserved.",
6
+ "steps": []
7
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@volter/twin-turbopuffer",
3
- "version": "1.0.0",
4
- "description": "Local Turbopuffer twin: v2 namespaces (write upserts/patches/deletes by id or filter with schema and distance_metric; query with filters, deterministic BM25 incl. last_as_prefix, attribute order, exact ANN and Count/Sum aggregates; multiQuery; deleteAll; metadata; schema; namespace listing) served to the unmodified @turbopuffer/turbopuffer client. Built on @volter/world-core.",
3
+ "version": "1.0.1",
4
+ "description": "turbopuffer Protocol 3 twin: every spec operation answers the vendor-shaped gap; demanded calls remain unserved.",
5
5
  "author": "Volter (https://github.com/volter-ai)",
6
6
  "license": "Apache-2.0",
7
7
  "files": [
8
8
  "src",
9
+ "journeys",
9
10
  "spec",
10
11
  "README.md",
11
12
  "LICENSE",
@@ -30,13 +31,8 @@
30
31
  "bin": {
31
32
  "world-turbopuffer": "dist/src/cli.js"
32
33
  },
33
- "dependencies": {
34
- "@volter/world-ui": "^1.0.1",
35
- "react": "^19.2.7",
36
- "react-dom": "^19.2.7"
37
- },
38
34
  "peerDependencies": {
39
- "@volter/world-core": "^3.0.1"
35
+ "@volter/world-core": "^3.0.38"
40
36
  },
41
37
  "devDependencies": {
42
38
  "@types/bun": "^1.2.20",
package/spec/SOURCE.md CHANGED
@@ -25,7 +25,7 @@
25
25
  https://turbopuffer.com/docs/branching) and posts a multi-query's `queries` to the plain query path
26
26
  (https://turbopuffer.com/docs/query). The patches fold each pseudo-path into that operation (the write body already
27
27
  has both fields; the copy's `dest_encryption` moves into `CopyFromNamespaceConfig`; the query takes either body and
28
- answers `QueryResult` or `MultiQueryResult`), leaving 11 operations. The twin routes by path and ignores the key.
28
+ answers `QueryResult` or `MultiQueryResult`), leaving 13 operations. The derived routes retain the documented paths; all operations are unmodeled.
29
29
  **Inference, not observation:** that turbopuffer's own server ignores `stainless_overload` is read from the
30
30
  documentation, which never mentions it; no request to the real service was made.
31
31
  - **Read by:** `bun scripts/derive-pack.ts turbopuffer`, which writes `../src/generated/`.
@@ -42,14 +42,11 @@
42
42
  page's example calls no turbopuffer operation, and the Quickstart's Connect block only sets shell variables; neither is
43
43
  counted. The examples of Pinning (`PATCH /v1/namespaces/{namespace}/metadata`) and Recall are counted and not
44
44
  replayed: the twin does not serve those operations.
45
- - **Where the pages and this spec disagree** (each an `exampleDiffers` in `../journeys/vendor-examples.json`): the
46
- metadata page's example answer names `approx_size_bytes`, `approx_num_rows` and `encryption: {"sse": true}`, where the
47
- same page's Response section and this spec's `NamespaceMetadata` name `approx_logical_bytes`, `approx_row_count` and
48
- `encryption.mode`; the delete page's example answers `"status": "ok"`, where this spec's delete answer is the constant
49
- `"OK"`. The twin answers the spec. `remove_stopwords` defaults to `true` in this spec's description and to `false` on
50
- the Write page ("Defaults to false (i.e. keep common words)") and in the January 2026 changelog; the twin answers the
51
- page. The spec names an embedding's computed attribute `$embed_<attribute>`, the Write and Embedding pages
52
- `embed_<attribute>`; the twin answers the pages.
45
+ - **Where the pages and this spec disagree:** the metadata page's example names `approx_size_bytes`,
46
+ `approx_num_rows` and `encryption.sse`, while its Response section and the spec name `approx_logical_bytes`,
47
+ `approx_row_count` and `encryption.mode`. The delete page shows `status: ok`, while the spec answers `OK`.
48
+ The spec defaults `remove_stopwords` to true and names `$embed_<attribute>`; the Write page defaults it to false
49
+ and names `embed_<attribute>`. No operation is served, so these examples remain unserved rather than replayed.
53
50
  - **APIs the pages document and this spec omits, outside the count until modelled:** the asynchronous form of a copy
54
51
  (`Prefer: respond-async`, answered 202 with a `Location` to poll, https://turbopuffer.com/docs/auth "Asynchronous
55
52
  requests"), and the export read `GET /v1/namespaces/{namespace}` and `HEAD /v1/namespaces/{namespace}`, which the
package/spec/sources.json CHANGED
@@ -1,4 +1,21 @@
1
1
  {
2
+ "https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/client.ts": {
3
+ "status": 200,
4
+ "checked": "2026-10-03",
5
+ "quotes": {
6
+ "baseURL = baseURL.replace('{region}', region);": true,
7
+ "https://{region}.turbopuffer.com": true,
8
+ "TURBOPUFFER_BASE_URL": true
9
+ }
10
+ },
11
+ "https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/core/error.ts": {
12
+ "status": 200,
13
+ "checked": "2026-10-03",
14
+ "quotes": {
15
+ "export class NotFoundError extends APIError<404, Headers> {}": true,
16
+ "export class AuthenticationError extends APIError<401, Headers> {}": true
17
+ }
18
+ },
2
19
  "https://raw.githubusercontent.com/turbopuffer/turbopuffer-typescript/v2.8.0/src/resources/namespaces.ts": {
3
20
  "status": 200,
4
21
  "checked": "2026-09-27"
@@ -11,6 +28,14 @@
11
28
  "The server returns `202 Accepted` with a `Location` header pointing to the operation.": true
12
29
  }
13
30
  },
31
+ "https://turbopuffer.com/docs/auth": {
32
+ "status": 200,
33
+ "checked": "2026-10-03",
34
+ "quotes": {
35
+ "all endpoints will return a JSON payload in the format": true,
36
+ "The HTTP API expects the API key to be formatted as a standard Bearer token and passed in the Authorization header:": true
37
+ }
38
+ },
14
39
  "https://turbopuffer.com/docs/branching.md": {
15
40
  "status": 200,
16
41
  "checked": "2026-09-27",
package/src/fetch.ts CHANGED
@@ -3,18 +3,12 @@
3
3
  import { createPackFetch, type DerivedFetch, type DerivedSurface, type PackFetchOptions } from '@volter/world-core';
4
4
  import surface from './generated/surface.gen.json' with { type: 'json' };
5
5
  import { manifest } from './manifest.ts';
6
- import { around } from './semantics/around.ts';
7
- import * as doors from './semantics/doors.ts';
8
6
  import { turbopufferSemantics } from './semantics/index.ts';
9
- import { screen as screen_dashboard } from './screens/dashboard.tsx';
10
7
 
11
8
  export function createTurbopufferFetch(options: PackFetchOptions = {}): DerivedFetch {
12
9
  return createPackFetch({
13
10
  manifest,
14
11
  surface: surface as DerivedSurface,
15
12
  handlers: turbopufferSemantics,
16
- doors,
17
- around,
18
- screens: { "dashboard": screen_dashboard },
19
13
  }, options);
20
14
  }
@@ -1 +1 @@
1
- {"generatedBy":"scripts/derive-pack.ts","resources":{"_seq_api_key":{"actions":[],"states":{},"embeds":{}}}}
1
+ {"generatedBy":"scripts/derive-pack.ts","resources":{}}
package/src/index.ts CHANGED
@@ -1,10 +1,12 @@
1
- // @volter/twin-turbopuffer — the turbopuffer twin (Protocol 3). A fixed file: the descriptor is the manifest's.
2
- import { packOf, registerPack } from '@volter/world-core';
1
+ // @volter/twin-turbopuffer — the turbopuffer twin (Protocol 3). A fixed file (create-pack): the descriptor is the manifest's, and the
2
+ // kernel derives the vendor-backed half from the generated surface, unless the manifest declares none (vendorBacked.none;
3
+ // architecture, "The real-system adapters").
4
+ import { packOf, registerPack, type DerivedSurface } from '@volter/world-core';
3
5
  import { manifest } from './manifest.ts';
6
+ import surface from './generated/surface.gen.json' with { type: 'json' };
4
7
 
5
8
  export { createTurbopufferFetch } from './fetch.ts';
6
9
  export { createTurbopufferTwinServer } from './server.ts';
7
10
  export { manifest };
8
11
 
9
- // The descriptor: twin-world's architecture, "The descriptor"; declared in manifest.ts.
10
- export const pack = registerPack(packOf(manifest));
12
+ export const pack = registerPack(packOf(manifest, surface as unknown as DerivedSurface));