@@ -253,11 +253,10 @@ def _version_from_ref(git_ref: str | None = None) -> str:
253253 "type" : "array" ,
254254 "items" : {
255255 "type" : "object" ,
256- "required" : ["name" , "since" ],
256+ "required" : ["name" ],
257257 "properties" : {
258258 "name" : {"type" : "string" },
259259 "description" : {"type" : "string" },
260- "since" : {"type" : "string" },
261260 "sha256" : {"type" : "string" },
262261 },
263262 },
@@ -288,7 +287,7 @@ def _read_manifest(store: Store, version: str) -> dict | None:
288287 # Upgrade legacy format: flat list of filenames -> new object format.
289288 if isinstance (manifest .get ("fixtures" ), list ) and manifest ["fixtures" ] and isinstance (manifest ["fixtures" ][0 ], str ):
290289 _info (f" upgrading legacy manifest format for v{ version } " )
291- manifest ["fixtures" ] = [{"name" : n , "description" : "" , "since " : version } for n in manifest ["fixtures" ]]
290+ manifest ["fixtures" ] = [{"name" : n , "description" : "" , "sha256 " : "" } for n in manifest ["fixtures" ]]
292291
293292 _validate_manifest (manifest , version )
294293 # Stash the prefix so callers know where to fetch fixture files.
@@ -298,26 +297,22 @@ def _read_manifest(store: Store, version: str) -> dict | None:
298297
299298def _merge_manifest (
300299 store : Store , fixtures_json : dict , version : str , prev_version : str | None ,
301- output : Path ,
302300) -> dict :
303- """Build a manifest for `version`, carrying forward `since` from prev_version ."""
301+ """Build a manifest for `version`, using sha256 from Rust-generated fixtures.json ."""
304302 entries = []
305- prev_since : dict [str , str ] = {}
303+ prev_names : set [str ] = set ()
306304
307305 if prev_version :
308306 prev_manifest = _read_manifest (store , prev_version )
309307 if prev_manifest :
310- prev_since = {e ["name" ]: e [ "since " ] for e in prev_manifest ["fixtures" ]}
308+ prev_names = {e ["name" ] for e in prev_manifest ["fixtures" ]}
311309
312310 for f in fixtures_json ["fixtures" ]:
313- name = f ["name" ]
314- since = prev_since .get (name , version )
315- sha = hashlib .sha256 ((output / name ).read_bytes ()).hexdigest ()
316- entries .append ({"name" : name , "description" : f ["description" ], "since" : since , "sha256" : sha })
311+ entries .append ({"name" : f ["name" ], "description" : f ["description" ], "sha256" : f ["sha256" ]})
317312
318313 # Additive-only enforcement.
319314 current_names = {e ["name" ] for e in entries }
320- missing = [n for n in prev_since if n not in current_names ]
315+ missing = [n for n in prev_names if n not in current_names ]
321316 if missing :
322317 print (
323318 f"error: fixtures removed since v{ prev_version } : { ', ' .join (missing )} " ,
@@ -345,12 +340,11 @@ def cmd_generate(args: argparse.Namespace) -> None:
345340
346341 _run_rust_generate (output )
347342
348- # Read fixtures.json and write a versioned manifest.
343+ # Read fixtures.json (with sha256 from Rust) and write a versioned manifest.
349344 fixtures_json = json .loads ((output / "fixtures.json" ).read_text ())
350345 entries = []
351346 for f in fixtures_json ["fixtures" ]:
352- sha = hashlib .sha256 ((output / f ["name" ]).read_bytes ()).hexdigest ()
353- entries .append ({"name" : f ["name" ], "description" : f ["description" ], "since" : version , "sha256" : sha })
347+ entries .append ({"name" : f ["name" ], "description" : f ["description" ], "sha256" : f ["sha256" ]})
354348 manifest = {
355349 "version" : version ,
356350 "generated_at" : datetime .now (timezone .utc ).isoformat (),
@@ -398,7 +392,7 @@ def _publish_full(
398392 if prev :
399393 _info (f"previous version: { prev } " )
400394
401- manifest = _merge_manifest (store , fixtures_json , version , prev , output )
395+ manifest = _merge_manifest (store , fixtures_json , version , prev )
402396 manifest_json = json .dumps (manifest , indent = 2 ) + "\n "
403397
404398 if args .dry_run :
@@ -541,8 +535,7 @@ def _publish_update(
541535 new_entries = existing_manifest ["fixtures" ][:]
542536 for f in fixtures_json ["fixtures" ]:
543537 if f ["name" ] in new_fixture_names :
544- sha = hashlib .sha256 ((output / f ["name" ]).read_bytes ()).hexdigest ()
545- new_entries .append ({"name" : f ["name" ], "description" : f ["description" ], "since" : version , "sha256" : sha })
538+ new_entries .append ({"name" : f ["name" ], "description" : f ["description" ], "sha256" : f ["sha256" ]})
546539
547540 updated_manifest = {
548541 "version" : version ,
0 commit comments