fix(workers): single-source contract version for the v3 result envelope (ADR 0113 V5) #1263
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/v3-contract-version-stamps"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes the failure of the first live G4 run (job
8ae71e61, 2026-10-16): Core rejected thesemisupervised-v3result submission with400 clusteringContractVersion mismatch: expected 2, got 1.Root cause: two stamp sites, two truths. The per-candidate
_stampedhelper derived the contract version from the method (v3→2), but the result-ENVELOPE stamp inmain.pyhardcodedSEMISUPERVISED_CONTRACT_VERSION(=1) for every single-pass method. The v3 worker suite pinned candidate stamps and the job-settings validation but never the envelope stamp — exactly the gap.Fix:
clustering.py: newcontract_version_for_method()as the single source of truth (v1/v2→1, v3→2, unknown→1 = pre-0113 default so a future method that forgets to extend the map degrades to the old contract, never invents a new one);_stampeduses it.main.py: envelope stamp uses the same helper.KNOWN_ISSUES.md: ISSUE-164 (resolved).Test plan
PYTHONPATH=workers/people/src .venv/bin/python -m pytest workers/people/tests/ -q→ 362 passed, 1 skipped (pre-existing heif), 99 subtests — v1/v2/v3 + registry + prototype suites all green.semisupervised-v3).