Contract Families¶
This index is the reviewed human projection of archlinternet.capabilities.json. The hidden contract-family markers are checked by make lint-docs; adding or removing a machine capability without updating this page fails the documentation gate.
Strict groups are blocking. Audit groups use the same family semantics for non-blocking migration/discovery.
| Family | Strict / audit groups | Purpose |
|---|---|---|
| Dependency | strict / audit | Forbid dependencies from one layer to selected target layers. |
| Layer order | strict_layers / audit_layers | Enforce an ordered inward dependency direction. |
| Allow-only | strict_allow_only / audit_allow_only | Restrict a layer to itself plus explicitly allowed first-party layers. |
| Cycle | strict_cycles / audit_cycles | Detect directed cycles among selected layers. |
| Acyclic sibling | strict_acyclic_siblings / audit_acyclic_siblings | Keep direct sibling namespaces below selected ancestors acyclic. |
| Module container | strict_module_containers / audit_module_containers | Discover direct feature modules and enforce a reviewed module profile. |
| Method body | strict_method_body / audit_method_body | Forbid selected API calls using source/IL analysis. |
| Unity asmdef | strict_asmdef / audit_asmdef | Govern Unity .asmdef references. |
| Independence | strict_independence / audit_independence | Keep selected layers mutually independent. |
| Assembly independence | strict_assembly_independence / audit_assembly_independence | Keep selected .NET assemblies mutually independent. |
| Assembly dependency | strict_assembly_dependency / audit_assembly_dependency | Forbid direct first-party assembly references. |
| Assembly allow-only | strict_assembly_allow_only / audit_assembly_allow_only | Restrict direct first-party assembly references to an allow-list. |
| Project metadata | strict_project_metadata / audit_project_metadata | Govern project properties, friend assemblies, and project references. |
| Protected surface | strict_protected / audit_protected | Restrict which layers may import a protected layer. |
| External dependency | strict_external / audit_external | Forbid vendor/framework namespace/type dependency groups. |
| External allow-only | strict_external_allow_only / audit_external_allow_only | Restrict external dependencies to reviewed groups. |
| Layer template | strict_layer_templates / audit_layer_templates | Apply reusable layer order to multiple namespace containers. |
| Type placement | strict_type_placement / audit_type_placement | Constrain matching types by location and naming. |
| Layout conventions | strict_layout_conventions / audit_layout_conventions | Govern source-file/declaration layout conventions. |
| Layout-convention applicability | strict_layout_convention_applicability / audit_layout_convention_applicability | Opt in to stale-folder, empty-selector, unmapped, and ambiguous layout evidence. |
| Public API surface | strict_public_api_surface / audit_public_api_surface | Govern exported API signatures and reviewed snapshots. |
| Contract-surface exposure | strict_contract_surface_exposure / audit_contract_surface_exposure | Prevent selected visible contract signatures from exposing selected type surfaces. |
| Versioned contract-surface isolation | strict_versioned_contract_surface_isolation / audit_versioned_contract_surface_isolation | Prevent a selected versioned contract surface from exposing types selected by other version or implementation surfaces. |
| Attribute usage | strict_attribute_usage / audit_attribute_usage | Restrict where selected attributes may appear. |
| Inheritance | strict_inheritance / audit_inheritance | Forbid selected base classes in selected source surfaces. |
| Interface implementation | strict_interface_implementation / audit_interface_implementation | Restrict where implementations of selected interfaces may live. |
| Composition | strict_composition / audit_composition | Restrict composition/service-locator calls to reviewed boundaries. |
| Coverage | strict_coverage / audit_coverage | Govern namespace, project, assembly, dependency-edge, rule-input, and semantic-role coverage. |
| Metric budget | strict_metric_budgets / audit_metric_budgets | Enforce inclusive minimum and maximum bounds on declared architecture metrics. |
| Contextual dependency | strict_context_dependencies / audit_context_dependencies | Forbid dependencies between semantic role/metadata contexts. |
| Contextual allow-only | strict_context_allow_only / audit_context_allow_only | Allow semantic-context dependencies only to selected contexts. |
| Semantic port boundary | strict_port_boundaries / audit_port_boundaries | Require selected context crossings to pass through a port/ACL seam. |
| Package dependency | strict_package_dependency / audit_package_dependency | Forbid selected NuGet package groups from project/assembly sources. |
| Package allow-only | strict_package_allow_only / audit_package_allow_only | Restrict NuGet references to reviewed package groups. |
| Framework dependency | strict_framework_dependency / audit_framework_dependency | Forbid selected MSBuild FrameworkReference groups. |
| Framework allow-only | strict_framework_allow_only / audit_framework_allow_only | Restrict framework references to reviewed groups. |
Choosing a family¶
Use the narrowest contract that expresses the architectural decision:
- Choose dependency/allow-only contracts for named layer relationships.
- Choose contextual contracts when the rule is naturally role/metadata based.
- Choose a port boundary when a cross-context dependency is allowed only through an explicit seam.
- Choose package/framework/project families for MSBuild/project governance rather than approximating those facts with namespaces.
- Choose coverage in addition to behavioral rules so newly discovered architecture cannot remain ungoverned.
- Use audit mode for migration discovery; promote to strict only when the rule is ready to block.
For reusable inputs across many contracts, see source_sets in the Policy format.