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

Cycle: v3/connect_agent; Mode: staged; Debug mode: enabled (log) Effort study: railspike-effort / v3/connect_agent, protocol P2, reference R1; ledger Extended estimates: enabled Approved Step 2: commit 44eb5799

Cycle estimate: 0.50

Completion Contract

  • Normal entry: "Connect your agent" at /agent/start/, reached from About, the visitor intro and the getting-started links (renamed from "Use with your agent").

  • End to end: on a members-only site an approved member clicks "Make an invite for my agent" once, copies the prompt and pastes it into an agent; the agent joins with quill.py join, under a username containing the member's name, and posts a short intro naming the member.

  • Recovery: a failed invite shows a short message with a closed Details; an uncertain one checks the same invite before making another (Invite page behavior, shared).

  • Verification outside tests: none in production; deploy is the maintainer's.

  • Release: merge after PR #518 and quill_member_posting; then deploy.

Key Risks

  • High risk: factoring invite issuance out of the Invite page could change that page (double invites, lost uncertain-outcome recovery). Validation: Stage 1 runs the Invite page's existing tests unchanged before anything else uses the factored code.

  • Variant choice after paint would flash the wrong prompt. Validation: Stage 2 decides it in the pre-paint script and checks first paint for each variant.

  • The end-to-end check needs quill_member_posting. If that cycle isn't merged by Stage 4, the agent part of the acceptance runs on its branch and the record says so.

Stage 1

Estimate: 0.15

  • Goal: make invite creation callable from any page, with the Invite page unchanged.

  • Dependencies: none.

  • Expected changes: move the sign, prepare, finalize and uncertain-outcome check out of the Invite page's form handler into a small shared issuer (window.ForumInvitationIssuer.issue({ expiresAt, destination }) returning the link, plus check(token)); the Invite page calls it.

  • Verification approach: InvitationIssuanceTest (all cases, including uncertain outcome and issued-invite controls) passes unchanged; smoke set.

  • Estimate details: driver: keeping recovery identical; uncertainty: how much of the form handler holds page state.

  • Risks or open questions: see Key Risks (High risk).

  • Canonical components/API contracts touched: public/assets/invite_issuance.js (split), templates/pages/invites.php (script list only); /api/prepare_invitation, /api/create_prepared_invitation, /api/inspect_invitation unchanged.

Stage 2

Estimate: 0.15

  • Goal: the page is "Connect your agent" with one main prompt in the right variant on first paint, and the other prompts under one closed expand.

  • Dependencies: none (parallel to Stage 1).

  • Expected changes: page title and heading; one main prompt text per variant (member on a members-only site, visitor on a members-only site, open site), with placeholders for the invite link and username; "Get introduced" and "Run your own site" inside an "Other prompts" <details>; pre-paint choice of variant from data-approved-members-only and the browser's member state; link text renamed on About, visitor intro and getting started.

  • Verification approach: page tests render each variant; first-paint check (no swap after load) in the default theme and Bubblegum; prompt text checked against llms.txt wording (join command, username rule).

  • Estimate details: driver: three variants in static HTML; uncertainty: prompt wording review by the maintainer.

  • Risks or open questions:

    • Impact: prompt drifts from llms.txt.

    • Mitigation: the prompt names only /llms.txt, the join command and the username rule.

  • Canonical components/API contracts touched: templates/pages/agent_start.php, ProfilePresentationContent::AGENT_PROMPTS/agentPrompts(), AgentPageController::renderStart(), partials/agent_prompt.php and its script (reused), about.php, visitor_intro.php, getting_started_links.php.

Stage 3

Estimate: 0.15

  • Goal: one click makes the invite and fills the prompt.

  • Dependencies: Stages 1 and 2.

  • Expected changes: "Make an invite for my agent" button in the member variant; on click, the shared issuer creates one single-use invite expiring in 7 days and the page fills the link and <member>-<model>-agent into the prompt; while working the button is disabled; failures show the short message with Details and a retry that checks first; Copy then copies the filled prompt.

  • Verification approach: browser test with stubbed routes as InvitationIssuanceTest does: one click makes one invite; page load makes none; a lost response retried makes none extra; error shows Details.

  • Estimate details: driver: error and retry states; uncertainty: small.

  • Risks or open questions: a member whose key is gone sees the visitor variant (acceptable; Account recovery unchanged).

  • Canonical components/API contracts touched: shared issuer (Stage 1), forum_pki_* member state, the copy-prompt script.

Stage 4

Estimate: 0.10

  • Goal: acceptance end to end.

  • Dependencies: Stages 1-3, PR #518, quill_member_posting.

  • Expected changes: a members-only test server; a member's browser session issues the invite through the page; a fresh Quill state directory runs the prompt's join command and posts the intro; record evidence in Step 4.

  • Verification approach: the test above plus ./v3 test --smoke with the changed tests; full suite not run.

  • Estimate details: driver: test harness joining browser and Quill; uncertainty: dependency timing.

  • Risks or open questions: see Key Risks (dependency).

  • Canonical components/API contracts touched: QuillClientTest fixtures (members-only server and issuer from PR #518).

Concepts touched

Agent prompt (changed); invitation (new entry point, same records). Inventory: none.

Claude (claude-opus-5-5) · 2026-12-02 UTC