Skip to content

fix(iam): codify bare "AlphaEngine" namespace on executor cloudwatch-metrics#192

Merged
cipher813 merged 1 commit into
mainfrom
fix/iam-codify-cloudwatch-bare-namespace
May 18, 2026
Merged

fix(iam): codify bare "AlphaEngine" namespace on executor cloudwatch-metrics#192
cipher813 merged 1 commit into
mainfrom
fix/iam-codify-cloudwatch-bare-namespace

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Problem

IAM Drift Check has failed on every run since 2026-05-17 (5/17 and 5/18, SHA b243444). 5/16 was the last green run.

IAM drift detected (1 finding(s)):
  - alpha-engine-executor-role/alpha-engine-cloudwatch-metrics: source document differs from AWS document (content drift)

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 PutAlphaEngineMetrics StringLike condition was widened out-of-band (during the 2026-05-16 Saturday SF cascade recovery) to:

"cloudwatch:namespace": ["AlphaEngine", "AlphaEngine/*"]

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 AlphaEngine namespace is in active, required use:

  • alpha-engine/infrastructure/emit-heartbeat.sh:22 — runs on the executor EC2 trading instance (assumes alpha-engine-executor-role)
  • predictor spot_train.sh, data spot_data_weekly.sh/spot_drift_detection.sh/RAG, backtester spot_backtest.sh heartbeats

StringLike AlphaEngine/* does not match the bare string AlphaEngine (no /). Reverting the live policy would deny those PutMetricData heartbeat calls and trip the dead-man's-switch CloudWatch alarms. Correct direction: codify live state.

Change

Add "AlphaEngine" alongside "AlphaEngine/*" in the codified alpha-engine-cloudwatch-metrics policy. 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

…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>
@cipher813 cipher813 merged commit 21119e9 into main May 18, 2026
3 checks passed
@cipher813 cipher813 deleted the fix/iam-codify-cloudwatch-bare-namespace branch May 18, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant