test(artifact-registry-coverage): Phase 4 PR 4 — ae-data producer-side CI guard#336
Merged
Merged
Conversation
…e CI guard Phase 4 of the artifact-freshness-monitor arc (plan doc: ~/Development/alpha-engine-docs/private/artifact-freshness-monitor-260527.md). PR 4 of the 4-PR cascade across ae-data / ae-research / ae-predictor / ae-backtester. Mirrors the tests/test_schema_contract.py::_GRANDFATHERED_BARE_FIELDS precedent — force operator attention at every new producer addition so the absence-of-artifact bug class can't slip through new code without an explicit register-or-grandfather decision. What this catches: a new s3.put_object(...) or s3.upload_file(...) in ae-data production code that hasn't been registered in alpha-engine-config/private-docs/ARTIFACT_REGISTRY.yaml (or explicitly grandfathered). The producer chokepoint at PR time means the silent absence-of-artifact bug class (e.g., 2026-05-17→27 pit_parity.json) can't reach production without the operator first deciding whether the artifact is load-bearing enough to warrant an SLA. Design choice — per-file PUT-site count rather than per-key-template extraction. Statically extracting key templates from arbitrary f-string put_object(Key=...) calls is fragile (keys are often constructed from surrounding context). Per-file count is stable across refactors and sufficient to force operator review at every new addition. The operator is the source of truth for "which key does this PUT emit"; the test's job is to ensure the operator can't sleepwalk past adding one without thinking. Three tests: - test_every_producer_file_is_pinned — new file with a PUT site fails the test with a clear resolution path. - test_every_pinned_file_still_exists — file removed without bumping the pin fails (stale-pin detection). - test_pinned_counts_match_actual — PUT-site count drift in an existing file fails (the typical add-a-new-PUT case). Initial pin: 44 PUT sites across 29 files in ae-data production code as of 2026-05-27. Sister coverage: - alpha-engine-config/scripts/validate_artifact_registry.py — PR-time SoT schema validator (registry side). - infrastructure/lambdas/freshness-monitor/index.py::load_registry — Lambda-runtime registry parse + spec validation (deploy side). PRs 5-7 (ae-research / ae-predictor / ae-backtester) mirror this pattern in a follow-up session per the plan §8 estimate (~2 sessions for PRs 4-7). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase 4 of the artifact-freshness-monitor arc (plan doc at
~/Development/alpha-engine-docs/private/artifact-freshness-monitor-260527.md; ROADMAP P1 entry in alpha-engine-config #342 / #344). PR 4 of the 4-PR cascade across ae-data / ae-research / ae-predictor / ae-backtester. Mirrors thetests/test_schema_contract.py::_GRANDFATHERED_BARE_FIELDSprecedent — force operator attention at every new producer addition so the absence-of-artifact bug class can't slip through new code without an explicit register-or-grandfather decision.PRs 5-7 (ae-research / ae-predictor / ae-backtester) mirror this pattern in a follow-up session per the plan §8 estimate (~2 sessions for PRs 4-7).
Depends on:
Changes
tests/test_artifact_registry_coverage.py(new):_enumerate_put_sites()—git grepfor everys3.put_object(/s3.upload_file(literal in ae-data production code (excludestests/,infrastructure/lambdas/,.claude/,.venv/,build/).EXPECTED_PER_FILE_PUT_COUNTS— hand-curated pin of 44 PUT sites across 29 files as of 2026-05-27. Bumped on every legitimate PUT-site change.test_every_producer_file_is_pinned— new file with a PUT site fails with a clear resolution path (register in ae-config registry → bump the pinned set).test_every_pinned_file_still_exists— file removed without bumping the pin fails (stale-pin detection).test_pinned_counts_match_actual— PUT-site count drift in an existing file fails (the typical add-a-new-PUT case).Design choice — per-file count rather than per-key-template extraction
Statically extracting key templates from arbitrary f-string
put_object(Key=...)calls is fragile (keys are often constructed from surrounding context: loop variables, function args, config values). Per-file count is stable across refactors and sufficient to force operator review at every new addition. The operator is the source of truth for "which key does this PUT emit"; the test's job is to ensure the operator can't sleepwalk past adding one without thinking.This is the lighter-touch alternative to the plan's "per-key extraction + match against registered prefix" specification. Bias toward chokepoint robustness — the test should be noisy in the right way, never silent in the wrong way.
Sister coverage
scripts/validate_artifact_registry.py— PR-time SoT schema validator (registry side).infrastructure/lambdas/freshness-monitor/index.py::load_registry— Lambda-runtime registry parse + spec validation (deploy side).Test plan
pytest tests/test_artifact_registry_coverage.py -v— 3 passings3.put_object(...)line to any existing producer file → test fails with the operator-resolution messageput_objectcall →test_every_producer_file_is_pinnedfailsComposes with
[[feedback_lift_invariants_to_chokepoint_after_second_recurrence]]— this IS the chokepoint cascade for the absence-of-artifact bug class.[[feedback_no_silent_fails]]— operationalized at PR time for new producers.[[feedback_sota_institutional_default_no_shortcuts]]— operator-attention chokepoint over heuristic key extraction.🤖 Generated with Claude Code