From 7242b509fccee5b39f0d6c0828bd8b4ee19117c2 Mon Sep 17 00:00:00 2001 From: SAPHID Date: Thu, 3 Dec 2026 22:36:52 +0000 Subject: [PATCH] docs: design durable X outreach in T3 workflows --- docs/design/x-outreach-durable-workflow.md | 179 +++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 docs/design/x-outreach-durable-workflow.md diff --git a/docs/design/x-outreach-durable-workflow.md b/docs/design/x-outreach-durable-workflow.md new file mode 100644 index 0000000000000..4ceb056fa1548 --- /dev/null +++ b/docs/design/x-outreach-durable-workflow.md @@ -0,0 +1,179 @@ +# X outreach as a durable T3 workflow + +Proposal, 3 December 2026. Documentation only; nothing here enables a routine or authorizes a social action. + +**Recommendation:** ship a Frame Control workflow bundle on T3's existing Labs workflow engine, with a narrow X connector and a reusable, human-only approval boundary. Keep campaign rules outside core. Start with a durable read-only inbox; add posting only after approval and crash-recovery tests pass. + +## Today: two routines and a chat queue + +Framey, an assistant in Grok Bot, promotes and supports [Frame Control](https://framecontrol.fun/), Alex's free, open-source Steam Frame app ([source](https://github.com/saphid/frame-control)). Alex is `@alexpsouthwell`, X user ID `42151893`. This account posted about 75 near-identical promotional replies in October 2026 with almost no impressions. Relevance and honesty matter more than volume. + +The following describes the supplied operating history, not a fresh audit of Alex's X account: + +1. **Daily mentions, about 08:00 Sydney.** Read mentions and replies since the previous run, roughly 24 hours. Ignore spam/bots. For questions, bugs, feedback, praise or direct questions, prepare a handle, summary, original link and short suggested reply. +2. **Daily outreach.** Read the latest public release notes. Search recent English and other-language posts, especially Japanese, and replies beneath popular Steam Frame posts. Find real owners/buyers asking for something Frame Control actually offers: installs, files, status, screenshots/clips, OBS, clipboard or connection help. Aim for 10–20 drafts only when real matches exist. +3. **Filter before offering anyone.** Search `from:alexpsouthwell to:` and Alex's `with_replies` timeline. Exclude anyone he has already replied to or promoted to, on any topic, and anyone in an earlier batch. Exclude bots/spam, every thread rooted at `@HardwareSteam`, and `@josethevrtech` threads. +4. **Deliver the useful daily batch.** Send a numbered list containing handle, post link, actual ask and tailored draft. Keep Alex's friendly voice, short text, no hashtags and no repeated boilerplate link. Send nothing if the batch is empty. +5. **Response check, 09:00–21:00 Sydney every two hours.** A saved script records its window start and seen post IDs, printing new replies, mentions, quotes and other responses only. Classify Frame Control problems, confusing setup/docs, trust worries and fitting requests as fix items. Send the coordinator the link, problem and acceptance test, with full-auto coding, no social posting, no changes to Frame Control PR #113, one PR per fix, and an honest `## Announcement`. Direct questions/feedback get reply drafts; praise usually gets nothing; unrelated items get nothing. Notify Alex only for new actionable items. +6. **Human posting gate.** Alex sees each draft with its source and says “send” or presses Reply on an X draft card. Only that exact text goes through the X connector's `create_posts`. Edits need fresh approval. The flow posts one draft per user message, then drafts the next. +7. **Manual repair.** The parent assistant repeatedly corrects unsupported claims. Approved-but-unposted drafts and repeat offers to the same people accumulate across days. There is no complete shared ledger of discovered, offered, contacted, approved or posted items. Routines restart without the conversation; Grok usage outages stopped runs on 16–20 November. Coding jobs also stalled on approvals/quotas without supervision. + +One lead's current lifecycle is below. Skipping is manual or prompt-driven; expiry is an intended disposition, not an enforced, durable timer today. + +```mermaid +stateDiagram-v2 + [*] --> Discovered + Discovered --> Skipped: irrelevant, excluded or duplicate + Discovered --> Drafted: apparent feature match + Drafted --> Drafted: parent repairs claims or wording + Drafted --> AwaitingAlex: numbered batch or draft card + AwaitingAlex --> Skipped: Alex declines + AwaitingAlex --> Approved: exact text approved + Approved --> AwaitingAlex: any edit needs approval again + Approved --> Posted: connector returns a post ID + Approved --> Approved: waiting for next chat turn + AwaitingAlex --> Expired: becomes stale, when noticed + Approved --> Expired: becomes stale, when noticed + Posted --> [*] + Skipped --> [*] + Expired --> [*] +``` + +**Additional existing implementation:** read-only host inspection found `frame-reply-scout.service` running on lxso1, owned by `~/Services/frame-reply-scout/{README.md,scout.py}`. It already has a SQLite queue, person reservations, model-deferred items and an `unknown` send outcome. Its README describes a 30-minute scan, one reply per person, a daily cap and spacing; it uses a different read/send transport from Grok. It is not evidence that the two routines have migrated or that its contact history is complete. Import its ledger and reconcile it before enabling another sender. No service or queue was changed for this proposal. + +## What this repository already provides + +Source baseline: upstream `origin/main` at `efbd62a7a700a29ad545f8334b2139407875dab3`. These are shipped code capabilities, not claims about what is enabled on Alex's running environment. + +| Existing capability | Source and practical boundary | +| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Durable TypeScript workflows | [workflow.ts](../../apps/server/src/workflows/workflow.ts) supplies `workflow`, journaled `step`/`step.try`, durable sleep/waits, child runs, tags/subjects and pools. [WorkflowEngine.ts](../../apps/server/src/workflows/WorkflowEngine.ts) uses Effect's SQL-backed cluster workflow engine with a single runner. Completed step results survive restart; external actions still need their own idempotency. One process owns a workflow database. | +| Persisted runs and shared state | [WorkflowStore.ts](../../apps/server/src/workflows/WorkflowStore.ts) and [initial workflow migration](../../apps/server/src/persistence/Migrations/110_Workflows.ts) persist runs, steps, waits, signal mail/deduplication, triggers, references and shared key/value state. [stepServices.ts](../../apps/server/src/workflows/stepServices.ts) exposes schema-checked `store.entry`, atomic `update` and multi-key `store.transaction` inside steps. Start keys deduplicate across definition versions. This is enough for a small outreach ledger; it is not an X contact model. | +| Definitions and deployment | [WorkflowRuntime.ts](../../apps/server/src/workflows/WorkflowRuntime.ts) loads and watches TypeScript definitions; Labs can disable execution. Unfinished runs retain their definition versions. [User guide](../user/workflows.md) documents the workflow folder and CLI. Definitions execute trusted server-side code, not sandboxed extension code. | +| Timers and webhooks | [triggers.ts](../../apps/server/src/workflows/triggers.ts) has interval, daily, webhook and issue/PR-open triggers. `daily` follows the **server clock**, with no per-trigger IANA timezone, and skips fixed times missed by over ten minutes. [Scheduler.ts](../../apps/server/src/scheduling/Scheduler.ts) drives due work. [ScheduledTaskService.ts](../../apps/server/src/scheduledTasks/ScheduledTaskService.ts) persists single-prompt timer/webhook tasks and dispatch state. A scheduled prompt is not a multi-stage workflow. | +| Agent steps and threads | [workflowAgent.ts](../../apps/server/src/workflows/workflowAgent.ts), [WorkflowAgentThreads.ts](../../apps/server/src/workflows/WorkflowAgentThreads.ts) and [WorkflowAgents.ts](../../apps/server/src/workflows/WorkflowAgents.ts) run typed agent steps in ordinary threads, including worktrees and linked environments. Step failure can pause for a person. Code-step retries and automatic resume exist; model quota failover and campaign supervision are application policy. | +| Questions, phone and remote clients | `ask` supports choices, data, links, timeout and answer attribution. [Workflows.ts](../../apps/server/src/workflows/Workflows.ts) exposes answer/resume/cancel/withdraw. [Web run feed](../../apps/web/src/components/workflows/WorkflowRunFeed.tsx) and [mobile run screen](../../apps/mobile/src/features/workflows/WorkflowRunRouteScreen.tsx) already render and answer questions. [Shared presentation](../../packages/client-runtime/src/workflows.ts) reads `data.body`; no new phone app is needed. These are individual questions, not an outreach batch editor. | +| CLI, MCP and secrets | [CLI](../../apps/server/src/cli/workflow.ts) and [workflow MCP toolkit](../../apps/server/src/mcp/toolkits/workflow/tools.ts) can start/read/signal/resume runs and edit shared state. [MCP secret handling](../../apps/server/src/mcpServerSecrets.ts) keeps sensitive connector settings out of normal settings/wire values. This is an integration route, not a built-in X connector or a general installable UI-extension API. | +| Event-sourced coding orchestration | [Orchestrator.ts](../../apps/server/src/orchestration-v2/Orchestrator.ts), [EventSink.ts](../../apps/server/src/orchestration-v2/EventSink.ts) and [EffectWorker.ts](../../apps/server/src/orchestration-v2/EffectWorker.ts) separate command decisions, transactional events/projections/receipts/outbox, and effects. Provider-process recovery is not a promise to replay every external action. The retained event log is bounded; durable projections and application records must retain business history ([architecture](../internals/01_architecture.md)). | + +Two gaps must not be hidden by the existing abstractions: + +- **An `ask` answer is not proof of human consent.** [MCP handlers](../../apps/server/src/mcp/toolkits/workflow/handlers.ts) accept signals and attribute them to clients; agents can also use the CLI. [WebSocket answer handling](../../apps/server/src/ws.ts) stamps a paired session, but generic signals/store writes remain available. Do not let `{ approved: true }`, an agent's paraphrase, or a client label authorize posting. +- **A journal cannot make an X write exactly-once.** X may accept a reply before the step result commits. Automatic workflow resume could execute that step again. The connector needs a send-intent ledger and explicit reconciliation. + +Also missing: campaign history/imports, exclusion ancestry checks, source-backed claims, stale-draft policy, X rate-limit handling and a supervisor for stalled fix work. [Issue #39013](https://github.com/pingdotgg/t3code/issues/39013) records workflow follow-ups; its older findings are a risk checklist, not proof each still exists on this baseline. + +## Proposed workflow bundle + +Use versioned definitions and helpers in a maintained bundle, deployed to the configured T3 workflow folder. This is an “extension” in the sense of user-owned workflow code plus a connector; no new plugin ABI or second workflow engine is assumed. + +Three short workflows keep discovery independent of human delays: + +1. **`frame-x-scan`** accepts a scheduled/manual tick. Code fetches mentions/responses, Alex's own replies, outreach searches and source snapshots. It pages to the saved cursor, stores results, then atomically commits the cursor. Model steps classify relevance and feature fit. Code deduplicates and starts one `frame-x-lead` per source post using a stable key. Scans finish without waiting for approvals. +2. **`frame-x-lead`** loads the lead → checks contact/exclusion history → verifies a feature match → drafts → validates every claim → opens an approval question → rechecks freshness/history → requests a permitted send → records the result. Code records skipped/expired reasons. Question names include the draft revision; editing withdraws the old question and creates a new revision/run. `subject` is the original post URL; tags identify the campaign and status. +3. **`frame-x-fix`** receives an actionable problem independently of any social draft. A model writes the problem and observable acceptance test; code deduplicates it, then a T3 coding agent gets a task-owned worktree and typed output containing its thread, PR and validation. Persist those references. A supervisor watches attempts and current PR checks, resumes recoverable failures, and raises blocked work to Alex. One fix per PR, honest `## Announcement`, no social tools, and an explicit exclusion for **saphid/frame-control PR #113**. + +The following division is deliberate: + +| Deterministic code | Model work | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| Pagination/cursors, identity resolution, history checks, root-author exclusions, contact reservations, state transitions, expiry, source hashes, schema checks, claim-policy checks, approvals, posting bytes, rate limits, retries and receipts | Relevance/spam assessment, language/translation, intent and bug classification, feature-to-need matching, concise drafting and semantic claim review | + +Models receive post text as untrusted data and bounded source excerpts. Drafting/classification agents have read-only tools and no X write credentials, approval authority or general full-access shell. A model's “verified” label never bypasses code policy. + +### State that survives every run + +Start with namespaced, schema-versioned records in `T3.store`, accessed through workflow steps and the CLI/orchestration interface. Use explicit secondary keys and transactions, not repeated scans of chat history. Keep authoritative approval/send records behind the trusted connector boundary; generic workflow-store edits cannot mint permission. + +| Record/key | Required data and invariant | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `lead::` | Author ID and handle aliases, conversation/root IDs and author, original URL/text/language/time, discovery lane/run, classification, state, feature match, exclusion evidence, `offeredAt`, expiry and skip reason. Unique source post across both routines. | +| `contact::` | Historical replies/promotions, offered batches, active reservation, sent/unknown outcomes and manual exclusions. Stable X IDs, not handles, own deduplication. One outstanding offer per person; a prior offer remains excluded after expiry. | +| `alex-reply:` | Alex's reply ID, recipient IDs, parent/conversation, timestamp and provenance. Import `with_replies` plus candidate-specific search; refresh before sending. Any prior topic counts. Track coverage/gaps, not just newest timestamp. | +| `draft::` | Immutable exact UTF-8 text, account and parent IDs, language, claim/evidence IDs, policy/source versions, hash, created/expiry times and superseded revision. Keep history; edits create a revision. | +| Approval receipt | Draft revision/hash, account, target, evidence/policy version, Alex's authenticated approval event/session, time, deadline, revocation and consumption. Append-only audit; agent signals are not receipts. | +| Send intent/receipt | Unique approval-derived operation ID, immutable payload, `ready / sending / posted / unknown / rejected`, attempts, timestamps, response/error, posted ID/URL and reconciliation evidence. The sender owns these durable records. | +| Scan/source/fix records | Per-endpoint/query cursor and pagination checkpoint; Sydney slot keys; source content hashes and fetched time; idempotent fix/thread/PR mapping; retry deadline, model attempt and last error; append-only business transitions. | + +Use states `discovered → eligible → verified → drafted → awaiting_approval → approved → sending → posted`, with explicit `skipped`, `expired`, `superseded`, `blocked` and `unknown` outcomes. `blocked` can resume without losing the lead; only reconciliation resolves `unknown`. Revocation is allowed before the sender atomically claims the intent; once `sending`, cancellation cannot promise to undo a network write. Retain contact/offer/send tombstones independently of pruned workflow runs. + +Migration imports the old script's cursors/seen IDs, Scout state, Alex's reply history and the chat backlog. Treat claimed historical approval as **unverified**, preserve its provenance, refresh the source, and ask again. Never replay the old approved queue automatically. Unknown contact-history coverage blocks outreach; an empty search result is not proof of no prior contact. Inbound items from previously contacted people remain available for bug triage/manual handling, without automatically creating another promotional draft. + +### Triggers, deduplication and expiry + +- Use `every("5 minutes")` as a durable dispatcher tick. Code converts time with `Australia/Sydney`, claims unique local-date/slot keys transactionally, and starts the daily 08:00 scan plus response scans at 09/11/13/15/17/19/21. This handles daylight saving without changing the server timezone or inventing a timezone option on `daily`. +- After downtime, coalesce missed slots into one catch-up per lane, scanning from the last fully committed cursor. Use a small overlap and post-ID deduplication for delayed API indexing. An API retention gap is a visible coverage failure, never silently marked complete. Bound each run's pages/cost and persist continuation work. +- Default outreach lookback: 72 hours; expire outreach when its source reaches 72 hours. Support drafts expire 48 hours after drafting. Approval expires at the earlier draft deadline or 24 hours after approval. These are proposed defaults. Recheck deleted/changed source, root author, manual Alex replies, claims and exclusion history before dispatch. +- Resolve full thread ancestry before offering a lead. Skip roots owned by HardwareSteam or josethevrtech; unresolved roots are blocked. Resolve those handles to stable IDs and retain aliases. Reserve a person atomically across lanes and earlier batches. No target-count pressure: 10–20 is a ceiling/aim when justified, not a minimum. + +### Claims: evidence before prose + +Build a small reviewed feature catalogue from the [website](https://framecontrol.fun/) and [published release notes](https://github.com/saphid/frame-control/releases). Fetch both; record URL, content hash, excerpt, release tag/date, platform, maturity, verification limit and allowed wording. Ignore drafts, withdrawn candidates and unreleased code. The authenticated releases API can expose unpublished entries; do not select the first item blindly. At research time the public latest release was [v0.4.62](https://github.com/saphid/frame-control/releases/tag/v0.4.62), explicitly limiting hardware verification. + +Each draft returns structured claims linked to catalogue entries and exact text spans. A separate model pass detects omitted/implicit claims, including in Japanese; code enforces required qualifications and denies unsupported capabilities. Absence or conflict in sources blocks the claim. If a capability appears in only one source, record the other source as checked but absent; do not manufacture corroboration. Require reviewed catalogue admission before it can be offered. Fetch before drafting and again before posting if the snapshot is over 24 hours old; changed supporting evidence invalidates approval and requires revalidation/reapproval. + +Keep these supplied limits as policy until reviewed evidence explicitly supersedes them: + +- Mac desktop panels work; Windows PC-in-headset is experimental. +- Wireless Adapter check: Windows only, read-only, untested on real hardware. +- OBS, clips and Decky/Framey loader: rough/early; worn-headset behavior unverified. +- No claim that it “reconnects,” types from a PC keyboard into the headset, or fixes Valve/SteamOS bugs. PC clipboard to the headset desktop is the supported wording. +- Describe charge, charging watts and time left; do not infer a confirmed charging-state feature. +- No Virtual Desktop dates or SteamOS release-note claims without reading and citing the original source. + +Reject boilerplate, unnecessary links and hashtags. Human edits pass the same checks. A model cannot conclusively prove arbitrary prose true: uncertain drafts stay blocked for source review, rather than relying on a keyword blacklist or a second model's confidence. + +### Approval on chat, desktop/web and phone + +Reuse workflow `ask`, `kind: "x_reply"`, `links` and `data.body` to show the original post, context/translation, exact reply, evidence limits and expiry. Offer **Approve exact text**, **Edit**, **Skip**. A phone uses the existing Workflows “Needs you” view on the owning environment; desktop and web use the same server state. Disconnection never approves anything. + +Add a small reusable **approval service**: an authenticated human action freezes an immutable payload and issues an opaque receipt. Bind it to the draft hash, account, parent and expiry; store the receipt outside agent-writable workflow state. The posting connector verifies that receipt against the service. Generic `t3 workflow signal`, store writes, a timeout or “full auto” cannot authorize an X write. Shared types belong in contracts; thin RPC/UI handlers call the service. Agents receive neither the human approval capability nor the sender's credentials. This requires actual credential/process separation, not hiding a tool from its prompt. + +Chat “send draft D revision 3” must resolve to the exact card already displayed and an authenticated user-message event. The server, not the assistant's statement, records consent. If message provenance cannot be attested, chat opens the native approval action; it does not post. UI and phone issue the same approval request. Start with existing individual cards; later add selection plus a final manifest showing every selected revision. A bulk approval binds that immutable manifest, never future drafts. An edit or stale card invalidates the old revision across all clients. + +After approval, the deterministic sender can drain the approved queue without one additional chat message per draft. Alex may revoke unclaimed intents and see pending, posted and unknown items. Approval grants only the displayed reply; it grants no other social actions. + +### X transport, retries and exact text + +Use an X adapter with read/search/history and reply-only write methods. Prefer the supported API/connector after checking its actual scopes, search retention, pagination and create-post behavior; those entitlements were not tested here. Preserve the existing `create_posts` integration where it supports the contract. Credentials belong on the owning environment in secret storage, with OAuth refresh and identity validation against `42151893`. Never store tokens in drafts, workflow results or model context. Do not inherit Scout's transport merely because it is running. + +The write request takes an approval/operation ID, **not model-provided text**. It loads the immutable approved payload, checks byte/hash equality and current policy, and calls `create_posts` with exactly that text and parent. Do all newline/link/length validation before approval. Never translate, shorten, add a link or “fix” wording at send time. Keep X's own display/link transformations distinct from the submitted text. + +Use a per-account send pool (`within(..., { limit: 1 })`) and connector-side reservation. Initially cap at 10 replies/day and at least 90 seconds apart, adopting Scout's conservative defaults; make limits configurable. Release pools while awaiting people. Persist endpoint/account rate budgets and reset deadlines; honor `429`/reset headers and bounded jittered backoff. Reads and model calls may retry with budgets; `401/403` require credential/access repair, not repeated posting attempts. + +Before network I/O, the connector commits the intent as `sending`. A repeated operation ID returns its stored outcome. A crash after dispatch or timeout becomes `unknown`, keeps the person reserved and **never automatically sends again**, even if the workflow step is resumed. Reconcile against Alex's replies by parent, exact submitted text and time; use a connector idempotency key only if its guarantee is documented. A positive match records the posted ID; a negative search alone does not prove non-delivery. Alex can resolve an uncertain outcome with evidence; retry requires explicit permission and a fresh approval. The system promises durable intent and duplicate prevention, not impossible end-to-end exactly-once delivery. + +Recording the remote result and advancing T3 are separate commits. On replay, query the sender receipt by operation ID and repair the T3 ledger; never redispatch to repair a missing local `posted` row. A successful send records contacted recipient, source, exact text and posted URL atomically in the sender's store, then mirrors the result into workflow state. + +### Failures and visibility + +Keep the inbox quiet when a completed scan finds nothing actionable. Surface new drafts, bugs and changed failure states once, using persisted notification keys. Do not confuse a failed/partial scan with an empty result. Show last successful scan, coverage gaps, source freshness, counts by disposition, oldest approval, next retry/rate reset, unknown sends, model cost and fix-thread/PR links. Existing workflow run/step views supply the first operational UI; add bounded summaries rather than streaming whole timelines. + +Code scans, recording, expiry and approved dispatch continue without a model. Model-dependent items persist as `blocked_model`, with attempt, provider/model, error class and next retry. Use `agent.try` to branch on failure and durable sleeps for bounded retries; ordinary failed agent steps otherwise hold for a person. A configured alternative model may retry only read-only classification/drafting against the same schemas and claim policy. No available quota means retain the item and raise one deduplicated outage; never relax verification, approvals or expiry. An independent deterministic supervisor checks overdue scans, paused fix jobs and retry exhaustion so a failed parent model is not its own watchdog. + +The T3 owner must remain online; this is restart recovery, not high availability. Back up workflow state together with approval/send receipts and contact history. After restore or owner migration, disable sending and reconcile newer remote replies/receipts before resuming. Keep exactly one owner; do not run Grok, Scout and T3 senders concurrently. Retention may remove raw post text under X policy, but must preserve lawful minimal contact/exclusion tombstones; losing them must block outreach rather than reset permission. + +## Phased delivery and acceptance tests + +| Phase | Small useful deliverable | Acceptance test | +| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 1. Read-only durable inbox | Import backlog/Scout/history; scan both lanes; deterministic exclusions/deduplication; reviewed feature catalogue; show source-backed drafts through existing workflow questions. Posting disabled. | Replay overlapping scans, handle changes and the same person across days: one offered person and no excluded root. Crash midway through pagination: resume without loss or cursor advance past unrecorded items. Import an old approval: it cannot send. Unsupported claim fixtures, including Japanese, stay blocked. | +| 2. Review and supervision | Native web/desktop/phone questions, edits/expiry, Sydney dispatcher, fix-thread creation and independent stall detection. | Approve on phone then open desktop: same revision/state. Edit/expiry invalidates the old card. Generic agent signal cannot produce a posting receipt. Test both Sydney DST transitions and multi-day downtime: one catch-up with visible coverage. A quota-blocked fix survives restart and is surfaced; duplicate bug reports map to one fix; PR #113 is excluded. | +| 3. Controlled posting | Human approval service, isolated reply connector and sender ledger, all clients/chat using one contract. Enable only after mock acceptance. | Double-click and concurrent devices yield one intent. Tamper with text/parent/account, forge store approval, replay a chat claim or revoke before claim: no send. Crash before dispatch, after X accepts and before local commit: no duplicate; uncertainty remains visible/reserved. Wire payload equals approved bytes; `429`, credential expiry and rejected replies preserve approval/expiry rules. Use a fake connector; any real canary needs Alex's separate exact-text approval. | +| 4. Cutover and queue ergonomics | Immutable batch review, audited reconciliation, source-change reapproval, backup/restore procedure and retirement of old triggers. | Shadow-scan all historical backlog cases; account for every imported item. Restore with a remote reply newer than the backup: sending stays off until reconciled. A batch edit cannot inherit old consent. Stop old routines/sender only during an authorized cutover; verify T3 alone owns schedules/sends. | + +## Placement, risks and remaining decisions + +**Choose the T3 workflow bundle, not campaign logic in core or a separate service orchestrating T3 threads.** T3 already owns durable scheduling, journals, waits, questions and agent lifecycles. Rebuilding them outside it creates another recovery boundary. Keep feature facts, Sydney cadence, exclusions and copy policy in the bundle. A narrow external connector is acceptable for X credentials/send receipts; it must not become a second workflow scheduler. + +The reusable human-approval receipt and its client/contract support are the justified core addition. Existing generic questions cover phase 1; they are insufficient authority for phase 3. Avoid promising an installable extension UI that this repository does not provide. If core will not accept the receipt boundary, retain a read-only T3 workflow and use a separately authenticated human review/sender surface; do not silently weaken approval. + +Main risks are incomplete X history/search entitlements, ambiguous write outcomes, source claims outrunning hardware proof, untranslated overclaims, trusted workflow code/agent process privileges, and an offline owner. The gates above make these blocked or unknown states visible. They cannot make missing historical evidence or arbitrary model prose certain. + +Open questions for implementation, with safe defaults already chosen: + +- Which supported X connector exposes all required reads, permitted exact-text replies and reliable response IDs? Default: verify in a fake/read-only integration first; no cookie-based fallback or new paid entitlement. +- Can T3 attest human chat message provenance and isolate approval capabilities from agent terminals? Default: native approval action until proven; no chat-only auto-send. +- How complete are historical Grok/Scout queues and Alex's reply history? Default: imported approvals need review; uncertain people stay excluded/blocked. No automatic exception for already-contacted support recipients. +- Should the proposed expiry, cap and spacing change after observing the queue? Default: 72-hour outreach, 48-hour support drafts, at most 24-hour approval, 10/day and 90-second spacing; measure useful conversations rather than draft volume. +- What lawful minimal history can be retained under the selected X access terms? Default: keep exclusion coverage conservative and pause outreach if required deletion would make deduplication unsafe.