Repository source: docs/plans/post_records/post_records_step4_implementation_summary.md
Debug mode: enabled (inherited from Step 3)
Effort study: railspike-effort / v3/post_records; host ledger. Standing P2 enrollment. Split child v3/retraction_target_id merged in #189.
Extended estimates: enabled (inherited from Step 3)
Cycle estimate: 0.95 (Step 4 entry; reaffirms the Step 3 projection unchanged)
Approval: Approved Step 3 by the maintainer, 2026-11-14T08:18:00Z. Branch feat/post-records from 523b8171. Planning commit ff7d755.
Stage originals, copied from Step 3 (not new ratings): Stage 1 0.12, Stage 2 0.15, Stage 3 0.10, Stage 4 0.10, Stage 5 0.15, Stage 6 0.15, Stage 7 0.15, Stage 8 0.05. Stage work only; they don't add up to the cycle.
Tests: per the repository rules, only the smoke set plus the tests for what changed, through ./v3 test --smoke …. The full suite was not run.
Stage 1 - A retraction can name a reaction
Original estimate: 0.12 Retrospective estimate: 0.12
Changes:
RemovalTarget::family()returnspost,post-reactionorthread-label, andRemovalTarget::sourceCandidates()returns the target's own record paths.PostRetractionRecordParserrejects a legacyPost-IDrequest that names a reaction.New
AcceptedRetraction::prepareReaction(). The receipt holds the reaction's thread inThread-ID, the post it was on inParent-ID, and its creation time inTarget-Created-At.AcceptedRemoval::all()now returns post removals only. A newAcceptedRemoval::reactions()returns reaction removals. This keeps reaction receipts out of rebuild placeholders, post suppression, label ownership and history-purge planning, all of which callall().RetractionDeletion::commitremoves the target throughsourceCandidates(), and its commit message names the family.ContentImportPlannerwon't import a reaction that was retracted locally.New
tests/ReactionRetractionTest.php(4 tests).
Verification:
Passed:
./v3 test --smoke ReactionRetractionTest RetractionTargetIdTest RemovalReceiptTest RetractionReceiptTest AcceptedRetractionTest ReadModelPostRetractionsTest RetractionTransactionTest RetractionMaintenanceTest HistoryPurgePlannerTest ContentImportPlannerTest ContentImportRecoveryTest DeleteRecordCommandTest, 509 run, 509 passed, 0 failed.Not run: the full suite.
Notes:
Step 3 planned to filter inside
ReadModelBuilder,AcceptedRetractionandRetractedPosts. One filter inAcceptedRemoval::all()covers all of them, plus history purge and imports.RetractionSweepstill counts reaction receipts when choosing its artifact cutoff time, which is harmless.
Estimate details: original scope as in Step 3, unchanged; no revisions. Retrospective: as planned. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Stage 2 - Retract a like through the API
Original estimate: 0.15 Retrospective estimate: 0.15
Changes:
LocalWriteService::prepareRetractionandfinalizePreparedRetractionbranch onRemovalTarget::family().New
requireRetractableReaction()loads the like fromrecords/thread-labels/orrecords/post-reactions/. It accepts only a like, meaning anaddwith exactlylikeand no source post. It resolves the like's thread, and allows the liker or a current approved operator (RetractionAuthority::currentOperator).The request's
Author-Identity-IDis the liker. An operator addsActor-Identity-IDandRetraction-Class: operator, as for posts.Finalize accepts the like through
AcceptedRetraction::prepareReaction, commits throughRetractionDeletion, and then runs a full derived-state refresh. Stage 3 replaces that refresh.The replay and retry paths are shared with posts.
Tests:
WriteApiSmokeTest::testMembersRetractTheirOwnLikesAndOperatorsRetractAnyLikecovers a thread like: a stranger is refused, the liker retracts, the file is gone, the receipt and commit message are written,viewer_tagsdrops the like, no post row appears, re-liking writes a new like, a replay answersalready_retracted, an operator retracts someone else's like, and a full./v3 rebuildagrees.testReplyLikesRetractAndOtherReactionsAreRefusedcovers a reply like (receiptThread-IDandParent-ID), re-liking, a flag being refused, and a missing record.
Verification:
Passed:
./v3 test --smoke ReactionRetractionTest RetractionTargetIdTest RetractionReceiptTest AcceptedRetractionTest ReadModelPostRetractionsTest RetractionTransactionTest WriteApiSmokeTest SingleRequestPostingTest PostRetractionScriptTest, 704 run, 704 passed, 0 failed.Not run: the full suite.
Notes:
The first draft of the test asserted on
vote_count. That count includes only approved members, so it was replaced by checkingviewer_tagsdirectly.
Estimate details: original scope as in Step 3, unchanged; no revisions. Retrospective: as planned. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Stage 3 - Targeted update after retracting a like
Original estimate: 0.10 Retrospective estimate: 0.08
Changes:
refreshAfterReactionRetractionnow calls the like path's own helpers,synchronizeThreadLabelDerivedStateorsynchronizePostReactionDerivedState. These re-derive the thread's labels or the post's reactions from the remaining files, and fall back to a full rebuild if the read model isn't current or the update fails.Page invalidation matches what a new like invalidates: the reply's page, or the thread for a root.
The thread-like test calls
finalizePreparedRetractiondirectly, so it can assert thatread_model_incremental_updateran andread_model_rebuilddidn't. The full rebuild at the end of that test checks that the targeted result matches a rebuild: no like inviewer_tagsand no reaction inposts.
Verification:
Passed:
./v3 test --smoke WriteApiSmokeTest ReactionRetractionTest IncrementalReadModelUpdaterTest, 667 run, 667 passed, 0 failed.Not run: the full suite.
Estimate details: original scope as in Step 3, unchanged. Retrospective 0.08, slightly under: the existing helpers needed no changes. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Stage 4 - delete-record on a like leaves a receipt
Original estimate: 0.10 Retrospective estimate: 0.12
Changes:
New
Canonical/ReactionTarget::describe()reads either kind of like (thread label or post reaction) and says where it sits and whether it is a like. Stage 2'srequireRetractableReactionnow uses it too, so the site and the CLI agree.New
Write/ReactionRemoval: writes a local-operator receipt (records/post-removals/<id>.txt,Target-IDandParent-IDas for signed retractions), thengit rms the record and its.ascand commits all of them together, rolling back on failure.scripts/delete_record.php: a like target, by ID or byrecords/post-reactions/orrecords/thread-labels/path, goes throughReactionRemoval, followed by the script's usual full rebuild and static build. A target that already has a receipt reports "Reaction already removed".Other reactions keep the plain
git rmpath. Routing every reaction through the new path brokeLocalAppSmokeTest::testDeleteRecordCommandRemovesRecordCommitsAndRefreshesDerivedStateandtestThreadAttributesCommandResolvesDeletedLabelRecordToThread, which delete a non-like label. That's consistent with the slice: only likes are retractable.docs/reference/v3_cli.md: new "Deleting a like" section.Test:
DeleteRecordCommandTest::testDeletingALikeRemovesItsSignatureAndLeavesAReceipt.
Verification:
Passed:
./v3 test --smoke DeleteRecordCommandTest WriteApiSmokeTest ReactionRetractionTest RetractionTargetIdTest ContentImportPlannerTest, 695 run, 695 passed, 0 failed. That includes the twoLocalAppSmokeTestcases above.Not run: the full suite.
Notes:
Deviation: Step 3 said to reuse Stage 3's targeted update here. The CLI keeps the script's existing full rebuild instead, because the targeted helpers are private to
LocalWriteServiceand the CLI is a rare operator action. The result is the same, just slower.
Estimate details: original scope as in Step 3, unchanged. Retrospective 0.12, slightly over: extracting the shared reader and scoping the route to likes. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Stage 5 - Records section on the post page
Original estimate: 0.15 Retrospective estimate: 0.18
Changes:
New flag
FORUM_POST_RECORDS_ENABLED("Post records"): off by default, site-mutable, in the EXPERIENCE group. Added to both flag lists inFeatureFlagEvaluatorTest.New
Canonical/PostRecordList::forPost()lists the post's own record, likes and flags on it, its format changes, titles it set as a reply, and receipts of retracted reactions on it. When the post is a root, it also lists thread labels and thread titles. Rows are sorted with the post first, then by time.New
templates/partials/post_records.php: a collapsed<details>with kind (linking to/records/<id>), what, by, when, and a source or receipt link. Retracted rows are struck through.ThreadAndPostPageController::postpassespostRecordsonly when the flag is on, andtemplates/pages/post.phprenders it.Tests:
WriteApiSmokeTest::testPostPageListsItsRecordsBehindTheFlag(flag off shows nothing; flag on lists the post and the like with links; after retraction the like row shows struck through with its receipt link) andReactionRetractionTest::testPostRecordListFindsExactTargetsOnly(an ID with a dot, a regex look-alike and a longer ID; the format record's actor; replies leave out thread labels).tests/run.phpregistersReactionRetractionTestandRetractionTargetIdTest. Neither had been registered, so both had been skipped. See the correction in retraction_target_id's summary.
Verification:
Passed:
./v3 test RetractionTargetIdTest ReactionRetractionTest, 12 run, 12 passed../v3 test --smoke RetractionTargetIdTest ReactionRetractionTest WriteApiSmokeTest FeatureFlagEvaluatorTest FeatureFlagsBehaviorTest DeleteRecordCommandTest: 697 run, 696 passed, 1 failed. The failure isFeatureFlagsBehaviorTest::testRenderedOrderIgnoresRegistryInputOrder. It fails onmainwithout these changes too (an undefined$indentintools_nav_card.phpunder its fixture), so it isn't caused by this work.Not run: the full suite.
Notes:
Deviation: Step 3 said "one query over existing tables". The read model has no index of reactions, formats or titles by post, so the lookup uses
git grepover the record directories with anchored patterns. It reads current files and needs nothing kept in sync, and it only runs with the flag on.The first version passed
-xtogit grep, which has no such flag, so every lookup failed silently. The page test caught it.Timestamp records aren't listed; this repository has no such record directory.
Estimate details: original scope as in Step 3, unchanged. Retrospective 0.18, over: the
git greplookup instead of a query, and the test-registration problem. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Stage 6 - A page for each record
Original estimate: 0.15 Retrospective estimate: 0.15
Changes:
New route
/records/<Record-ID>inApplication.php, handled by the newThreadAndPostPageController::record(). With the flag off, or for an unknown or malformed ID, it returns 404.Lookup: posts and reactions through
RemovalTarget::sourceCandidates, plusrecords/post-formats/andrecords/thread-subjects/. A removal is read fromAcceptedRetraction::readorLabelRemoval::read.New
templates/pages/record.php: kind and ID; a link to the target post and to its#recordslist; the author; for a removed record, a "Retracted." notice with the time, the actor if it differs from the author, and the receipt link; otherwise every header, the body (not for posts, which link to "Read this post"), the source link, and the signature link with itsreaction_signaturesstatus where indexed.Test:
WriteApiSmokeTest::testEachRecordHasAPageAndRetractedOnesShowTheirReceiptcovers flag off (404), a live like's fields and links, a post's page, the like's page after retraction, an unknown ID and a path-traversal ID (both 404). A smallrenderStatus()test helper was added.
Verification:
Passed:
./v3 test --smoke WriteApiSmokeTest ReactionRetractionTest RetractionTargetIdTest, 681 run, 681 passed, 0 failed.Not run: the full suite.
Notes:
The page renderer uses
$pathfor the template's own file, so the first draft showed the template path as the record's source. The variable is nowrecordPath.
Estimate details: original scope as in Step 3, unchanged. Retrospective: as planned. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Stage 7 - Retract buttons and docs
Original estimate: 0.15 Retrospective estimate: 0.15
Changes:
New
templates/partials/retract_record_control.php, shown only to the liker or a current operator, with different confirmation text for each. It reusespost_retraction.js(data-action="retract-post").submitSignedRetractionalready sends that ID astarget_id, so the script andbrowser_signing.jsneed no changes.The control appears in a new last column of the Records list for live likes, and on the record page of a live like. That means a
likeadd with noSource-Post-ID, matching the server rule. The record page loads the signing scripts andpost_retraction.jsand passesviewerCanRetractOthers, computed the same way as on the post page.public/assets/site.css: a few rules for the list table, retracted rows and the record page's field list.Docs: a new concept,
docs/concepts/post_record_list.md. Dated lines inpost_retraction,reaction_record,post_presentationandincremental_source_removal. "Reaction targets" sections inpost_retraction_record_v1.mdandremoval_acceptance_record_v1.md. A like note inagent_api.md, and an updatedllms.txtretraction line with itsLlmsTxtRendererTestassertion.Test:
WriteApiSmokeTest::testRetractButtonsShowForTheLikerAndOperatorsOnly. On both the post page and the record page, the liker and an operator see the button with their own confirmation text, while a stranger and a logged-out viewer don't. The record page loadspost_retraction, and after retraction neither page shows the button.
Verification:
Passed:
./v3 test --smoke LlmsTxtRendererTest WriteApiSmokeTest ReactionRetractionTest RetractionTargetIdTest DeleteRecordCommandTest FeatureFlagEvaluatorTest PostRetractionScriptTest, 711 run, 711 passed, 0 failed.Passed: the links in the new concept file resolve.
Inapplicable here: clicking the button in a browser. That needs a signing key in the browser. The click path is the existing
retract-posthandler, whichPostRetractionScriptTestalready exercises. The live check is Stage 8.Not run: the full suite.
Notes:
The first
llms.txtwording, "a like's Record-ID", put an apostrophe inside a single-quoted PHP string.php -lcaught it before any test ran, and it was reworded.
Estimate details: original scope as in Step 3, unchanged. Retrospective: as planned. Rater: Claude, the same exposed rater.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5
Review corrections
An independent agent reviewed the code diff (523b8171..29fb735) before closeout. It hadn't seen the planning or the implementation. Corrections:
Retracted likes could be replayed back (fixed). A signed like's bytes stay public in git history. Re-submitting them to
apply_thread_tagorapply_post_tagpassed every check once the file was gone, so anyone could make a retracted like count again. The reviewer reproduced it.signedReactionInputnow refuses a Record-ID that has a signed or local removal receipt; posts already had this guard. New test:WriteApiSmokeTest::testARetractedSignedLikeCannotBeReplayedBack.Record page called a repaired post "Retracted" (fixed). A
delete-record --repair-labelsreceipt (operation: resolve) leaves the post in place.record()now treats onlydeleteas removed, and catches any decode error, not justRuntimeException.Retract button on likes the server refuses (fixed). The list now calls a record "Like" only for an
addwithoutSource-Post-ID, the same rule as the server. A retracted reaction's receipt row reads "Like", since only likes can be retracted.ReactionRetractionTest::testPostRecordListFindsExactTargetsOnlyand the post page test check both.delete-recordrobustness (fixed). It now refuses a like that isn't committed, and one that already has a signed receipt. On failure it removes the receipt before restoring the files.Members-only instances (fixed).
/records/<id>is allowlisted inisApplicationRoutelike/posts/<id>, so a signed-out visitor gets the lobby rather than a 404.Known limitations, not fixed in this cycle:
./v3 purge-historystill plans only post removals, so a retracted like's bytes stay in history./source/blob/<sha>/records/thread-labels/…still serves them. Likes carry no prose, and the replay guard removes the harm, so both are left for a later cycle.The Records list runs about seven
git grepprocesses per post view, but only with the flag on. If static detail pages are also on, a full static build pays that for every post.
Verification: passed
./v3 test --smoke WriteApiSmokeTest ReactionRetractionTest RetractionTargetIdTest DeleteRecordCommandTest ContentImportPlannerTest LlmsTxtRendererTest PostRetractionScriptTest, 727 run, 727 passed. The two new web tests were also run by name and passed.
Cycle closeout
Delivered scope: v8 as approved.
Likes can be retracted through the existing signed retraction, with
Target-ID, by the liker or a current operator, using a targeted update. Replay can't restore them.delete-recordon a like leaves the same local receipt a post gets.Behind
FORUM_POST_RECORDS_ENABLED: a Records list on post pages,/records/<Record-ID>pages, and Retract buttons.Docs and
llms.txtare updated.
Revisions: start
523b8171. Planningff7d755, then Stages 1–7 (f5c0ef2,134341a,e16bd80,38fe695,8110882,702ace2,29fb735), the debug report, and the review corrections.Stages: 8 planned, 7 implemented. Stage 8 is the release: you deploy, turn on the flag, and retract a like on zenmemes.com.
Verification: focused and smoke tests passed at each stage. The full suite wasn't run.
FeatureFlagsBehaviorTest::testRenderedOrderIgnoresRegistryInputOrderfails onmaintoo. No browser click-through yet.Deviations from Step 3:
The Records lookup uses
git grep, not a read-model query.The CLI rebuilds in full rather than with the targeted update.
Timestamp records aren't listed.
Corrective work:
The review corrections above.
tests/run.phpwas missing two test files, one of them fromretraction_target_id, which is also corrected there.
New requests: none.
Enhancement requests still open:
Retracting flags, labels and other reactions.
Purging retracted likes from history.
A keep-both retraction mode for the presets thread.
Retrospective scope assessment: 0.98. That's slightly over the projected 0.95. The cause is the
git greplookup, the test-registration fix and the review corrections.Maintainer comfortable-fit judgment and acceptance: pending.
— Claude · 2026-11-14 UTC · Model: claude-opus-5-5