Álvaro Tejero-Cantero 678fcc071b
🐛 Check the page that an add-page change stores (#12675)
* 🐛 Check pages added with a full page value in soft mode

An :add-page change can carry a whole page under :page instead of an
id and a name. extract-affected-ids reads the page to check from the
change's top-level :id, so that form left the new page unchecked and
a referential error in it was stored.

Collect those page ids after the changes are applied and run the
affected check on them in soft mode: log the file id, the page ids
and the error codes, and never refuse the save. This is the first
step of the two-step rollout. The follow-up moves the page id into
extract-affected-ids and makes the check hard. The counters of
#12665 decide when to flip it.

Relates to #12666

AI-assisted-by: claude-opus-5-5, deepseek-v4.1-flash
Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>

* 🐛 Collect the page of a whole-page add-page in the affected check

An `:add-page` change that carries the page alone, with its id inside
`:page` and none at the top level, escaped the referential check:
`extract-affected-ids` read only the top-level `:id`. The schema side
(`touched-page-ids`) already reads `(or id (:id page))`; the referential
side now does the same.

This replaces the separate soft-mode check of the first commit. The page
now goes through `validate-file-affected` like any page a save touches,
so the deployment's flags decide whether an invalid page is refused
(`:file-validation`) or only logged (`:soft-file-validation`), and no
second log hint or rollout step is needed.

AI-assisted-by: claude-opus-5-5

* 🐛 Check the page an add-page stores, not its top-level id

An :add-page that carries the page whole stores it under the id inside
:page. extract-affected-ids and touched-page-ids read the top-level :id
first, so a change whose two ids differ stored one page and checked
another, which does not exist. Both now read the id of the page first.

The unit test of the affected check moves to the common validate tests,
with a case for the differing ids on the referential and the schema
side. The backend test sends that form through update-file as well,
and a new test sends the page as a commit group, the way the editor
does, and expects the commit under :rejected and no stored page.

AI-assisted-by: claude-fable-5-2

* ♻️ Derive the add-page change ID from the page

Use the page ID for both redo and undo so the builder cannot emit
conflicting IDs. Keep the change format and the library API unchanged.

AI-assisted-by: gpt-6.2-sol

---------

Signed-off-by: Álvaro Tejero Cantero <alvorithm@teje.ro>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-11-20 17:47:53 +01:00
..
2026-11-20 09:53:37 +01:00
2026-11-20 09:53:37 +01:00
2026-11-20 09:53:37 +01:00