diff options
Diffstat (limited to '.agent')
| -rw-r--r-- | .agent/design.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/.agent/design.md b/.agent/design.md index 27c7601..0b61180 100644 --- a/.agent/design.md +++ b/.agent/design.md @@ -377,6 +377,37 @@ parent_task_id: "<task-uuid>" # set by parent agent when creating subtasks Batch files wrap multiple tasks under a `tasks:` key and are accepted by `claudomator run`. +### Project Registry + +Projects are registered in **`internal/storage/seed.go`** — `SeedProjects()` — which is called on every server startup (`internal/cli/serve.go:125`). It upserts a hardcoded list of `task.Project` entries into the `projects` SQLite table. + +**To register a new project**, add an entry to the slice in `seed.go`: + +```go +{ + ID: "my-project", + Name: "my-project", + LocalPath: "/workspace/my-project", + RemoteURL: localBareRemote("/workspace/my-project"), + Type: "web", // "web" | "android" + DeployScript: "/workspace/my-project/scripts/deploy", // optional +}, +``` + +**`localBareRemote(dir)`** (`seed.go:47`) resolves the URL of the `local` git remote for the given directory, falling back to the directory path itself. By convention, bare repos live at `/site/git.terst.org/repos/<name>.git` and each working copy has a `local` remote pointing there. + +**Setting up a new project's bare repo:** +```sh +git init --bare /site/git.terst.org/repos/<name>.git +cd /workspace/<name> +git remote add local /site/git.terst.org/repos/<name>.git +git push local main +``` + +The `task.Project` struct is defined in `internal/task/project.go`. Projects are exposed via `GET /api/projects` and `POST /api/projects`. + +--- + ### Storage Schema Two tables auto-migrated on `storage.Open()`: |
