loopx icon indicating copy to clipboard operation
loopx copied to clipboard

[Bug]: main's Python digest-owner guard fails - goal_source.py and checkpoint_retention.py restate the bare SHA-256 shape

Open JasonBuildAI opened this issue 1 month ago • 0 comments

LoopX version or commit: main dc9fdbb51 (offending surfaces merged by PR #6827 6e8b4b1a06 and PR #6785 c56a3b14ea)

Host or runtime surface: Not host-specific

Area: Build, packaging, installer, or CI (required-check regression in Python Tests)

Problem

The required Python Tests workflow is red on the current main head because the Python twin of the digest-owner guard fails deterministically:

FAILED tests/architecture/test_content_digest_single_owner.py::test_only_the_owner_module_states_a_whole_value_digest_shape
AssertionError: second owner(s) of the digest shape:
{'loopx/control_plane/status/goal_source.py': [{'line': 88, ...}, {'line': 122, ...}, {'line': 321, ...}],
 'loopx/hosts/checkpoint_retention.py': [{'line': 23, ...}]}

Two recently merged surfaces state the whole-value bare SHA-256 shape themselves instead of reading it from the single owner loopx/control_plane/content_digest.py (BARE_SHA256_PATTERN):

  • loopx/control_plane/status/goal_source.py:88,122,321 - re.fullmatch(r"[0-9a-f]{64}", ...) for a pinned container id (both the dataclass constructor and the manifest parser) and for the source-identity namespace (added with 6e8b4b1a06, PR #6827);
  • loopx/hosts/checkpoint_retention.py:23 - _SHA = re.compile(r"[0-9a-f]{64}\Z"), used at line 140 to validate rotation-point digests (added with c56a3b14ea, PR #6785).

Impact

  • Python Tests is a required check and it fails on the current main head: run 39172287050 - test-shard (1) (job 117808033842) fails with the assertion above, and the aggregate pytest and merge-gate jobs fail with it. Every pull request based on current main inherits a failing required check it did not cause; 37 PRs are open against main right now.
  • This is the second occurrence of the same class. Issue #6117 (closed) reported the TypeScript twin: tests/control_plane_ts/content_digest_single_owner.test.ts failed because progress_review_evidence.ts restated /^[a-f0-9]{64}$/. The class recurs because new surfaces keep spelling the shape instead of importing the owner, and both new surfaces here are on paths that ship in the release.
  • The guard exists so one module decides what a stored SHA-256 looks like. With these surfaces the tree now holds two spellings of that one decision (re.fullmatch on the text versus a compiled \Z pattern), which is exactly the drift the guard is designed to catch before it becomes a data-format difference.

Minimal reproduction

git checkout dc9fdbb51
uv sync --extra test
uv run --extra test python -m pytest -q tests/architecture/test_content_digest_single_owner.py \
  -k test_only_the_owner_module_states_a_whole_value_digest_shape

Observed on the current main head: 1 failed, listing exactly the four sites above. Removing the two modules from the tree (they did not exist before their introducing pull requests) makes the same command pass as 1 passed, so these sites are the only cause of the guard failure.

Expected behavior

The four sites validate through BARE_SHA256_PATTERN from loopx.control_plane.content_digest, both modules are added to the guard's pinned CONSUMER_MODULES (the guard's designed review event for a new reader of the owner), and the guard passes again.

Actual behavior

main stays red for the required Python Tests check until each new surface reuses the owner or is deferred by review.

Additional context

  • Same-class precedent: #6117 (TypeScript twin, repaired by reusing the owner and pinning the module in the guard's consumer list).
  • The guard's layer-4 parity corpus already proves that the spellings being retired here (re.fullmatch on the text; compiled \Z plus .fullmatch) split exactly the same strings as the owner pattern, including the trailing-newline probe, so the substitution is behaviour-preserving by the guard's own oracle.
  • I reproduced this on main and will open the repair as a pull request that closes this report.

JasonBuildAI avatar Oct 19 '26 02:10 JasonBuildAI