mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
docs(conventions): dev-first framing + flag-enable + accuracy sweep
The conventions standard is dev-first by design — the developer receives the architecture map + per-task constraints at spawn and owns conforming code from the start; QA and the PR reviewer are the downstream net. Make that explicit in the developer prompt and add a dedicated conventions section to the RAG developer doc (it previously only mentioned the gate, reactively). Also reconcile the docs with the hardened behavior: env-reference now shows the flag is off by config default but on in the compose orchestrator block (left off in the registry), mirroring toolchain matching; and the RAG standard's example comment no longer implies a misplaced helper blocks (it warns).
This commit is contained in:
@@ -106,9 +106,11 @@ The gateway enforces some of these; the rest are convention but failing one of t
|
|||||||
|
|
||||||
If any item fails, do not retry `i_am_done`; fix the missing piece first.
|
If any item fails, do not retry `i_am_done`; fix the missing piece first.
|
||||||
|
|
||||||
## Write modular code — the conventions gate enforces it
|
## You own placement and modularity — write it right the first time
|
||||||
|
|
||||||
Beyond placement and hygiene, the Architectural Conventions Standard now enforces MODULARIZATION via a "modularity" AST check family that inspects a definition's body and a file's composition. Write to it from the start — a block-level modularity finding refuses `i_am_done` (and the PR reviewer's `pr_pass`) with the offending `file:line` + a fix hint, and surfaces in QA's `claim_review` evidence as `convention_findings`. The checks are language-aware: a Python/API project carries `thin_routes`; a TypeScript/React project carries `thin_components`; `modular_cohesion` and `god_class` apply to both.
|
This is yours to get right BEFORE you submit, not QA's or the PR reviewer's to catch. You already hold the rules: the project's "Architectural Standard" map is in your context and each task carries a `## Constraints` section. Place every definition in the module that owns its kind and keep each file to one concern from the first line you write. A violation that reaches the gate, QA, or the PR reviewer becomes a reject → rework → re-review loop that burns tokens and turns — they are the safety net, you are the first line.
|
||||||
|
|
||||||
|
Beyond placement and hygiene, the Architectural Conventions Standard also enforces MODULARIZATION via a "modularity" AST check family that inspects a definition's body and a file's composition. A block-level modularity finding refuses `i_am_done` (and the PR reviewer's `pr_pass`) with the offending `file:line` + a fix hint, and surfaces in QA's `claim_review` evidence as `convention_findings`. The checks are language-aware: a Python/API project carries `thin_routes`; a TypeScript/React project carries `thin_components`; `modular_cohesion` and `god_class` apply to both.
|
||||||
|
|
||||||
- **One architectural concern per file (`modular_cohesion`).** A file must own a single concern. Do not define a Pydantic model inside a router, or a schema inside a component — split each concern into its own module (`models/`, `schemas/`, the hook, …).
|
- **One architectural concern per file (`modular_cohesion`).** A file must own a single concern. Do not define a Pydantic model inside a router, or a schema inside a component — split each concern into its own module (`models/`, `schemas/`, the hook, …).
|
||||||
- **Keep route handlers thin (`thin_routes`, Python/API).** A route delegates data access and business logic to a service. It must NOT run its own database access in the route body — no `session.execute`/`query`/`scalars`/`add`, no `select()`/`insert()`/`update()`/`delete()`. Move that into the service the route calls. (An explicit `await db.commit()` to close the unit of work after delegating is fine — transaction-lifecycle calls don't count.)
|
- **Keep route handlers thin (`thin_routes`, Python/API).** A route delegates data access and business logic to a service. It must NOT run its own database access in the route body — no `session.execute`/`query`/`scalars`/`add`, no `select()`/`insert()`/`update()`/`delete()`. Move that into the service the route calls. (An explicit `await db.commit()` to close the unit of work after delegating is fine — transaction-lifecycle calls don't count.)
|
||||||
|
|||||||
@@ -193,11 +193,11 @@ These gate the env-toggled capabilities. Each is inert when off. See [Optional c
|
|||||||
| `ROBOCO_PROVISIONING_TIMEOUT_SECONDS` | `30.0` | Per-request provisioning timeout. |
|
| `ROBOCO_PROVISIONING_TIMEOUT_SECONDS` | `30.0` | Per-request provisioning timeout. |
|
||||||
| `ROBOCO_PROVISIONING_REPO_PRIVATE` | `true` | Whether provisioned repos are private. |
|
| `ROBOCO_PROVISIONING_REPO_PRIVATE` | `true` | Whether provisioned repos are private. |
|
||||||
|
|
||||||
### Architectural conventions — default **off**
|
### Architectural conventions — **off** (config) / **on** (compose)
|
||||||
|
|
||||||
| Variable | Default | Purpose |
|
| Variable | Default | Purpose |
|
||||||
|----------|---------|---------|
|
|----------|---------|---------|
|
||||||
| `ROBOCO_CONVENTIONS_ENABLED` | `false` | Master switch for the per-project conventions standard (scaffold, ambient injection, baseline constraints, gate enforcement). Fully inert when off. |
|
| `ROBOCO_CONVENTIONS_ENABLED` | `false` (config) / `true` (compose) | Master switch for the per-project conventions standard (scaffold, ambient injection, baseline constraints, gate enforcement). The compose orchestrator block defaults this **on** (left off in `docker-compose.registry.yml`); fully inert when off. |
|
||||||
|
|
||||||
### Toolchain matching — default **off**
|
### Toolchain matching — default **off**
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,16 @@ There is **no** `roboco_git_commit / _push / _create_pr / _merge_pr / _checkout`
|
|||||||
5. **Reflect:** `note(text="...", scope="reflect")` on what changed and why — useful for QA's diff review.
|
5. **Reflect:** `note(text="...", scope="reflect")` on what changed and why — useful for QA's diff review.
|
||||||
6. `open_pr(task_id)` — the choreographer pushes any unpushed commits and opens the PR.
|
6. `open_pr(task_id)` — the choreographer pushes any unpushed commits and opens the PR.
|
||||||
|
|
||||||
|
## Architectural conventions — own your placement
|
||||||
|
|
||||||
|
When the conventions standard is enabled you receive the project's architecture map (the "Architectural Standard" block) in your context at spawn, and every task carries a `## Constraints` section listing the block-level rules and module boundaries. Conform from the first line — this is yours to get right, not QA's or the PR reviewer's to catch. Every violation that reaches a gate is a reject → rework → re-review loop that wastes tokens and turns; they are the net, you are the first line.
|
||||||
|
|
||||||
|
- Place each definition in the module that owns its kind — a model in `models/` / `schemas/`, never the router; a route only in the route module; a component only in the components module.
|
||||||
|
- One architectural concern per file (`modular_cohesion`). Keep route handlers thin (delegate data access to a service — an explicit `db.commit()` is fine). Keep components presentational (fetch in a hook).
|
||||||
|
- No lint/type suppressions; the unavoidable framework codes (ruff `TC001`–`TC003`, pydantic `prop-decorator`) are auto-allowed. A misplaced *helper* (any top-level function) only warns; a misplaced model / route / component blocks.
|
||||||
|
|
||||||
|
A genuine false positive is cleared only by committing a `waiver` in `.roboco/conventions.yml` in your branch (reviewed in the PR), never an in-code suppression.
|
||||||
|
|
||||||
## Delivery gates
|
## Delivery gates
|
||||||
|
|
||||||
When toolchain matching is enabled, `i_am_done` is refused if the project's test suite cannot be collected under the interpreter the workspace was provisioned with (a "broken" toolchain). The fix is to call `i_am_blocked(reason='toolchain')` so the environment is rebuilt — never to pass on a source read.
|
When toolchain matching is enabled, `i_am_done` is refused if the project's test suite cannot be collected under the interpreter the workspace was provisioned with (a "broken" toolchain). The fix is to call `i_am_blocked(reason='toolchain')` so the environment is rebuilt — never to pass on a source read.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ languages: [python, typescript]
|
|||||||
modules:
|
modules:
|
||||||
- path: app/routers
|
- path: app/routers
|
||||||
purpose: HTTP routing only
|
purpose: HTTP routing only
|
||||||
forbidden: [model, helper] # no Pydantic models or helpers in routers
|
forbidden: [model, helper] # a model here blocks; a helper only warns
|
||||||
- path: app/models
|
- path: app/models
|
||||||
purpose: data models
|
purpose: data models
|
||||||
- path: app/services
|
- path: app/services
|
||||||
|
|||||||
Reference in New Issue
Block a user