Project memory and code map per repo
Epic 6368 — Connect Multiple Repositories to Project. Child C9.
Original requirement (verbatim):
> If the user has, say, twenty repos – one for the backend and another for the UI – they should be able to connect both of them to a project. Implement support for project with multiple repos
Settled inputs: PRD (Task 6372), Architecture (Task 6373) — read both; settled. Builds on C1 (`project_repos`) and C3 (non-primary worktrees at `_repos/<rid>/<N>`). Decision D9 (operator): project memory and the code map index every repo. Depends on the compliance child (C8) only to keep one schema migration per wave.
## Scope
- `ProjectMemoryState` gains `project_repo_id` (NULL = primary, legacy rows), unique `(project_id, coalesce(project_repo_id,0))` — expand-only migration.
- Codemap units carry the repo.
- `tools/project_memory_node.py --background` runs per repo worktree with a per-repo `refs/worktree/jaah-memory/integration-head`.
- The memory bundle serves per-repo pointers.
- Memory search filters and labels results by repo (`owner/name`).
## Acceptance criteria (verbatim, Architecture §0)
- **AC9.1** — Project memory and the code map index every repo. After a merge to U's integration branch and P's next memory background run, a memory search for a directory that exists only in U returns a code-map unit labelled `U`.
→ verify: dev → P → Memory, search the U-only path.
Credentials & reach:
- AC7.1 / AC8.1 / AC9.1 | operator login on app.dev.jaah.ai; AC8.1 also needs a node at or above the audit CLI floor (h3 runs 1.2.477, latest) | **verified**: credential fetch + sign-in probe above; node version seen on the Nodes page.
- Unit/integration gates | worktree only (`./dc check full`) | needs nothing beyond the worktree
Out of scope: Do NOT change memory trust/feedback scoring or the propose/read verbs' contracts beyond adding the repo label. N1 Do NOT make gate, stack, merge lane, GHA runners or CI OIDC per repo. N9 Do NOT add new permissions.
Done means:
- AC9.1 verified on dev per the oracle (screenshot of the U-labelled unit).
- Tests: legacy rows (NULL `project_repo_id`) are still served as the primary's; two repos keep independent integration-head refs; a single-repo project's memory output is unchanged.
- Migration expand-only and re-runnable.
- `./dc check full` green.
Outcome
Project memory and the code map now index every connected repository: per-repo heads and pointers (expand-only sibling table), repo-labelled and filterable search. PR #5529 merged, dev deploy succeeded; AC9.1 verified on dev with a screenshot. Full gate is green except Playwright smoke: 5 load flakes pass in isolation, and AC-8.3 also fails on develop (Task 6411). Deferred: per-repo claims, primary-swap re-keying, hook-tier injection of non-primary units.
Artifacts
Activity
- Draft
- Ready
- Runner started
- Runner ended (done)