|
| 1 | +# git-ranker Workflow Architecture |
| 2 | + |
| 3 | +## Purpose |
| 4 | + |
| 5 | +This repository is the orchestration layer for an agent-first development |
| 6 | +workflow across two application repositories: |
| 7 | + |
| 8 | +- `git-ranker`: backend system of record for APIs, jobs, persistence, and domain |
| 9 | + rules |
| 10 | +- `git-ranker-client`: frontend system of record for routes, components, user |
| 11 | + flows, and client-side state |
| 12 | + |
| 13 | +The control plane in this repo exists to make the product legible to coding |
| 14 | +agents, not to store application logic. |
| 15 | + |
| 16 | +## Current repo facts |
| 17 | + |
| 18 | +The submodules are initialized in this workspace and currently expose these |
| 19 | +high-level facts: |
| 20 | + |
| 21 | +- backend: Spring Boot 3.4, Java 21, JPA, Batch, Security, Actuator, Prometheus, |
| 22 | + structured JSON logging, Testcontainers, ArchUnit |
| 23 | +- frontend: Next.js App Router, React 19, TypeScript, ESLint, React Query, |
| 24 | + Zustand, Tailwind, Radix UI |
| 25 | + |
| 26 | +Those facts should shape the workflow and harness choices instead of generic |
| 27 | +defaults. |
| 28 | + |
| 29 | +## Core principle |
| 30 | + |
| 31 | +Repository-local knowledge is the system of record. A coding agent should be |
| 32 | +able to understand the product, architecture, quality bar, and execution flow |
| 33 | +from versioned artifacts in this repository plus the checked-out submodules. |
| 34 | + |
| 35 | +## Control-plane flow |
| 36 | + |
| 37 | +```text |
| 38 | +feature request |
| 39 | + -> request intake and acceptance contract |
| 40 | + -> ExecPlan for non-trivial work |
| 41 | + -> backend contract / behavior changes |
| 42 | + -> frontend integration / UI changes |
| 43 | + -> isolated task runtime |
| 44 | + -> Playwright + CDP validation |
| 45 | + -> logs / metrics / traces review |
| 46 | + -> fix loop |
| 47 | + -> PR / merge / debt update |
| 48 | +``` |
| 49 | + |
| 50 | +## Worktree model |
| 51 | + |
| 52 | +Every non-trivial task should use an isolated runtime footprint keyed by a task |
| 53 | +slug, for example `rank-comparison-filtering`. |
| 54 | + |
| 55 | +Expected layout: |
| 56 | + |
| 57 | +```text |
| 58 | +.worktrees/ |
| 59 | + backend/<task-slug>/ |
| 60 | + frontend/<task-slug>/ |
| 61 | +.runtime/ |
| 62 | + <task-slug>/ |
| 63 | + logs/ |
| 64 | + traces/ |
| 65 | + screenshots/ |
| 66 | + videos/ |
| 67 | + playwright/ |
| 68 | + observability/ |
| 69 | +``` |
| 70 | + |
| 71 | +The goal matches OpenAI's harness model: |
| 72 | + |
| 73 | +- one isolated app instance per task |
| 74 | +- one isolated observability context per task |
| 75 | +- artifacts are disposable once the task is complete |
| 76 | + |
| 77 | +## Knowledge-store layout |
| 78 | + |
| 79 | +```text |
| 80 | +AGENTS.md |
| 81 | +ARCHITECTURE.md |
| 82 | +PLANS.md |
| 83 | +docs/ |
| 84 | + design-docs/ |
| 85 | + exec-plans/ |
| 86 | + generated/ |
| 87 | + product-specs/ |
| 88 | + references/ |
| 89 | + workflows/ |
| 90 | +``` |
| 91 | + |
| 92 | +`AGENTS.md` is only the table of contents. The durable knowledge lives in |
| 93 | +`docs/`. |
| 94 | + |
| 95 | +## Cross-repo contract |
| 96 | + |
| 97 | +The repositories are versioned independently, but the workflow treats them as a |
| 98 | +single product system. A change request must identify which of the following are |
| 99 | +affected: |
| 100 | + |
| 101 | +- backend domain rules |
| 102 | +- backend API or event contracts |
| 103 | +- frontend route or component behavior |
| 104 | +- shared product language and acceptance criteria |
| 105 | +- reliability, security, or QA evidence |
| 106 | + |
| 107 | +Any contract change must update both sides of the boundary plus the knowledge |
| 108 | +store if the change affects future tasks. |
| 109 | + |
| 110 | +## Layering model |
| 111 | + |
| 112 | +The two repos should converge on one directional dependency model: |
| 113 | + |
| 114 | +```text |
| 115 | +Types -> Schemas/Contracts -> Repository/Gateway -> Service/Use Case |
| 116 | + -> Runtime/Delivery -> UI or HTTP surface |
| 117 | +
|
| 118 | +Cross-cutting concerns enter only through Providers: |
| 119 | +auth, feature flags, telemetry, configuration, external connectors |
| 120 | +``` |
| 121 | + |
| 122 | +This is intentionally rigid. Agents move faster when the allowed edges are |
| 123 | +obvious and mechanically enforceable. |
| 124 | + |
| 125 | +## QA and observability loop |
| 126 | + |
| 127 | +Every user-visible change is expected to produce: |
| 128 | + |
| 129 | +- automated regression evidence |
| 130 | +- a Playwright run over the affected journey |
| 131 | +- CDP evidence for DOM, console, network, and screenshot state |
| 132 | +- log evidence from the isolated task runtime |
| 133 | +- metrics and trace evidence when performance or async flow matters |
| 134 | + |
| 135 | +The recommended local stack is documented in |
| 136 | +[docs/workflows/local-observability-stack.md](docs/workflows/local-observability-stack.md). |
| 137 | +The implementation provided in `harness/` uses Loki, Prometheus, Tempo, and |
| 138 | +Grafana to preserve the same agent-facing query model described by OpenAI: |
| 139 | +LogQL, PromQL, and TraceQL. |
| 140 | + |
| 141 | +## What stays out of this repo |
| 142 | + |
| 143 | +- application code that belongs in `git-ranker` or `git-ranker-client` |
| 144 | +- private tribal knowledge that should instead be turned into docs |
| 145 | +- ad hoc task notes that never graduate into reusable rules |
| 146 | + |
| 147 | +## Current limitations |
| 148 | + |
| 149 | +- the frontend repo does not yet contain committed Playwright or test config |
| 150 | +- the harness knows the backend metrics endpoint, but frontend metrics and trace |
| 151 | + export wiring are still generic |
| 152 | +- repo-specific start scripts and local env bootstrapping still need to be |
| 153 | + codified into the harness |
0 commit comments