Repository navigation
Model one Almanac project across multiple local checkouts #47
Description
Activity
Additional design note: merging transcript-derived decisions
After more discussion, the hard part is not only the local registry collision or even Markdown merge mechanics. The hardest part is how multiple Claude/Codex workstreams should feed decisions from their transcripts into one shared project wiki.
A useful framing: transcript ingestion should extract knowledge candidates, not directly mutate project truth.
Proposed pipeline
Claude/Codex transcripts from workspaces | v structured decision/fact candidates | v dedupe + conflict detection + branch/merge awareness | v wiki update proposal | v reviewed committed Markdown in almanac/A transcript may say “the agent chose X while working on branch A,” but the Almanac should only say “the project follows X” once that decision survives review, merge, or explicit acceptance.
Candidate shape
Candidates probably need fields such as:
- project id
- workspace id
- branch / commit range, when available
- transcript session id and evidence range
- kind: decision, invariant, flow, gotcha, incident, todo, etc.
- summary
- affected files
- proposed page or topic
- confidence
- status: proposed, accepted, rejected, superseded, stale
- relations: duplicates, conflicts, supersedes
Merge cases
- Same decision, same meaning: one wiki update with multiple evidence refs.
- Related decisions, different scope: one consolidated page/section with scoped nuance.
- Conflicting decisions: one accepted project decision; rejected alternatives can be summarized in a Considered/Rejected section, but should not both become truth.
- Branch-local decisions: if the code never merges, the candidate should expire, stay branch-local, or remain proposed rather than entering project truth.
Important rule
Only merged/reviewed code should create project truth automatically. Transcript-derived decisions from unmerged workstreams should remain proposed candidates. If CodeAlmanac cannot tell whether the branch merged, it should be conservative and require Garden/review to accept the candidate.
Design implication
This reinforces the need for a project/workspace model. Workspaces produce transcript evidence and candidates, but the shared project owns the durable wiki truth. Background sync should not blindly turn every local agent transcript into committed project knowledge.
Direct transcript-to-wiki mutation is likely too eager for parallel workstreams. A safer design is:
- discover transcripts per workspace,
- extract structured candidates,
- group candidates by shared project identity,
- dedupe/conflict-check them,
- propose wiki updates,
- commit accepted knowledge into
almanac/through normal Git review/merge.
That means the basename collision is one symptom of a larger missing model: CodeAlmanac needs to distinguish shared project memory from local workspace activity and treat transcript-derived knowledge as evidence/proposals until it becomes settled project knowledge.
Additional design note:
--wiki <name>currently selects a path-bound registrationOne more implication: today's
--wiki <name>behavior shows that this is not just an auto-registration collision.Currently,
--wiki lmfellowmeans roughly:name -> one registered repository row -> one stored root_pathIt does not mean "the shared lmfellow project, resolved through the workspace I am currently in." If
lmfellowis registered to/a/lmfellow, then running a command from/b/lmfellowwith--wiki lmfellowstill targets the stored/a/lmfellowroot.That means the current selector conflates two things that probably need to be separate:
- Project selector: which shared Almanac project/codebase?
- Workspace selector: which local checkout/worktree should this command read or write?
Design implication
If CodeAlmanac supports one project across multiple checkouts,
namelikely belongs at the project level, not the workspace/root-path level.A future shape might be:
projects project_id name canonical_git_identity default_workspace_id workspaces workspace_id project_id root_path git_common_dir branch last_seen_atThen
--wiki lmfellowwould select the project. Command execution would still need an active workspace:- If
cwdis a known workspace for that project, usecwd. - If
cwdis outside known workspaces, use a configured default workspace or fail with a clear message. - A later explicit
--workspaceselector may be needed for non-cwd workflows.
Command behavior implications
For read/write commands:
codealmanac show architecture/foo --wiki lmfellow
If run from
/b/lmfellow, the intuitive behavior is:select project lmfellow use active workspace /b/lmfellow read /b/lmfellow/almanacFor sync:
codealmanac sync --wiki lmfellow
The project selector should scope to the shared project, but transcript evidence may come from any known workspace for that project. That reinforces the earlier candidate/proposal model: sync can discover transcript-derived knowledge across workspaces, but should not blindly mutate project truth from every local transcript.
Scope update
The issue should cover both:
- the immediate crash from same-basename auto-registration, and
- the deeper selector model problem where
--wiki <name>currently identifies a single path-bound registration instead of a shared project plus an active workspace.
A suffix-based name workaround would not solve this, because it would keep treating
/a/lmfellowand/b/lmfellowas unrelated wiki projects rather than workspaces for the same project.
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.