fix(iam): codify bare "AlphaEngine" namespace on executor cloudwatch-metrics#192
Merged
Merged
Conversation
…metrics The IAM Drift Check workflow has failed on every run since 2026-05-17 (content drift: alpha-engine-executor-role/alpha-engine-cloudwatch-metrics). Root cause: the live policy's PutAlphaEngineMetrics StringLike condition was widened out-of-band during the 2026-05-16 Saturday SF cascade recovery to allow both "AlphaEngine" and "AlphaEngine/*" cloudwatch:namespace values, but the "codify" half never landed for this policy — the repo JSON still constrained to "AlphaEngine/*" only. The widening is functionally required: emit-heartbeat.sh (executor EC2, assumes alpha-engine-executor-role) and the predictor/data/backtester spot scripts all PutMetricData to the bare "AlphaEngine" namespace, which the StringLike "AlphaEngine/*" does NOT match (no slash). Reverting live would deny heartbeat emission and trip the dead-man's-switch alarms, so the correct direction is to codify live state, not revert it. Verified: check-drift.py exit 0 (full + scoped) against live AWS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Problem
IAM Drift Checkhas failed on every run since 2026-05-17 (5/17 and 5/18, SHAb243444). 5/16 was the last green run.Root cause
The codified JSON was unchanged between the last-green SHA and the failing SHA — the drift was introduced on the live AWS side. The live
PutAlphaEngineMetricsStringLike condition was widened out-of-band (during the 2026-05-16 Saturday SF cascade recovery) to:but the repo JSON still constrained to
"AlphaEngine/*"only. The "fixed+codified" CloudWatch IAM work that session codified the other statement (the substrate-check read grant, #145) but not this namespace widening.Why codify live, not revert it
The bare
AlphaEnginenamespace is in active, required use:alpha-engine/infrastructure/emit-heartbeat.sh:22— runs on the executor EC2 trading instance (assumesalpha-engine-executor-role)spot_train.sh, dataspot_data_weekly.sh/spot_drift_detection.sh/RAG, backtesterspot_backtest.shheartbeatsStringLike
AlphaEngine/*does not match the bare stringAlphaEngine(no/). Reverting the live policy would deny thosePutMetricDataheartbeat calls and trip the dead-man's-switch CloudWatch alarms. Correct direction: codify live state.Change
Add
"AlphaEngine"alongside"AlphaEngine/*"in the codifiedalpha-engine-cloudwatch-metricspolicy. Pure codification — no live IAM change.Verification
infrastructure/iam/check-drift.py(full +--role alpha-engine-executor-role) → exit 0 against live AWS.🤖 Generated with Claude Code