Uh oh!
There was an error while loading. Please reload this page.
[Spec 1134] afx whoami + ship /arch-init command (multi-architect identity) - #1136
Conversation
…nostic
Resolves identity per spec precedence (builder-worktree cwd match via
detectCurrentBuilderId -> CODEV_ARCHITECT_NAME -> fail loud, exit 1; no
implicit 'main'). Strictly read-only against global.db:
lookupBuilderSpawningArchitect gains an optional db handle so whoami can
pass its readonly connection. Workspace display name from known_workspaces
with basename fallback; best-effort architect-row cross-check warns on
stderr only. --json emits the documented schema, and failure emits
{ "error": ... } on stdout alongside the stderr explanation.…th trees Workspace-agnostic identity-adoption command for architect terminals: explicit [name] argument (validated against the architect-name rule, path-traversal guarded) or afx whoami resolution; STOP-and-ask when neither resolves — never guess, never default to main. Reads codev/state/<name>.md; missing-file flow excludes builder *_thread.md files. Byte-identical in codev-skeleton/ and .claude/skills/ with a drift-guard test, plus first copySkills() regression tests proving the init/adopt/update install path.
…nce and afx skill Adds the whoami section (syntax, precedence, output examples, --json, exit codes) to agent-farm.md and the afx SKILL.md in BOTH trees, with identical section content. Drive-by: three stale 'state.db' wordings in send.ts user-facing/doc text now say global.db (post-#1118); historical 'state.db is retired' migration comments left as-is.
waleedkadous
commented
Jul 3, 2026
Architect Integration ReviewExcellent work — this is a clean, well-composed change. Independent integration review (Claude): APPROVE / HIGH confidence, no key issues, on top of the unanimous CMAP at every phase. Highlights from the integration pass:
Non-blocking notes for the record (both already scoped out deliberately, agreed):
|
waleedkadous
commented
Jul 4, 2026
@amrmelsayed I've requested your review on this one as the final pass — would value your opinion, especially since
No rush — the merge waits on your review. Thanks! |
amrmelsayed
commented
Jul 17, 2026
ReviewApproving. I verified this against today's On the two areas you flagged: Read-only access into global.db: this fits how I'd want readers to consume the consolidated db. Identity never depends on the handle (only enrichment does), the connection closes on every path including the fall-through to the fail-loud throw, and crucially whoami never triggers Identity precedence / multi-workspace edges: handled correctly. The builder enrichment passes
One follow-up this PR surfaces (non-blocking, spec 1134 scoped state-file lifecycle out deliberately): and that rule should be embedded across the codev CLI surface, not just documented: Also noting the Good to merge from my side. |
amrmelsayed
left a comment
There was a problem hiding this comment.
Formal approval per my full review in #1136 (comment). Verified against current main (clean merge, clean typecheck, 59 tests passing on the merged tree). Good to merge.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Adds
afx whoami— a fail-loud identity diagnostic reporting the current terminal's agent (workspace, type, name) from Tower/global.db's perspective — and ships the/arch-initarchitect identity-adoption command with codev via the skeleton, replacing the fragile personalps -p $PPIDancestry-matching command.Closes#1134
Changes
afx whoami(commands/whoami.ts+ cli.ts registration): precedence builder-worktree cwd match (reusesdetectCurrentBuilderId, incl. the afx send: detectCurrentBuilderId silently falls back to bare worktree name on state.db read failure → builder messages misroute to main #1094 no-fallthrough rule) →CODEV_ARCHITECT_NAME→ exit 1 with explanation. Never implicitlymain.--jsonsupport; builders carryarchitect:(spawning architect) when recorded; workspace display name fromknown_workspaceswith basename fallback; best-effort architect-row cross-check warns on stderr only. Strictly read-only:lookupBuilderSpawningArchitectgains an optionaldb?handle (defaultgetDb(), existing callers unaffected). Works without Tower./arch-initskill byte-identical incodev-skeleton/.claude/skills/arch-init/and.claude/skills/arch-init/: validated explicit[name](architect-name rule, path-traversal guarded) orafx whoamiresolution; STOP-and-ask when neither resolves; state recovery fromcodev/state/<name>.mdexcluding builder*_thread.mdfiles; the four architect guardrails; workspace-agnostic.afx whoamisections inresources/commands/agent-farm.mdand afxSKILL.mdin BOTH trees (identical section content). Drive-by: three stale "state.db" wordings insend.tsnow say "global.db" (post-Consolidate state.db tables into global.db (single user-global database) to eliminate the cwd-dependent fragmentation that causes "missing architect state after restart" #1118).Testing
copySkills()regression tests (install path for scenario 9)afx whoamifrom this builder worktree →builder-spir-1134+architect: main; from/tmp→ exit 1 fail-loud;/arch-initskill confirmed loading in Claude CodeSpec
Link: codev/specs/1134-afx-whoami-ship-arch-init-comm.md
Review
Link: codev/reviews/1134-afx-whoami-ship-arch-init-comm.md