Skip to content

Commit ab76fc6

Browse files
committed
chore: changeset and dogfood header for the commit doors' own-package addressing
Claude-Session: https://claude.ai/code/session_01JQwxbZ5jYNfPGLvPV8LYRe Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9179b36 commit ab76fc6

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
'@objectstack/metadata-protocol': patch
3+
---
4+
5+
fix(metadata-protocol)!: a package commit's revert plan and its revert address the committing package's own row; a revert whose row was deleted asks the package-less close, as the per-item rollback does
6+
7+
Clause-②: no (narrowing) — the commit revert (`POST /api/v1/packages/:id/commits/:commitId/revert`) and the package rollback (`POST /api/v1/packages/:id/rollback`) no longer restore a stored version into the package-unbound row when the committing package's own row of the item is gone, on an item of the five overlay types one installed read-only package ships, where `os migrate packageless-overlays` would move such a row into the base's paired `<base>.custom`; they inserted that package-less row before. The per-item rollback on the same package-less address has refused it since `packageless-overlay-write-closed`.
8+
9+
Metadata-protocol: none
10+
11+
Skills-docs: none needed — `skills/objectstack-platform/SKILL.md` already says the package-less save, reset and rollback of a movable row are refused once movable (D11), and places every customization of an installed base in its paired `.custom`; nothing it says becomes false.
12+
13+
<!-- adr-0087: not-required (already-registered packageless-overlay-write-closed) That entry, unreleased and shipping in the same release, already prescribes this change's TO for every package-less write onto an item an installed read-only package ships: write it into the base's paired `<base>.custom` with `PUT /api/v1/meta/<type>/<name>?package=<base>.custom` and the `overrides` declaration (its replacement), because the customization lives there (its reason, ADR-0146 D1, D2, D11). This change closes the commit doors' restore into the package-less row, the one package-less write the per-item rollback already refuses and the commit revert still made, onto the same TO. No stored row is rewritten or moved, so `objectstack migrate meta` has nothing new to do. -->
14+
15+
**BREAKING** write narrowing at the commit doors (`@objectstack/metadata-protocol`), shipped as `patch` (`Metadata-protocol: none`).
16+
17+
The plan a package publish records (`POST /api/v1/packages/:id/publish-drafts`, the commit's `existedBefore` and `prevVersion` per item) now reads the publishing package's own active row, and the revert removes or restores that row only. Before, both read any package's active row of the name: the first publish of a `<base>.custom` pair's declared override beside a row bound to the base (stored before the write naming the base was closed) was recorded as an edit of the base row's version, and its revert addressed the base row, refused there instead of removing the pair's row. It now removes the pair's row, and the row bound to the base is served again. Commits recorded before this change keep the plan they recorded.
18+
19+
### Migration: FROM → TO
20+
21+
FROM, undoing a commit of the installed package `com.acme.crm` (recorded before the write naming it was closed) that edited a customization whose row was deleted since:
22+
23+
```http
24+
POST /api/v1/packages/com.acme.crm/commits/cmt_123/revert
25+
```
26+
27+
It now answers `200` with `success: false`, and the item in `failed[]` with `code: NOT_OVERRIDABLE` and the sentence the per-item rollback gives; nothing is written. TO, write the version you want back into the base's paired `.custom`, declaring what it overrides:
28+
29+
```http
30+
PUT /api/v1/meta/view/account_list?package=com.acme.crm.custom
31+
{ "name": "account_list", "label": "My accounts", "overrides": { "package": "com.acme.crm", "basedOn": "1.4.0" } }
32+
```
33+
34+
- **Now refused, per item.** The restore of a commit item whose row in the committing package is gone, of a `view`, `dashboard`, `report`, `translation` or `email_template` one read-only package ships, where the package-less close applies (the row would be one `os migrate packageless-overlays` moves). The commit's other items still revert, and `POST /api/v1/packages/<id>/rollback` reports the item in its `failed[]` and continues.
35+
- **Still open.** Every restore into a row the committing package holds (a writable package's in place, the pair's in place), every removal, and every package-less restore the close leaves open (a name no read-only package ships, or one several ship).

‎packages/qa/dogfood/test/package-commit-revert-path-package.dogfood.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@
5151
// restoring it would write the row bound to the read-only base again. The
5252
// last case pins both on such a commit, recorded with the close shadowed on
5353
// the booted instance only (what a build before the close did).
54+
//
55+
// [#29414] A commit names its own package's rows. The pair's first publish
56+
// beside such a base-bound row is recorded as a create (its plan used to read
57+
// the base row's version), so its revert removes the pair's row and the base
58+
// row is served again; a revert whose row was deleted since asks the
59+
// package-less close, as the per-item rollback does. Control: a writable
60+
// package's edit commit restores its own row in place.
5461

5562
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
5663
import { type VerifyStack } from '@objectstack/verify';

0 commit comments

Comments
 (0)