# architecture Guardrails

> Canonical path: `guardrails/architecture/README.md`

This README lists executable guardrails for cross-domain architecture contracts.

- [`check-service-automation-architecture.sh`](./check-service-automation-architecture.sh) — enforces the durable Service Actor / Service Event / Schedule / Automation ownership and contribution-source boundaries.
- [`check-service-automation-architecture-test.sh`](./check-service-automation-architecture-test.sh) — mutation coverage for the service architecture guardrail.
- [`check-meshx-service-boundaries.sh`](./check-meshx-service-boundaries.sh) — enforces domain-service ownership, `internal/resource/server` composition, retired namespace residue, and the domain-agnostic `internal/service/resource/repos` lifecycle boundary.
- [`check-meshx-runtime-topology.sh`](./check-meshx-runtime-topology.sh) — keeps the embedded resource runtime handler-only inside `agentteam-server` by rejecting listener/server capabilities, standalone commands, build/process residues, the retired listener environment, and stale source namespaces.

The service architecture guardrail intentionally checks owner relationships
instead of maintaining repository-wide word-count allowlists. Product-facing
App names and stable product facades are valid vocabulary; broad term counts
made unrelated feature work fail without proving an architecture violation.

The durable checks are:

- Service Actor, provider-event normalization, and Automation core packages do
  not import higher-level App, Schedule, or service orchestration owners.
- The complete `internal/store/app` production package is scanned as the
  current Service Event owner, including pull-request subscriptions,
  provider-watch facades, delivery, and App runtime files. It does not depend
  on Schedule, Automation, or Trigger storage.
- Native Schedule code uses `schedule_definitions` and `automation_runs`; its
  stable Trigger-shaped facade does not read Service Event state.
- provider-event contribution sources reference `service_event_delivery`,
  while schedule contribution sources reference `automation_run`.
- GitHub/Gitea provider ingress and the visible-effect writers remain wired to
  the canonical normalization and contribution-source primitives.

Both the guardrail and its mutation test run in `make harness-fast`.
