Skip to content

feat(dev-fleet): create a worktree at the newest stable release - #23372

Closed
cixuuz wants to merge 1 commit into
kirodotdev:mainfrom
cixuuz:feat/dev-fleet-release-channel-pin
Closed

cixuuz wants to merge 1 commit into
kirodotdev:mainfrom
cixuuz:feat/dev-fleet-release-channel-pin

Conversation

@cixuuz

@cixuuz cixuuz commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: From Dev Fleet, check out the newest published stable release as a worktree you can pod or make live, without leaving the dashboard.

You cannot click through a shipped release from Dev Fleet. The fleet lists feature worktrees, and every one is unreleased code. To run what stable actually shipped you leave the dashboard, find the current tag by hand, and make the checkout yourself. Dev Fleet manages git checkouts, and a git checkout has no release channel.

Why it matters

A bug report says "broken in stable". Answering it means running stable. Today that
is manual work outside the tool that exists to manage checkouts, so it mostly does
not happen, and a fix gets tested against main instead of against the build the
reporter is on.

Not a goal

  • A second channel. nightly tags nothing, so its row would be main; insider tags resolve, but ordering -insider.N against -rc.N needs a rule this repository does not state.
  • Moving the pin in place. A newer release is Remove, then Create.
  • Changing which channel this install updates from. Nothing reads or writes $KIROCREW_HOME/channel.
  • Hardening any other checkout Dev Fleet or the dashboard performs.

What changed (motivation → approach → change)

Dev Fleet's toolbar gains a labelled More actions menu beside Prune merged, which stays the toolbar's one button; the menu's trigger is the second control (max-two-buttons-per-row counts it). Refresh moves into that menu, next to the new Release worktree item. It creates release-channel-stable: a real worktree detached at the newest published vX.Y.Z release. Pods and Make Live already drive any fleet row, so a shipped build boots the same way a feature branch does.

The approach is resolve-when-asked, not a standing mirror. The gateway asks the configured remote (git ls-remote) for the newest stable tag and the commit it advertises, fetches that one tag's objects, and checks it out detached. The action adds no background fetch, no pinned-row UI and no private common dir.

Moving part What it does
dev_fleet/release_worktree.py resolves the newest stable tag by semver, counting only a whole vX.Y.Z of ASCII digits with no leading zero and ignoring every other v* name the remote lists, confirms its advertised commit, refuses a partial clone (whose checkout would fetch the release's files itself), fetches that one tag, then runs git worktree add --detach from the gateway at the strict sandbox tier, with --no-replace-objects on the commit verify, the checkout and the HEAD readback so a refs/replace graft cannot swap the checked-out tree; refuses a name already registered at another path; a request cancelled mid-checkout settles before it unwinds
dev_fleet/runtime.py _run_cmd gains two keyword-only opt-ins, a sandboxed hook-name scan and a byte-capped incremental read; both default to today's behaviour and only the release action's network steps pass them
dev_fleet/gateway_routes.py POST /api/apps/dev-fleet/create-release-worktree, owner-only, every app token refused; {ok, path, name, version, ref, oid}, or a refusal: 503 when a step is refused for lack of an OS sandbox backend, 409 otherwise
security_posture.py lists release_worktree.py with the other Dev Fleet modules that redact text for the app's own replies and audit records
website/src/apps + website/src/i18n/locales the toolbar menu, with Refresh moved into it beside the new item (DevFleetPage.tsx, five strings in all twelve locales), and the gateway-route note (devFleetApi.ts)
docs the dev-fleet.md spec section
website/capture + website/scripts the committed capture harness behind the screenshots: capture-23344-release-worktree.mjs drives the isolated devfleet-release-worktree entry (the real DevFleetPage over a fetch stub, fixture data only); website/.jscpd.json exempts that entry from duplicate detection against its Dev Fleet sibling, by file

Why the gateway and the strict tier: git worktree add reads the repository's own .git/config and follows include.path, so a hostile config could name a content-filter driver. The checkout and the other local steps, the worktree-list and filter probes included, therefore run from the gateway at the strict tier (~/.aws, ~/.ssh and the vault bind-masked wherever an OS sandbox backend runs them), reusing handlers/worktree.py's filter probe and runner. The two network steps (ls-remote, the one-tag fetch) run at the stricter of standard and this install's effective agent.sandbox tier, so no git child the action runs is less confined than an agent's own commands; on a cc/strict install they clamp up to that tier. The route's main-checkout discovery, which runs before the action, is outside that statement. On a host with no backend that permits unsandboxed execution (agent.sandbox_allow_unsandboxed_exec in effect, its default on Windows only, and no governance sandbox.min_level floor above off), every step runs its git unsandboxed with a credential-scrubbed environment, as agent spawns there do. Neither comparison covers an agent session whose isolation Kiro Crew leaves to the Kiro CLI's own sandbox (macOS with that sandbox switched on, or the official Kiro CLI on Windows). The cost: credentials are withheld above standard, so a private remote cannot be fetched there, and the action refuses with a worded reason that names the tier. A public remote and the default standard install are unaffected.

On those network steps the scan that lists config-defined hook names, so each is disabled by name, runs inside the sandbox at the step's tier rather than as a gateway git. Each step's own git output is read incrementally under a 4 MiB cap, past which the child is killed and the step refuses, so a hostile advertisement is not buffered whole in the gateway. The fetch also resets several repo-config keys git would otherwise execute (core.sshCommand, credential.helper, gpg) as defense in depth; the boundary is the tier, not that list. Provenance is the whole .git, as Make Live and sync already trust it, except that the local object steps ignore refs/replace.

Backwards compatibility

Compatible: one gateway route, one toolbar menu and its item are added; Prune merged keeps its place and Refresh moves from a toolbar button into the More actions menu (same action, same label), the /fleet payload and the worktrees shape are unchanged, and _run_cmd's two new parameters are keyword-only with defaults that keep every existing caller on its current path.

Moves one control: Refresh is no longer a toolbar button but the first item of the More actions menu. This is deliberate, because max-two-buttons-per-row counts the menu trigger and Prune merged is the row's primary action; Refresh becomes two clicks, and the fleet already re-reads after every action. Otherwise the diff adds a module, a route, a menu, catalog strings and tests, and narrows no existing contract. The prune rules are unchanged; no exemption is added.

Tests

  • test/test_dev_fleet_release_worktree.py (new, 69): newest-by-semver resolution and the advertised-commit confirm; a tag outside the ASCII release shape (a leading zero, a non-ASCII digit in two scripts, a ten-digit part) never outranks the tip, a tag that is no release refuses nothing however long or many, and a release tag is matched whole; a promisor remote in force, read the way git reads a boolean, is refused as partial_clone before the fetch; the refusals (unpublished, a retracted tag, provenance mismatch, a declared checkout filter, an existing destination, a name registered at another path or left registered at the reserved path, a worktree list that cannot be read, a local step whose git cannot complete, a racing destination claim); after a failure past the claim, a failed worktree add releases the claim with an rmdir, which removes only an empty directory, and leaves another writer's tree alone; a tree that did not land detached is removed by git, and one git cannot remove is left with the command that clears it; a timed-out worktree add removes nothing and names the command that clears the tree once the checkout stops; a cancel mid-checkout still runs the readback or the unwind, holding the lock until then; a missing sandbox answers sandbox_unavailable on both ls-remote reads, the fetch, and the worktree-list and filter probes; every network step engages both _run_cmd opt-ins, and the worktree-list probe runs strict through _run_git; the network steps run at standard by default, the shipped auto included, and clamp up on a strict install, and a private remote unfetchable there is refused with a worded reason; real-git arms (a planted filter.<name>.smudge is refused and never runs, a --filter=blob:none clone is refused before the fetch and the remedy its refusal names clears it, a post-checkout hook does not run, a clean repo lands detached on the tag's peeled commit, a planted core.sshCommand is neutralized, a planted url.<evil>.insteadOf redirects resolution, the readback's removal of its own tree clears even a locked record, a credential-shaped filter name is redacted from the refusal, a refs/replace graft over the release commit does not change the checked-out tree, and a tag-mapping fetch refspec writes no local tag or FETCH_HEAD); and a parametrized sweep across prune/pruneTags, a tag-mapping or mirror remote.<name>.fetch, tagOpt, fetch.bundleURI and submodule recursion, proving that under each of them the fetch writes, updates or deletes no ref and runs no fetch inside a submodule.
  • test/test_dev_fleet_run_cmd_opt_ins.py (new, 14): the opt-ins are keyword-only and default to today's path; the default path keeps the unsandboxed scan and communicate(); only the release action's network runner passes them (a source scan of src/kiro_crew); each opt-in, engaged, takes its branch; the capped reader kills a child flooding stdout or stderr, including one still writing when the cap trips, and keeps stderr's last line.
  • website/src/apps/dev-fleet/DevFleetPageCoverage.test.tsx (updated): the two post-action refresh cases open the menu and pick Refresh.
  • test/test_dev_fleet_gateway_routes.py (updated): the route is owner-only, refuses every app token, answers 503 for a missing sandbox and 409 for any other refusal, and the registration test lists the new route.
  • website/src/apps/dev-fleet/DevFleetPage.releaseWorktree.test.tsx (new, 4): Prune merged is the one toolbar button and Refresh and Release worktree are items in the menu, its accessible name its visible label and its hint the title; success names the tree and version; the route's refusal reaches the page; the trigger is busy and the reopened item disabled while the request runs.

Determinism (testing-conventions § Proving a determinism fix): the three backend files are green 20/20 at -n0 (167 passed) and 10/10 at -n 4 --dist loadgroup --max-worker-restart=2 with test_dev_fleet_app_guards.py and test_dev_fleet_repo_accessor.py as co-tenants (246 passed, 1 skipped), and in a shuffled order (seed 25971, 167 ids). The new frontend test is green 10/10, and the Dev Fleet frontend suite passes shuffled (seed 8317, 212 tests). Static ratchets versus the merge-base (semgrep, jscpd, the flake-pattern ratchet and the website restyle ratchet) report no new findings.

Manual verification

The four states were captured from the real DevFleetPage with fetch stubbed at the network seam, fixture data only, by the committed harness website/scripts/capture-23344-release-worktree.mjs — see Screenshots; each scene asserts its state before the shot, and the success scene waits for the new row the fleet re-read returns. The tier and provenance statements in release_worktree.py were checked by real-git probes: git rejects a content-tampered loose object (hash mismatch), and a url.*.insteadOf redirect is honored, which is why the module states the trust boundary as the whole .git; a refs/replace graft is now ignored by the local object steps (--no-replace-objects).

Screenshots / video

Dev Fleet toolbar, dark theme, attached to this description (nothing is committed). The harness that produced them, website/scripts/capture-23344-release-worktree.mjs, drives the isolated website/capture/devfleet-release-worktree.{html,tsx} entry, so a reviewer can regenerate them.

The menu open — Prune merged is the one button; Refresh and Release worktree are the menu's items:

More actions menu open with Refresh and Release worktree

In flight — the trigger spins, and the reopened item reads "Creating…", disabled:

Creating…

Success — the toast names the worktree and version, and the re-read fleet shows the new release-channel-stable row:

Success toast and the new release-channel-stable row

Refusal — the server's reason in the action-error banner:

Refusal banner

Related Issues

Closes #23344

#23344's proposed background mirror, pinned fleet row and hermetic private common dir were replaced by resolution when the action runs, after @chenmingwei23's review; the simpler action solves the same problem. #12342 (the TOCTOU race in the earlier hermetic populate) is deliberately not closed here: this version has no populate step, so the race has no counterpart. #26550, #26551, #26552 and #26553, filed against the earlier design, become moot under this version.

Checklist

  • At most two commits (one here), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (docs/system-specs/modules/dev-fleet.md)
  • No secrets, credentials, or internal references in the diff

@cixuuz
cixuuz requested review from a team and KiroCrewCaptain as code owners October 23, 2026 07:58
@cixuuz
cixuuz requested a review from iamwhatever October 23, 2026 07:58
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 23, 2026
@cixuuz
cixuuz force-pushed the feat/dev-fleet-release-channel-pin branch from 4dc72aa to c43cac8 Compare October 23, 2026 08:11
@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 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] 968b006

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 968b006de7f8aa3fc180ff497ce06644094b2e5f via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the gateway-run strict-tier checkout reuses the reviewed handlers/worktree.py path, nothing is taken away, and four rendered screenshots cover the toolbar change.

Notes

  • Dev Fleet is a built-in app that Move every built-in app out to KiroCrewApps and forbid built-in apps #26967 is moving out of core. This PR adds 856 lines and a new gateway route that will have to move with it, so it is new feature surface in core rather than a fix in place. It isn't pinned in adoption-pins.json yet, so this is allowed, but expect it to raise the cost of the move.
  • The two _run_cmd additions (sandboxed_hook_scan, max_output_bytes) are only used by this action. If no second caller shows up, they could live in release_worktree._run_network_git and leave the shared runner's signature unchanged.

[DESIGN-REVIEWED] 968b006

Description read

[DESCRIPTION-READ] 38453586494464efa875fca4789fbc8903cd7eb5146f621d795c03be56105d45

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

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 968b006de7f8aa3fc180ff497ce06644094b2e5f via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

The screenshots show every new control and state: the More actions trigger, Refresh, Release worktree, Creating…, the success toast and a refusal banner. Nothing blocks. No blind reader has seen them, because this lane runs without one. Pushing the branch to this repo runs that read.

Notes

  • create_release_worktree "Release worktree" is a noun. It doesn't say the item creates anything or that it targets stable, and that only shows in the title tooltip. Rename it "Create stable worktree" and drop the tooltip that repeats it.
  • The refusal banner in attachment-04 reads "the remote advertises no stable release tag". It starts lowercase, uses git terms, and gives no next step. Write it in the user's terms and add what to do next, e.g. "No stable release published on origin yet — push a vX.Y.Z tag or try again later."

[UX-REVIEWED] 968b006

Description read

[DESCRIPTION-READ] 7ecb02e3cb3200e45c50543f821814067991d31640a605b52cacd149a5ae22b0

That sha256 names everything this verdict read: the PR description, plus the 7 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 23, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 968b006de7f8aa3fc180ff497ce06644094b2e5f via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Every item meets a named need. Two kinds of surface have only one caller.

Notes

  • Item 4 — one consumer, generalized: _run_cmd gets two independent keyword flags, sandboxed_hook_scan and max_output_bytes. I grepped the added + lines for sandboxed_hook_scan=|max_output_bytes=. Outside tests there is exactly 1 caller, _run_network_git (patch lines 524–525), and it always passes both flags together. Subtraction: have release_worktree.py call _communicate_capped and _with_config_hooks_off_sandboxed through a private runner of its own, so _run_cmd's shared signature stays as it is today.
  • Item 6 — rides along: the fetch also resets core.sshCommand, credential.helper and the gpg keys. The description says these resets are "defense in depth; the boundary is the tier, not that list". Subtraction: delete the resets and rely on the tier, which the description already names as the boundary.

What this change ships

Inventory (8 items) — 6 justified

Intent: run the newest stable release as a Dev Fleet worktree without leaving the dashboard — ADDITION.

  1. A "Release worktree" menu item creates release-channel-stable, detached at the newest vX.Y.Z tag — justified
  2. A new "More actions" menu sits beside Prune merged — justified
  3. Refresh moves from a toolbar button into that menu — justified
  4. _run_cmd gains a sandboxed hook-scan flag and an output-cap flag — one consumer, generalized
  5. A new owner-only gateway route, POST /create-release-worktree — justified
  6. The fetch resets repo-config keys git would otherwise execute — rides along, not the boundary
  7. release_worktree.py is added to the redaction-module list — justified
  8. A capture harness and a jscpd exemption for screenshots — justified

[FIRST-PRINCIPLES-REVIEWED] 968b006

Description read

[DESCRIPTION-READ] 7c74ad0aa213a91bf1e923a700969f398a9c3bb534e27e832f113ce1ce650547

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 added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 23, 2026
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] 968b006

@cixuuz
cixuuz force-pushed the feat/dev-fleet-release-channel-pin branch from c43cac8 to 9cf097a Compare October 23, 2026 08:29
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026
@cixuuz
cixuuz force-pushed the feat/dev-fleet-release-channel-pin branch from 9cf097a to d7edf2d Compare October 23, 2026 08:43
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026
@cixuuz
cixuuz force-pushed the feat/dev-fleet-release-channel-pin branch from d7edf2d to c98578d Compare October 23, 2026 09:10
@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 23, 2026
@cixuuz

cixuuz commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

First Principles PASS on f0b070c3a3; two notes:

Item 6, drop or gate the refresher's fetch_refs: needs-decision. Held as on e021b7df5e. Dropping it would leave the placeholder's "newest stable" and the adopted row's Behind badge stale until an operator clicks Create; gating it on the row existing keeps Behind fresh but leaves the placeholder stale. Both are reasonable, and the choice is part of the open scope thread with the maintainer, so it is not changed on a PASS. Design raised the same cost this round.

Item 4, _checkout_filter sibling keeps the racy probe: accepted and deferred. As the description says, the hermetic populate is Create's; converging dashboard/handlers/worktree.py and crewmate_worktree.py onto it is a separate change with its own callers.

@cixuuz

cixuuz commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: 8ee9080ffc4c6c1cdef2b7ca6b76f58f9aeb1337 -> b15273a6e3372ab5ec795c66abeda6a081777698 onto badd8f5aa8 (main +5). The commit is unchanged by the rebase (git range-diff: =). This head's green was out of date because main edited files this PR also touches (the i18n catalogs and docs/feature-map/README.md). On the rebased tree: npm run i18n:check PASS, vitest run src/i18n DevFleet (61 files, 1284 tests), docs_lint.py, and check_feature_map.py with FEATURE_MAP_BASE_REF=origin/main all pass. The last 2 main commits touch no file in this PR. Push guard SAFE (single commit on base).

The only real red on 8ee9080ffc was Backend Tests (3.12, 2) failing test/test_native_skill_projection_rewrites.py::test_two_concurrent_releases_each_prune_their_own_view, the open flake #23965 in skill-projection code this PR does not touch. Coverage Gate and PR Readiness failed only because of that shard.

@cixuuz

cixuuz commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: b15273a6e3372ab5ec795c66abeda6a081777698 -> 3e748957f2c94c9e4e8541875b97f268b5a29adf onto 8edd26d9ba (main +3). The rebase leaves the commit unchanged (git range-diff: =), and main's 3 commits touch no file in this PR. Main updated two ratchet baselines, so I re-ran both against this PR's 55 files: check_subprocess_encoding.py and check_sync_io_in_async.py pass. Push guard SAFE (single commit on base).

b15273a6e3 closed with 100 of 103 checks green and every review lane passing. The 3 reds were Backend Tests (3.12, 2) failing on the open flake #23965 (test_two_concurrent_releases_each_prune_their_own_view, the second head in a row on this PR), plus Coverage Gate and PR Readiness, which failed only because that shard did. This push re-runs that shard.

@cixuuz

cixuuz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: 3e748957f2c94c9e4e8541875b97f268b5a29adf -> abc4644a3ffb741b1c562c5fb59d6b9ea2c22d98 onto a3ee04f574 (main moved a lot overnight). This picks up #24142 ("wait for the coalesced follow-up prune before asserting"), the fix for the flake #23965 that failed Backend Tests (3.12, 2) on the last three heads; #23965 is now closed.

The rebase applied cleanly. git range-diff marks the commit ! only because surrounding lines shifted: no added or removed line in the patch changed. Main also touched files this PR edits (worktree_ops.py via #24101, the i18n catalogs, docs/feature-map/README.md), so I re-ran the full local set on the rebased tree:

  • pytest over every test_dev_fleet*.py plus test_native_skill_projection_rewrites.py and both ratchets: 1570 passed
  • check_black_formatting.py with black 26.10.1 (main's new pin), isort, flake8, mypy on dev_fleet
  • check_file_line_cap.py, check_subprocess_encoding.py, check_sync_io_in_async.py, docs_lint.py, check_feature_map.py against origin/main
  • tsc, npm run i18n:check, vitest run src/i18n DevFleet (61 files, 1284 tests)

Push guard SAFE (single commit on base).

@cixuuz

cixuuz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

span=204f62c484b8: fixed on e0ce9ab3296300f6ea579879ce0baab2221cabf5, by subtraction.

runtime._display_path is deleted. Its four call sites in worktree_ops_release.py now carry the bare path; the owner performs no redaction at all. The scrub happens where the string leaves the process: http_api.api_dev_fleet_run (a registered egress) scrubs every string in a run's result on the way out, as it already scrubbed the output lines. Git stderr is still bounded and scrubbed by runtime._error_detail, which does work _redact does not (strip + 200-char bound) and lives in the module classified for that path.

Why not "call _redact under its real name in worktree_ops_release.py": that makes the module a redactor call site, and the classification gate then requires an entry in security_posture.NON_EGRESS_REDACTION_MODULES. This is a fork PR; Sensitive Change Review refuses a fork diff that touches security_posture.py (it did, on an earlier head). So the honest shape available to this PR is no redaction in the owner and redaction at the registered boundary, which is also the simpler one.

Tests: test_the_run_record_carries_the_outcome_the_route_used_to_answer_with now asserts path is scrubbed alongside error; test_the_release_owners_carry_no_redactor_of_their_own pins that neither owner calls a redactor. Spec: § The Create mutation.

(Re-posted from comment 6375946937 so each disposition record carries one finding; this verdict's items 6 and 8 have their own comments.)

@cixuuz

cixuuz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Item 6 (courtesy --tags fetch every 60 s): accepted and deferred on e0ce9ab3296300f6ea579879ce0baab2221cabf5.

It was added as the GPT fix for span 9ead27a94181's sibling (an operator's git tag listing going stale beside the badge), ran with --no-prune --no-prune-tags, was best-effort, and its status was ignored. Removing it was a behaviour change outside that round's defects, so it was deferred then. It was later removed outright, in e021b7df5e, as one of the three scope concessions to the maintainer: fetch_refs is now a single tag-only mirror fetch with --no-tags, and nothing writes the operator's refs/tags/.

(Split out of comment 6375946937 so each disposition record carries one finding.)

@cixuuz

cixuuz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Item 8 (_start_task_run generalized for one caller): rebutted in part on e0ce9ab3296300f6ea579879ce0baab2221cabf5.

on_finish is not for one caller: it is the same hook _start_run exposes (fleet_state._disk_invalidate on provision), and _admit_run_locked is shared by both, so the two run kinds cannot drift in record shape. Inlining the audit into the work coroutine would put a SEL call inside the owner module, which is exactly the classification the Sensitive Change gate fences for a fork.

(Split out of comment 6375946937 so each disposition record carries one finding.)

@cixuuz

cixuuz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: abc4644a3ffb741b1c562c5fb59d6b9ea2c22d98 -> df9594519bebd83ae73390eabef66e4069354d7e onto 5285bc2878 (main +2: test_skill_listing_cost.py and the chat message store, neither touched by this PR). The commit is unchanged by the rebase (git range-diff: =). Push guard SAFE.

This push re-runs the gates that failed on abc4644a3f without judging anything, because they couldn't read or write the PR through the GitHub API at push time: Fork PR Description ("could not list check-runs ... refusing to POST"), Publish readiness signal ("Failed to publish the readiness status"), GPT 6.1 Review ("could not run"), Internal Content Scan, Security Scope Review, Screenshot Evidence and Sensitive Change Review. Dependency License Gate failed with "Dependency review is not supported on this repository" (the dependency graph is disabled in the repo settings), which no change in this PR can affect.

@cixuuz

cixuuz commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Rebased: df9594519bebd83ae73390eabef66e4069354d7e -> d622fc777115dcd0abd4269aef4e7c95993d9786 onto 96c4fef57c (main +7). Same-file overlap: #24493 dropped history comments in src/kiro_crew/apps/builtins/dev_fleet/runtime.py (+2/-3). The rebase applied cleanly and leaves the commit unchanged (git range-diff: =). On the rebased tree: check_comment_history.py against origin/main (no history narration on added lines), 1427 dev-fleet tests, the black gate (26.10.1), flake8, mypy and docs_lint.py all pass. Push guard SAFE (single commit on base).

df9594519b had finished every test shard green, with GPT and Opus clear and UX PASS. The only reds were four CANCELLED duplicate fast-gate runs (Automated Rule Check, Inclusive Language, SAST, PR Hygiene), each superseded by a successful run of the same gate on that head.

@cixuuz

cixuuz commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Design PASS on d622fc7771. Per-cycle tag-mirror fetch on every install: needs-decision.

This is the same cost First Principles item 6 raises on this head. The lane's own read is "acceptable for now", and since e021b7df5e the fetch is tag-only with --no-tags, runs as its own spawn, and cannot stall Behind. Whether to keep it, gate it on the row existing, or drop it and refresh on Create is a product choice that belongs to the open scope thread with the maintainer, so I'm not changing it on a PASS.

@cixuuz

cixuuz commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

First Principles PASS on d622fc7771. Item 6, drop fetch_refs from _status_refresher: needs-decision.

The subtraction is well-formed: Create calls fetch_refs before it resolves, so Create itself does not need the refresher. What the per-cycle fetch buys is the placeholder's "newest stable" name and the adopted row's Behind badge staying current between Creates. Dropping it means a new stable release goes unseen until someone clicks Create. Keeping that freshness against one extra fetch per cycle on every install is a trade-off for the maintainer, and it's already in their scope thread, so it is held rather than changed on a PASS. Design raised the same cost this round.

@cixuuz

cixuuz commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

UX PASS on d622fc7771. Raw git output after the framing sentence (06, 07, 11): accepted and deferred.

The notices render through the shared ErrorNotice, and its Ask-the-agent hand-off is the designed consumer of the git text. Mapping known causes to plain words and moving the stderr behind that hand-off changes the shared component that other Dev Fleet errors also use, so it belongs in its own PR. It's on the follow-up list with the two notes below.

@cixuuz

cixuuz commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

UX PASS on d622fc7771. Unreadable-HEAD (12) and version-probe (14) reuse release_channel_unresolved: accepted and deferred.

The point is right: in both cases the channel resolved and it is the checkout that couldn't be read. A dedicated key means a new string across all 12 catalogs plus the pseudolocale. I'll land it in the same follow-up as the notice copy above, so the error wording changes once rather than in two passes.

@cixuuz

cixuuz commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

UX PASS on d622fc7771. Behind badge offers no next step: accepted and deferred.

The tooltip should name the way out ("remove this worktree from its detail panel, then Create the newest"). It's one more i18n key across the same 12 catalogs as the note above, so it goes into the same copy follow-up rather than this PR.

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

REQUEST_CHANGES at d622fc7.

Four follow-ups are marked 'accepted and deferred' with no GitHub issue: the three UX copy items on this head (raw git stderr in notices 06/07/11, a dedicated string for cases 12 and 14, a next step in the behind-badge tooltip) and the Design prune-abandonment policy for hand-detached trees. Please fix them here, or open one issue per item and link each in the PR description.

Two blockers remain after that, and both need people rather than code:

  • A product decision. The maintainer's scope question (comment 6393308238: could a smaller 'create worktree at tag' action do, without the 60 s tag-mirror fetch on every install and the prune exemption?) has no answer, and the Design and First Principles dispositions on this head are 'needs-decision' pending it.
  • A security review. The hermetic populate (worktree_ops_release.py#L510) is the fence for #12342. Together with the new POST /api/release-channel/create route, it decides what a checkout may execute, so a human security reviewer must sign it off.

Checks are green and every AI lane passes at this head.

— crew-pr-reviewer (r128)

@cixuuz

cixuuz commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Pushed d622fc777115dcd0abd4269aef4e7c95993d9786 -> 325a56342a26b902669b4301ea14aed133879c52 (rebased onto 5a170e93b084, main +1062; the one conflict was the status refresher in worktree_ops.py, resolved by keeping main's redacted base-fetch warning and tmp-pack reaper and running the mirror fetch after them). Answering the review at d622fc7771:

Four deferred follow-ups, one issue each (deferred-finding, owner and Due: on each), linked under Related Issues in the description:

Also on this head, from the local pre-push review lanes:

  • fleet_state.py crossed the 2,000-line cap on the rebase (main grew it too). The release-channel row functions moved into fleet_state_release_channel.py, registered as a component between release_channel_pin and fleet_state in server.py, the boundary test and the spec; nothing else changed in them.
  • A lost run receipt (404 from /run?id= after a gateway restart mid-create) was reported as a failed create even when the worktree move had landed, so the new row rendered under a "could not create" notice. pollReleaseChannelCreate now resolves a lost receipt against a fresh /fleet?fresh=1 read: success when the rebuilt payload carries the adopted tree, lost only when it does not. Two tests pin both outcomes (the success one fails on the previous head).

The two blockers that need people, unchanged and still open:

  • Product decision (comment 6393308238): the three behaviour changes the question named were narrowed on e021b7df5e (no write to the operator's refs/tags/, base and mirror fetches as separate spawns, prune exemption limited to the pin). What remains for the maintainer to rule on is whether the 60 s private tag-mirror fetch ships at all, or whether a plain "create worktree at tag" with no mirror comes first. The Design and First Principles dispositions stay needs-decision until then; I am not changing the design direction to clear a lane.
  • Security review of the hermetic populate (worktree_ops_release.py _populate_release_tree) and the POST /api/release-channel/create route: human sign-off requested; the two lanes' PASS on this head is not a substitute.

Local on 325a56342a: 389 backend tests across the dev-fleet files, facade guards, ratchet and security posture; isort/flake8/black/mypy; line cap, comment-history, feature-map, docs-lint; tsc, i18n check, 50 DevFleet vitest tests; Opus 5.5 local lane clean; the GPT local lane ran on gpt-5.6-sol because gpt-6.1-sol is not served on this account, so CI's GPT lane is the authority there. Semgrep was not available locally; CI's SAST job covers it.

@cixuuz

cixuuz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Replying to @chenmingwei23's question:

Who is the user here, and how often do they need a stable checkout from Dev Fleet?

Thanks for asking before reviewing. Your smaller version is what this push is.

The user. A Dev Fleet operator answering a "broken in stable" report, who needs
to run the build the reporter has. git worktree add ../stable vX.Y.Z does work,
and the row it creates shows in the fleet. What the action adds is finding the
newest stable tag from the remote rather than a possibly stale local refs/tags/,
confirming the commit the remote advertises for it, and making the checkout at
the strict sandbox tier with a declared content filter refused.

The background tag mirror: removed. This version adds no timed fetch, and the
60s refresher is untouched. The action's one fetch is a single tag
(git fetch --no-tags --no-write-fetch-head <remote> refs/tags/<tag>), run only when
someone picks Release worktree from the toolbar's More actions menu. It writes
no refs/tags/ entry and no FETCH_HEAD.

Prune merged: unchanged. No prune rule or preselection changes, and no exemption
is added. The created tree is an ordinary detached row.

The base-branch fetch: unchanged. The action's fetch is separate from it, so a
failed tag fetch cannot leave the base branch stale.

Size. One action. 31 files, +3,001 lines, of which tests are 1,562 (1,459 backend,
103 frontend) and the locale catalogs 65 (five strings in twelve locales and the en-XA
pseudolocale). The new module release_worktree.py is 757 lines and the spec section
about 130. This version adds no pinned row, no private git common dir and no new page.

Fixed on be4c97c10caf8d7945755c1572a426dba84bdb2c.

@cixuuz

cixuuz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: a private git common dir the Create populate built under data_home()/run
resolution: removed -- the action builds no private common dir at all

  • span=832181c6170a Create writes its private Git directory into a sealed subtree

fixed in be4c97c: removed, not re-routed. Create no longer builds a private git common dir, so nothing is written under the sealed run subtree.
It runs git worktree add --detach in the main checkout's own repository, from the gateway at the strict tier, after a one-tag fetch into that repository.
worktree_ops_release.py, _populate_release_tree and _make_hermetic_common_dir are not in this head.

@cixuuz

cixuuz commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: a private git common dir the Create populate built under data_home()/run
resolution: removed -- the action builds no private common dir at all

  • span=ca6351073d65 the private git common dir is created under the sealed run subtree

fixed in be4c97c: removed, not re-routed. Create no longer builds a private git common dir, so nothing is written under the sealed run subtree.
It runs git worktree add --detach in the main checkout's own repository, from the gateway at the strict tier, after a one-tag fetch into that repository.

@cixuuz

cixuuz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the 2048-row and 64-byte bounds on the remote's refs/tags/v* listing, applied before the release filter
resolution: removed -- the listing bounds refused the whole action on tags that are no release; the 4 MiB output cap and the bounded release shape cover what they guarded

  • retrospective: the tag listing was bounded before it was filtered, and the release shape admitted other scripts' digits

removed in 4017374: _MAX_RELEASE_REFS and _MAX_REF_NAME_LEN counted and measured every advertised refs/tags/v* name before is_release_tag, so one long non-release tag, or 2,049 of them, refused the action.
The filter now runs first and both bounds are gone: _MAX_NETWORK_OUTPUT_BYTES already bounds the listing, and _STABLE_TAG_RE (read with fullmatch) admits only ASCII parts with no leading zero and at most nine digits, so parse_version's int() never meets a long run.
The old \d shape ranked v\u0669.0.0 (an Arabic-Indic nine), a fullwidth one, v01.9.0 and v1234567890.0.0 above the real tip; all four are ignored now.
Tests: test_a_tag_outside_the_ascii_release_shape_never_outranks_the_tip (4), test_a_tag_that_is_no_release_does_not_refuse_the_action (2), test_a_release_tag_is_matched_whole; each fails on 137d858.

@cixuuz

cixuuz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 137d858ada -> 4017374f1d: one commit, rebased onto main at 601aa4cd23. What changed besides the rebase:

  1. Rebase. The only conflict was in two catalogs, en.manual.json and en-XA.json, where main added pod_task_chip_* next to this PR's five keys. Both sets are kept, and git range-diff shows the PR's own hunks unchanged.
  2. The release shape and the listing bounds, as the disposition above records.
  3. A partial clone is refused before the fetch, as partial_clone (a 409). In a --filter=blob:none clone, the one-tag fetch goes through the clone's filter, so git worktree add fetched the release's files itself from inside the strict checkout. That is a network step outside _run_network_git, with no output cap and, at strict, no git credentials. A strict git config --get-regexp probe reads remote.<name>.promisor the way git reads a boolean (anything but a false spelling counts) and any extensions.partialClone. The refusal names the commands that hydrate the clone, and test_real_git_a_partial_clone_is_refused_and_its_remedy_clears_it runs them verbatim against a real blobless clone, which the action then creates.

Left as is: the rounds view reported SEAM LIMIT, so a retrospective ran this round. It also proposed smaller replacements for the second ls-remote confirm, the post-add readback, _CREATE_LOCK, _dest_refusal and the two _run_cmd opt-ins. Those are the author's design choices, so this push does not change them.

Local evidence on 4017374f1d:

  • The profile's gates pass: static checks, mypy, 23,681 related backend tests and 17,518 related frontend tests. The 44 backend tests that failed came from a TMPDIR under ~/.kiro, which testing-conventions lists as a false red; those four files pass 371/371 with a neutral TMPDIR.
  • The three backend files are green 20/20 at -n0, 10/10 at -n 4 with two co-tenants, and in a shuffled order (seed 25971).
  • Local review: the opus lane found nothing. The gpt lane ran on gpt-5.6-sol, because gpt-6.1-sol is not served on this account; it raised the partial-clone finding, and a focused re-verification found it closed.

Add an owner-only gateway action that creates release-channel-stable
as a sibling worktree detached at the newest published vX.Y.Z, so an
operator can pod it or make it live without finding the tag by hand.

The gateway asks the configured remote for the newest stable tag and
the commit it advertises, fetches only that tag's objects (it writes
no ref and no FETCH_HEAD), and runs git worktree add --detach at the
strict sandbox tier through handlers/worktree.py's runner, with hooks
turned off and a declared content filter refused. The local steps run
with ~/.aws, ~/.ssh and the vault bind-masked wherever an OS sandbox
backend runs them. The network steps run at the stricter of standard
and the install's agent.sandbox tier. The action adds no background
tag fetch, no pinned row and no prune-rule change: the tree is an
ordinary detached fleet row. The commit verify, the checkout and the
HEAD readback pass --no-replace-objects, so a refs/replace graft cannot
swap the checked-out tree for another while HEAD reads the advertised
oid. A release is a whole vX.Y.Z of ASCII digits with no leading zero;
every other v* name the remote lists is ignored, so none of them can
refuse the action or outrank the newest release. A partial clone is
refused before the fetch, because its checkout would fetch the
release's files itself, outside the action's one bounded fetch.

The toolbar keeps Prune merged as its one button beside a labelled
More actions menu; Refresh moves into that menu next to the new
Release worktree item, so the row holds two controls.
@cixuuz

cixuuz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: _network_tier, which clamps the agent's sandbox tier up to standard for the two network steps

  • on a default install the network steps run as auto and get no git credentials

fixed in 968b006: _network_tier returns the canonical tier name, mapping the clamp's result through the sandbox layer's own _SANDBOX_MODE_ALIASES, so the shipped agent.sandbox = auto reaches ls-remote and fetch as standard.
runtime._run_cmd adds _GIT_TRUSTED_HELPERS only for the literal standard, and _private_remote_hint compares against it too; both now see standard on the default install, so a private upstream authenticates and no tier hint is added.
test_the_shipped_auto_default_reaches_the_network_steps_as_standard fails on 4017374 ('auto' == 'standard') and passes now; the docstring and the spec section name the auto default.

@cixuuz

cixuuz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 4017374f1d -> 968b006de7: the Opus lane's block on 4017374f1d is fixed (see the disposition above), and the commit is rebased onto main at 217b3350c3; git range-diff shows no other change. The 4017374 CI and Build runs were cancelled before the edit, so CI runs fresh on this head.

@cixuuz

cixuuz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #33391 -- moved to a same-repository branch because Sensitive Change Review refuses fork PRs that touch security_posture.py. Same commit, rebased onto main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev Fleet: pin a worktree to the newest stable release, with a hermetic populate

3 participants