Feature plan: Step 1 · Step 2 · Step 3 · Step 4

Reverted 2026-12-04. The maintainer asked for this implementation to be undone, so it was reverted with a commit rather than by rewriting history. See revert_agent_opt_out. The trigger was the read-model columns agent_declared and agent_tagged, added for a single attribute.

Cycle: v3/agent_opt_out. Branch plans/agent-opt-out. Planning commits: Step 1 2aa3e2b, Step 2 e5ee5c3, Step 3 87053e0 (verified before Stage 1).

Debug mode: enabled

Effort study: railspike-effort / v3/agent_opt_out; host ledger agent_opt_out.md. Standing P2 enrollment.

Extended estimates: enabled.

Cycle estimate: 1.10 (Step 4 entry; Step 3 value reaffirmed, single exposed Claude rater, 2026-12-02 UTC)

Approval: "approved step 3", 2026-12-02. No split was chosen, so Stage 7 stays in this cycle.

Tests: smoke set plus each stage's tests (./v3 test --smoke …); the full suite was not run.

Stage 1 - Agent header, derived columns, feature flag

Original estimate: 0.15

Retrospective: 0.15

  • Changes:

    • PostRecord::$agent and PostRecordParser: optional Agent: yes|no header; any other value is a parse error. Spec updated in canonical_post_record_v1.md.

    • Read model (schema 58): posts.agent_declared (the post's own header, cleared on retraction) and posts.agent_tagged (an approved key gave #agent), plus a partial index for declarations. Written by the full rebuild and by both incremental insert paths and the scoped reaction update.

    • New Support\AgentMarker: the marking rule in one place. markedIdentityIds() (identity's own latest value, or the latest value among approved keys of the same username), markedCondition() for SQL, isMarked() for loaded rows.

    • Feature flag FORUM_AGENT_OPT_OUT_ENABLED, off by default, site-mutable, in the Experience group.

  • Verification:

    • New AgentMarkerTest (5 tests): header parsing, latest declaration marks earlier posts and a later "no" takes it back, guest posts, same-username keys, approved-only #agent with scoped and full rebuild agreeing, incremental post write.

    • Updated expectations: FeatureFlagEvaluatorTest::testRegistryListsCurrentPublicFlags, ReadModelSchemaTest, EventWhenRecordTest (now reads the schema constant instead of a literal).

    • ./v3 test --smoke AgentMarkerTest FeatureFlagEvaluatorTest ReadModelSchemaTest ScopedPostReactionUpdateTest EventWhenRecordTest CanonicalRecordParsersTest: all pass.

  • Notes:

    • Identity marking is computed per request from declarations, not stored per post, so a new declaration needs no re-derivation of older posts. The Stage 1 risk about propagation through incremental updates no longer applies.

    • The schema bump means one full rebuild on deploy.

  • Estimate details: original scope as planned; no revision.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Stage 2 - Member #agent mark

Original estimate: 0.10

Retrospective: 0.15

  • Changes:

    • LocalWriteService::applyPostTag accepts agent while the flag is on, through the existing reaction record (Target-Kind: post). An unapproved key is refused: "Only approved members can mark a post as agent."

    • Retraction: ReactionTarget reports is_agent_mark; requireRetractableReaction lets the mark's author or a current operator retract it, the same rule as likes. The records table offers Retract for "Agent mark" rows, and PostRecordList labels them.

    • "Mark agent" button on reply cards and the root card for approved viewers while the flag is on; hidden once the post is marked. The existing "Agent" button (request an agent reply) is unrelated and unchanged.

    • Thread and post queries (fetchThreadPosts, fetchPost, ThreadRepository) now select agent_tagged and agent_declared.

  • Verification:

    • New AgentOptOutPageTest: flag off refuses the tag and shows no button; flag on writes the record, sets agent_tagged, and the button leaves the marked reply.

    • AgentMarkerTest::testAnAgentMarkIsDescribedAsRetractable.

    • Updated WriteApiSmokeTest::testReplyLikesRetractAndOtherReactionsAreRefused for the new refusal text.

    • ./v3 test --smoke AgentOptOutPageTest AgentMarkerTest WriteApiSmokeTest::testReplyLikesRetractAndOtherReactionsAreRefused WriteApiSmokeTest::testApplyPostTagApiRejectsAnonymousViewerAndUnknownTag: all pass.

  • Notes:

    • The button is gated on the identity hint's profile being approved, as the retract control is, not on a signed-in session.

    • A retracted mark's receipt row still reads "Like" in the records table: receipts don't carry the tag, and PostRecordList assumes reaction receipts are likes. Left as is; logged for later.

  • Estimate details: retrospective above the original because the thread page loads posts through Application::fetchThreadPosts, not only ThreadRepository.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Stage 3 - Quill marks agents by default

Original estimate: 0.10

Retrospective: 0.15

  • Changes:

    • Server: /api/text_rules adds "agent_marker": true while the flag is on. The prepare/create routes take agent=yes|no (ignored while the flag is off) and write the Agent: header last. SignedPostBundleValidator accepts the header in client-signed records; the staging reason no longer calls it unsupported.

    • Quill (quill.py, quill.pl, quill.php, version 2026-12-02.2 after rebasing onto main, which had already used .1): signed records carry Agent: yes only when text rules advertise agent_marker, so older sites never stage an unknown header. The prepared flow always sends agent; sites without the feature ignore it. New --human sends Agent: no.

    • /llms.txt and /skill.md: one Agent policy line about marking, shown only while the flag is on.

  • Verification:

    • AgentOptOutPageTest::testWritersAndTextRulesCarryTheMarkerOnlyWhileTheFlagIsOn (prepare route, text rules and guide, flag on and off).

    • SingleRequestPostingTest::testSignedThreadCarriesAgentHeader.

    • tests/quill_client_test.py: new AgentValueTest; all 43 pass. QuillClientTest, LlmsTxtRendererTest, AgentPostingApiTest pass.

    • perl -c public/quill.pl, php -l public/quill.php.

  • Notes:

    • Pre-existing failure fixed: PostLinkTest.test_thread_reply_and_older_server failed on the base commit too; it expected #reply-2, but Quill prints #post-reply-2, which matches the page's post-<id> anchors. The expectation was stale.

    • claude's identity will declare itself on its first post with the new Quill after the flag is on.

  • Estimate details: retrospective above the original for the server-side write paths, which the plan had under Stage 1.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Original estimate: 0.20

Retrospective: 0.25

  • Changes:

    • New Support\AgentView: the reader's choice for this request, from the agent_view cookie (show/hide), set in Application::handle. listedSqlSuffix() leaves out marked posts and posts in threads an agent started.

    • AgentMarker rewritten to one SQL rule (IDENTITIES_SQL, markedSql()), so listings need no PHP-side identity list; markedIdentityIds() and isMarked() remain for rows already loaded.

    • Listings: ScoreVisibility::listedSql() now adds the reader's filter, which covers the board, /threads/, tag pages, search, gallery, the Zen strip and profiles through ThreadRepository, ThreadKeysetPage and AuthoredContentRepository. RecentPostRepository::eligible() adds it too, which covers Recent and Unread. The offline snapshot uses the new publicListedSql(), so a hiding reader's request never filters the shared copy.

    • Thread page: marked replies are dropped and a reply under one moves up to its nearest shown ancestor; "N replies by agents hidden. Show" sits above the replies. A thread an agent started, or a marked post's own page, shows "Agent post hidden" with a "Show agent posts" link.

    • /agent-view?set=show|hide&return=/path: sets the cookie (two years, SameSite=Lax, HttpOnly) and redirects to a same-site path only. A steady "Agent posts hidden · Show" note sits above the page content while hiding; Preferences gets a "Posts marked as agent" row.

  • Verification:

    • AgentOptOutPageTest::testHidingReaderSeesNoMarkedPostOnAnyRoute: /, /threads/, the thread, Recent, a tag page, two searches and the gallery in both modes; the agent-started thread and a marked post's page.

    • AgentOptOutPageTest::testSwitchStoresTheChoiceAndReturnsOnlyToThisSite (including //host and absolute URLs going home).

    • ./v3 test --smoke AgentOptOutPageTest AgentMarkerTest WebServerRoutingTest BoardListTest BoardSearchTest RecentPostTest InboxPageTest InboxFeedTest PreferencesPageTest FastNavigationLayoutTest: 533 run, all pass.

    • No-JavaScript: everything above is server-rendered links and cookies; no script involved.

  • Notes:

    • Any cookie already keeps a reader off the PHP-served static copies (FrontController::resolveStaticArtifactPath needs no cookies). Limitation: high-traffic mode's Apache rules serve .high-traffic/ copies without looking at cookies, so a hiding reader can see agent posts while that mode is on. Not changed here because the production server keeps a local edit to public/.htaccess; logged as a follow-up.

    • Activity, calendar and the prompts page were not walked in the test. Prompts and calendar go through ThreadRepository; Activity is an audit view and stays unfiltered, like flagged posts.

  • Estimate details: retrospective above the original for the agent-started-thread rule and the SQL-only marker rewrite.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Stage 5 - Text views, API and offline reader

Original estimate: 0.15

Retrospective: 0.15

  • Changes:

    • Text API: /api/get_thread prefixes marked posts with (agent) while the flag is on; for a hiding reader it drops marked replies (moving answers up, as the HTML page does), adds Agent-Replies-Hidden: N, and answers 404 with a reason for a thread an agent started. /api/get_post adds Agent: marked, or answers 404 with a reason for a hiding reader. Listing endpoints already go through the shared rule.

    • Offline snapshot: new agent_marked_posts table listing the snapshot's marked posts. The snapshot itself stays the same for everyone.

    • offline_reader.js: agentHiddenIds() reads the agent_view cookie; the saved board leaves out marked threads, a thread leaves out marked replies (same re-parenting), and a thread an agent started says why it isn't shown. Updates replace the marks for the threads they carry. Snapshots without the table hide nothing.

    • The cookie is no longer HttpOnly, because the offline reader reads it; it holds only show or hide.

  • Verification:

    • AgentOptOutPageTest::testTextApiAndOfflineSnapshotCarryTheMarks: text API in both modes; a snapshot built from the read model lists both marked posts and still contains them.

    • New AgentOptOutOfflineReaderTest (node): board filtering with no cookie, other cookies, hide, show, and an older snapshot.

    • ./v3 test --smoke AgentOptOutPageTest AgentOptOutOfflineReaderTest PublicOfflineSnapshotBuilderTest PublicOfflineSnapshotManifestTest AbsentRetractionSnapshotTest OfflineSnapshotPresentationTest OfflineSnapshotThreadPresentationTest: all pass.

    • Not done: a manual airplane-mode check in the installed app on a phone. That needs a deploy; it's listed under Stage 8's production checks.

  • Notes: none.

  • Estimate details: as planned.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Stage 6 - Upfront question and invite preset

Original estimate: 0.15

Retrospective: 0.15

  • Changes:

    • Instance default: new site-mutable flag FORUM_AGENT_POSTS_HIDDEN_BY_DEFAULT (off). While on, a reader who hasn't chosen yet gets agent posts hidden. Implemented as a flag rather than a separate setting, the same way other site choices are stored.

    • One-time question: until a reader chooses, pages show "Some posts here are written by AI agents. Do you want to see them? You can change this any time in Preferences." with "Show agent posts" and "Hide agent posts" links. Plain links, so it works without JavaScript; answering sets the cookie and returns to the same page.

    • Invite preset: the invite page has "Posts by AI agents: Let them choose / Show / Hide". The link becomes /lobby/?agent_view=hide#invite=…, and /lobby/ stores that choice on arrival. The signed invitation record is unchanged; the preset rides in the link and the QR code.

    • Application::storeAgentView() sets the cookie in one place and updates the current request.

  • Verification:

    • AgentOptOutPageTest::testQuestionUntilChosenAndTheDefaultAndInvitePresetApply: question shown until chosen; default hides for unchosen readers and a "show" cookie overrides it; /lobby/?agent_view=hide stores the cookie; the signed-in invite page offers the selector.

    • FeatureFlagEvaluatorTest, InvitationIssuanceTest pass.

  • Notes:

    • Plan change, smaller than planned: the preset is a link parameter instead of an invitation-record header, so no record format or spec changed. The trade-off is that someone could edit the link before opening it, which only changes their own view.

  • Estimate details: as planned.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Stage 7 - No-replies directive

Original estimate: 0.20

Retrospective: 0.15

  • Changes:

    • New Support\AgentReplyDirective: a line agents: no-replies on its own. On a thread's first post it covers the whole thread; on a reply, the replies made directly to it. It stays visible in the post.

    • LocalWriteService::agentReplyRefused(): applies only while the flag is on, and only to agent authors: the post says Agent: yes, or says nothing and its identity is marked. Agent: no (Quill's --human) always passes.

    • prepare_reply refuses before anything is signed, so Quill stops with the reason. create_reply refuses guest posts with agent=yes and the site's own agent replies (reader-requested ones). create_signed_post stages a signed agent reply with the reason, so it shows in the author's /staged/; a signed reply from an unknown key is refused instead, because staging needs a registered key.

    • Agent guide: one line asking agents to respect the directive.

  • Verification:

    • AgentOptOutPageTest::testNoRepliesDirectiveRefusesAgentRepliesOnly: prepared agent reply refused, agent=no allowed, guest agent reply refused, guest human reply allowed, a thread without the line unaffected.

    • SingleRequestPostingTest::testSignedAgentReplyToNoRepliesThreadIsStaged: staged with the reason; the same key's Agent: no reply publishes.

    • ./v3 test --smoke SingleRequestPostingTest AgentOptOutPageTest WriteApiSmokeTest: 748 run, all pass.

  • Notes:

    • Plan change: Quill needed no client code for this. The server answers prepare with the reason and stages signed replies, and Quill already prints both. That's why the retrospective is lower.

    • Not done: a profile-level directive. User pages have no editable text, so it needs a new record; logged as a follow-up, as the plan allowed.

  • Estimate details: see the plan change above.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Stage 8 - Docs, verification, release prep

Original estimate: 0.10

Retrospective: 0.10

  • Changes:

    • New concept entries agent_marker.md and agent_visibility.md; updated reaction_record.md, staged_submission.md, agent_posting_client.md, agent_guide.md. Source paths checked against the code.

    • Feature-flag page rows come from the registry, so nothing else was needed for Tools.

  • Verification:

    • ./v3 test --smoke with every test this cycle touched (21 classes listed in the PR): 861 run, 861 passed. python3 -m unittest tests/quill_client_test.py: 43 passed. The full suite was not run.

    • Final diff review of 87053e0..HEAD: the filter runs per request and never reaches shared copies. The offline snapshot uses publicListedSql(); the static artifact cache is served only to requests with no cookies and only deleted on writes; high-traffic copies render in an isolated worker without cookies.

    • Pending, needs a deploy: background rebuild (schema 58) on zenmemes.com, flag on, claude's next Quill post declaring the identity, a hide-mode check that none of claude's posts show, and an airplane-mode check in the owa.

  • Notes:

    • Follow-ups logged here (not done): high-traffic Apache rules ignore the cookie; profile-level agents: no-replies; a retracted agent mark's receipt reads "Like"; a voluntary "written with AI help" line.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Cycle retrospective

  • Delivered scope: all eight planned stages, with three plan changes recorded in their stages (identity marking computed by one SQL rule instead of stored per post; invite preset in the link instead of the invitation record; no-replies enforced by the server, so Quill needed no extra client code).

  • Starting revision 87053e0 (approved Step 3); stage commits on plans/agent-opt-out.

  • Retrospective scope assessment: 1.10 (single exposed Claude rater, 2026-12-02 UTC; not a measured value). Unchanged from the Step 3 projection: Stage 2 and Stage 4 ran over, Stage 7 under.

  • Maintainer comfortable-fit judgment: pending. Measured time: unknown.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Rebase onto main

  • 2026-12-02: rebased onto origin/main 0d7ba5f (32 new commits). Commit hashes quoted earlier in these plans are from before the rebase; the rebased planning commits are 8c2a1d2 (Step 1), d5e4d73 (Step 2), d41fc6d (Step 3).

  • Conflicts resolved: Quill's new join command (kept beside --human); the agent guide's new labeling line (kept main's wording, added ours after it); invite links now come from issueInvitation() (the preset is inserted into issued.link). Quill's join reads #invite= anywhere in the link, so /lobby/?agent_view=hide#invite=… still works. Main had already used Quill version 2026-12-02.1, so this branch uses 2026-12-02.2.

  • Re-verified after the rebase: smoke set plus the 21 touched test classes, 864 run, all pass; quill_client_test.py OK. Full suite not run.

— Claude · 2026-12-02 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)

Second rebase onto main

  • 2026-12-03: rebased onto origin/main cf4f32ddb (449 new commits) to open the PR.

  • One conflict: main moved the root card's Reply and Flag into the "…" menu (post_menu_items.php). "Mark agent" now lives in that menu too, through a new menuCanMarkAgent item, for both the root and full reply cards. Compact cards keep it inline next to their inline Flag.

  • Re-verified: the smoke set plus the 21 touched test classes, 870 run, all pass; quill_client_test.py OK. Full suite not run.

  • Open question for review: the AGENTS.md copy rule prefers static server HTML with viewer-specific UI decided in the client. This feature decides on the server from the cookie instead, so hiding works without JavaScript (a v3 constraint), and any cookie already skips the shared static copies.

— Claude · 2026-12-03 UTC · Model: Claude Opus 5.5 (claude-opus-5-5)