Skip to content

Commit e7072f5

Browse files
committed
docs(fixtures): mark installed-base deleteBehavior fixtures as the pre-#9784 era; add changeset
The two #4447 audit-governance fixtures pin the PRE-#9784 artifact shape (materialized deleteBehavior on a datetime) — artifacts of that shape remain in the installed base and must keep loading, so the bytes stay; the comments now say which era they are. Changeset: @objectstack/spec minor. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rxnd8cyFnoU8V5y21PaTsy
1 parent f742c7e commit e7072f5

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
"@objectstack/spec": minor
3+
---
4+
5+
feat(spec): materialize `deleteBehavior` only on reference field types (#9784)
6+
7+
`FieldSchema` no longer materializes the `deleteBehavior: 'set_null'` default
8+
onto non-reference field types (`text` / `datetime` / `number` / every other
9+
non-relational type, `user` included). The key has no meaning there — the
10+
engine's `cascadeDeleteRelations` reads it exclusively on `master_detail` /
11+
`lookup` fields carrying a `reference` — yet the materialized default shipped
12+
in every built app artifact, where a parse-time default becomes an apparent
13+
explicit declaration downstream (the #4447 shadowing mechanism) and reads as
14+
meaningful to AI authors browsing the artifact.
15+
16+
What changes and what does not:
17+
18+
- **Bare non-reference fields** parse to output that **omits** `deleteBehavior`
19+
(previously: `deleteBehavior: 'set_null'` materialized on every type). Built
20+
artifacts thin accordingly — measured on the showcase app: 210 fields, the
21+
key drops from 206 fields to 16.
22+
- **`lookup` and `tree`** keep materializing `set_null` byte-identically, at
23+
shape position.
24+
- **`master_detail`** keeps omitting it (the #9689 idempotent-materialization
25+
ruling, unchanged).
26+
- **The accept-set is untouched**: an authored `deleteBehavior` on any field
27+
type parses exactly as before and round-trips verbatim, so artifacts built
28+
by earlier versions (which carry the materialized key on every field) remain
29+
fully legal inputs. `parse(parse(x))` holds across the boundary.
30+
31+
No authored metadata needs any change: no key is removed, renamed or
32+
re-shaped, and no authoring spelling that parsed before is refused now.

‎packages/metadata-protocol/src/protocol.audit-field-governance.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ function makeStubEngine() {
129129
* spelled `false` on two of the four and left ABSENT on the other two, because
130130
* absent defaults to false as well and the read must not be right only for the
131131
* spelling that happens to be explicit.
132+
*
133+
* `deleteBehavior: 'set_null'` on the datetime is the PRE-#9784 materializing
134+
* era — newly built artifacts omit the key on non-reference fields, but
135+
* artifacts of this shape remain in the installed base and must keep loading;
136+
* keep the bytes as they shipped.
132137
*/
133138
const artifactObject = (name: string) => ({
134139
name,

‎packages/objectql/src/engine-audit-anchor-write.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,12 @@ describe('[#4447] a declared audit field cannot loosen the platform posture', ()
244244
fields: {
245245
id: { name: 'id', label: 'ID', type: 'text' as const, primaryKey: true },
246246
title: { name: 'title', label: 'Title', type: 'text' as const },
247-
// Verbatim from examples/app-showcase/dist/objectstack.json.
247+
// Verbatim from the PRE-#9784 examples/app-showcase/dist/objectstack.json
248+
// — the materializing era, when FieldSchema baked `deleteBehavior:
249+
// 'set_null'` onto every type. Newly built artifacts omit the key on
250+
// non-reference fields (#9784), but artifacts of this shape remain in
251+
// the installed base and this suite pins that they cannot loosen audit
252+
// governance — keep the bytes as they shipped.
248253
created_at: {
249254
label: 'Created At', type: 'datetime' as const, required: false,
250255
searchable: false, multiple: false, unique: false,

0 commit comments

Comments
 (0)