Skip to content

feat(sync-submission): add v_(N+1) docx regeneration gate (Phase 7)#28

Merged
Yoojin-nam merged 1 commit into
mainfrom
feat/tier1-PR3-vN-docx-md5-assertion
May 23, 2026
Merged

feat(sync-submission): add v_(N+1) docx regeneration gate (Phase 7)#28
Yoojin-nam merged 1 commit into
mainfrom
feat/tier1-PR3-vN-docx-md5-assertion

Conversation

@Yoojin-nam
Copy link
Copy Markdown
Contributor

@Yoojin-nam Yoojin-nam commented May 23, 2026

PR T1-3: v_(N+1) docx MD5 ≠ v_N docx assertion

Title: feat(sync-submission): add v_(N+1) docx regeneration gate (Phase 7)

Summary

Extends scripts/verify_package_integrity.py with an
--assert-vN-docx-changed mode that compares two docx files by MD5 and
exits non-zero when they are byte-identical. Documents the gate in
/sync-submission SKILL.md as Phase 7.

Motivation

Cross-project precedent (anonymized): an outcome-MA submission package
at v_(N+1) shipped with a v_(N+1) markdown body change (two-paragraph
edit) but the v_(N+1) docx in the submission folder was byte-identical
to the v_N docx — a silent cp over the v_N seed that never went
through the pandoc / Zotero CWYW regeneration step.

When uploaded to the EM portal, the markdown changes would have silently
reverted at peer review. P0 active submission blocker.

This gate adds defense-in-depth: even if the upstream regeneration
pipeline appears to have run, the byte-identity check catches the case
where it didn't.

Changes

  • scripts/verify_package_integrity.py:
    • new md5_file() helper
    • new assert_vN_docx_changed() function with explanatory FAIL message
    • new --assert-vN-docx-changed mode + --vN-docx / --new-docx
      arguments (mutually exclusive with --record / --verify)
    • module docstring updated to document third mode
  • skills/sync-submission/SKILL.md: Gate 10 + Phase 7 narrative.
  • skills/sync-submission/tests/test_vN_docx_assertion.sh — 4 cases
    (identical / different / missing v_N / missing --new-docx arg).

Test plan

  • bash skills/sync-submission/tests/test_vN_docx_assertion.sh — 4/4 PASS
  • bash scripts/validate_skills.sh
  • Companion check at v_(N+1) build time via PR T1-4
    (check_xref.py --vN-docx-md5).

Related

  • /manage-refs (PR T1-4 adds the build-time companion)
  • /revise (revision-round rebuilds invoke this gate)

🤖 Generated with Claude Code


Pairs with: T1-4 (#29) for defense-in-depth v_(N+1) docx regeneration.

Extends scripts/verify_package_integrity.py with --assert-vN-docx-changed
mode. Asserts that v_(N+1) docx MD5 differs from v_N docx MD5; identical
bytes = unmodified seed copy = block submission.

Motivation: silent v_N → v_(N+1) docx copies (without regeneration via
pandoc citeproc or Zotero CWYW field-code re-patch) cause markdown body
edits to silently revert at portal peer review. Defense-in-depth gate.

Adds Gate 10 + Phase 7 narrative to /sync-submission SKILL.md. Synthetic
fixture tests cover identical/different/missing-v_N/missing-arg cases —
all 4 pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Yoojin-nam Yoojin-nam merged commit bf0d620 into main May 23, 2026
1 check passed
@Yoojin-nam Yoojin-nam deleted the feat/tier1-PR3-vN-docx-md5-assertion branch May 23, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant