Repository navigation
Commit 3fbf3ca
fix(core,drivers,formula,metadata,objectql,platform-objects): refusals, field help and log lines state each decision in words instead of a tracker number (stage 5) (#20924)
Part of #20513
Clause-②: no
**Stage 5 of this lane (the other seven packages, plus the `objectql`
`findOne` refusal stage 3 held), under the maintainer's A / A ruling on
the card: the author-visible text and the log lines.** The stage is over
the ~80-string stop line (94 ledgered literals plus 2 URL-form
messages), so it lands in two parts: this PR carries every refusal,
prescription, metadata text and log line, and the 28 `src/`-shipped test
strings are reported as stage 5b below. #20513 remains open for stage
5b, so this PR carries no closing keyword. Text only: no error `code`,
field name, HTTP status, export or control flow moves.
## What this does
Refusals, prescriptions, field help and log lines in `core`,
`driver-memory`, `driver-mongodb`, `formula`, `metadata`,
`metadata-core` and `platform-objects` (and the one held `objectql`
string) sent the reader to a tracker number for the reason behind them.
Each rewritten string now says the reason in words (form D, as the
migration-entry rewrite and stages 1 to 4 applied it). Where the
sentence already stated the decision, only the citation goes; where an
ADR stood beside the number, the ADR stays. Where the sentence did not
carry the decision, it now does:
| Where | Cited | The sentence now says |
|---|---|---|
| `core` `IMetadataService.register` refusals (thrown, 400) | 7378 rows
3 and 1 | "... so the contract refuses loudly and never coerces a value
into storability" / "... so the contract refuses loudly and names the
mismatch" |
| `core` init-order fault suffix on a `getService` miss during `init()`
(thrown) | 4131 | "a composition/ordering fault; registration order is
not a contract." |
| `core` admin standing surface ledger reasons | 8613, 11663 |
"`active`, which this resolver honours"; "RECLASSIFIED from `reads-only`
when the config anchor landed" |
| `driver-mongodb` retired aggregate function (thrown, 400) | 6188, 5907
| "was REMOVED from @objectstack/spec AggregationFunction (ADR-0049
enforce-or-remove: no SQL backend compiled it)" |
| `driver-mongodb` undeclared aggregate function (thrown, 400) | 5907,
12818 | "before this refusal, this builder answered any unrecognised
name with a $sum of that column ..." |
| `metadata` route ledger note (HMR POST route) | 12140 | "CHANGED when
the development-only mount gate landed" |
| `metadata` history-seq failure (error log) | 4825 | "numbering it from
1 (what this code once did) would collide ..." |
| `driver-memory` / `driver-mongodb` multi-tenancy refusals
(`MEMORY_MULTI_TENANT_UNSUPPORTED`, `MONGODB_MULTI_TENANT_UNSUPPORTED`)
| 6915, 16589, 3724 as tracker URLs | The trailing `Tracking:` line and
its URL constants go; the consequence sentence above it already says the
driver refuses rather than run (or answer) unisolated. |
Every other rewritten literal loses only its citation.
**The `findOne` pair.** `objectql` `engine.ts` `requireFindOnePredicate`
and `metadata-core` `engineFindOnePredicateRefusalMessage` are byte
twins compared by `objectql`'s `engine-findone-predicate.test.ts`, so
both drop the citation in one commit (`0a25891e6d`) and the parity pin
stays byte-exact.
**Metadata text.** The `sys_account` token help, the `sys_email` headers
help and the SCIM credential store's protection reason drop their
numbers in the source. The `en` bundle is regenerated with `node
scripts/check-i18n-bundles.mjs --write --filter=platform-objects`: the
generator rewrote the four `en` leaves from the source and kept every
translated-locale value verbatim (merge mode). So the number inside the
three translated `sys_account` token helps (es-ES, ja-JP, zh-CN) leaves
only by editing those values, which AGENTS.md permits for
translated-locale values (keys and structure untouched). None of those
leaves has a source-hash companion entry (they are translations, not
source copies), so nothing falls back; `check:i18n` and
`check:i18n-stale-fill` are green.
**The URL-form ids (bounded in-place fix).** The claim names
`driver-memory`'s URL-form id (the per-call seam's dead card link). The
same `Tracking:` line carries a second URL on both seams, and
`driver-mongodb`'s twin guard carries the same line. All three go
together: same defect class as this card, a mechanical fix, files inside
this stage's surface, and no new verification surface (each package's
own tests, re-pinned). These are the only changes that move code shape
(two module constants and one ternary that only composed the removed
line).
## Ledger (`scripts/doc-authoring-prose-id.baseline.json`), per file,
occurrences before → after
Recomputed with `node scripts/check-doc-authoring.mjs --census-ledger`
in each text commit. Only these packages' rows move; every other file's
row is identical (0 moved). Measured at merge base `4d0b9cd542` (the
ledger is byte-identical at `cb4c31dd52`, where the work started, and at
`599cc8c5f`).
| File | Before | After |
|---|---|---|
| `core/src/health-monitor.ts` | 3 | 0 |
| `core/src/metadata-service-contract.ts` | 2 | 0 |
| `core/src/plugin-order.ts` | 3 | 0 |
| `core/src/plugin-registration.ts` | 1 | 0 |
| `core/src/security/admin-standing-surface.ts` | 3 | 0 |
| `core/src/security/authz-cache-posture.ts` | 1 | 0 |
| `drivers/driver-memory/src/filter-refusal.ts` | 12 | 0 |
| `drivers/driver-mongodb/src/mongodb-aggregation.ts` | 7 | 0 |
| `drivers/driver-mongodb/src/mongodb-filter.ts` | 5 | 0 |
| `drivers/driver-mongodb/src/test-mongod.ts` | 3 | 3 (stage 5b) |
| `formula/src/matches-filter.ts` | 1 | 0 |
| `metadata-core/src/contract-suite.ts` | 1 | 1 (stage 5b) |
| `metadata-core/src/engine-delete-dispatch.ts` | 4 | 4 (stage 5b) |
| `metadata-core/src/engine-dispatch-unhonoured-predicate.ts` | 1 | 0 |
| `metadata-core/src/engine-findone-predicate.ts` | 4 | 3 (stage 5b) |
| `metadata-core/src/engine-update-dispatch.ts` | 20 | 18 (stage 5b) |
| `metadata-core/src/object-schema-fls-contract.ts` | 3 | 3 (stage 5b) |
| `metadata/src/endpoint-matcher.ts` | 1 | 0 |
| `metadata/src/loaders/database-loader.ts` | 1 | 0 |
| `metadata/src/metadata-manager.ts` | 1 | 0 |
| `metadata/src/metadata-route-ledger.ts` | 2 | 0 |
| `metadata/src/plugin.ts` | 1 | 0 |
| `objectql/src/engine.ts` | 1 | 0 |
| `platform-objects/src/apps/translations/en.objects.generated.ts` | 4 |
0 |
| `platform-objects/src/apps/translations/es-ES.objects.generated.ts` |
3 | 0 |
| `platform-objects/src/apps/translations/ja-JP.objects.generated.ts` |
3 | 0 |
| `platform-objects/src/apps/translations/zh-CN.objects.generated.ts` |
3 | 0 |
| `platform-objects/src/audit/sys-email.object.ts` | 1 | 0 |
| `platform-objects/src/identity/sys-account.object.ts` | 3 | 0 |
|
`platform-objects/src/identity/sys-scim-connection-credential.object.ts`
| 1 | 0 |
| `platform-objects/src/plugin.ts` | 2 | 0 |
| **This stage** | **101 in 31 files** | **32 in 6 files** |
Whole ledger: files 200 → 175, pairs 485 → 441, occurrences 722 → 653.
Gate census sites 615 → 549; every other package's (file, ids) sequence
is identical before and after.
## Stage 5b (the rest of this stage, not in this PR)
The `src/`-shipped test strings, 28 literals carrying 32 occurrences in
6 files, all case labels or suite titles: `metadata-core`
`contract-suite.ts` (1 `describe` title), `engine-delete-dispatch.ts` (4
case labels), `engine-findone-predicate.ts` (3 case labels),
`engine-update-dispatch.ts` (15 case labels, 18 occurrences),
`object-schema-fls-contract.ts` (2 case `why` texts, 3 occurrences), and
`driver-mongodb` `test-mongod.ts` (3: a skip reason, a warning and a
thrown message), whose number two assertions in
`mongodb-memory-server-gate.test.ts` pin. After 5b these packages leave
the ledger entirely and the card can close.
## Text-only proof
A TypeScript-AST skeleton of each changed source file (every string
literal and template text one placeholder, pure-literal `+` operands
collapsed, comments never read) at merge base `4d0b9cd542` and head
`1432546ac8`: 27 of 29 files SAME; 2 DIFF, the two tenancy guards, whose
diff is exactly the removed URL constants, the removed `tracking`
ternary and the removed `Tracking:` line. Control: the same tool reports
DIFF on `rest` `import-template.ts` across `6f1f1c1035` (a real code
change).
## Tests (head `1432546ac8` unless noted)
- Build: `turbo run build` over `./packages/*` and `./packages/*/*`,
71/71, after the merge of `origin/main`.
- `@objectstack/objectql` `vitest run --project local`, three shards
after the merge: 116 + 116 + 115 files, 2260 + 2011 + 2528 tests passed.
`typecheck` exit 0 (test layer: 40 files / 234 errors / 65 signatures
held in the debt ledger, unchanged).
- At `214951a19c` (the incoming `main` commits touch none of these
packages): `core` 61 files / 1795 tests; `driver-memory` 65 / 1413;
`driver-mongodb` 29 passed, 5 skipped / 661 passed, 172 skipped (the
skips need a MongoDB server); `formula` 42 / 1240; `metadata` 55 / 828;
`metadata-core` 16 / 298; `platform-objects` 59 / 948. Each package's
`typecheck` exit 0.
- Consumer check: `plugin-dev`
`dev-plugin-optional-load-failure.test.ts` (reads the `driver-memory`
refusal) 10 / 10.
- Consumer pins: every string fragment of every removed source line was
searched across all 4298 test files in the repo; no test pins a fragment
that no longer exists, other than the number pins re-pinned here.
**Re-pins (8 assertions in 8 test files), each proven able to fail.**
The number pins in `health-monitor.test.ts`,
`authz-cache-posture.test.ts`, `mongodb-aggregation.test.ts`,
`mongodb-unrecognised-aggregate-function.test.ts`,
`mongodb-tenancy-guard.test.ts`, `memory-tenancy-guard.test.ts`,
`memory-tenant-scope-refusal.test.ts` and `objectql`
`engine-update-dispatch.test.ts` now assert the sentence that states the
decision.
**Ablation and mutations, one-off, on the committed head (`214951a19c`),
under a restore trap, through `scripts/ablation-replace.mjs`:**
- `metadata-core` face alone (objectql's tests resolve it through
`dist/`): the `findOne` twin and the id-predicate message each marked,
`pnpm --filter @objectstack/metadata-core build`,
`ablation-dist-preflight` marker present in 2 built files.
`engine-findone-predicate.test.ts` + `engine-update-dispatch.test.ts`:
10 failed / 83 passed (9 parity cases, 1 re-pin). Restore: blob == HEAD
and `git diff HEAD` empty for both, rebuild, preflight `--absent`
(absent from all 12 built files), rerun 93 / 93.
- Source-imported re-pins (no build leg): health-monitor 1 failed / 25;
authz posture 1 failed / 21; the two MongoDB retired-aggregate files 4
failed / 31; MongoDB tenancy 1 failed / 16; driver-memory boot 1 failed
/ 19; driver-memory per-call 1 failed / 10. Every restore: blob == HEAD,
`git diff HEAD` empty. After the run: `git diff HEAD` 0 bytes, `git
status --porcelain` 0 lines.
## Gates
`node scripts/pm/dispatch-gates.mjs --commands` (no paths) at
`1432546ac8`: 78 commands, 39 paths vs merge base `4d0b9cd542`, 309
changed lines. All 78 run one at a time from the worktree, each exit 0;
`--ran`: "78 derived famil(ies) accounted for — 78 run, 0 NOT-MEASURED
(a DERIVED zero)". Among them: `check:doc-authoring` (549 pinned sites
across 175 files, no growth, no burn-down unrecorded), `check:i18n` (9
packages in sync), `check:i18n-stale-fill`, `check:nul-bytes`,
`check:driver-conformance`, `check:driver-memory-census`,
`check:engine-double-contract`, `check:type-check-debt`. Also run after
the merge: `pnpm --filter @objectstack/spec check:generated` exit 0.
Narrowed lint: `eslint --no-inline-config --format json` over the 37
changed `.ts` files: 37 files, 0 errors, 0 warnings (count read from
eslint's JSON; none ignored). The resolved `parserOptions` are
`ecmaVersion: latest, sourceType: module` with no `project` or
`projectService`, so no type-aware rule runs and this diff cannot move
an untouched file's verdict. Repo-wide `pnpm lint` is CI's.
NOT MEASURED locally (CI's): the live MongoDB cells of `driver-mongodb`,
the Test Core shards, Dogfood, the workspace type-check lanes.
## Acceptance notes
- `origin/main` was merged once before opening (`1432546ac8`); its only
overlap is `objectql` `engine.ts`, in disjoint hunks, and `objectql` was
re-tested after the merge.
- `#20822` group 1b (branch
`claude/issue-20822-g1b-f3-route-then-delete`) edits `metadata`
`database-loader.ts` in `queryHistory`; this PR touches that file only
at the history-seq error line, in a different hunk. Whichever lands
later merges `main`. It does not touch `filter-refusal.ts`.
- The es-ES, ja-JP and zh-CN `sys_email.headers_json` help values were
translated from an older source revision and lack its last sentence
(never returned on the generic data path). They carry no source-hash
entry, so they are legacy-trusted and never reported. Noted, not filed;
no carrier.
- The `$null` diagnostics in `driver-memory` and `driver-mongodb` still
describe the backends' old disagreement in the past tense, while the
Turso diagnostic (stage 4) says every driver now refuses it. Both are
true; only the wording differs. Noted, not filed.
- Code comments and docblocks in these files still cite ids; they are
outside this ruling.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 31c3996 commit 3fbf3ca
39 files changed
Lines changed: 120 additions & 189 deletions
File tree
- .changeset
- packages
- core/src
- security
- drivers
- driver-memory/src
- driver-mongodb/src
- formula/src
- metadata-core/src
- metadata/src
- loaders
- objectql/src
- platform-objects/src
- apps/translations
- audit
- identity
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
| 172 | + | |
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
451 | | - | |
| 450 | + | |
| 451 | + | |
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
| 477 | + | |
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
526 | 526 | | |
527 | 527 | | |
528 | 528 | | |
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| |||
568 | 568 | | |
569 | 569 | | |
570 | 570 | | |
571 | | - | |
| 571 | + | |
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
| 617 | + | |
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| |||
0 commit comments