Feature Contract Definition
Purpose
Turn an agreed boundary change into an authoritative contract that independent producers and
consumers can implement and verify without guessing. A contract describes externally observable
semantics; a DTO, schema, or endpoint list without failures, ownership, and compatibility is only a
shape.
Workflow
- Start from accepted intent. Trace the contract to
OBJ-*, BR-*, BAC-*, affected SC-*
items, and the boundary crossing in the impact map. If behavior is still disputed, return to the
responsible Product or Engineering stage for that decision. Reuse existing repository/session
references and accepted revisions; do not invent IDs or require a new dossier merely to draft
a contract. Record missing mappings explicitly and continue unaffected surfaces.
- Name the parties and authority. Identify provider, every known consumer, contract owner,
approver, and independently deployed parties. Reuse authority already established in the
accepted inputs; do not request it again. An unresolved owner blocks acceptance of that
boundary, not evidence gathering or a reviewable draft. Unknown public consumers require a
documented support/version policy rather than an invented list of approvals.
- Select only the applicable surfaces. API/RPC, event/message, persisted/shared data, external
integration, security, or operational/SLO. Read the matching sections of
Contract surfaces.
- Define success and failure semantics. Inputs, outputs, invariants, errors, timeouts, retries,
duplication, ordering, partial success, authorization, and observability where applicable.
- Define evolution. Current version, proposed version, compatible and incompatible changes,
coexistence window, migration/deprecation, rollout order, rollback limit, and consumer evidence.
Name exact producer/consumer/schema revisions and retained data that remain supported;
syntactic compatibility alone does not establish unchanged meaning or failure behaviour.
- Maintain one source of truth. Amend and link the authoritative OpenAPI, AsyncAPI, schema, protocol, or
equivalent artefact. Summaries point to it; they do not become a second copy.
Follow its declared specification/toolchain version and repository validation commands;
do not upgrade a format, generator or runtime simply to express the change. External
publication or messaging requires authorization for that action.
- Make it verifiable. Add
TC-* contract criteria and planned EV-* evidence such as contract,
compatibility, serialization, migration, security-negative, or consumer tests.
Each criterion names stimulus/precondition, observable result and failure condition. Mark
evidence as planned, executed-pass, executed-fail or unavailable, tied to exact revisions
and environment; a schema linter cannot prove behavioral compatibility. Run applicable
existing specification checks now, and identify runtime checks that belong to implementation.
Decision rules
IF a consumer can observe a change
THEN compatibility is a contract question even when the code change is additive.
IF producer and consumer deploy independently
THEN name each supported old/new producer-consumer pair, retained-data reader pair and
rollback combination; verify them or record the pending check. Justify excluded combinations.
IF an error can cross the boundary
THEN its classification, representation, retryability, and ownership are contract fields.
IF delivery can repeat or reorder work
THEN define operation/event identity scope, payload reuse policy, deduplication horizon,
ordering scope and replay behavior; a timeout is not proof that no effect occurred.
IF an authoritative specification already exists
THEN amend and link it; do not copy it into the feature dossier.
IF a contract choice changes product behavior
THEN return that decision to Product instead of resolving it as an engineering detail.
Constraints
- Repository conventions are evidence, not authority to change a published boundary.
- Do not call a draft contract accepted until its accountable owner and affected independent parties
have a recorded status under the established authority/support policy. Record consultations,
required approvals and unresolved parties separately; a recorded rejection is not acceptance.
- Contract acceptance approves a specification revision; it does not prove implementation
conformance. New semantic changes require impact review and supersede only affected evidence.
- Do not require all surface sections. Mark only applicable surfaces; absence follows from the impact
map, not convenience.
- Keep implementation tasks out. The contract states what parties may rely on; resources implement it
later.
Output
Contract CT-01 <name and surface>
Trace <OBJ/BR/BAC/SC and boundary-crossing IDs>
Owner <accountable role>
Parties <providers, consumers, operators>
Authority <approver and consulted roles>
Specification <authoritative link and version>
Semantics <success, failures and invariants>
Evolution <compatibility, coexistence, migration, deprecation>
Security <identity, authorization, data exposure>
Operations <SLO, telemetry, support/recovery obligations>
Criteria <TC-*>
Evidence <EV-* status, tested revision/environment, result or pending check>
Status Draft | In review | Accepted | Blocked
Use only applicable fields and existing identifier conventions. Hand the accepted contract and
its exact version, plus pending conformance checks, to the implementation plan. A Blocked
contract names the unresolved rule/decision, accountable role and dependent work; unaffected
drafting and verification can continue.
1---2name: feature-contract-definition3description: Defining a versioned API, event, data, integration, security, or operational contract for a feature after its behavior is agreed and before implementation is planned. Use when callers, consumers, stored data, or operators will depend on a changed boundary and its success, failure, ownership, compatibility, and verification must be explicit. Does not choose the architecture or transport (feature-solution-analysis), record the decision (feature-decision-analysis), or implement the contract (feature-execution).4---56# Feature Contract Definition78## Purpose910Turn an agreed boundary change into an authoritative contract that independent producers and11consumers can implement and verify without guessing. A contract describes externally observable12semantics; a DTO, schema, or endpoint list without failures, ownership, and compatibility is only a13shape.1415## Workflow16171. **Start from accepted intent.** Trace the contract to `OBJ-*`, `BR-*`, `BAC-*`, affected `SC-*`18 items, and the boundary crossing in the impact map. If behavior is still disputed, return to the19 responsible Product or Engineering stage for that decision. Reuse existing repository/session20 references and accepted revisions; do not invent IDs or require a new dossier merely to draft21 a contract. Record missing mappings explicitly and continue unaffected surfaces.222. **Name the parties and authority.** Identify provider, every known consumer, contract owner,23 approver, and independently deployed parties. Reuse authority already established in the24 accepted inputs; do not request it again. An unresolved owner blocks acceptance of that25 boundary, not evidence gathering or a reviewable draft. Unknown public consumers require a26 documented support/version policy rather than an invented list of approvals.273. **Select only the applicable surfaces.** API/RPC, event/message, persisted/shared data, external28 integration, security, or operational/SLO. Read the matching sections of29 [Contract surfaces](references/contract-surfaces.md).304. **Define success and failure semantics.** Inputs, outputs, invariants, errors, timeouts, retries,31 duplication, ordering, partial success, authorization, and observability where applicable.325. **Define evolution.** Current version, proposed version, compatible and incompatible changes,33 coexistence window, migration/deprecation, rollout order, rollback limit, and consumer evidence.34 Name exact producer/consumer/schema revisions and retained data that remain supported;35 syntactic compatibility alone does not establish unchanged meaning or failure behaviour.366. **Maintain one source of truth.** Amend and link the authoritative OpenAPI, AsyncAPI, schema, protocol, or37 equivalent artefact. Summaries point to it; they do not become a second copy.38 Follow its declared specification/toolchain version and repository validation commands;39 do not upgrade a format, generator or runtime simply to express the change. External40 publication or messaging requires authorization for that action.417. **Make it verifiable.** Add `TC-*` contract criteria and planned `EV-*` evidence such as contract,42 compatibility, serialization, migration, security-negative, or consumer tests.43 Each criterion names stimulus/precondition, observable result and failure condition. Mark44 evidence as planned, executed-pass, executed-fail or unavailable, tied to exact revisions45 and environment; a schema linter cannot prove behavioral compatibility. Run applicable46 existing specification checks now, and identify runtime checks that belong to implementation.4748## Decision rules4950```text51IF a consumer can observe a change52THEN compatibility is a contract question even when the code change is additive.5354IF producer and consumer deploy independently55THEN name each supported old/new producer-consumer pair, retained-data reader pair and56rollback combination; verify them or record the pending check. Justify excluded combinations.5758IF an error can cross the boundary59THEN its classification, representation, retryability, and ownership are contract fields.6061IF delivery can repeat or reorder work62THEN define operation/event identity scope, payload reuse policy, deduplication horizon,63ordering scope and replay behavior; a timeout is not proof that no effect occurred.6465IF an authoritative specification already exists66THEN amend and link it; do not copy it into the feature dossier.6768IF a contract choice changes product behavior69THEN return that decision to Product instead of resolving it as an engineering detail.70```7172## Constraints7374- Repository conventions are evidence, not authority to change a published boundary.75- Do not call a draft contract accepted until its accountable owner and affected independent parties76 have a recorded status under the established authority/support policy. Record consultations,77 required approvals and unresolved parties separately; a recorded rejection is not acceptance.78- Contract acceptance approves a specification revision; it does not prove implementation79 conformance. New semantic changes require impact review and supersede only affected evidence.80- Do not require all surface sections. Mark only applicable surfaces; absence follows from the impact81 map, not convenience.82- Keep implementation tasks out. The contract states what parties may rely on; resources implement it83 later.8485## Output8687```text88Contract CT-01 <name and surface>89Trace <OBJ/BR/BAC/SC and boundary-crossing IDs>90Owner <accountable role>91Parties <providers, consumers, operators>92Authority <approver and consulted roles>93Specification <authoritative link and version>94Semantics <success, failures and invariants>95Evolution <compatibility, coexistence, migration, deprecation>96Security <identity, authorization, data exposure>97Operations <SLO, telemetry, support/recovery obligations>98Criteria <TC-*>99Evidence <EV-* status, tested revision/environment, result or pending check>100Status Draft | In review | Accepted | Blocked101```102103Use only applicable fields and existing identifier conventions. Hand the accepted contract and104its exact version, plus pending conformance checks, to the implementation plan. A `Blocked`105contract names the unresolved rule/decision, accountable role and dependent work; unaffected106drafting and verification can continue.