From 1ef4d2486c4c6c62e3bdb3d63852591d29f21c7e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sun, 20 Sep 2026 12:53:59 +0900 Subject: [PATCH 1/7] Reconcile list-resource #[Link] declarations with ALPS (#136) BlockList and PaymentList declared doUpdate*/doDelete* on their own onGet - transitions ALPS assigns to the single-row Block/Payment states, not the list. Both resources' own docblocks already said as much ("Single-row affordances ... live at page://self/admin/payment/payment"). The surplus declarations advertised a Link: header target that can't actually be followed as declared either - a bare href with no bound row identifier, since the real per-row delete/update forms are rendered inline in the list HTML, unrelated to this resource-level attribute. Per-resource resolution (the two options the issue posed have different right answers depending on whether ALPS's assigned target resource is GET-reachable at all): - Block/Payment: a real single-row GET view exists (Block::onGet, Payment::onGet), so moved the declaration there - matching ALPS exactly. Payment::onGet already declared doUpdatePayment; Block::onGet was missing doUpdateBlock entirely (an oversight, not by design) and Payment::onGet was missing doDeletePayment the same way - filled both in, or removing the list's declaration would have made the transition undiscoverable via hypermedia anywhere, not just corrected. - TaxRuleList: alps.json's TaxRule state lists doDeleteTaxRule, but there is no goTaxRule transition and no onGet on TaxRule.php - "intentionally no onPut... edits flow as delete + create" per its own docblock. There is no GET-reachable resource to move the declaration to without inventing one, so this is the one case where the resource is right and ALPS was incomplete: connected #doDeleteTaxRule into TaxRuleList's descriptor set instead. Regenerated alps.json.html/alps.svg and synced the docs/ copies per AGENTS.md. Updated the two Hypermedia workflow tests that exercised the old (wrong) navigation - extracting doUpdateBlock/doUpdatePayment/doDeletePayment from the list response, the only place they used to be declared. Now: Block: testUpdatesBlock's own response already carries doUpdateBlock (no extra hop needed); testDeletesBlock re-fetches the single-row Block GET (Block::onPut doesn't redirect, so there's no Location to follow - a real client returning to a bookmarked item page would do the same). Payment: both testUpdatesPayment and testDeletesPayment now follow the Location header (Payment's create/update both redirect to the single-row GET) instead of detouring through the list. Adding doUpdateBlock/doDeletePayment to the single-row GETs surfaced two new html-link-audit-ledger entries, symmetric to the doDeleteBlock/doUpdatePayment entries already there: the "new blank form" mode (blockId/paymentId absent) doesn't render an update/delete form, so the declared link has no matching affordance (target-missing, resourceOnly - same classification as their siblings). Also removed two ledger entries that are no longer observed now that the surplus links are gone from the list resources (block-list doUpdateBlock, payment-list doUpdatePayment method-mismatch). Verified: full suite green (2806 tests, 33061 assertions), psalm clean, asd --validate alps.json clean, HtmlLinkAuditLedgerTest and both Hypermedia workflow test files pass, all four affected HTML render tests (AdminBlockHtmlRenderTest, AdminBlockListHtmlRenderTest, AdminPaymentListHtmlRenderTest, AdminTaxRuleListHtmlRenderTest) pass unchanged - the rendered per-row forms were never driven by this PHP attribute, only the Link: HTTP header and the audit ledger were. --- alps.json | 3 +- alps.json.html | 3300 ++++++++-------- alps.svg | 3481 +++++++++-------- docs/alps.json.html | 3300 ++++++++-------- docs/alps.svg | 3481 +++++++++-------- src/Resource/Page/Admin/Block/Block.php | 1 + src/Resource/Page/Admin/Block/BlockList.php | 2 - src/Resource/Page/Admin/Payment/Payment.php | 1 + .../Page/Admin/Payment/PaymentList.php | 2 - tests/Html/html-link-audit-ledger.json | 20 +- .../FlowAdminContentPublishTest.php | 10 +- .../FlowAdminShopConfigurationTest.php | 12 +- 12 files changed, 6820 insertions(+), 6793 deletions(-) diff --git a/alps.json b/alps.json index 3b91d063c..9f3388840 100644 --- a/alps.json +++ b/alps.json @@ -1225,7 +1225,8 @@ "descriptor": [ {"href": "#TaxRule"}, {"href": "#goTaxRuleList"}, - {"href": "#doCreateTaxRule"} + {"href": "#doCreateTaxRule"}, + {"href": "#doDeleteTaxRule"} ] }, diff --git a/alps.json.html b/alps.json.html index b117ea293..b56247e9b 100644 --- a/alps.json.html +++ b/alps.json.html @@ -89,7 +89,7 @@