Repository navigation
Harden the POD job model and unify CLI/REST service interfaces - #37
Merged
Merged
Conversation
Introduce canonical lifecycle, structured job errors, and shared status results for synchronous CLI and asynchronous REST execution.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31bdb7ab97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Make REST submission responses deterministically pending, classify service-owned persistence failures as artifacts, and add endpoint and compiled-CLI integration coverage.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Closes #11
Before this change, the service exposed
RunRequest/RunResult, while REST maintained an independent taggedJobStatusenum and string-only failure table. That split allowed lifecycle and error semantics to diverge between interfaces.This PR introduces a canonical application job model in
spod::service:JobIdremains the shared string identity; REST generates UUID strings and synchronous callers use their configured run ID.JobStateis the stable serializable lifecycle:pending -> running -> succeededorpending -> running -> failed.JobStatuscarries the ID, workflow, optionalJobResult, and optional structuredJobError.JobErrorCodeprovides stable machine-readable categories:configuration,input,unsupported,artifact,scientific, andinternal.JobStorecentralizes atomic in-memory transitions and deliberately releases its lock before runner execution.REST now uses the shared status/result/error types and is limited to HTTP adaptation plus the current in-memory store. The CLI
runcommand executes through the same service API and formats the canonical terminal status; it does not implement scientific behavior. Health remains deterministic as{status: "ok", version: ...}.Semantics and scope
JobStatus.Validation
cargo fmt --all -- --checkcargo check --locked --workspace --all-targets --all-featurescargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --no-default-features --no-fail-fastcargo test --workspace --all-features --no-fail-fastcargo test --doc --workspace --all-featurescargo doc --workspace --no-depsbash scripts/check_dep_graph.shbash scripts/check_no_todos.shbash scripts/check_legacy_name_refs.shcargo deny --all-features checkReview fixes
Follow-up review fixes are included in commit 456f38c: POST /jobs now always returns the retained accepted pending snapshot; REST endpoint tests cover health, submit/pending, eventual success/artifacts, failure/artifact error code, and unknown IDs; service-owned request persistence failures map through ServiceError to the artifact category; lifecycle terminal-field invariants and impossible transition handling are covered; and compiled CLI integration tests cover validation and run success/failure. The explicit example CLI commands and the full validation matrix pass.