Skip to content

feat(canary,ha-proof): adopt liveness selector revision - #89

Merged
kyle-sexton merged 2 commits into
mainfrom
ci/liveness-selector-internal-consumers
Jul 13, 2026
Merged

feat(canary,ha-proof): adopt liveness selector revision#89
kyle-sexton merged 2 commits into
mainfrom
ci/liveness-selector-internal-consumers

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Internal-consumer follow-through for the liveness selector (ci-workflows#86, merged at 3415de3):

  • local-runner-canary.yml + production-ha-proof.yml: selector pin 66e3e973415de3ff2fafee40e4d087eb6073d2f6952b595; direct-output assertions adapted from idle semantics (reason=idle, idle-runner-count) to liveness semantics (reason=online, online-runner-count). Topology proofs keep their own REST-derived idle counts — only the selector contract changes.
  • production-ha-proof.cjs drain-hold: SELECTED_IDLE_COUNTSELECTED_ONLINE_COUNT, reason gate idleonline; generated workflow blocks re-rendered (--check clean).
  • Canary preflight rerun-guard message updated — reruns no longer route hosted; the guard stays because proof evidence wants a fresh dispatch.
  • Private-caller templates repinned to the new implementation commit 169e3a4 (two-commit flow: implementation first, then repin referencing its SHA, matching the existing pin-fetch pattern in ci.yml).

Test plan

  • node --test .github/scripts/*.test.cjs: 169 pass, 0 fail (includes pinned-revision contract tests via git show 169e3a4).
  • render-production-ha-proof-workflow.cjs --check: clean.
  • Live canary/HA-proof dispatches happen under github-iac#79 acceptance (fleet online/offline routing evidence).

Part of melodic-software/github-iac#79, epic melodic-software/github-iac#78.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EPDbXgonTuFwFwdTtHaCmw


Note

Medium Risk
Changes pinned self-hosted routing contracts for acceptance workflows; misalignment with fleet or selector behavior could block canary/HA proof until live acceptance runs.

Overview
Adopts the liveness select-runner revision (3415de3) in local-runner-canary.yml and production-ha-proof.yml, replacing the prior pin. Canary and production validation now require selector outputs with reason=online and online-runner-count instead of idle semantics; REST topology inventory in HA proof still uses its own idle/online counts from the API.

production-ha-proof.cjs and the generated workflow embeds use SELECTED_ONLINE_COUNT and the same reason gate; private seed templates and contract tests repin the reviewed implementation commit 169e3a4, with ci.yml fetching that SHA for pinned-revision tests. Canary preflight copy clarifies that attempt 1 is still required for evidence quality, not because reruns force hosted routing.

Reviewed by Cursor Bugbot for commit e7376e3. Bugbot is set up for automated code reviews on this repo. Configure here.

kyle-sexton and others added 2 commits July 13, 2026 17:24
Bump the internal select-runner pins to
3415de3 and adapt the direct-output
assertions from idle semantics (reason=idle, idle-runner-count) to
liveness semantics (reason=online, online-runner-count). Topology
idle-capacity proofs keep their own REST-derived idle counts; only the
selector contract changes.

Part of melodic-software/github-iac#79.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPDbXgonTuFwFwdTtHaCmw
Points both private-caller templates at commit
169e3a4 (the liveness-selector canary
and HA-proof implementation), records the superseded revisions in the
contract tests, and updates the CI pin fetch to the new commit.

Part of melodic-software/github-iac#79.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPDbXgonTuFwFwdTtHaCmw
@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_15f32e0d-994d-415f-a341-1e0b468ee92e)

@claude

claude Bot commented Jul 13, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 59s —— View job


PR Review: feat(canary,ha-proof): adopt liveness selector revision

  • Gather PR diff and changed files
  • Review workflow YAML changes (canary + HA-proof)
  • Review CJS script changes (production-ha-proof.cjs)
  • Review test changes
  • Review template repins
  • Review README changes
  • Post findings

This is a clean mechanical follow-through of the idle→online semantic rename introduced in #86. No correctness issues found. Notes below.

SHA pinning

The two-layer pin strategy holds throughout:

  • Selector pin advanced correctly: 66e3e973415de3ff2 in both local-runner-canary.yml and production-ha-proof.yml.
  • Template caller pins advanced to 169e3a4 — same SHA for both canary and HA-proof, which is correct since 169e3a4 (the implementation commit) is what the templates reference.
  • Old SHAs correctly retired to supersededSelectorShas / supersededCanaryShas in the test files.

ci.yml fetch consolidation

The two-line fetch collapsed to one:

# before: two separate SHAs
git fetch … ca3c19c fdf0e6e
# after: single combined implementation SHA
git fetch … 169e3a4

ci.yml L352 — This is correct and cleaner: both workflows now share the same pinned implementation commit, so one fetch suffices. The tests' git show 169e3a4 calls verify the contract at that SHA.

Idle→online rename completeness

Verified with a grep across .github/: zero residual references to SELECTED_IDLE_COUNT, IDLE_RUNNER_COUNT, idle-runner-count, or reason=idle remain. All renamed consistently:

Old New
idle-runner-count output online-runner-count
IDLE_RUNNER_COUNT env ONLINE_RUNNER_COUNT env
SELECTED_IDLE_COUNT env SELECTED_ONLINE_COUNT env
idleRunnerCount property onlineRunnerCount property
reason=idle gate reason=online gate

Dual drain-hold in production-ha-proof.yml

The workflow contains two inline drain-hold script blocks (at lines ~704 and ~1465), both generated from production-ha-proof.cjs. Both are updated identically — and --check passing clean confirms the CJS source and rendered YAML are in sync. No concern.

Intentionally retained idle references

The remaining idle occurrences in production-ha-proof.cjsidleCount, desktop-idle/laptop-idle outputs, and the summary line "Laptop retained at least one online idle runner." — are correct. These belong to the REST-based topology proof, which separately validates idle capacity at the group level. The PR description makes this explicit ("Topology proofs keep their own REST-derived idle counts"). The mixed phrasing "online idle runner" in that summary line accurately describes the laptop group invariant (must have at least one runner that is both online and idle per the REST query).

Rerun guard message

local-runner-canary.yml L109:

-  [[ "$RUN_ATTEMPT" = 1 ]] || fail "reruns must route hosted; start a new dispatch"
+  [[ "$RUN_ATTEMPT" = 1 ]] || fail "canary evidence needs a fresh dispatch, not a rerun"

Good improvement. The old message was inaccurate post-rename (reruns no longer guarantee a hosted route under the online selector) and the new message correctly explains why the guard exists (fresh evidence), not just what happens.

Test coverage

Both test files properly reflect the new contracts:

  • local-runner-canary.test.cjs: doesNotMatch regex updated from idle-runner-count to online-runner-count, and the two assertion regexes updated for SELECTED_REASON=online and ONLINE_RUNNER_COUNT.
  • production-ha-proof.test.cjs: implementationSha updated; both select-runner.yml@… assertions updated to the new selector SHA.

Overall: LGTM. The rename is complete and consistent, pin hygiene is maintained, the test suite covers the contracts, and the fetch consolidation is a clean improvement.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot was skipped (usage limit reached), so automated review did not complete. Human review is needed before merge; no reviewers were assigned because no non-author maintainers are visible for this repo.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@kyle-sexton
kyle-sexton merged commit c18c3d7 into main Jul 13, 2026
38 checks passed
@kyle-sexton
kyle-sexton deleted the ci/liveness-selector-internal-consumers branch July 13, 2026 21:32
kyle-sexton added a commit that referenced this pull request Jul 13, 2026
## Summary

#89 updated the immutable-pin fetch step in `ci.yml` but missed the
identical step in `selector-conformance.yml`. On main-push runs the
squashed PR branch commits are unreachable from a plain full-history
checkout, so `git show 169e3a4` inside the pin tests fails — the
post-merge `selector-conformance` run on main is red. PR runs passed
because the PR merge ref still reached those commits, which hid the gap.

One-line fix: fetch `169e3a4287211a536eddcd3a757dd06132fb556e` (the
liveness canary/HA-proof implementation commit) instead of the two
superseded pins.

Part of melodic-software/github-iac#79, epic #78.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01EPDbXgonTuFwFwdTtHaCmw

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> CI workflow-only change to which git objects are fetched; no runtime,
auth, or application logic.
> 
> **Overview**
> Aligns **`selector-conformance.yml`** with **`ci.yml`** by updating
the **Fetch immutable workflow pins under test** step to shallow-fetch a
single commit (`169e3a4…`) instead of two superseded SHAs.
> 
> That commit is the current liveness canary / HA-proof implementation
pin exercised by the immutable-pin tests. After squashed merges, those
old commits are not reachable from a full-history checkout on **main**,
so `git show` in the tests failed on post-merge runs even though PR runs
still passed.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
061172d. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant