Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v3.1.0
kind: DataContract
id: orders-contract
name: orders-contract
version: 1.0.0
status: active
domain: commerce
description:
purpose: Authoritative orders contract
schema:
- id: orders
name: orders
physicalName: tbl_orders
description: Orders table description
properties:
- id: id
name: id
physicalName: col_id
logicalType: string
physicalType: varchar(64)
required: true
description: Primary identifier
- id: amount
name: amount
physicalName: col_amount
logicalType: number
physicalType: decimal(10,2)
required: false
description: Order total amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v3.1.0
kind: DataContract
id: orders-contract
name: orders-contract
version: 1.0.0
status: retired
domain: commerce
description:
purpose: Authoritative orders contract
schema:
- id: orders
name: orders
physicalName: tbl_orders
description: Orders table description
properties:
- id: id
name: id
physicalName: col_id
logicalType: string
physicalType: varchar(64)
required: true
description: Primary identifier
- id: amount
name: amount
physicalName: col_amount
logicalType: number
physicalType: decimal(10,2)
required: false
description: Order total amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"breaking": false,
"changes": [
{
"after": "retired",
"before": "active",
"breaking": false,
"changeType": "DEPRECATE",
"domain": "LIFECYCLE",
"entityType": "CONTRACT",
"evidence": [],
"field": "status",
"identity": [
"orders-contract"
],
"path": "status",
"reasonCodes": []
}
],
"context": {
"effectiveDate": "2026-01-01"
},
"contractId": "orders-contract",
"decision": "REVIEW",
"decisionId": "b18506a1-f428-510f-9c5b-848054f2b03f",
"evidence": {
"hasChanges": true,
"mergeConflictsCount": 0
},
"policy": {
"idViolation": false,
"retiredViolation": false,
"valid": true,
"versionViolation": false,
"violations": [
{
"code": "CONTRACT_RETIRED_TRANSITION",
"details": {},
"message": "Contract transition to retired status requires governance review.",
"path": "status",
"severity": "WARNING"
}
]
},
"reasonCodes": [
"CHANGE_ASSESSMENT",
"CONTRACT_RETIRED_TRANSITION"
],
"reasons": [
{
"code": "CHANGE_ASSESSMENT",
"details": {},
"message": "Only descriptive metadata changed; no required version bump",
"path": null,
"severity": "INFO"
},
{
"code": "CONTRACT_RETIRED_TRANSITION",
"details": {},
"message": "Contract transition to retired status requires governance review.",
"path": "status",
"severity": "WARNING"
}
],
"requiredVersionBump": "none",
"schemaVersion": "1",
"validation": {
"issues": [],
"valid": true
}
}
29 changes: 29 additions & 0 deletions tests/fixtures/governance_scenarios/contract_id_change/base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v3.1.0
kind: DataContract
id: orders-contract
name: orders-contract
version: 1.0.0
status: active
domain: commerce
description:
purpose: Authoritative orders contract
schema:
- id: orders
name: orders
physicalName: tbl_orders
description: Orders table description
properties:
- id: id
name: id
physicalName: col_id
logicalType: string
physicalType: varchar(64)
required: true
description: Primary identifier
- id: amount
name: amount
physicalName: col_amount
logicalType: number
physicalType: decimal(10,2)
required: false
description: Order total amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v3.1.0
kind: DataContract
id: renamed-orders-contract
name: orders-contract
version: 1.0.0
status: active
domain: commerce
description:
purpose: Authoritative orders contract
schema:
- id: orders
name: orders
physicalName: tbl_orders
description: Orders table description
properties:
- id: id
name: id
physicalName: col_id
logicalType: string
physicalType: varchar(64)
required: true
description: Primary identifier
- id: amount
name: amount
physicalName: col_amount
logicalType: number
physicalType: decimal(10,2)
required: false
description: Order total amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"breaking": true,
"changes": [
{
"after": "renamed-orders-contract",
"before": "orders-contract",
"breaking": true,
"changeType": "MODIFY",
"domain": "IDENTITY",
"entityType": "CONTRACT",
"evidence": [],
"field": "id",
"identity": [
"orders-contract"
],
"path": "id",
"reasonCodes": [
"CONTRACT_ID_CHANGED"
]
}
],
"context": {
"effectiveDate": "2026-01-01"
},
"contractId": "orders-contract",
"decision": "BLOCK",
"decisionId": "750bd41f-1b63-5de6-a47c-47d9515c4d10",
"evidence": {
"hasChanges": true,
"mergeConflictsCount": 0
},
"policy": {
"idViolation": true,
"retiredViolation": false,
"valid": false,
"versionViolation": false,
"violations": [
{
"code": "CONTRACT_ID_CHANGED",
"details": {},
"message": "Contract ID mismatch. You changed the root ID of the contract, which is immutable. If you want to create a new contract, use 'semapact import --new' or change the ID back.",
"path": "id",
"severity": "ERROR"
}
]
},
"reasonCodes": [
"CHANGE_ASSESSMENT",
"CONTRACT_ID_CHANGED"
],
"reasons": [
{
"code": "CHANGE_ASSESSMENT",
"details": {},
"message": "Breaking lifecycle changes require a major version bump",
"path": null,
"severity": "INFO"
},
{
"code": "CONTRACT_ID_CHANGED",
"details": {},
"message": "Contract ID mismatch. You changed the root ID of the contract, which is immutable. If you want to create a new contract, use 'semapact import --new' or change the ID back.",
"path": "id",
"severity": "ERROR"
}
],
"requiredVersionBump": "major",
"schemaVersion": "1",
"validation": {
"issues": [],
"valid": true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v3.1.0
kind: DataContract
id: orders-contract
name: orders-contract
version: 1.0.0
status: active
domain: commerce
description:
purpose: Authoritative orders contract
schema:
- id: orders
name: orders
physicalName: tbl_orders
description: Orders table description
properties:
- id: id
name: id
physicalName: col_id
logicalType: string
physicalType: varchar(64)
required: true
description: Primary identifier
- id: amount
name: amount
physicalName: col_amount
logicalType: number
physicalType: decimal(10,2)
required: false
description: Order total amount
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: v3.1.0
kind: DataContract
id: orders-contract
name: orders-contract
version: 1.0.0
status: active
domain: commerce
description:
purpose: Authoritative orders contract
schema:
- id: orders
name: orders
physicalName: tbl_orders
description: Orders table description
properties:
- id: id
name: id
physicalName: col_id
logicalType: string
physicalType: varchar(64)
required: true
description: Primary identifier
- id: amount
name: amount
physicalName: col_amount
logicalType: number
physicalType: decimal(8,2)
required: false
description: Order total amount
Loading
Loading