Skip to content

Commit d7ef4bd

Browse files
committed
chore(spec): register the bare --apply's retirement in the ADR-0087 ledger (C7b S4 delta review)
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01USccGXR13sWyTeEwe8QFdH
1 parent c07af11 commit d7ef4bd

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

‎.changeset/15211-cli-apply-reviewed-plan.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
'@objectstack/cli': minor
3+
'@objectstack/spec': patch
34
---
45

56
feat(cli)!: `os migrate organization-ownership --apply` executes only the plan the operator reviewed (ADR-0131 D10)
67

78
Clause-②: yes (widening)
89

9-
<!-- adr-0087: not-required (no-migration-prescription) No metadata moves: no spec key, authorable spelling, object definition or stored shape is added, removed, renamed or re-shaped, and no exported declaration is removed or narrowed, so there is nothing for `objectstack migrate meta` to rewrite. What narrows is the accept set of one CLI command's writing mode: `--apply` without the reviewed plan file is refused, and the remedy is in the invocation an operator types (add `--plan-file`), never a rewrite of a package source or a stored row. The other categories are closed on facts: the package publishes (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); and nothing exported is removed or narrowed (not runtime-interface-only, type-surface-only or runtime-export-retired). -->
10+
<!-- adr-0087: registered cli-organization-ownership-apply-plan-file-required -->
1011

1112
**BREAKING** (a narrowing of `--apply`'s accept set, released in 18.0.0-next.1), shipped as `minor` under the launch-window convention for breaking changes. It also widens the command: a new flag, `--plan-file`, new refusal reasons, and two new keys on the apply report.
1213

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import type { SemanticMigration } from '../../types.js';
4+
5+
export const entry: SemanticMigration = {
6+
id: 'cli-organization-ownership-apply-plan-file-required',
7+
// No backticks in `surface`: build-upgrade-guide.ts renders it inside a code
8+
// span AND a table cell.
9+
surface:
10+
'os migrate organization-ownership --apply, invoked without --plan-file (the bare --apply --backup-taken that '
11+
+ '@objectstack/cli 18.0.0-next.1 shipped, with or without --fate-supplement)',
12+
replacement:
13+
'Run the plan first, `os migrate organization-ownership --out plan.json` (with the same `--fate-supplement`, '
14+
+ 'under the same tenancy posture, against the same database), review the file it writes, then '
15+
+ '`os migrate organization-ownership --apply --backup-taken --plan-file plan.json`. A script or runbook that '
16+
+ 'applies directly gains the plan step and the flag; nothing in a package source or a stored row changes.',
17+
reason:
18+
'ADR-0131 D10 makes the ceremony an operator\'s act on a plan the operator reviewed. The apply computes its '
19+
+ 'own plan at apply time, and that plan\'s inputs can move between the review and the run: a different host '
20+
+ 'fate supplement, another release\'s inventory, another tenancy posture or another database. Planning with '
21+
+ 'one supplement and applying with another ran the second one\'s fates unreviewed, including a mirror deletion '
22+
+ 'the reviewed plan never listed. So the apply now reads the plan file the operator reviewed and refuses, before '
23+
+ 'anything is written, when its inventory digest, posture or database differs from the run\'s. Without the '
24+
+ 'file there is nothing to compare, so the bare invocation is refused.',
25+
acceptanceCriteria:
26+
'Every invocation of `os migrate organization-ownership --apply` passes `--plan-file` with the file a plan run '
27+
+ 'wrote, and the run reports `reviewedPlan`. A run that answers `plan-file-required`, `plan-digest-mismatch`, '
28+
+ '`plan-posture-mismatch` or `plan-database-mismatch` has written nothing: plan again, review, and pass the new '
29+
+ 'file.',
30+
};

0 commit comments

Comments
 (0)