Simplify agent work completion and status classification#204
Open
arjunkomath wants to merge 1 commit into
Open
Simplify agent work completion and status classification#204arjunkomath wants to merge 1 commit into
arjunkomath wants to merge 1 commit into
Conversation
- Unify backup/restore completion through the work-item result protocol: the agent reports terminal outcomes (with typed output) via the status endpoint's attempt-fenced completion path, and the dedicated backup/complete, backup/failed, and restore/complete callback routes are deleted along with the agent's HTTP report methods. - Add WorkPayloadByType so enqueueWork is compile-time checked per work type; fixes a nullable storagePath slipping into restore payloads and types the autoheal payloads. - Compile Traefik desired state (routes, certs, ports, hashes) once per expected-state snapshot; drift planning, application, and routing-sync reporting now share one immutable compiled snapshot. - Reuse observedReadyPhases/isObservedReady from deployment-status.ts instead of inline ["healthy", "running"] sets across workflows, queries, and dashboard components. - Rewrite AGENT.md (project facts, repo map, verified commands) and symlink CLAUDE.md to it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
React Doctor found no issues. 🎉
|
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
Implements four items from the code-simplification review, net −35 lines with three duplicated decision points collapsed to one each.
One completion protocol for agent work
Backup and restore now complete through the existing work-item result path (
POST /api/v1/agent/status) instead of dedicated callback endpoints:WorkItemResultgains a typedoutputfield; completion side effects forbackup_volume(row update +resourceStatusChanged) andrestore_volume(restore/migration events) run incompleteWorkItemResults, fenced by(serverId, workId, attempt)so stale attempts can't clobber final state.backup/complete,backup/failed,restore/completeroutes;ReportBackupComplete/ReportBackupFailed/ReportRestoreCompleteclient methods; the agent's entirereportFailurecallback pattern inbackup.go.Typed work-queue payloads
WorkPayloadByTypemaps every work type to its payload shape andenqueueWorkis generic over it. This caught two real issues: a nullablestoragePathcould reach restore payloads (now guarded), and the autoheal payloads were untyped.Traefik state compiled once per snapshot
CompiledTraefikStateconverts and hashes routing data once per expected-state snapshot (memoized by snapshot identity). Drift planning, Traefik application, and routing-sync reporting consume the same compiled snapshot, so no path can compute convergence differently.Consolidated status classification
Replaced ~12 inline
["healthy", "running"]sets withobservedReadyPhases/isObservedReadyacross workflows, DB queries, and dashboard components. Intentionally-different sets (rollout progress UI, serverless wake handling) left untouched.Docs
Rewrote
AGENT.md(project facts, repo map, verified commands, completed the critical-restrictions section) and symlinkedCLAUDE.mdto it so agents load it automatically.Testing
web:tsc --noEmitclean, all 290 tests pass, biome cleanagent:go build,go vet,go testpass,gofmtclean🤖 Generated with Claude Code