@palbase/backend 39.1.3 → 39.1.5
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/MIGRATION.md +363 -0
- package/README.md +56 -10
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/engine/index.d.cts +3 -3
- package/dist/engine/index.d.ts +3 -3
- package/dist/{index-pK2At5Yc.d.cts → index-CCY1h_J2.d.cts} +3 -3
- package/dist/{index-Brhp8cxj.d.cts → index-Db5QHdTa.d.cts} +2 -2
- package/dist/{index-Dlu2b9-f.d.ts → index-QWN1Ncrv.d.ts} +2 -2
- package/dist/{index-eN4KzGa5.d.ts → index-fLaf0PN2.d.ts} +3 -3
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/openapi/index.d.cts +2 -2
- package/dist/openapi/index.d.ts +2 -2
- package/dist/{registry-B8ddZiMY.d.ts → registry-C7tCRyPm.d.ts} +1 -1
- package/dist/{registry-9dNeVN5d.d.cts → registry-CH6HRR6T.d.cts} +1 -1
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +1 -1
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js.map +1 -1
- package/docs/auth.md +4 -3
- package/docs/llms-full.txt +4 -3
- package/package.json +4 -3
- package/template/AGENTS.md +1 -1
- package/docs/paltimate/2026-09-06-fake-offset-claim/research.md +0 -75
- package/docs/paltimate/2026-09-06-fake-offset-claim/verification.md +0 -145
package/docs/auth.md
CHANGED
|
@@ -252,9 +252,10 @@ caller's permissions — pushed over realtime the moment a role changes.
|
|
|
252
252
|
## Email verification
|
|
253
253
|
|
|
254
254
|
The platform handles verification end to end. **You do not configure a sender**,
|
|
255
|
-
and `
|
|
256
|
-
|
|
257
|
-
notification tenant,
|
|
255
|
+
and `palbase notifications providers` / `palbase notifications templates` are
|
|
256
|
+
unrelated — those manage providers and templates for **your app's own**
|
|
257
|
+
notifications. Auth email goes out through Palbase's own notification tenant,
|
|
258
|
+
not yours.
|
|
258
259
|
|
|
259
260
|
What happens on `POST /auth/signup`:
|
|
260
261
|
|
package/docs/llms-full.txt
CHANGED
|
@@ -1071,9 +1071,10 @@ caller's permissions — pushed over realtime the moment a role changes.
|
|
|
1071
1071
|
## Email verification
|
|
1072
1072
|
|
|
1073
1073
|
The platform handles verification end to end. **You do not configure a sender**,
|
|
1074
|
-
and `
|
|
1075
|
-
|
|
1076
|
-
notification tenant,
|
|
1074
|
+
and `palbase notifications providers` / `palbase notifications templates` are
|
|
1075
|
+
unrelated — those manage providers and templates for **your app's own**
|
|
1076
|
+
notifications. Auth email goes out through Palbase's own notification tenant,
|
|
1077
|
+
not yours.
|
|
1077
1078
|
|
|
1078
1079
|
What happens on `POST /auth/signup`:
|
|
1079
1080
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@palbase/backend",
|
|
3
|
-
"version": "39.1.
|
|
3
|
+
"version": "39.1.5",
|
|
4
4
|
"description": "Palbase Backend SDK — class controllers (@Controller/@Get/@Post + @Body/@QueryParams/@Param), error classes, schema DSL",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
"dist",
|
|
93
93
|
"docs",
|
|
94
94
|
"stager",
|
|
95
|
-
"template"
|
|
95
|
+
"template",
|
|
96
|
+
"MIGRATION.md"
|
|
96
97
|
],
|
|
97
98
|
"dependencies": {
|
|
98
99
|
"@asteasolutions/zod-to-openapi": "^7.3.4",
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
"typescript": "^5.7.0",
|
|
111
112
|
"unplugin-swc": "^1.5.11",
|
|
112
113
|
"vitest": "^3.0.0",
|
|
113
|
-
"@palbase/core": "^2.
|
|
114
|
+
"@palbase/core": "^2.5.0"
|
|
114
115
|
},
|
|
115
116
|
"publishConfig": {
|
|
116
117
|
"access": "public",
|
package/template/AGENTS.md
CHANGED
|
@@ -16,7 +16,7 @@ import { Controller, Get, Post, Body, Param, User, z, Database, NotFound } from
|
|
|
16
16
|
> field would arrive `undefined`, and the build says so by name.
|
|
17
17
|
|
|
18
18
|
**The full reference** — every decorator, every platform service, every schema
|
|
19
|
-
helper — is at <https://
|
|
19
|
+
helper — is at <https://palbase.studio/llms.txt> (`/llms-full.txt` for
|
|
20
20
|
agents). This file does not repeat it; it says what the code should LOOK like.
|
|
21
21
|
|
|
22
22
|
## The layers
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# Fake pagination and claim: verification sources
|
|
2
|
-
|
|
3
|
-
Verified 2026-09-06. Scope: repair the two existing in-memory fake contracts,
|
|
4
|
-
using the repository's existing runtime and test runner. No new dependency or
|
|
5
|
-
public API is introduced.
|
|
6
|
-
|
|
7
|
-
| ID | Existing tool | Stakes | Tier | Status | Evidence |
|
|
8
|
-
| --- | --- | --- | --- | --- | --- |
|
|
9
|
-
| UD-001 | Bun 1.3.9 for independent consumer probes | 1 | quick | verified | `bun --version`; published-package and built-package probe executions |
|
|
10
|
-
| UD-002 | Vitest 3.2.4 for SDK regressions | 1 | quick | verified | `backend/package.json`, runtime version output, Context7 CLI documentation |
|
|
11
|
-
|
|
12
|
-
CLAIM: Bun supports direct TypeScript execution and reports test/runtime failures
|
|
13
|
-
with a nonzero exit status. SOURCE:
|
|
14
|
-
https://github.com/oven-sh/bun/blob/main/docs/test/runtime-behavior.mdx
|
|
15
|
-
VERIFIED: 2026-09-06 via Context7 and actual Bun 1.3.9 probe exits 1/0.
|
|
16
|
-
TIER: quick. Current docs are not an assertion that their latest Bun version is
|
|
17
|
-
the installed version; the installed runtime was measured separately.
|
|
18
|
-
|
|
19
|
-
CLAIM: Vitest's file arguments select test paths; `run` performs a single run.
|
|
20
|
-
SOURCE: https://github.com/vitest-dev/vitest/blob/v3.2.4/docs/guide/cli.md
|
|
21
|
-
VERIFIED: 2026-09-06 via Context7 and focused red/green executions.
|
|
22
|
-
TIER: quick.
|
|
23
|
-
|
|
24
|
-
CLAIM: `--no-file-parallelism` runs test files without file concurrency.
|
|
25
|
-
SOURCE: https://github.com/vitest-dev/vitest/blob/v3.2.4/docs/guide/debugging.md
|
|
26
|
-
VERIFIED: 2026-09-06 via Context7 and installed
|
|
27
|
-
`pnpm --filter @palbase/backend exec vitest --help --fileParallelism`.
|
|
28
|
-
TIER: quick. This flag changes scheduling, preserving test assertions, selected
|
|
29
|
-
files, type checking, and timeouts.
|
|
30
|
-
|
|
31
|
-
The SDK contracts were checked against local primary sources:
|
|
32
|
-
|
|
33
|
-
- `docs/database.md:179`: `now()` works in `claim` and other insert operations.
|
|
34
|
-
- `docs/database.md:355`: offset requires limit.
|
|
35
|
-
- `src/engine/db.ts:1403`: nonnegative integer limit validation.
|
|
36
|
-
- `src/engine/db.ts:1417`: nonnegative integer offset validation and limit requirement.
|
|
37
|
-
- `src/engine/db.ts:2362`: claim merges unique/extra and compiles insert expressions.
|
|
38
|
-
- `src/__tests__/helpers/mock-db.ts:277`: existing insert-expression resolver.
|
|
39
|
-
|
|
40
|
-
Runtime evidence separating the hypotheses is in `verification.md`.
|
|
41
|
-
|
|
42
|
-
## Publication follow-up
|
|
43
|
-
|
|
44
|
-
The user requested publication after the source fix was verified. Publication
|
|
45
|
-
uses the repository's existing Changesets workflow; stakes 3, standard tier.
|
|
46
|
-
Context7 was attempted twice but its transport was unavailable, so the official
|
|
47
|
-
Changesets CLI documentation was read directly and checked against the local
|
|
48
|
-
workflow and a successful live run.
|
|
49
|
-
|
|
50
|
-
| ID | Existing approach | Stakes | Tier | Status | Evidence |
|
|
51
|
-
| --- | --- | --- | --- | --- | --- |
|
|
52
|
-
| UD-003 | Changesets version commit followed by the main release workflow | 3 | standard | verified | `.github/workflows/release.yml`, `package.json`, official CLI docs and run 34035374818 |
|
|
53
|
-
|
|
54
|
-
CLAIM: `changeset version` updates package versions/changelogs, and `publish`
|
|
55
|
-
publishes package versions absent from npm. SOURCE:
|
|
56
|
-
https://github.com/changesets/changesets/blob/main/docs/command-line-options.md
|
|
57
|
-
VERIFIED: 2026-09-06 via official documentation, installed CLI 2.30.0, and the
|
|
58
|
-
repository's `ci:version`/`ci:publish` scripts. TIER: standard.
|
|
59
|
-
|
|
60
|
-
CLAIM: This repository versions locally, pushes to main, verifies matching core
|
|
61
|
-
images first, then publishes npm and advances latest/next. SOURCE:
|
|
62
|
-
https://github.com/palgroup/palbase-ts/blob/e9765e8460bbe9c4a20641f805a5e682f0097174/.github/workflows/release.yml
|
|
63
|
-
and https://github.com/palgroup/palbase-ts/actions/runs/34035374818
|
|
64
|
-
VERIFIED: 2026-09-06 via the workflow source and GitHub run state. TIER: standard.
|
|
65
|
-
|
|
66
|
-
Registry evidence: `latest` and `next` both resolve to 36.0.1; querying 36.0.2
|
|
67
|
-
returned E404 before versioning. Only the backend package is selected for a
|
|
68
|
-
patch release, with the existing image-before-npm order preserved.
|
|
69
|
-
|
|
70
|
-
Publication preflight observation: `ci:version` initially failed in the GitHub
|
|
71
|
-
changelog adapter because the local fix commit was not yet on GitHub. The commit
|
|
72
|
-
API returned HTTP 422 for `bfd6060` and resolved the existing base commit, ruling
|
|
73
|
-
out an authentication failure. Publishing the fix commit to a temporary branch
|
|
74
|
-
made the same `ci:version` command succeed without changing tooling or workflow.
|
|
75
|
-
Only backend package version/changelog and the consumed changeset changed.
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# Backend fake defects: proof, fix, proof
|
|
2
|
-
|
|
3
|
-
Date: 2026-09-06. Runtime: Bun 1.3.9, macOS arm64.
|
|
4
|
-
Published baseline: `@palbase/backend@36.0.0` from npm, unchanged.
|
|
5
|
-
Source baseline: nested `palbase-ts` repository, commit `295958d`, package 36.0.1.
|
|
6
|
-
The source checkout still contained both reported defects.
|
|
7
|
-
|
|
8
|
-
## Reproduction
|
|
9
|
-
|
|
10
|
-
The supplied `scripts/reproduce-sdk-bugs.ts` was absent from this workspace.
|
|
11
|
-
`backend/scripts/reproduce-sdk-bugs.ts` reconstructs the two supplied independent
|
|
12
|
-
contracts with public package imports and no application fixtures or credentials.
|
|
13
|
-
An identical copy was run in a scratch consumer of the published npm tarball.
|
|
14
|
-
|
|
15
|
-
Published baseline commands:
|
|
16
|
-
|
|
17
|
-
```sh
|
|
18
|
-
npm pack @palbase/backend@36.0.0 --ignore-scripts --pack-destination /tmp/palbase-sdk-fake-proof.CaHHuo --json
|
|
19
|
-
# Scratch package depends on that unchanged tarball.
|
|
20
|
-
bun install --ignore-scripts
|
|
21
|
-
bun reproduce-sdk-bugs.ts
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Observed before any source fix:
|
|
25
|
-
|
|
26
|
-
```text
|
|
27
|
-
FAIL findMany honors offset before limit
|
|
28
|
-
actual: [{ id: 'a' }], expected: [{ id: 'b' }]
|
|
29
|
-
FAIL claim evaluates now() in returned and stored rows
|
|
30
|
-
actual typeof created_at: 'object', expected: 'string'
|
|
31
|
-
0 passed, 2 failed
|
|
32
|
-
exit 1
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
The raw claim's returned AND stored rows carried `Symbol(palbase.tx.expr)`.
|
|
36
|
-
Tarball SHA-1 from npm pack: `0c665f63e2a9b98f5f736df050d17038305a5399`.
|
|
37
|
-
|
|
38
|
-
## Hypotheses and runtime discrimination
|
|
39
|
-
|
|
40
|
-
Pagination hypotheses: ignored offset, lost typed forwarding, wrong ordering.
|
|
41
|
-
With deliberately unsorted `c,a,b` seeds, raw calls at offsets 0, 1, 2 and 3
|
|
42
|
-
all returned `a`. Sorting therefore ran, and bypassing the typed wrapper still
|
|
43
|
-
failed. The source pagination step used `slice(0, limit)` and its local option
|
|
44
|
-
type omitted offset.
|
|
45
|
-
|
|
46
|
-
Claim hypotheses: skipped insert-expression evaluation, incompatible expression
|
|
47
|
-
marker, accidental materialization during reading. Passing the SAME `now()`
|
|
48
|
-
object to insert and claim returned a timestamp from insert, while claim stored
|
|
49
|
-
that original expression object by identity. A later read also returned the
|
|
50
|
-
expression, excluding a return-only formatting error.
|
|
51
|
-
|
|
52
|
-
Observed paths, cross-checked against the source:
|
|
53
|
-
|
|
54
|
-
- Public `/test` export → `src/test/fake-db.ts:65` → shared
|
|
55
|
-
`src/__tests__/helpers/mock-db.ts` operation implementation.
|
|
56
|
-
- Typed `fake.db.public.<table>.findMany` → `src/runtime.ts:498` → the same
|
|
57
|
-
raw operation, with offset forwarded.
|
|
58
|
-
- Typed claim → `src/runtime.ts:531` → raw claim.
|
|
59
|
-
- The helper is bundled into the shipped `/test` entry by `tsup.config.ts`;
|
|
60
|
-
its `__tests__` directory name does not make it an unused test-only copy.
|
|
61
|
-
|
|
62
|
-
## Source regression proof and changes
|
|
63
|
-
|
|
64
|
-
Command before and after the implementation change, from `backend`:
|
|
65
|
-
|
|
66
|
-
```sh
|
|
67
|
-
pnpm test src/test/fake-db.test.ts src/test/fake-db-parity.test.ts
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
| Tree | Result | Exit |
|
|
71
|
-
| --- | --- | --- |
|
|
72
|
-
| Original existing focused suite | 37 passed | 0 |
|
|
73
|
-
| New regressions, original implementation | 12 failed, 38 passed | 1 |
|
|
74
|
-
| Same tests, fixed implementation | 50 passed, no type errors | 0 |
|
|
75
|
-
|
|
76
|
-
The repair applies offset after filtering/ordering and before projection, and
|
|
77
|
-
uses the engine's existing limit/offset validation contract. Claim reuses the
|
|
78
|
-
insert-expression resolver and write-value guards before storing a new row.
|
|
79
|
-
Existing-row claims still return the original row without recording a new write.
|
|
80
|
-
|
|
81
|
-
Coverage includes raw and typed calls, filter/sort/projection ordering, distinct
|
|
82
|
-
pages, omitted/zero offset, an empty tail, zero limit, invalid pagination,
|
|
83
|
-
timestamp validity in returned/stored/tracked rows, repeated claims, and refusal
|
|
84
|
-
of invalid insert values without side effects. Explicit `id` lookup/deletion
|
|
85
|
-
semantics are unaffected.
|
|
86
|
-
|
|
87
|
-
## Built package and review
|
|
88
|
-
|
|
89
|
-
Fresh build: `pnpm -w turbo run build --filter=@palbase/backend` → exit 0,
|
|
90
|
-
backend cache miss, ESM/CJS/declarations generated.
|
|
91
|
-
|
|
92
|
-
From `backend`, against the built public package entry points:
|
|
93
|
-
|
|
94
|
-
```text
|
|
95
|
-
$ bun scripts/reproduce-sdk-bugs.ts
|
|
96
|
-
PASS findMany honors offset before limit
|
|
97
|
-
PASS claim evaluates now() in returned and stored rows
|
|
98
|
-
2 passed, 0 failed
|
|
99
|
-
exit 0
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
`pnpm typecheck` → exit 0.
|
|
103
|
-
`pnpm check:api` → exit 0; 424 exports and 421 signatures unchanged.
|
|
104
|
-
Independent reviewer: no actionable findings; separate source probe and
|
|
105
|
-
42-test fake suite both passed.
|
|
106
|
-
|
|
107
|
-
## Full-suite environment findings
|
|
108
|
-
|
|
109
|
-
The first shared-workspace `pnpm test` exited 1: 6 failed / 1900 passed tests,
|
|
110
|
-
3 collection failures and 3 worker RPC errors. It included ignored generated
|
|
111
|
-
Bun consumer tests under `bench/database-dx/generated/...`, which Vitest cannot
|
|
112
|
-
load (`bun:test`), plus five timeouts under concurrent load.
|
|
113
|
-
|
|
114
|
-
The sixth failure was an existing probabilistic cursor-test assertion:
|
|
115
|
-
`src/engine/cursor.test.ts:15` replaces character 10 with `x`, even when it
|
|
116
|
-
already is `x`. An independent loop observed this at attempt 82: the
|
|
117
|
-
"changed" token equalled the original, and decoding correctly accepted it.
|
|
118
|
-
Neither this test nor cursor implementation is changed by this fix.
|
|
119
|
-
|
|
120
|
-
Final suite verification uses a detached temporary checkout at the same commit,
|
|
121
|
-
with identical fix/test/probe files and the existing installed dependencies.
|
|
122
|
-
File scheduling is serial; no assertions, timeouts or test selections are changed.
|
|
123
|
-
The copied implementation, regression tests, and independent probe were checked
|
|
124
|
-
byte-for-byte against the working files with `cmp` (all exit 0).
|
|
125
|
-
|
|
126
|
-
Final command, from the isolated checkout's `backend` directory:
|
|
127
|
-
|
|
128
|
-
```text
|
|
129
|
-
$ pnpm test --no-file-parallelism
|
|
130
|
-
Test Files 128 passed (128)
|
|
131
|
-
Tests 1906 passed (1906)
|
|
132
|
-
Type Errors no errors
|
|
133
|
-
Duration 38.41s
|
|
134
|
-
exit 0
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
The isolated checkout was also freshly built (backend cache miss, exit 0), and
|
|
138
|
-
`bun scripts/reproduce-sdk-bugs.ts` there returned 2 passed / 0 failed, exit 0.
|
|
139
|
-
The shared workspace's generated Bun tests are not tracked SDK test files; their
|
|
140
|
-
absence in this checkout accounts for the three fewer collected files.
|
|
141
|
-
|
|
142
|
-
Full raw command logs are retained in `/tmp/palbase-sdk-fake-proof.CaHHuo`.
|
|
143
|
-
This initial verification covered source and local build artifacts, with no live
|
|
144
|
-
PostgreSQL run. The user subsequently requested publication as backend 36.0.2;
|
|
145
|
-
its registry installation is checked with the same independent contract probes.
|