Skip to content

fix(automation): refuse incomplete stored job documents - #4468

Merged
ScriptedAlchemy merged 5 commits into
masterfrom
codex/lossless-automation-jobs
Oct 24, 2026
Merged

ScriptedAlchemy merged 5 commits into
masterfrom
codex/lossless-automation-jobs

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Why

Ordinary job edits could discard undecodable siblings because the loader returned a filtered list. Refuse incomplete stored documents before a caller can rewrite them. Fixes #4422.

What changed

  • Validate the versioned envelope and every stored job before returning an editable list.
  • Preserve valid per-job extension fields and return safe configuration errors for invalid entries.

Scope

Job loading, CRUD, and scheduler admission use the existing persistence owner.

Blast Radius

Malformed configurations now need explicit operator repair. Healthy jobs keep their current behavior.

Verification

Before the fix, mixed valid/invalid documents loaded a filtered list and the dashboard create handler succeeded. The regressions now require a typed refusal and byte-exact preservation, including create, update, delete, and scheduler admission. Five persistence tests and three dashboard tests passed.

bazel test //crates/tracedecay-automation-runtime:unit_test --test_arg=automation::jobs::scheduler_config_tests:: --test_arg=automation::jobs::persistence_tests:: --test_output=errors
bazel test //crates/tracedecay-dashboard-api:unit_test --test_arg=automation_jobs_api::tests:: --test_output=errors
bazel test //crates/tracedecay:automation_runner_test --test_arg=job_persistence_ --test_arg=load_jobs_refuses_corrupt --test_output=errors

Three root integration tests also passed, covering normal persistence, retained extension fields, and refusal without rewriting. Independent source review found no correctness issues.

Linux CI exposed one scheduler test that still expected the old parser-error wording. The test now checks the typed configuration refusal, the safe file-specific diagnostic, and unchanged corrupt bytes. All 13 focused scheduler/persistence tests and the crate formatting check passed in the shared development checkout; the run includes the separately owned cron regression. This follow-up changes only the scheduler refusal test and its import. Required hosted checks must validate the updated PR head.

Master integration at 5980d8cb07be748756ff3d9a2b04d9b6420633aa includes the landed scheduler coalescing repair from #4388 and Hermes CI repair from #4453. The original issue patch is unchanged. Independent integration review passed. Local macOS Bazel verification passed 18 actual tests: five persistence, eight scheduler configuration, one dashboard CRUD refusal, three automation-runner persistence, and one scheduler coalescing test. Test result caching was disabled. These results cover the merged tree; required hosted checks for this new head remain authoritative.

Validation on the Cursor machine

Check out codex/lossless-automation-jobs and open that checkout in Cursor. Run the focused Bazel commands above from the repository root and confirm each test filter executes tests. Add the command output and operating system to this PR. Cursor is unavailable on the development machine; these local results do not claim Cursor host validation.

@changeset-bot

changeset-bot Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5980d8c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy enabled auto-merge (squash) October 22, 2026 23:08
@ScriptedAlchemy
ScriptedAlchemy merged commit 645131b into master Oct 24, 2026
16 checks passed
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.

fix(automation): refuse lossy user-job rewrites when stored entries or schema cannot be decoded

1 participant