SpireLens rename: post-rename Azure cleanup + relic-tracking follow-up #72

Closed
opened 2026-04-24 18:43:03 -07:00 by nelsong6 · 1 comment
nelsong6 commented 2026-04-24 18:43:03 -07:00 (Migrated from github.com)

Tracking issue for picking up where we left off after the CardUtilityStats → SpireLens rename session on 2026-04-24.

✅ Done (this session)

  • PR #69 merged (squash → 1f86c77 on main): full mechanical rename (CardUtilityStats → SpireLens + lowercase variants), 18 file/dir renames, deleted infra/opentofu/azure-vmss/ (7 files), deleted infra/ansible/ (8 files), deleted 4 dead workflows (ansible-validate, bootstrap-azure-builder-ansible, bootstrap-azure-builder-winrm, deploy-aks-ansible-control-runner), deleted 2 dead docs, deleted 2 dead ops scripts. Kept ops/windows-worker/Register-LocalIssueAgentRunner.ps1 (active laptop-runner registration).
  • GitHub repo renamed nelsong6/card-utility-stats → nelsong6/spirelens. Both self-hosted runners (issue-agent-NELSONPC, sts2-side-a) confirmed online post-rename.
  • Local checkout moved D:\repos\CardUtilityStats → D:\repos\spirelens, remote URL updated to https://github.com/nelsong6/spirelens.git, local main ref synced to 1f86c77.
  • Mod deployed and verified live: built SpireLens, mods/SpireLens/ populated (Loader + Core + manifest + Mono.Cecil), old mods/CardUtilityStats/ removed. Game restart shows [BaseLib] Applied 138 patches successfully, 0 failed, Loaded 3 mods (3 total), SpireLens Core + Loader init complete, 167 Harmony-patched methods.
  • Mod manifest id change to SpireLens (no migration code per design); orphaned save data at %APPDATA%/SlayTheSpire2/CardUtilityStats/ deleted.
  • PR #70 opened (fix/baselib-3.0.9 branch): bumps Alchyr.Sts2.BaseLib pin in SpireLens.csproj from 3.0.8 → 3.0.9. The build had silently regressed BaseLib to 3.0.8 because the csproj was hard-pinned; 3.0.8 still has the broken SelfApplyDebuffPatch against game v0.104.0. Manually copied 3.0.9 into mods/BaseLib/ to unblock the running game; PR is the durable fix so future builds don't regress.

🔄 Pending (blocked on az login)

All three of these need an authed Azure CLI session. One az login unblocks everything.

1. Federated identity credential update (highest priority — blocks all OIDC workflows)

The Entra app a9c457ac-128a-40a0-abc9-fd8214a8a462 (workflow var ARM_CLIENT_ID) has a federated identity credential whose subject is encoded against the old repo slug:

repo:nelsong6/card-utility-stats:ref:refs/heads/main

After the rename, workflow OIDC tokens present repo:nelsong6/spirelens:ref:refs/heads/main and Entra rejects them with AADSTS700213. Confirmed via the failed run of keyvault-secret-alias.yml (run 24903278120).

Fix: add a new federated credential (or update existing) covering the new slug. Add a corresponding entry for any other refs your OIDC-using workflows target — at minimum refs/heads/main, plus whatever pull-request / branch trigger patterns are in use.

az ad app federated-credential create \
  --id a9c457ac-128a-40a0-abc9-fd8214a8a462 \
  --parameters '{
    \"name\": \"spirelens-main\",
    \"issuer\": \"https://token.actions.githubusercontent.com\",
    \"subject\": \"repo:nelsong6/spirelens:ref:refs/heads/main\",
    \"audiences\": [\"api://AzureADTokenExchange\"]
  }'

(List existing first with az ad app federated-credential list --id a9c457ac-128a-40a0-abc9-fd8214a8a462 to see what other patterns to mirror.)

Until this is done, the issue-agent.yml workflow will fail at the Azure login step on every run.

2. Key Vault secret copy (card-utility-stats → spirelens)

The renamed issue-agent.yml reads secret spirelens from Key Vault romaine-kv. The current Key Vault still only has the old name card-utility-stats. After (1) is fixed, re-running the keyvault-secret-alias.yml workflow with these inputs handles it:

  • source_secret_name: card-utility-stats
  • target_secret_name: spirelens (default)
  • disable_source: false (leave the old name around for now in case any other system reads it)

Or do it manually via az:

SECRET=$(az keyvault secret show --vault-name romaine-kv --name card-utility-stats --query value -o tsv)
az keyvault secret set --vault-name romaine-kv --name spirelens --value \"$SECRET\"

3. Delete Azure RG rg-card-utility-stats-dev

The VMSS Terraform was deleted in PR #69, but the Azure resources it managed are still live (RG, gallery cardutilitystatsdevgallery, any VMSS instances). Small ongoing cost.

az resource list --resource-group rg-card-utility-stats-dev --output table   # safety check first
az group delete --name rg-card-utility-stats-dev --yes --no-wait

🔮 Next phase: broaden to relic tracking

After the rename is fully closed out, the next workstream is extending SpireLens beyond per-card to relic stats (the renaming was preparation for going broad). Decisions already made in the planning conversation:

  • Go broad — SpireLens covers card + relic + future surfaces, not just cards.
  • Motivation: the long-term goal is an informational system that can feed reinforcement learning, with the secondary motivation being run-spam-and-spot-patterns play-style support. The two motivations don't fight: existing aggregated-stats (UI) + event-log (RL-friendly) split is already correctly shaped.
  • First addition once the rename is closed: vanilla relic stats. Reference design: BSchneppe/relic-stats-sts2 which has a coverage table for 183/290 relics. No LICENSE file = all rights reserved — we can read for design inspiration (which relics, what stat per relic, hover-tooltip integration approach) but cannot copy code. Original implementation needed.
  • Coexistence: add a BaseLib-config toggle to disable SpireLens relic popups for users who keep the standalone RelicStats mod installed.
  • Out of scope for now: SlayTheStats overlap (pick-rate tracking) — different model from attribution, revisit when SpireLens has its own pick-rate features.

Highest-leverage RL addition while we're touching the event log

Capture decision-point state at each card-play event (hand, energy, enemy intents, current relics/potions/HP) — not just the outcome. Already-tracked outcomes + new state-before snapshot turn each event into a proper (s, a, r) triple. Invisible to the UI, unlocks imitation learning / offline RL on the run archive. Consider also: per-run JSONL on the event-log side so notebooks can pd.read_json(... lines=True) over runs/*.json without per-file ceremony.

Tracking issue for picking up where we left off after the CardUtilityStats → SpireLens rename session on 2026-04-24. ## ✅ Done (this session) - **PR #69 merged** (squash → 1f86c77 on main): full mechanical rename (`CardUtilityStats` → `SpireLens` + lowercase variants), 18 file/dir renames, deleted `infra/opentofu/azure-vmss/` (7 files), deleted `infra/ansible/` (8 files), deleted 4 dead workflows (ansible-validate, bootstrap-azure-builder-ansible, bootstrap-azure-builder-winrm, deploy-aks-ansible-control-runner), deleted 2 dead docs, deleted 2 dead ops scripts. Kept `ops/windows-worker/Register-LocalIssueAgentRunner.ps1` (active laptop-runner registration). - **GitHub repo renamed** `nelsong6/card-utility-stats` → `nelsong6/spirelens`. Both self-hosted runners (`issue-agent-NELSONPC`, `sts2-side-a`) confirmed online post-rename. - **Local checkout** moved `D:\repos\CardUtilityStats` → `D:\repos\spirelens`, remote URL updated to `https://github.com/nelsong6/spirelens.git`, local main ref synced to `1f86c77`. - **Mod deployed and verified live**: built SpireLens, `mods/SpireLens/` populated (Loader + Core + manifest + Mono.Cecil), old `mods/CardUtilityStats/` removed. Game restart shows `[BaseLib] Applied 138 patches successfully, 0 failed`, `Loaded 3 mods (3 total)`, SpireLens Core + Loader init complete, 167 Harmony-patched methods. - **Mod manifest `id` change** to `SpireLens` (no migration code per design); orphaned save data at `%APPDATA%/SlayTheSpire2/CardUtilityStats/` deleted. - **PR #70 opened** (`fix/baselib-3.0.9` branch): bumps `Alchyr.Sts2.BaseLib` pin in `SpireLens.csproj` from `3.0.8` → `3.0.9`. The build had silently regressed BaseLib to 3.0.8 because the csproj was hard-pinned; 3.0.8 still has the broken `SelfApplyDebuffPatch` against game v0.104.0. Manually copied 3.0.9 into `mods/BaseLib/` to unblock the running game; PR is the durable fix so future builds don't regress. ## 🔄 Pending (blocked on `az login`) All three of these need an authed Azure CLI session. One `az login` unblocks everything. ### 1. Federated identity credential update (highest priority — blocks all OIDC workflows) The Entra app `a9c457ac-128a-40a0-abc9-fd8214a8a462` (workflow var `ARM_CLIENT_ID`) has a federated identity credential whose `subject` is encoded against the old repo slug: ``` repo:nelsong6/card-utility-stats:ref:refs/heads/main ``` After the rename, workflow OIDC tokens present `repo:nelsong6/spirelens:ref:refs/heads/main` and Entra rejects them with `AADSTS700213`. Confirmed via the failed run of `keyvault-secret-alias.yml` ([run 24903278120](https://github.com/nelsong6/spirelens/actions/runs/24903278120)). **Fix:** add a new federated credential (or update existing) covering the new slug. Add a corresponding entry for any other refs your OIDC-using workflows target — at minimum `refs/heads/main`, plus whatever pull-request / branch trigger patterns are in use. ```bash az ad app federated-credential create \ --id a9c457ac-128a-40a0-abc9-fd8214a8a462 \ --parameters '{ \"name\": \"spirelens-main\", \"issuer\": \"https://token.actions.githubusercontent.com\", \"subject\": \"repo:nelsong6/spirelens:ref:refs/heads/main\", \"audiences\": [\"api://AzureADTokenExchange\"] }' ``` (List existing first with `az ad app federated-credential list --id a9c457ac-128a-40a0-abc9-fd8214a8a462` to see what other patterns to mirror.) Until this is done, **the `issue-agent.yml` workflow will fail at the Azure login step on every run.** ### 2. Key Vault secret copy (`card-utility-stats` → `spirelens`) The renamed `issue-agent.yml` reads secret `spirelens` from Key Vault `romaine-kv`. The current Key Vault still only has the old name `card-utility-stats`. After (1) is fixed, re-running the `keyvault-secret-alias.yml` workflow with these inputs handles it: - `source_secret_name`: `card-utility-stats` - `target_secret_name`: `spirelens` (default) - `disable_source`: `false` (leave the old name around for now in case any other system reads it) Or do it manually via `az`: ```bash SECRET=$(az keyvault secret show --vault-name romaine-kv --name card-utility-stats --query value -o tsv) az keyvault secret set --vault-name romaine-kv --name spirelens --value \"$SECRET\" ``` ### 3. Delete Azure RG `rg-card-utility-stats-dev` The VMSS Terraform was deleted in PR #69, but the Azure resources it managed are still live (RG, gallery `cardutilitystatsdevgallery`, any VMSS instances). Small ongoing cost. ```bash az resource list --resource-group rg-card-utility-stats-dev --output table # safety check first az group delete --name rg-card-utility-stats-dev --yes --no-wait ``` ## 🔮 Next phase: broaden to relic tracking After the rename is fully closed out, the next workstream is **extending SpireLens beyond per-card to relic stats** (the renaming was preparation for going broad). Decisions already made in the planning conversation: - **Go broad** — SpireLens covers card + relic + future surfaces, not just cards. - **Motivation:** the long-term goal is an informational system that can feed reinforcement learning, with the secondary motivation being run-spam-and-spot-patterns play-style support. The two motivations don't fight: existing aggregated-stats (UI) + event-log (RL-friendly) split is already correctly shaped. - **First addition once the rename is closed:** vanilla relic stats. Reference design: [`BSchneppe/relic-stats-sts2`](https://github.com/BSchneppe/relic-stats-sts2) which has a coverage table for 183/290 relics. **No LICENSE file** = all rights reserved — we can read for design inspiration (which relics, what stat per relic, hover-tooltip integration approach) but **cannot copy code**. Original implementation needed. - **Coexistence:** add a BaseLib-config toggle to disable SpireLens relic popups for users who keep the standalone RelicStats mod installed. - **Out of scope for now:** SlayTheStats overlap (pick-rate tracking) — different model from attribution, revisit when SpireLens has its own pick-rate features. ### Highest-leverage RL addition while we're touching the event log Capture **decision-point state** at each card-play event (hand, energy, enemy intents, current relics/potions/HP) — not just the outcome. Already-tracked outcomes + new state-before snapshot turn each event into a proper `(s, a, r)` triple. Invisible to the UI, unlocks imitation learning / offline RL on the run archive. Consider also: per-run JSONL on the event-log side so notebooks can `pd.read_json(... lines=True)` over `runs/*.json` without per-file ceremony. ## Quick links - Repo: https://github.com/nelsong6/spirelens - PR #69 (merged): https://github.com/nelsong6/spirelens/pull/69 - PR #70 (BaseLib pin): https://github.com/nelsong6/spirelens/pull/70 - Failed secret-alias run: https://github.com/nelsong6/spirelens/actions/runs/24903278120 - Local checkout: `D:\repos\spirelens` - Game install: `D:\SteamLibrary\steamapps\common\Slay the Spire 2\`
nelsong6 commented 2026-04-24 18:56:16 -07:00 (Migrated from github.com)

Closed out — final status

All blocked items completed (Azure CLI was authed in the new session, so no az login blocker).

✅ Done

  • KV secret aliased: spirelens created in romaine-kv with the same value as card-utility-stats (byte-equal, verified). Source secret kept enabled per the plan.
  • Federated credentials: card-utility-stats-github-actions-main and card-utility-stats-github-actions-pr were already migrated to repo:nelsong6/spirelens:... subjects (someone migrated them earlier in the session). The third credential, card-utility-stats-github-actions-prod, was unused (no remaining workflow uses environment: prod — that was tied to the deleted ansible/AKS workflows), so it was deleted rather than re-pointed.
  • RG rg-card-utility-stats-dev: az group delete --no-wait dispatched; currently in Deleting state. Contained 5 leftovers (vnet, NSG, public IP, NIC, orphaned OS disk — VM/VMSS already gone).
  • Bonus cleanup: dead .github/workflows/opentofu-azure-vmss.yml removed in #73 (merged as 0adb175). The workflow's working dir infra/opentofu/azure-vmss/ was deleted in #69, so the job could never have succeeded — missed in the rename PR.

🔮 Next up (separate issue)

Closing this issue. The relic-tracking workstream from the "Next phase" section of this issue should get its own tracking issue when it's picked up.

## Closed out — final status All blocked items completed (Azure CLI was authed in the new session, so no `az login` blocker). ### ✅ Done - **KV secret aliased**: `spirelens` created in `romaine-kv` with the same value as `card-utility-stats` (byte-equal, verified). Source secret kept enabled per the plan. - **Federated credentials**: `card-utility-stats-github-actions-main` and `card-utility-stats-github-actions-pr` were already migrated to `repo:nelsong6/spirelens:...` subjects (someone migrated them earlier in the session). The third credential, `card-utility-stats-github-actions-prod`, was unused (no remaining workflow uses `environment: prod` — that was tied to the deleted ansible/AKS workflows), so it was deleted rather than re-pointed. - **RG `rg-card-utility-stats-dev`**: `az group delete --no-wait` dispatched; currently in `Deleting` state. Contained 5 leftovers (vnet, NSG, public IP, NIC, orphaned OS disk — VM/VMSS already gone). - **Bonus cleanup**: dead `.github/workflows/opentofu-azure-vmss.yml` removed in #73 (merged as 0adb175). The workflow's working dir `infra/opentofu/azure-vmss/` was deleted in #69, so the job could never have succeeded — missed in the rename PR. ### 🔮 Next up (separate issue) Closing this issue. The relic-tracking workstream from the "Next phase" section of this issue should get its own tracking issue when it's picked up.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
romaine-life/spirelens#72
No description provided.