Skip to content

fix(apps): reject non-string cron execution selectors - #10053

Closed
leonlaiyc wants to merge 1 commit into
kirodotdev:mainfrom
leonlaiyc:fix/app-manifest-cron-selector-types
Closed

leonlaiyc wants to merge 1 commit into
kirodotdev:mainfrom
leonlaiyc:fix/app-manifest-cron-selector-types

Conversation

@leonlaiyc

@leonlaiyc leonlaiyc commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

An app manifest cron with a present non-string command or script selector is currently coerced to an empty string. The manifest then validates and the scheduler sees neither execution selector, so the job falls through to the default-agent mode and runs its message instead of rejecting corrupted input.

Why it matters

A malformed non-string cron command or script is currently accepted and coerced into absence. The scheduler can then silently run the job in default-agent mode instead of rejecting corrupted manifest input, changing execution semantics rather than merely emitting a validation warning.

What changed

  • Record present non-null non-string command and script values as cron type violations.
  • Reuse manifest validation to reject them with an actionable expected-type error.
  • Preserve the established null-means-absent convention.
  • Document both execution-selector fields and their validation contract.

Tests

  • Red-before: both command=7 and script=7 parsed empty and produced no validation error (2 failures).
  • Green-after: focused cron tests 9 passed; full test_app_manifest.py 227 passed.
  • flake8, documentation lint, and diff check passed.

Collision check

No open PR addresses cron selector typing or issue #9895. PR #9907 also edits apps/manifest.py, but only adds the unrelated append-only event-log contribution schema in distant sections; it does not touch CronEntry parsing or validation.

Manual verification

N/A — manifest parsing and the admission error are deterministic unit-level contracts.

Related Issues

Closes #9895.

Pattern harvest

Rule candidate: manifest execution selectors that are present and non-null must be type-checked before any normalization that can turn them into absence. The focused cron tests pin both command and script.

Checklist

  • One Conventional Commit
  • Deterministic regression coverage
  • Manifest reference updated
  • No secrets or credentials

Contribution License Agreement

Generated with Codex.

A malformed command or script selector was silently erased during manifest parsing, changing the cron into a default-agent job. Record the type violation so validation rejects the manifest while preserving null as the supported absent spelling.

Refs kirodotdev#9895
@leonlaiyc
leonlaiyc requested review from a team and dwu96 September 11, 2026 02:57
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — ✅ no blocking findings

Reviewed 2baef8351338b325c32f3c166a4bbc356efc391f via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 2baef83

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 2baef8351338b325c32f3c166a4bbc356efc391f via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Sound fix mirroring the established timezone flagging pattern, but the new tests are spliced into an existing test, silently relocating its absent-key assertions.

Watch

  • The new tests are inserted inside test_cron_enabled_boolean_values_accepted (patch hunk @@ -284,6 +284,29 @@): the trailing # Absent key: default enabled, no error. block (test/test_app_manifest.py:287-292) is severed from that test and, by indentation, becomes the tail of test_cron_null_execution_selector_remains_absent. The enabled-default pin still executes today, but it now lives under an unrelated test name — a future edit or deletion of the selector test drops that pin silently, and the enabled test no longer covers the absent-key case its structure promised. This restructuring is nowhere in the PR description.
    Clears when: the two new tests are moved after line 292 so test_cron_enabled_boolean_values_accepted retains its absent-key tail intact.

[DESIGN-REVIEWED] 2baef83

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed 2baef8351338b325c32f3c166a4bbc356efc391f via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 2baef83

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🟡 CONCERNS

Premise-level review of 2baef8351338b325c32f3c166a4bbc356efc391f via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All lenses check out on the base code: the fix reuses the existing _str_or_flagged helper and _CRON_FIELD_JSON_TYPES table (mechanism level, matching the recorded rationale that silently-invisible degradation gets the flagged treatment), the defect is verifiable by reading base (_str_or_empty coerces command: 7 to "" and validate() reports nothing, so the new test fails on base), and the doc update is mandated same-commit by AGENTS.md. The one real problem is the test insertion point: the new tests are spliced into base line 287, mid-body of test_cron_enabled_boolean_values_accepted, so that test's trailing absent-key assertions (test/test_app_manifest.py:287-292) now execute as the tail of the new test_cron_null_execution_selector_remains_absent.

First-Principles-Verdict: CONCERNS

The new tests splice into an existing test: test_cron_enabled_boolean_values_accepted's absent-key assertions now run inside test_cron_null_execution_selector_remains_absent.

Not justified as shipped

  1. The absent-enabled pin moved into the new selector test — undeclared, rides along: insertion at base line 287 splits test_cron_enabled_boolean_values_accepted (test/test_app_manifest.py:287-292), so its "absent key → default enabled" assertions detach from the test named for them and run, twice-parametrized, inside an unrelated selector test.

What this change ships

Inventory (5 items) — 4 justified

Intent: stop a non-string cron command/script in an app manifest from being silently coerced to absent and run as a default-agent job — a FIX (issue #9895; the added test fails on base by inspection of _str_or_empty).

  1. A cron with a non-string command is now rejected at manifest validation instead of silently running in agent mode — justified
  2. Same rejection for a non-string script — justified
  3. null for either selector still means absent, no error — justified
  4. Manifest reference documents the command/script rows and their rejection contract — justified
  5. Absent-enabled default assertions relocated into the new null-selector test — undeclared, rides along (accidental mid-test insertion)

Watch

  • The splice leaves test_cron_enabled_boolean_values_accepted no longer pinning the absent-key default it is named for; the pin survives only inside a selector test where nobody will look for it. Clears when: the two new tests are inserted after base line 292 and lines 287-292 stay in their original test.

Subtractions

  • Delete the trailing enabled-default block (comment + from_dict + two asserts) from test_cron_null_execution_selector_remains_absent — it belongs to test_cron_enabled_boolean_values_accepted; end the new test at its own final assert.

[FIRST-PRINCIPLES-REVIEWED] 2baef83

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 12, 2026
@NicholasRBowers NicholasRBowers added the needs-pr-triage PR scanner: awaiting automated triage label Sep 19, 2026
@chenmingwei23 chenmingwei23 added drive-to-green PR claimed by drive-to-green pipeline and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 19, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor

Kiro Crew [operator: chenmingwei23#de330d0c]: This PR has been inactive for 7+ days with failing CI. I assessed the blockers and they are resolvable. I will push fixes directly to this branch as a co-author.

Assessment: move the new selector tests outside the existing enabled test, retain its absent-key assertions, rebase, and re-run focused manifest tests.

If you prefer no automated changes, add the pr-no-autofix label.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 22, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you for this fix, @leonlaiyc! 🙏

Your change has landed as an in-repo replacement PR, #16420, which is now fully green and ready to merge. The original PR was branched from a fork, which blocked the merge path, so we re-opened the identical change on a branch in this repository and resolved a small docs conflict with current main.

Your commit keeps its original authorship — your name stays in the git history on #16420 (Rebase and merge preserves it) — and you'll be credited in the README Contributors list.

Closing this one in favour of #16420. Thanks again for the contribution!

@iamwhatever iamwhatever closed this Oct 3, 2026
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 3, 2026
@mbriones98 mbriones98 removed the drive-to-green PR claimed by drive-to-green pipeline label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App manifest cron selectors (command/script) coerce non-strings instead of rejecting — mode fallthrough

5 participants