2026-06-22 17:23:14 +02:00
|
|
|
# Architectural conventions for RoboCo.
|
|
|
|
|
#
|
2026-06-22 18:15:19 +02:00
|
|
|
# This file overlays the auto-derived scan: every consumer (the validator, the
|
|
|
|
|
# per-task constraints, the spawn-time ambient block) reads the merged effective
|
|
|
|
|
# map, so only project-specific divergences need to live here. The scan already
|
|
|
|
|
# excludes tests/ and docs/, maps the backend (roboco/) + frontend (panel/)
|
|
|
|
|
# layers, and defaults misplaced-helper to warn — so this file is mostly a small
|
|
|
|
|
# set of module declarations plus the rule-level policy below.
|
|
|
|
|
#
|
|
|
|
|
# Posture: BLOCK every boundary the codebase already honors (a model or helper
|
|
|
|
|
# in a route, a route in a service, a model/route in a panel component, a hook
|
|
|
|
|
# returning JSX — all refused), WARN the boundaries that still carry debt so a
|
|
|
|
|
# task is never stranded on pre-existing code.
|
2026-06-22 17:23:14 +02:00
|
|
|
|
|
|
|
|
version: 1
|
|
|
|
|
languages:
|
|
|
|
|
- python
|
|
|
|
|
- typescript
|
|
|
|
|
|
|
|
|
|
modules:
|
|
|
|
|
# --- Backend: roboco/ --------------------------------------------------------
|
|
|
|
|
- path: roboco/models
|
|
|
|
|
purpose: SQLAlchemy + Pydantic data models
|
|
|
|
|
forbidden:
|
|
|
|
|
- route
|
|
|
|
|
- path: roboco/api
|
2026-06-22 18:15:19 +02:00
|
|
|
purpose: API package wiring — app, deps, middleware, websocket
|
2026-06-22 17:23:14 +02:00
|
|
|
forbidden:
|
|
|
|
|
- model
|
|
|
|
|
- path: roboco/api/routes
|
2026-06-22 18:15:19 +02:00
|
|
|
purpose: HTTP routes — thin handlers that delegate to services
|
2026-06-22 17:23:14 +02:00
|
|
|
forbidden:
|
|
|
|
|
- model
|
|
|
|
|
- helper
|
|
|
|
|
- path: roboco/api/schemas
|
|
|
|
|
purpose: API request / response schemas
|
|
|
|
|
forbidden:
|
|
|
|
|
- route
|
|
|
|
|
- path: roboco/mcp/schemas
|
|
|
|
|
purpose: MCP tool input / output schemas
|
|
|
|
|
forbidden:
|
|
|
|
|
- route
|
|
|
|
|
- path: roboco/services
|
|
|
|
|
purpose: business logic, DB writes, side effects — the only layer that owns them
|
|
|
|
|
forbidden:
|
|
|
|
|
- route
|
|
|
|
|
- path: roboco/utils
|
|
|
|
|
purpose: shared, side-effect-free helpers
|
|
|
|
|
forbidden:
|
|
|
|
|
- route
|
|
|
|
|
- component
|
|
|
|
|
|
|
|
|
|
# --- Frontend: panel/ --------------------------------------------------------
|
|
|
|
|
- path: panel/src/components
|
|
|
|
|
purpose: presentational UI components
|
|
|
|
|
forbidden:
|
|
|
|
|
- model
|
|
|
|
|
- route
|
|
|
|
|
- path: panel/src/hooks
|
|
|
|
|
purpose: React hooks — data fetching + state, no JSX
|
|
|
|
|
forbidden:
|
|
|
|
|
- component
|
|
|
|
|
- model
|
|
|
|
|
- route
|
|
|
|
|
- path: panel/src/store
|
|
|
|
|
purpose: client-side state management
|
|
|
|
|
forbidden:
|
|
|
|
|
- component
|
|
|
|
|
- route
|
|
|
|
|
- path: panel/src/lib/api
|
|
|
|
|
purpose: typed API client
|
|
|
|
|
forbidden:
|
|
|
|
|
- model
|
|
|
|
|
- path: panel/src/lib
|
|
|
|
|
purpose: shared frontend helpers / utilities
|
|
|
|
|
forbidden:
|
|
|
|
|
- route
|
|
|
|
|
- component
|
|
|
|
|
|
|
|
|
|
rules:
|
2026-06-22 18:15:19 +02:00
|
|
|
# Comments are welcome in RoboCo — intent is documented in-code and in
|
|
|
|
|
# docstrings. The rule only nudges (full-line comments are never flagged).
|
2026-06-22 17:23:14 +02:00
|
|
|
no_inline_comments:
|
|
|
|
|
level: warn
|
2026-06-22 18:15:19 +02:00
|
|
|
# A handful of unavoidable framework suppressions are auto-allowed
|
|
|
|
|
# (TC001-003, pydantic prop-decorator); the few remaining inline E402 / E501 /
|
|
|
|
|
# arg-type suppressions stay warn until they migrate to pyproject config.
|
|
|
|
|
no_lint_suppressions:
|
2026-06-22 17:23:14 +02:00
|
|
|
level: warn
|
2026-06-22 18:15:19 +02:00
|
|
|
# RoboCo routes deliberately call db.commit() (get_db auto-commit is unreliable
|
|
|
|
|
# under BaseHTTPMiddleware); explicit commits no longer count as data access,
|
|
|
|
|
# so this stays advisory for the few routes that still read/write directly.
|
2026-06-22 17:23:14 +02:00
|
|
|
thin_routes:
|
|
|
|
|
level: warn
|
2026-06-22 18:15:19 +02:00
|
|
|
# A few panel components still fetch inline; extract into hooks, then promote.
|
2026-06-22 17:23:14 +02:00
|
|
|
thin_components:
|
|
|
|
|
level: warn
|
2026-06-22 18:15:19 +02:00
|
|
|
# Everything else inherits the derived BLOCK level — no models/helpers in
|
|
|
|
|
# routes, no routes in services, no models/routes in panel components, etc.
|
2026-06-22 17:23:14 +02:00
|
|
|
|
|
|
|
|
custom: []
|
2026-07-22 08:11:28 +02:00
|
|
|
waivers:
|
|
|
|
|
- path: panel/src/hooks/__tests__/use-tasks-null-guards.test.tsx
|
|
|
|
|
rule: no_components_in_hooks
|
|
|
|
|
reason: >-
|
|
|
|
|
`wrapper` is a QueryClientProvider test fixture local to this test file,
|
|
|
|
|
not a production component — the same pattern already used by the
|
|
|
|
|
pre-existing use-agents.test.tsx / use-observability.test.tsx hook
|
|
|
|
|
tests colocated under hooks/__tests__/.
|