Skip to content

docs(session-control): spec the closed-authoring-session cron refusal as shipped - #17641

Merged
bolichen97 merged 1 commit into
mainfrom
fix/cron-owner-spec-8449
Oct 7, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/cron-owner-spec-8449

Conversation

@buluoray

@buluoray buluoray commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Make the session-control spec describe the cron dispatch refusal that main actually ships when a job's authoring session has closed.

docs/system-specs/modules/session-control.md says that when a cron job's session_key names a session that is no longer open, _app_owned_cron_refusal "returns nothing" and the fail-closed direction "is wrong here". Since #8335 the code does the opposite: it refuses with cron_owner_unverifiable (src/kiro_crew/dashboard/session_control.py, the owning_slot is None branch), and test/test_cron_session_control.py::TestAppOwnedCron::test_a_job_whose_authoring_session_has_closed_fails_closed pins it. The refusal table row above it also omits this case.

Why it matters

The spec is what reviewers and agents read before touching this security gate. A paragraph that calls the shipped fail-closed arm a mistake invites someone to "fix" the code back to the fail-open #8335 closed, and gives an operator no recovery path for a refused user cron.

Not a goal

What changed (motivation → approach → change)

Stale spec text contradicts the shipped gate → rewrite it to match the code, docstring and pinned test → two edits in docs/system-specs/modules/session-control.md:

Backwards compatibility

Compatible: documentation only; no runtime behaviour changes.

Removes nothing: the diff replaces a spec paragraph that described behaviour the code no longer has.

Tests

No test change; the described behaviour is already pinned. Ran timeout 900 python3 -m pytest -n0 test/test_cron_session_control.py -x -q -k fails_closed with PYTHONPATH=<worktree>/src: 4 passed, including test_a_job_whose_authoring_session_has_closed_fails_closed.

Manual verification

N/A — docs-only; cross-checked each sentence against _app_owned_cron_refusal on origin/main and the cron adopt rows in src/kiro_crew/docs/cron-and-scheduling.md.

Decision for the owner

#8449 asks whether a user-created dispatching cron whose authoring tab has closed should be allowed to dispatch again, which needs an ownership record the confined app cannot influence (a new field written host-side at cron_add, or a separate gateway-written store, decided together with #13583's owner_app). This draft does not make that call and only ships the decision-free slice the thread converged on, correcting the spec to the shipped fail-closed gate with cron adopt --release as the documented recovery, because every input the gate can read today is selectable by the party being confined.

Related Issues

Refs #8449. Related: #8335, #13583.

Pattern harvest

Not generalizable: a single spec paragraph that a same-commit code change contradicted; the code, docstring and test were already consistent.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 14f4464d62fb18e532fcfb494da6468d68480bda — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Confirm that a --released job, which has no session_key, really passes _app_owned_cron_refusal, since the new spec text promises this as the recovery path.

[DESIGN-REVIEWED] 14f4464

Description read

[DESCRIPTION-READ] 583ef189acb2c43f44310c90952dd0c2260bb4d505bc477bd9f86fa6b800e8cd

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 14f4464d62fb18e532fcfb494da6468d68480bda — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 14f4464

Verdict parsed from the review's SHA-scoped output markers for commit 14f4464d62fb18e532fcfb494da6468d68480bda.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 14f4464d62fb18e532fcfb494da6468d68480bda: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 14f4464d62fb18e532fcfb494da6468d68480bda and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 14f4464

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 14f4464d62fb18e532fcfb494da6468d68480bda: <one-sentence reason>

@buluoray

buluoray commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Disposition of the Design Review advisory (confirm that a released job passes _app_owned_cron_refusal): verified on this head. The CLI's --release flag calls CronService.adopt_job(job_id, "") in src/kiro_crew/cli_commands.py, which writes an empty session_key. In _app_owned_cron_refusal, a job whose created_by does not start with app: and whose session_key is empty skips the owning-session branch and returns None, so it is not refused. test/test_cron_session_control.py::TestAppOwnedCron::test_a_user_owned_cron_is_unaffected exercises that path (a job with only a non-app created_by). No doc change needed.

@buluoray
buluoray marked this pull request as ready for review October 7, 2026 18:20
@buluoray
buluoray requested a review from a team as a code owner October 7, 2026 18:20
@buluoray
buluoray requested a review from bolichen97 October 7, 2026 18:20
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 7, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

The rewrite matches the code. _app_owned_cron_refusal fails closed with cron_owner_unverifiable when the authoring session has closed, and test_a_job_whose_authoring_session_has_closed_fails_closed pins that. The cron adopt --release recovery is also confirmed in your disposition. It is docs-only and the AI lanes are clean. I'm holding it only because it rewrites the spec for app-confinement security gating, and the accepted-cost wording plus the #8449/#13583 direction should be signed off by a maintainer who owns that gate.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. The rewritten paragraph in session-control.md now matches the owning_slot is None branch of _app_owned_cron_refusal, which returns cron_owner_unverifiable, and the recovery command it names (with --release or --session-of) exists in cli.py. The refusal table row matches too.

@bolichen97
bolichen97 merged commit 1ffcfc2 into main Oct 7, 2026
103 checks passed
@bolichen97
bolichen97 deleted the fix/cron-owner-spec-8449 branch October 7, 2026 22:53
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 7, 2026
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.

3 participants