@vllnt/convex-helpers 0.2.0 → 0.2.1-canary.d891d28
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.
- package/CHANGELOG.md +18 -0
- package/README.md +51 -21
- package/docs/API.md +29 -11
- package/llms.txt +24 -11
- package/package.json +6 -5
- package/docs/READINESS.md +0 -175
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,24 @@ and this project adheres to
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- The npm package now states that its bundled docs (`docs/API.md`, `README.md`,
|
|
14
|
+
`CHANGELOG.md`, `llms.txt`) match the installed version: a "For coding agents"
|
|
15
|
+
note in the README and `llms.txt`, relative `llms.txt` links to the shipped
|
|
16
|
+
files, an Ecosystem link and a Related packages section. `docs/API.md` now
|
|
17
|
+
lists the exported types of each entry.
|
|
18
|
+
- `pnpm check:package` (run by `pnpm lint`) fails when the tarball misses a
|
|
19
|
+
required doc file, ships contributor or internal files, or when a relative
|
|
20
|
+
`llms.txt` link does not resolve inside it.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- The tarball no longer ships `docs/READINESS.md` (maintainer publication
|
|
25
|
+
notes). `homepage` is now https://oss.vllnt.com/packages/convex-helpers.
|
|
26
|
+
- Tooling: every push to `main` touching the package publishes a canary (no
|
|
27
|
+
repository-variable gate), and docs-only changes now trigger it.
|
|
28
|
+
|
|
11
29
|
## [0.2.0] - 2026-11-26
|
|
12
30
|
|
|
13
31
|
### Fixed
|
package/README.md
CHANGED
|
@@ -21,7 +21,15 @@ host-`ctx` glue that run with the host's `ctx` — no own tables, no `app.use()`
|
|
|
21
21
|
mounting. Stateful concerns (rate limiting, idempotency, flags) belong in
|
|
22
22
|
`@convex-dev/*` or `@vllnt/convex-*` components.
|
|
23
23
|
|
|
24
|
-
See [ROADMAP.md](
|
|
24
|
+
See [ROADMAP.md](https://github.com/vllnt/convex-helpers/blob/main/ROADMAP.md)
|
|
25
|
+
(in the repository) for the planned module surface.
|
|
26
|
+
|
|
27
|
+
## For coding agents
|
|
28
|
+
|
|
29
|
+
The npm package bundles its docs at `node_modules/@vllnt/convex-helpers/docs/`
|
|
30
|
+
(`API.md`), next to `README.md`, `CHANGELOG.md` and `llms.txt`. They match the
|
|
31
|
+
installed version. Read them before writing code that uses this package. Type
|
|
32
|
+
declarations are in `dist/` and the TypeScript source is in `src/`.
|
|
25
33
|
|
|
26
34
|
## Features
|
|
27
35
|
|
|
@@ -52,11 +60,12 @@ See [ROADMAP.md](./ROADMAP.md) for the planned module surface.
|
|
|
52
60
|
pnpm add @vllnt/convex-helpers
|
|
53
61
|
```
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
`./builders` and `./validators`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Modules marked **planned** are
|
|
63
|
+
On GitHub this README describes `main`; the copy in each npm version describes
|
|
64
|
+
that version. `./better-auth`, `./identity`, `./builders` and `./validators`
|
|
65
|
+
first ship in `0.2.0`; `0.1.0` has only the root utilities and `./mcp`. Builds
|
|
66
|
+
of `main` are published to the `canary` dist-tag; canary tags move, so pin the
|
|
67
|
+
resolved version and test before production use. Modules marked **planned** are
|
|
68
|
+
not exported yet.
|
|
60
69
|
|
|
61
70
|
`convex@^1.45.0` is a peer dependency:
|
|
62
71
|
|
|
@@ -291,39 +300,60 @@ pnpm test:coverage # must reach 100%
|
|
|
291
300
|
|
|
292
301
|
Tests use [vitest](https://vitest.dev) with the node environment. 100% coverage
|
|
293
302
|
is enforced via `vitest.config.mts` thresholds. Identity integration tests use
|
|
294
|
-
**convex-test mocks**. Two
|
|
295
|
-
Convex backend (no cloud account):
|
|
296
|
-
concurrent bootstrap mutations with a
|
|
297
|
-
OCC, not login) and
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
+
**convex-test mocks**. Two local scripts in the repository (not in the npm
|
|
304
|
+
package) run against a real anonymous Convex backend (no cloud account):
|
|
305
|
+
`scripts/local-identity-proof.mjs` (16 concurrent bootstrap mutations with a
|
|
306
|
+
synthetic identity, one row; tests indexed OCC, not login) and
|
|
307
|
+
`scripts/better-auth-proof.mjs` (real Better Auth sign-in, anonymous and
|
|
308
|
+
email/password, then the issued JWTs sent to Convex functions that use
|
|
309
|
+
`./identity` and `./better-auth`; see
|
|
310
|
+
[docs/READINESS.md](https://github.com/vllnt/convex-helpers/blob/main/docs/READINESS.md#real-better-auth-loginjwt-proof)
|
|
311
|
+
for versions and assertions). Consuming apps must verify their own auth
|
|
312
|
+
integration independently.
|
|
303
313
|
|
|
304
314
|
## Documentation and security
|
|
305
315
|
|
|
306
316
|
- [API reference](./docs/API.md) · [LLM index](./llms.txt) ·
|
|
307
317
|
[Changelog](./CHANGELOG.md)
|
|
308
|
-
- [Security policy and private reporting](
|
|
318
|
+
- [Security policy and private reporting](https://github.com/vllnt/convex-helpers/blob/main/SECURITY.md)
|
|
309
319
|
- [Issues](https://github.com/vllnt/convex-helpers/issues) for non-sensitive
|
|
310
320
|
bugs
|
|
311
321
|
|
|
312
322
|
## Contributing
|
|
313
323
|
|
|
314
|
-
See
|
|
315
|
-
|
|
324
|
+
See
|
|
325
|
+
[CONTRIBUTING.md](https://github.com/vllnt/convex-helpers/blob/main/CONTRIBUTING.md)
|
|
326
|
+
for development setup, code style, and PR guidelines.
|
|
327
|
+
|
|
328
|
+
## Related packages
|
|
329
|
+
|
|
330
|
+
- [`convex-helpers`](https://www.npmjs.com/package/convex-helpers) — the
|
|
331
|
+
official helpers. `./builders` and `./validators` follow its signatures; use
|
|
332
|
+
it for everything this package does not cover.
|
|
333
|
+
- [`@convex-dev/better-auth`](https://www.npmjs.com/package/@convex-dev/better-auth)
|
|
334
|
+
— the Better Auth component. `./better-auth` only builds origin and cookie
|
|
335
|
+
settings to pass to it.
|
|
336
|
+
- [`@vllnt/convex-api-keys`](https://oss.vllnt.com/packages/convex-api-keys) —
|
|
337
|
+
stores, validates and revokes API keys. Use it behind `./mcp` `auth.validate`
|
|
338
|
+
when keys must be issued and revoked at runtime.
|
|
339
|
+
- [`@vllnt/convex-idempotency`](https://oss.vllnt.com/packages/convex-idempotency)
|
|
340
|
+
and the other `@vllnt/convex-*` components — stateful concerns (own tables,
|
|
341
|
+
`app.use()`), which this package leaves out.
|
|
342
|
+
- [`@vllnt/logger`](https://oss.vllnt.com/packages/logger) — structured logging.
|
|
343
|
+
This package logs nothing; hosts own observability.
|
|
344
|
+
- `@vllnt/convex-mcp` — deprecated; its code now ships as `./mcp` here.
|
|
316
345
|
|
|
317
346
|
## Author
|
|
318
347
|
|
|
319
348
|
Built by [bntvllnt](https://github.com/bntvllnt) ·
|
|
320
349
|
[bntvllnt.com](https://bntvllnt.com) · [X @bntvllnt](https://x.com/bntvllnt)
|
|
321
350
|
|
|
322
|
-
Part of the [@vllnt](https://github.com/vllnt) Convex component fleet —
|
|
323
|
-
[vllnt.com](https://vllnt.com)
|
|
324
|
-
|
|
325
351
|
If this is useful, [sponsor the work](https://github.com/sponsors/bntvllnt).
|
|
326
352
|
|
|
327
353
|
## License
|
|
328
354
|
|
|
329
355
|
[MIT](./LICENSE)
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
Part of vllnt oss: https://oss.vllnt.com
|
package/docs/API.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
**Compatibility:** `convex@^1.45.0`; ESM-only.
|
|
4
4
|
|
|
5
|
-
**Availability:** this reference
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
**Availability:** on GitHub this reference describes `main`; the copy shipped at
|
|
6
|
+
`node_modules/@vllnt/convex-helpers/docs/API.md` describes the installed
|
|
7
|
+
version. `./better-auth`, `./identity`, `./builders` and `./validators` first
|
|
8
|
+
ship in `0.2.0`; `0.1.0` has only the root utilities and `./mcp`. See the
|
|
8
9
|
[installation guide](../README.md#installation). Planned modules are not
|
|
9
10
|
exports.
|
|
10
11
|
|
|
@@ -146,13 +147,13 @@ per-instance secret. An `onResourceRead` hook is not provided.
|
|
|
146
147
|
`query(ref, options)` / `mutation(ref, options)` / `action(ref, options)` wrap a
|
|
147
148
|
Convex function reference as a typed `ToolDef`.
|
|
148
149
|
|
|
149
|
-
| Option | Type
|
|
150
|
-
| ------------- |
|
|
151
|
-
| `args` | `ConvexValidator`
|
|
152
|
-
| `description` | `string`
|
|
153
|
-
| `tags` | `Record<string, string>`
|
|
154
|
-
| `timeout` | `number`
|
|
155
|
-
| `onError` | `(ctx) =>
|
|
150
|
+
| Option | Type | Description |
|
|
151
|
+
| ------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
152
|
+
| `args` | `ConvexValidator` | A `v.object({...})` validator; converted to the tool's JSON-Schema input. |
|
|
153
|
+
| `description` | `string` | Human/LLM-facing tool description. |
|
|
154
|
+
| `tags` | `Record<string, string>` | Arbitrary metadata. |
|
|
155
|
+
| `timeout` | `number` | Per-call timeout (ms, finite, 0 to 2147483647; 0 disables), supported only for queries. Mutation/action timeouts are rejected because their execution cannot be cancelled safely. |
|
|
156
|
+
| `onError` | `(ctx) => OnCallResult \| undefined \| Promise<OnCallResult \| undefined> \| Promise<void>` | Per-tool error hook. |
|
|
156
157
|
|
|
157
158
|
### resource(ref, options)
|
|
158
159
|
|
|
@@ -177,6 +178,14 @@ activates only when the client sends a cursor.
|
|
|
177
178
|
|
|
178
179
|
Cursors are HMAC-signed per server instance and verified in constant time.
|
|
179
180
|
|
|
181
|
+
### Exported types
|
|
182
|
+
|
|
183
|
+
`AuthConfig`, `CallContext`, `ConvexClient`, `ConvexMCPServer` (the
|
|
184
|
+
`{ handler() }` return of `createMCPServer`), `ConvexValidator`, `FunctionType`
|
|
185
|
+
(`"query" | "mutation" | "action"`), `LifecycleHooks`, `OnCallResult`,
|
|
186
|
+
`PaginationConfig`, `ResourceDef`, `ServerConfig`, `ToolDef`, `ToolPage` and
|
|
187
|
+
`ToolSummary`.
|
|
188
|
+
|
|
180
189
|
### Validator utilities
|
|
181
190
|
|
|
182
191
|
| Export | Description |
|
|
@@ -227,6 +236,8 @@ you control. These are syntax helpers, not proof of ownership or CSRF
|
|
|
227
236
|
protection. Returning undefined leaves host/provider defaults in effect; it is
|
|
228
237
|
not a deny-all trusted-origin configuration.
|
|
229
238
|
|
|
239
|
+
Exported type: `CookieSettings` (the return of `cookieSettingsForSite`).
|
|
240
|
+
|
|
230
241
|
```ts
|
|
231
242
|
import {
|
|
232
243
|
cookieSettingsForSite,
|
|
@@ -255,6 +266,8 @@ their own code. The host configures Better Auth and its anonymous plugin.
|
|
|
255
266
|
| `getOrCreateFromAuth(ctx, { lookup, insert })` | Lookup then insert if absent; both callbacks receive subject. |
|
|
256
267
|
| `retargetRows(rows, apply)` | At most 1000 rows, sequential callbacks returning `deleted`, `patched`, or `skipped`; returns counts. Oversized pages reject before callbacks. |
|
|
257
268
|
|
|
269
|
+
Exported types: `AuthCtx` (`{ auth, trustedIssuer }`) and `AuthIdentity`.
|
|
270
|
+
|
|
258
271
|
Race-safe bootstrap requires the same Convex mutation transaction for indexed
|
|
259
272
|
lookup and insert, with every competing creator using that lookup. Remote calls
|
|
260
273
|
and actions do not provide uniqueness. Retargeting requires host authorization
|
|
@@ -298,6 +311,7 @@ runs both on the same convex-test backend.
|
|
|
298
311
|
| `customCtx(modifyCtx)` | Customization with no args: `modifyCtx(ctx, extra)` returns the ctx fields to add. `extra` holds the definition's keys other than `args`, `handler` and `returns`. |
|
|
299
312
|
| `Customization` | `{ args, input }`. `args` (property validators) are merged into the function's args and taken out of the handler's args; `input(ctx, consumedArgs, extra)` returns `{ ctx, args, onSuccess? }`. `onSuccess` runs after the handler. |
|
|
300
313
|
| `CustomBuilder`, `CustomCtx<Builder>` | Types of a custom builder and of the ctx its handlers receive. |
|
|
314
|
+
| `CustomInput`, `Registration` | Types of the `input` callback's return and of a registered function. |
|
|
301
315
|
|
|
302
316
|
Merging fails with an error when a consumed arg and a function arg share a name
|
|
303
317
|
but not a validator kind, when the function's args validator is neither an
|
|
@@ -313,6 +327,9 @@ declares none. Builders add no authorization of their own.
|
|
|
313
327
|
| `doc(schema, tableName)` | The table's validator plus `_id` and `_creationTime`; union tables get them on every member. Throws for other validator kinds. |
|
|
314
328
|
| `ValidationError` | Has `expected`, `got` and an optional `path`; the message names all three. |
|
|
315
329
|
|
|
330
|
+
Exported types: `AnyValidator`, `ValidateOptions`, `SystemFields` and
|
|
331
|
+
`AddFieldsToValidator`.
|
|
332
|
+
|
|
316
333
|
Behaviour matches `convex-helpers/validators` 0.1.124 for these exports, held by
|
|
317
334
|
a parity test, with two fail-closed differences:
|
|
318
335
|
|
|
@@ -329,7 +346,8 @@ value); messages are identical.
|
|
|
329
346
|
## Planned modules
|
|
330
347
|
|
|
331
348
|
The following modules are on the roadmap but not yet shipped. See
|
|
332
|
-
[ROADMAP.md](
|
|
349
|
+
[ROADMAP.md](https://github.com/vllnt/convex-helpers/blob/main/ROADMAP.md) (in
|
|
350
|
+
the repository, not the package) for milestones and exit criteria.
|
|
333
351
|
|
|
334
352
|
| Module | Status | Description |
|
|
335
353
|
| ----------------- | ------------------------ | --------------------------------------------------------- |
|
package/llms.txt
CHANGED
|
@@ -23,25 +23,38 @@ are not CSRF protection. Existing identity integration tests use convex-test moc
|
|
|
23
23
|
not real Better Auth or backend OCC proof. Errors/env/tracing remain planned. Builders add no authorization: the host's
|
|
24
24
|
`input` decides who may call.
|
|
25
25
|
|
|
26
|
+
## For coding agents
|
|
27
|
+
|
|
28
|
+
This package ships its docs: `node_modules/@vllnt/convex-helpers/docs/API.md`,
|
|
29
|
+
`README.md`, `CHANGELOG.md` and this `llms.txt`. They match the installed version.
|
|
30
|
+
Read them before writing code that uses this package. Type declarations are in
|
|
31
|
+
`dist/` and the TypeScript source is in `src/`.
|
|
32
|
+
|
|
26
33
|
## Release channels
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
`./validators` first ship in `0.2.0`; `0.1.0` has only the root utilities and `./mcp`. Prereleases are published
|
|
35
|
+
On GitHub this index describes `main`; the copy in each npm version describes that
|
|
36
|
+
version. `./better-auth`, `./identity`, `./builders` and `./validators` first ship in `0.2.0`; `0.1.0` has only the root utilities and `./mcp`. Prereleases are published
|
|
30
37
|
to the `canary` dist-tag; pin and test them before deployment.
|
|
31
38
|
MCP requires optional peers `@modelcontextprotocol/sdk@^1.29.0` and `zod@^4.3.6`;
|
|
32
39
|
the package is ESM-only and requires `convex@^1.45.0`.
|
|
33
40
|
|
|
34
41
|
## Docs
|
|
35
42
|
|
|
36
|
-
- [README](README.md): Project overview, installation, usage examples, and planned surface
|
|
37
|
-
- [API Reference](docs/API.md): Exported utilities, signatures, and compatibility
|
|
38
|
-
- [Changelog](CHANGELOG.md): Version history and release notes
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
43
|
+
- [README](./README.md): Project overview, installation, usage examples, and planned surface
|
|
44
|
+
- [API Reference](./docs/API.md): Exported utilities, signatures, and compatibility
|
|
45
|
+
- [Changelog](./CHANGELOG.md): Version history and release notes
|
|
46
|
+
- [Notice](./NOTICE): Attribution for the convex-helpers behaviour and types these entries follow
|
|
47
|
+
- [License](./LICENSE): MIT license
|
|
41
48
|
|
|
42
49
|
## Optional
|
|
43
50
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- [
|
|
47
|
-
- [
|
|
51
|
+
Repository files, not in the npm package; they describe `main`.
|
|
52
|
+
|
|
53
|
+
- [Roadmap](https://github.com/vllnt/convex-helpers/blob/main/ROADMAP.md): Planned modules and milestones
|
|
54
|
+
- [Contributing](https://github.com/vllnt/convex-helpers/blob/main/CONTRIBUTING.md): Development setup, validation commands, and release workflow
|
|
55
|
+
- [Security Policy](https://github.com/vllnt/convex-helpers/blob/main/SECURITY.md): Vulnerability reporting policy
|
|
56
|
+
- [Code of Conduct](https://github.com/vllnt/convex-helpers/blob/main/CODE_OF_CONDUCT.md): Community participation guidelines
|
|
57
|
+
|
|
58
|
+
## Ecosystem
|
|
59
|
+
|
|
60
|
+
- [vllnt oss](https://oss.vllnt.com/llms.txt): Index of the vllnt open-source packages on npm
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vllnt/convex-helpers",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1-canary.d891d28",
|
|
4
4
|
"description": "Typed Convex host-side utilities, trusted-origin and cookie configuration helpers, identity-row glue, and optional MCP tools.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
10
10
|
"src",
|
|
11
|
-
"
|
|
12
|
-
"docs",
|
|
11
|
+
"docs/API.md",
|
|
13
12
|
"CHANGELOG.md",
|
|
14
13
|
"NOTICE",
|
|
15
14
|
"llms.txt",
|
|
15
|
+
"!src/**/*.test.*",
|
|
16
16
|
"!src/**/*.spec.*"
|
|
17
17
|
],
|
|
18
18
|
"exports": {
|
|
@@ -49,12 +49,13 @@
|
|
|
49
49
|
"build": "tsc --project ./tsconfig.build.json",
|
|
50
50
|
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/typecheck.tsbuildinfo && tsc --noEmit --project tests/tsconfig.json",
|
|
51
51
|
"typecheck:ci": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/typecheck-ci.tsbuildinfo --project tsconfig.ci.json && tsc --noEmit --project tests/tsconfig.json",
|
|
52
|
-
"lint": "pnpm check:agents && pnpm check:docs && eslint --cache --cache-location node_modules/.cache/eslint/ .",
|
|
52
|
+
"lint": "pnpm check:agents && pnpm check:docs && pnpm check:package && eslint --cache --cache-location node_modules/.cache/eslint/ .",
|
|
53
53
|
"test": "vitest run --passWithNoTests",
|
|
54
54
|
"test:watch": "vitest --typecheck --clearScreen false",
|
|
55
55
|
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
56
56
|
"generate:llms": "node scripts/generate-llms.mjs",
|
|
57
57
|
"check:docs": "node scripts/check-docs.mjs",
|
|
58
|
+
"check:package": "node scripts/check-package.mjs",
|
|
58
59
|
"preversion": "pnpm install --frozen-lockfile && pnpm build && pnpm test && pnpm typecheck && pnpm generate:llms",
|
|
59
60
|
"check:agents": "node -e \"const f=require('node:fs');if(!f.existsSync('AGENTS.md')||f.existsSync('CLAUDE.md')||f.existsSync('.claude'))process.exit(1)\""
|
|
60
61
|
},
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
"publishConfig": {
|
|
111
112
|
"access": "public"
|
|
112
113
|
},
|
|
113
|
-
"homepage": "https://
|
|
114
|
+
"homepage": "https://oss.vllnt.com/packages/convex-helpers",
|
|
114
115
|
"bugs": {
|
|
115
116
|
"url": "https://github.com/vllnt/convex-helpers/issues"
|
|
116
117
|
},
|
package/docs/READINESS.md
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
# Publication remediation evidence
|
|
2
|
-
|
|
3
|
-
Status: **not publication-ready**: an independent review is done (2026-10-31, no
|
|
4
|
-
critical or high findings) and its fixes are applied, and the real Better Auth
|
|
5
|
-
login/JWT proof now passes locally (2026-11-03, see below). Publication still
|
|
6
|
-
needs the maintainer's release decision.
|
|
7
|
-
|
|
8
|
-
## Repairs and checks
|
|
9
|
-
|
|
10
|
-
- Origin preview allowlisting no longer bypasses scheme/credential/path
|
|
11
|
-
validation. Wildcards require an exact explicitly configured HTTPS pattern
|
|
12
|
-
with a single prefixed/suffixed wildcard label and fixed DNS suffix. Host
|
|
13
|
-
deployment ownership remains a prerequisite.
|
|
14
|
-
- Local HTTP rejects paths and URL normalization; controls reject before
|
|
15
|
-
trimming.
|
|
16
|
-
- Cookies require a validated HTTPS origin. SameSite=None remains opt-in host
|
|
17
|
-
policy.
|
|
18
|
-
- Retarget callbacks execute sequentially, stop on error and reject pages over
|
|
19
|
-
1000 before side effects. Host authorization and transaction boundaries remain
|
|
20
|
-
mandatory.
|
|
21
|
-
- MCP before-hook throws/timeouts deny dispatch generically. Auth and lifecycle
|
|
22
|
-
callbacks have 10-second deadlines; underlying host work is not cancelled.
|
|
23
|
-
- Raw tool/resource errors and attacker-controlled reserved keys are not logged.
|
|
24
|
-
Host hooks own observability/redaction; explicit hook-returned messages are
|
|
25
|
-
public.
|
|
26
|
-
- `AuthCtx.trustedIssuer` is required; missing/empty configuration and
|
|
27
|
-
mismatched issuer claims fail closed before row callbacks.
|
|
28
|
-
- README/API/llms describe actual shipped surfaces and conditional bootstrap
|
|
29
|
-
safety.
|
|
30
|
-
- Release notes are passed via a file, not interpolated shell source. Stable
|
|
31
|
-
release runs only from a `vX.Y.Z` tag on main that matches `package.json` and
|
|
32
|
-
`CHANGELOG.md`; default workflow permissions are read-only.
|
|
33
|
-
|
|
34
|
-
Commands executed from this repository:
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
pnpm install --frozen-lockfile
|
|
38
|
-
pnpm lint
|
|
39
|
-
pnpm build
|
|
40
|
-
pnpm typecheck
|
|
41
|
-
pnpm test:coverage
|
|
42
|
-
pnpm audit --json
|
|
43
|
-
pnpm audit --prod --json
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Coverage at the remediation checkpoint: 204 tests (including a real-clock policy
|
|
47
|
-
timeout), 100% statements, branches, functions and lines. Strict lint now
|
|
48
|
-
includes identity integration tests and schema; legacy MCP integration fixtures
|
|
49
|
-
remain excluded, explicitly rather than all tests. Typechecks now include host
|
|
50
|
-
wrappers. Packed runtime imports of all four entries passed, and packed API
|
|
51
|
-
TypeScript checks passed using
|
|
52
|
-
`tsc --ignoreConfig --noEmit --strict --skipLibCheck --module NodeNext --target ES2022`
|
|
53
|
-
against the installed local tarball. No publish command was executed.
|
|
54
|
-
|
|
55
|
-
## Independent review (2026-10-31)
|
|
56
|
-
|
|
57
|
-
A read-only source review found no critical or high issues. Outcome:
|
|
58
|
-
|
|
59
|
-
| Finding | Result |
|
|
60
|
-
| ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
|
|
61
|
-
| Subject-only lookups share a row across issuers (medium) | Fixed: `trustedIssuer` required, fail closed. Regression tests in `identity.e2e.test.ts`. |
|
|
62
|
-
| Optional `trustedIssuer` accepts any issuer (medium) | Fixed with the above. |
|
|
63
|
-
| Resources skip `onToolCall`/`before` hooks (medium) | Documented; an `onResourceRead` hook would be a future minor. |
|
|
64
|
-
| `timeout: 0` means no timeout (low) | Documented, unchanged. |
|
|
65
|
-
| Example injects the raw bearer into args (low) | Fixed: example injects a derived principal; `apiKey` documented as sensitive. |
|
|
66
|
-
| Resources accept `_`-prefixed params (low) | Fixed: rejected before dispatch. Regression test in `server.test.ts`. |
|
|
67
|
-
| No body, stream or deadline caps (low) | Documented as a host/platform duty. |
|
|
68
|
-
| Preview wildcard depends on Better Auth matcher (plausible) | Checked in Better Auth 1.7.12 source: `*` can span `.`. Documented; pattern shape tested. |
|
|
69
|
-
| SameSite=None, cursor secret, no Origin check, Bearer case, `isAnonymous`, `retargetRows` outcome (low) | Documented; no behavior change. |
|
|
70
|
-
|
|
71
|
-
Review limits: source reading only. Real login/JWT behavior was not exercised.
|
|
72
|
-
|
|
73
|
-
## Dependency reachability
|
|
74
|
-
|
|
75
|
-
Development-only advisories (Handlebars, esbuild, deepmerge-ts) are fixed with
|
|
76
|
-
scoped overrides in `package.json` (`handlebars@<4.7.10`,
|
|
77
|
-
`deepmerge-ts@<8.0.0`); other overrides were dropped once the lockfile resolved
|
|
78
|
-
the same versions without them.
|
|
79
|
-
|
|
80
|
-
Remaining: `minimatch` (3.x and 10.x, moderate,
|
|
81
|
-
[GHSA-g3hv-75wg-m249](https://github.com/advisories/GHSA-g3hv-75wg-m249)),
|
|
82
|
-
reached only through `@vllnt/eslint-config` lint tooling. The fix is minimatch
|
|
83
|
-
11, a major outside those packages' ranges, so no override is applied. Not
|
|
84
|
-
imported by package runtime. `pnpm audit --prod` reports zero advisories; this
|
|
85
|
-
is not proof for a host's independently installed optional peers. Convex CLI's
|
|
86
|
-
esbuild 0.27.0 is outside the reported vulnerable range (>=0.27.3 <0.28.1).
|
|
87
|
-
|
|
88
|
-
## Unverified conditions
|
|
89
|
-
|
|
90
|
-
- The Better Auth proof covers only the cases listed under its section below.
|
|
91
|
-
Not exercised: HTTPS cookies (`cookieSettingsForSite`), preview-pattern
|
|
92
|
-
origins, anonymous-to-registered account linking with `retargetRows`, social
|
|
93
|
-
or other plugins, and Better Auth 1.7.x (the component's peer range is
|
|
94
|
-
`<1.7.0`).
|
|
95
|
-
- No publishing, merging, tagging, visibility changes or production access
|
|
96
|
-
performed.
|
|
97
|
-
|
|
98
|
-
## Real local backend proof
|
|
99
|
-
|
|
100
|
-
Executed
|
|
101
|
-
`HOME=$(mktemp -d /tmp/helpers-home.XXXXXX) CONVEX_AGENT_MODE=anonymous node scripts/local-identity-proof.mjs`
|
|
102
|
-
through a managed process with declared 3340/3341 ports. Convex CLI 1.45.0
|
|
103
|
-
configured an anonymous local backend, created CLI-owned bindings in a temporary
|
|
104
|
-
fixture, deployed the indexed mutation and ran 16 simultaneous HTTP mutations.
|
|
105
|
-
All returned the same row ID; a separate query found exactly one row. Exit
|
|
106
|
-
status 0. No cloud account, production deployment or hand-edited generated
|
|
107
|
-
files. Identity injection was synthetic and cannot prove Better Auth login or
|
|
108
|
-
JWT integration. The retained script reproduces this evidence. Stable publishing
|
|
109
|
-
is tag-driven and uses reviewed current versions only.
|
|
110
|
-
|
|
111
|
-
## Real Better Auth login/JWT proof
|
|
112
|
-
|
|
113
|
-
Executed on 2026-11-03:
|
|
114
|
-
|
|
115
|
-
```sh
|
|
116
|
-
node scripts/better-auth-proof.mjs
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Result: `RESULT: PASS`, 13 assertions, exit status 0, about one minute. The
|
|
120
|
-
script builds a throwaway fixture under `/var/tmp`, installs its dependencies
|
|
121
|
-
there with `npm install --ignore-scripts --before <now - 7 days>` (nothing is
|
|
122
|
-
added to this package), starts an anonymous local Convex backend on ports
|
|
123
|
-
3350/3351 with an isolated `HOME`, generates `BETTER_AUTH_SECRET` randomly and
|
|
124
|
-
passes it over stdin, then deletes the fixture, `HOME` and backend process. No
|
|
125
|
-
cloud account, production deployment or hand-edited generated files. Rerunning
|
|
126
|
-
needs the network for npm and for the local backend download.
|
|
127
|
-
|
|
128
|
-
Pinned local backend: `precompiled-2026-10-22-1447815` (published 2026-10-22),
|
|
129
|
-
selected with the Convex CLI's `convex dev --local-backend-version` flag; the
|
|
130
|
-
script prints `Local backend: <version>`. The CLI's default is a moving
|
|
131
|
-
"latest", so the pin is what makes reruns reproducible.
|
|
132
|
-
Child processes inherit the caller's environment (so proxy and custom CA
|
|
133
|
-
settings still apply) minus every `CONVEX_*` variable, plus the script's own
|
|
134
|
-
`HOME`, ports and `CONVEX_AGENT_MODE=anonymous`, so `CONVEX_DEPLOYMENT`, `CONVEX_URL`,
|
|
135
|
-
`CONVEX_DEPLOY_KEY` and other `CONVEX_*` variables from the caller's shell
|
|
136
|
-
cannot redirect it.
|
|
137
|
-
|
|
138
|
-
Versions used: `convex` 1.48.0, `better-auth` 1.6.33, `@convex-dev/better-auth`
|
|
139
|
-
0.12.6, `jose` 6.2.13 (test token forging only), Node 24.22.1. The fixture
|
|
140
|
-
follows the component's documented setup: `app.use(betterAuth)`,
|
|
141
|
-
`getAuthConfigProvider()`,
|
|
142
|
-
`betterAuth({ plugins: [anonymous(), convex({ authConfig })] })` and
|
|
143
|
-
`registerRoutes`. It copies `src/identity.ts` and `src/better-auth.ts` unchanged
|
|
144
|
-
and calls them from Convex functions, with
|
|
145
|
-
`trustedOrigins: trustedOriginsFromCsv(siteUrl, ...)` configured in Better Auth
|
|
146
|
-
and `trustedIssuer` set to the deployment's site URL.
|
|
147
|
-
|
|
148
|
-
Asserted against real Better Auth sessions and tokens:
|
|
149
|
-
|
|
150
|
-
- Anonymous plugin sign-in and a separate email/password sign-in each issue a
|
|
151
|
-
token from `GET /api/auth/convex/token` with `iss` equal to the deployment
|
|
152
|
-
site URL, `aud` `convex` and `sub` equal to the Better Auth user id. The
|
|
153
|
-
anonymous token carries `isAnonymous: true`; the email token's is not `true`.
|
|
154
|
-
- Convex's `ctx.auth.getUserIdentity()` reports the same issuer, subject and
|
|
155
|
-
`isAnonymous` custom claim.
|
|
156
|
-
- `getOrCreateFromAuth` accepts both, inserts one row per subject, is
|
|
157
|
-
idempotent, and reports `isAnonymous` true and false respectively;
|
|
158
|
-
`getFromAuth` returns `null` before bootstrap and the flagged row after.
|
|
159
|
-
- Rejected: no token (`UNAUTHENTICATED`), `trustedIssuer` mismatch on a valid
|
|
160
|
-
token (`UNAUTHENTICATED`, no row written), payload edited with the signature
|
|
161
|
-
kept, foreign issuer signed with a foreign key, correct issuer signed with a
|
|
162
|
-
foreign key, and a real Better Auth token after it expires (valid just before,
|
|
163
|
-
rejected with "expired" later). Convex tolerates a few seconds of clock skew,
|
|
164
|
-
so the script waits 10 seconds past expiry. Queries can be served from the
|
|
165
|
-
backend cache, so the expiry check uses a mutation.
|
|
166
|
-
- Better Auth refuses a sign-in from an origin outside `trustedOrigins` (403)
|
|
167
|
-
and issues no token after sign-out.
|
|
168
|
-
|
|
169
|
-
The proof can fail: with the issuer check in `src/identity.ts` disabled, the
|
|
170
|
-
mismatch assertion fails and the script exits 1. `convex dev --once --start`
|
|
171
|
-
exits 0 even when the started command fails, so the script requires a result
|
|
172
|
-
marker that is written only after all assertions pass.
|
|
173
|
-
|
|
174
|
-
Findings: none. The helpers accepted every real token and rejected every invalid
|
|
175
|
-
one; no change to `src/` was needed.
|