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

Step 4: Implementation Summary — Connect your agent

Cycle: v3/connect_agent; Mode: staged; Debug mode: enabled, inherited from Step 3 (log) Effort study: railspike-effort / v3/connect_agent, protocol P2, reference R1; ledger Extended estimates: enabled, inherited Branch: feat/connect_agent, stacked on feat/quill_member_posting (PR #519), which sits on main 5c3d8755 (PR #518 merged). Approved planning commits after the restack: 47cf8c2e (Step 1), da1d6d91 (Step 2), 443d5b9f (Step 3). The earlier index-repair commit fell away in the restack (its change conflicted with the same index lines); Stage 4 repairs the index again. Feedback: PF-20261129-F12 (parts c, d, e and the "Run your own site" expando)

Cycle estimate: 0.50

Step 4 entry

Entry projection: 0.50, reaffirming Step 3 (2026-12-02 UTC, same single exposed Claude rater). Stage originals copied from Step 3, not re-rated: S1 0.15, S2 0.15, S3 0.15, S4 0.10.

Dependency state at entry: PR #518 (quill.py join) merged. quill_member_posting not started; Stage 4's agent-posting check needs it. Before Stage 4 it ran as its own one-shot (record, PR #519) and this branch was rebased onto it, so stage commits above now carry new hashes: Stage 1 c8b63042, Stage 2 7228e705, Stage 3 3d14e2c0.

Stage 1 - Shared invite issuer

Original estimate: 0.15

  • Changes:

    • public/assets/invite_issuance.js: new issueInvitation(root, feedback, { pending, destination, days }), holding the token, sign, prepare, finalize and uncertain-outcome check that lived in the Invite form's handler. It returns { token, destination, link }; an unconfirmed finalization throws with error.pending to pass back for the check. Exposed as window.ForumInvitationIssuer = { issue, failure }.

    • The Invite page's submit handler calls it with days: 30; button, feedback, QR and destination behavior unchanged.

  • Verification:

    • ./v3 test --smoke InvitationIssuanceTest: 511 run, 511 passed, including the browser suite's lost-response case (button becomes "Check invitation", inspect before reissue). Full suite not run.

  • Notes: the uncertain-outcome message still names "Check invitation"; Stage 3 gives its button the same label in that state so the text stays true.

Retrospective stage-work assessment: 0.10 (smaller than planned: the form handler's page state separated cleanly)

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

Stage 2 - Connect your agent page

Original estimate: 0.15

  • Changes:

    • ProfilePresentationContent: new CONNECT_PROMPTS (open, visitor, member) and connectPrompts($profile, $origin, $membersOnly); "Post as an agent" removed from AGENT_PROMPTS (Connect replaces it). JetLAG's editorial now carries the agent prompts, so its Agents page and links appear (the maintainer: "This can be the case for all sites").

    • AgentPageController::renderStart(bool $membersOnly), title "Connect your agent"; Application passes the members-only flag.

    • templates/pages/agent_start.php: one main prompt per case, then "Get introduced" and "Run your own site" under a closed "Other prompts" <details>.

    • agent.css: on a members-only site the HTML carries both the visitor and member prompts; html[data-member] (set before paint in layout.php) shows one. No server-side viewer branching.

    • Link text "Use with your agent" / "Work with an agent" becomes "Connect your agent" (About, visitor intro, getting started, Prompts library).

  • Verification:

    • ./v3 test --smoke PresentationProfileMatrixTest PlainSiteTest AppNavigationPlacementTest: 510 run, 510 passed (updated page test; new testMembersOnlyConnectPromptsCoverMembersAndVisitors; jetlag added to the gating matrix). Full suite not run.

    • First paint, Chrome at 390 px (throwaway Playwright script, not committed): JetLAG default theme as visitor and as member, and Bubblegum as member. Computed display showed exactly one case each time, with no change after load.

  • Notes:

    • On a members-only site /agent/start/ is for signed-in members (it redirects others to the lobby, as before), so the visitor case shows only to a signed-in key without remembered approval. Visitors get the prompt from a member.

    • The member prompt still shows {invite} and {human} until Stage 3 adds the button and fills them.

Retrospective stage-work assessment: 0.15

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

Stage 3 - One-click invite

Original estimate: 0.15

  • Changes:

    • public/assets/connect_agent.js (new): the member case's "Make an invite for my agent" calls ForumInvitationIssuer.issue with 7 days, fills {invite} and {human} (the browser's username; "myname" when it has none) into the prompt, shows it, hides the button and says "Invite ready. It works once and expires in 7 days." A failure shows the issuer's message plus a closed Details (step, error, wait, online, signed-in name, browser) with Copy details; an unconfirmed finalization turns the button into "Check invitation", which checks the same invite.

    • invite_issuance.js: errors from the shared issuer carry step (invite prepare, invite finalize, invite check); its requests abort after 30 s (CONTRIBUTING: nothing waits forever), so a stalled finalization becomes the existing check-don't-redo path. This applies to the Invite page too.

    • agent_start.php: member case = button, status, Details and the prompt hidden until filled. AgentPageController loads the signing scripts and connect_agent.js only on members-only sites.

  • Verification:

    • New tests/browser/connect_agent_invite.cjs (run by InvitationIssuanceTest::testConnectYourAgentMakesOneInviteOnClick): page load makes no invite; one click makes one with a 7-day expiry and fills link and username; a lost finalization then a retry makes no second invite and fills the same token; a refusal shows the server message and Details with the step; no username falls back to "myname".

    • ./v3 test --smoke InvitationIssuanceTest PresentationProfileMatrixTest: 521 run, 521 passed (existing Invite page browser cases unchanged). Full suite not run.

    • First paint (same throwaway script): JetLAG member view shows only the button and "Other prompts"; visitor and Bubblegum views unchanged.

  • Notes: issuer messages still replace some original errors with friendlier ones (pre-existing on the Invite page); Details carries the step and the message we have, not the lost original.

Retrospective stage-work assessment: 0.15

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

Stage 4 - Acceptance end to end

Original estimate: 0.10

  • Changes:

    • QuillClientTest::testJoinRedeemsAnInviteLinkOnAMembersOnlySite now follows the Connect your agent member prompt: it takes connectPrompts(..., true)'s member text, fills {invite} and {human} as connect_agent.js does, reads the invite link and the username rule from the prompt, joins with joiner-test-agent, and posts the hello the prompt asks for ("Hello, I work for joiner."). The hello lands in the repository; a non-member key is refused.

    • Plans index: one entry for this cycle again (restack duplicate).

  • Verification:

    • ./v3 test --smoke QuillClientTest InvitationIssuanceTest PresentationProfileMatrixTest LlmsTxtRendererTest AppNavigationPlacementTest PlainSiteTest: 561 run, 561 passed. The acceptance test runs for quill.py, quill.pl and quill.php on a members-only server. Full suite not run.

    • The member's click in a real browser with real OpenPGP signing is not exercised end to end: the click path runs against stubbed routes (connect_agent_invite.cjs), and the invite in the acceptance test is issued through the same server routes by a Python helper. Not replayed on jetlaghq.com (it would create an invite and a post in production).

  • Notes: final diff review done (git diff 5c3d8755..HEAD, excluding #519's commit): no unrelated files; no new dependencies (npm install of the existing playwright-core devDependency was used only for throwaway screenshots, not committed).

Retrospective stage-work assessment: 0.10

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

Closeout

  • Completion Contract: normal entry (renamed links, Agents nav) passed; one click makes one 7-day invite and fills the prompt (stubbed browser test); agent joins and posts its hello under a name containing the member's (acceptance test, all three clients); recovery (lost finalization checks the same invite, refusal shows message and Details) passed in the stubbed test. Release condition pending: merge #519, then this PR, then deploy.

  • Pending: the maintainer's comfortable-fit judgment; a real-browser click on a deployed members-only site.

  • Cycle retrospective assessment: 0.50 (this cycle, excluding quill_member_posting).