Skip to content

feat: guide empty first-run spaces - #703

Merged
lilyshen0722 merged 1 commit into
mainfrom
codex/687-first-run-surround
Jul 22, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
codex/687-first-run-surround

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

Closes #687

Summary

  • show a compact Join Commonly HQ offer only when HQ is configured and the current user is not already a member
  • teach users how visible pod conversation works in the regular empty state while preserving the bot-to-bot branch
  • add agent-DM starter prompts that fill and focus the composer without sending, then disappear once the user types or messages exist
  • add token-based responsive styles and layout invariants for the HQ card and wrapping prompt chips

Verification

  • full frontend tests: 54 suites, 241 tests passed
  • focused onboarding/layout tests after rebase: 4 suites, 22 tests passed
  • frontend production build passed
  • changed-file ESLint: 0 errors (repo JSX-extension warnings only)
  • full frontend ESLint reaches the existing unrelated PersonalityBuilder.tsx react/no-unescaped-entities error; this branch introduces no lint errors
  • real-browser checks passed at 1280x900 and 390x844: no horizontal overflow, the mobile drawer card remains fully visible, chips wrap within the viewport, click fills/focuses the composer, and no message POST occurs

Scope notes

No backend, route, or API changes. The Community redirect from #699 remains the single member/non-member destination.

@lilyshen0722
lilyshen0722 merged commit 352fcc8 into main Jul 22, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the codex/687-first-run-surround branch July 22, 2026 06:38
lilyshen0722 added a commit that referenced this pull request Aug 4, 2026
…#834) (#838)

`enqueueMentions` returned before enqueueing anything when a message carried
no @mention and no replyTo, and the implicit path from #703 is gated on
replies. So the one message most likely to need an answer — a newcomer's
first — was the one guaranteed not to get one. Observed live in Commonly HQ
on 2026-08-04: a new member asked a question and it sat fourteen hours, in a
room whose pinned welcome promises a support agent answers within a minute.

Scope, kept narrow deliberately: this is a first-message welcome wake, NOT
general routing of unaddressed messages. The member whose day-30 question
goes unanswered is out of scope and stays there until ADR-017 ships a policy
layer.

Why it can ship before that layer, when a general rule cannot: the trigger is
a monotone state transition (never-spoken -> spoken), so fires are bounded by
the state space — members x pods, amortized one per join — INDEPENDENT of
traffic. Message-arrival and clock triggers are bounded only by traffic, and
taming those needs the budget machinery ADR-017 and #832 have not shipped.
#800's incident was a clock trigger: eleven wakes, zero edges.

Four things the design turns on:

- The marker is claimed for every first message, addressed or not. Claiming
  only unaddressed ones would welcome a member on their SECOND message when
  their opener was "@codex help".
- Greeters are explicit opt-in (`config.welcomeWake.enabled === true`), never
  inferred. "The pod's support agent" is not a schema concept, and guessing
  one — sole install, oldest, name contains "support" — makes the target
  drift silently as installs change. Same stance as #833's heartbeat flag.
- A first message with no designated greeter still claims the marker and logs
  a warning. Silent no-op was the failure mode most likely to ship: feature
  live, nothing happening, nothing saying why.
- The event is enqueued as `chat.mention`, not a new type. The CLI wrapper's
  extractPrompt returns null for anything outside PROMPT_EVENT_TYPES, so a
  bespoke `pod.first_message` would be dropped by every already-deployed
  wrapper — the #611 failure mode.

Sender resolution moves above the unrouted early-return so the wake can check
`isBot === false`; every existing use of it is downstream and unchanged.
AgentProfile now loads only on the routed path, holding the added cost of
reaching that point to two queries.

Known cost, stated rather than buried: one marker upsert per human message.
Bounded and indexed, but a write where there was none. If profiling shows it,
the fix is a read-first fast path — the correct-and-simple version matches
firstContactService exactly, and matching the reviewed pattern beat inventing
a faster unreviewed one.

Ships inert: nothing is welcomed until an install opts in.

Tests: 18 service + 6 wiring, plus 41 existing mention tests unchanged.
Mutation-tested — which caught dead code in my own first draft, an
`isRouted ? [] : ...` guard that read as decisive and survived deletion.
lilyshen0722 added a commit that referenced this pull request Aug 24, 2026
…ust ambience

Interim for TASK-058. The #703 implicit-reply path is human-only
(sender.isBot === false), so a bot's reply reached the replied-to author
as plain ambient activity — and the claim layer then ordered that author
to stand down from its own conversation (Sage stood down twice on
Anvil's thread replies, observed live 2026-08-24). Bot-to-bot thread
conversations were structurally inert without an explicit @mention.

The wake-on-message fan-out now stamps repliesToYourMessage on the ONE
target whose message the post replies to (or threads on), plus an inline
frame teaching NO_REPLY as the exit; the wrapper honors the flag exactly
like direct addressing at the claim gate. Deliberately NOT a widening of
ADDRESSED_EVENT_TYPES (per-event evidence, not a type-set re-price), no
new events, and the existing wake-storm dampener bounds any loop.
Lookup failure degrades to today's ambient behaviour, never to silence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TdEJoXUmbHmW5TFk7hfkbK
lilyshen0722 added a commit that referenced this pull request Aug 24, 2026
…ust ambience

Interim for TASK-058. The #703 implicit-reply path is human-only
(sender.isBot === false), so a bot's reply reached the replied-to author
as plain ambient activity — and the claim layer then ordered that author
to stand down from its own conversation (Sage stood down twice on
Anvil's thread replies, observed live 2026-08-24). Bot-to-bot thread
conversations were structurally inert without an explicit @mention.

The wake-on-message fan-out now stamps repliesToYourMessage on the ONE
target whose message the post replies to (or threads on), plus an inline
frame teaching NO_REPLY as the exit; the wrapper honors the flag exactly
like direct addressing at the claim gate. Deliberately NOT a widening of
ADDRESSED_EVENT_TYPES (per-event evidence, not a type-set re-price), no
new events, and the existing wake-storm dampener bounds any loop.
Lookup failure degrades to today's ambient behaviour, never to silence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TdEJoXUmbHmW5TFk7hfkbK
lilyshen0722 added a commit that referenced this pull request Aug 24, 2026
…ust ambience (#1189)

Interim for TASK-058. The #703 implicit-reply path is human-only
(sender.isBot === false), so a bot's reply reached the replied-to author
as plain ambient activity — and the claim layer then ordered that author
to stand down from its own conversation (Sage stood down twice on
Anvil's thread replies, observed live 2026-08-24). Bot-to-bot thread
conversations were structurally inert without an explicit @mention.

The wake-on-message fan-out now stamps repliesToYourMessage on the ONE
target whose message the post replies to (or threads on), plus an inline
frame teaching NO_REPLY as the exit; the wrapper honors the flag exactly
like direct addressing at the claim gate. Deliberately NOT a widening of
ADDRESSED_EVENT_TYPES (per-event evidence, not a type-set re-price), no
new events, and the existing wake-storm dampener bounds any loop.
Lookup failure degrades to today's ambient behaviour, never to silence.


Claude-Session: https://claude.ai/code/session_01TdEJoXUmbHmW5TFk7hfkbK

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
lilyshen0722 added a commit that referenced this pull request Aug 25, 2026
…species (#1205)

* docs(adr): ADR-018 D6.3 — a reply addresses its target regardless of species

D6.1 settled that targeting is respected and only broadcast gambles, but left
"what counts as targeting" to the implementation, which answered it with a
species gate: #703's implicit-reply path is gated on `sender.isBot === false`,
so a bot's reply to an agent never addresses that agent. Observed live on the
SEO squad 2026-08-24 — Sage stood down twice on Anvil's claim, from a thread
about Sage's own message.

Records Sam's ratified direction: a reply or quote addresses its target
whoever sent it, with anti-ping-pong moving to three bounded guards (wake
dampener, thread convergence, an exit-teaching frame). The principle the next
widening inherits: bound on evidence of a loop, never on who is speaking.

States plainly that this is less built than decided — the interim ship carries
per-target evidence on the existing message.posted fan-out and does not widen
ADDRESSED_EVENT_TYPES, and the convergence guard does not exist. Points the
interim code comment at the ADR rather than at a pod-local task id, and adds
the ADR-020 scope-boundary note that #963's regression earned.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(adr-018): guard 2 is not merely unbuilt — it has no signal to count

D6.3 already records that the convergence guard is not implemented. What
it did not say is why, and the gap matters: the obvious implementation is
a countDocuments that always returns zero.

A total-match NO_REPLY takes the !sanitizedContent branch and persists no
message row, so "two consecutive silent turns" leaves nothing to count.
The only durable trace is a system_exchanges entry written solely in
agent-dm pods, which is the wrong population. And neither layer knows the
thread — postMessage never learns one, and AgentEvent has no thread
column, its payload being Mixed.

So a converged exchange is indistinguishable from one the instrument
cannot see, and guard 2 belongs in the ack path: a wake already knows its
thread at enqueue, and a seat that acks a thread-scoped wake and posts
nothing into that thread is the convergence event, keyed by (seat,
thread) where both are in hand.

Also records that guard 2 must state its own failure direction. Guard 1
fails open because dropping a genuine wake is the worse error; guard 2
failing open risks the unbounded reply chain the species gate existed to
prevent. Copying guard 1's shape would import an answer reasoned for a
different question.

Status line now names the two open items inside D6.3 — signal source and
threshold — so the ratified direction cannot be read as deciding them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(adr-018): fix guard number in the D6.3 interim comment

The comment called convergence "D6.3's third guard"; the ADR it points at
calls it guard 2 throughout (1 = dampener, 2 = convergence, 3 = frame).
The comment's whole job is to route a reader to the right section before
they widen this path, so a wrong guard number defeats it.

Comment-only; zero non-comment lines changed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guided first-run: register→attach cliff (starter path + teaching empty states)

1 participant