Evolutionary Database Design
Change persisted and serialized data shape in small, compatible, reversible
steps so that every code version that can be live at once — current, rolling
out, and rollback target — reads and writes the same store without a
coordinated cutover. Judge a change by which versions and readers it breaks,
not by whether the migration ran green in a development database.
"Schema" here means any persisted or serialized shape with independent readers
and writers: tables and columns, documents, event and message payloads, API
request and response bodies, exported files, and stored configuration. The
same compatibility model applies to all of them.
Core Directives
- Every change is a refactoring, not an edit. A data-shape change is one
unit: the schema change, the data migration, and the access-code change.
Never ship one without the others.
- Compatible with every live version. Version skew is the normal state
during a rollout, not an edge case. The shape must be readable and
writable by every version that can coexist, including the rollback target.
- Expand before contract. Add the new shape, move writers, backfill, move
readers, prove the old shape has no reader, then remove it. The contract
step is the only irreversible step; it is gated on evidence, never on the
calendar.
- A reversal step per stage. Each stage names how it is undone and what
data that would lose. A stage with no reversal step is a contract step and
carries the contract step's evidence bar.
- Meaning changes are new elements. Changing what an existing element
means — unit, encoding, time zone, currency, nullability semantics — under
the same name is invisible to every compatibility check. Introduce a new
element or version; never reinterpret in place.
- Data outlives code. Historical records carry the semantics of the code
that wrote them. Retention, backup, audit, privacy, and compliance
obligations bind the data across the transition; a migration cannot
destroy what an obligation requires kept.
- Absence of an import is not absence of a reader. Reports, exports,
analytics, backups, other repositories, and ad-hoc queries read a shape
without importing anything. Unknown readers, unmeasured volume, and unowned
data are findings, not assumptions.
Boundary
Use this skill when an admitted slice changes a persisted or serialized shape,
or retrospectively when an existing store, contract, migration history, or
data incident provides a bounded subject. In Design mode, use two passes when
architecture can still change the target shape, its write owner, or the
deployment topology that determines which versions coexist:
- Compatibility pass — after readiness, before A. Inventory the current
shape, its readers and writers, the coexistence window, and the
obligations that bind the data; classify the change and the compatibility
mode it requires. This constrains the design and supplies the data facts
that
morphogenetic-architecture grades reversibility from.
- Transition pass — after final A/L/C and E when applicable, before H.
Consume the accepted target shape, ownership, and topology; fix the staged
path, the migration units per stage, the backfill strategy, the contract
trigger, the reversal step per stage, and the data contract.
Use a Combined pass only for Audit mode against a stable store, or when
the target shape, ownership, and topology are already accepted and will not
change.
Consume:
- the readiness package's data ownership and lifecycle, domain-model seeds,
contract candidates, and cross-cutting constraints;
- current declared schemas, contracts, serializers, and migration history;
- deployment topology and rollout strategy: which versions coexist, and what
the rollback target is;
- the
morphogenetic-architecture reversibility grade when a boundary moves;
- data volume, write rate, lock behavior, and retention windows;
- historical migration incidents, escaped defects, and production signals.
If requirement meaning, data ownership, or the completion conditions of the
slice are unclear, return to requirements-grounding or
implementation-readiness. Existing schemas and access code are evidence of
readers and writers, not proof of their absence and not product intent.
This skill owns:
- the change classification and required compatibility mode;
- the transition design: staged path, reversal step per stage, contract
trigger;
- the migration units: schema change, data migration, and access-code change
per stage, and the backfill strategy;
- the data contract between a shape's writer and its consumers;
- the compatibility obligations handed to verification, placement, pipeline,
and traceability skills.
This skill does not own:
- component placement, write-ownership assignment across boundaries, or the
reversibility grade of a boundary move;
- requirement meaning, readiness, or the worth of the functionality the data
serves;
- the structural complexity deltas of the data model;
- test technique, scope, or fidelity; the earliest pipeline stage for a
check; pipeline preflight, gating, rollout, or rollback execution; or
implemented-versus-verified evidence state;
- the choice of migration tooling, online-DDL tool, or schema registry;
- specialist privacy, security, or domain data policy.
Use this Alchemy hand-off when both passes apply:
Implementation Readiness
→ Evolutionary Database Design — Compatibility pass: current shape, readers
and writers, coexistence window, obligations, change class, mode
→ A → L/C → E, as justified: target shape, ownership, reversibility grade
→ Evolutionary Database Design — Transition pass: staged path, migration
units, backfill, contract trigger, reversal per stage, data contract
→ Test Strategy — Portfolio pass: compatibility and migration evidence
→ Defect Shift-Left: earliest capable stage for each check
→ CI/CD Reliability: dry-run, reversibility gate, deploy order, rollback
→ Requirements Traceability: migration anchors and executed evidence
When test-strategy also applies, the Transition pass precedes its Portfolio
pass so the migration units are inside the evidence scope. Do not restart the
Compatibility pass after architecture unless the architecture changes which
elements change, who reads or writes them, or which versions coexist. If
accepted architecture changes after the Transition pass, rerun only the
affected stages before handing them to H.
evolutionary-database-design is a task-matched Alchemy companion. It is not
a new A.L.C.H.E.M.Y. letter, qualification stage, or gate.
Workflow
1. Qualify the subject
Select a mode:
- Design — derive the transition for an admitted or clearly bounded
change.
- Audit — assess an existing store, contract, or migration history
against current readers, obligations, and incidents.
In Design mode, also select the design pass defined under Boundary:
Compatibility, Transition, or Combined.
Define the subject as the set of elements a slice changes, one store or
contract, or a bounded migration history. Do not plan for "the whole
database" when no change or incident bounds the work.
2. Inventory the shape and its parties
For each element that changes, record:
Element: <store.table.column | topic.field | contract.path | file.field>
Current shape: <type, nullability, constraints, encoding, semantics>
Writer: <owning component, or unowned>
Readers: <components, reports, exports, analytics, backups, other repos>
Coexisting versions:<server versions live at once during rollout, plus rollback target>
Coexisting clients: <cached browser bundles, installed apps, pinned SDKs, or none — and how long each survives>
Volume / rate: <rows or events, write rate, lock behavior, or unmeasured>
Obligations: <retention, backup, audit, privacy, compliance, or none>
Reader evidence: <access logs, query metrics, contract registry, grep, or none>
Use the widest evidence available for readers: query logs, access metrics,
contract or schema registries, consumer lists, and export inventories. A
grep across one repository is a lower bound. An element with an unknown
writer or an unbounded reader set yields DEFER for that element.
The coexistence window does not end where the deployment ends. Code the
deployment cannot reach still runs: a browser bundle already fetched, a mobile
app not yet updated, a pinned SDK in a partner's build. Each is a live version
of the reader for as long as its own lifetime, which is set by cache policy,
release cadence, or nothing at all. A window bounded only by the rollout
duration is a window measured from the server's point of view. When a client
lifetime is undeclared or unmeasured, the window is unbounded and the element
yields DEFER.
3. Classify the change
Classify each element by what it does to an existing reader or writer:
| Class |
Example |
Old code reads new data |
New code reads old data |
Default path |
| Additive |
New optional element, new table or topic, defaulted column |
Yes, if tolerant reader |
Yes |
Single step |
| Widening |
Relaxed constraint, longer type, new enum value |
Breaks on the new value |
Yes |
Staged: readers first |
| Narrowing |
Added constraint, not-null, shorter type, removed enum value |
Yes |
Breaks on old data |
Staged: clean data first |
| Rename or move |
Column rename, table split or merge, field relocated |
No |
No |
Expand/contract |
| Semantic |
Same name, new unit, encoding, time zone, currency, or meaning |
Silently wrong |
Silently wrong |
New element or version; never in place |
| Destructive |
Drop, delete, truncate, purge |
Breaks |
n/a |
Contract step only |
| Ownership transfer |
Write authority moves to another component or service |
Depends |
Depends |
Staged with morphogenetic-architecture |
| Identity |
Primary key, identifier format, or uniqueness change |
No |
No |
Treat as semantic plus rename |
Then state the compatibility mode the coexistence window requires:
- backward — new code reads data written by old code;
- forward — old code reads data written by new code;
- full — both, the default whenever a rollout and its rollback can
overlap;
- full-transitive — full across every version in the window, required
when more than two versions coexist or historical data is never rewritten.
A weaker mode is acceptable only when a named owner accepts a coordinated
cutover or downtime, the record says so, and the acceptance names the
consumers it covers. "No external consumers" covers the parties it
enumerates and no others; an unnamed cached bundle, installed app, or pinned
SDK is not covered by it. An acceptance whose scope is not written down is
re-examined against the current Coexisting clients list, not inherited.
4. Design the transition
A change whose class and mode are satisfied by every coexisting version in one
step is COMPATIBLE. Every other change is staged. The staged path is:
Expand add the new shape; nullable or defaulted; nothing reads it yet
reversal: drop the new shape
Migrate writers write both shapes, or write new and read old
reversal: stop writing the new shape
Backfill batched, idempotent, resumable, throttled, verified by count
or checksum; run out of band from the deploy
reversal: ignore the new shape
Migrate readers read the new shape, fall back to the old
reversal: read the old shape again
Verify evidence that no reader depends on the old shape
reversal: none needed; nothing has changed yet
Contract remove the old shape; snapshot or backup taken first
reversal: restore from the snapshot — data written since is lost
Rules:
- Each stage is independently deployable and compatible with the previous
stage's code.
- Expand and contract never ship in the same deployable.
- The contract trigger is evidence — access logs, query metrics, a closed
deprecation window with consumer confirmation — not a date.
- Collapse stages only when the coexistence window proves them unnecessary,
and record the proof.
Report the reversibility input for morphogenetic-architecture: every stage
before contract is a reversible data change; the contract step, or any
stage without a reversal step, is an irreversible data migration. That
skill grades the boundary; this skill supplies the staged path whose reversal
step its Low-reversibility bar requires.
5. Design the migration units
In a Transition or Combined pass, define one unit per stage:
Stage: <expand | migrate writers | backfill | migrate readers | verify | contract>
Schema change: <DDL, contract diff, serializer change>
Data migration: <backfill or transform, batch size, checkpoint, throttle, verification>
Access code: <writer and reader change shipped with it>
Reversal step: <how it is undone and what is lost>
Deploy order: <what must be live before this unit>
Evidence: <what proves this stage is complete>
Rules:
- Ship each unit's schema change, data migration, and access code together,
in the same change as the code that depends on them.
- Make every migration idempotent and re-runnable; a partial run followed by
a retry converges.
- Production rollback is the previous stage's code against the expanded
shape. A down-migration is a development convenience, not a rollback path.
- Run a large backfill out of band from the deploy, in batches with a
checkpoint, throttled against production load, and verified by counts,
checksums, or dual-read comparison before readers move.
- Prefer online, non-locking schema operations; treat a full-table rewrite or
a long lock as a capacity risk to be measured, not assumed.
- When a stage transfers write ownership, coordinate its deploy order with
the accepted
morphogenetic-architecture decision; dual-write across an
ownership boundary is a transition, not an end state.
- Temporary scaffolding — dual writes, fallbacks, flags, migration code — is
removed at contract. Migration code that has provably run on every record
is a phantom requirement; hand it to
functionality-complexity-tradeoff.
6. Emit the data contract
For every shape with a writer and at least one consumer outside the writer's
boundary, record:
Shape: <store, topic, contract, or file>
Owner: <writing component>
Consumers: <named readers, or unknown>
Compatibility mode: <backward | forward | full | full-transitive>
Versioning: <additive only | versioned element | versioned contract>
Deprecation: <window, notice channel, and the evidence that closes it>
A contract that names no consumer is a phantom. Where a schema registry or
contract-test framework can enforce the mode, encode it there and route the
tooling choice to bring-down rather than restating the rule in prose.
7. Hand off the checks
- Send compatibility obligations to
test-strategy: every coexisting version
reads and writes the shape; migration and backfill are idempotent; the
oracle runs against real store semantics and production-shaped data, not an
empty development database.
- Send each check to
defect-shift-left for placement: schema-as-code at the
design stage, migration lint and schema diff at static analysis, contract
compatibility at integration, dry-run and reversibility at pre-deploy,
version-skew at canary.
- Send deploy order, pre-deploy dry-run, reversibility gate, contract-step
gating, snapshot requirement, and rollback artifact to
ci-cd-reliability-architecture.
- Send the schema or migration identifier and its compatibility test to
requirements-traceability as the data anchor.
- Send obsolete scaffolding to
functionality-complexity-tradeoff and
tooling substitution to bring-down.
- Send privacy, security, or domain data policy to the applicable companion
skill without weakening it.
8. Audit the store
In Audit mode:
- Map each element to its writer, readers, obligations, and last change.
- Find never-contracted expansions: parallel columns,
_old and _new
pairs, forever-nullable additions, dual writes with no closing evidence.
- Find semantic drift: an element whose meaning changed in place, and the
historical records that still carry the earlier meaning.
- Find unowned elements, unknown readers, and unversioned external shapes.
- Find migrations without a reversal step, non-idempotent backfills, and
contract steps that ran on a date rather than on evidence.
- Treat every migration incident as evidence that the transition design
missed a reader, a version, a volume, or an obligation.
A never-contracted expansion is not neutral: it doubles the write path,
splits the reader population, and leaves the reversal step of the original
change undefined. Either close it with evidence or record it as accepted
residual risk with an owner.
Decision Rules
| Condition |
Decision |
| Every coexisting version reads and writes the shape unchanged; no transition needed |
COMPATIBLE |
| A staged path exists; every stage is independently deployable and reversible until a contract step whose evidence trigger, snapshot, and obligation clearance are named |
STAGED |
| No compatible or staged path satisfies the obligations, or a contract step lacks its evidence trigger, snapshot, or obligation clearance |
BREAKING |
| A writer, reader set, coexistence window, ownership, volume, or obligation is unknown |
DEFER |
A Compatibility pass is provisional by design: its COMPATIBLE or STAGED
is a class, not a release-ready plan. Reserve the final decision for a
Transition or Combined pass against accepted architecture.
Do not emit COMPATIBLE from a green migration on an empty or synthetic
database, a passing down-migration, or the absence of imports.
Output Contract
Emit one row per changed element:
| Element |
Change class |
Writer / readers |
Coexisting versions |
Compatibility mode |
Transition stage |
Reversal step |
Evidence |
Residual blind spot |
Then emit:
Subject: <store, contract, shape, slice, or migration history>
Mode: Design | Audit
Design pass: Compatibility | Transition | Combined
Decision: COMPATIBLE | STAGED | BREAKING | DEFER
Change class: <additive | widening | narrowing | rename/move | semantic | destructive | ownership transfer | identity>
Compatibility mode: <backward | forward | full | full-transitive | weaker, accepted by owner>
Coexistence window: <server versions live at once, including the rollback target>
Coexisting clients: <cached bundles, installed apps, pinned SDKs and their lifetimes, or none>
Reversibility input: <reversible data change | irreversible data migration | unknown>
Staged path: <stages in order, or single step>
Contract trigger: <evidence that closes the old shape, or not yet defined>
Migration units: <per-stage units, or not yet fixed>
Data contract: <owner, consumers, mode, deprecation, or none needed>
Obligations: <retention, backup, audit, privacy, compliance, or none>
Handoffs: <test-strategy, shift-left, CI/CD, traceability, M, bring-down, companions>
Residual risk: <accepted, blocked, deferred, unknown, or none identified>
Next action: <one concrete stage, evidence, or owner question>
Verification: <dry-run, dual-read comparison, counts, commands, or Not run + reason>
Guardrails
- Do not infer absence of readers from absence of imports.
- Do not reinterpret an existing element in place.
- Do not ship expand and contract in one deployable.
- Do not schedule the contract step by date.
- Do not use a down-migration as the production rollback path.
- Do not run a large backfill inside the deploy step.
- Do not treat a green migration on an empty or synthetic database as
compatibility evidence.
- Do not leave an expansion open without an owner and a closing condition.
- Do not claim an ownership boundary listed under Boundary; hand it off.
1---2name: evolutionary-database-design3description: Designs and audits compatible, staged, reversible changes to persisted or serialized data shape: database schemas, event and message schemas, API payloads, and file formats. Use when a change adds, renames, moves, narrows, reinterprets, or removes a stored or serialized element, changes a key or identity, transfers write ownership, or needs a backfill; when deciding whether old and new code versions can coexist against one schema during rollout and rollback; when planning an expand/contract transition, its reversal steps, and the evidence that permits the contract step; or when auditing never-contracted expansions, semantic drift, unowned data, and migrations without a reversal path. Do not use for component placement, requirement meaning, test technique, pipeline stage placement, gating, or evidence state; hand those to morphogenetic-architecture, requirements-grounding, test-strategy, defect-shift-left, ci-cd-reliability-architecture, and requirements-traceability.4---56# Evolutionary Database Design78Change persisted and serialized data shape in small, compatible, reversible9steps so that every code version that can be live at once — current, rolling10out, and rollback target — reads and writes the same store without a11coordinated cutover. Judge a change by which versions and readers it breaks,12not by whether the migration ran green in a development database.1314"Schema" here means any persisted or serialized shape with independent readers15and writers: tables and columns, documents, event and message payloads, API16request and response bodies, exported files, and stored configuration. The17same compatibility model applies to all of them.1819## Core Directives20211. **Every change is a refactoring, not an edit.** A data-shape change is one22 unit: the schema change, the data migration, and the access-code change.23 Never ship one without the others.242. **Compatible with every live version.** Version skew is the normal state25 during a rollout, not an edge case. The shape must be readable and26 writable by every version that can coexist, including the rollback target.273. **Expand before contract.** Add the new shape, move writers, backfill, move28 readers, prove the old shape has no reader, then remove it. The contract29 step is the only irreversible step; it is gated on evidence, never on the30 calendar.314. **A reversal step per stage.** Each stage names how it is undone and what32 data that would lose. A stage with no reversal step is a contract step and33 carries the contract step's evidence bar.345. **Meaning changes are new elements.** Changing what an existing element35 means — unit, encoding, time zone, currency, nullability semantics — under36 the same name is invisible to every compatibility check. Introduce a new37 element or version; never reinterpret in place.386. **Data outlives code.** Historical records carry the semantics of the code39 that wrote them. Retention, backup, audit, privacy, and compliance40 obligations bind the data across the transition; a migration cannot41 destroy what an obligation requires kept.427. **Absence of an import is not absence of a reader.** Reports, exports,43 analytics, backups, other repositories, and ad-hoc queries read a shape44 without importing anything. Unknown readers, unmeasured volume, and unowned45 data are findings, not assumptions.4647## Boundary4849Use this skill when an admitted slice changes a persisted or serialized shape,50or retrospectively when an existing store, contract, migration history, or51data incident provides a bounded subject. In Design mode, use two passes when52architecture can still change the target shape, its write owner, or the53deployment topology that determines which versions coexist:54551. **Compatibility pass — after readiness, before A.** Inventory the current56 shape, its readers and writers, the coexistence window, and the57 obligations that bind the data; classify the change and the compatibility58 mode it requires. This constrains the design and supplies the data facts59 that `morphogenetic-architecture` grades reversibility from.602. **Transition pass — after final A/L/C and E when applicable, before H.**61 Consume the accepted target shape, ownership, and topology; fix the staged62 path, the migration units per stage, the backfill strategy, the contract63 trigger, the reversal step per stage, and the data contract.6465Use a **Combined pass** only for Audit mode against a stable store, or when66the target shape, ownership, and topology are already accepted and will not67change.6869Consume:7071- the readiness package's data ownership and lifecycle, domain-model seeds,72 contract candidates, and cross-cutting constraints;73- current declared schemas, contracts, serializers, and migration history;74- deployment topology and rollout strategy: which versions coexist, and what75 the rollback target is;76- the `morphogenetic-architecture` reversibility grade when a boundary moves;77- data volume, write rate, lock behavior, and retention windows;78- historical migration incidents, escaped defects, and production signals.7980If requirement meaning, data ownership, or the completion conditions of the81slice are unclear, return to `requirements-grounding` or82`implementation-readiness`. Existing schemas and access code are evidence of83readers and writers, not proof of their absence and not product intent.8485This skill owns:8687- the change classification and required compatibility mode;88- the transition design: staged path, reversal step per stage, contract89 trigger;90- the migration units: schema change, data migration, and access-code change91 per stage, and the backfill strategy;92- the data contract between a shape's writer and its consumers;93- the compatibility obligations handed to verification, placement, pipeline,94 and traceability skills.9596This skill does not own:9798- component placement, write-ownership assignment across boundaries, or the99 reversibility grade of a boundary move;100- requirement meaning, readiness, or the worth of the functionality the data101 serves;102- the structural complexity deltas of the data model;103- test technique, scope, or fidelity; the earliest pipeline stage for a104 check; pipeline preflight, gating, rollout, or rollback execution; or105 implemented-versus-verified evidence state;106- the choice of migration tooling, online-DDL tool, or schema registry;107- specialist privacy, security, or domain data policy.108109Use this Alchemy hand-off when both passes apply:110111```text112Implementation Readiness113→ Evolutionary Database Design — Compatibility pass: current shape, readers114 and writers, coexistence window, obligations, change class, mode115→ A → L/C → E, as justified: target shape, ownership, reversibility grade116→ Evolutionary Database Design — Transition pass: staged path, migration117 units, backfill, contract trigger, reversal per stage, data contract118→ Test Strategy — Portfolio pass: compatibility and migration evidence119→ Defect Shift-Left: earliest capable stage for each check120→ CI/CD Reliability: dry-run, reversibility gate, deploy order, rollback121→ Requirements Traceability: migration anchors and executed evidence122```123124When `test-strategy` also applies, the Transition pass precedes its Portfolio125pass so the migration units are inside the evidence scope. Do not restart the126Compatibility pass after architecture unless the architecture changes which127elements change, who reads or writes them, or which versions coexist. If128accepted architecture changes after the Transition pass, rerun only the129affected stages before handing them to H.130131`evolutionary-database-design` is a task-matched Alchemy companion. It is not132a new A.L.C.H.E.M.Y. letter, qualification stage, or gate.133134## Workflow135136### 1. Qualify the subject137138Select a mode:139140- **Design** — derive the transition for an admitted or clearly bounded141 change.142- **Audit** — assess an existing store, contract, or migration history143 against current readers, obligations, and incidents.144145In Design mode, also select the design pass defined under Boundary:146Compatibility, Transition, or Combined.147148Define the subject as the set of elements a slice changes, one store or149contract, or a bounded migration history. Do not plan for "the whole150database" when no change or incident bounds the work.151152### 2. Inventory the shape and its parties153154For each element that changes, record:155156```text157Element: <store.table.column | topic.field | contract.path | file.field>158Current shape: <type, nullability, constraints, encoding, semantics>159Writer: <owning component, or unowned>160Readers: <components, reports, exports, analytics, backups, other repos>161Coexisting versions:<server versions live at once during rollout, plus rollback target>162Coexisting clients: <cached browser bundles, installed apps, pinned SDKs, or none — and how long each survives>163Volume / rate: <rows or events, write rate, lock behavior, or unmeasured>164Obligations: <retention, backup, audit, privacy, compliance, or none>165Reader evidence: <access logs, query metrics, contract registry, grep, or none>166```167168Use the widest evidence available for readers: query logs, access metrics,169contract or schema registries, consumer lists, and export inventories. A170grep across one repository is a lower bound. An element with an unknown171writer or an unbounded reader set yields `DEFER` for that element.172173The coexistence window does not end where the deployment ends. Code the174deployment cannot reach still runs: a browser bundle already fetched, a mobile175app not yet updated, a pinned SDK in a partner's build. Each is a live version176of the reader for as long as its own lifetime, which is set by cache policy,177release cadence, or nothing at all. A window bounded only by the rollout178duration is a window measured from the server's point of view. When a client179lifetime is undeclared or unmeasured, the window is unbounded and the element180yields `DEFER`.181182### 3. Classify the change183184Classify each element by what it does to an existing reader or writer:185186| Class | Example | Old code reads new data | New code reads old data | Default path |187| --- | --- | --- | --- | --- |188| Additive | New optional element, new table or topic, defaulted column | Yes, if tolerant reader | Yes | Single step |189| Widening | Relaxed constraint, longer type, new enum value | Breaks on the new value | Yes | Staged: readers first |190| Narrowing | Added constraint, not-null, shorter type, removed enum value | Yes | Breaks on old data | Staged: clean data first |191| Rename or move | Column rename, table split or merge, field relocated | No | No | Expand/contract |192| Semantic | Same name, new unit, encoding, time zone, currency, or meaning | Silently wrong | Silently wrong | New element or version; never in place |193| Destructive | Drop, delete, truncate, purge | Breaks | n/a | Contract step only |194| Ownership transfer | Write authority moves to another component or service | Depends | Depends | Staged with `morphogenetic-architecture` |195| Identity | Primary key, identifier format, or uniqueness change | No | No | Treat as semantic plus rename |196197Then state the compatibility mode the coexistence window requires:198199- **backward** — new code reads data written by old code;200- **forward** — old code reads data written by new code;201- **full** — both, the default whenever a rollout and its rollback can202 overlap;203- **full-transitive** — full across every version in the window, required204 when more than two versions coexist or historical data is never rewritten.205206A weaker mode is acceptable only when a named owner accepts a coordinated207cutover or downtime, the record says so, and the acceptance **names the208consumers it covers**. "No external consumers" covers the parties it209enumerates and no others; an unnamed cached bundle, installed app, or pinned210SDK is not covered by it. An acceptance whose scope is not written down is211re-examined against the current `Coexisting clients` list, not inherited.212213### 4. Design the transition214215A change whose class and mode are satisfied by every coexisting version in one216step is `COMPATIBLE`. Every other change is staged. The staged path is:217218```text219Expand add the new shape; nullable or defaulted; nothing reads it yet220 reversal: drop the new shape221Migrate writers write both shapes, or write new and read old222 reversal: stop writing the new shape223Backfill batched, idempotent, resumable, throttled, verified by count224 or checksum; run out of band from the deploy225 reversal: ignore the new shape226Migrate readers read the new shape, fall back to the old227 reversal: read the old shape again228Verify evidence that no reader depends on the old shape229 reversal: none needed; nothing has changed yet230Contract remove the old shape; snapshot or backup taken first231 reversal: restore from the snapshot — data written since is lost232```233234Rules:235236- Each stage is independently deployable and compatible with the previous237 stage's code.238- Expand and contract never ship in the same deployable.239- The contract trigger is evidence — access logs, query metrics, a closed240 deprecation window with consumer confirmation — not a date.241- Collapse stages only when the coexistence window proves them unnecessary,242 and record the proof.243244Report the reversibility input for `morphogenetic-architecture`: every stage245before contract is a **reversible data change**; the contract step, or any246stage without a reversal step, is an **irreversible data migration**. That247skill grades the boundary; this skill supplies the staged path whose reversal248step its Low-reversibility bar requires.249250### 5. Design the migration units251252In a Transition or Combined pass, define one unit per stage:253254```text255Stage: <expand | migrate writers | backfill | migrate readers | verify | contract>256Schema change: <DDL, contract diff, serializer change>257Data migration: <backfill or transform, batch size, checkpoint, throttle, verification>258Access code: <writer and reader change shipped with it>259Reversal step: <how it is undone and what is lost>260Deploy order: <what must be live before this unit>261Evidence: <what proves this stage is complete>262```263264Rules:265266- Ship each unit's schema change, data migration, and access code together,267 in the same change as the code that depends on them.268- Make every migration idempotent and re-runnable; a partial run followed by269 a retry converges.270- Production rollback is the previous stage's code against the expanded271 shape. A down-migration is a development convenience, not a rollback path.272- Run a large backfill out of band from the deploy, in batches with a273 checkpoint, throttled against production load, and verified by counts,274 checksums, or dual-read comparison before readers move.275- Prefer online, non-locking schema operations; treat a full-table rewrite or276 a long lock as a capacity risk to be measured, not assumed.277- When a stage transfers write ownership, coordinate its deploy order with278 the accepted `morphogenetic-architecture` decision; dual-write across an279 ownership boundary is a transition, not an end state.280- Temporary scaffolding — dual writes, fallbacks, flags, migration code — is281 removed at contract. Migration code that has provably run on every record282 is a phantom requirement; hand it to `functionality-complexity-tradeoff`.283284### 6. Emit the data contract285286For every shape with a writer and at least one consumer outside the writer's287boundary, record:288289```text290Shape: <store, topic, contract, or file>291Owner: <writing component>292Consumers: <named readers, or unknown>293Compatibility mode: <backward | forward | full | full-transitive>294Versioning: <additive only | versioned element | versioned contract>295Deprecation: <window, notice channel, and the evidence that closes it>296```297298A contract that names no consumer is a phantom. Where a schema registry or299contract-test framework can enforce the mode, encode it there and route the300tooling choice to `bring-down` rather than restating the rule in prose.301302### 7. Hand off the checks303304- Send compatibility obligations to `test-strategy`: every coexisting version305 reads and writes the shape; migration and backfill are idempotent; the306 oracle runs against real store semantics and production-shaped data, not an307 empty development database.308- Send each check to `defect-shift-left` for placement: schema-as-code at the309 design stage, migration lint and schema diff at static analysis, contract310 compatibility at integration, dry-run and reversibility at pre-deploy,311 version-skew at canary.312- Send deploy order, pre-deploy dry-run, reversibility gate, contract-step313 gating, snapshot requirement, and rollback artifact to314 `ci-cd-reliability-architecture`.315- Send the schema or migration identifier and its compatibility test to316 `requirements-traceability` as the data anchor.317- Send obsolete scaffolding to `functionality-complexity-tradeoff` and318 tooling substitution to `bring-down`.319- Send privacy, security, or domain data policy to the applicable companion320 skill without weakening it.321322### 8. Audit the store323324In Audit mode:3253261. Map each element to its writer, readers, obligations, and last change.3272. Find never-contracted expansions: parallel columns, `_old` and `_new`328 pairs, forever-nullable additions, dual writes with no closing evidence.3293. Find semantic drift: an element whose meaning changed in place, and the330 historical records that still carry the earlier meaning.3314. Find unowned elements, unknown readers, and unversioned external shapes.3325. Find migrations without a reversal step, non-idempotent backfills, and333 contract steps that ran on a date rather than on evidence.3346. Treat every migration incident as evidence that the transition design335 missed a reader, a version, a volume, or an obligation.336337A never-contracted expansion is not neutral: it doubles the write path,338splits the reader population, and leaves the reversal step of the original339change undefined. Either close it with evidence or record it as accepted340residual risk with an owner.341342## Decision Rules343344| Condition | Decision |345| --- | --- |346| Every coexisting version reads and writes the shape unchanged; no transition needed | `COMPATIBLE` |347| A staged path exists; every stage is independently deployable and reversible until a contract step whose evidence trigger, snapshot, and obligation clearance are named | `STAGED` |348| No compatible or staged path satisfies the obligations, or a contract step lacks its evidence trigger, snapshot, or obligation clearance | `BREAKING` |349| A writer, reader set, coexistence window, ownership, volume, or obligation is unknown | `DEFER` |350351A Compatibility pass is provisional by design: its `COMPATIBLE` or `STAGED`352is a class, not a release-ready plan. Reserve the final decision for a353Transition or Combined pass against accepted architecture.354355Do not emit `COMPATIBLE` from a green migration on an empty or synthetic356database, a passing down-migration, or the absence of imports.357358## Output Contract359360Emit one row per changed element:361362| Element | Change class | Writer / readers | Coexisting versions | Compatibility mode | Transition stage | Reversal step | Evidence | Residual blind spot |363| --- | --- | --- | --- | --- | --- | --- | --- | --- |364365Then emit:366367```text368Subject: <store, contract, shape, slice, or migration history>369Mode: Design | Audit370Design pass: Compatibility | Transition | Combined371Decision: COMPATIBLE | STAGED | BREAKING | DEFER372Change class: <additive | widening | narrowing | rename/move | semantic | destructive | ownership transfer | identity>373Compatibility mode: <backward | forward | full | full-transitive | weaker, accepted by owner>374Coexistence window: <server versions live at once, including the rollback target>375Coexisting clients: <cached bundles, installed apps, pinned SDKs and their lifetimes, or none>376Reversibility input: <reversible data change | irreversible data migration | unknown>377Staged path: <stages in order, or single step>378Contract trigger: <evidence that closes the old shape, or not yet defined>379Migration units: <per-stage units, or not yet fixed>380Data contract: <owner, consumers, mode, deprecation, or none needed>381Obligations: <retention, backup, audit, privacy, compliance, or none>382Handoffs: <test-strategy, shift-left, CI/CD, traceability, M, bring-down, companions>383Residual risk: <accepted, blocked, deferred, unknown, or none identified>384Next action: <one concrete stage, evidence, or owner question>385Verification: <dry-run, dual-read comparison, counts, commands, or Not run + reason>386```387388## Guardrails389390- Do not infer absence of readers from absence of imports.391- Do not reinterpret an existing element in place.392- Do not ship expand and contract in one deployable.393- Do not schedule the contract step by date.394- Do not use a down-migration as the production rollback path.395- Do not run a large backfill inside the deploy step.396- Do not treat a green migration on an empty or synthetic database as397 compatibility evidence.398- Do not leave an expansion open without an owner and a closing condition.399- Do not claim an ownership boundary listed under Boundary; hand it off.