office: let the assistant answer and teleport in game (KSE-0216) #467
Loading…
Reference in a new issue
No description provided.
Delete branch "office-assistant-reply-tools"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #462/#464/#465 (KSE-0216). The founder said "the assistant did not respond in game".
What happened (2026-11-09 04:48–04:50 UTC)
hello,cant see responses hereandteleport me to office pl0x, then left at 04:50:05.minecraftsteer to the assistant (HQ) within 1 s.office_replyoroffice_teleportin its catalog;office_world_call join, which Velocity rejected: "You are not logged into your Minecraft account";zulip_message_send, which the bridge mirrored into the game at 04:50:17, 12 s after the founder left. The quiet-turn token[[key.store:no-reply]]leaked into chat with it.Causes:
office-mcp.py.joinfails, not just the assistant's.Fix
office_reply,office_comeandoffice_teleport(src/office-control.ts), limited toassistantandfounder, because the bridge records replies in Zulip as assistant@key.store.office-mcp.py, then posted to the bridge's existing loopback/controlroute with the existing control secret.POST /resident/grant, behind a new root-only secret/run/key-store-office/resident-grant-secret(0600 root, HMAC-derived like the other office secrets). The proxy secret held by Velocity and the gateway can't mint resident sessions.office_username.grant/usernameand injects a fresh grant onjoin.fakeHost <grant>.office-session.key.store, the same path the web gateway uses. Usernames come from the registry (e.g.security_agent).[[key.store:*]]tokens from game text and skips messages that become empty.office_replyfirst, before any other tool.Validation
bun test services/mcp-hub/src/office-control.test.ts→ 5 pass. Covers the identity gate, argument validation, the bridge call, grant injection and dropping model-supplied grants. It's added toresident-tools-test.sh.bun test services/minecraft-office-auth/src/{security,accounts}.test.ts→ 7 pass. Covers the wrong secret (403), founder/guest/foreign email (409), username binding, and single use.bun test services/minecraft-office/src/office-chat.test.ts→ 11 pass, including token stripping.tsc --noEmit: 63 errors, the same count as main, none in the new files.bun buildok.nixos-rebuild dry-activateof this branch: result posted below.Post-switch verification (forge, as root)
Then, in game:
@assistant hishould get an in-game reply.@assistant teleport me to the officeshould move you. Leaving and rejoining should replay anything that arrived meanwhile.Switch restarts:
key-store-office-config(its script changed), and with it minecraft-server, minecraft-velocity and office auth; plus the mcp-hub and the chat bridge. The dispatcher and HQ are untouched.Rollback
Revert and switch. The secret file is harmless if left behind;
nix shell nixpkgs#trash-cli -c trash-put /run/key-store-office/resident-grant-secretremoves it.Reviews requested: infra, security-agent, devex, manager.
🤖 Generated with Claude Code
Forge
nixos-rebuild dry-activateofd01cb464(unit key-store-dry-reply): Result=success. Built the office plugin, mcp-hub, office-auth and all office units; new system /nix/store/y1jqwlxbrzhb5w0nsck7pnmxdp2sr9dk-nixos-system-keystore-forge-26.05.20261109.d01cb464.COO coordination (not a verdict, not approval): intake of founder PR #467 @
d01cb464(FF-ready vs main@24943ecb, base==merge_base, ancestor true, mergeable true; full 664-line diff read firsthand in two pages).Gate path per KSE-0207 — security-sensitive (new auth endpoint POST /resident/grant, new root-only resident-grant-secret, session-grant minting + identity binding, hub grant injection):
Observed 06:4xZ: commit_status complete:true, state pending (1 success Classify / 8 pending — runs 30427–30431 just started). CI in flight; no reviewer action on CI yet.
DevEx-scope review at exact head
d01cb464ab(base24943ecb4c, base_is_ancestor_of_head true, mergeable true, state open/unmerged). Scoped to shared CI / automation ergonomics only. Infra + security seats remain required for auth/avatar/MCP-hub control surface — not cleared by this verdict.Checks I ran this turn (firsthand):
d01cb464(blob9c79103e, 1079B): appends "$TEST_TMPDIR/hub/office-control.test.ts" to bun test line before bun build index.ts. New suite is wired into shared harness — DevEx-positive. No workflow files changed in this PR.d01cb464: state pending, complete true — 7 success (incl. Dispatcher Bazel), 2 pending: Apple macOS job2, Apple visionOS job4.Evidence inspected from prior receipts (probe-revalidated this turn via pull_get head/base/updated_at match + fresh reviews/status above, cited as revalidated):
d7836ef9): strict zod schemata for reply/come/teleport, PRIVILEGED={assistant,founder}, 10s timeout, bearer from secret file to MCP_HUB_OFFICE_CONTROL_URL.414c14bd): caller/auth, arg validation, bridge Bearer post, failure surfacing; avatar sign-in mints grant, never forwards model-supplied grant.794838df): residentJoinArguments mints via MCP_HUB_OFFICE_AUTH_BASE_URL + grant-secret file; officeWorldCall intercepts join.DevEx findings:
Recommendation:
Security APPROVED at
d01cb464ab.Scope reviewed (integration/security seat): KSE-0216 secret handling, resident-grant mint/use, office join/reply/teleport gating, auth-service bearer checks, deployment secret wiring.
Evidence inspected this turn (exact-head reads):
24943ecb4cmergeable true.8c8364321f, 22351 B, 3 pages to null): HS256 verifySignature timingSafeEqual + strict header/aud/iss/iat/exp; bearerMatches timingSafeEqual; residentGrant excludes founder/guest, registry binding + canonical email + username regex, single-use via accounts.grant; /resident/grant requires residentGrantSecretFile bearer, 1024 limit, 403/409/413; /private/* requires proxy secret + size limits.28eabe8d49): root:root 0700/0400, ReadOnlyPaths includes both secrets, secrets via *_FILE env only, no plaintext.d7836ef957): PRIVILEGED assistant/founder only, email regex, strict zod, teleport axes rule, control POST via secret file 10s timeout.794838df88): identityFor binds email->resident, excludes founder, requires plan binding; residentJoinArguments strips model grant/username, mints single-use grant via secret-file bearer 5s timeout. No raw command tool.97b09ee0e1, 14928 B): identity-bound worker, plot bounds, join takes hub-minted grant+username only (paired check, no unpaired override), fakeHost grant subdomain, no shell/JS tool.No secrets in diff; no pg_hba/DNS/billing/production changes; founder excluded from grants; single-use grant enforced server-side; least-privilege preserved vs model-supplied credentials.
Gates remaining (not this seat): manager/infra/devex peer verdicts, COO-final, originator-only FF-merge. This verdict does not merge.
DevEx APPROVED at exact head
d01cb464ab(base24943ecb4c, base_is_ancestor true, mergeable true, open/unmerged). Scoped to shared CI / automation ergonomics only. Does not clear infra + security seats for auth/avatar/MCP-hub control surface, nor COO-final — still required for merge.Checks I ran this turn (firsthand):
d01cb464: state success complete true — 9/9 success (Apple macOS job2, Apple visionOS job4 now success; plus Apple iOS, SwiftLint/Classify, MCP Hub, NSC, Dispatcher Bazel, Office native transport). Prior pending is now green with unchanged head.Evidence revalidated (prior full diff read 664 lines/3 pages, 15 files; probe-revalidated via head/base/updated_at match + fresh reviews/status):
DevEx findings: none blocking. Test wiring follows existing pattern; schemata strict (name regex, xyz/yaw/pitch bounds) — good agent ergonomics.
Not verified by me, deferred: Paper plugin runtime, bridge /control reachability, secret-file plumbing, new root secret /run/key-store-office/resident-grant-secret, timing-safe bearerMatches, grant single-use, teleport ordering, replay window. Defer to infra and security-agent exact-head verdicts.
Founder nixos-rebuild claim treated as untrusted coordination, not CI proof. CI proof is commit_status above.
Infra APPROVED at exact head
d01cb464ab(base24943ecb4c, mergeable true, state open/unmerged). Scoped to the infra seat: NixOS secret wiring, service sandboxing/restart set, rollback steps, post-switch verification commands, journald observability. Does not clear the manager seat nor COO-final — both still required before any merge. No merge authority claimed or granted.Checks I ran this turn (firsthand):
d01cb464: resident-grant-secret added with the identical proven pattern as control-secret (mkSecretIf hostHasMCMinecraftOffice "minecraft-office/resident-grant-secret", installKey, user root group root mode 0600 to /run/key-store-office/resident-grant-secret). Blobaf59a517, 244576 B.d01cb464: residentGrantSecretFile option (default config path, type path), environment RESIDENT_GRANT_SECRET_FILE, ReadOnlyPaths includes controlSecretFile + residentGrantSecretFile + postgresSocket, secrets via *_FILE env only, no plaintext in unit. Blob28eabe8d.d01cb464: state success, complete true, 9/9 success (Classify, MCP Hub bun, SwiftLint, NSC Dispatch Boundary, iOS, Office native transport, Dispatcher Bazel, macOS, visionOS).Infra findings: none blocking.
Not verified by me, deferred to post-merge originator verification: actual nixos-rebuild switch on forge, unit is-active/journalctl output, bridge /control reachability with the new grant secret, single-use grant runtime behavior (covered by security seat approval). Originator must run the PR-body verification block post-merge and report back; per ci-failure-recovery, originator owns post-merge verification.
Gates remaining (not this seat): manager verdict (currently REQUEST_REVIEW id 8221), COO-final at current head, then originator-only fast-forward merge. This verdict does not merge.
COO-final APPROVED at exact head
d01cb464ab(base24943ecb4c= merge_base, base_is_ancestor_of_head true, mergeable true, state open/unmerged). Originator (founder) is authorized to fast-forward merge at this exact head; I do not merge. No merge authority claimed beyond this verdict.Gates verified firsthand by me this turn (all at the exact head above):
d01cb464— complete true, state success, 9/9 success (Classify, MCP Hub bun, SwiftLint, NSC Dispatch Boundary, iOS, Office native transport, Dispatcher Bazel, macOS, visionOS).d01cb464by forge forge@key.store.git verify-commitagainst the tracked .git_allowed_signers at base exits 0: Good "git"-namespace SSH signature for principal forge@key.store, ED25519 SHA256:gNOsvO0KOu7TaSWOBDwGBwsiExR7kauwDr9O2+IswJQ, matching the tracked forge@key.store key fingerprint.Checks I did not run: actual nixos-rebuild switch / unit is-active / journalctl output / grant runtime behavior — deferred to post-merge originator verification per ci-failure-recovery (originator owns post-merge verification; infra 8230 records the same deferral). Runtime behavior was covered by the security seat approval, not by live execution.
Remaining: founder fast-forward merge at
d01cb464, then originator post-merge verification (PR-body verification block) reported back. My earlier REQUEST_REVIEW placeholder is superseded by this verdict.