This commit is contained in:
Tiara Rodney 2026-02-05 01:51:29 +01:00
commit 41481636d8
No known key found for this signature in database
GPG key ID: 5CD8EC1D46106723
12 changed files with 2126 additions and 0 deletions

21
rules/index.md Normal file
View file

@ -0,0 +1,21 @@
# Rules
The ABC Pattern is defined and enforced through two complementary rule families:
* [Normative Rules](normative.md)
* [Validation Rules](validation.md)
Together, these rule sets establish the semantic, structural, and mechanical
guarantees that make ABC architectures predictable, verifiable, and safe for
automated reasoning and transformation.
Although closely related, the two rule families serve distinct purposes:
**Normative Rules** define the semantic contract of the ABC Pattern. They
specify what MUST, SHOULD, or MAY be true in any ABCcompliant architecture,
independent of implementation language, cloud provider, or IaC tool.
**Validation Rules** define the mechanical checks required to verify that an ABC
architecture conforms to the Normative Rules and the ABC Schema. Where Normative
Rules describe what must be true, Validation Rules describe how to detect
violations.

273
rules/normative.md Normal file
View file

@ -0,0 +1,273 @@
# Normative Rules
The ABC Pattern is defined by a set of Normative Rules that establish the
structural, behavioral, and dataflow guarantees of the architecture. These
rules are the foundation that makes ABC:
* predictable
* composable
* verifiable
* agentfriendly
* implementationagnostic
Normative Rules describe what MUST or SHOULD be true in any ABCcompliant
architecture, regardless of the underlying cloud provider, IaC tool, or
programming language. They are not suggestions or stylistic preferences; they
are the semantic constraints that ensure ABC constructs behave consistently and
safely.
Each rule is assigned a canonical identifier of the form:
```default
ABC-R#
```
This identifier is stable, unique, and referenced throughout:
* the ABC Schema
* validation rules
* implementation profiles (e.g., CDKTS, Terraform)
* agent guidance
* tooling and linters
## Hierarchy Rules
These define the allowed structure of an ABC architecture, including the roles
and relationships of ApplicationStacks, Logical Units, and Resource Groups.
### ABCR1 (MUST)
An Application Stack (ABCC1) MUST contain one or more Logical Units (ABCC2).
### ABCR2 (MUST)
A Logical Unit (ABCC2) MUST contain one or more Resource Groups (ABCC3).
### ABCR3 (MUST)
Every Construct (ABCC0) MUST have exactly one parent, except the Application
Stack (ABCC1), which has none.
### ABCR4 (MUST)
Constructs MUST form a strict tree hierarchy with no cycles.
### ABCR5 (SHOULD)
Logical Units (ABCC2) SHOULD represent coherent functional domains.
### ABCR6 (MAY)
Resource Groups (ABCC3) MAY be nested further if the implementation framework
supports subconstructs, provided all other rules remain satisfied.
## Relationship Rules
Specify how constructs relate to one another, including parentchild
constraints, allowed dependencies, and prohibited lateral references.
### ABCR10 (MUST)
A Resource Group (ABCC3) MUST NOT reference another Resource Group directly.
### ABCR11 (MUST)
A Logical Unit (ABCC2) MUST NOT reference another Logical Unit directly.
### ABCR12 (MUST)
A Construct (ABCC0) MUST NOT access parent state except through Capturing Down
(ABCF1).
### ABCR13 (MUST)
A Construct (ABCC0) MUST NOT access sibling state under any circumstances.
### ABCR14 (MUST)
All crossdomain communication MUST be mediated by the parent construct.
### ABCR15 (SHOULD)
Constructs SHOULD minimize the number of outputs they expose to reduce coupling.
### ABCR16 (MAY)
A parent MAY aggregate outputs from multiple children before reexposing them.
## Interface Rules
Define the semantics of Input and Output Contracts, including immutability,
explicitness, and the boundaries they enforce.
### ABCR20 (MUST)
Every Construct (ABCC0) MUST define an Input Contract (ABCC4).
### ABCR21 (MUST)
Every Construct (ABCC0) MUST define an Output Contract (ABCC5), even if empty.
### ABCR22 (MUST)
A Construct MUST NOT depend on any value not present in its Input Contract.
### ABCR23 (MUST)
A Construct MUST NOT expose any value not present in its Output Contract.
### ABCR24 (MUST)
Input Contracts MUST be immutable after instantiation.
### ABCR25 (SHOULD)
Output Contracts SHOULD be minimal and stable across versions.
### ABCR26 (MAY)
A Construct MAY expose composite outputs if they simplify parentlevel wiring.
## Instantiation Rules
Specify how constructs are created, how inputs are provided, and how
instantiation must avoid side effects or hidden dependencies.
### ABCR30 (MUST)
A Construct (ABCC0) MUST be instantiated exclusively through its Instantiation
Interface (ABCC6).
### ABCR31 (MUST)
Instantiation MUST be topdown: parents instantiate children; children MUST NOT
instantiate parents or siblings.
### ABCR32 (MUST)
The Instantiation Interface MUST accept only the Input Contract (ABCC4) and no
additional parameters.
### ABCR33 (MUST)
Instantiation MUST NOT produce side effects beyond constructing the child.
### ABCR34 (SHOULD)
Instantiation Interfaces SHOULD remain stable across minor revisions.
### ABCR35 (MAY)
Constructs MAY provide optional parameters in the Input Contract if defaults are
welldefined.
## Data Flow Rules
Formalize the two fundamental ABC dataflow mechanisms:
* Capturing Down (parent → child)
* Bubbling Up (child → parent)
These rules ensure that all communication flows through the parent construct,
eliminating ambiguity and hidden coupling.
### ABCR40 (MUST)
All downward data flow MUST occur through Capturing Down (ABCF1).
### ABCR41 (MUST)
All upward data flow MUST occur through Bubbling Up (ABCF2).
### ABCR42 (MUST)
A Construct MUST NOT read values from its parent except those explicitly passed
via Capturing Down.
### ABCR43 (MUST)
A Construct MUST NOT write values to its parent except through Bubbling Up.
### ABCR44 (MUST)
Parents MUST mediate all routing of outputs between children.
### ABCR45 (SHOULD)
Parents SHOULD avoid passing unnecessary outputs downward to reduce coupling.
### ABCR46 (MAY)
Parents MAY transform outputs before passing them down.
## Encapsulation & Testability Rules
Ensure that constructs remain isolated, testable, and free from crosscutting
concerns. These rules prevent leakage of internal details and enforce strict
boundaries.
### ABCR50 (MUST)
Constructs MUST encapsulate all internal implementation details.
### ABCR51 (MUST)
Constructs MUST be instantiable in isolation using mock Input Contracts.
### ABCR52 (SHOULD)
Constructs SHOULD avoid exposing internal resource identifiers unless required.
### ABCR53 (SHOULD)
Constructs SHOULD minimize internal state to simplify testing.
### ABCR54 (MAY)
Constructs MAY provide diagnostic outputs if they do not violate encapsulation.
## Evolution & Change Management Rules
Define how ABC architectures evolve safely over time, including versioning,
contract stability, and backwardcompatible changes.
### ABCR60 (MUST)
If a childs Output Contract changes, the parent MUST adapt explicitly.
### ABCR61 (MUST)
Breaking changes to Input Contracts MUST be versioned or documented.
### ABCR62 (SHOULD)
Constructs SHOULD maintain backward compatibility where feasible.
### ABCR63 (SHOULD)
Parents SHOULD validate child outputs before routing them.
### ABCR64 (MAY)
Constructs MAY deprecate fields gradually before removal.
## Optional Flexibility Rules
Provide nonmandatory guidance that enhances clarity, maintainability, or
ergonomics without affecting correctness. These rules are advisory and may be
adopted at the discretion of the implementation or team.
### ABCR70 (MAY)
Logical Units MAY be composed dynamically if the framework supports it, provided
all other rules remain satisfied.
### ABCR71 (MAY)
Resource Groups MAY be reused across Logical Units if instantiated
independently.
### ABCR72 (MAY)
The Application Stack MAY expose a composite Output Contract aggregating all
Logical Unit outputs.

155
rules/validation.md Normal file
View file

@ -0,0 +1,155 @@
# Validation Rules
The ABC Validation Rules define the mechanical checks required to verify that an
ABC architecture conforms to the ABC Schema and the normative rules of the
specification. These rules are intended for:
* automated validators
* linters
* compilers
* agentdriven code generation
* CI/CD enforcement
Validation Rules are **not** conceptual rules; they are operational constraints
that ensure an ABC description is structurally correct and unambiguous.
Validation Rules follow the canonical identifier format:
```default
ABC-VALID-R#
```
They are grouped into:
* Structural Validation
* Contract Validation
* DataFlow Validation
* Hierarchy Validation
* ProfileSpecific Validation (optional)
## Structural Validation Rules
These rules ensure the ABC hierarchy is wellformed.
### ABC-VALID-R1 (MUST)
Every construct MUST have exactly one parent, except the ApplicationStack which
MUST have none.
### ABC-VALID-R2 (MUST)
The hierarchy MUST follow the pattern:
`ApplicationStack → LogicalUnit → ResourceGroup`.
### ABC-VALID-R3 (MUST)
Construct trees MUST NOT contain cycles.
### ABC-VALID-R4 (MUST)
Construct IDs MUST be unique within the architecture.
### ABC-VALID-R5 (MUST)
Construct types MUST be one of:
ApplicationStack, LogicalUnit, ResourceGroup.
### ABC-VALID-R6 (MUST)
ResourceGroups MUST NOT have children.
### ABC-VALID-R7 (MUST)
LogicalUnits MUST NOT have parents that are not ApplicationStacks.
### ABC-VALID-R8 (MUST)
ResourceGroups MUST NOT have parents that are not LogicalUnits.
## Contract Validation Rules
These rules ensure Input/Output Contracts are welldefined and consistent.
### ABC-VALID-R10 (MUST)
Every construct MUST define both an InputContract and an OutputContract.
### ABC-VALID-R11 (MUST)
InputContracts MUST be immutable after instantiation.
### ABC-VALID-R12 (MUST)
Constructs MUST NOT reference values not present in their InputContract.
### ABC-VALID-R13 (MUST)
Constructs MUST NOT expose outputs not declared in their OutputContract.
### ABC-VALID-R14 (SHOULD)
OutputContracts SHOULD be minimal and stable across versions.
### ABC-VALID-R15 (MUST)
InputContracts MUST NOT reference parent or sibling constructs directly.
### ABC-VALID-R16 (MUST)
OutputContracts MUST NOT expose internal implementation details (e.g., resource
objects).
## DataFlow Validation Rules
These rules enforce Capturing Down and Bubbling Up.
### ABC-VALID-R20 (MUST)
All downward references MUST originate from:
* parent.InputContract
* parent.OutputContract
### ABC-VALID-R21 (MUST)
All upward references MUST originate from:
* child.OutputContract
### ABC-VALID-R22 (MUST)
No lateral data flow is permitted between siblings.
### ABC-VALID-R23 (MUST)
Constructs MUST NOT read values from grandparents or ancestors except through
parentmediated Capturing Down.
### ABC-VALID-R24 (MUST)
Constructs MUST NOT write values to ancestors except through Bubbling Up.
### ABC-VALID-R25 (MUST)
Constructs MUST NOT read or write values from siblings or cousins.
## Instantiation Validation Rules
These rules ensure constructs are instantiated correctly.
### ABC-VALID-R30 (MUST)
Constructs MUST be instantiated using the Instantiation Interface:
(scope, id, inputs).
### ABC-VALID-R31 (MUST)
Instantiation MUST NOT accept parameters outside the InputContract.
### ABC-VALID-R32 (MUST)
Instantiation MUST NOT produce side effects beyond constructing children.
### ABC-VALID-R33 (MUST)
Constructs MUST NOT mutate their InputContract after instantiation.