feat(cli): add autosubmit scheduling for submit#351
Open
dmego wants to merge 3 commits intojunhoyeo:mainfrom
Open
feat(cli): add autosubmit scheduling for submit#351dmego wants to merge 3 commits intojunhoyeo:mainfrom
dmego wants to merge 3 commits intojunhoyeo:mainfrom
Conversation
Contributor
|
@dmego is attempting to deploy a commit to the Inevitable Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
5 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="crates/tokscale-cli/src/tui/settings.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/settings.rs:33">
P2: Using command-layer `AutosubmitConfig` directly in settings creates brittle serialization that can silently reset all user settings on schema changes. The type lacks serde defaults, and `load()` uses `unwrap_or_default()` which discards all settings (not just autosubmit) if any field fails to deserialize. Consider adding serde defaults to `AutosubmitConfig` fields or using a separate settings-layer DTO with explicit migration/validation logic.</violation>
</file>
<file name="crates/tokscale-cli/src/main.rs">
<violation number="1" location="crates/tokscale-cli/src/main.rs:898">
P1: Add #[serde(default)] to all boolean fields in SubmitFilterArgs to prevent deserialization failures when config fields are missing</violation>
</file>
<file name="crates/tokscale-cli/src/commands/autosubmit.rs">
<violation number="1" location="crates/tokscale-cli/src/commands/autosubmit.rs:134">
P2: Unbounded interval values may cause chrono timestamp overflow/panic. The `parse_interval_spec` function accepts any u32 value without upper bound validation. Values like u32::MAX days (~4.3 billion days, ~11.7 million years) exceed chrono's DateTime representable range and will cause a panic when added to a timestamp in `is_due()`. Consider enforcing a reasonable maximum interval (e.g., 365 days or 10 years) during parsing.</violation>
<violation number="2" location="crates/tokscale-cli/src/commands/autosubmit.rs:704">
P2: Duplicate manual flag mappings in submit_args_to_cli_args and format_submit_args can diverge from SubmitFilterArgs definitions, causing autosubmit behavior mismatches</violation>
</file>
<file name="README.ja.md">
<violation number="1" location="README.ja.md:433">
P2: Missing `autosubmit run` command in Japanese README documentation. The autosubmit feature supports commands `enable|disable|status|run` but the Japanese documentation only lists `enable`, `status`, and `disable`, making the `run` command undiscoverable for Japanese users who rely on localized documentation.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Contributor
There was a problem hiding this comment.
4 issues found across 7 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="README.ko.md">
<violation number="1" location="README.ko.md:440">
P3: Autosubmit docs are internally inconsistent: the synopsis omits `tokscale autosubmit run` while the added bullet claims it exists.</violation>
</file>
<file name="README.md">
<violation number="1" location="README.md:443">
P2: README autosubmit synopsis is internally inconsistent: it omits the documented `autosubmit run` subcommand, which can mislead users about available CLI commands.</violation>
</file>
<file name="README.ja.md">
<violation number="1" location="README.ja.md:441">
P2: Autosubmit docs are internally inconsistent: `run` is documented in bullets but missing from the command synopsis block.</violation>
</file>
<file name="crates/tokscale-cli/src/tui/settings.rs">
<violation number="1" location="crates/tokscale-cli/src/tui/settings.rs:76">
P1: `Settings::load()` now drops `autosubmit` on any strict-load failure, which can silently disable and later persistently erase autosubmit config.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
Closes #123
Summary
tokscale autosubmit enable|disable|status|run--dry-rununavailable in autosubmitsettings.jsonlaunchdsystemd --user, withcronfallbackDetails
autosubmit runreuses submit behavior while keeping autosubmit logs minimalautosubmit statusreports both saved config state and live scheduler stateautosubmit disablecan clear unsupported or orphaned scheduler configurationsdryRunvalues are sanitized out before autosubmit executiontokscaledirectly instead of/bin/shValidation
cargo test --package tokscale-cli autosubmit -- --nocapturecargo run -p tokscale-cli -- submit --helpcargo run -p tokscale-cli -- autosubmit enable --helpcargo run -p tokscale-cli -- autosubmit enable --interval 2h --dry-runlaunchctl/systemctl --user/schtasks)Summary by cubic
Add autosubmit scheduling to
tokscale submit, with enable/status/disable/run and robust cross‑platform scheduler and status handling. Hardened config parsing, interval validation, and recovery to handle invalid configs and orphaned jobs.New Features
tokscale autosubmit enable|disable|status|run.submitfilters;--dry-runblocked for autosubmit and sanitized before execution.settings.json; status shows saved config and live scheduler state (degraded/orphaned), anddisablecan clear unsupported/orphaned scheduler entries.launchd(macOS),systemd --userwithcronfallback (Linux), Windows Task Scheduler; macOS now runstokscaledirectly vialaunchd.Bug Fixes
autosubmitconfig parsing and interval handling: onlyNh|Nd, positive integers, invalid units/zero rejected, extreme values capped.settings.jsonloading and recovery for invalid autosubmit config; improved status detection and cleanup of orphaned/unsupported scheduler jobs.Written for commit f647cfe. Summary will update on new commits.