Milestone 288 — pattern library + forge integration #111

Merged
bvandeusen merged 10 commits from dev into main 2026-08-16 16:37:12 -04:00
Showing only changes of commit eb760eb440 - Show all commits
+7 -2
View File
@@ -1049,13 +1049,18 @@ async def attach_live_body(note, data: dict) -> None:
data["body_source"] = "forge"
data["body_freshness"] = "current"
if fetched.commit_sha:
# Read the stored stamp BEFORE writing the fresh one into the
# response: `fields` aliases data["snippet"], so the other order
# makes the staleness check compare the new stamp to itself and
# the persist never fires (caught by the unit test, run 3811).
stored_prov = fields.get("provenance") or {}
stale = stored_prov.get("commit_sha") != fetched.commit_sha
prov = compose_provenance(commit_sha=fetched.commit_sha)
# Reflected in THIS response as well as persisted — the reader
# shouldn't need a second pull to see the stamp they caused.
if isinstance(data.get("snippet"), dict):
data["snippet"]["provenance"] = prov
stored_prov = fields.get("provenance") or {}
if stored_prov.get("commit_sha") != fetched.commit_sha:
if stale:
spawn(
_refresh_provenance(note, fetched.commit_sha),
site="pull provenance-refresh",