Skip to content

revert(cron): hide every app's secret from cron children, keep own bundle - #16853

Merged
iamwhatever merged 1 commit into
mainfrom
revert/pr-16442
Oct 5, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
revert/pr-16442

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Take #16442 back out of main, so no app cron can break from it, until a safer version is re-landed.

#16442 (squash commit 69ee1083e1bd9643328a29ee6f47937dce041990) hid every app's .app_secret from cron children. The maintainer decided to revert it first and re-land it later, for three reasons:

  1. It never ran against a real OS sandbox. Only unit tests and a recorded-libc harness ran. The earlier version of this change, fix(cron): mask the apps tree from every cron child that runs model-supplied code #13273, caused a p1 outage the same way.
  2. Over-blocking. If ANY app's .app_secret has a second hard link, NO app's bundle window opens. Every app cron then fails with MODULE_NOT_FOUND, so one app's problem takes down all apps.
  3. It breaks app crons that read their own .app_secret from disk. Third-party apps were never surveyed.

Why it matters

Left in, one bad link in one app can stop every app cron on a host. App crons that read their own secret break with no warning. Nothing proves the change works on a real sandbox.

Not a goal

What changed (motivation → approach → change)

#16442 could break every app cron at once and was never run on a real sandbox. So it comes out whole, and comes back later in a safer shape.

This is a plain git revert of the squash commit. Cron children go back to how they ran before #16442. That means #12518 is open again on main: a cron child can read other apps' .app_secret until the re-land. It is already open on release/0.8.0.

The revert undoes the mask in src/kiro_crew/cron_script.py, the extra mask and read-only inputs in src/kiro_crew/sandbox.py, src/kiro_crew/sandbox_launcher.py and src/kiro_crew/sandbox_seatbelt.py, the cron call in src/kiro_crew/slack/gateway.py, the two docs, and the tests (one test file is deleted). git diff origin/main...HEAD --name-only lists exactly the 11 files #16442 touched. Two later commits (#16279, #16786) share one file, docs/system-specs/modules/learn-cron-dashboard.md. It merged cleanly, and their edits stay.

Backwards compatibility

Compatible: cron children get back the exact view they had before #16442. App crons that read their own .app_secret work again.

Reader: src/kiro_crew/cron_script.py:cron_apps_mask -- cron -- its only callers, run_script_sandboxed and run_command_sandboxed in the same file, are reverted with it; git grep cron_apps_mask on this head finds nothing
Reader: test/test_cron_apps_secret_mask.py:cron_apps_mask -- cron -- the test file that pinned #16442 is removed in this revert
Reader: docs/system-specs/modules/learn-cron-dashboard.md:apps-tree mask -- cron -- the spec line goes back to the pre-#16442 wording
Reader: origin/release/0.8.0 -- release -- never had cron_apps_mask; nothing there reads it

Tests

No new tests. The revert removes test/test_cron_apps_secret_mask.py and #16442's edits to three sandbox tests. Targeted runs on this head:

  • test/test_sandbox_mount_checked.py, test/test_sandbox_mount_pinned_target.py, test/test_sandbox_refactor_generated_programs.py, test/test_sandbox_launcher_*.py, test/test_sandbox_mount_source_sweep.py, test/test_sandbox_refactor_facade.py, test/test_sandbox_refactor_create_guard.py, test/test_cron_script*.py, test/test_slack_gateway.py, test/test_slack_gateway_cron_exec_coverage.py: 1240 passed, 2 skipped.
  • test/test_sandbox_cron_child_audit.py: 11 passed.

Manual verification

N/A — this puts back code that ran on main before #16442. The re-land must carry a real-sandbox run on bare Linux and macOS (plan on #12518).

Related Issues

Refs #12518

The re-land plan: #12518 (comment)

Pattern harvest

Rule candidate: review-prompt
Pattern: a sandbox mask that fails closed for ALL apps when ONE app's input is bad; scope the refusal to the one app, and require a real-sandbox run before merge.

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

…he cron's own bundle readable (#16442)"

This reverts commit 69ee108.
@iamwhatever
iamwhatever requested a review from a team as a code owner October 4, 2026 23:31
@iamwhatever
iamwhatever requested a review from bolichen97 October 4, 2026 23:31
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of b7cb104485588dc408802844bc7d7ce70a718e9f — 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.

First-Principles-Verdict: PASS

Merging this puts the #12518 exposure back on main: cron children can read every app's .app_secret again. A maintainer should accept that until the re-land.

What this change ships

Inventory (5 items) — 5 justified

Intent: undo a cron-sandbox change that never ran against a real OS sandbox and could break every app cron at once, until a safer version lands. This is a FIX (a revert).

  1. App crons can again read every app's .app_secret, as before fix(cron): hide every app's secret from cron children, keep own bundle #16442. The cron: a script cron child can read every installed app's .app_secret bearer credential #12518 exposure is back on main. — justified
  2. One app's .app_secret with a second hard link no longer breaks every app cron with MODULE_NOT_FOUND. — justified
  3. App crons that read their own .app_secret from disk work again. — justified
  4. The tests that pinned fix(cron): hide every app's secret from cron children, keep own bundle #16442's behaviour (test/test_cron_apps_secret_mask.py and the edits in three sandbox tests) are removed. The description gives the reasons, and the re-land plan is on cron: a script cron child can read every installed app's .app_secret bearer credential #12518. — justified
  5. The app-kit API reference and the learn-cron-dashboard spec go back to the pre-fix(cron): hide every app's secret from cron children, keep own bundle #16442 wording. Edits from fix(chat): hand off the queue on every _run_chat exit #16279 and refactor(dashboard): compose the agents handlers from agent_admin owners #16786 stay. — justified

[FIRST-PRINCIPLES-REVIEWED] b7cb104

Description read

[DESCRIPTION-READ] 19dbbbbf78ff534cc9abdce1ba939c44bc5ad65a5d408a359d735fc899baa06b

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Before merging, a maintainer should confirm they accept that #12518 is open again: cron children can read every app's .app_secret until the fix is re-landed.

[DESIGN-REVIEWED] b7cb104

Description read

[DESCRIPTION-READ] 4f12b6ad819fb8629fde919c661bd367b92cdb91286e35d0be44ddeefe42aae9

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 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ human override accepted

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

Human judgment by @iamwhatever overrides the Opus 5.5 finding for b7cb104485588dc408802844bc7d7ce70a718e9f; the recorded reason is authoritative for this commit.

[OPUS-OVERRIDE] b7cb104

Verdict recorded from an authorized human decision for commit b7cb104485588dc408802844bc7d7ce70a718e9f.

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

@buluoray buluoray 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.

LGTM. I checked this at head b7cb104485.

It is an exact revert. All ten code, test and app-kit doc files are byte-identical to 69ee1083e1^ (the parent of #16442's squash commit). In docs/system-specs/modules/learn-cron-dashboard.md the revert removes exactly the lines #16442 added, and the later edits from #16279 and #16786 are kept.

The trade-off is the right one for now. #16442's global stop means one hard-linked .app_secret withholds every app's bundle window, so every bundle cron fails to import; and app crons that read their own .app_secret from disk lose it with no migration path. Both are wider outages than the leak they close is being exploited today, and the re-land plan on #12518 (per-window inode scan, a ScriptContext migration, a real-sandbox run on Linux and macOS) addresses them.

Accepted consequence, stated plainly: with this merged, cron children can again read every installed app's .app_secret, which token_auth.validate_app_secret accepts, so a cron can act as another app. That is what the Opus BLOCK describes and what the design lane asks a maintainer to confirm. The Opus block is correct about the effect; it is outweighed by the fail-everything regression, not mistaken.

Before merging

  1. The title Revert "…" fails PR Hygiene's conventional-commit check; it needs to be revert: ….
  2. The Opus BLOCK needs a maintainer override citing the accepted #12518 exposure.
  3. #12518 is CLOSED (#16442 closed it) and this body only says Refs, so merging will not reopen it. Please reopen it so the exposure stays tracked.

One correction to the body for the record: #16442 did get a real Linux-namespace run during review (own bundle readable with an empty secret, another app's secret ENOENT, symlink and ../ spellings refused); what never ran is macOS Seatbelt.

@iamwhatever iamwhatever changed the title Revert "fix(cron): hide every app's secret from cron children, keep own bundle" revert(cron): hide every app's secret from cron children, keep own bundle Oct 4, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ human override accepted

Human judgment by @iamwhatever overrides the GPT 6.1 finding for b7cb104485588dc408802844bc7d7ce70a718e9f; the recorded reason is authoritative for this commit.

[GPT-OVERRIDE] b7cb104

This comment is updated in place on each push.

The model was not re-run because an authorized human decision supersedes it.

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

@iamwhatever

Copy link
Copy Markdown
Contributor Author

The finding names the intended effect of the revert. Cron children see exactly what they saw on main before #16442; no new read path is added.
The body states it plainly: #12518 is open again on main and already open on release/0.8.0.
The suggested fix (keep the mask, patch only the regression) is the re-land, and the maintainer chose revert-first because the masked shape never ran on a real sandbox and can stop every app cron at once.
The re-land plan, with a mandatory real-sandbox run, is on #12518: #12518 (comment)
This is security-class, so the override is a human writer's call.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Not a new defect: cron children see exactly what they saw on main before #16442, and no new read path is added.
The body states it plainly: #12518 is open again on main and already open on release/0.8.0.
The suggested fix (keep sibling isolation, scope refusal to one app) is the re-land; the maintainer chose revert-first because the masked shape never ran on a real sandbox and can stop every app cron at once.
The re-land plan, with a mandatory real-sandbox run, is on #12518: #12518 (comment)
This is security-class and fenced, so the override is a human writer's call.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override fable b7cb104: maintainer-decided revert; reopening #12518 is the intended effect, re-land plan on #12518

@iamwhatever

Copy link
Copy Markdown
Contributor Author

/ai-review override gpt b7cb104: maintainer-decided revert; reopening #12518 is the intended effect, re-land plan on #12518

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the fable AI finding as false positive, not applicable, or explicitly accepted for b7cb104485588dc408802844bc7d7ce70a718e9f.

maintainer-decided revert; reopening #12518 is the intended effect, re-land plan on #12518

This decision applies only to this commit. A new push requires a new judgment.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Human judgment recorded

@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for b7cb104485588dc408802844bc7d7ce70a718e9f.

maintainer-decided revert; reopening #12518 is the intended effect, re-land plan on #12518

This decision applies only to this commit. A new push requires a new judgment.

@iamwhatever
iamwhatever merged commit e0a7a66 into main Oct 5, 2026
103 of 108 checks passed
@iamwhatever
iamwhatever deleted the revert/pr-16442 branch October 5, 2026 03:00
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 5, 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.

2 participants