Skip to content

Commit 7e68ccf

Browse files
dmealingclaude
andcommitted
docs(fr-035): record the owner ruling — @rowVersion / ADR-0043 declined
Optimistic concurrency does not enter the metamodel vocabulary. @autoset:onUpdate already models "stamps on every write" and the legacy OMDB engine already derives its optimistic-lock column from it, so a @rowVersion attribute would be a second name for a derivable concept — ADR-0023's can't-be-computed test fails, ADR-0037 forbids the overload. Phase 5 and PATCH-8 are dropped; partial update (Phases 0–4) stands alone. If a counter token is ever needed, widen the existing @autoset to integer fields instead. Also marks Phase 0 + the C#/Kotlin correctness fixes as shipped (7fab436). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hd5NWZ1rKau63vJzrBSpLb
1 parent 7fab436 commit 7e68ccf

1 file changed

Lines changed: 20 additions & 10 deletions

File tree

docs/superpowers/specs/2026-07-13-generated-mutation-surface-design.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
# Generated mutation surface — partial patch, optimistic concurrency, and the Kotlin repository generator
22

33
**Date:** 2026-07-13
4-
**Status:** Design proposal (no implementation yet). The `@rowVersion` metamodel attribute in §6
5-
**requires an explicit owner ruling** per ADR-0023 before any implementation.
4+
**Status:** Partially implemented. Phase 0 (the forcing-function gate) and the C#/Kotlin
5+
correctness fixes shipped in `7fab436b` (see §10). Phases 2–4 (the typed patch surface + the
6+
Kotlin repository generator) are the active remaining work.
7+
8+
> **OWNER RULING (2026-07-13): `@rowVersion` / ADR-0043 is DECLINED.** Optimistic concurrency
9+
> stays out of the vocabulary. Rationale (ADR-0023 §"can't-be-computed" fails): `@autoSet:onUpdate`
10+
> is already registered with the semantics *"stamps on every write,"* and the legacy OMDB engine
11+
> already derives its optimistic-lock column from exactly that field (`getDirtyField()` — explicit
12+
> attr override, else the auto-on-update field). A new `@rowVersion` attribute would be a second
13+
> name for a concept the metamodel already carries — precisely what ADR-0037 forbids. If a robust
14+
> *counter* token is ever needed (temporal `@autoSet` is unsound on SQLite/D1 at 1-second
15+
> resolution), the move is to widen the existing `@autoSet` to `field.int`/`field.long` (auto-set
16+
> on update ⇒ increment), NOT to add vocabulary. **Phase 5 and PATCH-8 are dropped.** Partial
17+
> update (Phases 0–4) stands alone.
618
**Issues:** [#197](https://github.com/metaobjectsdev/metaobjects/issues/197) (re-scoped: a generated
719
Kotlin repository), [#198](https://github.com/metaobjectsdev/metaobjects/issues/198) (no generated
820
partial/patch update). Both are one root cause: **the generated mutation surface is thin**, so
@@ -11,8 +23,8 @@ adopters hand-write exactly the SQL the metadata could own.
1123
**Ports touched:** all five. Kotlin gets the largest new artifact (a repository generator); C# and
1224
Java get correctness fixes to the generated update handler; TS and Python get typed patch shapes
1325
over already-partial runtimes.
14-
**New ADR proposed:** ADR-0043 (`@rowVersion` row-version optimistic concurrency) — gated on the
15-
owner ruling in §6.3.
26+
**New ADR proposed:** ~~ADR-0043 (`@rowVersion`)~~**DECLINED** by owner ruling (see banner
27+
above). No new vocabulary; no ADR.
1628

1729
---
1830

@@ -696,12 +708,10 @@ by design. Files: the two YAML fixtures only.
696708
- Python: `codegen/generators/entity_model.py` (or sibling) emits `<Entity>Patch` TypedDicts;
697709
`router_generator.py` Protocol gains `patch` and the route calls it.
698710

699-
**Phase 5 — `@rowVersion` (blocked on the owner ruling; severable).**
700-
- `spec/decisions/ADR-0043-row-version-optimistic-concurrency.md`.
701-
- Vocabulary in all five ports (TS `packages/metadata/src/constants.ts` + provider first, per
702-
the constants discipline; then C#/Java/Python/Kotlin parallels) + conformance items 2/4/6 +
703-
loader validation passes + per-port write-path wiring per §6.4 + migrate-ts default-column
704-
coverage + the runtime `WriteOpts.expectedVersion` surfaces.
711+
**Phase 5 — ~~`@rowVersion`~~ — DROPPED (owner ruling, 2026-07-13).** Optimistic concurrency is
712+
not entering the vocabulary; see the banner at the top. This phase and PATCH-8 are cancelled. If
713+
the need resurfaces, it is handled by widening the existing `@autoSet` to integer fields, tracked
714+
separately — not here.
705715

706716
**Phase 6 — docs.** Tier-2 feature doc (`docs/features/`), generated api-docs mention of patch
707717
semantics per port, agent-context skills note ("use the generated patch — never hand-write a

0 commit comments

Comments
 (0)