Skip to content

feat(runners): pin aixle-runner 0.1.0 in config/settings.yml; gateway services take named parameters (task #220) - #689

Merged
NOX73 merged 9 commits into
developfrom
feature/runner-pins-0-1-0
Nov 11, 2026
Merged

NOX73 merged 9 commits into
developfrom
feature/runner-pins-0-1-0

Conversation

@NOX73

@NOX73 NOX73 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

What

Follow-up of #676 (board task #220). It pins the first runner release and layers the runner gateway: transport in the controllers, named parameters in the services.

  1. The pins move into config/settings.yml.
    • The runners.release block sits under the existing runners: key. It has plain values (no ENV, no ERB) and keeps the comments of the old file.
    • config/runner_release.yml is deleted, along with the add_source! line that loaded it.
    • config/initializers/_config_settings.rb stays and holds only Settings.reload!. The reload is needed because the config gem loads Settings before Dotenv.load runs in development.rb/test.rb.
    • Runners::Release and config/initializers/runner_release.rb stay, so an invalid block still fails boot.
    • grep -rn "runner_release.yml" finds nothing, including in .github/workflows/runner-release.yml (header comment and release-notes text).
  2. Pin 0.1.0: recommended_version: "0.1.0", min_version: null. Under binaries, the linux-amd64 and linux-arm64 SHA-256 come from the checksums.txt of runner-v0.1.0, downloaded with gh release download runner-v0.1.0 -R AixleHQ/flow -p checksums.txt:
    55af0ecb22c70f52ca4213f7f310c6321ba0e1d175545f663c1c948107caad44  aixle-runner-linux-amd64
    e27d43e8d29ec520f5868b4394d66c9e95ea7476ffc3ee3d0a85e6b259527441  aixle-runner-linux-arm64
    
  3. CHANGELOG: a "Runner compatibility" entry under [Unreleased] / Changed.
  4. Runners::Release::Offer#platform is removed, since nothing read it.
  5. docs/index.md: the operations/releasing.md entry now names runner compatibility and releasing the runner.
  6. Gateway layering: a service takes named parameters and never sees the request, its body or its headers.
    • Controllers (transport):
      • check_protocol checks the protocol and the version's form.
      • For register only, check_registration_version runs next to it, after the token. It refuses a version over 255 characters (invalid_registration) and a version below min_version (runner_version_unsupported).
      • The body's shape is checked against the protocol schema (invalid_registration, invalid_result).
      • The body is mapped by the wire rules: an absent os or arch is nil, facts defaults to {}, auto_update defaults to true, ephemeral is body["ephemeral"] == true, and exit_code becomes an Integer.
    • register.request.json lets a body with ephemeral: true pass, whatever the rest of it holds (if/then, const: true). The service then refuses such a body with ephemeral_not_supported, so the refusal order of PROTOCOL.md §5.1 is unchanged: version length, min_version, ephemeral, then the body.
    • Strict types (Alex, code review round 3). ephemeral is a JSON boolean: any other value ("true", 1, 0.0, null) is invalid_registration, with no Rails boolean cast. os and arch are optional strings of at most 255 characters: any other value, null included, is invalid_registration instead of being ignored. Protocol 1 isn't released, so nothing is kept for compatibility. Unknown fields are still ignored.
    • Services (domain):
      • Runners::Registration.register!(credential, name:, os:, arch:, facts:, ephemeral:, auto_update:, runner_version:, protocol_version:) refuses ephemeral, strips the name, and saves the machine. The machine's validations refuse a blank name or a value over its column with invalid_registration.
      • Runners::Operations.record_result!(operation, status:, exit_code: nil, stdout: nil, stderr: nil, data: nil, error: nil) stores the known fields, with a nil one left out.
    • One refusal mechanism: services raise Runners::Credentials::Refused, which the base controller's rescue_from maps through REFUSAL_STATUS. The controllers' own refusals use the same codes. Statuses and codes are unchanged; the invalid_registration message for the body now also names ephemeral and string os/arch.
    • The ops long-poll's after/wait parsing stays in OperationsController.
  7. The rule is written down in docs/architecture/implementation-patterns.md ("Error Handling") and in DESIGN.md §6.1 ("Request schemas").

Every reference to the old file is updated:

  • releasing.md ("Runner compatibility", and step 3 of "Releasing the runner");
  • DESIGN.md §6, §12.1, §14.2, §14.3 and row 10 of §15;
  • PROTOCOL.md and fixtures/README.md;
  • the code comments.

Interaction with #677

#677 adds runners: proxy: to settings.yml. This PR adds release: under the same runners: key. Whichever PR merges second keeps both blocks under that one key.

How to test

  • Run bin/rails test test/services/runners/ test/integration/runner_gateway_test.rb test/integration/runner_gateway_operations_test.rb test/integration/runner_gateway_releases_test.rb test/integration/runner_protocol_conformance_test.rb.
  • runner_gateway_operations_test.rb is unchanged and passes. runner_gateway_test.rb keeps its existing tests, including an ephemeral: true body that would otherwise fail the schema, which is still answered ephemeral_not_supported. It gains tests for the strict types: ephemeral: "true", 1 and 0.0 are invalid_registration (with a valid or an invalid body), false or absent registers, a non-string os or arch is invalid_registration, and an absent one registers as nil.
  • The conformance fixture register/boundaries.json now expects 422 invalid_registration for a non-string os or arch.
  • In runner_gateway_releases_test.rb, GET /runner/v1/releases/0.1.0/linux-{amd64,arm64} answers 302 to the release asset, with the released digest in X-Aixle-Runner-Sha256. The test reads the committed pins, with no stub.
  • The service tests call register! and record_result! with named parameters. They cover the ephemeral refusal before the machine's validations, those validations, the stripped name, and the stored result.
  • protocol_schema_test.rb covers the schema's ephemeral: true exemption, the strict boolean ephemeral and the strict string os/arch.
  • release_test.rb checks the committed block against the released digests. It also checks that an invalid block makes Runners::Release.pins raise InvalidPins.

… request checks in the services (task #220)

- The runner pins move from config/runner_release.yml into the
  runners.release block of config/settings.yml; the add_source! loader
  is gone, and Runners::Release still fails boot on an invalid block.
- Pin runner-v0.1.0: the linux-amd64 and linux-arm64 SHA-256 from the
  release's checksums.txt, recommended_version 0.1.0, min_version null.
- Runners::Release::Offer loses platform, which nothing read.
- Runners::Registration.register! takes the request body and raises every
  refusal in PROTOCOL.md 5.1 order; Runners::Operations.record_result!
  checks op_result.request and builds the stored result. The controllers
  only call them, and invalid_result joins REFUSAL_STATUS.
- docs: the rule in implementation-patterns.md Error Handling, releasing.md,
  DESIGN.md, PROTOCOL.md, docs/index.md, CHANGELOG.

Signed-off-by: Alex <[email protected]>
aixle-com Bot pushed a commit that referenced this pull request Nov 10, 2026
…220)

Conflict in docs/index.md resolved: staging's azure-devops-app-registration line, the feature's operations/releasing.md line.
Comment thread config/settings.yml Resolved
Comment thread app/services/runners/registration.rb Resolved
Comment thread test/services/runners/release_test.rb Resolved

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one [Must]: .github/workflows/runner-release.yml still names config/runner_release.yml. Apply the patch attached to task #220 before merge. The other two comments are non-blocking recommendations. Everything else matches the task: the pins in settings.yml, digests that match checksums.txt, the refusal order kept, and controllers that check only transport.

Comment thread config/initializers/_config_settings.rb Resolved
Comment thread config/initializers/runner_release.rb Resolved

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 2 at 3c6ff59c. All round-1 findings are resolved: the workflow no longer names the deleted file, Settings.reload! is restored, the service helpers are private, and the boot test is split. CI is green with 17/17 checks. I left one non-blocking [Recommendation] (update the stale PR description before merge) and one [Note] (comment wrap). Approving.

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changing my verdict from approve to request changes. The second review's [Must] on docs/architecture/implementation-patterns.md:208 is correct, and I missed it in round 2. docs/design/agent-runtimes/DESIGN.md §6.1, the "Request schemas (task #209)" paragraph at lines 1161–1170, still says the controllers call Runners::ProtocolSchema.valid? and answer the refusal, and that new gateway endpoints in 8b/8c follow that pattern. That contradicts task item 6, the new Error Handling rule, and the code. This PR doesn't touch that paragraph. Please rewrite it so that the services check and normalize bodies and raise Runners::Credentials::Refused, and the controllers keep transport checks and status mapping. No other changes are needed. My [Recommendation] (stale PR description) and [Note] (comment wrap) remain non-blocking.

…s handle transport (task #220)

Runners::Registration.register! and Runners::Operations.record_result! take
named parameters and never the request body. The gateway controllers check
the headers (the register version refusals sit next to check_protocol), the
body's shape against the protocol schema, and map the body by the wire rules.
register.request.json lets a body that asks for ephemeral through, so the
refusal order of PROTOCOL.md 5.1 is unchanged. DESIGN.md 6.1 and the Error
Handling rule describe the layering.

Signed-off-by: Alex <[email protected]>
@aixle-com aixle-com Bot changed the title feat(runners): pin aixle-runner 0.1.0 in config/settings.yml, gateway request checks in the services (task #220) feat(runners): pin aixle-runner 0.1.0 in config/settings.yml; gateway services take named parameters (task #220) Nov 11, 2026

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 3 at fb24fc32: the layering matches Alex's decision. Services take named parameters, and the controllers handle headers, the schema check and the wire-rule mapping. The gateway request tests are unchanged from develop, the docs agree with the code, and CI is green. I left one non-blocking [Recommendation] on how the schema and the controller decide ephemeral, which differ for 0.0. There are no [Must] findings.

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changing my verdict to request changes after the second review. It found the same ephemeral: 0.0 divergence independently and rated it [Must], because the acceptance criterion says the register answers don't change and Alex decided the schema would use the same truth values as the Boolean cast. I agree, so this blocks the merge.

A fix can't live in the schema alone. JSON Schema treats 0.0 as equal to 0, and 0.0 also matches "type": "integer". So the controller has to keep the decision about ephemeral (for example, by checking the cast before the schema check, as develop did), or Alex has to accept the 0.0 change. Either option revisits round 2's "the controller doesn't need to know about ephemeral", so Alex should choose.

…ict strings (task #220)

Alex's code review round 3 decision: no Rails boolean cast. The schema is
the only definition of asking for ephemeral (const true); any other
non-boolean value, and an os or arch that is not a string, is
invalid_registration.

Signed-off-by: Alex <[email protected]>
Comment thread config/settings.yml Resolved

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 4: the delta fc1546a6 matches Alex's round-3 decision (strict boolean ephemeral, strict string os/arch), and its tests and docs are consistent. One [Must] remains: the branch conflicts with develop in config/settings.yml after #677 merged. Both runners: blocks need to be kept under one key, and CI needs to pass on the merged tree.

NOX73 and others added 2 commits November 11, 2026 20:34
…s-0-1-0

* origin/develop:
  feat(coder): clone GitLab, Bitbucket and Azure DevOps repos in coder_prepare_repo (#703)
  fix(agents): show each runtime's own logo everywhere (#704)
  feat(teams): assign cards to a team and run triggers as a team (#701)
  feat(agents): collect the Copilot CLI transcript as a session log (#700)
  fix(agents): keep Grok and Antigravity conversations in the terminal scrollback (#698)
  feat(billing): redesign the Billing tab around active and previous subscriptions (#646)
  feat(web): switch the UI, admin, public pages and emails to Inter (#699)
  chore(deps): weekly dependency batch — aws-sdk-core 3.267 retry fix, prism 2, Mantine 9.7.5, runner Go 1.27.4 (#697)
  fix(board): leave archived tasks out of agent board listings (#690)
  feat(agents): add GitHub Copilot CLI as an agent runtime (#684)
  feat(runners): the callback proxy — the proxy sidecar, the host runner relay and the gateway proxy route (task #216, 8b) (#677)

Signed-off-by: Rozhnov Alexandr <[email protected]>
@aixle-com

aixle-com Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Addressed in 9b57d94e, as Alex decided: Runners::Proxy.holder(route, environment, session_id:, key:) takes named parameters and no service receives request.headers. ProxiesController#forward reads X-Session-Id and the route's key header (new Runners::Proxy.key_header(route): X-Session-Key for mcp, the route's own header for credential routes, none for assets) and passes the values. The refusals are unchanged (403 session_not_on_environment in the same cases). Service tests call holder with named parameters; DESIGN.md's session-check line is updated.

aixle-com Bot pushed a commit that referenced this pull request Nov 11, 2026
Conflicts were between staging's feature-branch merges of #677, #684 and an
earlier head of #689 and develop's squash-merges of #677/#684 (plus #700,
#704). Each hunk takes develop's side (the final, reviewed version), except
config/settings.yml, which keeps the runners.release block of #689, and
CHANGELOG.md, which keeps both sides' entries. Staging-only content (#494)
merged without conflict and is kept.
aixle-com Bot pushed a commit that referenced this pull request Nov 11, 2026

@aixle-com aixle-com Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Round 6 at head 9b57d94: the Proxy.holder named-parameter change matches Alex's decision. Behaviour is unchanged (same 403 cases), the only caller is updated, and the tests and DESIGN.md match. No remarks.

@NOX73
NOX73 merged commit 7fd946d into develop Nov 11, 2026
17 checks passed
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