Skip to content

fix(security): read the -c script past options and redirections - #26087

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/rm-floor-c-operand-25814
Oct 31, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/rm-floor-c-operand-25814

Conversation

@bolichen97

@bolichen97 bolichen97 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A nested shell's script is checked by the deny floors even when an option or a redirection sits between -c and the script.

bash -c -x '<script>', bash -c -o pipefail '<script>' and bash -c <<EOF '<script>' all run <script>. The shared nested-payload reader took the word right after -c (-x, -o, <<eof) as the script, so the floors that walk nested shells never saw it. On main today, bash -c -x 'git push origin main' and bash -c -x 'kirocrew token' pass the gate, while bash -c 'git push origin main' is refused.

Why it matters

An agent can write these shapes on its own. The floors that read nested shells (git publish, the token mint, self-protection, the deny views, and the rm floor once it reads nested shells) are the layer meant to stop the command before it runs.

Not a goal

What changed (motivation → approach → change)

Symptom: an option or redirection after -c hid the script from every floor. Cause: the reader assumed the script is the first word after -c (after any --). bash keeps reading options after -c, and the outer shell strips redirections from argv wherever they sit.

Change: a new forward scanner, _shell_option_run, finds the word a shell really runs. From the -c carrier it skips options (short clusters, zsh's digit options like -1, a glued option+redirection like -x>/dev/null, long options such as --norc, and -o/-O/--rcfile with the value word each takes) and redirections with their target, and stops at the first plain word, the script. bash reads each o in a cluster as taking a value word (-oo pipefail errexit takes two); a getopt shell glues a mid-cluster name (-onoclobber); both readings are followed and their results unioned, the safe over-approximating direction. A redirection whose target holds a blank or shell syntax is ambiguous once quotes are gone: it may be the script ('2>/dev/null <cmd>') or a quoted target (>'a b', before -c or between an option and its value), so the scanner yields it and also reads past it, with no hop cap; seen keeps the scan O(n). The scanner adds those words as payloads next to the old first-word reading, so it only adds payloads. It reads only a -c inside the shell word's own run (_run_end scans the same way from the program word), so a later command's count flag (grep bash x && grep -c -e '<text>' f) keeps its pattern as text, and so do the arguments after a script file (bash file -c -e '<text>'). A shell word that is only a printer's argument (echo bash -c -x '<text>') opens no run either, so a printed example keeps main's reading. The scan runs only when a carrier exists, so other commands cost nothing extra.

The security spec gets one bullet, and the package line budget rises by the measured growth.

Backwards compatibility

Compatible: only a command whose -c script sits behind an option or redirection and is already refused when written plainly starts being refused. Ordinary commands such as bash -c -x 'echo hi', bash -c -o pipefail 'make 2>&1 | tee build.log', bash -c -x 'git push origin my-feature' and echo bash -c -x 'git status' still pass (pinned in the new test file).

Removes nothing: no rule, key, payload or allow case is removed. The reader only yields more payloads.

Tests

test/test_shell_c_option_payloads.py (new):

  • 44 shapes (-co/-oc pipefail carriers, -oo pipefail errexit two-value clusters, long options and -O before -c, a glued option+redirection -x>/dev/null, zsh digit options, a quoted script that opens with a redirection, a quoted redirection target with a blank or ; before -c or before an option value, options, -o/-xo/-ox names, a glued ksh/zsh -onoclobber, -, herestring, heredoc in three spellings, redirections, a glued -ec carrier) are refused with a git push origin main and a kirocrew token script. On main all 44 pass the gate.
  • Ordinary commands of the same shape still pass, including a shell followed by grep -c -e '<text>', grep -c -i '<text>' or wc -c -l '<text>' in a later stage, a shell name that is only another command's argument, bash /dev/null -c -e '<text>', and printed examples such as echo bash -c -o pipefail 'git push origin main'.
  • The first-word reading is kept, and an option's argument (pipefail) or $0 is not read as the script.
  • A 4,000-option run under 4,000 shell words stays linear.

test/test_security_gate_liveness.py: the package line budget, re-measured.

Existing test/test_denied_commands_security_cost.py pins that the payload set for -- runs is unchanged; it passes.

Proof: PROVEN test/test_shell_c_option_payloads.py::test_the_script_after_options_or_redirections_is_a_payload[bash -c -x '{p}'], test/test_shell_c_option_payloads.py::test_the_script_after_options_or_redirections_is_a_payload[bash -c -e '{p}'], test/test_shell_c_option_payloads.py::test_the_script_after_options_or_redirections_is_a_payload[bash -c -o pipefail '{p}'], test/test_shell_c_option_payloads.py::test_the_script_after_options_or_redirections_is_a_payload[bash -c -xo pipefail '{p}'], test/test_shell_c_option_payloads.py::test_the_script_after_options_or_redirections_is_a_payload[bash -c +e '{p}'] (head 6e23e58)

The new tests are pure functions over strings: no files, clock, network or shared state.

Manual verification

bash behavior was checked with a harmless echo script for each shape class: bash -c -x, -o pipefail, +e, -xo pipefail, -O extglob, -, >/dev/null, <<EOF, and -x <<<word. Each ran the quoted script, as did bash -c -o 2>/dev/null pipefail, bash -c -- 2>/dev/null, bash -c -ox pipefail, bash -co/-oc pipefail -x, bash --norc -c -x, bash --rcfile /dev/null -c -x, bash -c -x '2>/dev/null <cmd>', and zsh/ksh -c -onoclobber. bash -c -xo 'echo Q' takes echo Q as the option name, which is why a cluster holding o takes the next word.

Related Issues

Closes #25814

Sibling sweep

Swept: git grep -nE "_is_shell_command_flag(|_SHELL_COMMAND_FLAG_RE|== "-c"|_nested_shell_payloads|_shell_payload_walk" -- src/
Sibling: src/kiro_crew/security/shell_normalizer.py -- changed here
Sibling: src/kiro_crew/security/argv_floor_git.py -- not affected -- reads payloads through _nested_shell_payloads, so it gets the fix
Sibling: src/kiro_crew/security/argv_floor_self.py -- not affected -- reads frames through _shell_payload_walk, so it gets the fix
Sibling: src/kiro_crew/security/deny_gate.py -- not affected -- its deny views call _nested_shell_payloads
Sibling: src/kiro_crew/security/inline_payload.py -- not affected -- it splits every word of the command, not the word after -c
Sibling: src/kiro_crew/acp/liveness_interactive.py -- not affected -- reads git -c config, not a shell script

Pattern harvest

Rule candidate: review-prompt
Pattern: "the operand of a flag" read as the next token, where the program keeps parsing options after that flag

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners October 30, 2026 04:09
@bolichen97
bolichen97 enabled auto-merge (squash) October 30, 2026 04:09
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security/shell_normalizer.py

  • @KiroCrewCaptain: missing the ## Sensitive change review heading

How to clear this check:

  1. The PR author posts the template below as a PR comment, with
    every field filled (N/A needs a reason). Keep the
    Head commit line: it must name the current head SHA.
  2. The check turns green within a minute, with no push.
  3. A new push resets this check: post it again for the new head.

Only the author's comment counts this way. A reviewer can instead
paste the filled template into an "Approve" review on this head.
Merging still needs a reviewer's approval.

## Sensitive change review
- Head commit: dbac9e18d696d84644d6a12a4b8ad1376745e942
- What rule changed:
- Before -> after (what was allowed/blocked, now):
- Worst case if wrong (breaks commands / leaks secret / locks user out):
- Evidence checked (which sandbox result proves it):
- No regression:
  - Tools still work (which tools/commands were run, result):
  - Backward compatible (old config / old data / old callers still work, how checked):
  - Existing tests (which suites passed on this head):
- How to undo:

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

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision dbac9e18d696d84644d6a12a4b8ad1376745e942 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of dbac9e18d696d84644d6a12a4b8ad1376745e942 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the change fixes the parsing of real shell command lines, which the OS sandbox does not cover for git publish or the token mint, and it only adds payloads, so a revert undoes it cleanly.

Notes

  • _c_script passes each walk a different avoid lambda but shares one emit_memos, which breaks the docstring rule that the memo be built for "this same … emit identity". It holds today only because the avoided word is already a first-word payload. Either state that invariant in the docstring or drop avoid and dedupe through emitted.
  • Option arities are now spread across _SHELL_LONG_VALUE_OPTIONS, the bash/getopt o rule and the zsh digit options. The next shell quirk should be a change to that data, not another branch in the scanner, so this does not turn into the spelling-chase AGENTS.md warns about.

[DESIGN-REVIEWED] dbac9e1

Description read

[DESCRIPTION-READ] 32729a3d026b6465c09264c19fa52b6106128e5d9679bcbaebb975900a63474f

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of dbac9e18d696d84644d6a12a4b8ad1376745e942 — 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 does not.

First-Principles-Verdict: PASS

This fixes the cause: issue #25814, a reported bypass, in the one shared payload reader every floor goes through. The new tests fail on base. Nothing here changes the product's shape.

What this change ships

Inventory (8 items) — 8 justified

Intent: make sure a nested shell's -c script still reaches the deny floors when options or redirections sit between -c and the script. This is a FIX.

  1. bash -c -x|-e|+e|-o NAME '<denied script>' is now refused — justified
  2. bash -c <<EOF|<<<word|>/dev/null '<denied script>' is now refused — justified
  3. Options before -c (--norc, --rcfile FILE, -O NAME) no longer hide the script — justified
  4. Both the bash and the getopt (ksh/zsh) readings of -o are followed, and their results combined — justified
  5. Ambiguous redirect-shaped words (>'a b') are checked as scripts and also read past — justified
  6. A later stage's -c (grep -c -e), the arguments after a script file, and printed examples are still treated as data — justified
  7. The package line budget pin goes up by the measured growth — justified
  8. The security spec gains a bullet for this behaviour — justified

[FIRST-PRINCIPLES-REVIEWED] dbac9e1

Description read

[DESCRIPTION-READ] 6d38aff7cb6ad5b75eb6b1004a3cc4c1bba885fccb26d894bec93abb213a02d2

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] dbac9e1

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable dbac9e18d696d84644d6a12a4b8ad1376745e942 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] dbac9e1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt dbac9e18d696d84644d6a12a4b8ad1376745e942 false-positive: <reason, 20 to 500 characters>

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

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does dbac9e18d696d84644d6a12a4b8ad1376745e942 newly refuse? Updated in place on each push. A script-confirmed regression blocks; the model proposes candidates and never decides a refusal.

Verdict basis: adjudicated, zero confirmed regressions.

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 21 classified, 0 newly refused, 21 still allowed.
  • ubuntu-latest (platform posix): 21 classified, 0 newly refused, 21 still allowed.
  • windows-latest (platform windows): 4 classified, 0 newly refused, 4 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: The reader now returns additional payloads: the word a shell runs after options or redirections that follow its own -c. Every deny view and floor that walks nested shells now examines that word. None of the 25 candidates has a script verdict yet, so no regression is confirmed. Two things are named here but not confirmed. First, bash-mode o-counting can make a positional data word look like the script. Second, ambiguous redirection targets are returned as payloads.

TIGHTENING: _nested_shell_payloads now adds payloads through _shell_option_run, in all three deny tiers' views and in the self-protection and git-publish floors. The ONE threat is a protected command hidden behind options or redirections after -c, so that the first-word reading sees only -x. Hunk: + if j < _run_end(i): / + _c_script(j, k) # from the carrier: ``-co pipefail`` takes a name, and the HIDDEN cases such as "bash -c -x '{p}'" with PUSH = "git push origin main".

ADJUDICATED: 25 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE:

  • posix (21 rows): These are the actual boundary. They cover:
    • the committed git-publish golden paths, wrapped in -o pipefail, -e and -x
    • kirocrew self-health commands, which the floor that guards kirocrew subcommands now sees
    • --norc/--noprofile long options, and the GitHub Actions -eo pipefail -c cluster
    • a quoted redirect target containing a space, before the script
    • zsh -onoclobber, which bash-mode reads as three -o values
    • a positional-argument commit message that mentions the attack text
    • executor wrappers: timeout, find -exec, docker run, ssh
    • data-consumer mentions: grep, git log --grep, echo
  • windows (4 rows): The diff recognizes shells by program word. These rows probe that assumption with bash.exe, a quoted full path with \ separators to Git Bash's bash.exe, wsl bash, and a %TEMP%\ redirect target.
  • Not covered: cmd's /c and PowerShell's -Command are untouched by this diff, so no rows were written for them. No any rows, because every candidate names an executable.

UNADJUDICATED: These are narrowing questions I can argue but not confirm. Each has a call path, but any refusal would come back through the shell classifier rows above.

  • Bash-mode o-counting. In _shell_option_value_count with bash_mode=True, letters.lower().count("o") counts every o in a glued zsh/ksh name. So -onoclobber consumes three following words. With a script plus two positional arguments after it, the word after them is returned as a script payload, even though zsh treats it as data. The union with getopt mode only ever adds payloads, so this reading is never cancelled out.
    • Call path: _nested_shell_payloads → _c_script → _shell_option_run(bash_mode=True) → _emit.
    • Input I would have submitted: a zsh -onoclobber wrapper whose third positional argument is a commit message that mentions a protected push in prose. I did not submit it as a row because I could not attribute it to a real caller.
  • Ambiguous redirections returned as payloads. emit(j) on a word that fails _PLAIN_REDIRECTION_RE turns a dequoted redirect target into payload text. The >'/tmp/build log.txt' row probes this. A redirect target path that by itself matches a catalog rule would be refused through this path. I wrote no row for that, because no maintainer operation I could find writes to such a path.

[SCOPE-REVIEWED] dbac9e1

@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 30, 2026
@bolichen97
bolichen97 force-pushed the fix/rm-floor-c-operand-25814 branch from 1769b42 to 1ac9f7a Compare October 30, 2026 04:42
@bolichen97

bolichen97 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: option/redirection reading after -c applied to any -c carrier, including a later command's

  • span=c65544f87915

fixed in 1ac9f7a: the extra reading now applies only to a -c inside a shell word's own leading run of options and redirections (main loop and sweep).
bash -c 'make' && grep -c -e 'kirocrew token' notes.txt, sh -c 'cat log' | grep -c -i '<text>' log, wc -c -l '<text>', grep bash x && grep -c -e '<text>' f and bash /dev/null -c -e '<text>' are allowed again, pinned in test_ordinary_commands_still_pass.

@bolichen97

bolichen97 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • span=5e784cc06287

Rebutted: not a bypass. A -c script whose quoted text starts with a redirection token, followed by a positional arg that spells a denied command, gets an EXTRA payload and is refused; nothing is allowed that main refuses, and the first-word reading is kept.
It needs a quoted script that begins with >/2>&1 AND a trailing $0/$1 spelling a denied command, which an agent does not write in ordinary work; the refusal is loud and is fixed by dropping the leading redirect.
Telling a quoted operand from a live redirect needs the raw, pre-dequote token view threaded through every caller of _nested_shell_payloads (argv_floor_git, deny_gate, the payload walk), a new cross-module contract far larger than this rare, visible over-refusal. The CI adjudication downgraded it on the same grounds.

@bolichen97
bolichen97 force-pushed the fix/rm-floor-c-operand-25814 branch from 1ac9f7a to ef6b33c Compare October 30, 2026 04:58
@bolichen97

bolichen97 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author
  • span=c65544f87915

fixed in ef6b33c: a word counts as a redirection in _c_script_indexes only when it also fullmatches _PLAIN_REDIRECTION_RE (target with no blank or ;|&()<>), so a dequoted script that opens with a redirection is never stepped over.
bash -c -x '2>/dev/null kirocrew token', bash -c -o pipefail '0<x git push origin main' and env -S 3</dev/null '2>x git push origin main' are refused, pinned in HIDDEN in test/test_shell_c_option_payloads.py.

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=5e784cc06287

Rebutted: not a new class. On base f369225 echo bash -c 'git push origin main' is already refused by the first-word reading at the same call site, which this PR does not change.
The option run only extends that existing reading to echo bash -c -x '<script>', the same printed-example shape with an option in front; a printed shell example naming a protected push is not ordinary agent work, and the refusal is loud and recoverable.
Exempting printed text here would weaken the floor for the plain -c spelling too, which is a security-direction change outside this PR's goal.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 30, 2026
@bolichen97
bolichen97 force-pushed the fix/rm-floor-c-operand-25814 branch from ef6b33c to 3c5cb2b Compare October 30, 2026 05:23
@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 Oct 30, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=5e784cc06287

fixed in 3c5cb2b: the option-aware lookup starts AT the -c carrier (main loop and every-carrier sweep) and accepts only an index past it, so a carrier cluster's own o takes its option name.
bash -co pipefail -x 'git push origin main' and bash -oc pipefail -x '...' are refused, pinned in HIDDEN in test/test_shell_c_option_payloads.py.

@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 30, 2026
@bolichen97
bolichen97 force-pushed the fix/rm-floor-c-operand-25814 branch from 3c5cb2b to 5a421b8 Compare October 30, 2026 05:54
@bolichen97

Copy link
Copy Markdown
Contributor Author

resolution: narrowed (sweep extra and env -S branch removed); redirect ambiguity yields both readings

  • span=c65544f87915

fixed in 5a421b8: long options before -c count in the option run (--rcfile/--init-file take a value) and -O takes a name like -o, so bash --norc -c -x '<push>' is refused.
A redirection whose dequoted target holds a blank or shell syntax is now ambiguous, not decided: the reader yields it AND reads past it (no hop cap, each word passed once per reader call), both in the option run and before -c, so bash -c -x >'/tmp/a b' '<push>', 2>'a;b' and bash >'a b' -c -x '<push>' are refused while '2>/dev/null <cmd>' scripts stay caught.
env -u HOME -S ...: the env -S redirect branch is removed (not a -c carrier, outside the frozen goal, open on main too), listed under Not a goal; the every-carrier sweep extra is removed as redundant. All pinned in test/test_shell_c_option_payloads.py.

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

Copy link
Copy Markdown
Contributor

FYI #22719 merged as d848f2a, so the dash &> rows this body defers can now be included.

🤖 AI-assisted comment 🤖

@bolichen97
bolichen97 force-pushed the fix/rm-floor-c-operand-25814 branch from ac0bf07 to 6e23e58 Compare October 30, 2026 17:14
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 30, 2026
A shell keeps reading options after -c, and the outer shell strips a
redirection wherever it sits, so bash -c -x '<script>', bash -c -o
pipefail '<script>' and bash -c <<EOF '<script>' all run <script>. The
nested-payload reader took the word right after -c (-x, -o, <<eof), so
the self-protection and git-publish floors and the deny views never saw
the script. env -S had the same miss with a redirection before its
argument.

_c_script_indexes finds the word a shell runs in one backward pass and
the reader yields it in addition to the first-word reading, so it only
adds payloads. Closes #25814 for the shared reader; the rm floor's
nested reading uses the same reader.
@bolichen97
bolichen97 force-pushed the fix/rm-floor-c-operand-25814 branch from 6e23e58 to dbac9e1 Compare October 30, 2026 23:12
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Oct 30, 2026

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved on behalf of the watch holder (bolichen). Design and First Principles pass on this head, UX skipped or pass, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit fea0920 into main Oct 31, 2026
97 of 98 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/rm-floor-c-operand-25814 branch October 31, 2026 00:27
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 31, 2026
bolichen97 pushed a commit that referenced this pull request Oct 31, 2026
Backports these main PRs to release/0.11.0, in pick order. Each was a
`git cherry-pick -x` of its squash commit on main:

- fix(memory): read memory.db off the writer lock, split background pool (#24290) (cherry picked from commit fed830c)
- fix(dashboard): bound the pre-prompt build's wait to enter the memory pool (#24414) (cherry picked from commit 520cf2c)
- fix(memory): keep the shared -wal when another process closes the memory store (#25852) (cherry picked from commit dc63bb6)
- fix: read the page-cache prefetch in a child to keep sqlite locks (#26302) (cherry picked from commit 81dde23)
- perf(memory): score facts from a term index and prebuild after restart (#25328) (cherry picked from commit 6824348)
- fix(desktop): retry a failed netstat before Windows recovery gives up (#25792) (cherry picked from commit 043dd9f)
- fix(cli): say a gateway still serves the port when restart's replacement is refused (#25366) (cherry picked from commit 2e13127)
- fix(cli): refuse to stop or restart a gateway the desktop app supervises (#25705) (cherry picked from commit bbf0910)
- fix(hooks): approve kiro-cli read-only file searches after the deny tiers (#25150) (cherry picked from commit a0c0bd4)
- fix(settings): refuse a config save that config.local.json overrides (#26216) (cherry picked from commit 7f8688e)
- fix(workflows): write non-finite floats as null so runs open (#26085) (cherry picked from commit 3591282)
- fix(approvals): give each background tool approval its own id (#25905) (cherry picked from commit 51ef3bb)
- fix(chat): record file changes for kiro-cli v3 write tools (#25650) (cherry picked from commit 5369270)
- fix(sandbox): stop blaming a host-wide OOM kill on a per-tree limit (#25647) (cherry picked from commit 791d2a2)
- fix(acp): replay history when a KAS resume restores no turns (#25521) (cherry picked from commit 47c71cb)
- fix(kas): auto-approve granted built-ins after Crew's own checks (#25339) (cherry picked from commit dba4de5)
- fix(kas): mount web_search as the engine's remote_web_search (#26435) (cherry picked from commit 65c21b5)
- fix(kas): answer a spec's shell.allowedCommands at the gate, after Crew's checks (#25539) (cherry picked from commit 39d07d9)
- fix(kas): relay an MCP server's boolean env flags, never its secrets (#25331) (cherry picked from commit b734a68)
- fix(security): read the -c script past options and redirections (#26087) (cherry picked from commit fea0920)
- fix(kas): refuse a shell command a denyByDefault spec does not allow (#26501) (cherry picked from commit 9f0d02f)
- fix(kas): name a deniedCommands deny aimed at a redirect as not carried (#26489) (cherry picked from commit 4951c0c)
- fix(security): delete the curl-upload deny rule (#26469) (cherry picked from commit 70e206e)

Conflicts resolved by hand:
- #26302: test/spawn_audit_helpers.py adds only the page_cache.py entry
  (the embeddings_child.py entry names a module 0.11.0 lacks);
  test/test_page_cache_prefetch.py takes main's file.
- #25328: test/test_dashboard_server_composition_contract.py lazy-import
  count 93 -> 96 (the three names it adds).
- #25705: test/test_cli_restart_refused_message.py takes main's file.
- #26085: dashboard/handlers/workflows.py adds import math, keeps the
  release typing import.
- #25339: platform/governance.py keeps the release rule for a missing
  ceiling (main's enterprise-baseline clause is not on 0.11.0).
- #26435: harness-parity.md H6 row edited in place on the release text.
- #25539: its acp-client.md and agent-spec-fields.md lines are left out;
  the paragraphs they edit are not on 0.11.0 (security.md carries it).
- #25331: the test and two doc mentions use hoist_managed_servers /
  resume=, the 0.11.0 names of main's renamed hoist_servers_for_session.
- #26087: security package line budget 32,552 -> 32,714 (re-measured).
- #26501: kas_permissions.py comment keeps 0.11.0's shapes (main's
  subagent rules are absent); its acp-client.md line is left out, and the
  agent-spec-fields.md toolsSettings row says denyByDefault is gate-enforced.
- #26489: its agent-spec-fields.md sentence is added to the 0.11.0 row.
- #26469: test_denied_commands_security.py keeps 0.11.0's comment; count 113 -> 112.

Test fixes (host-dependent tests made hermetic; none loosens an assertion):
- tmpdir_helpers.short_tmp_path: a tmp_path override for modules whose code
  judges a path by its components (a .kiro/crew data-home part); an agent
  session's TMPDIR under ~/.kiro/crew made every test path the data home.
  Used by the file-explorer, design-tweak (both), spawn-offload, launch-copy,
  home-pin, native-skill and auto-improvement-members tests; the sage
  ancestor-chain test creates its dir under /tmp for the same reason.
- pi-gate tests and the remote-session Python 3.9 test take the first real
  binary on PATH (playwright_cli_installer_helpers._native_tool_on_path): a
  mise shim under a scratch HOME hangs or writes to stdout.
- snapshot-merge ACL test names its own uid; nobody (65534) is the overflow
  uid inside a user namespace and cannot be named in an ACL.
- installer-step and push_guard interrupt tests spawn with SIGINT at its
  default; a background pytest run starts with SIGINT ignored, which a shell
  trap and Python both keep.

Left out: #23920 (already on release/0.11.0), #26144 (needs
sandbox_launch_mark from #24709), #26088 (fences a main-only port),
#25346 (11 of its tests fail on 0.11.0: the kiro-cli skill scope it
compares against differs there), #26397 (needs #26152's new download
route, not on 0.11.0), #26428 (not merged).
bolichen97 added a commit that referenced this pull request Oct 31, 2026
…26487)

Backports these main PRs to release/0.11.0, in pick order. Each was a
`git cherry-pick -x` of its squash commit on main:

- fix(memory): read memory.db off the writer lock, split background pool (#24290) (cherry picked from commit fed830c)
- fix(dashboard): bound the pre-prompt build's wait to enter the memory pool (#24414) (cherry picked from commit 520cf2c)
- fix(memory): keep the shared -wal when another process closes the memory store (#25852) (cherry picked from commit dc63bb6)
- fix: read the page-cache prefetch in a child to keep sqlite locks (#26302) (cherry picked from commit 81dde23)
- perf(memory): score facts from a term index and prebuild after restart (#25328) (cherry picked from commit 6824348)
- fix(desktop): retry a failed netstat before Windows recovery gives up (#25792) (cherry picked from commit 043dd9f)
- fix(cli): say a gateway still serves the port when restart's replacement is refused (#25366) (cherry picked from commit 2e13127)
- fix(cli): refuse to stop or restart a gateway the desktop app supervises (#25705) (cherry picked from commit bbf0910)
- fix(hooks): approve kiro-cli read-only file searches after the deny tiers (#25150) (cherry picked from commit a0c0bd4)
- fix(settings): refuse a config save that config.local.json overrides (#26216) (cherry picked from commit 7f8688e)
- fix(workflows): write non-finite floats as null so runs open (#26085) (cherry picked from commit 3591282)
- fix(approvals): give each background tool approval its own id (#25905) (cherry picked from commit 51ef3bb)
- fix(chat): record file changes for kiro-cli v3 write tools (#25650) (cherry picked from commit 5369270)
- fix(sandbox): stop blaming a host-wide OOM kill on a per-tree limit (#25647) (cherry picked from commit 791d2a2)
- fix(acp): replay history when a KAS resume restores no turns (#25521) (cherry picked from commit 47c71cb)
- fix(kas): auto-approve granted built-ins after Crew's own checks (#25339) (cherry picked from commit dba4de5)
- fix(kas): mount web_search as the engine's remote_web_search (#26435) (cherry picked from commit 65c21b5)
- fix(kas): answer a spec's shell.allowedCommands at the gate, after Crew's checks (#25539) (cherry picked from commit 39d07d9)
- fix(kas): relay an MCP server's boolean env flags, never its secrets (#25331) (cherry picked from commit b734a68)
- fix(security): read the -c script past options and redirections (#26087) (cherry picked from commit fea0920)
- fix(kas): refuse a shell command a denyByDefault spec does not allow (#26501) (cherry picked from commit 9f0d02f)
- fix(kas): name a deniedCommands deny aimed at a redirect as not carried (#26489) (cherry picked from commit 4951c0c)
- fix(security): delete the curl-upload deny rule (#26469) (cherry picked from commit 70e206e)

Conflicts resolved by hand:
- #26302: test/spawn_audit_helpers.py adds only the page_cache.py entry
  (the embeddings_child.py entry names a module 0.11.0 lacks);
  test/test_page_cache_prefetch.py takes main's file.
- #25328: test/test_dashboard_server_composition_contract.py lazy-import
  count 93 -> 96 (the three names it adds).
- #25705: test/test_cli_restart_refused_message.py takes main's file.
- #26085: dashboard/handlers/workflows.py adds import math, keeps the
  release typing import.
- #25339: platform/governance.py keeps the release rule for a missing
  ceiling (main's enterprise-baseline clause is not on 0.11.0).
- #26435: harness-parity.md H6 row edited in place on the release text.
- #25539: its acp-client.md and agent-spec-fields.md lines are left out;
  the paragraphs they edit are not on 0.11.0 (security.md carries it).
- #25331: the test and two doc mentions use hoist_managed_servers /
  resume=, the 0.11.0 names of main's renamed hoist_servers_for_session.
- #26087: security package line budget 32,552 -> 32,714 (re-measured).
- #26501: kas_permissions.py comment keeps 0.11.0's shapes (main's
  subagent rules are absent); its acp-client.md line is left out, and the
  agent-spec-fields.md toolsSettings row says denyByDefault is gate-enforced.
- #26489: its agent-spec-fields.md sentence is added to the 0.11.0 row.
- #26469: test_denied_commands_security.py keeps 0.11.0's comment; count 113 -> 112.

Test fixes (host-dependent tests made hermetic; none loosens an assertion):
- tmpdir_helpers.short_tmp_path: a tmp_path override for modules whose code
  judges a path by its components (a .kiro/crew data-home part); an agent
  session's TMPDIR under ~/.kiro/crew made every test path the data home.
  Used by the file-explorer, design-tweak (both), spawn-offload, launch-copy,
  home-pin, native-skill and auto-improvement-members tests; the sage
  ancestor-chain test creates its dir under /tmp for the same reason.
- pi-gate tests and the remote-session Python 3.9 test take the first real
  binary on PATH (playwright_cli_installer_helpers._native_tool_on_path): a
  mise shim under a scratch HOME hangs or writes to stdout.
- snapshot-merge ACL test names its own uid; nobody (65534) is the overflow
  uid inside a user namespace and cannot be named in an ACL.
- installer-step and push_guard interrupt tests spawn with SIGINT at its
  default; a background pytest run starts with SIGINT ignored, which a shell
  trap and Python both keep.

Left out: #23920 (already on release/0.11.0), #26144 (needs
sandbox_launch_mark from #24709), #26088 (fences a main-only port),
#25346 (11 of its tests fail on 0.11.0: the kiro-cli skill scope it
compares against differs there), #26397 (needs #26152's new download
route, not on 0.11.0), #26428 (not merged).

Co-authored-by: w <w@k.local>
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.

rm floor: heredoc or flag between -c and the script still hides the payload

3 participants