Skip to content

Commit 4da02a5

Browse files
dmealingclaude
andcommitted
docs(plan): source v2 + persistence + reserved-word + AI-first YAML rollout (master sequencing)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7abb2b8 commit 4da02a5

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Rollout — source v2 + persistence attrs + reserved-word enforcement + AI-first YAML
2+
3+
> **Master sequencing plan.** This is the roadmap; each stage gets its own detailed TDD plan
4+
> (via `superpowers:writing-plans`) when it starts. Execute stages in isolated worktrees off the
5+
> latest `main`; per-unit `review + simplify` then merge forward + push (the standing gate).
6+
7+
**Goal:** land the reconciled metamodel design — `source` v2, the consolidated persistence
8+
attributes (incl. explicit referential actions), the canonical reserved-word enforcement, and
9+
sigil-free AI-first YAML — across the language ports.
10+
11+
**Authoritative design docs (read first):**
12+
- `spec/decisions/ADR-0006-ai-first-yaml-authoring.md` — sigil-free YAML; canonical JSON keeps `@`.
13+
- `spec/decisions/ADR-0007-source-v2-paradigm-subtypes-multisource.md` — source paradigm subtypes.
14+
- `docs/superpowers/specs/2026-05-23-source-v2-paradigm-subtypes-multisource-design.md`
15+
- `docs/superpowers/specs/2026-05-23-persistence-attributes-cross-language-design.md`
16+
- `spec/wire-format.md` (canonical key model), `spec/conformance-tests.md` (corpus contract).
17+
18+
## Decided defaults (open forks — ratified; override before the relevant stage if desired)
19+
- **`@onDelete` defaults from relationship subtype:** composition→`cascade`, aggregation→`set-null` (relation must be optional), association→`restrict`. `@onUpdate` default `cascade`. Value set = the existing `FkAction` union `cascade|set-null|restrict|no-action` (no `setDefault`).
20+
- **`@softDelete`:** object-level (a `deletedAt` timestamp mode + read-filter); cascade-soft-delete deferred.
21+
- **`@version`:** field-level `@version: true` (optimistic lock).
22+
- **Gating:** referential actions + `@storage` round-trip in the shared conformance corpus; physical-type escape hatch (`@columnType`) is codegen-only (golden tests).
23+
24+
## Order & rationale
25+
Canonical form first (source v2 + persistence + enforcement), TS-first; sigil-free YAML **last**
26+
(it desugars to the canonical vocab, so that vocab must be final). There is **no canonical
27+
`@`-purge** — canonical JSON keeps `@`; the only `@` work is (a) `ERR_RESERVED_ATTR` enforcement,
28+
which rides source v2 because `@name``@table` is its prerequisite, and (b) the YAML sigil-drop
29+
(last). **C# is held** (gated in its conformance ledger) per decision; do TS → Java → Python.
30+
31+
---
32+
33+
## Stage 1 — Source v2 + persistence in TypeScript (the reference). The backbone.
34+
35+
**1a · Shared corpus migration** (language-agnostic; the contract).
36+
- Migrate every `source.*` fixture: `source.dbTable``source.rdb` (kind defaults to `table`);
37+
`source.dbView``source.rdb` + `@kind: view`; `@name``@table`; field `@dbColumn``@column`.
38+
- Add fixtures: a reserved-word error (`@isArray``ERR_RESERVED_ATTR`); a referential-action
39+
fixture (relationship `@onDelete`/`@onUpdate`); a multi-source `@role` fixture; the no-primary /
40+
multiple-primary error fixtures.
41+
- Regenerate every affected `expected.json` from canonical output. Gate the new/changed fixtures
42+
in the **Java/Python/C#** expected-failures ledgers until each port implements the stage.
43+
44+
**1b · TS loader.** Register `source.rdb` (+ `@kind`/`@role`/`@table`/`@schema` schemas), drop
45+
`dbTable`/`dbView`; multi-source validation (exactly one `primary`); add `@onDelete`/`@onUpdate`
46+
to the relationship schema (`allowedValues = FkAction`); land `ERR_RESERVED_ATTR` (the parser
47+
check is already drafted; safe once `@name` is gone). Conformance green.
48+
49+
**1c · TS codegen/runtime/migrate consumers.** Read-only off `@kind` (not the subtype); source
50+
name off `@table`, field off `@column`; **route by `@role`** (primary = CRUD; index/cache/publish
51+
derived — degrade gracefully when absent). Golden/contract tests green.
52+
53+
**1d · Referential actions (low-effort, high-value).** Thread the relationship `@onDelete`/
54+
`@onUpdate` into the existing `migrate-ts` `FkDescriptor` (the `FkAction` union, `emit/{postgres,
55+
sqlite}.ts`, introspect, diff already exist). Round-trip fixture green.
56+
57+
Each sub-stage: TDD, then `review + simplify`, then merge + push.
58+
59+
## Stage 2 — Java
60+
Loader: `source.rdb` + `@kind`/`@role`/`@table`/`@column`, multi-source validation,
61+
`ERR_RESERVED_ATTR`, `@onDelete`/`@onUpdate`. Normalize the legacy `db*`/`jpa*` vocabulary toward
62+
the spec where it intersects. ObjectManagerDB/migration consumers: read-only via `@kind`, name via
63+
`@table`/`@column`, referential actions into the FK DDL. Un-gate the Stage-1 fixtures. Conformance green.
64+
65+
## Stage 3 — Python
66+
Loader: same source v2 + enforcement + referential schema. Codegen (the `metaobjects.codegen`
67+
package from sub-project A): read-only via `@kind`, field via `@column`. Un-gate the fixtures.
68+
Conformance green. (Python codegen/runtime/persistence is its own larger track — see the Python
69+
foundation roadmap; source v2 lands in its loader + codegen here.)
70+
71+
## Stage 4 — AI-first YAML (ADR-0006 D1–D4), TypeScript-only, LAST.
72+
`parser-yaml` + `yaml-desugar`: sigil-free authoring (closed structural-key set; desugar re-adds
73+
`@` for the now-final source-v2/persistence vocab). D2 type-coercion guard in the schema-validation
74+
pass (reject schema-type-mismatched coerced values; located "quote this" error). D3 house style
75+
(+ optional lint warnings). D4 YAML conformance fixtures (sigil-free attrs + coercion guard);
76+
YAML stays TS-only. TDD on parser-yaml/yaml-desugar/parser-equivalence/validation.
77+
78+
## Stage 5 — Enum datatype (separate; coordinate spelling).
79+
`field.enum` per its design doc; `values:` (YAML) / `@values` (canonical JSON) per ADR-0006 D1.
80+
81+
## C# (held)
82+
Stays on `dbTable`/`dbView` + the legacy vocabulary; the Stage-1 fixtures are gated in its
83+
ledger. Migrate to source v2 as its own effort once the user resumes C#.
84+
85+
## Cross-cutting
86+
TDD throughout; named constants for all metamodel strings (no inline literals); no `any`
87+
(narrow `unknown`); public-repo hygiene (no private names / local paths in committed files);
88+
conformance-gated per port; per-unit `review + simplify` before merge; push to origin for durability.

0 commit comments

Comments
 (0)