Drop heartbeats, migrate to pwsh, post-#157 staleness, escape PR title #159

Merged
romaine-life-app[bot] merged 1 commit from chore/issue-agent-pwsh-and-cleanup into main 2026-04-28 20:59:48 -07:00
romaine-life-app[bot] commented 2026-04-28 20:55:14 -07:00 (Migrated from github.com)

Bundle of cleanup from a process review. Five files; the workflow change is the substantive one.

Post-#157 staleness

  • README.md — drop the "Development Workflow" section that linked to docs/pull-only-workflow.md (deleted in #157, link was 404). Rewrite the "Storage" paragraph from the integer-version framing (v1 / v2 / v16, "schema versioned") to the structural shape detector that #157 actually shipped.
  • Tests/SpireLens.Core.Tests/RedMaskStatsTests.cs — rename RunData_V15WithoutWeakApplied_DeserializesWithZeroDefault → RunData_FromOlderShapeWithoutWeakApplied_DeserializesWithZeroDefault. #157's body says it renamed the same-shaped tests in BagOfMarbles / Pocketwatch / Orichalcum away from V17/V16/… framing; Red Mask was missed. Test logic is unchanged — still pins the missing-field-defaults-to-zero deserializer behavior.
  • docs/issue-agent.md, docs/laptop-issue-agent-runner.md — trim issue-agent-blocked / issue-agent-complete / issue-agent-pr-open from the labels lists. Grep confirms no workflow ever applies them; the docs claimed they were "applied by the workflow."

issue-agent.yaml

powershell → pwsh everywhere

Every shell: powershell -NoProfile -ExecutionPolicy Bypass -File {0} becomes shell: pwsh. PowerShell 7+ is already a documented runner prereq and installed on the active hosts. This kills two real bug classes:

  • Out-File -Encoding utf8 writes BOM-free in pwsh but writes a UTF-8 BOM in WinPS 5.1, which would corrupt $GITHUB_OUTPUT / $GITHUB_ENV parsing on first append.
  • Native arg passing: pwsh's Standard mode (default everywhere except Windows) handles quoted args correctly; WinPS 5.1's Legacy parser mangles strings containing ", backticks, or unbalanced braces.

Also bumped explicit intent: Out-File -Encoding utf8 → -Encoding utf8NoBOM (and same for the Set-Content / Add-Content JSON / log writers). pwsh's utf8 already means BOM-free, but the explicit name matches the intent and survives any future regression.

Heartbeats deleted

Glimmung releases the lease on the workflow_run.completed webhook plus the release-glimmung-lease job (the explicit fast-path). The heartbeat steps (synchronous + background) added nothing on the happy path and introduced a leak (background powershell.exe was never killed on a self-hosted runner) plus a fail-fast bug (synchronous heartbeat 502 would kill the whole phase before any work ran).

This depends on Glimmung's lease_default_ttl_seconds being raised so a long-tail workflow (~85 min worst case = max(test-plan, implementation) + verification plus build/prep/screenshot overhead) fits comfortably under TTL with no heartbeats. Sibling PR in nelsong6/glimmung will bump the value before this lands.

gh pr create → gh api

The "Create pull request" step previously passed $title (sourced from the LLM's pr_title) directly to gh pr create --title $title. Even on pwsh with Standard arg passing this would be fragile if the title ever needed unusual escaping. Switched to building a JSON payload with ConvertTo-Json and calling gh api --method POST repos/<slug>/pulls --input payload.json. JSON encodes everything correctly. (gh pr create has --body-file but no --title-file, otherwise that would have been the one-line fix.)

Risk

  • README / docs / test-rename are non-functional.
  • pwsh migration: pwsh is already required by the laptop runner doc and installed on the active hosts. No backward-compat shim needed since the fleet is a known set of self-hosted runners.
  • Heartbeat deletion: depends on Glimmung's lease_default_ttl_seconds being raised before this lands on a long-tail run. Coordinate with the corresponding glimmung change.
  • gh api PR creation hits the same REST endpoint gh pr create calls internally, with the same scopes. html_url and number come straight from the response JSON.
Bundle of cleanup from a process review. Five files; the workflow change is the substantive one. ## Post-#157 staleness - **README.md** — drop the "Development Workflow" section that linked to `docs/pull-only-workflow.md` (deleted in #157, link was 404). Rewrite the "Storage" paragraph from the integer-version framing (`v1 / v2 / v16`, "schema versioned") to the structural shape detector that #157 actually shipped. - **Tests/SpireLens.Core.Tests/RedMaskStatsTests.cs** — rename `RunData_V15WithoutWeakApplied_DeserializesWithZeroDefault` → `RunData_FromOlderShapeWithoutWeakApplied_DeserializesWithZeroDefault`. #157's body says it renamed the same-shaped tests in BagOfMarbles / Pocketwatch / Orichalcum away from `V17/V16/…` framing; Red Mask was missed. Test logic is unchanged — still pins the missing-field-defaults-to-zero deserializer behavior. - **docs/issue-agent.md**, **docs/laptop-issue-agent-runner.md** — trim `issue-agent-blocked` / `issue-agent-complete` / `issue-agent-pr-open` from the labels lists. Grep confirms no workflow ever applies them; the docs claimed they were "applied by the workflow." ## issue-agent.yaml ### `powershell` → `pwsh` everywhere Every `shell: powershell -NoProfile -ExecutionPolicy Bypass -File {0}` becomes `shell: pwsh`. PowerShell 7+ is already a documented runner prereq and installed on the active hosts. This kills two real bug classes: - **`Out-File -Encoding utf8` writes BOM-free in pwsh** but writes a UTF-8 BOM in WinPS 5.1, which would corrupt `$GITHUB_OUTPUT` / `$GITHUB_ENV` parsing on first append. - **Native arg passing**: pwsh's `Standard` mode (default everywhere except Windows) handles quoted args correctly; WinPS 5.1's Legacy parser mangles strings containing `"`, backticks, or unbalanced braces. Also bumped explicit intent: `Out-File -Encoding utf8` → `-Encoding utf8NoBOM` (and same for the `Set-Content` / `Add-Content` JSON / log writers). pwsh's `utf8` already means BOM-free, but the explicit name matches the intent and survives any future regression. ### Heartbeats deleted Glimmung releases the lease on the `workflow_run.completed` webhook plus the `release-glimmung-lease` job (the explicit fast-path). The heartbeat steps (synchronous + background) added nothing on the happy path and introduced a leak (background `powershell.exe` was never killed on a self-hosted runner) plus a fail-fast bug (synchronous heartbeat 502 would kill the whole phase before any work ran). This depends on Glimmung's `lease_default_ttl_seconds` being raised so a long-tail workflow (~85 min worst case = `max(test-plan, implementation) + verification` plus build/prep/screenshot overhead) fits comfortably under TTL with no heartbeats. Sibling PR in `nelsong6/glimmung` will bump the value before this lands. ### `gh pr create` → `gh api` The "Create pull request" step previously passed `$title` (sourced from the LLM's `pr_title`) directly to `gh pr create --title $title`. Even on pwsh with `Standard` arg passing this would be fragile if the title ever needed unusual escaping. Switched to building a JSON payload with `ConvertTo-Json` and calling `gh api --method POST repos/<slug>/pulls --input payload.json`. JSON encodes everything correctly. (`gh pr create` has `--body-file` but no `--title-file`, otherwise that would have been the one-line fix.) ## Risk - README / docs / test-rename are non-functional. - pwsh migration: pwsh is already required by the laptop runner doc and installed on the active hosts. No backward-compat shim needed since the fleet is a known set of self-hosted runners. - Heartbeat deletion: depends on Glimmung's `lease_default_ttl_seconds` being raised before this lands on a long-tail run. **Coordinate with the corresponding glimmung change.** - `gh api` PR creation hits the same REST endpoint `gh pr create` calls internally, with the same scopes. `html_url` and `number` come straight from the response JSON.
Sign in to join this conversation.
No reviewers
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!159
No description provided.