Skip to content

CI against the real learner-server through one throwaway test device per run - #7

Merged
onthegonow merged 4 commits into
mainfrom
ci/production-test-device
Nov 13, 2026
Merged

onthegonow merged 4 commits into
mainfrom
ci/production-test-device

Conversation

@onthegonow

Copy link
Copy Markdown
Contributor

Each run now also tests against the owner's production learner-server, through one throwaway test device. Nothing touches the owner's records.

What a run does:

  • prod-device uses the CI minter's key (secret LEARNER_CI_MINT_KEY, scope ci-mint) to createTestDevice and seedMasteryGain. The pairing code goes to a mode-600 file outside the public logs, and only ids are printed.
  • ProductionServerTests (heavy, GitHub runner only) checks:
    • the app's own code pairs from the code, heartbeats with pairing state ok, and is confined (another device's endpoints and a web-only RPC are refused);
    • the mastery feed announces exactly the seeded gain, and feedback is recorded once.
  • prod-revoke always runs, even after a failure or cancel, and removes the device and everything it wrote. The device also dies at its 120-minute TTL.

Secrets and coverage:

  • The minter's key is only in those two steps. A fork's pull request skips by name. A missing secret on this repo's own runs fails, and so does a device that was made while its suite skipped.

Review: an adversarial review before the first run found one blocker and four should-fixes. All are fixed in this PR. Auto-merge is off until the run's outputs are reviewed too.

🤖 Generated with Claude Code

onthegonow and others added 4 commits November 13, 2026 00:40
…e per run

- prod-device (before the heavy lane): createTestDevice and seedMasteryGain with the CI
  minter's key (secret LEARNER_CI_MINT_KEY, scope ci-mint). The device's pairing code
  goes to a mode-600 file outside ci-out; only ids are printed.
- prod-revoke (always runs, even after a failure or cancel): revokeTestDevice removes
  the device and everything it wrote. The device also dies at its 120-minute TTL.
- The minter's key is in the env of these two steps only. Forks get no secrets, and the
  suite then skips by name.
- ProductionServerTests (heavy, GitHub runner only): the app's own code pairs from the
  code (health and identity checked), heartbeats (pairing state ok), and is confined to
  itself: another device's endpoints are refused, and so are RPCs outside a test
  device's allowance. The mastery feed then announces exactly the seeded gain, and its
  feedback is recorded once (a replay returns the same row). The device key stays in
  memory and is never printed or an assertion operand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Blocker: a test device may call getBaselineStatus (the feed needs it), so the
  confinement check expected the wrong 403. It now checks getMasteryProgress, a
  read-only web RPC outside the allowance.
- The device file is written right after createTestDevice, so prod-revoke finds the
  device even when seeding fails or the run is cancelled before the seed.
- The feed test no longer depends on the heavy lane starting within 15 minutes of the
  seed: the feed's install time and cursor are set from the gain's completedAt.
- A missing secret fails the run unless it is a fork's pull request. A device that was
  made while its suite skipped is a failure in the report, not a green skip.
- Secrets stay out of failure output and process arguments: Pairing.Payload's
  description omits the key; ProdDevice's omits the code; ids are compared as plain
  strings; curl takes the key on stdin (-H @-); python takes replies on stdin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is a warning (each speaking phase checks again)

PR #7's run: the production lane passed end to end (device created, both suites green,
revoked), but the speech phase failed: say stayed silent for its minute of retries right
after corespeechd was killed, then worked in every later phase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… outputs

The review found nothing leaked and nothing real changed on production, and confirmed
that revoke removes everything. Two production claims proved less than they said.

- Nothing showed the app called production and not the runner's own local
  learner-server, which passes the same identity check. The device file now carries
  the API URL the device was created on; the test asserts the pinned URL equals it and
  prints the host.
- The confinement that matters, that a test device cannot read the owner's mastery,
  was not tested: the feed's short lookback would hide the owner's gains anyway. A new
  test asks for every notification since 1970 and requires exactly this device's
  seed. Its messages report counts only, never rows.
- The feedback check's comment now says what it tests: the server's idempotence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@onthegonow
onthegonow merged commit 7b19f3e into main Nov 13, 2026
1 check passed
@onthegonow
onthegonow deleted the ci/production-test-device branch November 13, 2026 01:23
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