Bug / design gap
CodeAlmanac treats local checkout paths too much like project identity. When the same project is checked out in multiple local directories, read-command auto-registration can collide on the derived basename and crash with a raw SQLite uniqueness error on repositories.name.
The crash is the immediate symptom, but the deeper issue is that CodeAlmanac should understand one Almanac project across multiple workspaces/checkouts/worktrees.
Why this matters
The point of an Almanac is shared project memory. If each local checkout becomes a separate registered wiki/project, then parallel agent workstreams and team members can end up with separate local identities for what is logically the same codebase. That makes project memory feel path-local instead of project-local.
For teams, the committed almanac/ tree should be the shared source of project knowledge. Different developers and agents may make different design decisions, but those changes should converge through normal Git review and merge flows against the same project wiki, not through unrelated local registrations.
Repro symptom
- Check out the same repository in two directories with the same basename, for example:
/work/a/lmfellow
/work/b/lmfellow
- Ensure both contain an initialized
almanac/ wiki.
- Run a read command from the first checkout so CodeAlmanac auto-registers it as
lmfellow.
- Run a read command from the second checkout.
Actual behavior
The second auto-registration derives the same name, lmfellow. The local registry has repositories.name as UNIQUE, so SQLite raises an integrity error. Users can see a raw traceback instead of a product-level explanation.
Desired product model
CodeAlmanac should distinguish:
- Project identity: the shared codebase / Almanac project, likely derived from Git identity such as canonical remote URL and possibly other repository metadata.
- Workspace identity: a local checkout, worktree, or agent workspace path where commands are run.
- Wiki source: the committed
almanac/ tree that travels with the repository and is reviewed/merged through Git.
In that model, /work/a/lmfellow and /work/b/lmfellow can both be workspaces for the same lmfellow project rather than competing registered projects with colliding names.
Design questions
- What should be the canonical project identity for local repositories? Git remote URL? Git common-dir? A stored Almanac project id? A combination?
- How should workspaces be stored? A separate workspace table keyed by local path and linked to one project seems likely.
- When running from a workspace, should commands read/write the current checkout's
almanac/ tree while attributing runs and indexes to the shared project identity?
- How should ambiguity be handled when two different projects want the same display name?
- How should existing path-keyed repository registrations migrate?
Non-goal / temporary workaround
Auto-suffixing derived names (lmfellow-2, lmfellow-3) would avoid the crash, but it reinforces the wrong model by treating same-project workspaces as separate Almanac projects. That may be acceptable only as a temporary mitigation, not the desired design.
Acceptance direction
A future fix should make read-command auto-registration robust for multiple local checkouts of the same project without creating separate project identities for the same codebase. At minimum, the current raw SQLite integrity error should be replaced with a clear product-level error if the full workspace/project model is not implemented in the first pass.
Bug / design gap
CodeAlmanac treats local checkout paths too much like project identity. When the same project is checked out in multiple local directories, read-command auto-registration can collide on the derived basename and crash with a raw SQLite uniqueness error on
repositories.name.The crash is the immediate symptom, but the deeper issue is that CodeAlmanac should understand one Almanac project across multiple workspaces/checkouts/worktrees.
Why this matters
The point of an Almanac is shared project memory. If each local checkout becomes a separate registered wiki/project, then parallel agent workstreams and team members can end up with separate local identities for what is logically the same codebase. That makes project memory feel path-local instead of project-local.
For teams, the committed
almanac/tree should be the shared source of project knowledge. Different developers and agents may make different design decisions, but those changes should converge through normal Git review and merge flows against the same project wiki, not through unrelated local registrations.Repro symptom
/work/a/lmfellow/work/b/lmfellowalmanac/wiki.lmfellow.Actual behavior
The second auto-registration derives the same name,
lmfellow. The local registry hasrepositories.nameasUNIQUE, so SQLite raises an integrity error. Users can see a raw traceback instead of a product-level explanation.Desired product model
CodeAlmanac should distinguish:
almanac/tree that travels with the repository and is reviewed/merged through Git.In that model,
/work/a/lmfellowand/work/b/lmfellowcan both be workspaces for the samelmfellowproject rather than competing registered projects with colliding names.Design questions
almanac/tree while attributing runs and indexes to the shared project identity?Non-goal / temporary workaround
Auto-suffixing derived names (
lmfellow-2,lmfellow-3) would avoid the crash, but it reinforces the wrong model by treating same-project workspaces as separate Almanac projects. That may be acceptable only as a temporary mitigation, not the desired design.Acceptance direction
A future fix should make read-command auto-registration robust for multiple local checkouts of the same project without creating separate project identities for the same codebase. At minimum, the current raw SQLite integrity error should be replaced with a clear product-level error if the full workspace/project model is not implemented in the first pass.