Repository navigation
chore: sync upstream KiroCrew v0.9.0 as 0.9.0-1.0, Claude Code auth, merge-leftover fixes - #4
Merged
Merged
Conversation
… its three consumers (kirodotdev#14478) `sanitize_body` had four callers, all in test/test_gh_pr_fetch.py, and zero in src: production reads `_sanitized_body_with_clip`, which also says whether the clip fired. A public name reads as a supported entry point, and the next caller who reaches for it gets a body with no truncation flag. Renamed to `_sanitize_body`; the four test references follow, so the normalisation is still asserted on its own. `BUCKETS` had one docstring reference and no code caller, while three places carried the same five names independently: `_bucket()` (producer), `_UNDATED_RANK` (undated tie-break, read with `.get(bucket, 0)`) and `PrObservation._bounded_buckets()` (retained board). A sixth bucket added to the producer alone took the LOWEST rank by default and was dropped from the board, with nothing going red. One test now pins all three to the tuple: every string `_bucket()` emits is in `BUCKETS` and every member is emitted; `_UNDATED_RANK` keys equal `BUCKETS`; every emitted bucket lands in exactly one retained list. Mutating `_bucket()` to emit a sixth string fails it with `{'unrecognised'}`. Closes kirodotdev#14073
…14428) On the KAS backend every Crew-managed MCP server reaches the wire through hoist_managed_servers, which runs AFTER _own_stub_session has stamped the per-session token onto the session-level array. On KAS that array is empty at stamping time, so the hoisted kirocrew-core launched with only KIROCREW_SESSION_KEY. Its tool-policy read then went out unattested and the gateway answered 409 member_identity_unavailable, so every tools/call (memory_recall, spawn_run, kiro_cli_logs, ...) was refused as identity_unattested on every KAS session. hoist_managed_servers now takes the session token and stamps it on the elements it hoists, and both create_session and load_session pass it. Caller entries (broker stubs, member dispatch) keep their own identity and third-party servers never receive the token. The gateway verifies the token against the published MAC-signed mapping, so no gatewayd claim is needed. Co-authored-by: Zezhen Xu <zezhexu@amazon.com>
…tdev#8748) (kirodotdev#14324) The namespace launcher hid run/voice-runtime (empty-dir bind) BEFORE it sealed run (bind-over-self + MS_RDONLY remount). A non-recursive MS_BIND does not replicate submounts, so the later run self-bind masked the earlier hide and the real voice-runtime subtree was readable through it (writes still EROFS). Move the READONLY_DIRS loop ahead of the SENSITIVE_DIRS loop: a hide issued on an already-sealed parent is a mount on top of it and stays reachable, the same property the WRITABLE_DIRS carve-outs rely on. Private-window staging stays first; carve-outs stay last. Container-measured on the real _build_launcher_script output (strict, standard, cc): marker in run/voice-runtime went from readable to ENOENT, run stays read-only, siblings under run readable, carve-out writable. Tests: fake-libc mount-order assertion for a hidden leaf under a sealed parent (with the swapped-loops break arm), the carve-out still after both, launcher-text seal < hide < carve-out pin per tier; the fake-libc site numbering follows the new order. Closes kirodotdev#8748
…erged (kirodotdev#14635) kirodotdev#14542 split the pod runtime and kept kiro_crew.pod.runtime as a forwarding facade. It merged with a test-order regression and with review findings still open: - Owners loaded on first use, so an owner's by-name imports, such as runtime_home's pin_directory, could be taken inside a test's patch of platform_compat and keep the stub for the rest of the worker. test_pod_windows_seed's source-pin test failed when run first. - A star import carried none of the moved public names, the module __getattr__ made mypy type every rt.<name> as Any, and mock.patch(..., create=True) on a forwarded name deletes the owner's binding when it exits. The core now imports its six owners at the end of its own body, before it installs its forwarding, so every owner binding is taken at import as it was when the runtime was one module. The facade follows the repository's canonical re-export shape: _EXPORTS maps each name to its owner's dotted name, each read resolves the owner through import_module (the kirodotdev#13727 spelling, which waits on the import lock for an owner another thread is still importing), writes and deletes are forwarded, and __all__ is derived. __getattr__ is hidden from type checkers, which see the TYPE_CHECKING imports instead. Names bound to a module are fixed once the owners load and refused by name, both ways. A new AST guard scans the test trees and fails on a create=True patch of a forwarded name, including through the rt that the pod CLI and Dev Fleet bind; a parameter, a call's result or text it cannot spell counts as unresolved and fails. The Dev Fleet spec states what is enforced.
…tdev#14623) `cli_doctor.py` held every section of `kirocrew doctor` in one 5.6k-line module. The sections now live in `kiro_crew.doctor_checks`, one module per family (agents, mcp, confinement, access, install, services, resources, workload, channels, features, plus the render rules every printed value goes through). `cli_doctor.py` keeps the orchestrator, which prints the sections in the same order and decides the verdict and exit status, and the rows repository gates pin to that file: the spawn-audited probes, the hardened agent-spec reads, the MCP Tools repair and probe, the KAS relay rows and the redacted model-URL probe. `kiro_crew.cli_doctor` stays the one import path and patch target: every name it held still resolves there, families read facade-bound names through it at call time, and writes to a moved name are forwarded to its family. The report's output, order, issues and exit status are unchanged, pinned by a whole-report golden test.
…dev#14641) session_set_model (added in kirodotdev#14223) was registered on the dashboard MCP server without an entry in the kirodotdev#14508-enforced title table, so test_mcp_tool_titles.py::test_every_listed_tool_carries_its_declared_title[kirocrew-dashboard] failed on main and on every dashboard-touching PR's merge ref. Declare its title alongside its session_* siblings. Co-authored-by: kirocrew-agent <agent@kirocrew.local>
…irodotdev#14483) Prevent Meetings startup from serializing agent kickoff turns or waiting without a bound when one provider keeps the opening turn alive. Preserve speech captured during initialization and dispatch it promptly after every agent has either initialized or reached its kickoff budget. Co-authored-by: Chunhe Yao <maomao@Chunhes-Laptop.local>
…odotdev#14619) crew/packaging/build.py held every rule of the crew bundle builder in one 6,332-line module: sensitive-path policy, credential scanning, the no-follow filesystem primitives, crew resolution, the curation plan, the external prompt read, spec normalisation, the staging transaction, report publication and the CLI. Each responsibility now has one owner in the private package crew/packaging/pipeline/ (contract, scan, sensitive, pinned, destination, hashing, crew, candidates, plan, prompt, spec, layout, staging, report, transaction, cli), stacked lowest layer first. The code moved as it was: every top-level statement of the old module reappears AST-identical apart from how a cross-owner call is spelled, except that build_bundle asks report to write the report temp file and the __main__ guard calls pipeline.cli. build.py is a facade of the kiro_crew.security shape. A name resolves from the owner that defines it on each access, and a write or delete lands on that owner. An owner calls another owner's function through that owner's module, so a monkeypatch of build.X still reaches every caller. The standard-library names the old module bound stay bound. The suites load a throwaway copy of the whole package, source rules read every builder file, and a new composition contract pins the name inventory, the export table, layering, late binding and every patch site. aws-control.md gains the builder's ownership section.
…irodotdev#14327) * fix(windows): make five directory-link fences see a junction A Windows directory junction is a reparse point that os.path.islink and Path.is_symlink both report as False, while is_dir reports True. Five fences still tested one of those two predicates, so each failed OPEN for the only directory link an unprivileged Windows user can create -- and stayed green on POSIX, where the same plant is a symlink the old predicate catches. Measured on Windows, each red before the change and green after: - artifacts ArtifactStore._rmtree deleted files inside the link's target -- data loss outside the artifact store, reported as a successful prune. - portability._strip_host_local_store_state removed state behind the link when its relative name matched the host-local predicate, and raised out of the import when shutil.rmtree refused the reparse point. - node_modules_txn._gone took the rmtree arm, hit the refusal ignore_errors swallows, and returned False -- the permanent wedge its own docstring exists to prevent. - skills SkillsLoader._candidate_has_symlink answered False and the walk descended, so the read and approve paths reached what the link pointed at. - deploy _stage_tree_safe passed the link. Not a way into a deployment, because within_root pins containment to the opened descriptor; the cost was a link with nothing readable behind it staged as an ordinary empty directory, and one with files behind it refused under the wrong tag. platform_compat.is_link_or_junction is what docs/system-specs/common/platform-compat.md already mandates for detecting a directory link, so no spec changes: these sites were out of compliance with it. Swapping the predicate is not sufficient in _rmtree, and a review round is what established that. Screening a child and then letting a walker descend that NAME are two operations on two objects: os.walk re-tests with os.path.islink at descent (Lib/os.py:431), which is False for a junction, so one planted after the screen was still descended and the sweep unlinked the link target's files. Creating a junction needs no elevation and the agent both triggers a delete and can retry it. pinned_fs.remove_tree_pinned cannot answer that here: supports_pinned_tree_walk() needs O_DIRECTORY, O_NOFOLLOW and dir_fd support, and all three are absent on Windows. platform_compat .pin_directory can -- its open uses OPEN_REPARSE_POINT so a junction at the name is refused rather than followed, and its share mode omits FILE_SHARE_DELETE so the directory and every ancestor resist rename and delete while the handle lives. So _rmtree is an explicit recursion: each directory is pinned before anything in it is touched, and released only once it is empty, because a pinned directory cannot itself be removed. The root's own removal stays outside the warn-and-continue handler. A residual anywhere keeps the root non-empty, so the removal fails and the caller sees it; the per-entry warnings name WHERE the residual is rather than deciding to report success. The caller logs a successful delete and fires its delete event unconditionally, so a swallowed root failure would report a completion that did not happen. The pruning walk makes the rewritten functions match test_link_screen_hold_pin's discovery condition, so they owe baseline entries; regenerated with test/gen_link_screen_sites.py. That baseline is regenerated whole and carries no reason, so the reason is here: all four are the NO-HOLD kind, because each refuses every link and never traverses one. _purge removes a link with unlink_link_or_junction, which never touches its target, and its descent is guarded by the pinned open rather than by a re-check. _strip_host_local_store_state prunes a link from the walk. _gone unlinks the link itself or rmtrees a real tree. And _candidate_has_symlink returns True at the first link and resolves nothing -- its whole contract is to make its caller refuse. None joins HELD_SITES, whose shape is asserted against the gate's own hold helpers: holding that chain across a whole recursive delete would break the ordinary layout that gate's docstring names, a junction or symlink on the path to a config directory, for no privilege gain. ensure_owner_rwx_dirs is already declared the same way. The deploy fence names a link of either kind, so its message says "linked directory" rather than "symlinked directory", and the one test asserting that prose is updated. The pattern is anchored on the "in-tree: " prefix: a bare "linked directory" is a SUBSTRING of "symlinked directory" and would pass against either wording. * fix(windows): anchor the link fences to pinned descriptors The five fences now see a junction, but four of them still screened a NAME and then acted on that name, so the entry could be replaced in between -- and on Windows nothing in the stdlib refuses the replacement: os.walk's own descent re-check is os.path.islink, which a junction answers False to. platform_compat gains PinnedDirectory: act on the ENTRIES of the directory you inspected, never on its name. The two platforms reach that property by opposite routes, so a call site written in terms of either one is broken on the other -- POSIX every call is dir_fd-relative because the pin does not block a rename there, Windows every call goes by path because the handle denies FILE_SHARE_DELETE and so freezes the directory and its ancestors. child() and open_file() refuse a link IN THE OPEN, so a screen and the act that follows it cannot be separated. read_bytes asserts a regular file from the descriptor's own fstat and the open sets O_NONBLOCK, so a FIFO at the name cannot stall a read. A pin CHAIN is bounded by PINNED_TREE_MAX_DEPTH, enforced in child() rather than at each call site, because the hazard belongs to the chain: every level holds a descriptor while the level below it is in use, and the trees being walked are untrusted content -- an agent-writable artifact store and a hand-built snapshot archive. The refusal is an OSError raised BEFORE the open, so each caller's existing error policy classifies it: the artifact sweep names it as a residual and the unguarded root removal then fails, and the snapshot strip propagates it, which is the only honest answer for a function whose contract is that host-local state is gone afterwards. 64 is skills._PROJECT_SKILL_MAX_DEPTH's number and reasoning; a caller with a shallower domain keeps its own tighter cap and reaches it first. Three call sites are converted to it: - artifacts.ArtifactStore._rmtree removes the tree through a pin chain, including the root itself through a pin on its PARENT, so no by-name step is left. A refused pin dispatches on WHAT IS AT THE NAME rather than on the exception class: pin_directory reports whichever of ENOTDIR / ELOOP the kernel picks for O_DIRECTORY|O_NOFOLLOW, Linux answers ENOTDIR and Windows raises NotADirectoryError, so keying on one class leaves the link behind wherever a kernel picks another and the root removal then fails ENOTEMPTY out of delete(). Asking what is there also keeps a plain file from being removed as though it were a link, and re-raises for a real directory that merely refused to open. - portability._strip_host_local_store_state pins every directory before judging its entries. The extraction directory is only owner-restricted, which does not exclude a same-UID process, so the swap needs nothing from the archive. A link is removed when the predicate matches it, never descended, and left alone when the predicate does not match -- it is not this function's to delete. - skills.get_pending_skill reads SKILL.md, .meta.json and every script through ONE pin chain that both judges and reads. The screen it replaces refused a link PRESENT at check time, so a candidate tree the LLM can write needed only to have the link absent at the screen and present by the read; measured against that shape, a junction swapped into the window made the API serve the bytes of a file outside the candidate. The pending-detail collector shares _PENDING_SCRIPT_MAX_DEPTH with the verdict walk so the two cannot disagree about which trees exist, and it now bounds depth the SAME WAY as well. That walk refuses to DESCEND when the directory it stands in is already at the cap, so it enumerates the level AT the cap; the collector compared with >= and refused one level earlier, which answered 404 for a candidate the verdict had just judged fine. GPT 5.6 and Opus 5 each raised it independently. Pinned by a boundary test at exactly the cap -- the two existing depth tests used cap+2 and depth 2, so neither could see an off-by-one. The detail read screens the whole top level before a byte is read, so a link at a name it never opens -- .meta.json, or an unexpected entry approve refuses outright -- fails the candidate instead of reaching no check at all. A present .meta.json that cannot be read through the pin fails it too, rather than being swallowed into empty metadata and served as a clean new skill; unparseable CONTENT still serves, since a typo must not make a candidate unreviewable. The screen does not replace the per-name refusals: it cannot see a swap that lands after it. A refused candidate no longer answers the same 404 as a deleted one. The detail read's refusals leave the candidate LISTED, so one shared code had the panel say it was approved or dismissed elsewhere -- false, and pointing away from the only action that applies. It now answers pending_skill_unreadable while the candidate is staged and pending_skill_not_found only when nothing is there; the staged split is a by-name probe that runs after the pinned read already refused, so it chooses a message and can never grant a read. The sixth fence prunes the WALK, not just the entry: skipping a junction inside rglob("*") still let it enumerate the junction's descendants, and the per-file mkdir(parents=True) rebuilt the directory the skip meant to prune, so the target's files landed in the live tree anyway. os.walk(topdown=True) with dirnames edited in place is what makes the prune real, and each pruned name is now reported instead of dropped silently. snapshot_merge._copy_tree_no_overwrite's unpinned fallback skipped is_symlink() alone, which answers False for a junction -- on the one platform that branch runs, since it needs no dir_fd support plus --allow-unpinned-staging. Its two siblings already paired the check with is_reparse_point; this one now reads the same way. /api/models leaves the route sweep's 503 table: kirodotdev#14463 taught the fake kiro-cli to answer chat --list-models, so the route serves under the fake and the table entry was stale -- red on every open pull request, not just this one. The snapshot-import strip pins the EXTRACTION ROOT, not just memory_stores. Pinning only the leaf left snap reached by name, and snap comes from a by-name iterdir() in the owner-only extraction directory a same-UID agent shares, so swapping it for a directory link redirected the whole strip and a matching backups tree outside the archive was deleted -- the harm this function was written to prevent. snap.parent is now the anchor and each component below it is opened through the pin above it; the by-name is_dir() probe is gone with it. The pending-detail read spends the verdict walk's budget rather than a new one: the same entry cap and the same per-file byte cap, enumerated lazily at both the candidate root and inside scripts/, with one budget threaded through the recursion. The per-file cap is asserted from the open descriptor's own fstat and the read is bounded too, so a file that grows in between stops at the cap. No aggregate check: entries times per-file already bounds the total, so one could never fire. The refused-open fallback is one method, child_if_real_dir: it pins the child, answers None when the name is no longer a real directory, and re-raises for one that is. The callers share that QUESTION, not the action -- two unlink on None, _strip deliberately does not -- so the errno-agnostic dispatch lives in one place and the differing actions stay at the call sites. Its re-raise carries child's depth refusal out, so an over-deep tree fails the operation instead of being unlinked as a link. pinned_fs owns this discipline, so PinnedDirectory is its cross-platform arm rather than a second opinion. The split is forced by the import direction: pinned_fs imports platform_compat for its own Windows no-reparse open, so that layer cannot import it back, and supports_pinned_walk() already means "dir_fd opens are available" to consumers that read it to degrade on Windows. The one real duplicate, the POSIX open-flag triple, is now a single pinned_dir_flags() helper that a test asserts equal to pinned_fs.dir_flags(). PinnedDirectory's public surface is only what a caller uses: no descriptor accessor, and read_text is the whole read surface, with _open_file, _read_bytes and _lstat private because no site outside the class calls them -- the read path is read_text -> _read_bytes -> _open_file and the predicates are is_link / is_dir. A public accessor on a fence primitive invites a caller to operate outside the pin the class exists to keep, and every name in the spec's method list is one the spec then has to keep in sync forever. Docs: a platform-compat row for the read primitives and the depth bound. The portability entry leaves test/link_screen_sites.py because the site no longer has the screen-then-resolve-by-name shape. The discovery baseline is regenerated rather than hand-edited: the pruning walk's `_is_link` helper in snapshot_merge is itself a link-screening site, so it is recorded as one, and the portability row is dropped because that site no longer screens a name it then acts on. Both edits come from test/gen_link_screen_sites.py, which is what the hold-pin test names as the remedy.
kirodotdev#14634) Both spawn paths read the root's process-start token once, keep it, and hand it to _track_session_pid, so the line written and the line the retirement later compares are one read of the identity, not two. _track_session_pid keeps one line per gw:pid number: a same-number line carrying a different token is a predecessor's and is replaced, never kept, so a successor on a recycled number always has a line of its own. The kill paths (_kill_inner, AcpClient._reset_state) retire by identity too, the way the observed-exit path already does: "confirmed dead" is a fact about the process, not about a number a root spawned since may already hold, and their prefix-matched untrack took the successor's lines with it. No new lock and no new await: the bare line still goes only while the number is dead, under the pid file's own lock. Co-authored-by: w <w@k.local>
…otdev#14558) sections.py (8,199 lines) and loader.py (6,840) held every configuration rule, so no group of settings had an owner and a one-setting edit sat among forty unrelated sections. Both files are among the most-edited in the repository, so finding the rule for one setting cost the same scroll every time -- and these files carry the security clamps, the fail-closed defaults, the write-back migrations and the credential list, where a guess ships silently. Each config.json domain now has its own module, with the two old files kept as the facades every caller imports: config/fields.py owns the field metadata and the shared value coercers; memory_sections, integration_sections and service_sections own their sections' DTOs; section_builders owns the _build_* helper of 28 sections, grouped by the module that owns each section's DTO; migration owns the write-back migration ids, the document transform and superseded-default reporting. Imports run one way -- fields, the section owners, sections, then section_builders/migration, then loader -- and a test pins that graph. Every module split out keeps the kiro_crew.config.loader logger, so a relocated warning keeps the name operators filter on. Each file's residual core stays put because something outside the config package names that file, not because it was convenient: the writer scans exempt only loader.py, seven specs and the feature map cite it for the clamp, credentials, port, agent resolution and telemetry parse, the agent-spec read inventory and agent-SDK edge baseline key to it, the second-boot witness keys the published counters to it, and the blocking harness-parity and memory-store rules cover it; sections.py keeps the DTOs that messaging, slack-gateway, crew-mode, history, stt-streaming, metrics, decisions, security, model-selection, model-fallback, subagent, acp-client and crew-log-projection name, plus the four constructs whose source scans allow them only there. config.md carries that table. Behaviour is unchanged: both facades re-export every historical name as the same object, so every import still resolves, and the schema baseline config-baseline.json regenerates byte-identical. A patch reaches the code that looks the name up in the patched module: loader-resident seams (the path helpers, the config writers, the clamp event, DEFAULT_POOL_SIZE, record_adoptions, each _build_* name at its _load_resolved call site, the snapshot globals) stay call-time seams on the loader, while a helper read inside a relocated builder or migration rule is patched on section_builders or migration. No test or caller that predates this change patches one of the relocated names; config.md lists both sets, and a contract test pins representative seams of each kind. The one changed call shape is internal -- the migration transform takes the adoption-ledger writer as an argument and the loader passes its own record_adoptions at call time, preserving that patch seam.
…v#14602) The artifact_store split left four facade contracts short of what a patch or import of kiro_crew.artifacts reached before it. - A config_dir patch moved the store root but not the default folder file. get_default_folder_store builds its store on the facade's config_dir, so one patch moves both. - MAX_NAME_LEN, MAX_DESCRIPTION_LEN and ALLOWED_EVENT_TYPES had two live bindings, one read by the store and one by its owner. The store reads them through the owner module, so each has one binding. - slug_is_well_formed resolved a different _validate_slug binding than the store methods. It lives in the facade next to the store, so the two cannot disagree. - The facade exported fewer names to a star import. __all__ declares its whole public surface, and the eleven incidental imports it had dropped are bound again. artifacts.md states the seam rules as the code applies them: the store seams and rule helpers steer from the facade, and rule data an owner reads itself steers from that owner. Tests pin the folder path, each seam's reach and the star-import surface.
…14654) _approve_and_log picked its SEL outcome label with a chained conditional expression that re-tested `approval_sent is not False` in two arms. Resolve it with a guard-first if/elif/else instead: an approval the transport rejected (approve_tool returned False) is the transport-floor rejection, an approval carrying a metadata reason is auto_approved, anything else is approved. Same three labels for every input; no behaviour change.
…dev#14563) * refactor: split the dashboard API client into domain modules Move the 664 endpoint methods and their wire types out of website/src/api/client.ts into 40 domain modules under website/src/api/client/. Each module exports a create*Endpoints factory that the facade hands the transport it owns, so no module imports a runtime value from client.ts and the session key, j/jNullable and auth recovery keep one definition. client.ts keeps the transport and auth-recovery pipeline, re-exports every moved type and constant, and assembles the same plain api object by spreading the modules' segments in the original key order. Four methods and the Kiro usage types stay defined in client.ts because other docs, the i18n gate or a late-bound sibling call pin them there. A capture of all 670 methods under seven response shapes is byte-identical at the base and this head. New ApiClient.refactor tests pin the api shape, one owner per key, the transport install, the raw-fetch reads, caller-owned bodies and the late-bound wakatime export URL. The four owning docs name the new owners. * test: pin the api key order and the members that send no session key ApiClient.refactor.surface.test.ts holds Object.keys(api) and the teams/appearances namespaces to the order the split was cut from, and asserts that the 171 members whose request carried no X-Session-Key there still send none, so two swapped spreads or a raw read or write moved onto the shared helpers fail instead of passing silently. Also tidies three comments the move left misleading (a stray "Chat" heading, and the usage/capability stub note split between its two modules) and states in dashboard-token-auth.md that authorization stays on the gateway: the token middleware and the handler-level owner gate whose owner_only and stale_session_reauth refusals the client only surfaces.
…to (kirodotdev#14666) Three comments in CI files still named the module that used to hold the code they describe. The component refactors kept each old module as a facade but moved the code into owner modules, so the sentences now send a reader to the wrong file. - check_sync_io_in_async.py: the 30s SQLite busy_timeout lives in apps/builtins/auto_research/campaign/storage.py, not handlers.py. - docs_lint.py: the foreign-home readers the allowlist block names are the onboarding_sources/ adapters, not onboarding_import.py. - publish-linux.yml: the per-format feed URL is set in runtime/update/feed-lane.js; buildFeedBase() stays in auto-update.js. Comments only. No path filter, gate, or workflow step changes.
…tdev#14674) apps/registry.py carried the whole App Store pipeline in one 7,769-line module: subprocess environments, clone-target policy, caches, registry trust, git checkout transport, the store listing and the install transaction. Its rules now live in ten private owners under apps/registry_pipeline/, one per responsibility, and registry.py stays the only import path and patch surface. The facade answers every name the one-module registry bound with the object its owner holds, and a write through it reaches every module that binds the name, so the existing monkeypatch and mock.patch seams keep reaching the moved call sites. Owners import only lower owners and never the facade; the build step and the two index-entry name gates stay in registry.py, where repository guards read them by path. Moved function bodies are unchanged. A new composition-contract test pins the surface, the one-namespace writes, the layering, the facade call sites, reload and a create=True patch guard. Characterization tests pin the seed path, frozen cache filenames and the credentialed-output classes. The App Kit spec gains section 20 with the owner map; the security_posture allowlist, one RFC line cite and the moved-symbol citations in other specs are updated.
…otdev#14669) Eleven merged refactors moved code out of facade modules (source providers, snapshot, onboarding import, artifact store, doctor, pod runtime, auto-research, connections warm, aws-control backup, issue radar routes, MarkdownRenderer). Specs, architecture docs, RFCs and one design spec still named the facade as the module that defines or does the work, or cited line numbers that now point at unrelated code or past the end of the file. Point each such citation at the module that owns the code at main, and replace dead line numbers with symbol citations. Facade citations that are still true stay as they are, such as the onboarding_import.<name> paths the onboarding spec asks specs to use.
…tdev#14661) The drain counts a row as waiting when it pops it, before the claim moves it out of the claimable states. Nothing re-emitted the count after the row registered, so the chip kept '1 waiting' and the old wait reason (e.g. low memory) with nothing waiting. Co-authored-by: zejiangg <zejiangg@amazon.com>
) The file viewer, download, raw/stream/sheet/office preview, browse and grep handlers read any host path the user can read. An allow-listed channel user holds a dashboard token (app="", non-owner subject) and could read the owner's logs and stores through them. Each handler now calls require_owner_dashboard_request first. /api/file-raw is declared by a shipped App Kit manifest, so there the gate binds requests without a named app claim. Old fixtures get owner identity only; assertions are unchanged. Co-authored-by: zejiangg <zejiangg@amazon.com>
kirodotdev#14699) A plain send whose POST hits the transport deadline before a receipt arrives comes back `response-late`. The composer kept the optimistic bubble but said nothing, so the row read as a delivered message, and `selectTurnInterrupted` counted the trailing unconfirmed row as an interrupted turn and offered Resume -- a bare continue against a transcript that never held the text. - `selectTurnInterrupted`: a trailing user row still carrying the client-minted `meta.optimistic` flag is not an interrupted turn. The flag is never sent, so the backend mirror `is_turn_interrupted` never sees such a row and needs no matching edit. - ChatPage: when the send minted a bubble, the `response-late` arm stamps it (`markSendUnconfirmed`) and posts a WARN notice under it after the correlated-echo short-circuit, instead of returning bare. A busy-slot Queue send minted no bubble and keeps the bare verdict. - chatSlice: `markSendUnconfirmed` records the missed receipt on the bubble as `meta.deliveryUnconfirmed`; the receipt and the echo reconcile clear it with the optimistic flag. - UserMessage: a bubble carrying the mark draws a muted "Delivery pending..." line; the mark, not the optimistic flag, drives it, because the flag also survives refused, connection-failed and queued sends. The notice row under the bubble carries the instruction. - ChatFooter: the plain running indicator ("Thinking...") is not drawn while the newest send is such a bubble (`selectTrailingSendUnconfirmed`, passed from ChatPage as `sendUnconfirmed`): the send did start a local turn, so the indicator would sit under a row that already says pending and a notice that says unconfirmed. The stopping, killing, compacting and regenerating branches are untouched, and the indicator returns on its own once a receipt or echo clears the mark. - Catalog: two new keys in every shipped locale; pseudolocale regenerated. The notice states the uncertainty and the exit without promising either branch: "Delivery not confirmed -- this message may still be pending. If no reply arrives, send it again." Fixes kirodotdev#14559
…lish (kirodotdev#14652) * fix(auto-improvement): owner-gate the routes that drive agents or publish Seven auto-improvement routes were wrapped only in _require_enabled, so any dashboard token could reach them. A non-owner could clone a repository of their choice, grant the unsandboxed-agent consent flags, start a run or a calibration, start a PR watcher, push a one-click commit with the owner's git credentials, or open a draft PR under the owner's GitHub identity. Each handler now calls require_owner_dashboard_request first, the same shape as _handle_deps_install: app tokens are refused too, since no app-token caller exists. Allowed decisions are recorded in SEL off the event loop; refusals are audited by the gate itself. * fix(auto-improvement): owner-gate GET /watchers, whose sweep starts watchers GET /watchers runs a reconcile sweep. With watcherAutoStart on it starts watcher agents, and with autoPublish on it marks the owner's draft PRs ready. A non-owner could reach both through this read, around the new gate on POST /watchers/{fp}/start. The handler now takes the same owner gate first; no dashboard page or agent calls this route. --------- Co-authored-by: zejiangg <zejiangg@amazon.com>
…d one (kirodotdev#14589) * fix(fleet_probe): report the budget-bypassing pytest, not the budgeted one DEFAULT_BANNED_RES[0] recognised a worker cap only when `-n` carried a digit. On this repository that is inverted: `auto` (and a bare pytest, whose addopts supply `-n auto`) is the form bounded by xdist_budget.py's memory hook, while an explicit `-n <N>` bypasses the budget entirely -- setup.cfg and scripts/run_scoped_tests.py both say so. So the rule flagged every run the repository's own gate runner makes and stayed silent on `pytest -n 32`. The lookahead is now positive and selects a pytest whose command line carries an explicit worker count of two or more; the argv reader (`_argv_worker_pool_is_budgeted`, formerly `_argv_declares_a_worker_cap`) decides, reading `-n auto` / `-n logical` / no `-n` / `-n0` / `-n 1` as budgeted or single-process and resolving a repeated `-n` last-wins as argparse does. `_CAP_SCAN` and the kirodotdev#13653 shell-token selection are unchanged; the backtracking test keeps its subject and swaps the polarity of its end-to-end lines. Tests enumerate every runner form x every budgeted and unbudgeted spelling, the issue's verdict table row by row, and the launcher-own `-n` cases in both directions. SKILL.md and the rule's comment block now state the sense instead of deferring it. Closes kirodotdev#13814 * fix(fleet_probe): judge the count lexically, stop at --, fold an addopts override The argv reader now compares the -n value as a string (a run of digits past the interpreter's conversion limit, or a character isdigit accepts and int refuses, no longer raises out of _host_lines), stops reading options at pytest's -- terminator (a -n0 behind it is a path, not the run's count), and walks the tokens an -o/--override-ini addopts= override prepends before the run's own, so the count such an override carries is judged and the run's own last -n still wins. Comments and docstrings state the rule's current sense without history.
…rodotdev#14170) * fix(issue radar): bound the chain hold and refuse a relative path The crew store's chain hold is the only implementation of this walk in the tree, and it enforces less than the walk it is modelled on. Two guarantees are missing, and both are available without anything else moving. A relative path is now refused. Its components resolve against a current directory the walk never inspects, so the chain it would hold is not the chain the caller named -- and a bare `.` would be held successfully, which looks like a hold of the wrong object rather than a failure. The depth is now bounded. One open per component is the walk's whole cost, so a path with no bound on its depth is a stall inside the hold, performed before any of the work the hold protects begins. The bound is measured against the deepest path this store builds: a provider namespace arrives with one component per level of nesting, so a namespace nesting the twenty levels its own limit allows reaches thirty-one components on an eight component data root, against a bound of sixty-four. Both refusals are `ValueError`, which the recording path already absorbs. The read path absorbs it too now, so a chain the walk declines to chase answers header order rather than raising into a crew's ordinary listing. * fix(issue-radar): bound the chain hold's untrusted suffix, not the absolute path The depth cap spent one budget on the operator's data root and on the provider namespace, so a deep but legitimate data home refused every by-name write for that home -- dropping the unit order and leaving the header-clock fallback permanently in force, which is the failure the order file exists to prevent. The bound now arrives from the call site, which knows the store's base, so it bounds only what a caller's input can grow. It is a required keyword, so an omitted cap cannot mean an unbounded walk.
…14368) Model and reasoning effort are one composer control by design: the model chip names the level in force and the slider that changes it lives inside the model picker, below the model list (original design 612a1d6). kirodotdev#13637 split them while adding the selection-capabilities endpoint, giving the composer a second "Effort: ..." button and a portaled menu of its own. Keep everything kirodotdev#13637 added on the backend -- the capability endpoint, its remote-peer proxy, and the Codex `model[effort]` pair grouping -- and move the slider back into the picker fed by that data: the picker embeds it when the capability read reports support, offers exactly the advertised levels in their advertised order, and shows no effort row when the backend reports none. The ChatInput `separateEffort` / `onReasoningEffortClick` props and the `composer-effort-chip` control are gone; `hasEffort` gates the level shown on the model chip, and the chip's title and aria-label carry that level in every state (running, routed, pinned, inherited), so it is announced and shown in the tooltip, not only rendered. Both pickers (ModelEffortDropdown and ChatPane's inline dialog) route keys into the embedded controls through one shared helper, modelPickerKeyRouting.ts: the Tab is claimed through the IME latch before any focus move, a disabled slider is skipped in favour of its enabling switch, arrow hops land on the switch and never on the slider (whose own arrows would silently persist a level change), the effort block's help button is a routed Tab stop, Escape still dismisses from inside the slider, switch or manage row, and a Tab whose native destination is outside the dialog dismisses instead of leaving the portal open behind it. Both dialogs cap their height to the space above the chip, and only the model list shrinks, so a short split pane keeps the filter and the slider reachable. The default toggle names what it does with one stem in both states: "Use default effort" when no default is configured (so it is not misread as a model choice under the model list), "Use default effort (<Level>)" when one is, so the switch never reads as two different controls. Tests assert the slider renders inside the picker dialog and that no standalone effort control exists. The story, the model-selection spec, and the stale split-composer screenshots follow. Adds the decision-ledger entry recording the maintainer's ruling; edits no existing entry. Refs kirodotdev#13637
…irodotdev#14588) A reply in a Slack thread the session did not start (the owner answering an agent's send_message DM, a reply under a cron post) opened a slack:<ts> session that knew only the reply. The default transport path never fetched the thread parent, and because it persists the user's row at receipt, the history fallback replayed that reply as the thread's only history. Both dispatch paths now read the thread's first message once, for a fresh Slack-born session with no prior turns. The model gets it only through the existing fenced, injection-screened thread-context block. The transcript gets one display-only notice row above the reply, attributed to its author; the dashboard's notice card keeps its line breaks. The transport path passes exclude_last_n=1 so the current message is not also replayed as history. A message whose thread_ts is its own ts (the message-shortcut forward) is not its own parent: it gets no notice row, and the transport path does not fetch it. The row carries untrusted text, so no model-bound reader takes it: notice rows are outside the recall roles, and recent_with_provenance, memory consolidation and auto-skill detection now skip them while the consolidation offset still moves past them. An injection-matching parent's text is withheld from the row, and the row's text goes through the prompt block's marker neutralizers. The parent's author is looked up (users.info) only when a notice row will be written; a session that only needs the prompt text skips it. Rider: the single conversations.history read that fetch_message_detail shares with the existing fetch_message now injects the channel's cached workspace team_id, so fetch_message sends it too. That matches every other RealSlackClient channel call, and an install with no cached team sends the same request as before. Fixes kirodotdev#14540 Co-authored-by: Nick Bowers <nrb@amazon.com>
…ating-only label (kirodotdev#14678) Two rules this RFC owns are recorded here so the code implementing them is reviewable against a decision rather than proposing one. Mapping: an action outcome still wakes, except when needs_owner answered quiet at P >= 0.5 and the outcome's own confidence is below ACTION_OVERRIDE_MIN_P (0.6). needs_owner is the only question carrying the owner's wake_when / quiet_when, so a barely-confident answer to a question carrying none must not veto a confident one that does. Measured on 118 logged verdicts: 11 wakes came only from that clause, all over a quiet answered at p 0.59-0.94, 8 of them under 0.52. Calibration: owner_acted is true when the turn dispatched something that could have CHANGED anything, not when it dispatched anything at all. A count made the label constant (84 of 84 true), and a label with no variance cannot tune the thresholds this section exists to tune. Read-only is established, not assumed, and a turn whose dispatches arrive unnamed records tool_names_known: false. Refs kirodotdev#14643 Co-authored-by: wave1 verify <worker@localhost>
…odotdev#14962) Both workspace-create callers (dashboard handler, CLI) resolve the dir before materialize_workspace_dir sees it, and resolving follows a link at the final name, so the guard only ever saw the target. The function now also takes the unresolved leaf and refuses a symlink or directory junction there on every platform. The by-name arm (Windows) also uses platform_compat.is_link_or_junction for its adopt and EEXIST checks, which catch a junction planted after resolution. materialize_workspace_dir is recorded in the link-screen baseline as a site that refuses every link, so it needs no held descriptor chain: it never continues through a link it screened. Closes kirodotdev#12358 Co-authored-by: Joe Guo <zejiangg@amazon.com>
…14958) Co-authored-by: Zejiang Guo <zejiangg@amazon.com>
…rocess resolves (kirodotdev#14957) A Finder/Dock-launched Kiro Crew gateway hands its children the minimal launchd PATH. run_aws resolved the aws head absolutely but spawned it with the inherited env, so the CLI's own by-name lookup of a profile's credential_process binary failed. Pass aws_spawn_env(argv[0]), the same env the SSM tunnel spawns already use. The sandbox's AWS_SECRET*/AWS_SESSION* scrub runs inside the wrapped child, so it still applies. Closes kirodotdev#11412 Co-authored-by: Joe Guo <zejiangg@amazon.com>
kirodotdev#14952) Bump the skill search index schema to 6 so a catalog warmed before the HTML-body marker (kirodotdev#14882) is rebuilt and an HTML-bodied SKILL.md leaves list_skills. Delete compress_thread_history, which lost its last caller when Slack resume switched to verbatim replay (kirodotdev#14881), with its now-unused prompt constants and the tests that only exercised it. Co-authored-by: Zejiang Guo <zejiangg@amazon.com>
…4948) * fix(apps): owner-gate the app enable route POST /api/apps/{name}/enable refused app tokens but let any other dashboard subject re-enable an app, which registers its agents, skills, MCP servers and crons, starts its backend and runs onEnable. Gate it with require_owner_dashboard_request, the same call disable and uninstall use. Existing enable tests now act as the owner, and a new test pins the non-owner refusal. * test(apps): give the owner test state a broadcast_ws The enable hook wiring reads broadcast_ws from the dashboard state. The owner test state had none, so two hook tests passed on an AttributeError instead of on the hook they drive. Put the attribute on the shared helper state. --------- Co-authored-by: zejiangg <zejiangg@amazon.com>
…v#14796) The left rail item for /members read "Crew Members" while the page title already read "Crewmates" (PR kirodotdev#12924). Align the rail, the sidebar create-menu entry, and the Feature Previews card on the accepted product word (rfc-crewmates-launch.md): crewmate. Updates nav.crew_members, pages.chatSidebar.open_crew_members and pages.developer.featurePreviewsTab.crew_members in en.manual.json and every translated catalog (each copies that language's existing pages.membersPage.title), regenerates en-XA and the settings command-palette registry, and follows the label-derived settings id from developer.crew-members to developer.crewmates with a legacy-id migration so saved deep links keep working. Co-authored-by: cixuuz <26782336+cixuuz@users.noreply.github.com>
…split-pane opens to the pane's session (kirodotdev#14458) * fix(dashboard): wire onFileOpen through every ChatPane host The locale catalogs, SessionGridView, ChatPage and the renderer test rebase onto current main unchanged. The five UI files that drifted are re-applied edit by edit against main's current text: ChatPane's destructure, transcript options and dependency array and its ChatMessageList mount; ChatEmbed's destructure and mount; the Members DM pane; the app-sdk user-row comment; and the two attachment components. The no-handler degrade removal in FileMentionChip / FileAttachmentCard is kept as this PR wrote it, because that is its stated intent -- but it is the open question in this thread, not a settled one, and the diff now carries upstream's richer inert branches (visually-hidden path text, aria-hidden label) into the deletion. Rebased onto current upstream main `be067a350`. * fix(dashboard): bind split-pane file opens to the pane's own session The split-view host handed one active-slot-bound onFileOpen to every ChatPane, so a file opened from a non-focused pane opened against the host's active session (GPT block on kirodotdev#9921). Give each pane a slot-bound opener: SessionGridView wraps the host opener per leaf and passes opts.slot = the pane's own slot; usePanelDocumentActions.openFile honours an explicit slot override (defaulting to slotRef.current, so single-chat and member-DM hosts are unchanged); and usePanelTabs.openFile routes the tab into the bucket KEYED by that slot (bucketKey(slot)), not the strip's bound key — so the tab's bucket and its stamped slot are the same session and the tab does not vanish when a different pane becomes active. This matches the existing openView named-slot contract. Tests pin the cross-bucket route. Keep the base's inert-card / inert-chip a11y contract from kirodotdev#13855: a file card / mention chip with no onFileOpen handler stays a non-clickable span whose tooltip + sr-only text is the localized "can't be opened here" sentence (attached_file_inert, restored across all 13 locales), not the bare path. Drop the dead ChatEmbedProps.onFileOpen passthrough: neither real ChatEmbed host supplies a viewer (First Principles). Co-authored-by: aniruddhaadak80 <127435065+aniruddhaadak80@users.noreply.github.com> --------- Co-authored-by: ANIRUDDHA ADAK <aniruddhaadak80@gmail.com> Co-authored-by: kirocrew-worker <worker@kirocrew.local> Co-authored-by: aniruddhaadak80 <127435065+aniruddhaadak80@users.noreply.github.com>
…ect (kirodotdev#14141) * fix(llm_helpers): steer the in-band host-deny notice before every reject (kirodotdev#5403 slice 1) Every host deny in llm_helpers -- reject-all / read-only policy, an always-deny pattern hit, a missing title, a hook deny, a withheld headless name grant, and the tool-free background one-liner -- now awaits the shared deny_notice.steer_refusal_notice (via a thin _steer_host_deny that redacts the reason) immediately before reject_tool, so a steer-capable backend learns in the same turn that the HOST blocked the call instead of reading kiro-cli's "User denied tool execution". The one genuine user rejection (interactive_rejected) stays bare. supports_steer False is byte-identical to before. Each site names its cause. A safety rule judging the call itself (scan hit, hook deny, withheld name grant) is DENY_CAUSE_POLICY, whose notice carries class remediation. The surface refusing the call (reject-all, read-only, tool-free one-liner) is the new DENY_CAUSE_SURFACE_POLICY: no remediation, because keying it off the model's own title on a surface where no tool can run would hand out a sanctioned command that cannot run there. The empty title is DENY_CAUSE_INVALID_NAME. The SEL audit row precedes the steer and the reject at every site (audit-first, as the chat runner already does). Cancellation mid-steer schedules a shielded, strongly referenced reject_tool and awaits it under the shared steer bound before re-raising, so a stranded permission cannot wedge the backend and a stalled pipe cannot turn the caller's timeout into a hang. Tests: a source-level guard over every reject_tool( in the module (steer within 8 lines, audit before the steer, explicit cause at every steer, exactly one allowlisted user rejection), one behavioural test per deny reason with a provider double recording steer/reject order and the cause-specific wording, capability-gate, redaction and remediation suppression tests, and two cancellation tests (audit-first survives; stalled reject does not hang). * fix(llm_helpers): let a failed deny audit raise before the wire; surface cause for withheld grants Every deny in _resolve_permission and the background one-liner audits through the module's one raising funnel. An audit that cannot be written raises before the steer and the reject, so a deny is never answered on the wire without its SEL row; the caller's own deadline bounds the unanswered request. Approvals audit the same way after approve_tool. The headless name-grant refusal steers as DENY_CAUSE_SURFACE_POLICY: the grant was the only approver and this surface has none, and the host-authored reason carries no rule identity, so the policy wording would anchor its remediation on the model's own tool title alone. Tests: the audit-failure cases assert a raise with nothing sent on the wire in both funnels; the source walker asserts no audit call sits under a try and that the module has exactly one audit funnel; the withheld grant asserts the surface clause and no remediation.
… listener (kirodotdev#14960) `config.loader.read_local_secret` and its ~16 callers resolved the gateway credential by PORT alone. A port names a SET of listeners, so on a host where a gateway holds one loopback family and a co-resident (or an `ssh -L` forward's local end) holds the other, the port-keyed read could return a credential published for a listener the caller is not dialing — disclosing this machine's gateway credential, which authenticates against the real gateway. kirodotdev#13929 published `run/gateway-<port>-<address>.secret` per bound address and taught the desktop app's `listenerSecretsFor` to read it, but explicitly deferred every Python reader to this issue. This adds `run_marker.read_listener_secret(port, host)` — the Python twin of the JS predicate (family coverage + cross-family intersection) — and threads a `dial_host` through `read_local_secret`. A caller that names its dial host reads the address-keyed entry and FAILS CLOSED when listener entries exist for the port but none covers the family it reaches. It falls back to the port-keyed read only for a gateway that published no listener entry at all (a pre-per-listener gateway), where nothing else claims the port. Every reader that builds a loopback URL now passes its host: cli_server, mcp_core, mcp_shared, mcp_cron, cron_trigger, cron_script, computer_use/screencast, cli_commands, app_lifecycle_client, and the Sage review driver. Fixes kirodotdev#14102. Co-authored-by: kirocrew-agent <agent@kirocrew.local>
…r read (kirodotdev#15039) The compare-and-clear race test released its rebinder inside the compare, but once the clear dropped the map lock nothing ordered the rebinder against the route's own post-clear read, so a descheduled rebinder left the answer at relinked: false on a loaded runner. Hold the durability wait until the re-link has landed, and pin the descheduled ordering with a stalled rebinder. Closes kirodotdev#15026
kirodotdev#14314) A Markdown link such as [Python](https://en.wikipedia.org/wiki/Python_(programming_language)) is valid CommonMark: a destination may hold a balanced pair of parentheses. The Slack, Telegram and WhatsApp renderers ended the URL at its first ")", so the link opened a page that does not exist and a stray ")" trailed the label. iMessage refused parentheses and left the markup raw. Every renderer now builds its destination from one shared unit, constants.md_link_destination(): one URL character, or a "(...)" group of them, one level deep. A backslash and the character after it are one token, so an escaped "[" or backslash stays whole and a backslash before a parenthesis is refused. A "[" that opens a nested "[label](" is refused, so the inner link renders on its own and the outer text stays as written, while a "](" that opens no link stays part of the URL. An unbalanced "(", a second level of nesting or an escaped "\)" leaves the link as written instead of linking a cut URL. The unit is the grammar outbound_files walks to find local image files, bounded to one level; wherever it matches it ends at the walker's ")", and a test pins this. Slack's destination also excludes "|" and ">", which would end or split its <url|label> form, and every renderer's link label excludes "[", "]" and line breaks, as the screen's does. The display-safety screen collapses each link to its label so the credential scan reads what the reader sees, and a wider link match drops more URL text from that scan. So besides the literal text and the renderers' own grammar, the screen always scans four readings that model no single client: Telegram's plain-text fallback, applying that fallback's own fence, inline-code, heading, "**", "__" and link passes in its order with lone delimiters kept; each link closed at its balanced ")" at any depth, as a CommonMark reader such as Discord closes it; each link closed at the first ")", as a lazy reader closes it; and no link parsing at all, so a key split by markup inside a URL is still scanned. Telegram's renderer imports the fallback passes from the screen, one definition for both. Each converted Slack block, and the joined message, is also scanned as the Slack client displays it and settled until that view shows no key. A key found in any reading is answered with the collapsed, redacted form, which carries no URL, and that answer is itself scanned under every reading. Collapsing can itself close a link ("[AKIA]*(u)" reads as "[AKIA](u)" once the "*" is gone), so rewritten text is collapsed and scanned again until a pass changes nothing, for at most four passes; past that it strips markup outside redaction tags and collapses and scans once more. A cut splitting a long message, each boundary of a message rotated into several, and a cut's repair are graded under the same readings as one message, and the repair always runs with the channel's own cutter. Text with no "](" is graded under the canonical form and the plain fallback only, since each link reading equals the canonical form there.
…dotdev#15042) resolve_wire_model_id matched a stored id against advertised ids only by normalized key, so it never matched when the claude adapter advertised a bare family alias ("fable", "opus") instead of the dotted provider id a session had stored. The stored id went out unchanged, which the adapter does not serve. When the key compare misses, accept an advertised id that is a version-less alias of the stored id's own registry entry. Versioned aliases are excluded because an entry also lists substitution aliases (claude-haiku-4.5 under Sonnet); an adapter advertising one serves a different model, and folding onto it would send the wrong model. Co-authored-by: clarezoe <460084+clarezoe@users.noreply.github.com>
…irodotdev#15081) Two Windows-only cases in test/test_apps_registry_coverage.py fail on main itself (confirmed on 86cec58 and current df0ea79), with no PR involved, blocking the Windows CI shard on multiple open PRs. This fixes the first. _contained_join resolves an untrusted, index-controlled subdirectory under a clone root and returns it only if it stays inside the root -- the defense-in-depth companion to the lexical _is_safe_registry_subdir gate, so a hostile clone containing e.g. `sub -> /etc`, or a self-pointing `pkg -> pkg` loop, cannot smuggle a read or a write outside the root at use time (see the leaf-symlink guard in install.py::_unpoison_rejected_checkout). It relied on Path.resolve() raising on a symlink loop. That holds on POSIX -- non-strict resolution re-raises ELOOP as RuntimeError -- but NOT on Windows: non-strict resolve lexically collapses a self-pointing reparse point WITHOUT walking it, so a `pkg -> pkg` loop resolved to a path that still passed the is_relative_to containment check and was handed back as "contained". A caller would then read or write THROUGH the loop. The CI Windows runner proved it: _contained_join returned a WindowsPath under the temp root instead of None. Fix: after the textual containment check, re-resolve the target with strict=True to force the OS to actually walk it. A loop (the link exists, so it is not FileNotFoundError, and walking it raises on both platforms) fails closed to None. A merely-missing path raises FileNotFoundError and keeps the pre-existing contract of returning the contained path, because the rollback path re-checks containment of app.json AFTER it has been removed and needs a contained path back for the restore to proceed. POSIX is unchanged: a loop still raises at the first non-strict resolve and never reaches the new block. The loop test now asserts None on both platforms -- correct BECAUSE of this fix, not because the platforms were already the same; the old win32 branch was describing the bug. Verified on Python 3.12 (matching CI): all 380 tests in the module pass, including the three TestUnpoisonRejectedCheckout tests that a naive blanket strict=True broke (the missing-path contract they depend on). The depth-60 case in the same file is a SEPARATE gate-disagreement, addressed in a follow-up commit on this branch. Co-authored-by: kirocrew-agent <agent@kirocrew.local>
….0-1.0 Sync with kirodotdev/KiroCrew main (2675 upstream commits). Upstream's architecture wins; fork features are re-applied on top: - providers: router env injection (provider_base_url, keyring key, OPENCODE_API_FORMAT) now keys on the claude/opencode backend, so upstream's own acp_backend=claude gets it too; legacy agent.provider=claude_code|opencode still selects that backend. - claude backend: fork router model pin moved into upstream's _render_claude_settings_payload (the fork's own writer was shadowed by upstream's same-named method and never ran). - opencode: fork isolation/HOME redirect only when a custom endpoint is injected; upstream's native opencode backend otherwise. - vision, shim, keyring, bridge, hardening fixes re-applied. - security.py / subagent admission moved to packages upstream; the curl/wget pipe-to-shell regex fix is ported to security/denied_rules.py; the fork's subagent recursion guard is dropped (upstream now supports bounded nested spawns with child reserves). Bugs fixed while resolving: - electron main.js did not parse on fork main (duplicate imports, stray catch) -> rebuilt from upstream + fork additions. - committed conflict markers in 5 docs files. - config schema: vision_providers referenced an unimported name, turning every schema field into "string". - agent.provider enum silently stripped claude_code/opencode. - session_allocation text-only resume guard used an undefined logger. - auto-update download links dropped arch and deb/rpm format. Baselines, model registries, pseudolocale and settings registry regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
One helper (kiro_crew/claude_auth.py) now decides the env a claude-agent-acp session is spawned with: - No base URL + no key: nothing injected, so the Claude Pro/Max login from `claude /login` is used. Previously an ambient ANTHROPIC_API_KEY or CLIPROXY_API_KEY in the gateway env was always injected, silently moving a subscription user to API billing (or sending a router key to api.anthropic.com). - `claude setup-token` tokens (sk-ant-oat...) are passed as CLAUDE_CODE_OAUTH_TOKEN, so a headless gateway can use a subscription. - Custom endpoint: Claude Code's background/subagent models (ANTHROPIC_DEFAULT_*_MODEL, ANTHROPIC_SMALL_FAST_MODEL, CLAUDE_CODE_SUBAGENT_MODEL) are pinned to the chat model so a router is never asked for a Haiku/Sonnet id it does not serve. - agent.use_shim with an empty base URL points the claude backend at the built-in shim; turning the shim on is the whole setup. Fixes: - shim used the provider key (env/keyring) instead of its own configured shim_openai_api_key. - shim non-streaming responses had type "response" instead of "message"; tool_choice, stop_sequences, top_p and tool_result is_error were dropped; streaming never reported input_tokens; backend 400/404/413/429 were all turned into retryable 502s. - provider test probed /v1/v1/models for base URLs ending in /v1. - doctor flagged a subscription login as "will fail with 401"; it now prints the active Claude auth mode and also covers acp_backend=claude. - a fork regression test predates upstream's owner-gated config writes. Settings -> Chat -> Provider gains "Claude subscription (Pro/Max)" (default) and "Anthropic API key" presets with hints. New guide: docs/guides/claude-code.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
…spellings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
Upstream's provider-identity contract forbids "claude_code" literal comparisons in converted files; the doctor and model-list fork paths reintroduced two. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
- set_model: the fork's "not advertised -> fall back" guard ran before upstream's effort-pair typing, so on codex (which advertises model[effort] pairs) a bare model id was refused. Pair-id backends are exempt; _push_model_config_option resolves them. - test_cc_models_endpoint.py had `import json` above `from __future__`, a SyntaxError since before this sync: none of its tests ever ran. - test_context_widget_block.py: the merge kept a stale fork line; take upstream's content assertions. - Provider reloads are driven by the live config watcher; its key set is now module-level PROVIDER_RELOAD_KEYS and includes agent.use_shim (which now changes the claude backend's endpoint). The fork test that expected the PATCH handler itself to reload is retargeted at that set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
Upstream now requires every own-server tool to carry a Tool.title from data/mcp_tool_titles.json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
…ime pin The fork's copy carried UTF-8 re-exec asserts pasted into unrelated tests (13 ctypes-layout tests failed on a missing PYTHONUTF8) and a probe test that could never import its module. Rebased on upstream's file; kept the one stub the fork's POSIX identity check needs and added a test that a recycled or unreadable PID is never signalled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
… the session tree - messaging.delivery_is_muted: the fork had flipped it to fail CLOSED, so any session-store hiccup silently swallowed every channel reply (the Telegram /new and /unlink recovery tests caught it). Back to upstream's fail-open: a noisy muted chat is visible, a dead one is not. - transcribe.py: the fork's copy re-declared an older block that overrode upstream's signer-rewritten ffmpeg set with arm64 only, so a signed x86_64 macOS release would refuse its own decoder. Upstream's file already carries the fix. - The vision describer spawns an agent on a session's behalf; it now gets that session's shared scratch (client, session handle and both MCP entry points), so an image saved under $KIROCREW_SCRATCH is readable and upstream's spawn-seam contract holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
…ut token Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
- Remove pages/developer/FeaturePreviewsTab.tsx: upstream moved it into
Settings > Developer; the fork had resurrected the dead copy, whose two
catalog keys no longer exist (i18n key gate).
- dynamic-keys baseline back to upstream's.
- Provider/vision/shim settings keys and the new Claude hints translated
into all 11 catalogs (catalog parity).
- Pull-request panel CLI hint, Dev Fleet and Workflows manifest copy take
upstream's {{productName}} / current wording in every catalog; the
stale productName exception is dropped.
- Tests that hard-coded upstream's repo URL or product label now read the
fork's constant / catalog value; the rail-registry test renders the
Provider page with a backend that has URL/key rows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
WalkthroughWarning Review details and warnings were omitted to fit the comment limit. |
Security Scope Review -- 🔴 could not complete (fails closed)No scope verdict for |
…build Same change as ci/manual-build-only, applied to the sync branch so the sync does not bring the automatic triggers back. Every workflow keeps only workflow_call/workflow_dispatch; build-desktop-fork.yml is manual-only. Two CI-watchdog tests that assert triggers exist now fail by design. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
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.
Problem / Motivation
Goal: Bring the fork up to upstream KiroCrew v0.9.0 (
0.9.0-1.0) and make Claude and Claude Code work with every way a user signs in.main(base018c9ecf3).mainwere found while syncing, the most visible being that the desktop app'smain.jsdid not parse.Why it matters
maincannot start.Not a goal
What changed (motivation → approach → change)
Sync
The merge commit is
2fc429641. Upstream's architecture wins, and fork features are re-applied on top of its newagent_sdk/backends,security/andsubagent_manager/admission/packages.claudeandopencodebackends.Claude and Claude Code
kiro_crew/claude_auth.pydecides one set of rules for the Claude backend's environment:claude /login)ANTHROPIC_API_KEYorCLIPROXY_API_KEYno longer overrides it.claude setup-tokentoken (sk-ant-oat…)CLAUDE_CODE_OAUTH_TOKEN, so a headless gateway can use a subscription.ANTHROPIC_API_KEY.ANTHROPIC_BASE_URLand the key. Background and subagent models (ANTHROPIC_DEFAULT_*_MODEL,ANTHROPIC_SMALL_FAST_MODEL,CLAUDE_CODE_SUBAGENT_MODEL) are pinned to the chat model.agent.use_shimwith no base URLtype: "message"tool_choice,stop_sequences,top_pand tool errorsdoctorprints the active Claude auth mode.docs/guides/claude-code.md.Bugs fixed
main:main.jsdid not parseagent.provider=claude_code|opencodetest_cc_models_endpoint.pywas a SyntaxError, so it never ranvision_analyzehad no tool title/v1/v1/modelsFeaturePreviewsTab.tsxBackwards compatibility
Compatible:
agent.provider=claude_code|opencodeconfigs still work, and now validate.ANTHROPIC_API_KEYin the gateway's environment is no longer forwarded to Claude Code unless a base URL is configured. Set the provider key (config, keyring orKIROCREW_PROVIDER_API_KEY) to use an API key on purpose.Tests
test/test_claude_auth.py: the auth modes, factory wiring and shim translationtest_platform_compat.pywebsite/src/test/providerPresets.test.tsgh/rg).tsc -b: clean.Manual verification
Still needed; the container cannot do these:
claude /login,setup-token, an API key, and the shim against Ollama.Screenshots / video
None attached. This PR changes the Settings → Chat → Provider page (new presets and a hint line), and I could not capture screenshots from the build container.
Related Issues
N/A
Pattern harvest
Rule candidate: review-prompt
Pattern: after a sync merge, diff every fork-touched file against upstream for duplicated or spliced blocks (re-declared constants, asserts pasted into unrelated tests, resurrected deleted files). Most of this PR's regressions had that shape.
Checklist
docs/guides/claude-code.md)🤖 Generated with Claude Code
https://claude.ai/code/session_01ATqnFbQ5QTnwwAcdoDbgCE
Generated by Claude Code