[Spec 1134] afx whoami + ship /arch-init command (multi-architect identity)#1136
Open
waleedkadous wants to merge 29 commits into
Open
[Spec 1134] afx whoami + ship /arch-init command (multi-architect identity)#1136waleedkadous wants to merge 29 commits into
waleedkadous wants to merge 29 commits into
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.
Contributor
Author
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):
|
Contributor
Author
|
@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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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