# KAN-9: Add Projects and Repositories management menus

## Ticket

https://danubii.atlassian.net/browse/KAN-9

## Branches

- Source: `ai/KAN-9-add-projects-and-repositories-management-menus`
- Target: `main`

## Repositories

- `danubii/openclaw-orchestrator`: `ai/KAN-9-add-projects-and-repositories-management-menus` -> `main` (Completed)

## Summary

https://danubii.atlassian.net/browse/KAN-9
Add first-class project management to the UI and backend, with a separate Projects menu for creating/selecting projects and a separate Repositories menu for viewing, creating, editing, and deleting repository records.
Scope
- Create a dedicated Projects menu/page where users can see existing projects, create new projects, edit project metadata, archive/delete where appropriate, and switch active project context.
- Add a project switcher in the main app navigation so workflows, repositories, and future views can be filtered by the selected project.
- Create a dedicated Repositories menu/page where users can list repositories for the active project, add new GitHub repositories, edit display/base branch/configuration fields, and delete/remove repositories.
- Persist project and repository records in the backend instead of relying only on ad hoc repository input during workflow creation.
- Update workflow creation so users choose repositories from the active project, while still supporting multi-repo workflows.

## Approved Plan

KAN-9 adds first-class Projects and Repositories management to OpenClaw. The repository already has project/repository persistence, create/register flows, and multi-repo workflow creation, but it lacks dedicated management pages, update/archive/delete API support, active project navigation, and project-filtered workflow/repository views.
- Users can create, select, update, and archive/remove projects from a dedicated Projects page.
- Active project is visible in navigation and filters workflows/repositories by default.
- Users can list, create/register, edit, and archive/remove repositories from a dedicated Repositories page.
- Workflow creation uses persisted repositories from the selected project and still supports multi-repo selection.
- Backend APIs, EF migrations, frontend UI, service/API tests, and Playwright tests cover the flow.
- Final validation should run `dotnet test OpenClaw.Orchestrator.slnx`, `npm run lint --prefix web`, `npm run build --prefix web`, and `CI=1 npm run test:e2e --prefix web`.
- `Project` exists with `Id`, `Name`, `Key`, `Description`, `CreatedAt`; no update/archive metadata.

## Test Summary

Running repository test profile `openclaw-local` for `KAN-9`.
danubii/openclaw-orchestrator
- Target: `main`
- Working: `ai/KAN-9-add-projects-and-repositories-management-menus`
Required: `True`
Exit code: `0`
Timed out: `False`
Blocked: `False`

## Cross-Repository Integration Summary

Single-repository workflow; cross-repository integration was not required.

## Smoke Test Summary

Running repository smoke profiles for `KAN-9` after implementation, tests, and cross-repository integration.
- `danubii/openclaw-orchestrator` in `repo-10-danubii-openclaw-orchestrator`: `ai/KAN-9-add-projects-and-repositories-management-menus` -> `main`
Required: `True`
Exit code: `0`
Timed out: `False`
Blocked: `False`
```bash
GIT_TERMINAL_PROMPT=0 GIT_ASKPASS=/workspace/git-askpass.sh git clone --branch 'main' 'https://github.com/Danubii/openclaw-orchestrator.git' 'repo-10-danubii-openclaw-orchestrator' && git -C 'repo-10-danubii-openclaw-orchestrator' checkout --detach 'de4fb9747ea15e234aa6fbc7987126be16412c84'

## Review Summary

This implementation delivers the full KAN-9 scope: dedicated `/projects` and `/repositories` management pages, a `ProjectSwitcher` in `AppShell`, archive/update endpoints for both entities, project-filtered workflow listing, `ProjectId` in `WorkflowSummaryDto`, EF migration with backfill, and comprehensive service/API/Playwright tests. The incremental pass under review specifically adds the archived-repository guard in `UpdateAsync`/`UpdateTestProfileAsync`, maps `RepositoryArchivedException` in the repository endpoint, and adds regression coverage.
All validation gates pass: 46 application tests, 15 API tests, ESLint, TypeScript, Next.js build, and 1 Playwright smoke test.
---
**APPROVE_WITH_NOTES**
All acceptance criteria are met and no blocking or high-severity defects were identified. Several medium findings should be tracked as follow-up work.
---
None.
---

## Manual QA

KAN-9: Add Projects and Repositories management menus
Flow completed through test deploy. Medium review findings accepted for this run; no blocker/high findings remain.

## Guardrails

- OpenClaw created this PR handoff record, but does not merge automatically.
- Human review is required before merge.