-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCONTRACT.yaml
More file actions
114 lines (110 loc) · 4.18 KB
/
CONTRACT.yaml
File metadata and controls
114 lines (110 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
module:
id: PRATYA
name: Pratya Core Engine
description: Spec coverage and traceability engine for Contract-Driven Development
owner: intrigsoft
created: "2026-03-06"
version: 0.1.0
specs:
- id: PRATYA-001
version: 1.0.0
status: approved
title: CONTRACT.yaml parsing and validation
description: >
The parser must load a CONTRACT.yaml file, validate its structure against
the schema, and return a typed ModuleContract object.
acceptance_criteria:
- Valid CONTRACT.yaml parses to a ModuleContract with correct fields
- Spec fields are mapped correctly
- Supersession fields are mapped correctly
cases:
- id: PRATYA-001-TC-001
description: Invalid YAML syntax is rejected with a clear error
- id: PRATYA-001-TC-002
description: Non-object YAML content is rejected
- id: PRATYA-001-TC-003
description: Empty specs list is accepted as valid
- id: PRATYA-001-TC-004
description: Malformed spec IDs are rejected via schema validation
- id: PRATYA-001-TC-005
description: Duplicate spec IDs are rejected
- id: PRATYA-001-TC-006
description: Broken superseded_by reference is rejected
- id: PRATYA-001-TC-007
description: Broken supersedes reference is rejected
changelog:
- version: 1.0.0
date: "2026-03-06"
note: Initial definition
- id: PRATYA-002
version: 1.0.0
status: approved
title: Coverage matrix computation
description: >
The coverage engine must cross-reference trace entries against active
specs to produce per-spec and aggregate coverage percentages.
acceptance_criteria:
- Zero traces produce 0% coverage
- Deprecated and superseded specs are excluded by default
- Partial coverage computes correct percentages
- Full coverage of approved specs produces 100%
cases:
- id: PRATYA-002-TC-001
description: All tests passing marks spec as passing=true
- id: PRATYA-002-TC-002
description: Any test failing marks spec as passing=false
- id: PRATYA-002-TC-003
description: No tests marks spec as passing=null
- id: PRATYA-002-TC-004
description: Istanbul coverage-summary.json is read for code coverage
- id: PRATYA-002-TC-005
description: Missing coverage file returns undefined codeCoverage
- id: PRATYA-002-TC-006
description: Case coverage is computed correctly across all specs
changelog:
- version: 1.0.0
date: "2026-03-06"
note: Initial definition
- id: PRATYA-003
version: 1.0.0
status: approved
title: Audit rules engine
description: >
The audit engine must detect violations by comparing traces and contract
state, emitting typed violations with correct severity.
acceptance_criteria:
- Orphan annotations produce ERROR violations
- Uncovered approved specs produce ERROR violations
- Uncovered cases produce WARN violations
cases:
- id: PRATYA-003-TC-001
description: Deprecated spec reference produces WARN
- id: PRATYA-003-TC-002
description: Superseded spec reference produces WARN with successor hint
- id: PRATYA-003-TC-003
description: Broken supersession chain produces ERROR
- id: PRATYA-003-TC-004
description: Stale spec version from previous report produces WARN
- id: PRATYA-003-TC-005
description: Fully covered contract produces zero violations
changelog:
- version: 1.0.0
date: "2026-03-06"
note: Initial definition
- id: PRATYA-004
version: 1.0.0
status: approved
title: Report generation
description: >
The report engine must produce JSON and HTML reports from a CoverageMatrix.
acceptance_criteria:
- JSON report contains module, generatedAt, summary, specs, violations
- JSON summary counts are accurate
- HTML report contains all spec IDs and coverage percentages
cases:
- id: PRATYA-004-TC-001
description: HTML report includes violation sections when violations exist
changelog:
- version: 1.0.0
date: "2026-03-06"
note: Initial definition