| 1 | # 0003 — `git/` is not a REST resource |
| 2 | |
| 3 | **Status:** adopted |
| 4 | |
| 5 | ## Decision |
| 6 | |
| 7 | The transport lives at `src/git/`, not `src/resources/git/`. Supporting services |
| 8 | live at `src/services/git/*`. |
| 9 | |
| 10 | ## Why |
| 11 | |
| 12 | `resources/` in this codebase means "REST resource: has DTOs, appears in |
| 13 | OpenAPI, returns JSON." Git HTTP is a wire protocol — binary streams, pkt-line |
| 14 | framing, no JSON, `@ApiExcludeController()`. Filing it under `resources/` |
| 15 | invites the next person to give it DTOs and a Swagger entry, and then to |
| 16 | reach for `express.json()`. |
| 17 | |
| 18 | ## Layout |
| 19 | |
| 20 | ``` |
| 21 | src/git/ transport edge |
| 22 | git.controller.ts three routes, nothing else |
| 23 | git.service.ts resolve → authorize → delegate |
| 24 | git.constants.ts service names, repo ids |
| 25 | git.errors.ts |
| 26 | |
| 27 | src/services/git/ |
| 28 | protocol/receive-pack-request.ts pkt-line parsing |
| 29 | pack-process/ spawns git upload-pack / receive-pack |
| 30 | ref-advertisement/ the info/refs body |
| 31 | repository-storage/ materialized bare repos on disk |
| 32 | wal/ the log (0004 onward) |
| 33 | ``` |
| 34 | |
| 35 | ## Consequences |
| 36 | |
| 37 | `bodyParser: false` in `main.ts` is load-bearing and must stay. If it is ever |
| 38 | re-enabled for the REST side, scope it per-route — `express.json()` will consume |
| 39 | the packfile stream before the handler sees it. |