Recon: laptop-side discovery for SSH-driven glimmung integration #179

Closed
opened 2026-05-28 17:21:14 -07:00 by romaine-life-app[bot] · 6 comments
romaine-life-app[bot] commented 2026-05-28 17:21:14 -07:00 (Migrated from github.com)

Context

We are redesigning how spirelens runs under glimmung. The previous integration used a GitHub Actions self-hosted runner on this laptop; the new direction is to drop the self-hosted runner entirely and have glimmung's in-cluster k8s_job phases SSH into this laptop over an ephemeral Tailscale connection to drive the existing pwsh scripts (prepare-issue-agent-job.ps1, run-issue-agent-phases.ps1, prepare-issue-agent-scenario.ps1, summarize-issue-agent.ps1).

Before writing any code on either side, we need to understand the current state of the laptop so the new design is grounded in what is actually here, not what I am guessing.

This issue is a recon checklist. Run each block in PowerShell, paste the raw output back as a comment on this issue (one fenced block per section, in the same order, so it lines up with the questions). Do not redact paths, usernames, or process names — none of this is sensitive on its own and the design depends on the specifics. If a command errors, paste the error; an error is a useful signal.

Do not change any settings yet. This is read-only discovery. The follow-up issues will propose specific configuration changes once we know the baseline.


Section 1 — Desktop session model

Goal: determine whether the laptop runs the GHA self-hosted runner as a Windows service in Session 0, as an interactive user in a real desktop session, or some hybrid. This determines whether SSH-as-that-user can launch STS2 into a renderable desktop and let SpireLensMcp attach.

# 1a. Auto-login configuration
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' |
  Select-Object AutoAdminLogon, DefaultUserName, DefaultDomainName

# 1b. Is the GHA runner installed as a Windows service, and as whom?
Get-CimInstance Win32_Service -Filter "Name like 'actions.runner.%'" |
  Select-Object Name, State, StartName, PathName

# 1c. Where is the runner actually executing right now?
Get-Process -Name Runner.Listener -ErrorAction SilentlyContinue |
  Select-Object Id, SessionId, StartTime, Path
qwinsta

# 1d. Is the runner launched from Startup?
Get-ChildItem "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup",
              "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" `
              -ErrorAction SilentlyContinue

Also note (one sentence, plain English):

  • After a reboot, do you have to sign in by hand before things "work," or does the laptop come back ready to take an issue-agent run with no human action?

Section 2 — SpireLensMcp lifecycle

Goal: determine whether the SpireLensMcp HTTP bridge on localhost:15526 is a persistent service, started per-run by prepare-issue-agent-job.ps1 -InstallMcp, or something in between. This decides whether the new cluster-side orchestrator needs to own SpireLensMcp lifecycle or can assume the bridge is always reachable while STS2 is running.

# 2a. Is anything currently listening on 15526?
Get-NetTCPConnection -LocalPort 15526 -ErrorAction SilentlyContinue |
  Select-Object LocalAddress, LocalPort, State, OwningProcess

# 2b. If yes, who owns the process?
$pids = (Get-NetTCPConnection -LocalPort 15526 -ErrorAction SilentlyContinue).OwningProcess | Select-Object -Unique
foreach ($pid in $pids) {
  Get-Process -Id $pid -ErrorAction SilentlyContinue |
    Select-Object Id, SessionId, ProcessName, Path
}

# 2c. Probe the bridge directly
try {
  (Invoke-WebRequest -UseBasicParsing -Uri 'http://localhost:15526/api/v1/singleplayer' -TimeoutSec 3).StatusCode
} catch { $_.Exception.Message }

# 2d. Is SpireLensMcp registered as a Windows service?
Get-Service -ErrorAction SilentlyContinue |
  Where-Object { $_.Name -match 'SpireLens|STS2|spire' } |
  Select-Object Name, Status, StartType, DisplayName

# 2e. Installed mods (expected: BaseLib, SpireLens, SpireLensMcp — total 3)
Get-ChildItem 'D:\SteamLibrary\steamapps\common\Slay the Spire 2\mods' -Directory -ErrorAction SilentlyContinue |
  Select-Object Name, LastWriteTime

Section 3 — Prereqs already on the host

Goal: figure out what is already installed so we know whether the laptop-side migration is "install a few things" or "stand up a fresh tool chain."

# 3a. OpenSSH Server presence and state
Get-WindowsCapability -Online -Name OpenSSH.Server* | Select-Object Name, State
Get-Service sshd -ErrorAction SilentlyContinue | Select-Object Name, Status, StartType
Get-NetFirewallRule -Name *ssh* -ErrorAction SilentlyContinue |
  Select-Object Name, DisplayName, Enabled, Direction, Action

# 3b. Tailscale
Get-Command tailscale -ErrorAction SilentlyContinue | Select-Object Source
if (Get-Command tailscale -ErrorAction SilentlyContinue) {
  tailscale --version
  tailscale status
}

# 3c. .NET SDKs
dotnet --list-sdks
dotnet --info | Select-String -Pattern 'OS Name|OS Version|RID|Architecture'

# 3d. Claude CLI
Get-Command claude -ErrorAction SilentlyContinue | Select-Object Source
# Do NOT run `claude auth status` if it would prompt; only run if it returns
# immediately. If unsure, skip and report "skipped".

# 3e. git
Get-Command git -ErrorAction SilentlyContinue | Select-Object Source
git --version

Section 4 — Path confirmation

Goal: confirm the paths in AGENTS.md and the workflow files still match the current laptop. Several scripts hard-code these.

$paths = @(
  'D:\repos\SpireLens',
  'D:\repos\spire-lens-mcp',
  'D:\repos\STS2MCP',
  'D:\SteamLibrary\steamapps\common\Slay the Spire 2',
  'D:\SteamLibrary\steamapps\common\Slay the Spire 2\data_sts2_windows_x86_64\sts2.dll',
  "$env:APPDATA\SlayTheSpire2",
  "$env:APPDATA\SlayTheSpire2\SpireLens"
)
foreach ($p in $paths) {
  [pscustomobject]@{
    Path   = $p
    Exists = Test-Path -LiteralPath $p
  }
}

Section 5 — Reachability to glimmung and GitHub

Goal: confirm the laptop can call glimmung's callback HTTP from its current network, which is what the new design relies on for lease verification, callback posting, and screenshot upload coordination.

# 5a. Glimmung
try { (Invoke-WebRequest -UseBasicParsing -Uri 'https://glimmung.romaine.life/healthz' -TimeoutSec 5).StatusCode } catch { $_.Exception.Message }

# 5b. GitHub API
try { (Invoke-WebRequest -UseBasicParsing -Uri 'https://api.github.com/' -TimeoutSec 5).StatusCode } catch { $_.Exception.Message }

# 5c. Outbound DNS / Tailscale coordination server reachability
try { (Invoke-WebRequest -UseBasicParsing -Uri 'https://login.tailscale.com' -TimeoutSec 5).StatusCode } catch { $_.Exception.Message }

Section 6 — Free-form observations

Anything else worth flagging that the commands above will not capture. Examples that would be useful:

  • Is the laptop on Wi-Fi or wired? Does it sleep aggressively?
  • Is there a power profile that puts the GPU to sleep? STS2 verification needs a renderable session.
  • Are there multiple Windows user accounts in play (e.g. a dedicated issue-agent user separate from your personal account)?
  • Is there anything you have been working around manually with the current GHA runner that we should make sure the SSH replacement also handles?

What happens after you paste outputs back

I will read the outputs, classify the laptop as session model (a)/(b)/(c) from the parent session's question 1, and post a follow-up comment that:

  1. Maps each finding to a concrete design choice (SSH user, sshd config, Tailscale ACL, who owns SpireLensMcp lifecycle, whether we need an auto-login change, etc).
  2. Lists the actual configuration changes the laptop will need (still no code, just config deltas).
  3. Hands the next set of questions back to you in the parent session so we can move on to the glimmung-side and spirelens-side PRs.

Do not start any of those configuration changes from this issue. This issue closes when the recon outputs are pasted and the follow-up comment is written.

## Context We are redesigning how spirelens runs under glimmung. The previous integration used a GitHub Actions self-hosted runner on this laptop; the new direction is to drop the self-hosted runner entirely and have glimmung's in-cluster `k8s_job` phases SSH into this laptop over an ephemeral Tailscale connection to drive the existing pwsh scripts (`prepare-issue-agent-job.ps1`, `run-issue-agent-phases.ps1`, `prepare-issue-agent-scenario.ps1`, `summarize-issue-agent.ps1`). Before writing any code on either side, we need to understand the current state of the laptop so the new design is grounded in what is actually here, not what I am guessing. This issue is a recon checklist. Run each block in PowerShell, paste the raw output back as a comment on this issue (one fenced block per section, in the same order, so it lines up with the questions). Do not redact paths, usernames, or process names — none of this is sensitive on its own and the design depends on the specifics. If a command errors, paste the error; an error is a useful signal. Do not change any settings yet. This is read-only discovery. The follow-up issues will propose specific configuration changes once we know the baseline. --- ## Section 1 — Desktop session model Goal: determine whether the laptop runs the GHA self-hosted runner as a Windows service in Session 0, as an interactive user in a real desktop session, or some hybrid. This determines whether SSH-as-that-user can launch STS2 into a renderable desktop and let SpireLensMcp attach. ```powershell # 1a. Auto-login configuration Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' | Select-Object AutoAdminLogon, DefaultUserName, DefaultDomainName # 1b. Is the GHA runner installed as a Windows service, and as whom? Get-CimInstance Win32_Service -Filter "Name like 'actions.runner.%'" | Select-Object Name, State, StartName, PathName # 1c. Where is the runner actually executing right now? Get-Process -Name Runner.Listener -ErrorAction SilentlyContinue | Select-Object Id, SessionId, StartTime, Path qwinsta # 1d. Is the runner launched from Startup? Get-ChildItem "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup", "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" ` -ErrorAction SilentlyContinue ``` Also note (one sentence, plain English): - After a reboot, do you have to sign in by hand before things "work," or does the laptop come back ready to take an issue-agent run with no human action? --- ## Section 2 — SpireLensMcp lifecycle Goal: determine whether the SpireLensMcp HTTP bridge on `localhost:15526` is a persistent service, started per-run by `prepare-issue-agent-job.ps1 -InstallMcp`, or something in between. This decides whether the new cluster-side orchestrator needs to own SpireLensMcp lifecycle or can assume the bridge is always reachable while STS2 is running. ```powershell # 2a. Is anything currently listening on 15526? Get-NetTCPConnection -LocalPort 15526 -ErrorAction SilentlyContinue | Select-Object LocalAddress, LocalPort, State, OwningProcess # 2b. If yes, who owns the process? $pids = (Get-NetTCPConnection -LocalPort 15526 -ErrorAction SilentlyContinue).OwningProcess | Select-Object -Unique foreach ($pid in $pids) { Get-Process -Id $pid -ErrorAction SilentlyContinue | Select-Object Id, SessionId, ProcessName, Path } # 2c. Probe the bridge directly try { (Invoke-WebRequest -UseBasicParsing -Uri 'http://localhost:15526/api/v1/singleplayer' -TimeoutSec 3).StatusCode } catch { $_.Exception.Message } # 2d. Is SpireLensMcp registered as a Windows service? Get-Service -ErrorAction SilentlyContinue | Where-Object { $_.Name -match 'SpireLens|STS2|spire' } | Select-Object Name, Status, StartType, DisplayName # 2e. Installed mods (expected: BaseLib, SpireLens, SpireLensMcp — total 3) Get-ChildItem 'D:\SteamLibrary\steamapps\common\Slay the Spire 2\mods' -Directory -ErrorAction SilentlyContinue | Select-Object Name, LastWriteTime ``` --- ## Section 3 — Prereqs already on the host Goal: figure out what is already installed so we know whether the laptop-side migration is "install a few things" or "stand up a fresh tool chain." ```powershell # 3a. OpenSSH Server presence and state Get-WindowsCapability -Online -Name OpenSSH.Server* | Select-Object Name, State Get-Service sshd -ErrorAction SilentlyContinue | Select-Object Name, Status, StartType Get-NetFirewallRule -Name *ssh* -ErrorAction SilentlyContinue | Select-Object Name, DisplayName, Enabled, Direction, Action # 3b. Tailscale Get-Command tailscale -ErrorAction SilentlyContinue | Select-Object Source if (Get-Command tailscale -ErrorAction SilentlyContinue) { tailscale --version tailscale status } # 3c. .NET SDKs dotnet --list-sdks dotnet --info | Select-String -Pattern 'OS Name|OS Version|RID|Architecture' # 3d. Claude CLI Get-Command claude -ErrorAction SilentlyContinue | Select-Object Source # Do NOT run `claude auth status` if it would prompt; only run if it returns # immediately. If unsure, skip and report "skipped". # 3e. git Get-Command git -ErrorAction SilentlyContinue | Select-Object Source git --version ``` --- ## Section 4 — Path confirmation Goal: confirm the paths in AGENTS.md and the workflow files still match the current laptop. Several scripts hard-code these. ```powershell $paths = @( 'D:\repos\SpireLens', 'D:\repos\spire-lens-mcp', 'D:\repos\STS2MCP', 'D:\SteamLibrary\steamapps\common\Slay the Spire 2', 'D:\SteamLibrary\steamapps\common\Slay the Spire 2\data_sts2_windows_x86_64\sts2.dll', "$env:APPDATA\SlayTheSpire2", "$env:APPDATA\SlayTheSpire2\SpireLens" ) foreach ($p in $paths) { [pscustomobject]@{ Path = $p Exists = Test-Path -LiteralPath $p } } ``` --- ## Section 5 — Reachability to glimmung and GitHub Goal: confirm the laptop can call glimmung's callback HTTP from its current network, which is what the new design relies on for lease verification, callback posting, and screenshot upload coordination. ```powershell # 5a. Glimmung try { (Invoke-WebRequest -UseBasicParsing -Uri 'https://glimmung.romaine.life/healthz' -TimeoutSec 5).StatusCode } catch { $_.Exception.Message } # 5b. GitHub API try { (Invoke-WebRequest -UseBasicParsing -Uri 'https://api.github.com/' -TimeoutSec 5).StatusCode } catch { $_.Exception.Message } # 5c. Outbound DNS / Tailscale coordination server reachability try { (Invoke-WebRequest -UseBasicParsing -Uri 'https://login.tailscale.com' -TimeoutSec 5).StatusCode } catch { $_.Exception.Message } ``` --- ## Section 6 — Free-form observations Anything else worth flagging that the commands above will not capture. Examples that would be useful: - Is the laptop on Wi-Fi or wired? Does it sleep aggressively? - Is there a power profile that puts the GPU to sleep? STS2 verification needs a renderable session. - Are there multiple Windows user accounts in play (e.g. a dedicated `issue-agent` user separate from your personal account)? - Is there anything you have been working around manually with the current GHA runner that we should make sure the SSH replacement also handles? --- ## What happens after you paste outputs back I will read the outputs, classify the laptop as session model (a)/(b)/(c) from the parent session's question 1, and post a follow-up comment that: 1. Maps each finding to a concrete design choice (SSH user, sshd config, Tailscale ACL, who owns SpireLensMcp lifecycle, whether we need an auto-login change, etc). 2. Lists the actual configuration changes the laptop will need (still no code, just config deltas). 3. Hands the next set of questions back to you in the parent session so we can move on to the glimmung-side and spirelens-side PRs. Do not start any of those configuration changes from this issue. This issue closes when the recon outputs are pasted and the follow-up comment is written.
romaine-life-app[bot] commented 2026-05-28 17:57:41 -07:00 (Migrated from github.com)

Synthesis from the recon outputs

Headline read

  • Session model: (b) interactive desktop, manual login. AutoAdminLogon=0, runner runs in SessionId=1 as .\nelsonlaptopuser, launched from two Startup .cmd shortcuts. Service entries exist but are Stopped+Disabled. After reboot, a human signs in by hand and the runners follow.
  • SSH-to-laptop is fully greenfield. No sshd.exe, no Tailscale, no firewall rules. Only the SSH client is present. The replacement design has to install both.
  • SpireLensMcp is per-run, not persistent. Port 15526 is unbound, no service, not in mods/. The orchestrator owns SpireLensMcp lifecycle (install + STS2 launch + readiness probe + teardown).
  • Two GHA runners are registered against a different repo than spirelens (C:\actions-runner-card-utility-stats and …-implementation). Surfacing this as a follow-up question — see Q5 below.

Findings → design choices

1. Session model + login

Confirmed (b). The SSH transport works the way I sketched: orchestrator pod SSHes in as nelsonlaptopuser, lands in their interactive desktop session (SessionId=1), Start-Process sts2 opens a real window, SpireLensMcp can attach. But only after a human has signed in post-reboot. Two ways forward, choice belongs to you (Q1 below):

  • (α) Enable AutoAdminLogon for nelsonlaptopuser. Reboots come back ready. Standard for dedicated CI hosts; on a personal gaming laptop it has real security consequences (anyone with physical access bypasses Windows logon).
  • (β) Keep manual login. env-prep phase probes laptop reachability and emits a clean abort_reason="host_unavailable" verdict when the laptop is asleep or pre-logon. Runs queue cleanly until you sign in next.

I lean (β) given this is your personal device, but it's a quality-of-life call.

2. SSH transport

Greenfield install on the laptop. Configuration that lands when we run the laptop-config PR (still no code, just config deltas):

  1. Enable the Windows OpenSSH Server optional feature. Set the sshd service Automatic + Running.
  2. Drop glimmung's SSH CA pubkey at C:\ProgramData\ssh\trusted_user_ca_keys.
  3. Edit C:\ProgramData\ssh\sshd_config:
    • TrustedUserCAKeys C:\ProgramData\ssh\trusted_user_ca_keys
    • PasswordAuthentication no
    • PubkeyAuthentication no (only CA-signed certs)
    • Match User nelsonlaptopuser block with a restricted command/shell where it makes sense.
  4. Firewall: allow TCP/22 only on the Tailscale interface. Deny on all other interfaces. (No public sshd.)
  5. SSH login user = nelsonlaptopuser. We are not standing up a dedicated issue-agent user — the desktop session, STS2 install, Claude CLI auth, and SpireLens checkouts are all warm under this user. A second account would lose that warmth.

Per-run, glimmung's SSH CA signs a 10-minute cert with principal=spirelens-agent-<lease_id> for audit. The cert dies; no authorized_keys entry to rotate.

3. Tailscale transport

Greenfield install. Configuration:

  1. Install Tailscale on the laptop, sign in interactively once under nelsonlaptopuser.
  2. Tag the laptop tag:spirelens-host.
  3. ACL: tag:spirelens-orchestrator (the ephemeral cluster-side node) can reach tag:spirelens-host:22 only. No other tagnet traffic.
  4. Glimmung holds the Tailscale OAuth client secret in KV; per run it mints a pre-authorized, single-use, ephemeral auth key tagged tag:spirelens-orchestrator for the orchestrator pod.

4. SpireLensMcp lifecycle

Confirmed per-run. The orchestrator owns:

  • Install (or refresh) spire-lens-mcp into mods/ from D:\repos\spire-lens-mcp during env-prep, matching today's prepare-issue-agent-job.ps1 -InstallMcp behavior.
  • Launch STS2 during env-prep with -StartSts2 semantics intact.
  • Poll http://localhost:15526/api/v1/singleplayer until it returns 2xx, with a bounded timeout that produces a clear abort_reason="bridge_not_ready" verdict on failure.
  • During cleanup_early / cleanup_final, kill STS2 and tear down the per-run working dir on the laptop.

The pwsh scripts already do most of this. We keep them, change the env-var contract they consume from GHA-shaped to glimmung-shaped (GLIMMUNG_RUN_ID, GLIMMUNG_LEASE_REF, per-run working dir).

5. Mods directory drift

Today's mods/: BaseLib, godotexplorer, SpireLens. Per AGENTS.md the allowed set is BaseLib, SpireLens, SpireLensMcp.

  • SpireLensMcp absent: expected, since installs are per-run.
  • godotexplorer present: not in the policy. The env-prep mod-set probe needs to decide fail-open or fail-closed. Surfacing as Q3 below.

6. Path drift

D:\repos\STS2MCP (referenced in sts2-host-smoke.yml and AGENTS.md as the reference clone of the upstream kunology/STS2MCP) is gone. D:\repos\spire-lens-mcp is what's actually here, and per AGENTS.md is the active install. The reference is genuinely not needed for runtime — it was always a documentation crutch. AGENTS.md should be edited in the spirelens-side PR to drop the stale reference. Not blocking.

7. Power / sleep / GPU

Read-only probes can't see this. We need a one-line answer (Q4) before locking the design, because if the laptop sleeps mid-run the orchestrator's SSH dial will fail and STS2 won't render. Default expectation in the design: "plugged in, never sleep, never lid-close-sleep" while issue-agent runs are anticipated.

8. Reachability + toolchain

All clean. Glimmung/GitHub/Tailscale coordination reachable (200/200/200). .NET 9.0.313, git 2.54, Claude CLI all installed and at the expected paths. No work needed here.

Concrete laptop config-change list (proposed, awaiting Q1/Q3/Q4)

Once Q1–Q4 below are answered, the laptop-side change set is:

  1. Install Windows OpenSSH Server optional feature; sshd Automatic + Running.
  2. Drop glimmung SSH CA pubkey at C:\ProgramData\ssh\trusted_user_ca_keys.
  3. Apply sshd_config edits above.
  4. Firewall rule: TCP/22 allowed only on Tailscale interface; explicit deny elsewhere.
  5. Install Tailscale; sign in once as nelsonlaptopuser; tag tag:spirelens-host.
  6. Power profile: plugged-in never sleep, lid-close stays awake when plugged in (assuming Q4=plugged-in path).
  7. Conditional on Q1=α: enable AutoAdminLogon for nelsonlaptopuser.
  8. Conditional on Q3: remove or document godotexplorer from mods/.
  9. Decommission the two GHA runner registrations (after Q5 is answered):
    • cd C:\actions-runner-card-utility-stats; .\config.cmd remove --token <token>
    • same for …-implementation
    • Delete both .cmd shortcuts in …\Startup\.
    • Delete the C:\actions-runner-card-utility-stats* directories.
  10. (No long-lived keys, secrets, PATs, or authorized_keys entries land on the laptop. Trust anchors only: SSH CA pubkey + Tailscale device identity.)

Questions surfaced by the recon (please answer in this thread)

Q1. Auto-login. Do you want AutoAdminLogon enabled for nelsonlaptopuser so reboots come back ready (α), or keep manual login and have glimmung emit a clean "host unavailable" verdict when the laptop is pre-logon (β)? My lean: β.

Q2. (Carried over from parent session, finally relevant.) When we tear down .github/workflows/issue-agent.yaml on the spirelens side, do you want it deleted outright (per glimmung's migration policy: compatibility prohibited, no legacy/fallback), or kept disabled-but-present for a short soak window in case the new orchestrator misbehaves? My lean: delete. The post-merge fallback path is "manually re-register a glimmung workflow that points at a docker image tag we know works," not "flip a workflow back on."

Q3. godotexplorer in mods/. Was that installed deliberately (e.g. for a debugging task), or is it a leftover? If deliberate, AGENTS.md needs a tweak. If a leftover, the env-prep mod-set probe should fail-closed (refuse to start a run when unexpected mods are present) per the existing AGENTS.md "treat any non-(SpireLens|BaseLib|SpireLensMcp) entry as a removal candidate" policy.

Q4. Power / sleep / GPU. One sentence: when an issue-agent run is expected, will the laptop be plugged in with sleep disabled, or do we need the orchestrator to handle waking it (and if so, how — Wake-on-LAN over Tailscale is unreliable; the realistic alternative is "human keeps the laptop awake during expected run windows")?

Q5. The card-utility-stats runners. Both GHA runners are registered against a nelsong6/card-utility-stats repo, not spirelens. Three possibilities, please pick:

  • (i) card-utility-stats is the previous name of this project and the runner reg was never updated — safe to tear down with the rest of the spirelens migration.
  • (ii) card-utility-stats is a separate active project that also uses this laptop — we need to coordinate its migration too (or migrate it to glimmung in the same shot).
  • (iii) Something else — please describe.

Next steps once Q1–Q5 are answered

  1. I post a follow-up comment locking the laptop config-change list and (separately) the glimmung-side / spirelens-side PR plans.
  2. The laptop session executes the config changes one section at a time (still in this issue thread, so the audit trail stays in one place). Each section gets pasted-back verification output the same way the recon did.
  3. Once the laptop is configured and we can prove ssh nelsonlaptopuser@<tailnet-ip> over a CA-signed cert lands a working pwsh session, this issue closes.
  4. New issue opens against nelsong6/glimmung for the orchestrator image + cert/authkey endpoints + workflow registration.
  5. New issue opens against nelsong6/spirelens for env-var rename in the pwsh scripts, workflow-file deletion, AGENTS.md updates, and sts2-host-smoke.yml migration to a glimmung-agent subcommand.
## Synthesis from the recon outputs ### Headline read - **Session model: (b) interactive desktop, manual login.** AutoAdminLogon=0, runner runs in SessionId=1 as `.\nelsonlaptopuser`, launched from two Startup `.cmd` shortcuts. Service entries exist but are Stopped+Disabled. After reboot, a human signs in by hand and the runners follow. - **SSH-to-laptop is fully greenfield.** No `sshd.exe`, no Tailscale, no firewall rules. Only the SSH client is present. The replacement design has to install both. - **SpireLensMcp is per-run, not persistent.** Port 15526 is unbound, no service, not in `mods/`. The orchestrator owns SpireLensMcp lifecycle (install + STS2 launch + readiness probe + teardown). - **Two GHA runners are registered against a different repo than spirelens** (`C:\actions-runner-card-utility-stats` and `…-implementation`). Surfacing this as a follow-up question — see Q5 below. ### Findings → design choices **1. Session model + login** Confirmed (b). The SSH transport works the way I sketched: orchestrator pod SSHes in as `nelsonlaptopuser`, lands in their interactive desktop session (SessionId=1), `Start-Process sts2` opens a real window, SpireLensMcp can attach. **But only after a human has signed in post-reboot.** Two ways forward, choice belongs to you (Q1 below): - **(α) Enable AutoAdminLogon for `nelsonlaptopuser`.** Reboots come back ready. Standard for dedicated CI hosts; on a personal gaming laptop it has real security consequences (anyone with physical access bypasses Windows logon). - **(β) Keep manual login.** env-prep phase probes laptop reachability and emits a clean `abort_reason="host_unavailable"` verdict when the laptop is asleep or pre-logon. Runs queue cleanly until you sign in next. I lean (β) given this is your personal device, but it's a quality-of-life call. **2. SSH transport** Greenfield install on the laptop. Configuration that lands when we run the laptop-config PR (still no code, just config deltas): 1. Enable the Windows OpenSSH Server optional feature. Set the `sshd` service Automatic + Running. 2. Drop glimmung's SSH CA pubkey at `C:\ProgramData\ssh\trusted_user_ca_keys`. 3. Edit `C:\ProgramData\ssh\sshd_config`: - `TrustedUserCAKeys C:\ProgramData\ssh\trusted_user_ca_keys` - `PasswordAuthentication no` - `PubkeyAuthentication no` (only CA-signed certs) - `Match User nelsonlaptopuser` block with a restricted command/shell where it makes sense. 4. Firewall: allow TCP/22 *only* on the Tailscale interface. Deny on all other interfaces. (No public sshd.) 5. SSH login user = `nelsonlaptopuser`. We are not standing up a dedicated `issue-agent` user — the desktop session, STS2 install, Claude CLI auth, and SpireLens checkouts are all warm under this user. A second account would lose that warmth. Per-run, glimmung's SSH CA signs a 10-minute cert with `principal=spirelens-agent-<lease_id>` for audit. The cert dies; no `authorized_keys` entry to rotate. **3. Tailscale transport** Greenfield install. Configuration: 1. Install Tailscale on the laptop, sign in interactively once under `nelsonlaptopuser`. 2. Tag the laptop `tag:spirelens-host`. 3. ACL: `tag:spirelens-orchestrator` (the ephemeral cluster-side node) can reach `tag:spirelens-host:22` only. No other tagnet traffic. 4. Glimmung holds the Tailscale OAuth client secret in KV; per run it mints a pre-authorized, single-use, ephemeral auth key tagged `tag:spirelens-orchestrator` for the orchestrator pod. **4. SpireLensMcp lifecycle** Confirmed per-run. The orchestrator owns: - Install (or refresh) `spire-lens-mcp` into `mods/` from `D:\repos\spire-lens-mcp` during env-prep, matching today's `prepare-issue-agent-job.ps1 -InstallMcp` behavior. - Launch STS2 during env-prep with `-StartSts2` semantics intact. - Poll `http://localhost:15526/api/v1/singleplayer` until it returns 2xx, with a bounded timeout that produces a clear `abort_reason="bridge_not_ready"` verdict on failure. - During `cleanup_early` / `cleanup_final`, kill STS2 and tear down the per-run working dir on the laptop. The pwsh scripts already do most of this. We keep them, change the env-var contract they consume from `GHA-shaped` to `glimmung-shaped` (`GLIMMUNG_RUN_ID`, `GLIMMUNG_LEASE_REF`, per-run working dir). **5. Mods directory drift** Today's `mods/`: BaseLib, godotexplorer, SpireLens. Per AGENTS.md the allowed set is BaseLib, SpireLens, SpireLensMcp. - **SpireLensMcp absent**: expected, since installs are per-run. - **godotexplorer present**: not in the policy. The env-prep mod-set probe needs to decide fail-open or fail-closed. Surfacing as Q3 below. **6. Path drift** `D:\repos\STS2MCP` (referenced in `sts2-host-smoke.yml` and AGENTS.md as the reference clone of the upstream `kunology/STS2MCP`) is gone. `D:\repos\spire-lens-mcp` is what's actually here, and per AGENTS.md is the active install. The reference is genuinely not needed for runtime — it was always a documentation crutch. AGENTS.md should be edited in the spirelens-side PR to drop the stale reference. Not blocking. **7. Power / sleep / GPU** Read-only probes can't see this. We need a one-line answer (Q4) before locking the design, because if the laptop sleeps mid-run the orchestrator's SSH dial will fail and STS2 won't render. Default expectation in the design: "plugged in, never sleep, never lid-close-sleep" while issue-agent runs are anticipated. **8. Reachability + toolchain** All clean. Glimmung/GitHub/Tailscale coordination reachable (200/200/200). .NET 9.0.313, git 2.54, Claude CLI all installed and at the expected paths. No work needed here. ### Concrete laptop config-change list (proposed, awaiting Q1/Q3/Q4) Once Q1–Q4 below are answered, the laptop-side change set is: 1. Install Windows OpenSSH Server optional feature; `sshd` Automatic + Running. 2. Drop glimmung SSH CA pubkey at `C:\ProgramData\ssh\trusted_user_ca_keys`. 3. Apply sshd_config edits above. 4. Firewall rule: TCP/22 allowed only on Tailscale interface; explicit deny elsewhere. 5. Install Tailscale; sign in once as `nelsonlaptopuser`; tag `tag:spirelens-host`. 6. Power profile: plugged-in never sleep, lid-close stays awake when plugged in (assuming Q4=plugged-in path). 7. *Conditional on Q1=α*: enable AutoAdminLogon for `nelsonlaptopuser`. 8. *Conditional on Q3*: remove or document `godotexplorer` from `mods/`. 9. Decommission the two GHA runner registrations (after Q5 is answered): - `cd C:\actions-runner-card-utility-stats; .\config.cmd remove --token <token>` - same for `…-implementation` - Delete both `.cmd` shortcuts in `…\Startup\`. - Delete the `C:\actions-runner-card-utility-stats*` directories. 10. (No long-lived keys, secrets, PATs, or `authorized_keys` entries land on the laptop. Trust anchors only: SSH CA pubkey + Tailscale device identity.) ### Questions surfaced by the recon (please answer in this thread) **Q1. Auto-login.** Do you want AutoAdminLogon enabled for `nelsonlaptopuser` so reboots come back ready (α), or keep manual login and have glimmung emit a clean "host unavailable" verdict when the laptop is pre-logon (β)? My lean: β. **Q2. (Carried over from parent session, finally relevant.)** When we tear down `.github/workflows/issue-agent.yaml` on the spirelens side, do you want it deleted outright (per glimmung's migration policy: compatibility prohibited, no `legacy`/`fallback`), or kept disabled-but-present for a short soak window in case the new orchestrator misbehaves? My lean: delete. The post-merge fallback path is "manually re-register a glimmung workflow that points at a docker image tag we know works," not "flip a workflow back on." **Q3. godotexplorer in `mods/`.** Was that installed deliberately (e.g. for a debugging task), or is it a leftover? If deliberate, AGENTS.md needs a tweak. If a leftover, the env-prep mod-set probe should fail-closed (refuse to start a run when unexpected mods are present) per the existing AGENTS.md "treat any non-(SpireLens|BaseLib|SpireLensMcp) entry as a removal candidate" policy. **Q4. Power / sleep / GPU.** One sentence: when an issue-agent run is expected, will the laptop be plugged in with sleep disabled, or do we need the orchestrator to handle waking it (and if so, how — Wake-on-LAN over Tailscale is unreliable; the realistic alternative is "human keeps the laptop awake during expected run windows")? **Q5. The card-utility-stats runners.** Both GHA runners are registered against a `nelsong6/card-utility-stats` repo, not `spirelens`. Three possibilities, please pick: - (i) `card-utility-stats` is the *previous* name of this project and the runner reg was never updated — safe to tear down with the rest of the spirelens migration. - (ii) `card-utility-stats` is a separate active project that *also* uses this laptop — we need to coordinate its migration too (or migrate it to glimmung in the same shot). - (iii) Something else — please describe. ### Next steps once Q1–Q5 are answered 1. I post a follow-up comment locking the laptop config-change list and (separately) the glimmung-side / spirelens-side PR plans. 2. The laptop session executes the config changes one section at a time (still in this issue thread, so the audit trail stays in one place). Each section gets pasted-back verification output the same way the recon did. 3. Once the laptop is configured and we can prove `ssh nelsonlaptopuser@<tailnet-ip>` over a CA-signed cert lands a working pwsh session, **this issue closes**. 4. New issue opens against `nelsong6/glimmung` for the orchestrator image + cert/authkey endpoints + workflow registration. 5. New issue opens against `nelsong6/spirelens` for env-var rename in the pwsh scripts, workflow-file deletion, AGENTS.md updates, and `sts2-host-smoke.yml` migration to a `glimmung-agent` subcommand.
romaine-life-app[bot] commented 2026-05-28 18:16:43 -07:00 (Migrated from github.com)

Locked plan

Decisions, locked

  • Q1 → β. No AutoAdminLogon. env-prep probes laptop reachability and emits abort_reason="host_unavailable" when the laptop is asleep / pre-logon. Runs queue until next manual sign-in.
  • Q2 → delete. .github/workflows/issue-agent.yaml removed outright. No soak, no disabled-but-present. Revert path is re-registering a known-good glimmung image tag.
  • Q3 → fail-closed. env-prep mod-set probe lists mods/ and aborts (abort_reason="unexpected_mod:<name>") if anything outside {BaseLib, SpireLens, SpireLensMcp} is present. No AGENTS.md allow-list edits. On this laptop, the first migrated run will refuse to proceed until godotexplorer is removed (laptop step L8 below).
  • Q4 → plugged in, no wake handling. Design assumes the laptop is plugged in with sleep + lid-close-sleep disabled during expected run windows.
  • Q5 → (i). Both runners are this same project under its previous name. Decommission both with the migration. Stale D:\repos\card-utility-stats clone removed.

Laptop config-change list (locked, ordered, with verification per step)

Sequence is important: steps L1–L2 can run before glimmung-side PR-G merges; L3–L6 are blocked on the SSH CA pubkey existing (admin task A2 below); L7–L8 are independent; L9 happens last, after the new SSH path has been smoke-tested end-to-end, so the old capacity stays dormant-but-present until the new capacity is proven.

L1. Install Windows OpenSSH Server.

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Set-Service sshd -StartupType Automatic
Start-Service sshd

Verify: Get-Service sshd | Select-Object Name, Status, StartType (Status=Running, StartType=Automatic), Test-NetConnection -ComputerName localhost -Port 22 -InformationLevel Quiet (True).

L2. Install Tailscale.

winget install --id Tailscale.Tailscale --accept-source-agreements --accept-package-agreements
# After install, sign in interactively (this opens a browser):
tailscale up

Sign in to the tailnet under nelsonlaptopuser. Then in the Tailscale admin console, tag the device tag:spirelens-host (or apply via a re-tailscale up --advertise-tags=tag:spirelens-host after the tag exists in ACLs — see admin task A3).
Verify: tailscale status shows the device online with the tag:spirelens-host tag, capture the tailnet IPv4. Paste both in the issue comment.

L3. Firewall: TCP/22 allowed only on Tailscale interface; explicit deny elsewhere.

$tsAlias = (Get-NetAdapter | Where-Object { $_.InterfaceDescription -like 'Tailscale*' }).Name
New-NetFirewallRule -DisplayName 'spirelens-ssh-tailscale-allow' -Direction Inbound -Action Allow `
  -Protocol TCP -LocalPort 22 -InterfaceAlias $tsAlias
New-NetFirewallRule -DisplayName 'spirelens-ssh-other-deny' -Direction Inbound -Action Block `
  -Protocol TCP -LocalPort 22 -InterfaceAlias (Get-NetAdapter | Where-Object { $_.InterfaceDescription -notlike 'Tailscale*' }).Name

Verify: Get-NetFirewallRule -DisplayName 'spirelens-ssh-*' | Format-Table DisplayName, Enabled, Direction, Action.

L4. Deposit glimmung SSH CA pubkey (blocks on admin task A2).
The glimmung admin will paste the CA pubkey contents in this issue. Then on the laptop:

$ca = @"
<paste CA pubkey here>
"@
Set-Content -LiteralPath 'C:\ProgramData\ssh\trusted_user_ca_keys' -Value $ca -Encoding ascii
# Tighten ACL: SYSTEM + Administrators only.
icacls 'C:\ProgramData\ssh\trusted_user_ca_keys' /inheritance:r /grant 'SYSTEM:(R)' /grant 'Administrators:(R)'

Verify: Get-Content C:\ProgramData\ssh\trusted_user_ca_keys returns the pubkey, icacls output shows only SYSTEM + Administrators.

L5. Lock sshd_config.
Edit C:\ProgramData\ssh\sshd_config with these lines (idempotent — replace any existing values):

TrustedUserCAKeys C:\ProgramData\ssh\trusted_user_ca_keys
PasswordAuthentication no
PubkeyAuthentication no
AuthenticationMethods publickey

Then:

Restart-Service sshd

Verify: sshd -T | Select-String 'trustedusercakeys|passwordauthentication|pubkeyauthentication|authenticationmethods' shows the new values.

L6. Smoke test end-to-end SSH cert flow (blocks on glimmung PR-G deployed + admin task A4).
Glimmung admin issues a one-off short-TTL cert for the testing principal and pastes the SSH command into the issue. The laptop side just confirms tail -f of C:\ProgramData\ssh\logs\sshd.log shows the successful auth event for the right principal. The cluster-side connect is performed by the orchestrator smoke job.

L7. Power profile: never sleep, no lid-close sleep, on AC.

powercfg /change standby-timeout-ac 0
powercfg /change hibernate-timeout-ac 0
powercfg /change disk-timeout-ac 0
# Lid action on AC = do nothing (231a05a2-29c2-4f57-8b9a-12222eda5b32 = lid close action)
powercfg /setacvalueindex SCHEME_CURRENT SUB_BUTTONS 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg /setactive SCHEME_CURRENT

Verify: powercfg /query SCHEME_CURRENT SUB_SLEEP STANDBYIDLE and the SUB_BUTTONS LIDACTION query both show 0 / do-nothing on AC.

L8. Remove godotexplorer and the stale D:\repos\card-utility-stats clone.

Remove-Item 'D:\SteamLibrary\steamapps\common\Slay the Spire 2\mods\godotexplorer' -Recurse -Force
Remove-Item 'D:\repos\card-utility-stats' -Recurse -Force

Verify: re-run section-2e + section-4 PATH commands from #179; godotexplorer absent from mods/, D:\repos\card-utility-stats does not exist.

L9. Decommission GHA runners (do this last, after PR-S merges and a real run has succeeded end-to-end).
For each runner dir:

# Mint a runner removal token first (admin task A5). Then:
Stop-Process -Name Runner.Listener -ErrorAction SilentlyContinue
cd C:\actions-runner-card-utility-stats
.\config.cmd remove --token <token-A>
cd C:\actions-runner-card-utility-stats-implementation
.\config.cmd remove --token <token-B>
Remove-Item 'C:\actions-runner-card-utility-stats' -Recurse -Force
Remove-Item 'C:\actions-runner-card-utility-stats-implementation' -Recurse -Force
Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\Start GitHub Runner issue-agent-nelsonlaptop-a.cmd"
Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\Start GitHub Runner issue-agent-nelsonlaptop-b.cmd"

Verify: Get-Process -Name Runner.Listener -ErrorAction SilentlyContinue returns nothing, both actions.runner.* Windows services gone from Get-CimInstance Win32_Service -Filter "Name like 'actions.runner.%'", both runner dirs gone, both Startup .cmd shortcuts gone, the runner list on the spirelens repo's GitHub Settings → Actions → Runners page is empty.

Glimmung-side: PR-G (nelsong6/glimmung)

Scope: add the server-side primitives the SSH-replacement design depends on. Heavy version per the migration / quality timeframe policy — full endpoint shape, KV wiring, runner image update, docs, tests.

  1. Two new HTTP endpoints (in internal/server/):
    • POST /v1/leases/{id}/ssh-cert — admin or lease-callback-token auth. Signs a short-TTL OpenSSH user cert using the CA private key loaded from KV. Cert principal: spirelens-agent-<lease_id> for audit; TTL 10m; key extensions limited to permit-pty only (no port-forward, no agent-forward, no X11). Returns {cert, ttl_seconds}.
    • POST /v1/leases/{id}/tailscale-authkey — same auth shape. Mints a one-shot, ephemeral, pre-authorized auth key via the Tailscale OAuth client (KV-loaded), tagged tag:spirelens-orchestrator. Returns {authkey, expires_at}.
  2. KV wiring (read at startup, like the existing GitHub App secrets):
    • glimmung-ssh-ca-private-key (OpenSSH-format CA private key, PEM-encoded).
    • glimmung-tailscale-oauth-client-id, glimmung-tailscale-oauth-client-secret.
      New README KV table rows describing each. Identity/permissions for glimmung-identity extended to read these (tofu change in the same PR).
  3. Glimmung-managed runner image (whichever image renders k8s_job phase pods today, based on what ambience's phases run against — likely defined in glimmung's helm chart or a Dockerfile under cmd/glimmung-native-runner/ or similar): add openssh-client and tailscale (userspace mode, tailscaled --tun=userspace-networking). This is the only image consumed by the new spirelens shell scripts; ambience continues to consume it without behavioral change.
  4. Docs:
    • docs/remote-host-execution.md (new): how a project workflow uses the two new endpoints to drive a host outside the cluster.
    • docs/workflow-shape.md: note that phase shell scripts can call the two new endpoints; no schema change.
    • README.md: add the three new KV table rows.
  5. Tests:
    • internal/server/ssh_cert_api_test.go: cert-mint happy path, auth gate, lease-state gate (active only), CA loading from a stub provider, deterministic principal naming.
    • internal/server/tailscale_authkey_api_test.go: same shape with a mock Tailscale OAuth client.
    • internal/server/route_inventory_test.go: route list updated.
  6. Feature contracts: PR body checks contracts touched (HTTP API surface, auth, observability). Container build check via existing .github/workflows/docker-build-check.yaml.

Two endpoints, two KV secrets, one image update, docs, tests. Single PR. No new Go binary, no orchestrator container — the orchestration logic lives in the spirelens repo's shell scripts that run inside the existing runner image. This matches the ambience pattern (project-owned scripts in scripts/glimmung-native/, glimmung-owned runtime image).

Spirelens-side: PR-S (nelsong6/spirelens)

Scope: delete the old GHA workflow, add the glimmung-native scripts that replace it, rename pwsh env vars, update AGENTS.md, add a workflow registration doc.

  1. Delete:
    • .github/workflows/issue-agent.yaml
    • .github/workflows/sts2-host-smoke.yml (the probe folds into the new env-prep script; the standalone workflow is redundant)
    • .github/workflows/opentofu-issue-agent-screenshot-storage.yml and the tofu module it manages (the dedicated per-project screenshot blob is obsolete — glimmung now hosts screenshot artifacts under the shared romaineglimmungartifacts account, as ambience does). I will sequence the tofu state destroy as a separate admin task A6 to avoid the PR merging while the Azure resource still exists.
    • .github/scripts/publish-issue-agent-screenshots.ps1 (uploading moves cluster-side, matching ambience).
  2. Keep:
    • .github/workflows/keyvault-secret-alias.yml, .github/workflows/ps-quality.yml — unrelated to issue-agent.
  3. Add scripts/glimmung-native/ modeled directly on nelsong6/ambience/scripts/glimmung-native/:
    • env-prep.sh: mint cert + authkey via PR-G endpoints, tailscale up --authkey=…, ssh probe to laptop, abort with host_unavailable on dial failure, run laptop-side mod-set check (abort on unexpected_mod:*), run laptop-side SpireLensMcp install via the existing prepare-issue-agent-job.ps1 -InstallMcp -StartSts2, poll localhost:15526 via SSH-forwarded probe until ready, emit phase outputs ssh_endpoint, tailnet_ip, working_dir, bridge_ready.
    • test-plan.sh: ssh in, run existing run-issue-agent-phases.ps1 -PhaseName test_plan with renamed env vars (see step 4), scp issue-agent-test-plan.json back, emit test_plan output.
    • implement.sh: ssh in, run … -PhaseName implementation, push glimmung/<run_id> branch using a per-run GH clone-write token minted in the script (same pattern this issue used), scp result back, emit implementation, branch_name outputs.
    • verify.sh: ssh in, build + deploy .dll, prep scenario, run … -PhaseName verification, scp screenshots + issue-agent-verification.json back, upload screenshots to romaineglimmungartifacts via federated identity, emit verification output.
    • env-destroy.sh: ssh in, kill STS2 + SpireLensMcp, rm per-run working dir on laptop, tailscale logout (ephemeral node dies on its own).
  4. Rename env vars in .github/scripts/*.ps1 from GHA-shaped to glimmung-shaped:
    • GITHUB_RUN_ID → GLIMMUNG_RUN_ID
    • GITHUB_RUN_ATTEMPT → GLIMMUNG_ATTEMPT_INDEX
    • GITHUB_REPOSITORY → GLIMMUNG_PROJECT_REPO
    • RUNNER_TEMP → GLIMMUNG_WORKING_DIR
    • GITHUB_WORKSPACE → GLIMMUNG_REPO_ROOT
    • Per migration policy: rename in place, do not ship a compat shim that exports the old names.
  5. AGENTS.md updates:
    • Drop the D:\repos\STS2MCP reference paragraph (the kunology fork is gone).
    • Replace the "issue-agent" GHA-runner description with a one-paragraph "issue-agent runs via glimmung-native SSH" pointer.
    • Mod policy (BaseLib / SpireLens / SpireLensMcp) unchanged.
  6. Add docs/glimmung-workflow.md mirroring nelsong6/ambience/docs/glimmung-workflow.md (if it exists) or equivalent — captures the workflow registration JSON we will land via POST /v1/workflows after PR-S merges.

Phase shape registered in glimmung Postgres (admin task A7), mirroring ambience exactly except for verify recycle policy:

env-prep       depends_on: []                outputs: ssh_endpoint, tailnet_ip,
                                                       working_dir, bridge_ready
llm-work       depends_on: env-prep          jobs: test-plan + implement
                                              outputs: test_plan, implementation,
                                                       branch_name
llm-verify     depends_on: llm-work          verify: true
                                              outputs: verification
evidence-gate  depends_on: llm-verify        recycle_policy: 3 attempts,
                                              on=[verify_fail, verify_malformed],
                                              lands_at=env-prep
cleanup_early  depends_on: evidence-gate     always, skip_when_preserve_test_env
touchpoint     depends_on: cleanup_early     always, primitive=pr_touchpoint
touchpoint_gate depends_on: touchpoint        primitive=pr_merge
cleanup_final  depends_on: touchpoint_gate   always
pr.recycle_policy: 3 attempts on [pr_review_changes_requested], lands_at=env-prep
budget.total: 25

Admin / data tasks (not in any PR)

These are operator actions, not code changes:

  • A1. Generate SSH CA keypair (ssh-keygen -t ed25519 -f glimmung-ssh-ca). Private key → KV as glimmung-ssh-ca-private-key. Public key surfaced for laptop step L4.
  • A2. Paste the CA pubkey as a comment on this issue once A1 is done.
  • A3. Tailscale ACLs: define tag:spirelens-host, tag:spirelens-orchestrator; rule allowing tag:spirelens-orchestrator → tag:spirelens-host:22. Apply via the Tailscale admin console JSON.
  • A4. Run an admin-issued cert from the deployed PR-G endpoints, post the resulting SSH command in the issue for L6 smoke verification.
  • A5. Mint runner removal tokens for both GHA runners (GitHub Settings → Actions → Runners → each → remove → copy token) and paste in the issue when L9 is reached.
  • A6. Destroy the per-project screenshot storage tofu state (sequenced after PR-S merges so the workflow file is gone before the resource).
  • A7. Register the spirelens workflow in Postgres via POST /v1/workflows after both PR-G and PR-S are deployed.

Sequence of operations

1.  PR-G drafted, reviewed, merged, deployed.        [glimmung repo]
2.  Laptop steps L1–L2 (install OpenSSH Server + Tailscale).  [laptop session]
3.  Admin tasks A1, A2, A3.                          [you]
4.  Laptop steps L3–L5 (firewall + CA pubkey deposit + sshd_config).  [laptop session]
5.  Admin task A4 → laptop step L6 (smoke SSH cert flow).  [you + laptop session]
6.  Laptop steps L7–L8 (power profile + remove godotexplorer + stale clone).  [laptop session]
7.  PR-S drafted, reviewed, merged.                  [spirelens repo]
8.  Admin task A6 (destroy screenshot storage tofu).  [you]
9.  Admin task A7 (register workflow in Postgres).    [you]
10. First synthetic spirelens issue dispatched against the new path; verify ADVANCE.
11. Admin task A5 → laptop step L9 (decommission GHA runners + Startup shortcuts).  [you + laptop session]
12. #179 closes.

Steps 1–6 can land before PR-S is even drafted, since none of them depend on the spirelens-side scripts existing. Steps 7–10 are the actual cutover. Step 11 is the no-going-back step and is correctly the last operational action.

Confirm and proceed

If this matches your intent, the next concrete action is (1) draft PR-G in the glimmung repo. Reply on this issue or in the parent session with "proceed with PR-G" (or call out any disagreement) and I'll spawn a glimmung worktree and start drafting. I will keep #179 as the audit trail for the laptop-side execution; the PR work will be tracked in its own PR descriptions and reference back here.

## Locked plan ### Decisions, locked - **Q1 → β.** No AutoAdminLogon. env-prep probes laptop reachability and emits `abort_reason="host_unavailable"` when the laptop is asleep / pre-logon. Runs queue until next manual sign-in. - **Q2 → delete.** `.github/workflows/issue-agent.yaml` removed outright. No soak, no disabled-but-present. Revert path is re-registering a known-good glimmung image tag. - **Q3 → fail-closed.** env-prep mod-set probe lists `mods/` and aborts (`abort_reason="unexpected_mod:<name>"`) if anything outside `{BaseLib, SpireLens, SpireLensMcp}` is present. No AGENTS.md allow-list edits. On *this* laptop, the first migrated run will refuse to proceed until `godotexplorer` is removed (laptop step L8 below). - **Q4 → plugged in, no wake handling.** Design assumes the laptop is plugged in with sleep + lid-close-sleep disabled during expected run windows. - **Q5 → (i).** Both runners are this same project under its previous name. Decommission both with the migration. Stale `D:\repos\card-utility-stats` clone removed. ### Laptop config-change list (locked, ordered, with verification per step) Sequence is important: steps L1–L2 can run before glimmung-side PR-G merges; L3–L6 are blocked on the SSH CA pubkey existing (admin task A2 below); L7–L8 are independent; L9 happens **last**, after the new SSH path has been smoke-tested end-to-end, so the old capacity stays dormant-but-present until the new capacity is proven. **L1. Install Windows OpenSSH Server.** ```powershell Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 Set-Service sshd -StartupType Automatic Start-Service sshd ``` *Verify:* `Get-Service sshd | Select-Object Name, Status, StartType` (Status=Running, StartType=Automatic), `Test-NetConnection -ComputerName localhost -Port 22 -InformationLevel Quiet` (True). **L2. Install Tailscale.** ```powershell winget install --id Tailscale.Tailscale --accept-source-agreements --accept-package-agreements # After install, sign in interactively (this opens a browser): tailscale up ``` Sign in to the tailnet under `nelsonlaptopuser`. Then in the Tailscale admin console, tag the device `tag:spirelens-host` (or apply via a re-`tailscale up --advertise-tags=tag:spirelens-host` after the tag exists in ACLs — see admin task A3). *Verify:* `tailscale status` shows the device online with the `tag:spirelens-host` tag, capture the tailnet IPv4. Paste both in the issue comment. **L3. Firewall: TCP/22 allowed only on Tailscale interface; explicit deny elsewhere.** ```powershell $tsAlias = (Get-NetAdapter | Where-Object { $_.InterfaceDescription -like 'Tailscale*' }).Name New-NetFirewallRule -DisplayName 'spirelens-ssh-tailscale-allow' -Direction Inbound -Action Allow ` -Protocol TCP -LocalPort 22 -InterfaceAlias $tsAlias New-NetFirewallRule -DisplayName 'spirelens-ssh-other-deny' -Direction Inbound -Action Block ` -Protocol TCP -LocalPort 22 -InterfaceAlias (Get-NetAdapter | Where-Object { $_.InterfaceDescription -notlike 'Tailscale*' }).Name ``` *Verify:* `Get-NetFirewallRule -DisplayName 'spirelens-ssh-*' | Format-Table DisplayName, Enabled, Direction, Action`. **L4. Deposit glimmung SSH CA pubkey** *(blocks on admin task A2)*. The glimmung admin will paste the CA pubkey contents in this issue. Then on the laptop: ```powershell $ca = @" <paste CA pubkey here> "@ Set-Content -LiteralPath 'C:\ProgramData\ssh\trusted_user_ca_keys' -Value $ca -Encoding ascii # Tighten ACL: SYSTEM + Administrators only. icacls 'C:\ProgramData\ssh\trusted_user_ca_keys' /inheritance:r /grant 'SYSTEM:(R)' /grant 'Administrators:(R)' ``` *Verify:* `Get-Content C:\ProgramData\ssh\trusted_user_ca_keys` returns the pubkey, `icacls` output shows only SYSTEM + Administrators. **L5. Lock `sshd_config`.** Edit `C:\ProgramData\ssh\sshd_config` with these lines (idempotent — replace any existing values): ``` TrustedUserCAKeys C:\ProgramData\ssh\trusted_user_ca_keys PasswordAuthentication no PubkeyAuthentication no AuthenticationMethods publickey ``` Then: ```powershell Restart-Service sshd ``` *Verify:* `sshd -T | Select-String 'trustedusercakeys|passwordauthentication|pubkeyauthentication|authenticationmethods'` shows the new values. **L6. Smoke test end-to-end SSH cert flow** *(blocks on glimmung PR-G deployed + admin task A4)*. Glimmung admin issues a one-off short-TTL cert for the testing principal and pastes the SSH command into the issue. The laptop side just confirms `tail -f` of `C:\ProgramData\ssh\logs\sshd.log` shows the successful auth event for the right principal. The cluster-side connect is performed by the orchestrator smoke job. **L7. Power profile: never sleep, no lid-close sleep, on AC.** ```powershell powercfg /change standby-timeout-ac 0 powercfg /change hibernate-timeout-ac 0 powercfg /change disk-timeout-ac 0 # Lid action on AC = do nothing (231a05a2-29c2-4f57-8b9a-12222eda5b32 = lid close action) powercfg /setacvalueindex SCHEME_CURRENT SUB_BUTTONS 5ca83367-6e45-459f-a27b-476b1d01c936 0 powercfg /setactive SCHEME_CURRENT ``` *Verify:* `powercfg /query SCHEME_CURRENT SUB_SLEEP STANDBYIDLE` and the `SUB_BUTTONS LIDACTION` query both show 0 / do-nothing on AC. **L8. Remove `godotexplorer` and the stale `D:\repos\card-utility-stats` clone.** ```powershell Remove-Item 'D:\SteamLibrary\steamapps\common\Slay the Spire 2\mods\godotexplorer' -Recurse -Force Remove-Item 'D:\repos\card-utility-stats' -Recurse -Force ``` *Verify:* re-run section-2e + section-4 PATH commands from #179; godotexplorer absent from `mods/`, `D:\repos\card-utility-stats` does not exist. **L9. Decommission GHA runners** *(do this last, after PR-S merges and a real run has succeeded end-to-end)*. For each runner dir: ```powershell # Mint a runner removal token first (admin task A5). Then: Stop-Process -Name Runner.Listener -ErrorAction SilentlyContinue cd C:\actions-runner-card-utility-stats .\config.cmd remove --token <token-A> cd C:\actions-runner-card-utility-stats-implementation .\config.cmd remove --token <token-B> Remove-Item 'C:\actions-runner-card-utility-stats' -Recurse -Force Remove-Item 'C:\actions-runner-card-utility-stats-implementation' -Recurse -Force Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\Start GitHub Runner issue-agent-nelsonlaptop-a.cmd" Remove-Item "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\Start GitHub Runner issue-agent-nelsonlaptop-b.cmd" ``` *Verify:* `Get-Process -Name Runner.Listener -ErrorAction SilentlyContinue` returns nothing, both `actions.runner.*` Windows services gone from `Get-CimInstance Win32_Service -Filter "Name like 'actions.runner.%'"`, both runner dirs gone, both Startup `.cmd` shortcuts gone, the runner list on the spirelens repo's GitHub Settings → Actions → Runners page is empty. ### Glimmung-side: PR-G (`nelsong6/glimmung`) **Scope:** add the server-side primitives the SSH-replacement design depends on. Heavy version per the migration / quality timeframe policy — full endpoint shape, KV wiring, runner image update, docs, tests. 1. **Two new HTTP endpoints** (in `internal/server/`): - `POST /v1/leases/{id}/ssh-cert` — admin or lease-callback-token auth. Signs a short-TTL OpenSSH user cert using the CA private key loaded from KV. Cert principal: `spirelens-agent-<lease_id>` for audit; TTL 10m; key extensions limited to `permit-pty` only (no port-forward, no agent-forward, no X11). Returns `{cert, ttl_seconds}`. - `POST /v1/leases/{id}/tailscale-authkey` — same auth shape. Mints a one-shot, ephemeral, pre-authorized auth key via the Tailscale OAuth client (KV-loaded), tagged `tag:spirelens-orchestrator`. Returns `{authkey, expires_at}`. 2. **KV wiring** (read at startup, like the existing GitHub App secrets): - `glimmung-ssh-ca-private-key` (OpenSSH-format CA private key, PEM-encoded). - `glimmung-tailscale-oauth-client-id`, `glimmung-tailscale-oauth-client-secret`. New README KV table rows describing each. Identity/permissions for `glimmung-identity` extended to read these (tofu change in the same PR). 3. **Glimmung-managed runner image** (whichever image renders `k8s_job` phase pods today, based on what ambience's phases run against — likely defined in glimmung's helm chart or a Dockerfile under `cmd/glimmung-native-runner/` or similar): add `openssh-client` and `tailscale` (userspace mode, `tailscaled --tun=userspace-networking`). This is the only image consumed by the new spirelens shell scripts; ambience continues to consume it without behavioral change. 4. **Docs:** - `docs/remote-host-execution.md` (new): how a project workflow uses the two new endpoints to drive a host outside the cluster. - `docs/workflow-shape.md`: note that phase shell scripts can call the two new endpoints; no schema change. - `README.md`: add the three new KV table rows. 5. **Tests:** - `internal/server/ssh_cert_api_test.go`: cert-mint happy path, auth gate, lease-state gate (`active` only), CA loading from a stub provider, deterministic principal naming. - `internal/server/tailscale_authkey_api_test.go`: same shape with a mock Tailscale OAuth client. - `internal/server/route_inventory_test.go`: route list updated. 6. **Feature contracts:** PR body checks contracts touched (HTTP API surface, auth, observability). Container build check via existing `.github/workflows/docker-build-check.yaml`. Two endpoints, two KV secrets, one image update, docs, tests. Single PR. No new Go binary, no orchestrator container — the orchestration logic lives in the spirelens repo's shell scripts that run inside the existing runner image. This matches the ambience pattern (project-owned scripts in `scripts/glimmung-native/`, glimmung-owned runtime image). ### Spirelens-side: PR-S (`nelsong6/spirelens`) **Scope:** delete the old GHA workflow, add the glimmung-native scripts that replace it, rename pwsh env vars, update AGENTS.md, add a workflow registration doc. 1. **Delete:** - `.github/workflows/issue-agent.yaml` - `.github/workflows/sts2-host-smoke.yml` (the probe folds into the new env-prep script; the standalone workflow is redundant) - `.github/workflows/opentofu-issue-agent-screenshot-storage.yml` *and* the tofu module it manages (the dedicated per-project screenshot blob is obsolete — glimmung now hosts screenshot artifacts under the shared `romaineglimmungartifacts` account, as ambience does). I will sequence the tofu state destroy as a separate admin task A6 to avoid the PR merging while the Azure resource still exists. - `.github/scripts/publish-issue-agent-screenshots.ps1` (uploading moves cluster-side, matching ambience). 2. **Keep:** - `.github/workflows/keyvault-secret-alias.yml`, `.github/workflows/ps-quality.yml` — unrelated to issue-agent. 3. **Add `scripts/glimmung-native/`** modeled directly on `nelsong6/ambience/scripts/glimmung-native/`: - `env-prep.sh`: mint cert + authkey via PR-G endpoints, `tailscale up --authkey=…`, ssh probe to laptop, abort with `host_unavailable` on dial failure, run laptop-side mod-set check (abort on `unexpected_mod:*`), run laptop-side SpireLensMcp install via the existing `prepare-issue-agent-job.ps1 -InstallMcp -StartSts2`, poll `localhost:15526` via SSH-forwarded probe until ready, emit phase outputs `ssh_endpoint`, `tailnet_ip`, `working_dir`, `bridge_ready`. - `test-plan.sh`: ssh in, run existing `run-issue-agent-phases.ps1 -PhaseName test_plan` with renamed env vars (see step 4), scp `issue-agent-test-plan.json` back, emit `test_plan` output. - `implement.sh`: ssh in, run `… -PhaseName implementation`, push `glimmung/<run_id>` branch using a per-run GH clone-write token minted in the script (same pattern this issue used), scp result back, emit `implementation`, `branch_name` outputs. - `verify.sh`: ssh in, build + deploy `.dll`, prep scenario, run `… -PhaseName verification`, scp screenshots + `issue-agent-verification.json` back, upload screenshots to `romaineglimmungartifacts` via federated identity, emit `verification` output. - `env-destroy.sh`: ssh in, kill STS2 + SpireLensMcp, rm per-run working dir on laptop, tailscale logout (ephemeral node dies on its own). 4. **Rename env vars in `.github/scripts/*.ps1`** from GHA-shaped to glimmung-shaped: - `GITHUB_RUN_ID` → `GLIMMUNG_RUN_ID` - `GITHUB_RUN_ATTEMPT` → `GLIMMUNG_ATTEMPT_INDEX` - `GITHUB_REPOSITORY` → `GLIMMUNG_PROJECT_REPO` - `RUNNER_TEMP` → `GLIMMUNG_WORKING_DIR` - `GITHUB_WORKSPACE` → `GLIMMUNG_REPO_ROOT` - Per migration policy: rename in place, do not ship a compat shim that exports the old names. 5. **`AGENTS.md` updates:** - Drop the `D:\repos\STS2MCP` reference paragraph (the kunology fork is gone). - Replace the "issue-agent" GHA-runner description with a one-paragraph "issue-agent runs via glimmung-native SSH" pointer. - Mod policy (BaseLib / SpireLens / SpireLensMcp) unchanged. 6. **Add `docs/glimmung-workflow.md`** mirroring `nelsong6/ambience/docs/glimmung-workflow.md` (if it exists) or equivalent — captures the workflow registration JSON we will land via `POST /v1/workflows` after PR-S merges. Phase shape registered in glimmung Postgres (admin task A7), mirroring ambience exactly except for verify recycle policy: ``` env-prep depends_on: [] outputs: ssh_endpoint, tailnet_ip, working_dir, bridge_ready llm-work depends_on: env-prep jobs: test-plan + implement outputs: test_plan, implementation, branch_name llm-verify depends_on: llm-work verify: true outputs: verification evidence-gate depends_on: llm-verify recycle_policy: 3 attempts, on=[verify_fail, verify_malformed], lands_at=env-prep cleanup_early depends_on: evidence-gate always, skip_when_preserve_test_env touchpoint depends_on: cleanup_early always, primitive=pr_touchpoint touchpoint_gate depends_on: touchpoint primitive=pr_merge cleanup_final depends_on: touchpoint_gate always pr.recycle_policy: 3 attempts on [pr_review_changes_requested], lands_at=env-prep budget.total: 25 ``` ### Admin / data tasks (not in any PR) These are operator actions, not code changes: - **A1.** Generate SSH CA keypair (`ssh-keygen -t ed25519 -f glimmung-ssh-ca`). Private key → KV as `glimmung-ssh-ca-private-key`. Public key surfaced for laptop step L4. - **A2.** Paste the CA pubkey as a comment on this issue once A1 is done. - **A3.** Tailscale ACLs: define `tag:spirelens-host`, `tag:spirelens-orchestrator`; rule allowing `tag:spirelens-orchestrator` → `tag:spirelens-host:22`. Apply via the Tailscale admin console JSON. - **A4.** Run an admin-issued cert from the deployed PR-G endpoints, post the resulting SSH command in the issue for L6 smoke verification. - **A5.** Mint runner removal tokens for both GHA runners (GitHub Settings → Actions → Runners → each → remove → copy token) and paste in the issue when L9 is reached. - **A6.** Destroy the per-project screenshot storage tofu state (sequenced after PR-S merges so the workflow file is gone before the resource). - **A7.** Register the spirelens workflow in Postgres via `POST /v1/workflows` after both PR-G and PR-S are deployed. ### Sequence of operations ``` 1. PR-G drafted, reviewed, merged, deployed. [glimmung repo] 2. Laptop steps L1–L2 (install OpenSSH Server + Tailscale). [laptop session] 3. Admin tasks A1, A2, A3. [you] 4. Laptop steps L3–L5 (firewall + CA pubkey deposit + sshd_config). [laptop session] 5. Admin task A4 → laptop step L6 (smoke SSH cert flow). [you + laptop session] 6. Laptop steps L7–L8 (power profile + remove godotexplorer + stale clone). [laptop session] 7. PR-S drafted, reviewed, merged. [spirelens repo] 8. Admin task A6 (destroy screenshot storage tofu). [you] 9. Admin task A7 (register workflow in Postgres). [you] 10. First synthetic spirelens issue dispatched against the new path; verify ADVANCE. 11. Admin task A5 → laptop step L9 (decommission GHA runners + Startup shortcuts). [you + laptop session] 12. #179 closes. ``` Steps 1–6 can land before PR-S is even drafted, since none of them depend on the spirelens-side scripts existing. Steps 7–10 are the actual cutover. Step 11 is the no-going-back step and is correctly the last operational action. ### Confirm and proceed If this matches your intent, the next concrete action is **(1) draft PR-G** in the glimmung repo. Reply on this issue or in the parent session with "proceed with PR-G" (or call out any disagreement) and I'll spawn a glimmung worktree and start drafting. I will keep #179 as the audit trail for the laptop-side execution; the PR work will be tracked in its own PR descriptions and reference back here.
romaine-life-app[bot] commented 2026-05-28 18:42:28 -07:00 (Migrated from github.com)

PR-G is up: nelsong6/glimmung#632 — remote-host execution primitives.

Lands the two server-side primitives the SSH-replacement design depends on:

  • POST /v1/lease-callbacks/{callback_token}/ssh-cert — signs a 10-minute OpenSSH user cert over a caller-supplied pubkey. KeyId carries the lease ref for audit; principal is derived server-side as <project>-agent; permissions limited to permit-pty. Endpoint fails closed (HTTP 503) when the CA secret is empty.
  • POST /v1/lease-callbacks/{callback_token}/tailscale-authkey — mints a one-shot, ephemeral, pre-authorized Tailscale auth key tagged tag:<project>-orchestrator via the OAuth client-credentials flow. Same fail-closed shape.

Reuses the existing callback-token capability auth and gates on lease.state=claimed — no new admin path, no caller-supplied principals or tags. The glimmung-managed native-runner image gains openssh-client and tailscale (binaries only; tailscaled is launched per-run in userspace networking mode by project scripts, not by the image).

Design doc: docs/remote-host-execution.md. Threat model, endpoint contracts, KV/env wiring, and orchestrator-flow sketch all live there.

go vet, go test ./..., and helm template glimmung k8s all clean locally. PR description has the full Feature Contracts section. docker-build-check.yaml is currently in flight against the branch to confirm the runner image still builds with the new packages — I'll comment back here when that lands.

Nothing on this issue is blocked on PR-G review. The first laptop-side step (L1: install Windows OpenSSH Server) can run any time. L2 (install Tailscale) is also unblocked. L3–L6 wait for the CA pubkey, which lands when PR-G is merged and the operator does admin task A1.

**PR-G is up:** [nelsong6/glimmung#632 — remote-host execution primitives](https://github.com/nelsong6/glimmung/pull/632). Lands the two server-side primitives the SSH-replacement design depends on: - `POST /v1/lease-callbacks/{callback_token}/ssh-cert` — signs a 10-minute OpenSSH user cert over a caller-supplied pubkey. `KeyId` carries the lease ref for audit; principal is derived server-side as `<project>-agent`; permissions limited to `permit-pty`. Endpoint fails closed (HTTP 503) when the CA secret is empty. - `POST /v1/lease-callbacks/{callback_token}/tailscale-authkey` — mints a one-shot, ephemeral, pre-authorized Tailscale auth key tagged `tag:<project>-orchestrator` via the OAuth client-credentials flow. Same fail-closed shape. Reuses the existing callback-token capability auth and gates on `lease.state=claimed` — no new admin path, no caller-supplied principals or tags. The glimmung-managed native-runner image gains `openssh-client` and `tailscale` (binaries only; `tailscaled` is launched per-run in userspace networking mode by project scripts, not by the image). Design doc: [`docs/remote-host-execution.md`](https://github.com/nelsong6/glimmung/blob/spirelens-remote-host-primitives/docs/remote-host-execution.md). Threat model, endpoint contracts, KV/env wiring, and orchestrator-flow sketch all live there. `go vet`, `go test ./...`, and `helm template glimmung k8s` all clean locally. PR description has the full Feature Contracts section. `docker-build-check.yaml` is currently in flight against the branch to confirm the runner image still builds with the new packages — I'll comment back here when that lands. Nothing on this issue is blocked on PR-G review. The first laptop-side step (L1: install Windows OpenSSH Server) can run any time. L2 (install Tailscale) is also unblocked. L3–L6 wait for the CA pubkey, which lands when PR-G is merged and the operator does admin task A1.
romaine-life-app[bot] commented 2026-05-28 20:35:43 -07:00 (Migrated from github.com)

Admin task A1 + A2 complete (pre-merge).

  • A1. ed25519 SSH CA generated, private key uploaded to KV as glimmung-ssh-ca-private-key (version 12327d3f223148cca295565997d0f120, tagged algorithm=ed25519, rotated=2026-05-29, comment=glimmung-ssh-ca-2026-05). Local copy on the session pod has been deleted.
  • A2. CA public key below, for laptop step L4 (deposit at C:\ProgramData\ssh\trusted_user_ca_keys):
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJarsnXPSZo7uRW3yee9qSgL5N1fxQ05zvCkHmzZDI9m glimmung-ssh-ca-2026-05

When the laptop session is ready to do L4, the exact PowerShell (from the locked plan) is:

$ca = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJarsnXPSZo7uRW3yee9qSgL5N1fxQ05zvCkHmzZDI9m glimmung-ssh-ca-2026-05"
Set-Content -LiteralPath 'C:\ProgramData\ssh\trusted_user_ca_keys' -Value $ca -Encoding ascii
icacls 'C:\ProgramData\ssh\trusted_user_ca_keys' /inheritance:r /grant 'SYSTEM:(R)' /grant 'Administrators:(R)'

Verification: Get-Content C:\ProgramData\ssh\trusted_user_ca_keys should return the line above; icacls should show SYSTEM + Administrators only.

The KV secret only gets read by glimmung after PR-G (#632) merges and ArgoCD rolls the new pod image, so sitting in KV right now is harmless — ExternalSecret will materialize it on the next deployment refresh.

Still pending on the operator side: A3 (Tailscale OAuth client + tenant ACL) — needs you in the Tailscale admin console. I can spec the exact steps and the JSON snippet when you're ready.

**Admin task A1 + A2 complete (pre-merge).** - **A1.** ed25519 SSH CA generated, private key uploaded to KV as `glimmung-ssh-ca-private-key` (version `12327d3f223148cca295565997d0f120`, tagged `algorithm=ed25519, rotated=2026-05-29, comment=glimmung-ssh-ca-2026-05`). Local copy on the session pod has been deleted. - **A2.** CA public key below, for **laptop step L4** (deposit at `C:\ProgramData\ssh\trusted_user_ca_keys`): ``` ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJarsnXPSZo7uRW3yee9qSgL5N1fxQ05zvCkHmzZDI9m glimmung-ssh-ca-2026-05 ``` When the laptop session is ready to do L4, the exact PowerShell (from the locked plan) is: ```powershell $ca = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJarsnXPSZo7uRW3yee9qSgL5N1fxQ05zvCkHmzZDI9m glimmung-ssh-ca-2026-05" Set-Content -LiteralPath 'C:\ProgramData\ssh\trusted_user_ca_keys' -Value $ca -Encoding ascii icacls 'C:\ProgramData\ssh\trusted_user_ca_keys' /inheritance:r /grant 'SYSTEM:(R)' /grant 'Administrators:(R)' ``` Verification: `Get-Content C:\ProgramData\ssh\trusted_user_ca_keys` should return the line above; `icacls` should show SYSTEM + Administrators only. The KV secret only gets read by glimmung after PR-G ([#632](https://github.com/nelsong6/glimmung/pull/632)) merges and ArgoCD rolls the new pod image, so sitting in KV right now is harmless — `ExternalSecret` will materialize it on the next deployment refresh. **Still pending on the operator side:** A3 (Tailscale OAuth client + tenant ACL) — needs you in the Tailscale admin console. I can spec the exact steps and the JSON snippet when you're ready.
nelsong6 commented 2026-05-28 23:43:08 -07:00 (Migrated from github.com)

PR-S is up: #180.

Matches the locked plan exactly:

  • Deletes issue-agent.yaml, sts2-host-smoke.yml, opentofu-issue-agent-screenshot-storage.yml, the infra/opentofu/issue-agent-screenshot-storage/ tofu module, and publish-issue-agent-screenshots.ps1 — no compat, no soak (Q2).
  • Adds scripts/glimmung-native/{lib,env-prep,test-plan,implement,verify,env-destroy}.sh. lib.sh is the shared helper layer (glimmung lease-callback wrappers, tailscaled bring-up, SSH/scp helpers, per-run keypair gen). The five phase scripts dispatch on $GLIMMUNG_STEP_SLUG.
  • Renames GITHUB_RUN_ID|GITHUB_RUN_ATTEMPT|GITHUB_REPOSITORY|RUNNER_TEMP|GITHUB_WORKSPACE → GLIMMUNG_* in the kept pwsh scripts. grep -rn confirms no stragglers.
  • AGENTS.md drops the stale D:\repos\STS2MCP reference and adds a one-paragraph "Issue-agent execution model" section describing the new orchestrator + SSH-over-Tailscale model.
  • docs/glimmung-workflow.md carries the phase shape + JSON registration spec the operator POSTs to glimmung.romaine.life/v1/workflows.

env-prep fail-closed posture per Q3: the probe-mod-set step lists mods/ and aborts with unexpected_mod:<name> on anything outside {BaseLib, SpireLens, SpireLensMcp}. On the current laptop state, the first run will refuse to advance until godotexplorer is removed (#179 laptop step L8).

Operator follow-ups after merge (none of these are in PR-S):

  1. Destroy the screenshot-storage tofu state at nelsontofu/spirelens/issue-agent-screenshot-storage.tfstate.
  2. Register the workflow in Glimmung Postgres via POST /v1/workflows using the JSON in docs/glimmung-workflow.md.
  3. Confirm tag:spirelens-host is applied to the laptop (laptop session steps L2/L6).
  4. Decommission the two GHA self-hosted runners on the laptop (step L9).

Unblocked once #180 merges and the four operator steps land: first synthetic spirelens issue dispatched against the new path will exercise the full federation + SSH + verify-loop chain end-to-end.

**PR-S is up: [#180](https://github.com/nelsong6/spirelens/pull/180).** Matches the locked plan exactly: - **Deletes** `issue-agent.yaml`, `sts2-host-smoke.yml`, `opentofu-issue-agent-screenshot-storage.yml`, the `infra/opentofu/issue-agent-screenshot-storage/` tofu module, and `publish-issue-agent-screenshots.ps1` — no compat, no soak (Q2). - **Adds** `scripts/glimmung-native/{lib,env-prep,test-plan,implement,verify,env-destroy}.sh`. `lib.sh` is the shared helper layer (glimmung lease-callback wrappers, tailscaled bring-up, SSH/scp helpers, per-run keypair gen). The five phase scripts dispatch on `$GLIMMUNG_STEP_SLUG`. - **Renames** `GITHUB_RUN_ID|GITHUB_RUN_ATTEMPT|GITHUB_REPOSITORY|RUNNER_TEMP|GITHUB_WORKSPACE` → `GLIMMUNG_*` in the kept pwsh scripts. `grep -rn` confirms no stragglers. - **AGENTS.md** drops the stale `D:\repos\STS2MCP` reference and adds a one-paragraph "Issue-agent execution model" section describing the new orchestrator + SSH-over-Tailscale model. - **`docs/glimmung-workflow.md`** carries the phase shape + JSON registration spec the operator POSTs to `glimmung.romaine.life/v1/workflows`. **env-prep fail-closed posture per Q3:** the `probe-mod-set` step lists `mods/` and aborts with `unexpected_mod:<name>` on anything outside `{BaseLib, SpireLens, SpireLensMcp}`. On the current laptop state, the first run will refuse to advance until `godotexplorer` is removed (#179 laptop step L8). **Operator follow-ups after merge** (none of these are in PR-S): 1. Destroy the screenshot-storage tofu state at `nelsontofu/spirelens/issue-agent-screenshot-storage.tfstate`. 2. Register the workflow in Glimmung Postgres via `POST /v1/workflows` using the JSON in `docs/glimmung-workflow.md`. 3. Confirm `tag:spirelens-host` is applied to the laptop (laptop session steps L2/L6). 4. Decommission the two GHA self-hosted runners on the laptop (step L9). Unblocked once #180 merges and the four operator steps land: first synthetic spirelens issue dispatched against the new path will exercise the full federation + SSH + verify-loop chain end-to-end.
nelsong6 commented 2026-07-05 15:45:18 -07:00 (Migrated from github.com)

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.

Closing during repository issue cleanup. If this becomes active work again, we can reopen or recreate it as a fresh, specific task.
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#179
No description provided.