contract-driven-delivery 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +219 -0
- package/README.md +124 -1
- package/assets/CLAUDE.template.md +13 -0
- package/assets/agents/backend-engineer.md +3 -1
- package/assets/agents/frontend-engineer.md +3 -2
- package/assets/cdd/conformance.json +16 -0
- package/assets/cdd/tier-policy.json +35 -0
- package/assets/contracts/api/api-contract.md +26 -0
- package/assets/hooks/pre-tool-use-graph-first.sh +65 -0
- package/assets/skills/contract-driven-delivery/scripts/validate_api_conformance.py +671 -0
- package/assets/skills/contract-driven-delivery/scripts/validate_api_semantic.py +8 -1
- package/assets/skills/contract-driven-delivery/scripts/validate_contract_versions.py +4 -0
- package/dist/cli/index.js +2118 -491
- package/docs/adr/0001-contract-to-openapi-export.md +142 -0
- package/docs/adr/0002-schema-carrying-contract-format.md +277 -0
- package/docs/adr/0003-code-intelligence-indexing-strategy.md +110 -0
- package/docs/api-conformance.md +145 -0
- package/docs/openapi-export.md +157 -0
- package/package.json +1 -1
|
@@ -45,6 +45,8 @@ def find_endpoint_table(lines: list[str]) -> list[tuple[int, str]]:
|
|
|
45
45
|
Find all data rows across ALL '| method |' tables in the document.
|
|
46
46
|
Blank lines and prose between rows do not end collection, making this
|
|
47
47
|
robust to files where content is appended after the original table block.
|
|
48
|
+
A new markdown heading does end the active table so ADR 0002 schema field
|
|
49
|
+
tables under `## Schemas` are not misread as endpoint rows.
|
|
48
50
|
"""
|
|
49
51
|
in_table = False
|
|
50
52
|
sep_seen = False
|
|
@@ -53,6 +55,11 @@ def find_endpoint_table(lines: list[str]) -> list[tuple[int, str]]:
|
|
|
53
55
|
for i, line in enumerate(lines):
|
|
54
56
|
stripped = line.strip()
|
|
55
57
|
|
|
58
|
+
if re.match(r'^#{2,}\s+', stripped):
|
|
59
|
+
in_table = False
|
|
60
|
+
sep_seen = False
|
|
61
|
+
continue
|
|
62
|
+
|
|
56
63
|
if not stripped:
|
|
57
64
|
continue # blank lines never end table mode
|
|
58
65
|
|
|
@@ -66,7 +73,7 @@ def find_endpoint_table(lines: list[str]) -> list[tuple[int, str]]:
|
|
|
66
73
|
continue
|
|
67
74
|
|
|
68
75
|
# A header row for an endpoint table
|
|
69
|
-
if cells[0].lower() == 'method':
|
|
76
|
+
if cells[0].lower() == 'method' and len(cells) > 1 and cells[1].lower() == 'path':
|
|
70
77
|
in_table = True
|
|
71
78
|
sep_seen = False
|
|
72
79
|
continue # skip header row
|
|
@@ -132,6 +132,8 @@ def git_available(root: Path) -> bool:
|
|
|
132
132
|
['git', 'rev-parse', '--git-dir'],
|
|
133
133
|
capture_output=True,
|
|
134
134
|
text=True,
|
|
135
|
+
encoding='utf-8',
|
|
136
|
+
errors='replace',
|
|
135
137
|
cwd=str(root),
|
|
136
138
|
)
|
|
137
139
|
return r.returncode == 0
|
|
@@ -150,6 +152,8 @@ def git_show_head(root: Path, rel_path: str) -> str | None:
|
|
|
150
152
|
['git', 'show', f'HEAD:{rel_path}'],
|
|
151
153
|
capture_output=True,
|
|
152
154
|
text=True,
|
|
155
|
+
encoding='utf-8',
|
|
156
|
+
errors='replace',
|
|
153
157
|
cwd=str(root),
|
|
154
158
|
)
|
|
155
159
|
if r.returncode == 0:
|