Skip to content

Commit ac74658

Browse files
committed
debug: add diff output to contract artifact check
1 parent d4d654d commit ac74658

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

docs/architecture/contract_manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
"classification": "supporting",
174174
"relativePath": "docs/architecture/release_bundle_manifest.json",
175175
"role": "whole release bundle hash inventory",
176-
"sha256": "6cccab8d4842f984b1672af653944df7e3eff2be4ce025817cffa334d2589c54"
176+
"sha256": "e6e4094692e270173cb2392cc876050e1c2c4c9d29672119223c75da1252c51a"
177177
},
178178
{
179179
"classification": "supporting",
@@ -257,7 +257,7 @@
257257
"classification": "supporting",
258258
"relativePath": "scripts/generate_contract_artifacts.py",
259259
"role": "contract artifact generator",
260-
"sha256": "c5e16e58a9c65b8e3fdb0c064dc39467f5578ca848962a998128ae65c5f2c506"
260+
"sha256": "6d572e5bd4702d74513ff8017e42b1600caa2f1c9717397126cf5b3cf053d322"
261261
},
262262
{
263263
"classification": "supporting",

docs/architecture/release_bundle_manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"bundleSha256": "4049a0b990999deb17edc28e64ccff0a846afa9fcabe3c1b1f98f3c3e0f0e1ed",
2+
"bundleSha256": "c7ed98f8479f43e4db1bc88deeb1deab9c60ffeda7dc73ad6e356e19e9c70623",
33
"contractVersion": "pbpk-mcp.v1",
44
"fileCount": 612,
55
"files": [
@@ -2202,8 +2202,8 @@
22022202
{
22032203
"group": "operations",
22042204
"relativePath": "scripts/generate_contract_artifacts.py",
2205-
"sha256": "c5e16e58a9c65b8e3fdb0c064dc39467f5578ca848962a998128ae65c5f2c506",
2206-
"sizeBytes": 16310
2205+
"sha256": "6d572e5bd4702d74513ff8017e42b1600caa2f1c9717397126cf5b3cf053d322",
2206+
"sizeBytes": 16955
22072207
},
22082208
{
22092209
"group": "operations",
@@ -3721,5 +3721,5 @@
37213721
],
37223722
"mode": "staged-source-tree-equivalent"
37233723
},
3724-
"totalBytes": 12048815
3724+
"totalBytes": 12049460
37253725
}

scripts/generate_contract_artifacts.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,16 @@ def _check_file(path: Path, expected: str) -> bool:
434434
current = path.read_text(encoding="utf-8")
435435
if current != expected:
436436
print(f"Generated file is out of date: {path}", file=sys.stderr)
437+
print(f" Expected length: {len(expected)}, actual length: {len(current)}", file=sys.stderr)
438+
for i, (e, a) in enumerate(zip(expected, current)):
439+
if e != a:
440+
print(f" First diff at byte {i}: expected {e!r}, got {a!r}", file=sys.stderr)
441+
print(f" Expected context: {expected[max(0,i-20):i+20]!r}", file=sys.stderr)
442+
print(f" Actual context: {current[max(0,i-20):i+20]!r}", file=sys.stderr)
443+
break
444+
else:
445+
if len(expected) != len(current):
446+
print(f" One file is a prefix of the other (length mismatch)", file=sys.stderr)
437447
return False
438448
return True
439449

src/mcp_bridge/contract/artifacts.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@
296296
"classification": "supporting",
297297
"relativePath": "docs/architecture/release_bundle_manifest.json",
298298
"role": "whole release bundle hash inventory",
299-
"sha256": "6cccab8d4842f984b1672af653944df7e3eff2be4ce025817cffa334d2589c54"
299+
"sha256": "e6e4094692e270173cb2392cc876050e1c2c4c9d29672119223c75da1252c51a"
300300
},
301301
{
302302
"classification": "supporting",
@@ -380,7 +380,7 @@
380380
"classification": "supporting",
381381
"relativePath": "scripts/generate_contract_artifacts.py",
382382
"role": "contract artifact generator",
383-
"sha256": "c5e16e58a9c65b8e3fdb0c064dc39467f5578ca848962a998128ae65c5f2c506"
383+
"sha256": "6d572e5bd4702d74513ff8017e42b1600caa2f1c9717397126cf5b3cf053d322"
384384
},
385385
{
386386
"classification": "supporting",
@@ -442,7 +442,7 @@
442442

443443
_RELEASE_BUNDLE_MANIFEST_JSON = r"""
444444
{
445-
"bundleSha256": "4049a0b990999deb17edc28e64ccff0a846afa9fcabe3c1b1f98f3c3e0f0e1ed",
445+
"bundleSha256": "c7ed98f8479f43e4db1bc88deeb1deab9c60ffeda7dc73ad6e356e19e9c70623",
446446
"contractVersion": "pbpk-mcp.v1",
447447
"fileCount": 612,
448448
"files": [
@@ -2645,8 +2645,8 @@
26452645
{
26462646
"group": "operations",
26472647
"relativePath": "scripts/generate_contract_artifacts.py",
2648-
"sha256": "c5e16e58a9c65b8e3fdb0c064dc39467f5578ca848962a998128ae65c5f2c506",
2649-
"sizeBytes": 16310
2648+
"sha256": "6d572e5bd4702d74513ff8017e42b1600caa2f1c9717397126cf5b3cf053d322",
2649+
"sizeBytes": 16955
26502650
},
26512651
{
26522652
"group": "operations",
@@ -4164,7 +4164,7 @@
41644164
],
41654165
"mode": "staged-source-tree-equivalent"
41664166
},
4167-
"totalBytes": 12048815
4167+
"totalBytes": 12049460
41684168
}
41694169
"""
41704170

0 commit comments

Comments
 (0)