Skip to content

feat(skills): approval surfaces for atomic claims (part 3/4 of #3795) - #19429

Closed
rubencu wants to merge 3 commits into
kirodotdev:mainfrom
rubencu:split/3795-3-approval-surfaces
Closed

rubencu wants to merge 3 commits into
kirodotdev:mainfrom
rubencu:split/3795-3-approval-surfaces

Conversation

@rubencu

@rubencu rubencu commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: An operator who disabled review can opt into receiving prose-only skill updates unattended, every Kiro Crew process certifies the auto-skill authority the way the gateway does, and a refusal of the authority rule reaches the dashboard as a coded 409 instead of a 404.

With skills.approval_required=false, a safe prose-only update to an existing auto-skill still waits for manual approval, and nothing lets an operator apply it unattended. Part 2 of this series (#18595 split) shipped the claim and promotion protocol and its private authority, but nothing provisions that authority, so on part 2 alone staging and promotion stay off. The dashboard also reports a dismissal, delete or pin the authority rule refused as 404 or 400, which tells the operator the skill is gone while it is still there.

This is part 3 of 4 of #18595, bolichen97's ruling of 2026-10-12. Stack: #19410 -> #19427 -> PR3 (this) -> #19431 docs and specs. #18595 stays open as the whole-change reference.

Stacked on #19427: the diff shows PR1's and PR2's commits (2ce645b4c3, 636e185628) until they merge: #19410's head cd12c94a90 replayed onto current main, the same patch, and the head of #19427. GitHub refuses a fork branch as the base of a PR into kirodotdev, so the PR targets main. This part's own change is the one commit abc94b1a26.

Why it matters

Users who opt out of approval and also opt into unattended updates should receive prose improvements without granting unattended execution to script-bearing candidates, and turning approval off alone must not widen what it already meant. Every process that can stage or promote (gateway, kirocrew consolidate, kirocrew run) has to certify the authority at the same boundary, or the fail-closed default of part 2 is a feature that never turns on. A refusal that surfaces as "not found" costs an operator a wrong diagnosis.

Not a goal

What changed (motivation → approach → change)

Goal: wire every surface onto the part 2 protocol with one certification boundary per process and one refusal vocabulary.

Approach: the surfaces are carried from commit 7fa433e33c on #18595. Each process certifies once at startup, before it constructs a loader or consolidator, and a refusal never stops the process: the initializer records the reason, every staging and promotion path refuses, and the rest of the work proceeds.

  • Gateway startup (slack/gateway_runtime/process_entry.py): run_gateway provisions or certifies the authority once, before any loader or session, and logs the refusal and keeps serving when it cannot. Certification stays on the readiness path so no agent this gateway spawns runs before the stale-state checks.
  • Standalone CLI (cli_knowledge.py, cli_parser_agent.py, cli.py, cli_server.py, cli_help.py): kirocrew consolidate and kirocrew run attempt the same certification before constructing mutation-capable collaborators and print one stderr notice on a refusal when skills.auto_create_from_sessions is on. kirocrew skills authority-retire takes the gateway lock and moves an idle authority root, its record and the public quarantines aside under one .stale-<token> suffix, printing every set-aside path and deleting nothing.
  • Unattended updates, separate opt-in (config/memory_sections.py, config/section_builders.py, config-baseline.json, history_consolidation_skills.py): skills.auto_apply_updates (default false) applies a prose-only update when approval_required=false and auto_refine_on_deviation=false. Disabling approval alone still stages every update. _stage_skill_update stages with notification suppressed, captures the candidate binding, and _auto_apply_staged_update promotes through auto_apply_pending_update, runs the lifecycle pass with the target exempt, and audits auto_applied_update, auto_apply_committed_recovery_pending or auto_apply_failed. An update whose supplied scripts all failed validation is rejected with all_scripts_rejected only when it would be applied unattended and is staged as prose whenever update review is on, the rule fix(skills): respect disabled approval setting #7617 set for new candidates.
  • Consolidation skips detection while auto-skills are off (history_consolidation_skills._run_skill_detection): where auto_skill_promotion_disabled_reason() is set there is no aux model call, no candidate that could only be lost and no detection marker, so the window is judged once creation is available again.
  • Dashboard (dashboard/handlers/prompts_skill_pending.py, dashboard/handlers/prompts_skill_edits.py, dashboard/server.py, dashboard/server_runtime/skill_learning.py): api_skill_pending_dismiss calls dismiss_pending_skill_checked and maps PendingDismissalRefused to 409 pending_dismissal_refused. DELETE /api/skills/{name} and POST /api/skills/-/pin call delete_skill_checked and set_pinned_checked and map LiveSkillMutationRefused to 409 skill_mutation_refused, each with reason, detail and the retire hint, audited rejected. A skill that is gone keeps its 404 and 400. set_update_auto_applied_hook raises a Skill auto-updated notification for an unattended apply, the one record the operator sees that a live skill changed. The pending notification reads has_scripts is True so an unknown value is not reported as scripts.
  • Tests moved forward from the part 2 map with the code they test: the two cli._skills_cmd tests in test_skill_versioning.py, test_skill_write_guard.py and test_skill_write_territory_guard.py (handler doubles stand in for delete_skill_checked), test_dashboard_pinned_write_migration.py, and the new test_skills_authority_retire_floor_link.py, which holds the CLI path, the operator hint and the floor id equal.

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. The same refusal applies on native Windows and on macOS with the Kiro CLI internal sandbox (fail-closed default, pending maintainer confirmation on #18595), a gateway whose startup refused, and a process that never runs authority initialization. A dismissal the authority rule refuses while its candidate is still staged answers 409 pending_dismissal_refused instead of 404. A live auto/ delete or pin the same rule refuses while the skill is still there answers 409 skill_mutation_refused instead of 404 and 400. skills.auto_apply_updates is a new key defaulting false, so an approval-off install keeps staging updates as it does today.

Reader: src/kiro_crew/history_consolidation_skills.py:_stage_skill_update -- chat -- unchanged unless auto_apply_updates is on, an update whose scripts all failed is rejected only when it would be auto-applied (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_skills.py:_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/dashboard/handlers/prompts_skill_pending.py:api_skill_pending_dismiss -- crew page -- a candidate still staged when the authority rule refuses answers 409 with the reason and retire hint, audited rejected, a missing candidate keeps its 404 (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 and api_skill_pin -- crew page -- a refused delete or pin answers 409 skill_mutation_refused, a missing or non-auto skill keeps its 404 and 400 (test_delete_and_pin_refused_by_the_authority_rule_are_coded_409s, test_pin_roundtrip)
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, the list-only form stays 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 -- attempts certification once before constructing sessions, stores and the consolidator, a refusal keeps the task running (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-retire holds the gateway lock and prints every set-aside path (test_authority_retire_cli_holds_the_gateway_lock, test_authority_retire_cli_reports_a_root_retired_without_a_record)
Reader: src/kiro_crew/slack/gateway_runtime/process_entry.py:run_gateway -- release -- the authority initializes after boot_platform and before GatewayOrchestrator on every platform, and a refusal never stops the gateway (test_authority_initializes_before_orchestrator_on_every_platform, test_maskless_existing_authority_logs_one_retire_hint)

Tests

On db794425bc (three commits on main 1f033607bd). That is the same patch as this head (patch ID 8e34973093f0) before its replay onto main 7796e2af52, whose one newer commit touches none of this series' files. Run with PYTHONPATH=src python -m pytest -q -p no:cacheprovider:

  • Parts 1 to 3's owning set (part 2's set plus test_cli_server_more_coverage*.py, test_cli_server_facade.py, test_consolidate_cmd.py, test_dashboard_pinned_write_migration.py, test_dashboard_server_composition_contract*.py, test_history.py, test_history_consolidation_facade.py, test_history_consolidator.py and the CLI split contract tests): 7,205 passed, 922 skipped (880 of them the website-dependent test_skillform_frontmatter_parity.py). test_slack_gateway.py with every test_slack_gateway_*.py topic module: 1,048 passed.
  • test_skill_update_flow.py pins the opt-in, the all-invalid-script rule on both sides of update review, the recovery-pending outcome and the detection skip. test_consolidate_cmd.py drives a real SkillsLoader through kirocrew consolidate on a delegated host. Its autouse floor now reads an empty cgroup file for the confinement probe, as part 2's suite does. On a runner inside a Kiro Crew agents slice, that test otherwise read the operator's terminal as confined. test_cli_server_facade.py's frozen import inventory now lists initialize_gateway_auto_skill_private_authority, which _run_task imports into the facade (tests patch it there). test_slack_gateway_run.py::TestRunGateway pins the startup order on linux, darwin and win32 and the single retire hint. test_skill_pending_api.py pins the three 409s, their SEL rows and the unchanged 404 and 400. test_dashboard_server_composition_contract_owners.py pins the Skill auto-updated notification on the serving loop and inline, and that a failed or unreadable record is contained.
  • The tree-scan guards and the flake-pattern and wait-discipline ratchets at -n0: 261 passed. The 24 script gates pass, and push_guard.py --base main --max-ahead 3 reports SAFE TO PUSH.

Manual verification

N/A: unit coverage sufficient. The dashboard change is three JSON error payloads and one notification with no rendered component change, and the Skills tab renders the 409 through its existing uncoded dismiss-failure copy.

Related Issues

Part 3/4 of the #18595 split (stack: #19410 -> #19427 -> PR3 -> #19431). Fixes #3795.

Pattern harvest

Rule candidate: review-prompt
Pattern: a handler that maps every exception from a mutation to 404 or 400, so a refusal of a resource that still exists reads as the resource being gone.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed and code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license (see the Licensing section of CONTRIBUTING.md).

@rubencu
rubencu requested review from a team and KiroCrewCaptain as code owners October 12, 2026 12:37
@rubencu
rubencu requested a review from cruisercohen October 12, 2026 12:37
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Oct 12, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision abc94b1a267f5d947970830a2eb58aad1e918711 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — 🟡 CONCERNS

Design-level review of 9c3d166d93de462d0cd2daded57ab666e0e517d0 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

A refused authority still shows up as an unexplained failure: the dashboard throws away the new 409 hint, and on macOS/Windows auto-skills turn off with only a log line.

Watch

  • The 409 never reaches the operator. The goal says a refusal "reaches the dashboard as a coded 409", and the API returns pending_dismissal_refused / skill_mutation_refused with a hint. But the dismiss onError in website/src/pages/overview/SkillsTab.tsx:1295-1305 only recognises pending_skill_not_found. Every other code falls through to dismiss_failed_reason_uncoded, which suggests a retry. The retry fails the same way, and the operator never sees the kirocrew skills authority-retire hint. The "wrong diagnosis" harm moves from "gone" to "transient" instead of going away. Pin and delete have the same gap.
    Clears when: the UI maps both codes to catalog text that carries the hint (in this PR or #19431), or the description stops claiming the operator sees the reason.
  • Auto-skills switch off silently on macOS (Kiro CLI internal sandbox) and native Windows. The fail-closed default is "pending maintainer confirmation on feat(skills): atomically promote safe auto-skill updates #18595". If startup certification refuses, run_gateway only calls logger.warning, and _run_skill_detection then skips detection with no marker. A user with auto_create_from_sessions=true gets no skills and nothing in the UI saying so. Reverting is easy, but this lands on main with no rendered status.
    Clears when: a maintainer confirms the macOS/Windows fail-closed on #18595, and the disabled reason appears on a dashboard surface (for example the Skills tab), not only in the gateway log.

[DESIGN-REVIEWED] 9c3d166

Description read

[DESCRIPTION-READ] 0ee64dd4cb346d24f81c6dc6afa60308e1a4268555d95a1b1383beb24af02660

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — 🔴 BLOCK

Premise-level review of 9c3d166d93de462d0cd2daded57ab666e0e517d0 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: BLOCK

product-shape change without accepted RFC: auto-skill extraction stops on native Windows, macOS with the Kiro CLI sandbox, and sandbox-off installs, and the author says the decision is still pending.

Not justified as shipped

  • Item 5 — product-shape, no recorded decision: the description says "refuse … on native Windows and on macOS with the Kiro CLI internal sandbox (fail-closed default, pending maintainer confirmation on feat(skills): atomically promote safe auto-skill updates #18595)", and _auto_skill_authority_sandbox_refusal returns _SANDBOX_OFF_REFUSAL if mode == "off".
    Clears when: an RFC covering the platform fail-closed default for auto-skills is merged non-draft on the base (then push or rebase), or a maintainer posts /ai-review override first-principles 9c3d166d93de462d0cd2daded57ab666e0e517d0: <decision>.

What this change ships

Inventory (9 items) — 8 justified

Intent: let an operator who turned approval off also receive prose-only skill updates unattended, and make every process certify the auto-skill authority; ADDITION.

  1. Opt-in skills.auto_apply_updates (off by default) applies prose-only updates without review — justified
  2. With unattended apply on, an update whose supplied scripts all failed validation is rejected — justified
  3. New "Skill auto-updated" dashboard notification — justified
  4. Gateway certifies the authority at startup and keeps serving if it is refused — justified
  5. kirocrew consolidate and run no longer extract skills where the authority is refused (whole platforms, sandbox off) — product-shape, no RFC
  6. Consolidation skips the aux-model detection call while auto-skills are off — justified
  7. New kirocrew skills authority-retire operator command — justified
  8. Refused dismiss/delete/pin answers a coded 409 instead of 404/400 — justified
  9. The scripts warning shows only when has_scripts is True — justified

Blockers

  • product-shape change without accepted RFC: auto-skills fail closed on whole platforms. Turning auto-skill creation off on native Windows, on macOS with the Kiro CLI internal sandbox, and wherever sandbox.mode is off removes a capability those users have today. This PR extends that to the standalone CLI (cli.py _consolidate_cmd, cli_server.py _run_task). The base RFC list has no entry covering skills: I grepped skill|approval|claim and got two hits, both unrelated (rfc-goal-loop-approval-hold, rfc-leaked-runtime-reclaim at draft). "bolichen97's ruling" covers the split into four PRs, not this default.
    Clears when: an RFC covering this shape is merged non-draft on the base (then push or rebase), or the maintainer override above is posted for this head.

[FIRST-PRINCIPLES-REVIEWED] 9c3d166

Description read

[DESCRIPTION-READ] f00cc774369b105a81012242c56ea41a3a0068d37282482fde67c546c68f9c7f

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

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

Review details

No findings that block the merge.

FINDING — src/kiro_crew/skills.py:6605 — a candidate with two scripts that share a filename (or Run.sh/run.sh on a case-insensitive filesystem) hits the O_EXCL create in _write_pinned_new_file. That raises FileExistsError, which stage_skill_candidate's except FileExistsError: continue treats as "slug taken". Each of slug, slug-2 … slug-50 then fails the same way, and the candidate is dropped with "No free pending slug" while the consolidation offset still advances. The old write_text let the last duplicate win → Fix: skip a filename already in script_names (compare casefolded) before calling _write_pinned_new_file, or wrap in-candidate create failures in a non-FileExistsError exception so only the candidate-directory create reads as a slug collision.
FINDING — src/kiro_crew/skills.py:3102 — update_skill and set_inject_on_trigger now return False when _live_auto_mutation_lock refuses. That happens whenever an authority root exists but this process cannot take the target lock, for example with the sandbox off. The dashboard PUT then answers {"error": "not found"} with a 404 for an auto/ skill that still exists, while delete and pin answer a coded 409 for the same refusal → Fix: add a checked variant that raises self._live_auto_mutation_refusal(name) on refusal, as set_pinned_checked/delete_skill_checked do. Route api_skill_detail PUT and the inject handler through _live_skill_mutation_refused.

[OPUS-REVIEWED] 9c3d166

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

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

Review details

No findings.
[GPT-REVIEWED] 5db8c92

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 5db8c92 to 9c3d166 Compare October 12, 2026 13:23
@rubencu

rubencu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Replayed onto #19427's fixed head (5db8c92b6a -> 9c3d166d93, same single commit; the body's earlier-commit SHAs regenerated). 1,870 tests across this part's test files plus the skills family pass on the new head, git diff --check and push_guard pass.

@rubencu

rubencu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

The PR Hygiene red on this head is the commit cap, not the content: the gate allows 1 or 2 commits over main and this part carries the earlier parts of the stack as commits (3 on #19429, 4 on #19431) because GitHub refuses a fork branch as the base of a PR into kirodotdev. #19410 and #19427 (1 and 2 commits) pass the same gate. Three ways out, all a maintainer's call: a maintainer creates split/3795-1-atomic-write-fsync, split/3795-2-candidate-claim-promotion and split/3795-3-approval-surfaces in kirodotdev from the current heads so parts 2 to 4 can retarget their bases and show only their own commit; or the red is accepted until #19410 and #19427 merge, after which this part is re-pushed as one commit on main; or the cap is raised for the series. Nothing else on this head changes until then.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 15, 2026
@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 9c3d166 to b78b2ad Compare October 15, 2026 05:39
@rubencu

rubencu commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased the three-commit stack onto 83e97cd0c7; part 3 is now b78b2ad846 after porting its gateway changes into process_entry.py and service_boot.py while preserving main’s owner composition. Part 1 patch-id remains exact; part 2 change content is byte-identical; part 3 semantics are preserved. Worker suites passed 3,142 tests (3 skipped), parent reran 484 tests, and pushguard/exact lease passed.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 15, 2026
@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from b78b2ad to 2522313 Compare October 15, 2026 05:49
@rubencu

rubencu commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Final stack refresh after main advanced: part 3 is 2522313e44 on part 2 89ac22607c, preserving the validated owner-port patch identity. Three-commit pushguard and exact lease passed.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 15, 2026
@rubencu

rubencu commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Replayed split part 3 onto #19427 952207f950 as cafd4309da. Main’s prompt/history/Slack/runtime composition is preserved; the two authority-retire CLI tests moved byte-identically into the split lifecycle module (1,653 lines). Worker and parent owner suites plus static/mypy/line-cap/max-4 guards pass. Exact lease pushed; part 4 follows.

@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 2522313 to cafd430 Compare October 16, 2026 19:54
@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

This is part 3's push for this round: f646f1a184 -> 9bc384f2f0, re-stacked on #19410 3faa2ff5d7 and #19427 0e8c025aab (main 88d73a83b0).

It fixes this part's CI red. Backend Tests (3.12, 1) and (Windows) (1) failed test_cli_server_facade.py, whose frozen import inventory did not list initialize_gateway_auto_skill_private_authority. _run_task imports that name into the facade and tests patch it there, so it joins _BASE_IMPORTS, with the inventory's comment saying why.

The Windows (6) red was part 1's read-only delete, which #19410 fixes. The Opus and Security Scope lanes ended incomplete or unsettled on f646f1a184; those are lane failures, not findings. The runs on 9bc384f2f0 wait at action_required for a maintainer.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 22, 2026
@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 9bc384f to 72bc5fe Compare October 22, 2026 07:54
@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

This is part 3's push for this round: 9bc384f2f0 -> 72bc5fe116, re-stacked on #19410 690b2c3522 and #19427 d791cb359c (main d7240d0d2a). It answers this part's Coverage Gate red on 9bc384f2f0. dashboard/server_runtime/skill_learning.py was at 75.4%, because the Skill auto-updated notification hook had no test. Two tests in test_dashboard_server_composition_contract_owners.py now pin it on the serving loop and inline, with a failed notify and an unreadable record contained (about 95% against that round's report). The other file under the floor, skills_auto_claims.py, is covered by #19427's new tests.

Main's #17283 and #22866 changed two composition-contract test modules this part also edits. The replay kept every per-file patch ID, and those modules pass after it. The runs on 72bc5fe116 wait at action_required for a maintainer.

@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 72bc5fe to 05eb8ac Compare October 22, 2026 09:46
@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

This is part 3's push for this round: 72bc5fe116 -> 05eb8ac598, re-stacked on #19410 cd12c94a90 and #19427 88c9e3b62e (main a70e93f108). Its own commit is patch-identical.

The round's Coverage Gate passed on 72bc5fe116, and its SAST red is part 1's fixture finding, fixed there. The GPT 6.1, Opus 5.5 and Security Scope lanes ended incomplete again (Security Scope: "no leg reported"), so none of them has reviewed this part yet. The PR Hygiene red is the stacked commit cap.

Checked on this head: parts 1 to 3's owning set (7,185 passed, 924 skipped), the Slack gateway modules (1,048 passed), the tree-scan guards and ratchets (261 passed), the 24 script gates, and push_guard.py --max-ahead 3. The body's Tests section is regenerated for this head.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 22, 2026
@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 05eb8ac to 0e3e8ef Compare October 22, 2026 21:04
@rubencu

rubencu commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebase onto main 66b3698653: 05eb8ac598 -> 0e3e8ef294, re-stacked on #19427's 7124e8d20e. Main's #23119 split test/test_security.py, which conflicted with part 2's one test there. That test moved with its class to test/test_security_sensitive_paths.py (see #19427). This part's own commit is patch-identical (8e34973093f0).

Checked on this head: parts 1 to 3's owning set (7,187 passed, 924 skipped), the Slack gateway modules (1,048 passed), the tree-scan guards and ratchets (261 passed), the 24 script gates, and push_guard.py --max-ahead 3. The body's stack line and Tests section are regenerated.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 22, 2026
)

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 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. 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-reparse entry open, the
identity-bound delete (a match, a mismatch, a file-for-directory swap,
the READONLY clear, an identity that is not full FileIdInfo, and native
Windows cases), 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.
@rubencu
rubencu force-pushed the split/3795-3-approval-surfaces branch from 0e3e8ef to abc94b1 Compare October 23, 2026 07:10
@rubencu

rubencu commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Rebase onto main 7796e2af52: 0e3e8ef294 -> abc94b1a26, re-stacked on #19427's 636e185628. 0e3e8ef294's Coverage Gate failed closed because CI's change detection never reported, so no test job ran; this push gives CI a fresh run. Main's #4533 landed the self-protection-skills-authority-retire floor, so the two floor-bound tests in test_skills_authority_retire_floor_link.py now run instead of skipping, and they pass. This part's own commit is patch-identical (8e34973093f0).

Checked on db794425bc, the same patch on 1f033607bd: parts 1 to 3's owning set (7,205 passed, 922 skipped; the two fewer skips are those floor-bound tests), the Slack gateway modules (1,048 passed), the tree-scan guards and ratchets (261 passed), the 24 script gates, and push_guard.py --max-ahead 3, which passes again on this head. The body's stack line and Tests section are regenerated.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 23, 2026
@rubencu

rubencu commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #23649: see #19431 (comment) for the recommendation that a maintainer close this PR.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thank you, @rubencu. As you recommended, closing as superseded by #23649 (part 1 landed in #19410, which closed #3795). Happy to reopen if anything here is still missing.

@iamwhatever iamwhatever closed this Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-apply prose skill updates: atomic candidate claim (design history from PR #2713)

2 participants