Repository navigation
debug: fork-only Windows probe (do not merge) - #8
Closed
Pearcekieser wants to merge 1952 commits into
Closed
Pearcekieser wants to merge 1952 commits into
Pearcekieser wants to merge 1952 commits into
Conversation
… count (kirodotdev#9689) Fixes kirodotdev#9556 Three presentation defects on a Stop press: 1. One card per press: stop_slot_turn's stale-card sweep resolved an orphaned stop card AND appended a fresh row, so one press put two stop_event rows on the wire and the pane (which upserts by meta.id) rendered two [Stopped] chips. A press that finds an orphan now re-arms that row in place (same id, back to 'stopping'), mirroring the escalation path's card reuse; the shared _open_stop_event_card chokepoint covers /stop and /interrupt so the rule cannot drift. A stale escalation marker scoped to the reused id is cleared so the press's cooperative ack is not deferred to a hard callback that already fired. 2. No raw JSON in previews: TranscriptReadProjection.last_message_info (the tail reader behind the Crew Members roster subtitle and the session-list preview) now skips rows matched by is_stop_event_row — reusing the shared predicate whose docstring documents why a naive kind check matches a restored row but not a freshly-stopped one. 3. One consistent tool count: TurnBlock's collapse summary counts DISTINCT tool_call_ids (id-less rows one each) instead of tool rows, so a stopped call's 🔧/🚫 pair reads as one call; and the app-sdk ChatMessageList skips a group of only RESOLVED permissions (its pill claimed '0 tool calls' over an empty expansion), matching ChatPage's all-permission-group skip while keeping pending-approval groups — the embed's approval surface — rendered. docs/system-specs/modules/history.md Stop Events section updated same-commit. Co-authored-by: Di Wu <dwu96@users.noreply.github.com>
…+Enter or Tab, with a Settings toggle (kirodotdev#9795) The Terminal tab's completion popup opens unbidden ~70ms after almost any word, and while it was open Enter accepted the highlighted row — the first one by default — instead of reaching the shell. Typing `git status` and pressing Enter could therefore rewrite the line to `git stash`, and every submit needed an Escape first. A user reported the feature as "nearly unusable" for exactly this reason and asked for a way to turn it off. Two changes, one on each side of the complaint: * **Enter belongs to the shell until the user has arrowed onto a row.** `TerminalCompletion` keeps a `navigated` ref, set by ArrowUp/ArrowDown and reset both when the menu closes and when a fresh listing replaces it (so arrowing and then typing on hands Enter back to the shell). A plain Enter now closes the menu and passes through untouched — the line is submitted exactly as typed. Tab is unchanged as the no-arrow accept key (common prefix, else the highlighted row). This is the convention of fish, zsh-autosuggestions and VS Code's terminal, and it keeps the menu usable for people who want it: ↑/↓ then Enter still accepts. The IME and staleness guards sit ahead of the new check, so their behaviour is unchanged. * **A Settings toggle for the existing config gate.** kirodotdev#7718 added `dashboard.terminal.completion.enabled`, but it was config-file-only. It now has a `SettingsToggle` under Settings → Display → Terminal, writing through the same per-path optimistic overlay as the shell field. To carry a `configKey` it is declared as a nested `properties` node under `dashboard.terminal` in `sections.py` (flattening into `SCHEMA_REGISTRY`; `completion` stays open via `additionalProperties` so the undeclared `completion.commands` allowlist still validates) and added to the config PATCH allowlist as a strict `bool`. Only a literal `false` reads as off on both sides — `bool("false")` is `True`, so a hand-edited string must not show as off while the popup keeps appearing. The gate itself is unchanged: the route answers an empty listing per keystroke, so the toggle takes effect immediately with no restart. Tests - TerminalCompletion.test.tsx: three new cases (plain Enter passes through and closes; Enter accepts after an arrow; a fresh listing forgets the pick) plus Tab-as-accept; existing accept-by-Enter tests go through a `pick()` helper (↓ ↑ Enter). Red-before: reverting the component fails the two Enter-passthrough cases. - DisplayPanel.terminalCompletion.test.tsx (new, 6): default-on when absent, off only for literal false, string "false" reads on, PATCH with a boolean + optimistic flip, failure message + rollback, no blink-back after a successful commit. - test_config_patch.py: nested write, sibling `completion.commands` preserved, non-boolean refused. test_config_schema.py: nested key is a first-class registry entry with default true; `completion` stays open. The reachability walk in `test_registry_entries_structurally_complete` now recurses declared `properties` like the flattener does. - settingsRegistry.gen.ts and en-XA regenerated; keys added to all 12 catalogs; i18n gate + style tests green. Pattern harvest - Rule candidate: review-prompt - Pattern: "a completer's Enter accepts a default-highlighted suggestion; Enter must submit the typed input unless the user explicitly selected" Co-authored-by: Joe Guo <zejiangg@amazon.com>
kirodotdev#9746) Stamp source_preset + source_template_prompt (a prompt snapshot) on jobs created from a Schedule-page template, and show a low-key, dismissible, template-named hint when that template's prompt has since changed -- attributed via the snapshot so a user's own edit never fires it. Fixes kirodotdev#441.
Let Discord, Telegram, and Teams return to native generations from the exact same private conversation bucket. Persist explicit-new generation floors for every DM channel so a restart cannot reuse an older conversation key. Keep zero-turn generations out of history until their first real turn.
…irodotdev#9850) POST /api/crons answered a 500 and `kirocrew cron add --cron` printed a traceback; both now refuse the way their update counterparts already do.
The checked-in `src/kiro_crew/docs/settings-registry.generated.json` was missing four entries that the extractor produces from the live settings source: chat.default-memory-mode, display.command-completion, secrets.jira-api-token and secrets.wakatime-api-key. `npm run gen:settings` writes TWO artifacts from one extraction pass -- the UI registry the command palette imports, and this JSON, which a deployed gateway reads to answer "where is that setting?". Only the first was current, so the four settings existed in the dashboard while the agent-facing lookup could not name them, and nothing at runtime can tell a stale copy from a correct one. That asymmetry is exactly what `settingsRegistry.test.ts` compares BYTE-FOR-BYTE, so Frontend Tests shard 3 has been red on main rather than only on the pull request that noticed it. Regenerated with the extractor, 195 entries. No source change: the UI registry was already correct, so this moves the second artifact onto it.
…dev#9861) `npm run gen:settings` on current main produces 5 entries the checked-in JSON lacks (chat.default-memory-mode, display.command-completion, ...), so settingsRegistry.test.ts ("checked-in JSON matches live extraction") reds Frontend Tests (3) on every PR rebased onto main. Regenerated output only, no hand edits.
…irodotdev#9730) (kirodotdev#9870) The Slack in-progress placeholder flips to a terminal "Something went wrong" mid-run while the agent keeps working and posts the correct, complete reply minutes later. The whole streaming loop is wrapped in one try; the typed except arms are all kiro_crew.acp.client errors, so any non-ACP raise (a Slack API refusal, rate limit, socket or JSON error) reaches the generic except Exception catch-all, which renders the terminal message and records a session failure. The `accumulated or` guard means the generic string only wins when nothing has streamed yet -- the tool-first path, where the loop makes progress-card Slack calls before any text. The ACP turn never died; a decorative side channel did. Fix: make the two presentation calls that can raise into the loop before the first chunk best-effort. - _append_task (the progress-card path) swallows and logs at WARNING at its single definition, covering all call sites. - The chat.update fallback in _ensure_stream_started, on failure, leaves stream_ts as None instead of a truthy sentinel. A truthy sentinel routed end of turn into the placeholder-edit branch and _safe_final_update updated a ts that does not exist -- swallowed at debug, the reply never posted, success recorded: silent data loss. With None, every downstream reader treats falsy as "no placeholder": the two in-loop cursor-edit branches skip the edit (asserts dropped), and the final answer is posted by the end-of-turn else branch. Tests: TestLiveTurnPresentationFailure drives the handler with a raising progress-card call, and a second sub-test where start_stream returns None AND the fallback post_message raises, asserting the accumulated reply is still posted via a fresh post_message (not an update against a dead ts). Both fail on the respective bug and pass with the fix. Reproduction is not available: Slack is scrubbed from the pod environment by construction. Declared narrowness: other presentation calls in the loop (set_thread_status, stop_stream, _append_stream, _rotate_stream) share the shape but are safe today because the real SlackClient swallows internally; tracked in kirodotdev#9878, not swept here. Fixes kirodotdev#9730 Refs kirodotdev#9878
Classify connection errors and plain 5xx responses as retryable while retaining terminal auth, quota, and DNS precedence. Co-authored-by: Premshay <28099628+Premshay@users.noreply.github.com>
* fix(acp): scope policy substitutions to each model selection A substitution advisory describes only the config-option request that emitted it; reusing it after a clean explicit switch misattributes the session context window. * fix(acp): attribute a substituted switch to the model that serves it set_model records the served id in _resolved_model_id, then rebased the context meter on the REQUESTED id. When a config-option advisory substituted the model, the meter showed the requested model's window against the substitute's token counts — wrong for exactly the sessions that were silently moved. The rebase now keys on the served id. The startup override read _last_substitution_model without clearing it first. set_model states the rule beside its own clear: an advisory belongs to the request that emitted it. A substitution left behind by an earlier switch — on a runtime this process reset or resumed — was otherwise read as this dispatch's own served model and misattributed the session. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Premshay <28099628+Premshay@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ss origins (kirodotdev#9897) Add mc-notification-sound, mc-ui, and mc-reading-width to DURABLE_PREF_KEYS so they survive an origin change, and close the growth gap (issue 9491) that made growing the allowlist unsafe: a pre-render reconcile pass reads the host copy of newly added keys on a warm profile before the first flush, so a mount-written local default can no longer overwrite the value another origin backed up. Fixes kirodotdev#9875 Refs kirodotdev#9491
kirodotdev#9902) The stub degrades to the real backend whenever the broker is unreachable, via os.execvpe. CPython replaces the image in place only on Unix; Windows emulates exec as spawn-then-exit, so the backend got a new pid and this process died. kiro-cli holds that process's stdio pipe and waits on its pid, so it read the exit as the server hanging up: 'connection closed: initialize response', with the server's whole tool surface missing from the session. Every stubbed server failed that way while directly-launched ones were fine. POSIX keeps execvpe. Windows now runs the backend as a child that inherits this process's stdin/stdout/stderr and waits on it, so the pipe and the pid kiro-cli watches both survive the hand-off. The command is resolved against the child's PATH to match execvpe rather than CreateProcess, the child is terminated if the wait is interrupted, and the exit relays the backend's own status through os._exit to stand in for a replaced image. That status is reinterpreted as signed 32-bit first: Windows reports an exit code as an unsigned DWORD and a crash lands above INT_MAX (an access violation is 0xC0000005), which os._exit cannot parse as a C int. Relaying it raw would raise OverflowError and kill the stub on an exception instead of reporting the status. Reinterpreting rather than clamping keeps the code kiro-cli reads identical to the one the backend exited with. Closes kirodotdev#9901
…omments (kirodotdev#9873) Co-authored-by: zejiangg <zejiangg@amazon.com>
… with private fork-on-edit (kirodotdev#8307) Blueprint semantics for the Agents page: editing a crew's template definition forks a private copy on first edit instead of mutating the shared template. The template selector becomes the definition panel's header bar, with a Customized state, a live change-count popover, a scoped 'Reset my changes', and 'Save as new template'. All behind the agent_template_pane feature flag. - fork endpoint (POST /api/agents/detail/{name}/fork) + publish endpoint - fork lineage sidecar (forked_from/private_to) in agent_model_state.json - sync loop skips auto-creating private copies; fork refresh keeps copies aligned with owned-template dynamic fields without clobbering user edits - panel UI: header selector, source badges, Customized tag, changes popover, scoped reset, save-as-new-template dialog, switch-away confirm - i18n for 11 locales; 96 backend + 36 frontend tests; capture harness
The code-style spec says a comment carries invariants, edge cases, units and the reason a surprising choice is correct -- not a task log. History lives in git. This applies that rule to the top-level modules of src/kiro_crew. Removed from comments and docstrings: PR, issue and ticket numbers, review-round and finding markers, and change-log sentences. Narration was rewritten into present-tense statements of what the code does now, so a reader can tell whether a comment describes the code in front of them. Comments that carried nothing but provenance were deleted outright. Every invariant, attack spelling, measured number and threat-model rationale was kept. Only the reference to how the code got there was dropped. Across the 110 source files the executable token stream is identical to the base commit, with comments dropped and docstrings normalised. The gate that enforces the rule is reshaped from a baselined per-file ratchet to a diff-scoped check, in the same shape as the brand-name gate. It judges only the lines a change adds, against COMMENT_HISTORY_BASE_REF, and has no baseline file. The per-file JSON was a merge-conflict hotspot for every cleanup PR in flight, and it bought nothing a diff check does not: added lines are complete for regression, and what is cleaned cannot come back. It moves from backend-lint to its own fast-gate job, drops out of the main ratchet audit (a diff gate has no whole-tree question), and is recorded as PR-only there. Co-authored-by: zejiangg <zejiangg@amazon.com>
…e system row (kirodotdev#9879) The pinned-prompt banner derived its candidates from TURN_OPENER_ROLES, so an auto-nudge or subagent completion row took the band on every loop cycle while the user scrolled a babysit session, and NudgeCard drew a ring + card chip that previewed the instruction payload -- a nudge read like something the user sent. - utils/pinnedPrompt.ts: isPrompt admits only role=user rows that are neither a steer nor a subagent completion persisted under `user` (shape check, not role). Nudge and subagent rows neither pin nor push the banner out. - usePinnedPrompt.ts: drop the machine-label substitution (nothing machine authored reaches the banner any more); PinnedPromptInput loses machineLabel/machineBody. - NudgeCard.tsx: centred muted one-liner "<cycle label> · Expand/Collapse" with no card chrome and no payload preview; the raw payload opens in a monospace panel underneath; Loop button unchanged. - i18n: pages.chat.nudgeCard.expand/collapse in every catalog + en-XA; translator context for the pinned-banner keys updated. - Tests updated to pin the inverse contract (machine openers never pinnable, jump anchor does not walk machine runs, NudgeCard has no card chrome). - .github/screenshots/nudge-pin-collapse: before/after pod captures. Closes kirodotdev#9874
…mbers roster (kirodotdev#9428) The Crew Members roster is the Sessions sidebar's twin, built from copied values that drifted: in kiro-light its card stayed white (#fff) while the sessions card stepped back to --panel (#fafafa), its header sat on its own padding (16/16/4 vs an 8px 40px line), its row titles were 500 not 600 with unset line-heights, its column-resize grip was a flat 6px strip where the sidebar draws a 2px accent pill, and its search field carried a chip row where the sidebar docks a sort/filter menu in the field (kirodotdev#9416). components/listShell.ts now carries the sidebar's recipes — card (with the `sidebar` theme-pack hook and the `sidebar-inner` kiro-light hook), header line, title, list body, row box and states, row type scale — and both pages consume them; SessionFlyout's title copy joins in. ResizeHandle renders the sidebar's pill (2px rounded bar, accent on hover/focus, accent-hover while dragging, `inset` for the card radius, `className` for absolute placement) and keeps its window-splitter keyboard contract; the sidebar mounts it and gains arrow-key resize, the roster mounts it on the card border with the same 12px inset. components/SearchFilterBar.tsx is the sidebar's search row (field, clear button, trailing 24px filter trigger with badge, the padding table that keeps text clear of it); the sidebar mounts it and the roster replaces its SearchInput + chip row with it, the menu holding star, live state (working / needs you / unread / patrolling), origin and sort. The roster filter model is pure (pages/members/rosterFilter.ts) so the page's state layer can move without touching how a filter decides. New labels in all locales. Parity tests pin both pages to the shared recipes and components and forbid the literals; the kiro-light hook test follows the hook into listShell and requires both cards to mount it; rosterFilter has its own unit pins. Closes kirodotdev#9416 Rebased over kirodotdev#9437 (docked SidePanel replaces the detail drawer): the drawer-side constants this change adjusted are gone with the drawer; the SidePanel separator assertion is narrowed to /resize panel/i because the roster grip is a second resize separator.
kirodotdev#9785) Mount the KAS sign-in flow as a Settings > Overview card instead of a full-screen gate. KasLoginGate keeps its flow in one place (KasLoginFlow) and gains a card chrome (KasLoginEmbedded); KiroSignInCard adds the signed-in summary (provider, expiry, renewability -- never a token) with sign-out, sign-in-again and an explicit "sign-in expired" state. Backend: KasToken.is_usable() is the one predicate the spawn decision, kirocrew doctor and the card share; KasLoginService.status() reports expires_at/expired/has_refresh_token/refresh_rejected/usable. A refresh the issuer refuses (400/401/403) raises RefreshRejected and is recorded as a token-free marker beside the vault (cleared by any new credential), so the card and doctor can say "sign in again". The marker never changes the auth owner: a lapsed Crew identity is reported, not silently handed back to kiro-cli's login (no automatic demotion, by decision). Chat: an AcpAuthRequired error row is stamped auth_required and offers "Sign in to Kiro", a deep link to the card (overview.kiro-sign-in, also a Search Everywhere entry). Closes kirodotdev#9772
… (P3-b) (kirodotdev#9787) Crew Members DM threads and split panes had no microphone: ChatInput learned about dictation through 23 voice*/onVoice* props that only ChatPage wired. Wiring them into ChatPane would close today's gap and reopen it with the next capability. - RFC §3 layer 4 / §4 P3: the composer becomes a `Composer` root plus atoms that own their own state and read one small context ({ slotKey, editor onChange/inputRef, capabilities }); surfaces compose; no atom imports the store (kirodotdev#8651). ChatInput becomes a preset composition of atoms slice by slice (P3-c..f). - chat-core/composer/Composer.tsx: root + context + Composer.Voice. The atom runs useComposerVoice (ChatPage's dictation block, extracted verbatim) and publishes its state into the root; ChatInput renders the atom and reads that state with one hook; its 23 voice props are deleted. ChatPage wraps ChatInput in the root and hands the atom only what it cannot know (on-screen predicate, off-screen draft delivery, auto-submit, push-to-talk, caret refs) — behaviour unchanged. ChatPane wraps ChatInput in the root with queue:false (kirodotdev#8852) and gets a mic. - One microphone across mounted composers (module-level capture owner; other mics read it as voiceTranscribeActive, prewarm withheld). - voiceTranscriptInbox becomes multi-subscriber: begin fans out, settle delivers text once — to the owner, else to a subscriber that accepts unowned text, else HELD until a composer for that session is back on screen (redeliverPending on slot change). No unowned drop. - VoiceDictationPanel header wraps at pane width so the device name is readable and the keyboard hint takes its own line. - ChatInput dictation tests migrate to the ComposerVoiceSliceOverride seam; new tests for the root, the pane, the mutex and the inbox. - Capture harness + before/after screenshots (temp-screenshots/). Closes kirodotdev#9775
…t with refs (kirodotdev#9810) Browser panel (native view) gains Annotate: pick mode highlights the element under the cursor on the LIVE page and a click leaves a numbered marker; the note for each marker is typed in the PANEL (trusted renderer), never in the page. Click a marker (or the row's pencil) to edit, Esc leaves pick mode with the notes kept. The panel lists N · role "label" · note with per-row edit/remove, two-step Clear and Add to chat, which puts a numbered draft into the composer (nothing is sent) Annotations on <title> (<url>): 1. [button "Save"] (e12, `form > footer > button.primary`) -- <note> and attaches a screenshot with the markers rendered in. The `eN` refs are the ones the agent's `snapshot` mints, so it can act on them directly. - electron/browser-annotate.js: the pick/marker overlay (OVERLAY_SOURCE) lives IN the page because the native view is composited above the dashboard DOM. Trust posture: everything it reports is page-realm data with snapshot-level trust; the user's prose never enters the page (no text input is created there, the overlay never receives note text). Installed with executeJavaScript, mirrored by polling, captured with capturePage -- never the agent's CDP control plane. Closed op set start/stop/poll/remove/clear/ capture/teardown; poll carries one-shot picked/edit ids and the main process hands focus back to the dashboard so the panel editor takes it without a second click. - electron/browser-ops.js: walker helpers extracted into PAGE_HELPERS_SOURCE, spliced into BOTH the walker and the overlay (one implementation, same refs). Ref map bound to the Document object (SPA route changes keep refs) and pruned of disconnected elements on every injection (bounded by the live DOM). Walker skips the overlay's own host. Outline text unchanged. - WebPreviewPanel: Annotate/Done on the native header; slot-keyed mirror (a session switch never shows another session's notes); notes, editor, list, Clear (two-step), Add to chat; navigation keeps noted picks as detached (Add to chat works without screenshot) and re-Annotate continues numbering without wiping them; transient poll failures retry; errors via ErrorNotice. Native-only; hidden on web/remote. - utils/browserAnnotations(.prompt).ts: list description (role, else tag), screenshot File, draft text; PREVIEW_ANNOTATE_EVENT -> useChatPageResourcesController puts the draft into the composer (or the originating slot's draft) and uploads the PNG through uploadFiles. - docs/feature-map: Browser panel row mentions Annotate + browser:annotate. - i18n: 22 keys (two plural) × 13 locales + en-XA. Closes kirodotdev#9759
…sed comment input (kirodotdev#9812) Selecting text in the file viewer used to show a [Comment | Copy] toolbar; only a click on Comment opened a second popover with the input. The annotator now opens the comment input straight away, already focused, and keeps the host's actions as icon buttons beside it (below a full-width input under 480px). - SelectionToolbar: opt-in `composer` prop. Enter submits, Shift+Enter newline, Escape closes and restores the text selection (rebuilt from text offsets, since focus collapses it and the host's <mark>s split the nodes). Cmd/Ctrl+C in an empty input copies the selected document text. Keys typed into the box and the caret's selectionchange no longer re-run the selection check. Chat's toolbar passes no composer and is unchanged. - MarkdownPanel: resolves the anchor + paints the highlight in `onOpen` (before focus), submits through the existing pending-comment path; the CommentPopover stage and its state are gone from the file viewer (other hosts keep it). - Copy label goes through i18n; two new keys (comment_input, more_actions) in all 13 catalogs + en-XA. - Tests updated for the new flow; new SelectionToolbar.composer.test.tsx pins focus-first, the keyboard contract, open/submit/close handshake and the width-dependent layout. Real-pod capture harness + before/after frames. Closes kirodotdev#9760
…kirodotdev#9757) A stale busy snapshot can suppress the optimistic user bubble even when the server starts a new turn. Echo correlated dashboard sends before the reply starts so the user message appears in event order. Use the existing per-client slot-authorized WebSocket path for raw user content. Reconcile echoes by sendId while preserving the row rendering identity. Keep the correlation so an HTTP timeout or connection reset cannot restore an already delivered send. HTTP receipts confirm existing rows without inserting duplicates after streaming or navigation. Cover delivery ordering, app scope isolation, interleaved steers and ambiguous HTTP failures, with controlled browser recordings. Synchronize the shutdown drain test on provider entry so it verifies cancellation independent of scheduling. Co-authored-by: Rui Tao <ruit@amazon.com>
Co-authored-by: zejiangg <zejiangg@amazon.com>
…tdev#9885) Comments and docstrings only. No executable code changes. Rewrites or deletes history-narrating comments and docstrings in the first alphabetical half of `test/`, from `test/body_stream_helpers.py` through `test/test_lifecycle_hooks.py`, so every remaining comment states what behaviour the test pins and why rather than which issue, PR or review round it came from. The rule is docs/system-specs/common/code-style.md, "Comments explain the WHY": a comment carries invariants, edge cases, units and the reason a surprising choice is correct, and never a PR or issue number, a review-round marker, a commit SHA, a date, or narration like "previously", "used to", "no longer" or "we now". Every invariant and edge-case note is kept; only the history is removed. Marker count in comment-history-baseline.json for these files: 2146 -> 0. All 560 entries are pruned from the baseline in this commit. Every changed file is proven comments-and-docstrings-only mechanically: its executable token stream (tokenize, COMMENT tokens dropped, docstring STRING tokens normalised to a placeholder) is identical to the same file at origin/main. Co-authored-by: zejiangg <zejiangg@amazon.com>
…irodotdev#9817) The empty-turn recovery ladder allows exactly one synthetic continuation before its give-up card. Under a flaky provider window the model repeatedly ends PRODUCTIVE turns right after a tool result (cause=visible_partial, issue kirodotdev#9809): text streamed, tools ran, the turn was billed — and the single continuation dies the same way, so the session parks on the give-up card while every attempt was making real forward progress. The budget is pinned in code and the only knob, session.empty_response_auto_continue, is an on/off bool. Add session.empty_response_max_continues (int, default 1, clamped 1-10): - default 1 keeps today's behavior byte-for-byte, including the exact notice strings — the setting is purely opt-in - above 1, consecutive failures keep continuing while the budget lasts and the notice shows progress ('recovery 2 of 3'), so the transcript reads as advancing, not looping; the give-up rung still terminates the ladder - the productive-turn counter jump (0 -> 2) is preserved and generalizes to max(retries + 1, 2), keeping the give-up arithmetic uniform across the replay and jump paths at any budget - loader clamps the persisted value so a hand-edited 0 cannot disable recovery and a 999 cannot arm an unbounded ladder Deliberately not a fix for issue 9809's Problem 2 (give-up wording), which is claimed and in flight separately. Addresses Problem 1 of kirodotdev#9809 Co-authored-by: Patrick Gao <patrigao@amazon.com>
…odotdev#8283) ssh to localhost (or this host's own name) re-enters the machine OUTSIDE the agent sandbox: the far side is a fresh unsandboxed login shell, and passwordless sudo there completes a full escape (observed live on a dev desktop where sudo is broken inside the sandbox but 'ssh localhost sudo' grants root). Two-tier build, same shape as the existing self-protection floors: - Catalog rule sandbox-escape-ssh-self (category sandbox-escape): a lint-safe positional regex — verb in command position, self host as the operand directly after it, end-delimited so a remote host merely named localhost.example.com never matches — kept a human-auditable SUBSET of the floor. No option-skipping group on purpose: that shape fails is_safe_user_regex, which would silently disable the rule. - Argv-structural floor _is_ssh_to_self: FAIL-CLOSED about option grammar — every token that could be an operand, including one in an option's value slot, is checked against the self-host set, so no per-verb option table exists to get wrong (scp -r localhost:… was the shape that defeated a table). Resolves redirections the way bash removes them from argv, user@/URI-authority/bracketed-IPv6 prefixes, bare IPv6 and numeric IPv4 literals (::ffff:127.0.0.1, 2130706433, 0x7f000001), hostname substitutions, -o hostname=/-o proxyjump= routing values, Windows .exe spellings, and this machine's own hostname/FQDN/addresses. ssh/sftp read only the FIRST unshadowed operand as the host, so a word like localhost inside a remote command run on another host stays data. - Own-name resolution runs in a background daemon thread with retry backoff: getfqdn/getaddrinfo are synchronous DNS and is_denied runs inline on the gateway event loop, so the gate never blocks on DNS. Until the first resolve lands the own-name half is empty; the hard-coded loopback half never depends on it. Named fail-open residuals (denying these would break every legitimate remote ssh): -F config files, ProxyCommand, ssh_config Host aliases, and substitutions that only resolve to this host at run time. Remote hosts are unaffected. The rule is operator-disableable like its floor siblings; the pattern-subset-of-predicate invariant, deny/allow corpora, opt-out, tokenizer-failure union, and resolver failure paths are locked by tests. Golden manifest 148->149; module spec and the deny-guidance docstring updated alongside. Round 8 (reviewer-verified escape gaps, maintainer-ruled fixes): - Nested-frame RSYNC_RSH inheritance: a self-targeting RSYNC_RSH seen in an outer frame (export or env-prefix) now latches for the command's remaining frames, so RSYNC_RSH='ssh localhost' sh -c 'rsync host:/x .' is denied. - IPv6 zone-ID bypass: %zone suffixes are stripped at both the resolver cache site and the _host_is_self operand, so fe80::1%eth0 matches the interface address fe80::1. - Tests: 2 deny + 2 allow RSYNC_RSH frame cases, plus 2 zone-ID tests (resolver strip + match-time strip). Proof-run: all 4 new assertions fail on the pre-fix tree. Round 9 (new reviewer-verified escape gap + import hygiene): - Escaped-quote separator-mask bypass: inside double quotes a backslash-escaped quote is a literal, not a close. _mask_quoted_separators now honors bash's \" \\ \$ \` escapes inside double quotes, so scp "a\";b" localhost:/x no longer exits the quote at \" and reads the ; as a real separator that ends the operand walk before the self-host target. Deny test added; proof-run confirms it fails on the pre-fix tree. - top-level-imports: fcntl/struct moved from a function-local import to a guarded module-level optional import; the Linux interface sweep now gates on their presence as well as sys.platform. Round 10 (new reviewer-verified escape gap, maintainer-ruled fix + sweep): - Parameter-default gluing bypass: _operand_targets_self checked each ${VAR:-word} default in ISOLATION, so bash's substitution INTO the surrounding word escaped it: ssh local${KC_UNSET:-host} id resolves to ssh localhost id. The whole operand is now resolved via _resolve_param_defaults (fixpoint: all operator spellings, colon-less and nested included) and the resolved spelling re-checked. - Sibling sweep, one invariant at the operand chokepoint: every statically-derivable expansion/gluing form is resolved before host parsing. Brace expansion (local{h,}ost, ::{1,2}, 0x7f00000{1..2}; alternations and numeric/char ranges, capped at 256 products with fail-closed deny on overflow) and single-integer arithmetic literals ($((0x7f)).0.0.1 -> 127.0.0.1; hex/bash-octal/decimal normalized, no expression evaluator) are expanded and each choice re-checked; the ProxyJump chain also checks its unsplit value so a brace comma is not torn by the hop split. Run-time-dependent forms (bare $VAR, command substitution with output, arithmetic beyond one literal) remain the documented residual class. Each resolution only widens the deny. - Tests: 13 deny cases (6 parameter-operator/nesting forms, 5 brace forms incl. proxyjump, 2 arithmetic) + 4 allow cases locking remote hosts and plain file operands. Proof-run: exactly the 13 new deny assertions fail on the pre-fix tree. - argv_floor.py black-formatted at the pinned version (clears the Backend Lint black-gate offender from round 9). Review round 11: the quoted-separator sentinel table now covers every _ends_argv boundary character (& newline # ( {), so a quoted boundary token is operand data instead of a fake command boundary that hides a later self-host target (scp '&' localhost:/tmp/x); backslash-newline stays untouched as a line continuation. Interface addresses join the synchronous own-host seed, so the first ssh-family command already knows them -- the async worker only adds DNS-derived names, closing the first-command window for ssh <own-interface-IP>. Comment wording in argv_floor.py reworded to satisfy the comment-history lint gate. The synchronous own-identity seed is packet-less: interface enumeration keeps the UDP-connect probes and the Linux per-interface sweep, and every resolver-backed form (getfqdn/getaddrinfo, plus Windows' resolver-backed interface list) belongs to the async enrichment worker, so is_denied never does DNS on the event loop. The operand walk reads userinfo before the colon split when the @ precedes the first colon, so a bare IPv6 loopback behind userinfo (user@::1) resolves to the whole remainder instead of an empty host. The RSYNC_RSH walk remembers the last plain assignment across separators and promotes it into the exported slot when a later bare "export RSYNC_RSH" names it, covering the POSIX VAR=value; export VAR two-step. Windows adapters get their own packet-less sweep in the synchronous seed: GetAdaptersAddresses (iphlpapi, via ctypes) reads the local adapter table with the anycast/multicast/dns-server lists skipped, so a secondary or VPN address with no DNS record is known before the first ssh-family command is judged, matching the Linux per-interface sweep. The helper self-gates and returns an empty set off Windows or on any failure. The raw-substring verb gate resolves static parameter defaults before probing (s${U:-s}h -> ssh), matching the operand walk; brace-range integer conversion failures past the interpreter's digit cap land on the existing fail-closed overflow deny instead of an uncaught ValueError; a resolver Thread.start failure clears the in-flight latch and answers from the synchronous seed instead of aborting the permission decision. ctypes moves to the module import block. Flat command substitutions with statically-decidable output (echo/printf literals) splice into the source before the verb probe and the operand walk, so ssh $(printf localhost) resolves to its output; dynamic bodies keep their text and stay the documented run-time residual. macOS gains a packet-less getifaddrs interface sweep feeding the synchronous seed, the sibling of the Linux ioctl and Windows GetAdaptersAddresses sweeps. Glob operands and command words resolve against what the pattern CAN match: a word whose glob can name an ssh-family program passes the verb gate and the walk, and an operand whose glob can match a loopback or own-host name denies, both via fnmatch with no filesystem read. A hostname the textual layers cannot classify goes to an off-loop DNS verdict worker; the decision fails closed until the cached verdict says whether any resolved address is loopback or local. The numeric-loopback check accepts only spellings inet_aton or ip_address accept, so remote domains with a numeric first label stay allowed. Round 17 (three lanes): detached "-J value" (and flag bundles ending in the jump letter) now latch the next token as a ProxyJump hop chain, comma-split like the attached form. The fail-closed DNS-alias verdict is consulted only for tokens in HOST position (ssh/sftp positional, a host:path prefix, a scheme authority, a userinfo remainder, or a routing option value) so dotted local filenames like backup.tar.gz are never refused as first-contact hostnames. Literal same-line assignments resolve before the verb gate and the walk (a=s; ${a}sh localhost denies); one level of function-call argument binding recurses the floor on the bound body (f(){ ssh "$1" id; }; f localhost denies); an arithmetic expression that survives normalization fails closed in a connection-target position (ssh 127.0.0.$((0+1)) denies), reversing the earlier allow ruling for target-position expressions. The catalog rule description now declares the one-time first-contact refusal instead of claiming other hosts are unaffected, and the macOS CI leg runs the interface-sweep tests so the darwin getifaddrs walk is CI-verified. Round 18: the arithmetic literal normalizer keeps its decimal str() inside the try -- a huge hex/octal literal whose int() succeeds (power- of-two bases are exempt from the digit cap) but whose decimal spelling exceeds it now fails closed through the target-position rule instead of raising through is_denied. Host position survives valueless flags: a new case-folded value-taking option letter set decides whether the token after an option is the destination (ssh -v self.example is DNS- checked) or the option's value (ssh -i id_rsa.pub is not), and a consumed positional ends host position so later dotted remote-command arguments stay data. The DNS-alias layer covers dotless names (an /etc/hosts loopback alias resolves like any hostname; position, not punctuation, keeps junk out) and allow verdicts are revalidated after a TTL (stale-while-revalidate, one single-flight worker; deny verdicts stay permanent) so a rebinding name is caught at the next publish. The function binder accepts bash's parenthesis-free keyword form. The rule description drops the word dotted. Round 19: the value-taking option letters are per verb, and a case-folded collision now reads as VALUE-TAKING -- sftp's uppercase -R takes a value, so treating the folded "r" as valueless let the value consume the positional slot and the real host went unchecked (sftp -R 64 localhost). A host mistaken for a value leaves the slot pending and every later token still gets the full checks, so over-checking is the safe side of that fold. ssh -c cipher is the same class and is covered by the same table. Test assertions on the DNS recorder use exact equality comprehensions (also clears the CodeQL substring-sanitization false positive on the membership spelling). Round 20 (Opus 1 + GPT 2 blocking, 1 advisory, plus a CI regression): the verb-gate probe now runs the tokenizer's own ANSI-C decode, so $'\x73\x73\x68' spells ssh to the gate exactly as bash spells it to exec (the operand walk already decoded; the gate guarding it did not). A same-line cp/mv/ln/install whose source operand is an ssh-family binary binds its destination as that verb for the rest of the line (cp /usr/bin/ssh /tmp/x && /tmp/x localhost), the statically decidable half of the renamed-binary class; a copy staged in an earlier command line stays the documented residual. An exact -- is now the POSIX option terminator and preserves host position, so ssh -- localalias reaches the DNS layer instead of being swallowed as an option value. The round-18 dotless-alias change had sent every dotless first contact to the fail-closed DNS layer, refusing the everyday ssh dev-dsk shape (CI allow pin, both platforms): dotless names now get a same-call verdict from the hosts file - the round-18 attack vector itself, a local read with no DNS and no refusal - and absent an entry answer open while one async worker revalidates; dotted names keep fail-closed first contact. Rule text and golden manifest updated to declare the split. The value-taking docstring now describes the per-verb table (round-19) instead of contradicting it. Two repo-gate fixes on the hosts-file layer: the POSIX hosts path is component-assembled behind its os.name guard (Cross-Platform Portability scans line literals and cannot see the guard), and the parse reads a bounded slice (_HOSTS_FILE_READ_CAP, 4 MiB) instead of iterating the handle - the repo-wide unbounded-handle-iteration guard flags variable-path iteration, and the cap is real: a pathological hosts file is read truncated and names past the cap fall through to the async DNS revalidation, whose resolver reads the untruncated database. Co-authored-by: Patrick Gao <patrigao@amazon.com>
…tdev#9892) Comments and docstrings only. No executable code changes. Rewrites or deletes history-narrating comments and docstrings in the second alphabetical half of `test/`, from `test/test_lifecycle_scripts_cov80.py` through `test/test_zip_vet.py`, so every remaining comment states what behaviour the test pins and why rather than which issue, PR or review round it came from. The rule is docs/system-specs/common/code-style.md, "Comments explain the WHY": a comment carries invariants, edge cases, units and the reason a surprising choice is correct, and never a PR or issue number, a review-round marker, a commit SHA, a date, or narration like "previously", "used to", "no longer" or "we now". Every invariant and edge-case note is kept; only the history is removed. Marker count in comment-history-baseline.json for these files: 2146 -> 0. All 521 entries are pruned from the baseline in this commit. Together with the first half, `test/` no longer appears in the baseline at all. Every changed file is proven comments-and-docstrings-only mechanically: its executable token stream (tokenize, COMMENT tokens dropped, docstring STRING tokens normalised to a placeholder) is identical to the same file at origin/main. Co-authored-by: zejiangg <zejiangg@amazon.com>
…#7974) (kirodotdev#10272) After a successful create, re-scan the created-into root so the just-created rows flip to the "Already set up" badge instead of staying ticked, while a new keepResult flag on the scan mutation keeps the Results card on screen. In the empty-state branch, render the root-existing badge, disable "Create the root folder only", and switch the subtitle when the root folder already exists. Closes kirodotdev#7974
kirodotdev#10475) A self-heal rebuild takes its local port from the LIVE tunnel (`_recover` reads `current.status.local_port or inst.local_port`), but `_mark_recovered` persisted only `was_connected`, `forwarder_pid`, `forwarder_start` and `forwarder_sig`. When a rebuild settled on a different port than the registry held, the divergence was written in half: the identity described the new port while `local_port` kept naming the old one, and each later drop re-cemented it. Three consequences, all observed on a crew that read offline for hours while its remote gateway, forwarder and token were healthy: - Readers of the recorded port — the pane URL and `diagnose`'s fallback — address a port with no listener, so the crew presents as offline. - `forwarder_sig` is a MAC over the port. Signed with the live port and verified against the recorded one, it fails verification, so the orphan reclaim refuses the child this write exists to record and the leak becomes permanent. - Self-heal reports success and the health probe passes, because the live tunnel is genuinely fine, so nothing retries or warns. Persist `local_port` in the same write, giving the recovery path the same field set `connect()` already writes. The new test pins a rebuild that lands on a different port and checks both the recorded port and that `forwarder_sig` matches a MAC over it. It stubs `process_start_time`, without which the signing branch is skipped on a host that cannot read it and the signature assertion would pass without ever computing a signature. Fixes kirodotdev#10473 Co-authored-by: Chen Tong <cttong@amazon.com>
…ull-request form (kirodotdev#10446) The composer's automation popover opened on the bounded pull-request monitor, whose only subject is a pull request URL validated against four code hosts. A session about anything else therefore opened onto a form it could not fill, with the surface that accepts an arbitrary objective behind an unlabelled button. The goal loop is now the default view. An armed record still outranks it in either direction: a slot holding a structured monitor opens on the monitor, and a slot running a legacy loop opens on the loop and is offered no monitor, since whichever view is hidden is a running automation nothing on screen reports. The view is re-derived from the record on every open, so visiting the bounded form and closing the popover does not make the pull-request form that slot's default again; the unsaved bounded draft is keyed on the editor and survives either way. Three controls stop promising a surface they do not open. The switch to the bounded form names its subject, "Watch a pull request instead", and is underlined without hovering because it is now the only route there. The composer trigger reads "Set a goal" and shows the Goal glyph while nothing is armed, keeping the radar for a slot that is actually probing. The cost note opens "This goal loop" rather than "This legacy loop", so a reader can tell the loop being warned about is the screen in front of them; it keeps its warn colouring, which on the default view is the only cost cue the surface carries. A crew or member session is now told why its goal fields are disabled. That explanation lived only on the bounded view, so flipping the default would have left those sessions a dead form with no reason on it. The note renders from the disabled flag itself, and its sentence names automations rather than monitors so that it is true on the goal form as well as the monitor form. The composer button retires `back_to_bounded_monitor`, removed from every catalogue. The capture harness is pinned to English, since it addresses controls by their English accessible names and otherwise inherits the operator's locale.
…odotdev#7116) (kirodotdev#10445) Cancelling a dirty minutes draft now asks before discarding, the revert dialog says the loss is permanent (all 14 locale catalogs), the editor textarea is focused on entry, the save button reads Saving… while the write is in flight, and a saved-but-empty edit no longer shows the 'output will appear here' placeholder. Backend: the delete-output response drops the consumer-less 'reverted' field, and store.delete_meeting derives the edits path through the existing agent_edits_dir helper (same contain + refuse-linked barrier, spelled once). Co-authored-by: Nick Bowers <nrb@amazon.com>
…v#6887) (kirodotdev#10408) The Discover page's FeaturedSpotlight resolved one registry hero URL and latched a single failure to the gradient. For an INSTALLED lead app the same art is on local disk, so a failed registry asset now swaps once to the installed-app art route (AppIcon's two-latch discipline, kirodotdev#6804), and only then degrades to the gradient. The art-path guards it leans on now refuse every traversal and authority spelling the URL parser normalizes. Closes kirodotdev#6887. Co-authored-by: Nick Bowers <nrb@amazon.com>
…otdev#10405) Add a Side-by-side diffs toggle to Settings > Chat (Display/Appearance preferences), bound to the existing client-local mc-diff-split key that every diff surface already reads as its initial layout. New useDiffSplit hook centralises the key and default (true = side-by-side); DiffBlock, FileChangeChips and SidePanel read through it. No new storage key, no new default, no change to how any surface reads it.
…tdev#6372) (kirodotdev#10397) Clicking a listed session whose backend slot was deleted elsewhere used to bounce silently: the detail fetch 404s, the rejected reducer restores the previous selection, and the dead row stays listed. switchSlot now takes an opt-in announceOnMissing flag; every user gesture on a listed session reference passes it (a call-site classification ratchet test pins the announced / keep-target / self-handling classes). On a 404 the thunk stores the session name in chat.switchSlotGone, ChatPage renders it through its pane-level ErrorNotice above the composer, and the row is evicted synchronously via the existing removeSlotOptimistic reducer. An announced non-404 or transport failure gets the same notice with failure copy (could not be opened) and no eviction: the session exists and the still-selected row invites the natural retry. The eviction runs only when provably safe: the selection must escape the gone key (no orphaned activeSlot), the row must still be the object captured at dispatch (authoritative frames disarm it; applySlots documents the identity contract this leans on), and the switch must hold the live requestId claim (stale 404s cannot evict). The gone announcement is escapes-only: re-activating the already-open deleted session keeps the pre-change silent behavior. Self-handling callers (creation races, deep-link restore, panel binds) stay quiet by design. Co-authored-by: Nick Bowers <nrb@amazon.com>
…ent (kirodotdev#10396) chat_folder_move takes `before`/`after` naming a SIBLING, so an agent can reorder the sidebar instead of only reparenting. An anchor may stand in for `new_parent` (an omitted `new_parent` means the top level, so without that, ordering a folder INSIDE a folder would be inexpressible). Positions are written as contiguous 0..n-1 over the destination's siblings, the same values a drag writes, so both paths leave one convention in the store. Two reads had to change for the write to be usable. chat_folder_tree listed folders by path, a sequence the person never sees, which made every anchor a guess; it now lists them in sidebar order. And the sidebar's own nested render drew subfolders in raw cache order, so a subfolder's stored position never reached the screen: invisible while a drag only reordered roots, wrong the moment a tool could set it. Composing several writes needs one rule the endpoint cannot state. It judges each PATCH alone, so an app repositioning its folder among the person's would have the first accepted and a later one refused, leaving an order nobody chose and nothing to roll it back with. The whole renumber is therefore checked against the caller's ownership before the first write.
…ng the xdist session (kirodotdev#10441) pytest-timeout's SIGALRM handler calls pytest.fail from wherever the timer fires. Inside setup, call or teardown that is an ordinary failure; while pytest is rendering a report or between phases it propagates out of pytest_runtest_protocol with no report logged. xdist sends runtest_protocol_complete only when that hook returns, so the controller either raises the worker's traceback as an INTERNALERROR or trips worker_workerfinished's crashitem assertion, and one slow test on an overloaded runner erases the shard's results. The root conftest now wraps the protocol as the outermost hook and turns such an escape into a synthesized call-phase failure for the item that owned the timer, so the session continues and the test is the thing that goes red. test-durations.yml stops publishing a partial .test_durations: exit 0 and 1 mean the session ran every test, any other exit means it stopped early and the refresh fails instead of pushing a file pytest-split would balance on. The regression test drives the exact escape path in a real two-worker session that loads the root conftest as a plugin. Co-authored-by: Zejiang Guo <zejiangg@amazon.com>
…otdev#10430) A diagram that finished streaming while its remote-instance pane was the inactive tab rendered as an empty 16px box. InstancesViewport keeps inactive panes mounted as display:none iframes, and mermaid measures its labels with getBoundingClientRect() in document.body, so inside that iframe every size is 0: it emits viewBox="-8 -8 16 16" with NaN node transforms, and MermaidBlock pasted that in. Nothing redrew it until the block happened to remount. MermaidBlock now probes host.getClientRects() before the lazy mermaid chunk load and before mermaid.render(), and watches the box with a ResizeObserver for the whole of render(). The list is empty exactly when the element has no box (display:none anywhere above it, the hidden iframe included) and non-empty, even at zero size, whenever layout ran; visibilityState and clientWidth both lie inside a hidden iframe. With no box it waits on a ResizeObserver and continues on the notification that brings the box back, after layout. render() is itself async -- it lazy-loads the diagram's own chunk, and image shapes load apart -- so the pane can hide and even come back inside it; a box lost at any point during render(), or absent when it resolves, means some measurement was taken hidden, and that SVG is discarded and the attempt repeats once the box is back. Without ResizeObserver there is nothing to wait on, so the result stands as before rather than rendering in a loop. Teardown before anything drew abandons the chain and forgets the code, so a later run (new source, or the StrictMode replay) does not skip a diagram that never drew. Co-authored-by: Joe Guo <zejiangg@amazon.com>
…rodotdev#10381) _kill_escaped_children was the last gated raw signal-0 probe: the tripwire in test_windows_kill_probe_audit.py carried an exemption for it. Probe liveness with platform_compat.pid_exists, kill with platform_compat.kill_pid, and take SIGKILL from platform_compat (the shim's portable spelling; the cross-platform gate flags signal.SIGKILL on added lines), then retire the GATED_PROBES entry. POSIX behavior is unchanged: pid_exists is the same os.kill(pid, 0) probe and kill_pid propagates the same exceptions into the existing handler. Co-authored-by: DeryFerd <DeryFerd@users.noreply.github.com>
…ut tail (kirodotdev#10368) A failed Pull+Build reported `Updating <old>..<new>` as the reason. That is git's progress line, not a failure. Every sync step writes stdout and stderr into ONE pipe. A child block-buffers stdout to a pipe and writes stderr unbuffered, so the stdout buffer flushes at process exit -- after the diagnostic. A refused `git merge --ff-only` therefore ends with its `Updating a..b` line, and the dashboard promoted the last output line whenever the exit code carried no reserved diagnosis. run_step now gives each step's stderr its own pipe, pumps it through line by line, and remembers its last 4 non-blank lines. On failure run_steps re-emits them as `::steperr::<idx>::<line>`, and the UI ladder becomes cause -> stderr tail -> last line. The markers are the raw log tail and never set lastIsCause, so the exit-code-only diagnosis boundary is unchanged.
…Reason (kirodotdev#10440) On codex a policy-blocked tool call ended the session silently. The model's last word was codex's own "aborted by user", and no correction followed. Measured on codex-acp 1.11.0 / codex 0.153.4: a command approval advertises allow_once, accept_execpolicy_amendment and cancel -- there is no decline -- so the host's deny can only answer cancel, and codex aborts the whole turn with stopReason "cancelled" before the model is called again. A _session/steering injected while the permission was pending returns {outcome: injected} and is discarded with the turn. Both end-of-turn continuation gates keyed "cancelled by the user" on that wire stop reason, so the one channel that could still reach codex's model -- the fallback continuation -- was skipped too, and a Stop hook's block decision was suppressed the same way. - should_queue_refusal_recovery and should_queue_hook_continuation take the host's own Stop signal (`user_stopped`, keyword-only, REQUIRED) and have no stop-reason parameter at all, so the rule cannot come back by omission. - chat_runner reads that signal LIVE through one helper, `_stop_pressed()` (a stop in flight, or slot._stop_generation moved since entry), at both gates and again after each gate's await -- the credential-hint lookup and the config load -- before the queue write. A Stop that presses and resolves during the awaited Stop hook is invisible to a snapshot and to `_stopping`; the counter still says it happened. - build_refusal_recovery_prompt takes `turn_aborted` and, when the turn ended cancelled, names and overrules the harness's own "aborted by user" / "interrupted the previous turn on purpose" messages, which arrive right next to the continuation and otherwise win. - A backend abort after a policy block is logged apart from "Turn cancelled by user". - ACP_BACKENDS_STEER comment records why codex stays a non-member: its steering channel is a different method and cannot reach the denied turn, so the continuation is its only channel. Tests: gate semantics for backend-abort vs Stop press on both gates, a structural pin that neither gate has a stop-reason parameter, abort wording composed with the awareness body without inflating the RecoveryCard bullet count, and a source-level pin that the runner reads the live signal at both gates and re-reads it after each await. Co-authored-by: zejiangg <zejiangg@amazon.com>
…tdev#10335) An opencode session held none of Kiro Crew's own tools -- no spawn_run, no cron_add, no send_message -- while working in every visible respect, and the reason recorded for it was false. `providers/mirrors/registry.py` and `agent_sdk/backends.py` both said opencode's `initialize` result advertises `mcpCapabilities` of `http` and `sse` and "no stdio", so the `session/new` `mcpServers` array could not carry Crew's stdio servers. ACP's `McpCapabilities` schema has exactly two boolean fields, `http` and `sse`, and no `stdio` field at all -- a conforming agent cannot advertise stdio, so `{"http": true, "sse": true}` is what full support looks like and the absence was never evidence. The same entry also contradicted itself: its last sentence said the array carries the shared gateway's broker stubs, and those are stdio elements too (`mcp_gateway/session_servers.py` emits command/args/env), which `_pooled_mcp_servers` had been appending to that very array for opencode whenever pooling was on. Measured against opencode 1.18.30 rather than re-inferred: the element `acp/session_mcp.py::acp_server_element` already emits is accepted, the child is spawned, its tools are listed and the element's `env` reaches it. Dropping the `type` key is byte-identical -- the tag is tolerated and DISCARDED by the adapter's zod schema -- and the mirror DROPS it rather than depend on that: the adapter's ACP-to-native mapping branches on whether `type` is PRESENT, so a tag surviving a schema change would be routed as a remote server and fail the whole `session/new` with `-32602`. Only the stdio tag goes; for `http` and `sse` the tag is what the adapter's union matches on. What this adds: * `providers/mirrors/opencode.py` -- the wire face, reusing `session_mcp_projection` with no new translator. NO transport filter: `http` and `sse` elements are both accepted here, unlike codex, so codex's `drop_unadvertised_transports` would only remove servers the harness would have mounted. `sse` becomes opencode's own `remote` kind (streamable HTTP), which is noted because an SSE-only server is then spoken to over the wrong shape. * `providers/mirrors/identity.py` -- the control-plane identity carriage, extracted from `codex.py` and now shared. `KIROCREW_SESSION_KEY` placement is a security rule and the identity-bound withhold set is a derivation; a second copy of either drifts silently. The REASON differs per transport and stays in each mirror: codex-rs `env_clear()`s its children, while opencode's inherit the ambient environment, so here the element env SCOPES the key to this session rather than supplying it at all. Dropping the rule mis-scopes rather than empties, which is the harder failure to notice. * opencode joins `ACP_BACKENDS_SESSION_MCP_ARRAY`, moves from `no-channel` to `mirror`, and gets its own `session/new` + `session/load` splice and its own spawn-arm cache warm (harness-parity H13). Once it is in `MIRRORS`, `_pooled_mcp_servers` returns `[]` for it, so the mirror places the broker stubs itself and one withhold rule covers both halves of the array. * `test/test_opencode_session_mcp.py` -- the unit half, plus a real-adapter ratchet that drives `opencode acp` the way its codex sibling drives codex-acp and skips cleanly where the harness is absent. It pins the `initialize` `mcpCapabilities` shape, so a release that starts refusing the stdio element goes red rather than silently emptying every session's tool set. `disabledTools` is honoured by withholding the server it narrows -- and unlike codex that includes Crew's own control plane. codex's exemption for it was never about the wire (`managed_mcp_spec_entry` emits only command/args/env, so the narrowing reaches no element on either backend); it rests on codex having a SECOND channel, refusing the call at the permission request. That channel does not exist here -- this harness emits no `_meta.kiro` and no `rawInput.server`/`tool`, only a fused `<server>_<tool>` title -- so carrying the exemption across without the mechanism would leave a tool the operator switched off on the dashboard reachable on an ordinary path. `narrowed_control_plane` withholds it instead, and the cost is stated rather than hidden: that session loses the server, and with `kirocrew-core` gone it cannot report back to its channel at all. It is paid only by an operator who narrowed the control plane deliberately. That reach is DECLARED rather than left in prose, because per-tool MCP deny is not a requirement on every provider: `McpProjection` gains a `per_tool_deny` field, required for every `kind=mirror` and refused elsewhere, whose three members name the three states that exist -- `settings-file` (claude: the restriction becomes a `permissions.deny` rule and the server stays mounted), `per-call` (codex: Crew refuses the call at the approval request) and `whole-server` (opencode: the server is withheld). Each is OBSERVABLE in what a mirror's `session_projection` returns, so `test_provider_mirrors.py` cross-checks the declaration against behaviour instead of against its own prose, and a mirror that stops withholding -- or starts returning deny pairs it cannot enforce -- fails there rather than quietly contradicting the card a user read. The mirrors README gains a column and `agent-host-contract.md` a row, so the answer is lookup-able before a session runs, and the field is READ rather than merely declared: `backend_mcp_projection` carries it across the agent-sdk boundary as a plain string and `kirocrew doctor` prints one report-only row for the selected backend when the reach is `whole-server`. That is the reach whose consequence an operator meets by accident -- switching one tool off is an ordinary dashboard action that says nothing about servers, and here it removes the server, Crew's own control plane included. One further asymmetry with codex, in the opposite direction: a malformed element fails the WHOLE `session/new` with `-32602` here, where codex drops the element and succeeds, so `acp_server_element`'s skip discipline is load-bearing. ## Pattern harvest Defect class: an ABSENCE in a capability advertisement read as a refusal, without reading the schema that would have carried the claim. `McpCapabilities` has no `stdio` field, so the missing flag was one no agent could set. Rule candidate: a `no-channel` declaration -- the one kind that asserts something about a live adapter -- must cite a driven test, the way a mirror's transport rules already do. Recorded in `providers/mirrors/README.md` and the RFC's migration section. Co-authored-by: Joe Guo <zejiangg@amazon.com>
) Feature-intro clips were a static tuple compiled into the package, with the media riding in the wheel. That is the right shape for two clips and the wrong one for a library: every added video needed a release. Clips now come from a manifest published per release folder on the CDN, signed with the same offline key cli.sh pins for the update feed under a distinct schema string, and cached in ~/.kiro/crew/feature-videos/<release>/ by a background pass at gateway boot. The static catalog stays as the fallback for an install that never fetched a manifest. Three properties make it safe to act on bytes from a CDN. The manifest is verified and an unverified one is discarded WHOLE, because the signature covers the document. Every clip is sha256-pinned by that signed manifest, so a tampered object can only fail verification. And the one case where the browser fetches media off this origin -- an eligible clip that is not cached yet -- is pinned to the host the signed manifest declares. Fetching any of it is governed by capabilities.feature_videos_download, fail-closed, consulted at four chokepoints: the manifest fetch, the clip download, the src handed to the browser, and POST /api/feature-videos/ fetch-all. Already-cached clips keep playing under a denial. Selection now draws uniformly among eligible clips instead of taking the first in catalog order. Order stopped being a statement about the user: with a hosted library, catalog order is publication order, so the first entry would always win and the rest would only be reachable by retiring the ones ahead of it. Eligibility is unchanged and still deterministic. The streamed-and-verified transfer itself moves out of embeddings.py into asset_downloader.py, shared by both callers, with resume added: a partial stays in a .part staging file nobody serves and the next boot continues it. embeddings.py keeps everything that is about the model. Its too-small branch also stops mis-reporting -- the staged size is now read before the unlink, where the old inline copy read it after and degraded every undersized download to a generic transport error. New: GET /api/feature-videos/probe (server-side reachability, because the modal's <video> is preload="none" and a client cannot discover a dead src before the user's "Got it" records a permanent verdict), POST /api/feature- videos/fetch-all, and GET /feature-videos/<release>/<file> -- a dynamic route, never add_static and never a listing, validating both URL components against the manifest's own rules and re-checking containment after resolve(). dashboard.feature_videos_enabled keeps its default of false. Co-authored-by: Zejiang Guo <zejiangg@amazon.com>
… cannot expire the budget The sensitive-path gate refused ordinary project files as "access to sensitive path" whenever the gateway was busy. The resolver was not waiting on the disk: os.path.realpath re-acquires the GIL once per path component, the anchor rebuild does ~400 of those, and each waits a full switch interval when another thread is CPU-bound. Measured: 2 ms idle, 2000-4200 ms under one busy sibling thread, against a 2 s budget. One host logged 57 expiries in a day, each after an event-loop-lag warning. Resolution now runs in a helper process (own GIL): the pool worker pays one pipe round-trip. A helper wedged on a dead mount is killed at the deadline so the worker is reclaimed, and its /proc syscall is the stall sample. A stall is refused as "could not be verified within the resolver budget" instead of as a match, with its own deny-guidance class; shell command text no longer enters the path tier; the stall log names what it observed instead of guessing "stalled mount?".
GPT 5.6 Review —
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fork-internal CI probe for kirodotdev#10256 Windows shard failures after rebasing onto kirodotdev#10276. Not for merge.