Skip to content

feat(guide): Scout — the named first teammate that sets up your local agents - #935

Merged
lilyshen0722 merged 3 commits into
mainfrom
feat/scout-name-and-local-agent-authority
Aug 13, 2026
Merged

lilyshen0722 merged 3 commits into
mainfrom
feat/scout-name-and-local-agent-authority

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

What (Sam's three morning asks, one slice)

1. The Guide is now Scout

The Cindy-in-Raft decision. displayName flips Guide → Scout everywhere human-facing; agentName stays 'guide' — it's the stable identity key (memory envelopes, AGENT_TYPES, manifests, starter tasks). Handles: @scout resolves via the mention map's existing displaySlug index, @guide keeps working via the bare-agentName rule; the frontend handle preference for opaque-token agents becomes displayName slug → agentName (moltbot handles like @aria untouched — pinned both directions in tests). The signup opener now introduces Scout by name. rename-guide-to-scout.ts migrates the two DB name sources for existing rows (only rows still named exactly "Guide" — user renames survive).

2. Scout sets up local agents — connect_local_agent actionType

Scout proposes; the owner approves; the executor creates the seat owned by the user (ephemeral registry row + installation, ADR-006 self-serve shape) and the approved card deep-links to the connect page with ?pod=&name= prefilled.

The D1 line, drawn deliberately: the executor creates the seat only. The runtime token is never minted on this path — the connect page force-rotates on issue, in the user's own browser session, exactly as today. No payload field ever carries a credential (chat history is member-readable and dual-store mirrored). Pinned by test: JSON.stringify(executionResult) must not match /token/i.

Guards: #609 foreign-name check at propose time (Scout gets an immediate error, picks a new name) and re-checked at execute time (state can change between propose and approve). Existing own install = success (alreadyInstalled), matching the BYO page's identity-continuity behavior.

3. commonly_agent_status + agentStateService (Raft P4)

One derivation of proof-of-life — heartbeats ∪ AgentRuns ∪ token lastUsedAt — extracted from the pod-agents route, which now consumes it (no copy left behind). One bucket vocabulary: active / idle / stale / never-connected / ready — ready is the honest word for native agents (the #915 lesson: they have no connection to make). Scout answers "is my agent connected?" from the same truth the roster shows, and its prompt maps each bucket to the action that fixes it.

Proof

Post-merge: deploy → rename-guide-to-scout.ts + refresh-native-agent-configs.ts on dev → live E2E (ask Scout to set up a seat, approve, land on prefilled connect page).

🤖 Generated with Claude Code

https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8

lilyshen0722 and others added 2 commits August 13, 2026 02:52
… agents (ADR-020)

Three asks from Sam's morning session, one coherent slice:

Scout (the Cindy-in-Raft decision): displayName flips Guide → Scout;
agentName stays 'guide' (stable identity key). @scout resolves via the
mention map's displaySlug index; @guide keeps working via the bare-name
rule. Frontend handle preference for opaque-token agents becomes
displayName slug → agentName. rename-guide-to-scout.ts migrates the two
DB name sources for existing rows; the signup opener introduces Scout by
name.

connect_local_agent (new approval actionType): Scout proposes a BYO
seat; approval creates the ephemeral registry row + installation OWNED BY
THE USER (ADR-006 shape, #609 foreign-name guard at propose AND execute),
then the card links to the connect page with ?pod=&name= prefilled. The
runtime token is never minted on this path — credentials stay a
human-in-browser act, and no payload field ever carries one. An existing
own install is success (identity continuity), not failure.

commonly_agent_status (new native tool) + agentStateService: ONE
derivation of proof-of-life (heartbeats ∪ runs ∪ token use — extracted
from the pod-agents route, which now consumes it) and ONE bucket
vocabulary: active/idle/stale/never-connected/ready ('ready' is the
honest word for native agents — the #915 lesson). Scout answers 'is my
agent connected?' from the same truth the roster shows. The #915
regression suite caught a real extraction bug (named-export
buildAgentUsername) before it shipped.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
Sam: the persona/package name split for the flagship agent is a permanent
two-name tax ('guide' leaking in payloads, handles, envelope keys), and
pre-GTM is the only cheap moment to fix it — 3 installs, one a real
user's. Renamed while it costs a migration script instead of a regret.

- manifest guide.ts → scout.ts, agentName 'scout' (exports scoutApp;
  apps.ts + authController import sites updated)
- migrate-guide-to-scout.ts: users (username guide-* → scout-*,
  botMetadata, PG resync) + installations + MEMORY ENVELOPES (identity
  continuity — the renamed agent finds its memory exactly where it left
  it) + registry (delete-not-rename when the boot seeder already minted
  the scout row) + flagged approvals (pending cards must execute against
  the renamed install; resolved rows stay as honest audit) + runs
  (lastActiveAt continuity) + pending events. Exact-'Guide' displayName
  match only, so a user's own rename survives. --dry supported.
- MENTION_ALIASES scout:['guide'] — the real user onboarded under @guide;
  their muscle memory and every old @guide in history keep landing.
- chat author snapshots stay frozen (history is never rewritten).

No dead window: the native runtime reads installation.config, so old rows
keep answering between deploy and migration. Order: deploy → migrate →
refresh-native-agent-configs.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XeUH4HVDsDHYPsHJthXjB8
@lilyshen0722

Copy link
Copy Markdown
Contributor Author

Second commit (ed84b07b) extends this to the full DB rename per Sam's call: agentName is now 'scout' everywhere, not just the displayName. The persona/package split was a permanent two-name tax and pre-GTM is the only cheap moment. migrate-guide-to-scout.ts moves users (+PG resync), installations, memory envelopes (identity continuity), registry (delete-not-rename vs the boot seeder's fresh row), flagged approvals, runs, and pending events; MENTION_ALIASES scout:['guide'] keeps the real user's @guide muscle memory landing; chat history stays frozen. Run order after merge: deploy → migrate → config refresh.

@lilyshen0722
lilyshen0722 merged commit cdefb29 into main Aug 13, 2026
11 checks passed
@lilyshen0722
lilyshen0722 deleted the feat/scout-name-and-local-agent-authority branch August 13, 2026 10:17
lilyshen0722 added a commit that referenced this pull request Aug 13, 2026
…obbered — every pod page crashed (#936)

P0, caught live in post-deploy browser verification. #935's activity
derivation was written as a NEW file at backend/services/agentStateService.ts
— a path where the #891 mention-honesty service already lived. Its
same-named test sat at the same test path, so the clobber also buried the
suite that would have caught it, and CI stayed green. Live effect: the
/:podId/agent-states route called MY deriveAgentState(lastActiveAt,
runtimeType) with (installation, tokens, callerId), returned bare 'stale'
strings, and the typeahead useMemo crashed the ENTIRE pod page on
s.agentName.toLowerCase().

- restore agentStateService.ts + its test verbatim from #910
- re-add the activity pieces in the SAME file under non-colliding names:
  collectPodAgentActivity + deriveActivityBucket (tool + roster call sites
  updated); activity tests live in agentStateService.activity.test.js
- V2PodChat: the honesty surface promises 'silence over a wrong dot' —
  that now includes malformed payloads; shape-guard the map so a bad
  backend degrades to no-dots, never an error boundary


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

Co-authored-by: Claude Fable 5 <[email protected]>
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.

1 participant