Files
kandev/docs/plans/create-local-repository/task-01-backend-initialization.md
T
2026-08-24 11:09:03 +00:00

1.8 KiB

id, title, status, wave, depends_on, plan, spec
id title status wave depends_on plan spec
01-backend-initialization Backend local repository initialization done 1
plan.md ../../specs/workspaces/requirements/create-local-repository.md

Task 01: Backend Local Repository Initialization

Acceptance

  • The workspace-scoped endpoint creates an absent <parent>/<name> repository with unborn branch main, no files, and no commits, then returns its persisted repository DTO.
  • Invalid names/parents, unknown workspaces, and existing targets fail with the specified status and do not mutate the target or persist a repository.
  • Git or persistence failure leaves no repository row and applies the request-owned cleanup contract.

Verification

make -C apps/backend fmt
(cd apps/backend && go test ./internal/task/service ./internal/task/handlers)
make -C apps/backend lint

Files Likely Touched

  • apps/backend/internal/task/service/service_requests.go
  • apps/backend/internal/task/service/local_repository_initialization.go
  • apps/backend/internal/task/service/local_repository_initialization_test.go
  • apps/backend/internal/task/handlers/repository_handlers.go
  • apps/backend/internal/task/handlers/repository_handlers_test.go

Dependencies

None.

Inputs

  • Spec: What, API Surface, Permissions, Failure Modes, and Persistence Guarantees.
  • Existing exact-path validation: apps/backend/internal/task/service/repository_discovery.go.
  • Existing persistence/event path: Service.CreateRepository in apps/backend/internal/task/service/service_resources.go.
  • Security boundary: docs/decisions/2026-07-20-explicit-local-repository-trust.md.

Output Contract

Report endpoint/service behavior, rollback strategy, tests run, files touched, blockers, and residual filesystem race risks. Mark this file done and update the plan entry only after targeted tests pass.