Refactor monetization to controller-based reconciliation + autoresearch#315
Closed
bussyjd wants to merge 1 commit into
Closed
Refactor monetization to controller-based reconciliation + autoresearch#315bussyjd wants to merge 1 commit into
bussyjd wants to merge 1 commit into
Conversation
- Rename `copy` → `patched` in controller.go to avoid shadowing the built-in copy function (4 occurrences) - Revert cosmetic whitespace changes in kubectl.go and verifier.go that added review noise without functional benefit - Add ApplyOutput to kubectl.go cleanly atop the original formatting - Remove SetRegistration/HandleWellKnown from verifier (now handled by serviceoffer-controller registration resources) - Update CLAUDE.md dev constraints to mention serviceoffer-controller image https://claude.ai/code/session_016ktZi3zLxbnWrjF8cLyTjm
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly refactors the monetization system to move ServiceOffer reconciliation from a Python CLI script into a dedicated Kubernetes controller, while adding comprehensive autoresearch capabilities (coordinator, worker, publisher). The changes establish a cleaner separation of concerns: the controller handles all CRD state management and ERC-8004 registration side effects, while the Python CLI becomes a thin helper for CRUD operations and catalog publishing.
Key Changes
Monetization Architecture Refactor
cmd/serviceoffer-controller/main.go,internal/serviceoffercontroller/): New Kubernetes controller that owns ServiceOffer reconciliation, child resource management, and ERC-8004 registration side effectsinternal/embed/infrastructure/base/templates/registrationrequest-crd.yaml): Isolates ERC-8004 publication from ServiceOffer, enabling cleaner async side-effect handlinginternal/x402/source.go,internal/x402/serviceoffer_source.go): Decouples pricing configuration from ServiceOffer CRD, supporting both static and dynamic pricing modelsAutoresearch System (New)
internal/embed/skills/autoresearch-coordinator/scripts/coordinate.py): Discovers GPU workers via ERC-8004/8004scan API, probes x402 pricing, submits experiments with micropayments, replaces Ensue-based shared-memory modelinternal/embed/skills/autoresearch-worker/scripts/worker_api.py): Minimal HTTP service for running submitted train.py experiments, storing results, exposing x402-gatable endpointsinternal/embed/skills/autoresearch/scripts/publish.py): Publishes best autoresearch results to Ollama and optionally sells via x402CLI Enhancements
obol sell probe(cmd/obol/sell.go): New subcommand to check x402 pricing for a worker endpointobol sell httpimprovements: Better integration with ServiceOffer controller lifecycleflows/flow-*.sh): Comprehensive test flows covering stack init, inference, agent setup, selling, buying, and lifecycle managementInfrastructure & Testing
flows/flow-10-anvil-facilitator.sh): Local test infrastructure for paid flowsinternal/openclaw/import.go): Better model API key environment handlingCode Quality
errorsimports across packagesmap[string]interface{}tomap[string]anyfor Go 1.18+ compatibilityinternal/network/validate.gofor install option validationNotable Implementation Details
https://claude.ai/code/session_016ktZi3zLxbnWrjF8cLyTjm