Architecture decision record · ADR-0003
The legacy door uses withDefaults and plain schema-object
Millwork uses option B.
Context
Millwork supports legacy records (decision 1 in the plan). Two bases are possible for a shape
on a legacy record:
- A.
@warp-drive/legacy/model-fragments:withLegacy,withFragmentDefaultsand theFragmentextension. - B.
@warp-drive/legacy/model/migration-support:withDefaultswith a plainschema-objectfield.
Both work in the spike, on 5.8.0 and on 5.9.1.
Decision drivers
Not recorded in the original ADR.
Options considered
Not recorded in the original ADR.
Decision
Millwork uses option B. It does not depend on the model-fragments layer.
Consequences
- Option A gives a per-object
hasDirtyAttributesandrollbackAttributes. But the dirty flag is per top-level field, and no API names the changed path. Millwork must add per-path change tracking (plan section 4.5) in both cases. So option A gives little that Millwork can use. - Option A needs the
fragment:type prefix, themodelFragments: truestore option and theember-objectextensions. These names and behaviors would show through the Millwork API. The plan does not permit the word "fragment" in the API. - Option B needs only a legacy-mode schema. The record is editable with no
checkout.changedAttributes()androllbackAttributes()work for the whole record. - A real legacy
Modelclass cannot hold a shape. Its@attrtransform runs only in a serializer, sostore.pushgives the raw value. An in-place edit of a plain object@attris not tracked. So aModelwith a shape must move to awithDefaultsschema. Plan change: the class form@shape(...)on aModel(plan section 4.3) must make awithDefaultsschema, not aModelattribute. M3 must confirm this with a test app. - A
valuecodec on aModelstays atransform:<name>for the serializer.
Confirmation
Evidence
packages/warp-drive/tests/spikes/s4-legacy-door.test.ts
Interview record
Each question of the interview with its answer and its source. A fact from the code or a document, a question that the author did not ask, and an assumption are rows too.
| Question | Answer | Source |
|---|---|---|
| Where does the text of this page come from? | From the Markdown file docs/adr/0003-legacy-door-base.md at commit c8154b0. The text of each section is the text of the Markdown file. A section that the Markdown file does not have says so. | Document: docs/adr/0003-legacy-door-base.md |
Changelog
| Date | Author | Change |
|---|---|---|
| 2026-12-01 | Joe Gaudet | Status in the Markdown file: Accepted (M0, spike S4). |
| 2026-12-01 | Joe Gaudet | Commit 0a16254: Build Millwork 1.0 (#1) |
| 2026-12-04 | Joe Gaudet (agent) | Converted from docs/adr/0003-legacy-door-base.md to this page. The text is the text of the Markdown file. |
The adr skill of skillsaw wrote this page. The HTML in this file is the source of truth. The diagrams are the Mermaid sources in it.