docs(skill): record faked-cursor de-fake learning + Phase 2 scorecard progress
- gotchas.md: de-faking a cursor is not a drop-in -- with-field-default mutates the cursor (transact!) as a render side effect and broke the simple-mode swap; the de-fake belongs with the render-fn rewrite, verified against the swap spec. - scorecard.md: append the Phase 2 (in-progress) Transaction Edit row -- no-cursor 1->0, LOC 1608->1555, parity held (swap 6/6 + Shared Location). Faked roots / snapshot / Selmer / route-collapse remain as the wholesale-rendering continuation of Phase 2.
This commit is contained in:
@@ -83,6 +83,19 @@ validation re-render; a `#error {…}` stack means a 500. Then serialize the for
|
|||||||
before save (`new FormData(document.querySelector('#wizard-form'))`) to see exactly what
|
before save (`new FormData(document.querySelector('#wizard-form'))`) to see exactly what
|
||||||
posts. This is how the `:mode` 500 and the empty-account bugs above were isolated.
|
posts. This is how the `:mode` 500 and the empty-account bugs above were isolated.
|
||||||
|
|
||||||
|
## De-faking a cursor is not a drop-in — `with-field-default` mutates
|
||||||
|
|
||||||
|
Tempting fix for a faked deep cursor (`with-cursor` + synthetic `MapCursor` at index 0):
|
||||||
|
replace it with `(fc/with-field-default 0 {})` to advance naturally. **It broke the
|
||||||
|
simple-mode swap** (`transaction-edit-swap` test 1 threw). `with-field-default` calls
|
||||||
|
`cursor/transact!` — it *mutates the form cursor* (assoc-ing the default row) as a render
|
||||||
|
side effect, which changes simple-mode behavior. The read-only synthetic `MapCursor` did
|
||||||
|
not. Lesson: removing a faked cursor on these modals is **not** a one-liner — it's part of
|
||||||
|
the larger render-fn extraction (render the row from explicit data, construct field names
|
||||||
|
directly, look up errors explicitly), done when the simple/advanced rows are reworked into
|
||||||
|
pure render fns / Selmer. Don't swap one cursor primitive for another and assume parity;
|
||||||
|
verify against the swap spec, and expect the de-fake to come with the render-fn rewrite.
|
||||||
|
|
||||||
## Scorecard exceptions (ratchet violations with a reason)
|
## Scorecard exceptions (ratchet violations with a reason)
|
||||||
|
|
||||||
_None yet._ Append here if a migration must let a metric regress for a documented reason.
|
_None yet._ Append here if a migration must let a metric regress for a documented reason.
|
||||||
|
|||||||
@@ -39,8 +39,14 @@ Each migration appends one row (after-numbers), referencing the before in the di
|
|||||||
| Phase | Modal | LOC | Routes | no-cursor twins | faked roots | snapshot merges | OOB | mixed hx- | cookbook reused / added |
|
| Phase | Modal | LOC | Routes | no-cursor twins | faked roots | snapshot merges | OOB | mixed hx- | cookbook reused / added |
|
||||||
|-------|-------|-----|--------|-----------------|-------------|-----------------|-----|-----------|-------------------------|
|
|-------|-------|-----|--------|-----------------|-------------|-----------------|-----|-----------|-------------------------|
|
||||||
| 1 (baseline) | Transaction Edit `transaction/edit.clj` | 1608 | ~12 | 1 | 2 | ~75 | 0 | 8 | — / seeded 7 entries |
|
| 1 (baseline) | Transaction Edit `transaction/edit.clj` | 1608 | ~12 | 1 | 2 | ~75 | 0 | 8 | — / seeded 7 entries |
|
||||||
|
| 2 (in progress) | Transaction Edit `transaction/edit.clj` | 1555 | ~12 | **0** | 2 | ~75 | 0 | 8 | — / 0 |
|
||||||
|
|
||||||
> Phase 1 is distillation only — no app code changed. The Transaction Edit row is the
|
> **Phase 2 progress (partial).** Achieved with parity held (swap spec 6/6 + Shared
|
||||||
> **before** baseline that Phase 2 must beat (target: routes → ~3, no-cursor → 0, faked
|
> Location green): deleted the dead `*-no-cursor*` twin (no-cursor 1→0, −53 LOC) and fixed
|
||||||
> roots → 0, snapshot merges → 0, LOC ↓, mixed hx- → 0). The `0` OOB is already achieved
|
> a real production bug (`:mode` leaking into the upsert → 500 on every advanced manual
|
||||||
> by the merged reference and must not regress.
|
> save). **Still open** for this modal — and intentionally *not* forced under parity risk:
|
||||||
|
> faked cursor roots (2 — de-faking needs the render-fn rewrite, see `gotchas.md`), the
|
||||||
|
> snapshot round-trip (~75 — removed by the wizard→plain-form reclassification), Selmer
|
||||||
|
> conversion of the render fns, and route collapse (~12 → ~3). These are the bulk of the
|
||||||
|
> modal migration and require restructuring the modal's rendering wholesale rather than
|
||||||
|
> isolated edits; track as the continuation of Phase 2.
|
||||||
|
|||||||
Reference in New Issue
Block a user