Skip to content

chore(security): drop history comments in security files - #24769

Merged
chenmingwei23 merged 1 commit into
mainfrom
comments/src-security
Oct 27, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
comments/src-security

Conversation

@iamwhatever

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Remove review-round and PR-history narration from # comments in the security-sensitive files of src/kiro_crew that the earlier source-comment passes skipped, with no code change and no weakened security reason.

The source-comment rollout (#23966 #24222 #24225 #24227 #24444 #24468 #24493 #24500 #24642) skipped every security, auth, sandbox, policy, governance, redaction, credential and argv-gate file on purpose, so they could get their own reviewed pass. This is that pass. These files carry the densest history in the tree: round-17: / round-20 (GPT): tags on the ssh-to-self floor, "Raised by the GPT review", "Found in review (GPT 5.6)", "an earlier revision of this change", "the first version of this PR".

Please review this one carefully as a security change. Every edit is a # comment, and the AST check below proves no code moved, but the comments are the only place many of these threats and invariants are written down. Please read each rewrite against the code it sits on and check that the reason still reads as strongly as before.

Why it matters

A review-round label tells a reader how long a fix took, not what it guards, and "this change" stops meaning anything once the PR merges. In security code the reader most needs the threat and the invariant, and the history tags push them further down the paragraph.

Not a goal

  • No docstring edits (the docstring hits in argv_floor_hosts.py, auto_improvement/backend/, ops_mission_control/ and chat_tags_policy.py stay).
  • No code, string, constant, behaviour or formatting change.
  • No new or wider security rule; no file outside the security scope.

What changed (motivation → approach → change)

70 files touched; only # comment lines changed (424 lines added, 483 removed).

Approach: a path-keyword scan found 408 security-sensitive files that the earlier passes skipped. A token-level scan of their # comments flagged 175 lines with history or restating markers. Each hit was read in context: false hits (codex, previously-unseen IP, reviewer as a product noun, "earlier pass" meaning a runtime pass) stayed, and the real ones were edited. Every rewrite keeps the threat, the attack, the invariant, the fail-closed choice or the ordering rule, and drops only the tag or the "an earlier revision did X" frame. Where a past mistake was the reason, it now reads as the rule ("Testing X covers only one of the two paths", not "An earlier revision tested X").

count
Files edited 70
# lines added / removed 424 / 483
Non-comment lines touched 0
Security-file comment lines flagged by the scan 175 -> 83 (the 83 left are false hits or kept on purpose, listed below)
goal_scan.py history --strict --root src/kiro_crew 26 -> 23 (the rest are docstrings or non-security files)

Before pushing I checked every added line: none over 100 columns, none with "this change", "this PR", "earlier revision", a round count, GPT or Opus, and inclusive language throughout.

Every removed or rewritten comment

ssh-to-self floor (security/argv_floor_ssh.py, security/argv_floor_hosts.py):

  • round-N: / (round-N) / round-N (GPT|Opus): labels on about 50 comments — Reader: each rule's text is unchanged; only the label naming the review round that added it is gone.
  • "the round-7 same-frame ;-clear semantics" / "the round-7 clear rule" — Reader: still names the rule, now as "the same-frame ;-clear rule".
  • "the round-17 assignment/function binders" — Reader: now "the same-line assignment/function binders", the two binders defined above.
  • "keeps the round-17 order" (@ in a path token) — Reader: now "keeps the colon-first order", the split described two lines above.
  • "This reverses the round-18 collision rule, whose bet did not survive" — Reader: now states the rejected rule ("treating such a letter as valueless and betting that the DNS layer still covers a host after it does not survive the consumption path").
  • "the round-28 -o/-J treatment" — Reader: "the same treatment -o/-J get".
  • "the hosts-file alias class the round-18 finding named" — Reader: "the hosts-file alias class (a loopback alias in /etc/hosts)".
  • "since round-17 the layer only runs in host position" — Reader: "the layer only runs in host position".
  • "# round-10 static resolutions" — Reader: "Static resolutions for _operand_targets_self".

security/readonly_bash.py:

  • pager + prefix: "the denylist this PR exists to argue against" — Reader: "a denylist, the shape this module avoids"; the reason (the pager's command language grows) stays.
  • date -d: "an earlier revision of this change left it OFF on the belief…" — Reader: documentation suggests -d sets DST on BSD/macOS; the implementations show it does not. The getopt table stays.
  • file: "the shape this change keeps converging on" — Reader: "the shape this module converges on".
  • --preserve-date: "how it was originally, and wrongly, admitted here" — Reader: "which makes it easy to admit by mistake"; the ctime reason stays.

security/shell_normalizer.py — NAME+=tail: Reader: an appended PROGRAM word is invisible to the single-assignment pattern; the example and the spelling list stay. Removes "closed in an earlier round", "found in review".
security/paths.py, security/paths_resolver.py (2) — Removes nothing: "(found in review)" tails; the sentence before each states the reason.
security/paths_targets.py — Reader: the three weaker fallbacks and why each is open stay; "were each found open in review" -> "are each open".

agent_sdk/tool_gate.py — Reader: testing effective_sandbox_mode(mode) != "off" covers only one of the two paths that hand back an unwrapped child, so the gate asks whether the mask WILL BE APPLIED.
agent_sdk/backends.py — Claude backend: Reader: leaving it out would render the option unavailable on builds that can run it. Two-set registry: Reader: one set plus a destructive deny cannot be re-applied when a ceiling tightens or loosens at runtime.
agent_parts/spec_grants.py — Reader: without its ceiling neither creation verb is safe to auto-approve. Removes "added by this change".
agent_parts/spec_rebuild.py (4) — Reader: a leaked admission flag would exempt later writes from the spec-install guard; a ceiling-filtered installer must not be recorded as synced over an unrewritten grant list; without the hold a boot-time author install failure loses the governance retry. Removes "GPT 6.1 F1 / First Principles Item 4" tags.
agent_materialization/fork_refresh.py — Removes nothing: "(Opus round-47)" tag.

auto_improvement/spine/agent_runner_gate.py (8) — Reader: every reason stays (fixed-position parsers are evaded by adding a position; (/) split over-checks safely; unknown options are valueless; operator deny rules come from the keystone; publishing verbs share one capability). Removes "Raised by the GPT/Opus review", "Measured before fixing", "the previous rule", "evaded three times already".
auto_improvement/spine/agent_runner.py (4) — Reader: the audit row closes the asymmetry that would read as a sandbox bypass; sandboxed rather than deleted keeps credentials out of reach; if allowed_tools: is wrong for []; early returns must still accrue cost.
auto_improvement/spine/driver_git.py (2), gate.py (2), git_safety.py (2) — Removes nothing: "Raised by the GPT review" tails. driver_git.py also: Reader: patching replace-ref reads one at a time leaves the next one open, hence the chokepoint.
auto_improvement/spine/push_policy.py — Reader: a single strip pass lets origin/refs/heads/main through; a normalization that runs once can always be re-nested.

aws_control/.../pipeline/prompt.py (3) — Reader: resolving for the credential fences while the pseudo-filesystem loop tests the raw path lets a /proc/self/environ link through; a restated gate drifts from the first; a component walk after resolve() can never find a link.
aws_control/.../pipeline/pinned.py — Removes nothing: "a path this change is not about".
aws_control/.../microvm/hooks.py — Reader: the body carries a single-use activation code, so only its length and exception type are logged.
code_review_sage/sage_lib/review_driver.py — Reader: the fallback must refuse redirects because _probe dials ports that may not be our gateway.
meetings/backend/routes/audio_import.py (5) — Reader: every by-name open on Windows can follow a planted junction and fire SMB auth; the platform gate runs first; probe failure refuses; Apple over-cap refuses whole; a split must not emit a rejected record. Removes GPT/Opus round tags and adjudication notes.

ops_mission_control/backend/policy_store.py (5) — Reader: a config-to-keystone migration IS the hole (an agent-written config.json would become the ceiling); fencing identity while leaving primary_instance writable moves the bypass; an unlink on lockdown failure would delete the healthy ceiling. Removes "an earlier revision had one", "Found in review (GPT 5.6 / Opus 5)", "this app is new in this PR".
ops_mission_control/backend/secrets.py (2), providers/datadog.py, http_routes/actions.py (2), slack_out.py (3) — Reader: the exception chain is severed so no credential bytes ride __cause__; site reaches the request host so it is allowlisted; both action paths must converge for follow-up; every egress path goes through the redaction shim; a URL is not exempt from redaction. Removes "Found in review" tails and "this PR's recurring lesson".
papyrus/backend/gitops.py, store.py — Reader: a symlink-only check leaves the guard bypassable on Windows (junctions). Removes "the platform this PR adds".

autonudge_service/gate.py (2) — Reader: every shape other than one committed transition has a named gap. Removes "Four rounds of review", "an earlier build of this branch".
aws_consent.py — Reader: fail CLOSED; allowing a transient STS fault would bill an unconfirmed account.
computer_use/policy.py — Removes nothing: "because a reviewer will find it otherwise".
config/sections_tailnet.py — Removes nothing: "this fix" -> "this branch".
dashboard/chat_tag_grants.py (2) — Removes nothing: "(a review finding)", "Opus review finding".
dashboard/chat_turn/deny_chokepoints.py, permission_prompt.py — Reader: cause-blind wording would send the person to audit a rule that does not exist; an unresolved future would wedge the turn.
dashboard/handlers/auth_refresh.py — Reader: skipping revocation on a degraded store would let the cookie validate again for its TTL.
dashboard/handlers/security_trusted_apps.py — Removes nothing: "this change" -> "this handler".
dashboard/handlers/tailnet_mobile.py (2) — Reader: owner-only READ closes the disclosure a frontend-only check leaves; the publish gate is unconditional.
dashboard/refresh_tokens.py — Reader: a last-N jti history weakens the RFC 6819 reuse signal; the maintainer's decision for chain-head-only stays. Removes reviewer-lane narration.
dashboard/tailnet_serve.py — Reader: both narrowings and what each broader predicate removes stay, in present tense.
dashboard/token_auth_callers.py, token_secret.py (2) — Reader: the linked-key lookup stops an app slot reading as the person; the in-place fallback keeps the truncation window and runs only where hard links cannot. Removes "this fix", "the pre-PR code".
decisions/points/tool_risk.py — Reader: raising to 0.90 is rejected because it crosses the measured window. Removes "in an earlier round of this PR".
diag/procs.py (2) — Reader: cutting argv before redaction is a credential leak; the owner label is bounded anyway. Removes "earlier revision", "two reviews", "Opus lane".
log_redaction.py (2) — Removes nothing: "the old" before "unconditional destruction".
mcp_cron.py (3), mcp_cron_shell_scan.py (2), mcp_cron_vet.py — Reader: ownerless rows stay out of chat scope; an unsubstantiated warning is worse than none; in-chat approval widens the owner-only boundary; the +B probe makes nested comma braces reachable; the quadratic path is outside the brace walk; a storage-time refusal alone does not reach stored jobs.
mcp_gateway/rewriter_launch.py — Reader: copying the spec lets spec-controlled fields ride into our binary; the class is the copy.
messaging/dispatch_admission.py — Reader: a channel spelling missing from this set leaves no off-switch; a hand-picked test list is blind to the channels it omits.
pinned_fs.py (7), pinned_fs_dirs.py (2), pinned_fs_files.py — Reader: a name in a tree we created is a planted link or file, so refuse; no decision governing a write goes through a path name; ELOOP/ENOTDIR become the module's refusal type; the cleanup never unlinks. Removes "Raised in review", "this change's first invariant", "the first design".
platform/update_governance.py — Reader: an enumeration without a membership rule misses members (core.gitProxy).
pod/runtime_home.py — Reader: copying host SSO tokens into the pod would make HOST bearer tokens readable to any agent shell. Removes "an earlier revision", "a security review correctly flagged".
safety_override_breadcrumb.py (7), safety_override_grant.py — Reader: every reason stays (off-loop writes, idle flush, image nonce, FIFO-safe open, live-grant skip). Removes "(found in review)" tails and two blocks that repeated the comment directly above them word for word.
sandbox_leaves.py — Reader: no in-sandbox reader has the AWS consent leaf, so withholding it costs nothing.
sandbox_probe.py — Reader: a macOS version cutoff disables a working sandbox; decide empirically.
skills_body_reads.py (2) — Reader: a bare read_text has no containment, O_NOFOLLOW, regular-file check or size cap. Removes "the site the reviewer found"; also drops # Check extra paths, which restates the for extra in self._extra_paths: line under it.
slack/gateway_runtime/turn_approvals.py — Reader: the three ways borrowing a running slot goes wrong stay, in present tense.
snapshot_archive.py (4), snapshot_build.py (4), snapshot_merge.py, snapshot_merge_driver.py, snapshot_redact.py, snapshot_restore.py (4) — Reader: every hazard stays (a corrupt db staged as bytes lets --keep prune a real backup; dirs_exist_ok follows must_create on every path; the pinned gate is asked once before staging; ancestors are pinned; no by-name lockdown; a symlink is moved, not skipped; validate before mutate; O_NONBLOCK against a FIFO). Removes "earlier revision of this change", "first revision of this PR", "review caught/found/asked", "the old code".
subagent_manager/admission/pump.py — Reader: an unanswered request left pending is a missing record of the wait. Removes "this fix".

Kept on purpose (a reviewer may ask)

  • Docstrings, by rule, even with the same tags.
  • reviewer as a product noun or a person reading the SEL (skills_review.py, tailnet_serve.py, sandbox_leaves.py, security_posture.py, security-conductor scripts).
  • "earlier pass" in security/redaction.py and subagent_manager/admission/pump.py: a runtime pass of the same function.
  • "The maintainer chose the STRONGER posture" in dashboard/refresh_tokens.py: a recorded decision, not a review round.
  • backends.py's Codex paragraph ("the two things that were missing when it was not"): it lists the two conditions a harness must meet.
  • # Check tool hooks for auto-approve in slack/handler_runtime/permission_ladder.py: it names the block's purpose.
  • Where unsure, the comment stayed.

Backwards compatibility

Compatible: only comments change; every touched file has the same AST as its base.

Removes nothing: no code, key, record, validator or public function changes.

Tests

Proof: not provable -- copy-only change

AST-identical proof. goal_scan.py astcheck <merge-base> compares ast.dump(ast.parse(src)) for every .py file changed against the merge base (e4fad3933a):

files checked: 70  code-changed: 0  docstring-only: 0

Gates on the touched files:

  • flake8, isort --check-only: clean
  • check_comment_history.py, check_brand_name.py, check_file_line_cap.py: pass
  • black: scripts/check_black_formatting.py needs black 26.10.1 and this host has 26.3.1, so it could not run here. With the installed black, the same 3 files (auto_improvement/spine/gate.py, papyrus/backend/store.py, dashboard/tailnet_serve.py) report the same reformat on the base as on this branch, and the AST check shows their code is identical. CI's Fast Gate runs the bounded check.

Tests, KIROCREW_PROFILE=standalone pytest -n 4 --dist loadgroup, run 3 times: the related tests (248 files: test/test_<module>*.py for every touched module, plus the test dirs of the 6 touched apps) and the sandbox/security dirs (118 more files: test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*).

run passed skipped failed
1 18594 117 2
2 18594 117 2
3 18594 117 2

The same 2 fail on an unmodified worktree of the merge base on this host, so they are host state, not this diff: code_review_sage/tests/test_store_ancestor_chain.py::TestTheWindowBetweenTheRefusalAndTheWalk::test_a_link_planted_inside_the_window_is_followed_outside_every_root and test/test_snapshot_merge_core_files_pinned.py::test_the_rewrite_keeps_the_live_stores_access_control_acl (setfacl refused on the scratch filesystem). Both were noted the same way in #24493 and #24225.

Manual verification

N/A — comment-only change; the AST check proves the compiled code is unchanged.

Related Issues

None.

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

Contributed under the project's Apache-2.0 license.

@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 27, 2026 06:37
@iamwhatever
iamwhatever requested a review from CrysisDeu October 27, 2026 06:37
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/agent_sdk/tool_gate.py

  • src/kiro_crew/log_redaction.py

  • src/kiro_crew/sandbox_leaves.py

  • src/kiro_crew/sandbox_probe.py

  • src/kiro_crew/security/argv_floor_hosts.py

  • src/kiro_crew/security/argv_floor_ssh.py

  • src/kiro_crew/security/paths.py

  • src/kiro_crew/security/paths_resolver.py

  • src/kiro_crew/security/paths_targets.py

  • src/kiro_crew/security/readonly_bash.py

  • src/kiro_crew/security/shell_normalizer.py

  • src/kiro_crew/snapshot_redact.py

  • @iamwhatever posted a complete reasoning template for b1eab3c.

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

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision b1eab3c7a72346ca804f8d0fc03c0b75334950e6 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 27, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Comment-only change: every added or removed line in the patch is a # comment, apart from one deleted blank line, so no behaviour or contract moves.

[DESIGN-REVIEWED] b1eab3c

Description read

[DESCRIPTION-READ] e8a03331af51955850a79d6a46b9b2026a1526c1bf22723c295c2c892448c989

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

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

Nothing blocks: every changed line is a # comment (plus one removed blank line), so no capability, default or surface moves.

What this change ships

Inventory (3 items) — 3 justified

Intent: make the security files' comments state the threat and invariant instead of the review history — a cleanup, neither FIX nor ADDITION of behaviour.

  1. Review-round and model tags (round-N, "GPT", "Opus round-47") dropped from about 70 security files' comments — justified
  2. "This change / earlier revision" wording rewritten to state the rule directly — justified
  3. One blank line removed in a comment block — justified

[FIRST-PRINCIPLES-REVIEWED] b1eab3c

Description read

[DESCRIPTION-READ] fd45f294e4aa052393d336fa7ef90800a1b946f3bf5021f1ad4c383b5c3e724e

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

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] b1eab3c

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

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

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

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

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b1eab3c

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

@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 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Security Scope Review -- ✅ PASS

Which legitimate operations does b1eab3c7a72346ca804f8d0fc03c0b75334950e6 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): 10 classified, 0 newly refused, 6 still allowed.
  • ubuntu-latest (platform posix): 10 classified, 0 newly refused, 6 still allowed.
  • windows-latest (platform windows): 3 classified, 0 newly refused, 2 still allowed.

No candidate flipped from allowed to refused.

Scope-Verdict: PASS

Reason: The patch changes no matcher, validator, path fence or argv floor. Every hunk rewrites or deletes comment text, and nothing else changes: one comment line (# Check extra paths) is removed and two duplicated comment blocks in safety_override_breadcrumb.py are deleted. With no executable change, the change cannot newly refuse anything. The 12 candidates are controls on the security modules whose comments it edits.

TIGHTENING: none -- no mechanism got stricter. The closest hunk to a guard is comment-only, e.g. src/kiro_crew/security/argv_floor_ssh.py: -# checked twice (round-26): the floor recurses on it → +# checked twice: the floor recurses on it. The code lines around it, such as _SSH_FORWARD_OPT_LETTERS: frozenset[str] = frozenset("lrdwb"), are unchanged context.

ADJUDICATED: 12 candidates, 0 confirmed newly-refused

PLATFORM COVERAGE: The diff adds no assumption about paths, separators, interpreters or environment variables, because it adds no code.

  • posix: ssh port forward, rsync, scp in host:path form, ssh -v, date -d, file, less, a same-line variable assignment, and git -C with a POSIX path. These touch the ssh floor, the read-only command lists and the shell normalizer, whose comments were edited.
  • windows: ssh.exe with a port forward and git -C with a drive-letter path. These cover the Windows spelling of the same operations.
  • any: git --no-pager log, the global-option case named in the edited agent_runner_gate.py comments.

No platform assumption is left unprobed.

[SCOPE-REVIEWED] b1eab3c

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: cdf6a5c
  • What rule changed: None. Only # comment lines change in 70 security-sensitive files; no code, string, constant or docstring is touched.
  • Before -> after (what was allowed/blocked, now): Identical. goal_scan.py astcheck e4fad3933a compares ast.dump(ast.parse(src)) for every changed file against the merge base: files checked: 70 code-changed: 0 docstring-only: 0.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): No runtime effect is possible, since the compiled code is unchanged. The real risk is a rewritten comment that states a security reason less clearly; each rewrite is listed with a Reader: line in the PR body for review.
  • Evidence checked (which sandbox result proves it): The AST check above, plus the sandbox/security suites (test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*) passing 3 times on this head.
  • No regression:
    • Tools still work (which tools/commands were run, result): N/A for runtime: no code changed (AST-identical). flake8 and isort on the 70 files are clean.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes; same AST as base, so every caller, config and stored record is read by identical code.
    • Existing tests (which suites passed on this head): 366 test files (related module tests for every touched module, the 6 touched apps' test dirs, and the sandbox/security dirs), KIROCREW_PROFILE=standalone pytest -n 4, 3 runs: 18594 passed, 117 skipped, 2 failed each run; the same 2 fail on an unmodified merge-base worktree on this host (host state: setfacl refused, and a code_review_sage link-window test).
  • How to undo: Revert the single commit; it only touches comments.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Backend Lint (and the Coverage Gate that depends on it) fails on src/kiro_crew/publish_governance.py:299: F821 undefined name 'lists_checked_by_caller'. This PR does not touch that file; main has the same error since #24343, and #24767 fixes it. I will rebase once #24767 merges.

@iamwhatever
iamwhatever force-pushed the comments/src-security branch from cdf6a5c to c7c0931 Compare October 27, 2026 07:54
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: c7c0931
  • What rule changed: None. Only # comment lines change in 70 security-sensitive files; no code, string, constant or docstring is touched.
  • Before -> after (what was allowed/blocked, now): Identical. goal_scan.py astcheck aeb5c02c4b (the merge base after the rebase onto main for fix(governance): pass lists_checked_by_caller to session check #24767) compares ast.dump(ast.parse(src)) for every changed file against the merge base: files checked: 70 code-changed: 0 docstring-only: 0.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): No runtime effect is possible, since the compiled code is unchanged. The real risk is a rewritten comment that states a security reason less clearly; each rewrite is listed with a Reader: line in the PR body for review.
  • Evidence checked (which sandbox result proves it): The AST check above, plus the sandbox/security suites (test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*) passing 3 times on the pre-rebase head cdf6a5c, which has the same diff (the rebase moved only the base).
  • No regression:
    • Tools still work (which tools/commands were run, result): N/A for runtime: no code changed (AST-identical). flake8 and isort on the 70 files are clean.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes; same AST as base, so every caller, config and stored record is read by identical code.
    • Existing tests (which suites passed on the same diff, pre-rebase head cdf6a5c): 366 test files (related module tests for every touched module, the 6 touched apps' test dirs, and the sandbox/security dirs), KIROCREW_PROFILE=standalone pytest -n 4, 3 runs: 18594 passed, 117 skipped, 2 failed each run; the same 2 fail on an unmodified merge-base worktree on this host (host state: setfacl refused, and a code_review_sage link-window test).
  • How to undo: Revert the single commit; it only touches comments.

1 similar comment
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: c7c0931
  • What rule changed: None. Only # comment lines change in 70 security-sensitive files; no code, string, constant or docstring is touched.
  • Before -> after (what was allowed/blocked, now): Identical. goal_scan.py astcheck aeb5c02c4b (the merge base after the rebase onto main for fix(governance): pass lists_checked_by_caller to session check #24767) compares ast.dump(ast.parse(src)) for every changed file against the merge base: files checked: 70 code-changed: 0 docstring-only: 0.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): No runtime effect is possible, since the compiled code is unchanged. The real risk is a rewritten comment that states a security reason less clearly; each rewrite is listed with a Reader: line in the PR body for review.
  • Evidence checked (which sandbox result proves it): The AST check above, plus the sandbox/security suites (test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*) passing 3 times on the pre-rebase head cdf6a5c, which has the same diff (the rebase moved only the base).
  • No regression:
    • Tools still work (which tools/commands were run, result): N/A for runtime: no code changed (AST-identical). flake8 and isort on the 70 files are clean.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes; same AST as base, so every caller, config and stored record is read by identical code.
    • Existing tests (which suites passed on the same diff, pre-rebase head cdf6a5c): 366 test files (related module tests for every touched module, the 6 touched apps' test dirs, and the sandbox/security dirs), KIROCREW_PROFILE=standalone pytest -n 4, 3 runs: 18594 passed, 117 skipped, 2 failed each run; the same 2 fail on an unmodified merge-base worktree on this host (host state: setfacl refused, and a code_review_sage link-window test).
  • How to undo: Revert the single commit; it only touches comments.

@iamwhatever
iamwhatever force-pushed the comments/src-security branch from c7c0931 to dbfb8b2 Compare October 27, 2026 09:07
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: dbfb8b2
  • What rule changed: None. Only # comment lines change in 70 security-sensitive files; no code, string, constant or docstring is touched.
  • Before -> after (what was allowed/blocked, now): Identical. goal_scan.py astcheck a62012b058 (the current merge base with main) compares ast.dump(ast.parse(src)) for every changed file against the merge base: files checked: 70 code-changed: 0 docstring-only: 0.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): No runtime effect is possible, since the compiled code is unchanged. The real risk is a rewritten comment that states a security reason less clearly; each rewrite is listed with a Reader: line in the PR body for review.
  • Evidence checked (which sandbox result proves it): The AST check above, plus the sandbox/security suites (test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*) passing 3 times on the pre-rebase head cdf6a5c, which has the same diff (the rebase moved only the base).
  • No regression:
    • Tools still work (which tools/commands were run, result): N/A for runtime: no code changed (AST-identical). flake8 and isort on the 70 files are clean.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes; same AST as base, so every caller, config and stored record is read by identical code.
    • Existing tests (which suites passed on the same diff, pre-rebase head cdf6a5c): 366 test files (related module tests for every touched module, the 6 touched apps' test dirs, and the sandbox/security dirs), KIROCREW_PROFILE=standalone pytest -n 4, 3 runs: 18594 passed, 117 skipped, 2 failed each run; the same 2 fail on an unmodified merge-base worktree on this host (host state: setfacl refused, and a code_review_sage link-window test).
  • How to undo: Revert the single commit; it only touches comments.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased onto main (now at dbfb8b2). The previous head's review lanes all failed on a repo-wide GitHub API rate limit, and Security Scope Review then held that failure as the per-head floor even though its re-run classified PASS, so a fresh head was the only way to re-measure. The diff is unchanged: astcheck against the new merge base still reports 70 files, 0 code-changed.

@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 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Backend Tests (3.12, 2) and (Windows) (2) fail on one test: test/test_crew_log_fullscan_guard.py::test_a_warm_session_read_that_earns_a_savepoint_reads_only_the_gap (strict XPASS). This PR does not touch crew-log code; main has the same red shard, and #24774 fixes it. I will rebase once #24774 merges.

@iamwhatever
iamwhatever force-pushed the comments/src-security branch from dbfb8b2 to a8967db Compare October 27, 2026 13:12
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: a8967db
  • What rule changed: None. Only # comment lines change in 70 security-sensitive files; no code, string, constant or docstring is touched.
  • Before -> after (what was allowed/blocked, now): Identical. goal_scan.py astcheck c7189a883e (the current merge base with main) compares ast.dump(ast.parse(src)) for every changed file against the merge base: files checked: 70 code-changed: 0 docstring-only: 0.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): No runtime effect is possible, since the compiled code is unchanged. The real risk is a rewritten comment that states a security reason less clearly; each rewrite is listed with a Reader: line in the PR body for review.
  • Evidence checked (which sandbox result proves it): The AST check above, plus the sandbox/security suites (test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*) passing 3 times on the pre-rebase head cdf6a5c, which has the same diff (the rebase moved only the base).
  • No regression:
    • Tools still work (which tools/commands were run, result): N/A for runtime: no code changed (AST-identical). flake8 and isort on the 70 files are clean.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes; same AST as base, so every caller, config and stored record is read by identical code.
    • Existing tests (which suites passed on the same diff, pre-rebase head cdf6a5c): 366 test files (related module tests for every touched module, the 6 touched apps' test dirs, and the sandbox/security dirs), KIROCREW_PROFILE=standalone pytest -n 4, 3 runs: 18594 passed, 117 skipped, 2 failed each run; the same 2 fail on an unmodified merge-base worktree on this host (host state: setfacl refused, and a code_review_sage link-window test).
  • How to undo: Revert the single commit; it only touches comments.

@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 27, 2026
Remove review-round tags and PR-history narration from # comments in
the security-sensitive files the earlier source-comment passes skipped.
Each rewrite keeps the threat, invariant or fail-closed reason and drops
only the "earlier revision" / "found in review" / round-N framing.
Comments only: every touched file has the same AST as its base.
@iamwhatever
iamwhatever force-pushed the comments/src-security branch from a8967db to b1eab3c Compare October 27, 2026 15:22
@iamwhatever

Copy link
Copy Markdown
Contributor Author

Sensitive change review

  • Head commit: b1eab3c
  • What rule changed: None. Only # comment lines change in 70 security-sensitive files; no code, string, constant or docstring is touched.
  • Before -> after (what was allowed/blocked, now): Identical. goal_scan.py astcheck cd89e05194 (the current merge base with main) compares ast.dump(ast.parse(src)) for every changed file against the merge base: files checked: 70 code-changed: 0 docstring-only: 0.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): No runtime effect is possible, since the compiled code is unchanged. The real risk is a rewritten comment that states a security reason less clearly; each rewrite is listed with a Reader: line in the PR body for review.
  • Evidence checked (which sandbox result proves it): The AST check above, plus the sandbox/security suites (test_sandbox*, test_security*, test_denied_commands*, test_argv_floor*) passing 3 times on the pre-rebase head cdf6a5c, which has the same diff (the rebase moved only the base).
  • No regression:
    • Tools still work (which tools/commands were run, result): N/A for runtime: no code changed (AST-identical). flake8 and isort on the 70 files are clean.
    • Backward compatible (old config / old data / old callers still work, how checked): Yes; same AST as base, so every caller, config and stored record is read by identical code.
    • Existing tests (which suites passed on the same diff, pre-rebase head cdf6a5c): 366 test files (related module tests for every touched module, the 6 touched apps' test dirs, and the sandbox/security dirs), KIROCREW_PROFILE=standalone pytest -n 4, 3 runs: 18594 passed, 117 skipped, 2 failed each run; the same 2 fail on an unmodified merge-base worktree on this host (host state: setfacl refused, and a code_review_sage link-window test).
  • How to undo: Revert the single commit; it only touches comments.

@iamwhatever

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in 45 files this PR also touches since this head went green (c7189a8 -> cd89e05); CI re-running. astcheck against the new merge base: 70 files, 0 code-changed.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author

macOS Tests shard 4 hit the 40-minute job limit with GitHub's 'macOS arm64 capacity constraints' notice and no test failure, so I re-ran that one job once. The other macOS shards and all Linux and Windows shards passed on b1eab3c.

@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 27, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) October 27, 2026 18:20
@chenmingwei23
chenmingwei23 merged commit 05ee2e4 into main Oct 27, 2026
126 of 127 checks passed
auto-merge was automatically disabled October 27, 2026 23:09

Pull Request is not mergeable

@chenmingwei23
chenmingwei23 deleted the comments/src-security branch October 27, 2026 23:09
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 27, 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