Skip to content

Resolve the trail commands from a workspace view - #332

Merged
takashi-matsuyama merged 2 commits into
mainfrom
cli/resolve-from-workspace-view
Oct 8, 2026
Merged

takashi-matsuyama merged 2 commits into
mainfrom
cli/resolve-from-workspace-view

Conversation

@takashi-matsuyama

@takashi-matsuyama takashi-matsuyama commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

The commands that read or write a workspace's trail (verify, view, status, stats, report generate, decisions generate, approval *, decision record, import claude-code / import codex) now resolve a workspace view to the repository it links, as orient, refresh, note, decision capture, task and the rest already do. init, project new, exec and run keep resolving in place, but from a workspace view they now say what the directory is instead of advising git init.

Why

A workspace view is a directory outside git that links its planning repo, and it is the operator's daily cwd. From one, basou verify, view, status and stats (reproduced) stopped with Not a git repository. Run 'git init' first, then re-run 'basou <command>'.: following that advice would turn the view into a repository, which it is designed not to be. These commands called resolveRepositoryRoot directly; the other commands go through resolveBasouRootForCommand, which redirects a view to the repository it links and a storeless portfolio member to the workspace that aggregates it. They now go through it too (the helpers they used are removed).

init and project new set up the repository they run in, and exec and run run a child there and record its git changes, so redirecting them would initialize or snapshot the wrong repository. They resolve through a new resolveRepositoryRootInPlace, which tells a workspace view (a non-git directory whose links include one repository, or more, with a .basou store) apart from a plain directory and prints Not a git repository: this is a workspace view (it links <name>). Run 'basou <command>' inside a repository instead. for a view. A directory that is not a view keeps the git init advice, word for word.

No --json shape, exit code, flag or on-disk format changes: commands that failed from a view now succeed, and the new message is prose.

Checklist

  • Branch is rebased on main.
  • One commit per topic (split unrelated fixes into separate PRs).
  • Tests cover the change: a workspace-view test for each command (13, with approval covering list, show, approve and reject), portfolio-member tests for verify and decision record (HOME stubbed to a fixture registry), unit tests for resolveRepositoryRootInPlace (in a repository, a view with one link, a view with two, a directory whose links hold no store, a plain directory, a repository whose git fails), the uninitialized portfolio card, and coverage of a registered view and member. Each fails when the resolution it covers is reverted: no redirect for each of the nine (and for approval show and approve/reject separately), no member resolution for verify and decision record, a redirect for each of the four, the in-place guard removed, the card gate removed, coverage resolving the git toplevel only, and decision record recording the cwd as its working directory.
  • pnpm lint, pnpm typecheck, and pnpm test are all green locally (core 2620, sdk 65, cli 1461; lint reports the same 4 warnings as main).
  • CHANGELOG.md ## Unreleased updated (### Fixed, three entries).
  • CLI stderr stays pathless: the new message names only the view's link (a directory entry); the redirect note on stderr is the existing one the other commands print.

Review

A convergent review (one round, review-only) ran before merge. Applied in the second commit:

  • basou view: a portfolio card with no store of its own refuses a refresh or an import with Workspace not initialized, as 0.65.0 did. With the change, its import resolved to the workspace that aggregates it while the card's paths stayed put, so an import (reached only by a direct HTTP request; the UI does not open such a card) wrote into another card's store, and a refresh wrote part of its work and then failed.
  • Capture coverage (view --portfolio --check) resolves each registered entry as basou import does, so a registered view or member declares the roots of the workspace it resolves to instead of being reported as an entry import cannot run in (refresh --portfolio already resolved it that way).
  • The tests listed above for approval show/approve/reject, the member path, the working directory and the in-place guard; comments the change made stale.

Left for separate work: a relative --linked-file is checked against the cwd but rendered against the resolved root, which decision capture already does from a view; and the commands' tests read the developer's own ~/.basou/portfolio.yaml when they resolve a storeless repo, as orient and the other commands' tests already do.

Related

Reproduced from a workspace view with build a93e199 (v0.65.0): verify, view, status and stats exited 1 with the git init advice; with this branch they resolve, and init, exec and project new print the view message.

🤖 Generated with Claude Code

takashi-matsuyama and others added 2 commits October 8, 2026 11:37
From a workspace view (a directory outside git that links its planning
repo), verify, view, status, stats, report generate, decisions generate,
approval *, decision record and import stopped with "Not a git repository.
Run 'git init' first", advice that would turn the view into a repository.
They resolved the repository root with resolveRepositoryRoot directly,
while orient, refresh, note, decision capture, task and the rest go through
resolveBasouRootForCommand. They now go through it too, so a view resolves
to the repository it links and a portfolio member to the workspace that
aggregates it.

init, project new, exec and run work on the repository they run in, so
they keep resolving in place, through a new resolveRepositoryRootInPlace.
Outside git it tells a workspace view apart from a plain directory and,
for a view, says what the directory is instead of advising git init.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- basou view: a portfolio card with no store of its own (a workspace view,
  a portfolio member) refuses a refresh or an import with "Workspace not
  initialized", as 0.65.0 did. Its import now resolves to the workspace that
  aggregates it while the card's paths stay put, so an import wrote into
  another card's store and a refresh wrote part of its work and then failed.
- Capture coverage resolves each registered entry as basou import does
  (resolveBasouRootForCommand, quietly, against the registry it checks), so
  a registered view or member declares the roots of the workspace it
  resolves to instead of being reported as an entry import cannot run in.
- Tests: show, approve and reject from a view; verify and decision record
  from a portfolio member (HOME stubbed to a fixture registry); the working
  directory decision record records from a view; a failing git in an
  existing repository surfaces as "Git command failed"; the uninitialized
  card; coverage of a registered view and member. Coverage tests resolve
  against an absent registry instead of the developer's own.
- Comments that the change made stale (decision, view, import, coverage).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@takashi-matsuyama
takashi-matsuyama merged commit 647b7eb into main Oct 8, 2026
8 checks passed
@takashi-matsuyama takashi-matsuyama mentioned this pull request Oct 8, 2026
6 tasks done
@takashi-matsuyama
takashi-matsuyama deleted the cli/resolve-from-workspace-view branch October 8, 2026 05:22
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