Skip to content

server: remove the Reconciler interface - #532

Merged
yongruilin merged 3 commits into
google:mainfrom
yongruilin:ax-remove-reconcile-interface
Oct 29, 2026
Merged

yongruilin merged 3 commits into
google:mainfrom
yongruilin:ax-remove-reconcile-interface

Conversation

@yongruilin

Copy link
Copy Markdown
Collaborator

Fixes #514.

server.NewServer now takes the *controller.TaskReconciler directly and reads actor state through its client, so ax-server wires a single value.

  • Removes server.Reconciler, Options.Reconciler, Options.Substrate, and the nil checks they required.
  • ax-server now exits if it can't create the Substrate client, instead of running without reconciliation.
  • Adds internal/substrate/substratetest, an in-memory Substrate control API. The server and CLI tests now drive a real TaskReconciler against it, replacing fakeReconciler, fakeSubstrate and fakeMainReconciler.

Reviewing commit by commit is easiest:

  1. The new package.
  2. The test migration, still on the old API. It changes only tests, plus a TaskReconciler.Client getter.
  3. The refactor. Its test changes are mechanical.

Lets the server and CLI tests run a real TaskReconciler against a fake
Substrate.
Replace fakeReconciler, fakeSubstrate and fakeMainReconciler with a
TaskReconciler running against substratetest. Add TaskReconciler.Client,
which the server will use to read actor state.
NewServer takes a *controller.TaskReconciler and reads actor state
through its client. Options.Reconciler and Options.Substrate are gone,
and ax-server now exits if it can't create the Substrate client.

Fixes google#514.

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice, and splitting it into three commits made this easy to review. LGTM from me. @rakyll leaving the final look to you since it's your area.

@janetkuo janetkuo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. As I brought up in #514 (comment), now that Server holds *controller.TaskReconciler directly, CreateTask, SuspendTask, and ResumeTask don't need to funnel through a single Reconcile call by mutating task.Status.Phase in memory. We can split out explicit Suspend / Resume methods in a small follow-up PR. @yongruilin @mayawang happy to put up a quick PR if that sounds good.

@benzaidfoued benzaidfoued 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.

/lgtm

@yongruilin

Copy link
Copy Markdown
Collaborator Author

LGTM. As I brought up in #514 (comment), now that Server holds *controller.TaskReconciler directly, CreateTask, SuspendTask, and ResumeTask don't need to funnel through a single Reconcile call by mutating task.Status.Phase in memory. We can split out explicit Suspend / Resume methods in a small follow-up PR. @yongruilin @mayawang happy to put up a quick PR if that sounds good.

ref: #514 (comment)

@rakyll

rakyll commented Oct 28, 2026

Copy link
Copy Markdown
Member

This looks good to me. Feel free to follow up with a follow up PR to follow up from #514 (comment).

@yongruilin

Copy link
Copy Markdown
Collaborator Author

@janetkuo i created a separate issue #534

@yongruilin
yongruilin merged commit 37dda66 into google:main Oct 29, 2026
10 checks passed
yongruilin added a commit that referenced this pull request Oct 30, 2026
* controller: replace Reconcile with Suspend and Resume

The server calls Suspend or Resume instead of setting the task's phase
for Reconcile to read. The reconciler no longer writes the phase; the
server decides it. ReconcileDelete becomes Delete.

Fixes #534.

* docs: update AGENTS.md and the substrate skill

Describe the explicit Suspend/Resume/Delete flow, and list substratetest,
which the server and CLI tests have used since #532.
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.

server: remove the Reconciler interface

5 participants