Repository navigation
Conversation
GPT 6.1 Review (fork) —
|
First Principles Review (Opus 5.5, fork) —
|
Opus 5.5 Review (fork) —
|
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) —
|
Security Scope Review (fork) — 🔴 BLOCK (blocking)Which legitimate operations does no leg reported, and this was not the nothing-to-adjudicate short circuit No |
79f6391 to
1a801c3
Compare
|
Rebased onto |
1a801c3 to
9ced455
Compare
|
Rebased onto The floor this PR depends on is now |
9ced455 to
795c96d
Compare
|
The other reds on |
aed119f to
28cac77
Compare
|
Fixed the split-induced all-shard collection failure on |
|
Rebased onto |
28cac77 to
d67fc72
Compare
…ev#3795) Part 1 of the kirodotdev#18595 split. It carries the platform half of kirodotdev#3795: the helpers the atomic skill candidate claim and promotion path publishes and verifies with, and nothing that uses them yet. platform_compat gains rename_no_replace, a path-taking adapter over the native no-replace rename that fails closed with ENOTSUP where the host has no such primitive, opened_file_identity and opened_path_identity_matches, which compare an already-open file or directory by device and inode on POSIX and by native volume and file id on Windows, open_path_no_reparse and unlink_path_if_identity, which delete exactly one opened Windows entry whose native identity still matches, and the Win32 structures those read. platform_lock_compat gains prepare_lock_file, which seeds the one inert byte msvcrt locking needs on an empty dedicated lock file. pinned_fs.scan_tree_pinned accepts optional entry and depth budgets enforced while the listing is consumed. The tests cover the identity comparison on both platforms including the FileIdInfo and legacy-id split, the no-replace adapter's refusal of an occupied destination, the lock-file seeding, and the descriptor-bound directory sync ignoring a substituted path. The link-screen baseline declares the one new screen-then-resolve site, and the platform-compat spec documents the two identity helpers.
…ev#3795) Part 1 of the kirodotdev#18595 split. It carries the platform half of kirodotdev#3795: the helpers the atomic skill candidate claim and promotion path publishes and verifies with, and nothing that uses them yet. platform_compat gains rename_no_replace, a path-taking adapter over the native no-replace rename that fails closed with ENOTSUP where the host has no such primitive, opened_file_identity and opened_path_identity_matches, which compare an already-open file or directory by device and inode on POSIX and by native volume and file id on Windows, open_path_no_reparse and unlink_path_if_identity, which delete exactly one opened Windows entry whose native identity still matches, and the Win32 structures those read. platform_lock_compat gains prepare_lock_file, which seeds the one inert byte msvcrt locking needs on an empty dedicated lock file. pinned_fs.scan_tree_pinned accepts optional entry and depth budgets enforced while the listing is consumed. The tests cover the identity comparison on both platforms including the FileIdInfo and legacy-id split, the no-replace adapter's refusal of an occupied destination, the lock-file seeding, and the descriptor-bound directory sync ignoring a substituted path. The link-screen baseline declares the one new screen-then-resolve site, and the platform-compat spec documents the two identity helpers.
…ev#3795) Part 1 of the kirodotdev#18595 split. It carries the platform half of kirodotdev#3795: the helpers the atomic skill candidate claim and promotion path publishes and verifies with, and nothing that uses them yet. platform_compat gains rename_no_replace, a path-taking adapter over the native no-replace rename that fails closed with ENOTSUP where the host has no such primitive, opened_file_identity and opened_path_identity_matches, which compare an already-open file or directory by device and inode on POSIX and by native volume and file id on Windows, open_path_no_reparse and unlink_path_if_identity, which delete exactly one opened Windows entry whose native identity still matches, and the Win32 structures those read. platform_lock_compat gains prepare_lock_file, which seeds the one inert byte msvcrt locking needs on an empty dedicated lock file. pinned_fs.scan_tree_pinned accepts optional entry and depth budgets enforced while the listing is consumed. The tests cover the identity comparison on both platforms including the FileIdInfo and legacy-id split, the no-replace adapter's refusal of an occupied destination, the lock-file seeding, and the descriptor-bound directory sync ignoring a substituted path. The link-screen baseline declares the one new screen-then-resolve site, and the platform-compat spec documents the two identity helpers.
…ev#3795) Part 2 of the kirodotdev#18595 split. It carries the candidate claim and promotion path of kirodotdev#3795: every promotion, dismissal and unattended apply first captures the pending generation through authenticated no-follow reads, records its digest in a held claim lock, renames the public directory into a hidden quarantine and publishes only from a fresh private materialization of the captured bytes. Updates publish the complete live tree with no-replace renames and keep the replaced generation as permanent public evidence. Restart recovery consumes, re-queues or retains each claim by exact digest and native identity. The private authority lives at tag-grants/auto-skill-private, beneath a directory every Kiro Crew sandbox already masked, so no new deny leaf, mask or spawn check is added. All auto-skill locks follow one documented order, skills.AUTO_SKILL_LOCK_ORDER: slug claim, claim, target, namespace. skill_runtime/auto_skills stages the candidate beneath the pinned pending parent and takes the target lock inside the slug claim lock, skill_runtime/versions numbers the snapshot from the captured live generation, and constants names the authority directories. Nothing provisions the authority yet: gateway startup, the standalone CLI commands and the dashboard, Slack and consolidation surfaces arrive in part 3. The test conftest models that startup lazily so every existing suite keeps its behaviour.
…tdev#3795) Part 3 of the kirodotdev#18595 split. It wires the surfaces of kirodotdev#3795 onto the claim and promotion path part 2 shipped. Gateway startup provisions or certifies the auto-skill private authority once, before any loader or session, and keeps serving with auto-skill staging and promotion disabled when that refuses. kirocrew consolidate and kirocrew run attempt the same certification, and kirocrew skills authority-retire moves an idle authority aside under the gateway lock. A prose-only update to an existing auto-skill is applied without review when the operator opts in with skills.auto_apply_updates on top of approval_required=false. Disabling approval alone still stages every update. An update whose supplied scripts all failed validation is rejected when it would be applied unattended and staged as prose when update review is on. Consolidation skips skill detection wherever staging and promotion are off. The dashboard raises a Skill auto-updated notification for an unattended apply, and a dismissal, delete or pin the authority rule refuses answers a coded 409 instead of a 404 or 400.
…dev#3795) Part 4 of the kirodotdev#18595 split. It carries the spec text of kirodotdev#3795 for the code parts 2 and 3 shipped. memory-skills-hooks.md documents the staged-approval contract: the separate skills.auto_apply_updates opt-in, the recovery-pending outcome and its lifecycle exemption, the bounded claim scans, the rename-probe cleanup, the canonical text hashing at staging and apply, and the all-invalid-script rule applied to updates. cli.md documents what kirocrew consolidate and kirocrew run do with the authority certification and adds the kirocrew skills authority-retire row. security.md records that the auto-skill publication authority lives beneath the already masked tag-grants directory, adds no deny leaf or mask of its own, and never refuses a spawn.
|
Refreshed onto |
|
Rebased onto |
|
Now
The PR's test files plus |
|
Rebased onto |
|
Rebased onto |
|
Rebased onto
The fork workflows still wait for a maintainer to approve them. |
A prose-only update to an existing auto-skill can now be applied without review when the operator opts in with skills.auto_apply_updates on top of approval_required=false; disabling approval alone still stages every update. An update whose supplied scripts all failed validation follows the kirodotdev#7617 rule: rejected when approval is off, staged as prose when it is on. Every promotion, dismissal and unattended apply first captures the pending generation through authenticated no-follow reads, records its digest in a held claim lock, renames the public directory into a hidden quarantine and publishes only from a fresh private materialization of the captured bytes. Updates publish the complete live tree with no-replace renames and keep the replaced generation as permanent public evidence; restart recovery consumes, re-queues or retains each claim by exact digest and native identity. The private authority lives at tag-grants/auto-skill-private, beneath a directory every Kiro Crew sandbox already masked, so no new deny leaf, mask or spawn check is added and an authority problem never refuses an agent spawn. Gateway startup provisions it; a refusal only disables auto-skill staging and promotion. Hosts whose agents run in a sandbox Kiro Crew does not build never get an authority (fail-closed default). All auto-skill locks follow one documented order, skills.AUTO_SKILL_LOCK_ORDER: slug claim, claim, target, namespace. Fixes kirodotdev#3795
|
Rebased onto main
Checks:
|
|
Thanks for this work, @rubencu. Closing this whole-change reference PR, since it has been split into the stacked series for #3795, which is where review continues:
The branch and history stay available here, and this can be reopened if the reference is needed again. |
Problem / Motivation
Goal: Prose-only updates to existing auto-skills can be applied without review when the operator opts in, and every candidate promotion consumes or restores exactly the authenticated generation it inspected.
With
skills.approval_required=false, safe prose-only updates to existing auto-skills still required manual approval, and there was no way to opt into applying them unattended. Candidate promotion also mutated private claim state before proving the private root was agent-denied, while rejection restoration reserialized metadata and changed CRLF bytes on Windows.Why it matters
Users who opt out of approval and also opt into unattended updates should receive safe prose improvements without granting unattended execution to script-bearing candidates; turning approval off alone must not widen what it already meant. Promotion and recovery must consume or restore exactly the authenticated generation, never mutate an untrusted root first, inspect a public replacement, or normalize rejected candidate bytes.
Not a goal
skills.auto_apply_updatessetting. It is set withkirocrew config set.What changed (motivation → approach → change)
Goal: let an operator who disabled review receive prose-only skill improvements, without letting an agent approve its own candidate and without widening what
approval_required=falsealready meant.Approach: every promotion first captures the public pending generation through authenticated no-follow reads, records its digest in a held claim lock, renames the public directory into a hidden public quarantine, and publishes only from a fresh private materialization of the captured bytes. The private authority lives at
tag-grants/auto-skill-private, beneath thetag-grantsdirectory Kiro Crew masks on Linux and macOS, and it is provisioned or certified only while that protecting mask actually applies. Every authority-backed use rechecks the live sandbox mode and revokes the process certificate withsandbox_offif the mode changes to off. The alternative this replaces, a dedicated deny leaf with its own mask, needed spawn-time materialization and verification, which turned an auto-skill problem into a refused agent spawn.skills.auto_apply_updates(default false) applies a prose-only update whenapproval_required=falseandauto_refine_on_deviation=false. Turning approval off alone still stages every update. A successful apply keeps the previous version under.versions/, runs the lifecycle pass with the target exempt, and raises a Skill auto-updated notification.approval_required=false,auto_apply_updates=true, refinement off), an update whose supplied scripts all failed validation is rejected withall_scripts_rejected; whenever update review is still on, including approval off withauto_apply_updatesoff, it is staged as prose for review as before (history_consolidation._stage_skill_update), as fix(skills): respect disabled approval setting #7617 does for new candidates.skills_auto_pinning.py,skills_auto_authority.py,skills_auto_locks.py,skills_auto_snapshot.py,skills_auto_claims.py, andskills_auto_promotion.py, bound through theskills.pyfacade): capture, quarantine, private materialization, prepared journal, no-replace publication of the complete live tree, exact-inode refusal restore, and restart recovery that consumes, re-queues, or retains each claim by exact digest and tagged native identity.skill_runtime/auto_skills.stage_skill_candidatekeeps the one-slug-space allocator from fix(skills): coordinate live and pending auto-skill slug claims #12970 and now writes the candidate beneath the pinned pending parent;create_auto_skillandrestore_auto_skilltake the target lock inside the slug claim lock;skill_runtime/versionspicks the snapshot number from the captured live generation. The facade members for create/update/delete/pin/inject/archive take the per-target lock.*_checkedvariants keep main'sPendingApprovalRefusedvocabulary: advisory read-only prechecks refuse early with the reason, and the claim path notes reasons (stale_base,target_missing,live_exists,kind_mismatch,invalid_layout,script_validation_failedwith its report) for refusals that happen after the claim.promotion_disabledis new.credential_mask_applies(configured_sandbox_mode()). Every authority-backed entry rechecks that predicate; a live mode flip to off revokes the process binding and recordssandbox_off, distinct from delegated and unavailable-mask refusals. Agent spawning remains independent of authority state.pending.lock. An enumeration or identity failure aborts the entire attempt, auditsactive_claim_indeterminate, and retracts the detection marker for retry instead of interpreting the slug as unclaimed.recovery_pending=trueand SEL recordsauto_apply_committed_recovery_pending; the prepared claim journal durably exempts the live target from inactivity and max-count archival until restart recovery retires the claim. The immediate lifecycle pass now runs on this outcome, advances its throttle only on success, and a later retry reads the same persisted exemption. The exemption mirrors what restart recovery can do to a live tree: only an authenticated prepared or evidence journal naming the target exempts it. A valid journal that cannot be opened or authenticated makes every target indeterminate until its authenticated publication target can be read, because the candidate slug is untrusted and need not resemble an update target; lifecycle logs the exact journal and stopped-process restart recovery. Per-target scoping resumes only for a journal that was read and authenticated. A crash-orphaned.rename-probe-*file or other non-claim name exempts nothing. Restart recovery skips probe files and unlinks a bounded number per pass once their modification time shows them orphaned, and stale-authority inspection no longer counts them as claims in flight.kirocrew consolidateandkirocrew runattempt the same certification as gateway startup, once, before constructing mutation-capable collaborators. As on the gateway, a refusal never stops the command: the initializer records the reason, every staging and promotion path refuses, memory consolidation and the task proceed, and one stderr notice says so whenskills.auto_create_from_sessionsis on._run_skill_detectiontreatsauto_skill_promotion_disabled_reason() is not Noneas auto-skill creation off for the run: no aux model call, no candidate that could only be lost, no detection marker advanced.auto/name folds onto the canonical slug lock its first component reaches (NFKC, case folding, trailing dots and spaces stripped); a name no promotion can target under any spelling (auto/Persist_Me) is mutated by name as before the protocol instead of refused, so a plantedalways: trueskill stays deletable, pinnable and toggleable. For canonical names, lock-free by-name mutation and dismissal are granted only when an unmasked gateway or operator process observestag-grants/auto-skill-privateabsent on the selected data home, or while that process freshly re-proves the data-home-wide no-replace refusal. A process carrying the Kiro Crew sandbox marker or confirmed by the macOS kernel as Seatbelt-confined can see an empty maskedtag-grantswhile the real authority exists, so it treats root absence and a fresh probe as indeterminate, requires the hidden target lock, and refuses mutation with the in-sandbox reason when that lock cannot be acquired. Root existence is re-read on every call. With a root present in every other state, every mutation takes the authority-backed target lock even after sandbox mode turns off; an uncertified process fails closed rather than bypassing a lock a certified process may already hold. The r3b host-wide sandbox predicates now shape only startup logging, the retirement hint, and which retirement path runs. On a mask-less host with an existing root, the single startup warning and refused mutation namekirocrew skills authority-retire: the operator stops every gateway and agent on that home, and the command takes the gateway lock and moves the authority root plus record aside under one.stale-<token>suffix. The ungatedself-protection-skills-authority-retireargv floor (commit fe170cc on fix(security): denykirocrew skills authority-retirefrom an agent shell #4533, landing first) denies that command through an agent shell with no catalog opt-out. Once an unmasked process observes the root absent, by-name mutation and explicit dismissal resume. The obsolete authority spellings remain first-creation checks only and are inert after the real authority exists._auto_skill_sandbox_excludes_every_promoter()holds (delegated sandboxing, effectiveagent.sandboxoff, no sandbox backend), no process on the data home can be certified, soauthority-retiremoves the root aside without trusting it, as the startup reseed does for a stale record. A home moved bycp -a, rsync or a backup restore (stale provenance) and a valid root whoseevidence/or public quarantine outgrew the stale-state scan both retire, and a planted always-on skill becomes removable again. Idleness comes from activeclaims/alone, with one bounded scan; a claim journal there, or an overflow, refuses with the manual recovery. Wherever a promoter could exist, retirement still verifies provenance and identities first, and an unverifiable root refuses with the unchanged stopped-installation handoff.FILE_SHARE_DELETEforbids renaming that directory, so both retirement paths release the root pin before the renames and re-check the root by native identity at each one..quarantineor.live-quarantinename is history only beside the privateevidence/entry of the same name, andevidence/leaves with the root._move_authority_asidetherefore renamesskills/auto/.quarantine/andskills/auto/.live-quarantine/aside under the root's.stale-<token>suffix on both retirement paths, so a fresh root provisioned after a retire no longer inherits 1,025 orphaned names that made staging and recovery refuse forever. Nothing is deleted:kirocrew skills authority-retireprints every set-aside path and how to requeue a candidate left there, and a failed rename or sync renames every entry already moved back, the record included._pending_slug_claimedand_recover_abandoned_claimsskip a public quarantine name whose claim already retired into privateevidence/before it counts toward_ACTIVE_CLAIM_SCAN_LIMIT. Every promotion, dismissal and TTL prune leaves one such name forever, so counting them froze staging for every slug, and stopped recovery from requeuing interrupted claims, after 1,025 lifetime claims. Names without evidence (including any planted ones) still count and still make the verdict indeterminate.dashboard/handlers/prompts_skill_pending.py, minimal edit).dismiss_pending_skill_checkedraisesPendingDismissalRefused("promotion_disabled")when the candidate is still staged, by-name dismissal is not ruled in, and the process holds no authority certificate.api_skill_pending_dismissmaps it to 409pending_dismissal_refusedwithdetail=auto_skill_promotion_disabled_reason()and the retirehintwhere it applies, audited asrejected. The unsuffixeddismiss_pending_skillkeepsFalsefor every other caller.dashboard/handlers/prompts_skill_edits.py, minimal edit).delete_skill_checkedandset_pinned_checkedraiseLiveSkillMutationRefused("promotion_disabled")when the liveauto/skill is still there, its name takes the authority-backed target lock, by-name mutation is not ruled in, and the process holds no authority certificate.DELETE /api/skills/{name}andPOST /api/skills/-/pinmap it to 409skill_mutation_refusedwith the samereason,detailandhint, auditedrejected, instead of 404not foundand 400not an auto-skill or not found. A skill that is gone keeps its 404 and 400.delete_skillandset_pinnedkeep returningbool; the three handler test doubles that stood in fordelete_skillnow stand in fordelete_skill_checked.self-protection-skills-authority-retireargv floor that denieskirocrew skills authority-retirethrough an agent shell (one matcher insecurity/argv_floor.py, its rule row and reason insecurity/denied_rules.py, itsis_deniedregistration and facade export, its entry in the security spec's ungated-floor list, and the security package line budget raised to the measured 29,224), is commit047556b8509e15aa99a2ba342171f593df05257don the fork branchsecurity/skills-authority-retire-floor, kept on fix(security): denykirocrew skills authority-retirefrom an agent shell #4533 for a maintainer to land from a repository branch. This PR touches no path the Sensitive Change Review names. Merge order: that floor first, then this PR, so the retire command never ships without the floor that makes it operator-only.create_auto_skill(whichapproval_required=falsepublishes through) returnsNone, and TTL pruning removes nothing, so a pre-upgrade candidate stays visible for a future supervised migration; an explicit dismissal still removes it.cp -a/rsync host move, regeneratedtoken_signing.key, renumbering remount) is reseeded at startup only after public.quarantine/and.live-quarantine/names and privatelocks/claims/names correlate with stale private evidence. When the private authority root is missing, startup still bounded-scans both public quarantine directories and treats every entry as in flight because no private evidence remains to prove retirement; only empty public quarantine permits fresh provisioning. Any unmatched name, including the pending-to-quarantine crash window before private claim materialization, refuses reseed with the exact recovery steps.os.scandirunder_STALE_CLAIM_SCAN_LIMIT; overflow is indeterminate, names the breached bound, disables auto-skills, and does not delay gateway readiness with an unbounded walk. Staging streams only slug-matching claim identities and returns the existing retryable indeterminate result once more than_ACTIVE_CLAIM_SCAN_LIMITunconsumed names are seen. Restart recovery scans a bounded active namespace across private claims and both public quarantines, drops names retired by private evidence before they count, and refuses the pass with the exact overflow reason instead of materializing and sorting permanent history.platform_lock_compat.prepare_lock_file;pinned_fs.scan_tree_pinnedgains entry and depth budgets; the skills parent sync uses main'satomic_write.fsync_open_dirrather than a helper of its own.sandbox.pyandsecurity/paths.pychange comments only: no new deny leaf, mask, materialization, or spawn check.run_gatewayprovisions or certifies the authority once, before any loader or session, only when the protecting mask applies. A refusal is logged and the gateway keeps serving with auto-skill staging and promotion disabled. Certification stays on the readiness path deliberately, so no agent this gateway spawns runs before the obsolete-spelling and stale-state checks; its work is bounded and listed beside_STALE_CLAIM_SCAN_LIMIT(a few lstats, one provenance read and MAC, at most six bounded directory scans only for a stale record, provisioning syncs, one rename probe).test_fresh_root_swap_after_provenance_sync_refusesnow carriesrequires_renamable_pinned_directory, a capability probe, because a Windows pin omitsFILE_SHARE_DELETEand refuses the injected rename before any swap exists, and production never creates the authority on Windows. (c) The doubles now behave like the hosts they stand in for: native Windows keeps the realpin_directoryandopen_file_no_reparse(the CRT cannot open a directory), the native rollback test creates the roots it pins, identity mismatches stay in their own encoding (a native 128-bit id flips a bit instead of passing throughint()), the stat double keepsst_file_attributes, the fallback claim stages with the host's realdir_fdcapability, the staging tamper writes by public name,_WinEntrydelegates the rest ofos.DirEntry(is_junction), the shim opens a link throughO_SYMLINKwhere there is noO_PATH(macOS), and the POSIX descriptor-identity test pins its branch. The macOStest_mcp_gateway_backend_recordred is base-owned: this change touches nothing it imports.Backwards compatibility
Breaking: auto-skill staging, approval, unattended apply, and unreviewed direct publication need a certified private authority protected by the live Kiro Crew credential mask, so they refuse where none exists or where the configured sandbox mode changes to off. A mode flip to off revokes the process certificate and reports
sandbox_offbefore the next authority-backed operation. Live mutation and claim-based dismissal take the same authority lock whenever an unmasked boundary observestag-grants/auto-skill-privatepresent; an agent-sandboxed or Seatbelt-confined process treats the masked view as indeterminate and requires that lock even when the root appears absent. An uncertified process fails closed rather than racing a certified process. They retain by-name behavior only when an unmasked process observes that root absent or freshly re-proves the data home's no-replace refusal. The same staging refusal applies on native Windows and on macOS with the Kiro CLI internal sandbox (fail-closed default, pending maintainer confirmation), a gateway whose startup refused (a data home that, when its authority is first created, still holdsskills/auto/.privateor a top-levelauto-skill-privatefrom an earlier revision of this change, a data home whose filesystem has no atomic no-replace rename, or a stale authority record with a claim in flight), and a process that never runs authority initialization. A stale authority record with no claim in flight is reseeded at startup instead of refusing. On a mask-less host with an existing root,kirocrew skills authority-retiremoves the root and record aside after the operator stops every gateway and agent, without trusting an unverifiable root there because no process on that home can be certified; elsewhere it verifies first. The ungatedself-protection-skills-authority-retireargv floor denies that command through an agent shell with no catalog opt-out, restoring by-name mutation without deleting evidence. A dismissal the authority rule refuses while its candidate is still staged answers 409pending_dismissal_refusedinstead of 404; the Skills tab renders it through its existing uncoded dismiss-failure copy. A liveauto/delete or pin the same rule refuses while the skill is still there answers 409skill_mutation_refusedinstead of 404 and 400; retirement also moves the publicskills/autoquarantines aside with the root. Wherever staging refuses, consolidation skips skill detection and TTL pruning removes nothing.skills.auto_apply_updatesis a new key defaulting false, so an approval-off install keeps staging updates as it does today; every other key and file main accepts is still accepted. Writer sweep on origin/main @ ffd9136: the auto-skill writers arehistory_consolidation(stage new/update, direct publish), the dashboard pending handlers (approve, dismiss),prune_pending, and the live-mutation members (create/update/delete/pin/inject/archive/restore); each is listed below.Reader: src/kiro_crew/history_consolidation.py:HistoryConsolidator._stage_skill_update -- chat -- without authority staging returns None and is audited
creation_failed; with it, unchanged unlessauto_apply_updatesis on; an update whose scripts all failed is rejected only when it would be auto-applied (TestDelegatedSandboxFailsClosed, test_disabled_approval_alone_never_auto_applies_an_update, test_update_whose_scripts_all_failed_stays_reviewable_while_update_review_is_on)Reader: src/kiro_crew/history_consolidation.py:HistoryConsolidator._run_skill_detection -- chat -- wherever staging and promotion are off, detection is skipped with no aux model call and no marker, while memory consolidation proceeds (test_consolidation_still_runs_on_a_delegated_host)
Reader: src/kiro_crew/history_consolidation.py:HistoryConsolidator._process_auto_skills -- chat -- direct publish of a NEW prose skill with approval off is off under the same gate as staging (test_unreviewed_publication_is_off_under_the_same_gate)
Reader: src/kiro_crew/dashboard/handlers/prompts_skill_pending.py:api_skill_pending_approve -- crew page --
promotion_disabledreturns the coded 409 with the reason (test_approve_refusal_vocabulary_is_fully_classified)Reader: src/kiro_crew/dashboard/handlers/prompts_skill_pending.py:api_skill_pending_dismiss -- crew page -- dismissal runs by name only when an unmasked process observes the authority root absent or freshly re-proves the no-replace refusal; an in-sandbox view treats both verdicts as indeterminate, and with an authority possible it takes the lock and fails closed if the process cannot authenticate it; a candidate still staged when that refusal happens answers 409
pending_dismissal_refusedwith the reason and retire hint, auditedrejected, while a missing candidate keeps its 404 (test_unmasked_root_absence_still_grants_by_name_mutation, test_in_sandbox_root_absence_and_fresh_no_replace_probe_both_refuse_mutation, test_masked_authority_view_never_proves_real_root_absent, test_startup_refuses_a_filesystem_without_no_replace_rename, test_dismiss_refused_by_the_authority_rule_is_a_coded_409_not_a_404, test_dismiss)Reader: src/kiro_crew/dashboard/handlers/prompts_skill_edits.py:api_skill_detail -- crew page -- a canonical
auto/live mutation takes the authority lock while its root exists and resumes by name after verified operator retirement; a name no promotion can target still runs by name, and an alias spelling waits on its canonical target lock; a delete that rule refuses while the skill is still there answers 409skill_mutation_refusedwith the reason and retire hint, auditedrejected, while a missing skill keeps its 404 (test_existing_authority_never_grants_lock_free_mutation_when_sandbox_turns_off, test_operator_retire_moves_verified_idle_authority_and_restores_by_name_mutation, test_a_planted_non_canonical_auto_skill_stays_deletable, test_an_alias_spelling_waits_on_the_canonical_target_lock, test_delete_and_pin_refused_by_the_authority_rule_are_coded_409s)Reader: src/kiro_crew/dashboard/handlers/prompts_skill_edits.py:api_skill_pin -- crew page -- a pin the authority rule refuses while the skill is still there answers 409
skill_mutation_refused, auditedrejected; a missing or non-auto skill keeps its 400 (test_delete_and_pin_refused_by_the_authority_rule_are_coded_409s, test_pin_roundtrip)Reader: src/kiro_crew/skill_runtime/auto_skills.py:prune_pending -- chat -- prunes nothing while staging and promotion are off (test_pre_upgrade_candidates_survive_ttl_pruning)
Reader: src/kiro_crew/cli_knowledge.py:_consolidate_cmd -- release -- attempts certification once; a refusal keeps consolidation running with skill detection off and one notice when auto-skill creation is on, while the list-only form remains read-only (test_standalone_consolidation_certifies_before_staging, test_consolidation_still_runs_on_a_delegated_host, test_standalone_refusal_is_silent_when_auto_skills_are_off)
Reader: src/kiro_crew/cli_server.py:_run_task -- release -- after validating the spec exists and loading config, attempts certification once before constructing sessions, stores, lifecycle writers, or the consolidator; a refusal keeps the task running with one notice when auto-skill creation is on (test_authority_is_certified_before_task_state, test_authority_refusal_keeps_the_task_running, test_authority_refusal_is_silent_when_auto_skills_are_off)
Reader: src/kiro_crew/cli_knowledge.py:_skills_cmd -- release --
kirocrew skills authority-retireholds the gateway lock; on a host where no process can be certified it moves an unverifiable root aside once activeclaims/is empty, elsewhere only verified idle authority state, retaining the exact root, record and public.quarantine/.live-quarantinedirectories under one stale token, so a later fresh root starts with no claim history, and holding no pin on the root it renames (test_authority_retire_cli_holds_the_gateway_lock, test_authority_retire_cli_reports_a_root_retired_without_a_record, test_operator_retire_moves_verified_idle_authority_and_restores_by_name_mutation, test_maskless_retire_sets_aside_an_unverifiable_root_without_trusting_it, test_maskless_retire_ignores_retired_history_past_the_scan_bound, test_masked_host_retire_refuses_an_unverifiable_root_with_the_exact_handoff, test_maskless_retire_refuses_a_claim_in_flight_and_names_the_manual_recovery, test_simulated_windows_retire_holds_no_pin_on_the_root_it_renames, test_retire_sets_quarantine_history_aside_so_a_fresh_root_stages_again, test_a_failed_quarantine_set_aside_restores_every_retired_entry, TestSelfProtectionFlagInterposition)Reader: src/kiro_crew/skills.py:SkillsLoader._pending_slug_claimed -- chat -- staging counts only unconsumed public quarantine names toward the active-claim bound, so claim history never refuses a slug while planted names still make it indeterminate (test_consumed_quarantine_history_never_exhausts_the_active_claim_bound, test_unconsumed_quarantine_names_still_bound_the_active_claim_scan)
Reader: src/kiro_crew/skills.py:SkillsLoader.list_pending_skills -- crew page -- a candidate's
nameis now its directory name, which equals the metadata name for every candidate staging writes (test_skills_custom_fixture_drives_live_and_pending_readers)Tests
Current validation on
8f463d5372(two commits directly onccb5d34645): main’sskills.pyandhistory_consolidation.pycomposition roots are preserved. Auto-skill authority, locking, snapshot, claim, and promotion behavior lives in six focused owner modules, each below 2,000 lines; history auto-apply behavior lives inhistory_consolidation_skills.py. Main’s #20844 splitcli.pyinto parser registrars and mirror owners, so_skills_cmdand the standalone authority certification in_consolidate_cmdlive incli_knowledge.py, theskills authority-retireparser incli_parser_agent.register_skills_parser, andcli.pykeeps the dispatch branch, the registrar call, andTYPE_CHECKINGnames for the two skills functions the owner imports. The skill-versioning tests remain a scoped package with every file at most 1,711 lines.platform_compat.rename_no_replace, which nothing called, is removed with its four tests, and the spec’s live-missing restore sentence names the pinned no-replace rename the code performs (_rename_skill_child_no_replace). Main’s #21347 folded the three nested_restore_redactedclosures inskills_review.pyinto one module-level helper; this PR removes in-place candidate redaction, the helper’s only use, soskills_review.pycarries no restore helper. The four test files this change formats (test_consolidate_cmd.py,test_skill_pending.py,test_skill_pending_notify.py,test_skill_update_flow.py) are black-clean, so they leave.github/black-baseline.txt; the baselined Black gate refuses a clean file that is still listed. Main’s #21438 splittest_history.pyby class, and this PR’s history test edits moved with their classes intotest_history_auto_skills.pyandtest_history_consolidator.py, each of which defines the_initialize_skills_authorityhelper. This PR no longer changestest_history.py, which keeps its baseline row. Main’s #21416 splittest_platform_compat.pyby topic; this PR’s added platform tests stay intest_platform_compat.pywith only hunk context moved. Main’s #21549 splitdashboard/handlers/prompts.pyintoprompts_*owners behind a_facade_mirrorfacade: the refused-dismissal 409 and itsPendingDismissalRefusedimport moved intoprompts_skill_pending.py, and the refused delete and pin 409s, theLiveSkillMutationRefusedimport and the_live_skill_mutation_refusedhelper intoprompts_skill_edits.py, directly aboveapi_skill_pin;prompts.pykeeps only the facade’sTYPE_CHECKINGmanifest lines for those three names. Main’s #21464 movedTestRunGatewayintotest_slack_gateway_run.py, and this PR’s three startup tests moved with it, so this PR no longer changestest_slack_gateway.py. Those five files are byte-identical to #19429’s resolution, which carries the same hunks. The PR’s test files plustest_frontmatter.py, the CLI split contract tests, everytest_platform_compat_*.pyandtest_history_*.pytopic module, the prompts handler and facade tests and main’s newtest_consolidation_lesson_semantic_reroute.pypassed 6,973 tests (39 skipped), andtest_slack_gateway.pywith itstest_slack_gateway_*.pytopic modules passed 1,038. On this head, baselined Black, isort, Flake8, mypy, line-cap, docs, comment-history, brand-name, subprocess-encoding, sync-I/O-in-async, harness-parity and diff pass, as do the flake-pattern and wait-discipline ratchets and the max-two-commit push guard.Ran on head
07f5c68bac, one commit ona1974e202287.test/test_skills_authority_retire_floor_link.py(4 tests): the CLI dispatches exactlyskills authority-retireto_skills_cmd, and the operator hint names the same path; once the floor is on the base,is_deniedand the floor predicate deny exactly that command (and notkirocrew skillsorskills list), and the floor id is in the ungated set with no catalog row and a note naming the command. The two floor-bound tests skip on a base without the floor, with the merge order as the reason, so a rename on either side fails a test once both halves coexist.test_skill_pending.py: main's document-cap fixture helper sizes its SKILL.md against the staged bytes. This change stages the generated content as UTF-8 bytes through the pinned new-file writer with no newline translation, so the on-disk length is the encoded length on every platform; the text-modeos.linesepexpansion the helper assumed made the fixture 12 bytes short on Windows.Round 8 (the first native-Windows and macOS CI run of this change, on fix(security): deny
kirocrew skills authority-retirefrom an agent shell #4533's head09f2d7096ee8, failed twelve tests (eleven PR-added, one base-owned); the test-side fixes landed in fix(security): denykirocrew skills authority-retirefrom an agent shell #4533'seca89293adand ran green on Windows on4aec9b8622, the head this PR was carved from): new Linux doublestest_simulated_windows_identity_mismatch_refuses_untouched(both mismatch cases with native 128-bit ids) andtest_simulated_windows_linked_dismissal_on_macos_open_flags(the shim withoutO_PATH), plus a_WinEntrycompleteness assertion. Against a clean archive of the previous head, scratch doubles reproduced five of the CI errors on Linux (int()of a 16-byte id for both mismatch cases,_WinEntrywithoutis_junctionin the walkshutil.rmtreeruns on Windows,False is Trueunder macOS open flags, a bytes id compared with an int inode), and all five pass on this head. Pinning roots that were never created reproduces the rollback test'sWinError 2as a missingskillsroot on Linux, and the setup step the test now runs makes the same pin succeed. Native Windows and macOS were never run locally: on4aec9b8622CI's Windows shards passed with these fixes, and the macOS shards' only failure wastest_mcp_gateway_backend_record.py::test_reap_kills_a_real_term_ignoring_group_and_spares_a_recycled_one(PermissionError, not a file this change touches, the same runner-environment failure as on09f2d7096ee8); CI's shards on this PR are the oracle. The gate files (test_skill_pending,test_skill_versioning,test_platform_compat*,test_security_gate_liveness,test_denied_commands_security,test_security_facade,test_security) passed 4,039 tests, 37 skipped. The owning set passed 5,552 tests, 36 skipped, with the onestatic/distdashboard boot-chain failure classified below, which the unmodified head reproduces once that local build is present.Round 6 (retirement sets the public quarantine history aside; refused live delete and pin): 80 collected node ids, asserted nonempty before expansion; 20/20 shuffled runs green at
-n 0and 10/10 green at-n 4 --dist loadgroup --max-worker-restart=2, each under a 600-second timeout with its own order and log.test_retire_sets_quarantine_history_aside_so_a_fresh_root_stages_again(masked and mask-less) plants consumed history past the active-claim bound in both public quarantines, retires, re-enables the sandbox and restarts certification: both quarantines are found intact under the root's token, nothing is deleted, and a fresh root stages, inspects and requeues an interrupted claim.test_a_failed_quarantine_set_aside_restores_every_retired_entryfails the last rename and finds the root, record and both quarantines back under their own names.test_delete_and_pin_refused_by_the_authority_rule_are_coded_409spins both 409s, their SEL rows, the surviving skill and the unchanged 404 and 400. Mutation proof, each restored: leaving the quarantines in place turns the history test red on both paths and makes a fresh root refuse staging (active-claim inspection was indeterminate, verdictNone) exactly as the review reproduced; dropping the rollback leaves the root missing; the handler calling the unchecked delete (404 == 409) or pin (400 == 409), or a classifier that never raises (404 == 409), turns the 409 test red. The owning, denied-command, security-facade and prompts-handler set passed 13,769 tests, 46 skipped, with the same 10test_cli.py::TestDoctor*host-probe failures as on base.Round 5b (retirement, active-claim bound, refused dismissal): 44 collected node ids, asserted nonempty before expansion; 20/20 shuffled runs green at
-n 0and 10/10 green at-n 4 --dist loadgroup --max-worker-restart=2, each under a 600-second timeout with its own order and log.test_maskless_retire_sets_aside_an_unverifiable_root_without_trusting_it(home moved, key regenerated, record missing) andtest_maskless_retire_ignores_retired_history_past_the_scan_bound(1,025 evidence or public quarantine names) reproduce the reviewer's two triggers and prove a planted always-on skill becomes deletable;test_masked_host_retire_refuses_an_unverifiable_root_with_the_exact_handoffkeeps the masked-host text exact;test_simulated_windows_retire_holds_no_pin_on_the_root_it_renamesmodels the missingFILE_SHARE_DELETEon both paths;test_consumed_quarantine_history_never_exhausts_the_active_claim_boundstages and requeues past 1,025 consumed names whiletest_unconsumed_quarantine_names_still_bound_the_active_claim_scankeeps 1,025 planted names indeterminate;test_dismiss_refused_by_the_authority_rule_is_a_coded_409_not_a_404pins the 409, its SEL row and the unchanged 404. Mutation proof, each restored: verify-first under exclusion turns 7 retirement tests red; reading retired history under exclusion turns both history cases red; holding the root pin across the renames turns the simulated-Windows case red on each path; counting consumed names turns the history test red in staging (None is False) and, separately, in recovery (candidate not requeued); calling the unchecked dismissal or never raising turns the 409 test red (404 == 409). The owning, denied-command, security-facade and prompts-handler set passed 13,765 tests, 46 skipped; its 10test_cli.py::TestDoctor*failures fail identically on a pristine base worktree (host doctor probes). That set also exposedtest_security_gate_liveness::test_the_package_stays_within_its_line_budget, red on the previous head and green on base, now re-pinned with its reason.Round-five masked-view boundary: 6 collected node ids, asserted nonempty before expansion; 20/20 shuffled runs green at
-n 0and 10/10 green at-n 4 --dist loadgroup --max-worker-restart=2, each under a 600-second timeout with its own order and log.test_masked_authority_view_never_proves_real_root_absentcovers both the launcher marker and kernel-confirmed Seatbelt state with a real authority hidden behind an emptytag-grantsview;test_unmasked_root_absence_still_grants_by_name_mutationretains the operator-side r4 behavior;test_in_sandbox_root_absence_and_fresh_no_replace_probe_both_refuse_mutationproves neither masked absence nor a masked fresh probe grants mutation. Removing the root guard made both masked-view cases red (False is True); removing the fresh-probe guard made its regression red (True is False). Both guards were restored before the final runs. The owning, denied-command, and security-facade set passed 11,947 tests, 43 skipped.Round-four regression set: 37 collected node ids, asserted nonempty before expansion; 20/20 shuffled runs green at
-n 0and 10/10 green at-n 4 --dist loadgroup --max-worker-restart=2, each under a 600-second timeout with its own order and log. The owning and complete denied-command/security-facade set passed 9,091 tests, 43 skipped.Round-four mutation proof, each restored afterwards: restoring candidate-name inference for an unreadable journal turns
test_an_unreadable_valid_claim_journal_exempts_every_lifecycle_targetred (2 == 0archived); granting lock-free mutation while the authority root exists turnstest_existing_authority_never_grants_lock_free_mutation_when_sandbox_turns_offred; forcing the simulated-Windows fixture's delegated predicate to true turnstest_simulated_windows_opened_identity_pins_delegation_falsered.Environment classifications, verified by the Opus lane against clean git archives:
test_the_dashboard_boot_keeps_its_chain_hooks_and_orderfails only when the dirty worktree's locally builtwebsite/distis linked into the packaged static path; clean archives of base and head both pass.test_auto_improvement_members::test_assignments_build_real_context_from_only_their_private_storeis inherited and identical on base because an agent-session basetemp under the crew scratch is classified as a sensitive path. The 10test_workflows_private_executionerrors are inherited and identical on base because this venv has pytest-asyncio 1.4.0 while the repository pins 0.20.3, and 1.4.0 supplies noevent_loopfixture.Standalone CLI coverage:
test_standalone_consolidation_certifies_before_stagingdrives a realSkillsLoaderthroughkirocrew consolidateand stages after certification;test_consolidation_still_runs_on_a_delegated_hostdrives the real initializer, consolidator, transcript and loader on a delegated host and proves the command completes, memory consolidation advances the transcript, no skill prompt is issued, no candidate exists, no detection marker is set, and exactly one notice is printed.kirocrew runkeeps the task running on a refusal (test_authority_refusal_keeps_the_task_running), and both commands stay silent when auto-skill creation is off.Round-two focused regressions (persisted lifecycle exemption, call-time cross-process fallback, quarantine/lock correlation, bounded stale scan, facade composition): 16 tests, 5/5 repeat runs green at
-n 4. The owning and conftest-dependent set collected 8,042 tests: 8,000 passed, 41 skipped, with the same one inherited stale-static/distdashboard boot-chain failure described below.Round-three final regressions (missing-root public quarantine correlation, bounded claims and quarantine streaming, bounded recovery refusal, the existing I/O-indeterminate path): 7 tests, 20/20 repeat runs green at
-n 0and 10/10 green at-n 4in shuffled argument order. The required owning and conftest-dependent set passed 7,723 tests, 42 skipped on the final rebased head.Round-three mutation proof, each restored afterwards: restoring the missing-root
else []shortcut turns bothtest_missing_private_root_refuses_public_quarantinecases red by reseeding; restoring eagerlistdirin_pending_slug_claimedturnstest_pending_slug_claim_scan_consumes_only_limit_plus_onered by returning false without consuming the bounded scanner; restoring eager recovery listings turnstest_recovery_scan_overflow_is_bounded_and_indeterminatered without consuming or reporting the bounded public-quarantine scan.Mutation proof, each restored afterwards: restoring the CLI early exit, or removing the detection gate, turns
test_consolidation_still_runs_on_a_delegated_hostred; refusing a name with no canonical fold turnstest_a_planted_non_canonical_auto_skill_stays_deletablered; dropping the alias fold turnstest_live_names_fold_onto_their_canonical_target_lockandtest_an_alias_spelling_waits_on_the_canonical_target_lockred; re-adding the per-operation obsolete-root check turnstest_an_obsolete_root_planted_after_startup_blocks_nothingred; removing thecreate_auto_skillgate or the prune gate turnstest_unreviewed_publication_is_off_under_the_same_gateortest_pre_upgrade_candidates_survive_ttl_pruningred; never reseeding turns all fourtest_a_stale_idle_authority_is_reseeded_at_startupcases red, and reporting no live claims turnstest_a_stale_authority_with_a_claim_in_flight_refuses_with_exact_recoveryred; reverting the update rule turns bothtest_update_whose_scripts_all_failed_stays_reviewable_while_update_review_is_oncases red; dropping the retired-evidence filter or the startup probe turnstest_recovery_skips_retired_evidence_without_opening_its_lockortest_startup_refuses_a_filesystem_without_no_replace_renamered.Round-two mutation proof, each restored afterwards: dropping the claim-backed lifecycle exemption archives the committed live generation and turns
test_recovery_pending_target_stays_lifecycle_exempt_until_claim_retiresred; restoring the cached-startup-refusal shortcut turnstest_startup_refusal_does_not_override_root_absence_after_mode_flips_backred; ignoring public quarantine correlation turnstest_stale_reseed_refuses_unmatched_in_flight_state[public-only]red by reseeding; removing the named scan bound turnstest_bounded_stale_claim_scan_consumes_only_limit_plus_onered.Earlier rounds' mutation proof still holds: removing the live mask recheck made
test_live_mode_flip_off_revokes_the_next_promotionfail withDID NOT RAISE PendingApprovalRefused; restoring fail-openreturn Falsemadetest_active_claim_inspection_io_failure_aborts_stagingfail by stagingauto/indeterminate-active-claim.New behaviour pinned in earlier rounds:
test_sandbox_off_has_a_distinct_refusal_and_never_provisions,test_live_mode_flip_off_revokes_the_next_promotion,test_gateway_certifies_authority_when_the_protecting_mask_applies,test_active_claim_inspection_io_failure_aborts_staging,test_auto_apply_reports_committed_update_when_consumption_needs_recovery,test_committed_auto_apply_with_pending_recovery_is_reported_as_live, the bounded concurrent-promotion barrier, and the three_floor_monkeypatchautouse fixtures. The composition signature pins now match the members earlier rounds changed (_promote_pending_update,_pending_slug_claimed,auto_apply_pending_update).Gates: baseline-aware Black, touched non-baselined Black, full isort, full Flake8, mypy (2,199 source files), subprocess encoding, sync-I/O-in-async, harness parity, brand, comment-history, docs lint,
git diff --check, added-line path/host/inclusive-language scans, and the denial differential (44 classified golden paths allowed at both refs, no regressions). After patch-id-identical rebases as main moved,push_guard --base main --require-single-on-basereports SAFE TO PUSH (single commit on base). The model half of the fork security-scope review is not runnable locally.Design questions
tag-grantsmask, sonamespace_argvandsandbox_exec_argvneither materialize nor verify it; a missing, refused or obsolete authority disables auto-skill promotion and never refuses an agent spawn. Pinned byTestAutoSkillAuthorityNeverGatesASpawn(no certificate, an obsolete nested root under a symlinkedskills/, an older static mask already hiding the late authority).skills/auto/.privatemarking its ancestors (item 2). The leaf is no longer a deny-floor entry at all: authority moved undertag-grants, a single-component leaf already on the floor, sopath_contains_sensitive()is false for<home>/skillsand<home>/skills/auto. The obsolete spelling is a refusal input of the skill code only (test_auto_skill_authority_rides_the_tag_grants_fence).approval_required=falsewidening (item 3). Updates need the separateskills.auto_apply_updatesopt-in; the existing switch keeps its meaning (test_disabled_approval_alone_never_auto_applies_an_update).auto/.live-quarantine/<claim>is permanent evidence and never a cleanup target, so a write that lands after the last hash survives (test_a_late_write_to_the_old_live_generation_survives_publication_cleanup, plus the rollback-path tests).TestDelegatedSandboxFailsClosed). This round applies the 2026-09-18 option 1 ("disable auto-skill staging/promotion until authority was provisioned") consistently, as the reading of the pending platform contract this change takes, also pending maintainer confirmation: the unreviewedapproval_required=falsepublication path (create_auto_skill) is off under the same gate and reports through the sameauto_skill_promotion_disabled_reason(), so the less safe configuration no longer keeps a feature the reviewed one lost; consolidation skips skill detection rather than generating candidates nothing can stage; and TTL pruning removes nothing, so candidates queued before the upgrade stay visible for a future supervised migration instead of being deleted unreviewed.skills.AUTO_SKILL_LOCK_ORDER: slug claim (.auto-slug-claim.lock) → claim → target → pending namespace. Every path takes a left-to-right subsequence (test_every_auto_skill_path_takes_its_locks_in_the_one_documented_order).skills.pyapprove_pending_update_checked,preview_pending_update,stage_skill_candidate,_read_pending_meta,get_pending_skill, and the composition pins;skill_runtime/auto_skills.stage_skill_candidate,dismiss_pending_skill,update_auto_skill;skill_runtime/authoring.update_skill,set_pinned,set_inject_on_trigger;skill_runtime/versions.py; andhistory_consolidation._stage_skill_update. Locks: feat(skills): audit pending and live overlap (#11311) #11323's in-process_auto_skill_mutation_lock(name)(a per-nameRLock) and this change's cross-process_live_auto_mutation_lock(name)→locks/target-<slug>.lockguard the same writers; whichever lands second should take one at thetargetposition ofAUTO_SKILL_LOCK_ORDERor replace it. Metadata: feat(skills): audit pending and live overlap (#11311) #11323'sbase_digest/_live_body_digestand this change'sbase_content_hash/canonical_skill_text_hashboth hash the live body with CRLF folded to LF, and feat(skills): audit pending and live overlap (#11311) #11323's.versions/restage-<slug>.sha256record would sit inside the whole-tree generation this change hashes and publishes.test/link_screen_sites.pylists 24 new screen-then-resolve sites (23 inskills.py, one inplatform_compat.unlink_path_if_identity). Each refuses on a link rather than traversing one, and most act inside the masked private authority.auto/<slug>missing for by-name readers._auto_apply_staged_updateleaves a candidate in the queue with no bell.kiro_internal_sandbox_enabled()is re-read per spawn while the delegation gate was startup-only. Verified covered: every authority-backed use callsrequire_auto_skill_private_authority, which re-readssandbox.spawn_delegates_masking()and through it the uncachedkiro_internal_sandbox_enabled(), so turning the internal sandbox on after startup revokes the certificate before the next stage or promotion (test_turning_on_a_delegated_sandbox_after_startup_revokes_the_next_promotion).skill_mutation_refusedthroughdelete_skill_checkedandset_pinned_checked, following thedismiss_pending_skill_checkedprecedent, sodelete_skill(name) -> bool, its signature pin and its link-screen site are unchanged. The refusal is classified outsidedelete_skill, after it returnedFalse, from the same predicates the lock decision reads; a reserved-namespace spelling is not anauto/name there, so it still reads as not found.test/conftest.pyonly. No suite undersrc/kiro_crew/apps/builtins/*/testsconstructs aSkillsLoaderor reaches an auto-skill path, so none needs it.skills/auto/.quarantine/stages its next candidate under a-Nsibling, because that evidence can no longer be authenticated against the moved-aside authority. The existing pin that a lockless quarantine entry reserves its slug is kept.evidence/, public.quarantine/, public.live-quarantine/and retained claim locks still grow without bound. The startup stale-state scan still countsevidence/and the public quarantines, so a stale record on a masked host past 1,024 lifetime claims still refuses reseed and needs the manual recovery. A pruning policy for names whose public inode is provably quiescent is not built here. Operator retirement setsskills/auto/.quarantine/andskills/auto/.live-quarantine/aside under the root's own.stale-<token>suffix, so a fresh root provisioned after a retire starts with empty history and nothing is deleted; the retire output names every set-aside path. The startup reseed of a stale record (_set_aside_stale_authority) still leaves both public quarantines in place: it reseeds only below_STALE_CLAIM_SCAN_LIMIT, so it orphans at most that many names, but they then count toward the same-sized active-claim bound until retention exists, and its manual-recovery text does not ask the operator to move them.pending_dismissal_refusedthrough the existing uncoded dismiss-failure message; the response carriesdetailandhintfor a follow-up catalog entry._pinned_parent_matcheslikely aborts the promoter)lexistsfails open rather than closed outside the sandbox case (r5 covers the in-sandbox case)f1841eac):tag-grantsis under a masked prefix. Confidence: low — dev harness only.test_a_failed_quarantine_set_aside_restores_every_retired_entry). Candidates 4, 5, 7 and 8 are unchanged.Manual verification
N/A — no rendered UI changes; deterministic tests cover concurrency, restart recovery, notification, platform and sandbox behaviour. Native Windows behaviour (
FileIdInfo,MoveFileWno-replace,msvcrtlock seeding) is exercised by simulation here and needs the Windows CI leg on the replacement head.Related Issues
Fixes #3795
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.