fix(F17): a PDF in a folder is not proof the package can be rebuilt

Build sweep run this session: 48 sources, 46 built, 2 failed. Infineon_AI_Engineer's
cover letter fails on font expansion (the font is not scalable); cv_template.tex
fails on unfilled placeholders, which is expected for the academic legacy path.
Overfull boxes: Microsoft ISE 25.33pt, Isovalent 0.88pt. All historical, all
left alone.

New: resume_builder/helpers/package_manifest.py records, per application
package, what a rebuild would ACTUALLY do - sources, class-file hashes, PDFs
present, and the reasons a rebuild would not reproduce the submitted document.
It is descriptive; nothing in it authorises rewriting a submitted file.

What it found across 21 packages:
- 17 are DATE-DEPENDENT. The cover letters use 	oday, so recompiling a
  historical package silently restamps it with today's date.
- 1 has an INCOMPLETE SOURCE DISTRIBUTION: output/NATO_AI_ENGINEER ships no
  resume.cls. It builds on this machine only because a copy exists elsewhere,
  and the shipped PDF hid that. Not repaired by copying the newest class in -
  the repo carries THREE different resume.cls variants (13/7/1 copies) and older
  macros differ, so that "fix" could silently change a historical document.
- 1 has no PDF at all, so nothing is reviewable without a build.

Classification: 7 application packages were in no reuse category. Added to
historical_revalidate, and the register now records the default explicitly -
anything unlisted is treated as revalidate-before-reuse. Being recent is not the
same as being verified; none of the seven was re-read for this.

Prevention rather than repair: 	oday removed from the cover-letter template so
new packages stop adding to the pile. A test now fails if it comes back, if the
manifest goes stale, or if a package is left unclassified.

Also: scan_document gained a template mode. A placeholder in a TEMPLATE is what
makes it a template; the defect is one surviving into a generated document.

37/37 tests pass; counter-proof still catches all 9.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qej5SBvhcbGXHwLqNWiskM
This commit is contained in:
dennisthiessenandClaude Opus 5 committed 2026-09-11 20:48:52 +02:00
1 parent c7e8d4e058
commit eecdbdade6
7 files changed
+797 -24

No files matched your search

+30 -1
View File
@@ -2,6 +2,7 @@ from __future__ import annotations
import importlib.util
import json
import sys
import re
import unittest
from pathlib import Path
@@ -62,7 +63,35 @@ class CanonicalSystemTests(unittest.TestCase):
"resume_builder/templates/resume_template.tex",
"resume_builder/templates/coverletter_template.tex",
):
self.assertEqual([], validator.scan_document(ROOT / relative, self.claims), relative)
self.assertEqual([], validator.scan_document(ROOT / relative, self.claims, template=True), relative)
class PackageReproducibilityTests(unittest.TestCase):
"""F17: a PDF in a folder is not evidence that the package can be rebuilt."""
def test_manifest_is_current(self):
import subprocess
result = subprocess.run(
[sys.executable, str(ROOT / "resume_builder" / "helpers" / "package_manifest.py"),
"--check"], capture_output=True, text=True)
self.assertEqual(0, result.returncode, result.stdout + result.stderr)
def test_cover_letter_template_does_not_use_today(self):
# \today makes a rebuild date-dependent: recompiling a historical letter
# silently restamps it with the current date.
template = (ROOT / "resume_builder" / "templates" / "coverletter_template.tex").read_text(
encoding="utf-8")
body = "\n".join(
line for line in template.splitlines() if not line.strip().startswith("%"))
self.assertNotIn("\\today", body)
def test_every_application_package_is_classified_for_reuse(self):
manifest = json.loads(
(ROOT / "resume_builder" / "canonical" / "package_manifest.json").read_text(
encoding="utf-8"))
unclassified = [name for name, entry in manifest["packages"].items()
if entry["reuse_classification"] == "UNCLASSIFIED"]
self.assertEqual([], unclassified)
class WorkflowPolicyTests(unittest.TestCase):