- ControlPlane 라우터에 워커/에이전트 구독 채널을 추가한다 - ProtoSocket 기반 실시간 양방향 채널( dispatcher, envelope, server)을 구현한다 - Forgejo push 이벤트를 provider 어댑터로 처리하도록 연동한다 - PostgreSQL 스토리지 백엔드를 분리하여 postgres.go로 신설한다 - Git engine command에 diff/checkout/merge 연쇄 연산을 추가한다 - 런타임 모델에 agentSession, runtimeChannel 스키마를 추가한다 - 데이터베이스 마이그레이션에 agent_session, runtime_channel, lease 테이블을 추가한다 - agent-contract에 Forgejo branch events 계약 문서를 작성한다 - 로드맵 마일스톤과 아카이브 작업을 갱신한다
70 lines
2.4 KiB
Markdown
70 lines
2.4 KiB
Markdown
# Architecture
|
|
|
|
Gito starts as a modular monolith with separable process roles. The codebase can
|
|
run as one service at first, but its boundaries should allow separate server,
|
|
worker, and shell deployments later.
|
|
|
|
## Layers
|
|
|
|
### Control Plane
|
|
|
|
- Owns proto-socket and REST surfaces.
|
|
- Accepts user, automation, and provider callback requests.
|
|
- Applies auth, policy, and approval gates.
|
|
- Creates operations and exposes event streams.
|
|
- Does not execute Git commands directly.
|
|
|
|
### Core Domain
|
|
|
|
- Owns repository registry, workspace leases, operations, revision cursors,
|
|
idempotency keys, audit records, and normalized events.
|
|
- Knows provider-neutral concepts such as `Repo`, `WorkspaceLease`,
|
|
`GitOperation`, `RevisionEvent`, and `ChangeRequest`.
|
|
- Does not know GitHub, GitLab, Gitea, Plane, Jira, or IOP HTTP details.
|
|
|
|
### Worker
|
|
|
|
- Picks pending operations.
|
|
- Coordinates workspace leases.
|
|
- Calls agent-shell for filesystem and command execution.
|
|
- Records operation outcomes and emits events.
|
|
- Handles retry and backoff policy.
|
|
|
|
### Agent Shell
|
|
|
|
- Runs on a machine that owns local workspace access.
|
|
- Executes Git CLI and IOP CLI commands.
|
|
- Streams logs, handles cancellation, and enforces dirty-workspace guards.
|
|
- Connects outbound to the control plane where possible.
|
|
|
|
### Git Engine
|
|
|
|
- Platformless Git operation layer.
|
|
- Supports clone, fetch, pull, checkout, status, diff, commit, push, branch, tag,
|
|
and revision scans.
|
|
- Must be testable against local bare repositories without GitHub, GitLab, or
|
|
Gitea.
|
|
|
|
### Provider Adapters
|
|
|
|
- Own platform APIs and DTOs.
|
|
- Map Forgejo/Gitea PR, GitHub PR, and GitLab MR into provider-neutral
|
|
`ChangeRequest` operations.
|
|
- Treat webhooks as wakeup signals. Final state must be verified through Git
|
|
revision or provider read APIs.
|
|
- MVP priority is Forgejo push intake: provider webhooks enter through REST
|
|
callbacks, then Gito emits normalized branch events for internal proto-socket
|
|
consumers such as NomadCode.
|
|
|
|
## Transport
|
|
|
|
- proto-socket is the default internal runtime transport.
|
|
- REST is reserved for health/readiness, provider callbacks, smoke/curl, and
|
|
simple bootstrap endpoints.
|
|
- gRPC is intentionally out of scope for the initial architecture.
|
|
|
|
## Event Policy
|
|
|
|
All external side effects should produce durable operation and event records in
|
|
PostgreSQL. Redis may be added later for fanout or stream acceleration, but it is
|
|
not the source of truth.
|