Skip to content

feat(workflows): add Kiro Workflows dashboard routes and chat wiring - #47357

Draft
romdr wants to merge 40 commits into
feat/kas-workflows-enginefrom
feat/kas-workflows-dashboard-routes
Draft

romdr wants to merge 40 commits into
feat/kas-workflows-enginefrom
feat/kas-workflows-dashboard-routes

Conversation

@romdr

@romdr romdr commented Dec 4, 2026 •

Copy link
Copy Markdown

Problem / Motivation

Goal: With agent.kas_workflows on and Kiro Agent as the backend, a dashboard chat can start Kiro Workflows runs and answer its own run's steps, the dashboard gets routes to watch, answer and control them, and a run survives idle timeouts, crashes and gateway restarts.

Kiro Agent has its own workflow engine: saved recipes, multi-step runs, and steps that stop to ask a person a question or for an approval. The PR this one sits on gives Kiro Crew the engine's run mirror and router, but nothing in the gateway calls them. With the switch on, a chat still gets no workflow tools, no route lists a run or answers a step, and a running step dies with its chat's Kiro Agent process at the next idle timeout.

Why it matters

Kiro Agent is Kiro Crew's default backend. Without this PR the switch turns nothing on: the dashboard pages in the frontend PRs above this one have no routes to call, and a step that asks a question waits with no way for the person, or the chat on the person's behalf, to answer it.

Not a goal

  • Turning Kiro Workflows on by default. With agent.kas_workflows off, chats behave as on main.
  • The dashboard pages, which come in the frontend PRs above this one. No file under website/ changes here.
  • Holding plan approvals for a person on channels such as Slack and on Kiro Crew's other approval paths, which the next PR in the stack does.
  • Replacing Kiro Crew's own workflow engine, or changing the pinned Kiro Agent version.

What changed (motivation → approach → change)

The gateway now calls the engine from the PR below, only with agent.kas_workflows on and Kiro Agent as the backend. A run belongs to the chat whose Kiro Agent session started it, and the dashboard reaches the run through that chat's turns or through a route.

Area What a person gets
Routes under /api/workflows/kas/ Recipes; launching a run; reading runs, a chat's runs and a step's conversation; run controls (pause, resume, stop, retry, restart, delete); step controls (reply, model and effort, more loop passes, mark done or failed, stop); answers to held approvals and questions; a chat's reconnect
Chat turns A dashboard chat gets Kiro Agent's workflow tools and its send_message, so its model can start a run and answer a step of it; a dashboard launch becomes the chat's next turn and starts the run on the chat's own session; a message sent while the chat follows a run waits as its next turn
Approvals A plan approval in a chat's turn waits for the person in every approval mode; a step's approval follows its chat's mode, also after the person changes it, and gets YOLO only where gateway --approval yolo reaches that chat
Live updates Each run change pushes a kas_workflow_revision frame on /api/ws to the owner's pages, coalesced over 250 ms, so a page reads again only when something changed
Keeping runs alive A chat whose run works or waits for a person keeps its Kiro Agent process past session.timeout_secs; 45 s after a process crashes, the chats whose runs it drove get a reconnect turn; at gateway start, boot recovery reconnects interrupted runs
Rewind Rewind, edit-resend and regenerate past a live run answer 409 rewind_workflow_running, with the run names masked
Sidebar A chat whose run waits for a person shows as needing input
Settings The dashboard may write agent.kas_workflows, a config change the agent proposes that turns it on counts as widening access, and GET /api/workflows/engine names the engine in use

Every route is the dashboard owner's, and an app token gets 403. Each of the 22 routes this PR registers has a RouteAccess label in the route table. With the switch off, or on another backend, every /api/workflows/kas/ route answers 409 engine_not_kas, except that the reads and Stop stay open while the router still holds a run; GET /api/workflows/engine answers in both cases, naming Kiro Crew's own engine when the switch is off. A project folder a request names must sit under the home folder, a recent project or an open chat's project, and every answer is redacted.

When Kiro Agent starts a turn on the chat's session by itself, the chat follows that turn without prompting the model. In a chat that has Kiro Agent's run_workflow, Kiro Crew's own routes for writing a new workflow answer 409 kas_workflows_in_chat, so the model is offered one engine.

A launch, reconnect or observe message queued behind a busy turn runs as a turn of its own, also with dashboard.merge_queued_messages on, so it starts its run instead of reaching the model merged with the next queued message.

Only a crash sends a reconnect turn: an idle expiry also ends a process, and reconnecting after one would start a new process at every expiry. The 45 s wait covers Kiro Agent's 30 s claim on the dead process's runs, during which it refuses a reconnect. Only that process's chats are reconnected, because a new process for another chat in the same project would sweep the crashed chat's run as stale and take it first. A crash or boot reconnect reads a cold chat's transcript off the event loop before it checks that the chat is idle, so a turn the person starts during that read gets no reconnect turn queued behind it. A launch reads a cold chat's transcript off the event loop too before it queues its turn, and answers 400 invalid_slot when the chat closed during that read; a restored chat's observe turn starts once its transcript is read. The routes check a project folder and a recipe folder off the event loop. A launch's model and effort are checked with fullmatch, so a value that ends in a newline answers 400 invalid_model or invalid_effort.

One limit stays: Kiro Agent asks the chat's session for permission before each poll of a command watch, and nothing reads a request that arrives between the chat's turns. Kiro Crew denies it at the chat's next prompt, which fails the watch and its run.

How a workflow step reads its chat's approval mode is its own module, dashboard/chat_turn/kas_step_mode.py, which keeps dashboard/chat_turn/tool_approval.py within the 2,000-line cap. The specs, the feature map and the AGENTS.md routing row follow the code.

Backwards compatibility

Compatible: with agent.kas_workflows off, the default, every /api/workflows/kas/ route refuses, no chat gets the workflow tools, and each chat-turn and approval change acts only on a workflow launch, observe or reconnect turn or on a run's plan approval, none of which occurs.

Removes nothing: the diff adds routes, a listener on process deaths (runtime_death.subscribe) and code paths taken only for a Kiro Workflows run; its two new refusals (a rewind past a live run, Kiro Crew workflow authoring in a chat that has run_workflow) need the switch on.

Tests

  • New tests drive every /api/workflows/kas/ route through aiohttp: the switch and backend check, project folders outside the allowed roots, redacted answers, and the step model route's 400, 404 and 409.
  • New chat-turn and trigger tests: launch, observe and reconnect turns send no prompt; a plan approval asks under Trust; a rewind past a live run is refused; only a crash reconnects, after 45 s; the revision frame is coalesced and owner-only; the chat's workflow tools are exactly the five workflow tools and send_message.
  • On a75883e, below this head: black, isort and flake8 on the changed files, the comment history and brand name checks pass; the two chat session test files pass (44 tests), and every test file that reads the chat agent's tool list, 51 files: 2,808 passed, 26 skipped.
  • On this head, the redaction sink tests, with python -m pytest -q -p no:cacheprovider -n 8 --dist loadgroup <files>: the five test files that read the sink list (test_security_posture.py, test_security_posture_facade.py and three core decoupling tests) and six test files of the modules behind this PR's two new sinks, the routes' answers and the rewind refusal's run names (test_kas_workflows_plan_redaction.py, test_kas_workflows_step_transcripts.py, test_kas_workflows_round4_l2.py, test_kas_workflows_round5.py, test_kas_workflows_chat.py, test_kas_workflows_chat_session.py): 11 files, 264 passed, 0 failed, 0 skipped.
  • On this head: the wait-discipline, anchored-pattern, route-label and per-test reset gates, 76 passed, and the first two measured against the PR below's head as on a pull request, 64 passed; test/test_kas_workflow*.py with the conftest, observe-turn, idle-hold and process-death tests and the test files the diff changes, 54 files: 1,939 passed, 0 failed; the agent-SDK import boundary and focus-cue gates and the file line cap pass.
  • On this head, for the queued launch: test_workflow_turns_queued_behind_a_busy_turn_never_merge posts two launches to a busy chat with merging on, then a plain message and a reconnect, and fails without the fix (the four drain as one turn that is not a launch). New route tests (run control, step reply, approval answer, a chat's runs and its reconnect, boot recovery's start and stop) bring dashboard/handlers/kas_workflows.py from 72.1% to 86.0% of its lines by the Coverage Gate's per-file check over the 46 test files that name these modules, over its 80% floor. On 37be11a, the fix commit below this head, scripts/local-gate.py --base 9b94d7af493d, the related set of the fix, 145 backend test files: 5,751 passed, 0 failed; mypy, black, isort, flake8, the comment history and brand checks and docs lint pass.
  • test/conftest_resets_dashboard.py resets the boot recovery task, what a trigger install undoes and the process-death listeners before every test. New tests pin the route labels, the routes' path checks off the event loop, a launch into a cold chat and into one closed during the read, a restored chat's observe turn, and a launch option that ends in a newline.
  • On the commits below this head: the branch's own test files and every test file importing a file that conflicted with main, 105 files: 4,225 passed, 2 expected failures; the file line cap and the tests around the moved module, 24 files: 1,563 passed.
  • On b3b505c, an earlier head (not rerun on this head, which adds the merge of main fa5f024 and the fixes above and in the PR below), part of the local gate's related set: scripts/local-gate.py --base 989b629c2b --dry-run relates 5,034 backend test files to this diff (22 in the diff, 905 by name, 4,060 that reference a changed file, 47 through a facade) and leaves its frontend set to CI, since no file under website/ changes. They ran with the gate's pytest command at 4 workers, python -m pytest -q -n 4 --dist loadgroup --max-worker-restart=2 --no-cov -p scripts.explicit_file_targets -p no:cacheprovider -- <files>, in this order until a 25-minute cap:
    • the 12 new test files: 195 passed, 0 failed, 0 skipped;
    • the 10 test files the diff changes: 952 passed, 0 failed, 0 skipped;
    • the 482 files named after a changed module: 17,550 passed, 0 failed, 24 skipped;
    • 12 more files that name the changed workflow modules: 476 passed, 0 failed, 0 skipped;
    • the first 600 of 735 files that name a changed module, in five runs of 120: 23,937 passed, 1 failed, 6 skipped, 2 expected failures; the last three runs were cut by the cap and ran once more by themselves after it. The one failure, test/test_git_repo_touches.py::TestStatusAdmitsTouchedRoots::test_user_file_changes_cannot_list_or_admit_an_untouched_repo, is in a file this PR does not change, and it fails the same way on main 190fef0 on this host (the file alone: 1 failed, 171 passed on both);
    • in all: 1,116 files, 43,110 passed, 1 failed, 30 skipped, 2 expected failures.
  • Not run in that pass, cut by the cap: the other 3,918 files of the gate's set, among them the other 135 files that name a changed module and 3,208 that reference a changed file through a common word such as chat, router or workflows.
  • Not run: the full local gate and the full website suite (left to CI), and repeated and shuffled runs of the new tests.

Manual verification

With the four PRs above stacked on this one, on the pinned Kiro Agent 0.66.117, in headless Chromium against a local gateway on loopback: five runs launched from the Workflows tab's form (one waiting on its question, one answered through the step reply route and completed, one with its step marked failed, one paused, one stopped from its menu), and three runs started by a chat's model, in which the chat answered the step's question with Kiro Agent's send_message and the run completed (in the first of the three only after the person told it to answer; the engine PR below describes the three).

Not repeated since the stack moved onto main 704bfc3: /workflow-run, a plan approval held under Trust until allowed, a parked step moved to another model, about 50 minutes of use in which the page never read these routes on a timer, and the command watch failing at the chat's next prompt. A live Kiro Agent crash during a run was not repeated either; the 45 s crash reconnect has unit tests here, and its last live run was on an earlier version of this branch.

Real-machine verification

Machine: the author's own Linux development host, Amazon Linux 2023, x86_64, 16 vCPU / 30 GiB.
Before (main 190fef0): pytest -n 4 test/test_kas_workflows_optin_gate.py with this PR's test file -> 34 failed | 6 passed.
After (head 3c5da62): the same command -> 40 passed.
Route check: in the browser check of the two UI PRs above, on this machine, GET /api/workflows/engine, the route this PR adds, answered 404 on main 190fef0 and 200 on heads dea05b0 and 53225fe.
Cleanup: own host, no machine to delete; the check worktree on main was removed.

Screenshots / video

N/A -- this PR changes no file under website/, so it has no rendered surface.

Related Issues

No issue tracks this work.

Continues draft #25450.

It lands after the PR that adds the Kiro Agent workflow engine and before the PR that holds plan approvals for a person on every channel.

Checklist

  • A Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...); PR Hygiene does not count commits
  • Existing tests pass and new tests added for new functionality
    • Ticked after this draft's first CI run passes: the full existing suites did not run outside CI (Tests says what did).
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributed under the project's Apache-2.0 license, as the Licensing section of CONTRIBUTING.md sets out.

Kyle Seaman and others added 21 commits November 25, 2026 12:23
The dashboard half of Kiro Workflows on Kiro Agent: the
/api/workflows/kas/* routes (recipes, runs, run controls, step
transcripts, approvals, questions, reconnect), the chat-turn wiring that
starts a launch or observe turn on the chat's own KAS session, keeps a
KAS plan or question on the person's card under every approval mode,
refuses a rewind / edit-resend / regenerate past a live run (409
kas_rewind_refused), and boot recovery of interrupted runs.

A request's project directory is confined to server-held roots before
any filesystem use. Every route refuses unless agent.kas_workflows is on
and the backend is Kiro Agent; responses are redacted and the handler
is registered as a redaction sink.

Cherry-picked from c35ccf3 onto feat/kas-wf-2b-engine at 31930a7.
Ten files conflicted with what main changed since 2026-11-12:
- Both sides kept: docs/feature-map/README.md (main's Workflows row,
  then the new Kiro Workflows row), change_card_catalog_kinds.py,
  handlers/core_config_schema.py, slot_projection.py,
  test/test_security_posture.py, and chat_turn/turn_dispatch_gates.py
  (main's comment with the _kas_observe condition added).
- chat_regenerate.py: the rewind guard runs before main's restored-hold
  flush, so a refused edit-resend still changes nothing.
- chat_turn/permission_prompt.py: main's approval trace span and the
  person-wait window both stay.
- test_dashboard_server_composition_contract.py: main's version, which
  computes the lazy-import check, so the hand-kept _LAZY_IMPORTS rows
  and the count are dropped.
- test_dashboard_server_composition_contract_reach.py: main's version;
  the 29 new routes become rows in
  test/fixtures/dashboard_mcp_route_table.txt in place of the stored
  count and digest.

Moved with git rebase --onto from 31930a7 to our copy of #25449
(feat/kas-workflows-engine at 11472b6537: Kyle's head with
origin/main 378ec94 merged, our live-walk fixes, the frame-fed step
transcript and the ledger drop). Four files conflicted with main's
changes since 2026-11-12:
- docs/feature-map/README.md: the Kiro Workflows row, then main's
  current Bot abilities row.
- change_card_catalog_kinds.py: main's agent.kas_persist_mcp_sign_in
  and this agent.kas_workflows, both kept.
- chat_delivery.py: the observe-turn refusal first, then main's
  loss_prone and held_peer condition.
- chat_turn/permission_prompt.py: the person-wait window and main's
  YOLO timeout advice both kept; the advice leaves out a KAS plan
  handoff too, since no auto-approve answers one.
The calls into the router the base removed or re-signed are fitted in
our own commit "fit the dashboard routes to the ledger-free router",
three commits up.
- The KAS session fake takes main's new session_cwd keyword.
- chat_runner no longer imports kas_workflows.chat: nothing reads it there,
  and main's compose-binding test now refuses an unread runner import.
- The parity-route waits use FALLBACK_TIMEOUT_SECS (K19); the turn-ceiling
  stub carries flake-ok, since nothing waits on it.

Cherry-picked from 552b9b6 onto the commit above; it applied with
no conflict.
The two cherry-picked commits were written against the engine and main
of 2026-11-12. On today's engine head and its main, these tests broke
at run time; the product code needed no change.

- test_kas_workflows_chat_session.py and
  test_kas_workflows_optin_gate.py build the settings with
  workflow_settings() merged through with_client_meta_settings(),
  which replaced attach_workflow_settings.
- test_kas_workflows_chat_session.py resets the engine's record of
  sessions last driven with workflows on, and the switch-off test
  records its session first: the engine now sends enabled: false only
  for such a session. The old test passed in file order only.
- test_chat_surface_follows_the_gate installs the turn starter, since
  chat_workflows_enabled() now also requires the dashboard wiring.
- test_kas_workflows_round5.py plants a synthetic GitHub token: main's
  redactor keeps an AWS key ID visible.
- test_held_note_turn_starts.py lists the launch, reconnect and observe
  turn starts in handlers/kas_workflows.py: turn admission answers each
  without sending the model a prompt, so a held note waits for the
  turn's cycle end, as the PR had it.

Verified on this tree:
- pytest -n0 on the 15 test files the two commits add or change, plus
  both composition-contract tests: all pass.
- black, isort, flake8, subprocess encoding, comment history, brand,
  file line cap, harness parity, docs-lint: pass; mypy src/kiro_crew:
  no issues in 4917 files.
- scripts/local-gate.py --base origin/feat/kas-wf-2b-engine: backend
  6/6 batches pass (148,622 tests), with one case deselected that fails
  the same way on the engine head:
  test_find_ui_auto.py::test_the_generated_auto_tier_answers_labels_
  only_it_carries[continue with github-...]. Frontend: batches 1-3 and
  5 pass; batch 4 has one failure, UsageTab.spendChartHarness.test.tsx,
  which fails alone too and reads no file this branch changes (website/
  is untouched).

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
Our copy of #25449 keeps no run ledger: a run's chat is the chat whose
Kiro Agent session is, or was, the run's parent, and boot recovery asks
Kiro Agent's own run lists. Kyle's two commits above called the
ledger's names, so this fits them:

- recover_runs_on_boot passes recover_on_boot an open chat as
  chat_exists and the open chats' project folders as folders, in place
  of each chat's named workspace (a chat that switched workspace now
  gets its runs back).
- The state poll's reconnect and the reconnect route no longer await
  ensure_ledger, which is gone.
- Turn admission names the chat's session without workspace=.
- The transcript route's docstring says it serves the router's kept
  copy of the step's conversation; it reads no session file.
- test_kas_workflows_boot_recovery.py gives each run a parent named
  for its chat and answers boot recovery's list in place of the
  ledger and load; the named-workspace and ledger-stamp tests are gone
  with the rule. Two tests patch project_root.recent_project_dirs,
  the name the base made public.

Spec: kas-workflows.md gets the dashboard's own section ("The
dashboard": the routes, turn admission, the transcript route, boot
recovery's caller, the rewind and authoring refusals), and its gate
paragraph no longer says nothing calls the entry points. The spec
index row and the AGENTS.md routing row name the routes.

Verified on this tree:
- pytest -n 8: the test files this branch adds or changes against the
  base, every test_kas_workflows_*.py and both composition-contract
  tests, 1,318 passed before the spec edit; test_kas_workflows_*.py,
  test_chat_runner_kas_observe.py, test_kas_slot_needs_person.py,
  test_held_note_turn_starts.py and test_security_posture.py, 798
  passed after it.
- black --check, flake8, isort on the changed files; docs-lint.sh;
  docs_lint.py --strict-identifiers has no finding in the edited
  specs.
A Kiro Workflows step reads its parent chat's approval mode when it
asks. The reader took the process-wide override alone, so the grant
`gateway --approval yolo` arms auto-approved a step of a channel-linked
chat, or of a chat whose turn a channel started, while that chat's own
tool calls kept asking. The reader now ANDs the override with
yolo_reaches, as every other dashboard approval path does, so a step
follows the same channel scoping as its chat.

Spec: docs/system-specs/modules/cli.md names the step reader among what
the CLI launch grant does not reach.

Verified on this tree:
- pytest -n0 test/test_kas_workflows_chat_session.py
  test/test_chat_runner_coverage_approval.py: 70 passed, the new
  channel-linked case included.
- black --check and flake8 on the two changed Python files: clean.
- scripts/docs-lint.sh: all documentation checks passed.

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
Rewind and edit-resend refuse with 409 rewind_workflow_running while a
Kiro Workflows run launched since the edited message is live, and the
body names those runs so the person knows what to stop. The names came
straight from the router's rows, which are not redacted, so a run name
carrying a credential reached the browser as written. The refusal now
passes each name through redact_via_context, capped at the router's
display length, where it is built, so both doors answer it masked.

kas_workflows/chat.py joins the security posture's redaction sinks as
"Kiro Workflows rewind refusal".

Verified on this tree:
- pytest -n0 test/test_kas_workflows_round4_l2.py
  test/test_kas_workflows_chat.py test/test_security_posture.py: 118
  passed, including the new rewind and edit-resend cases that plant a
  synthetic GitHub token in the run name.
- black --check and flake8 on the changed Python files: clean.

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
The Kiro Workflows views learn about run changes by polling
GET /api/workflows/kas/state every 2 seconds. The dashboard already
holds one WebSocket per page, /api/ws, so the server now pushes the
change there and a client can re-read the state route when it arrives.

The router's revision becomes a property whose setter calls a new
DashboardHooks.changed hook. Every existing `revision += 1`, in any of
the router's modules, reaches it with no other edit, including one a
later engine change adds. The new module dashboard/kas_workflow_triggers
supplies that hook: revision_publisher sends kas_workflow_revision
{"revision": n} to owner sockets only (broadcast_ws_owners), coalesced
on a leading and a trailing edge over 250 ms, and the workflow startup
installs it beside the bell-note and marker-row hooks. The frame is
listed in ws_event_scope._OWNER_ONLY_EVENTS, so an app token's denial
is audited as owner_only. The routes are unchanged and the frame
carries no run data.

Specs: docs/system-specs/modules/learn-cron-dashboard.md gains the
kas_workflow_triggers.py entry; docs/feature-map/README.md's Kiro
Workflows row names the frame.

Moved onto our copy of #25449 with git rebase --onto. Conflicts:
router_base.DashboardHooks keeps the base's transcript_changed beside
changed, both docstring bullets; learn-cron-dashboard.md keeps main's
current text around the new entry, and the feature-map row sits above
main's current Bot abilities row. kas-workflows.md says a revision
move calls the changed hook and, in "The dashboard", that the frame
is pushed.

Verified after the move:
- pytest -n 8 on the seven files below and
  test/test_kas_workflows_step_transcripts.py: 303 passed.
- black --check and flake8 on the changed modules;
  check_file_line_cap.py: 0 failures, router.py at 1,929 lines;
  docs-lint.sh: pass.

Verified on the first base (31930a7):
- pytest -n0 test/test_kas_workflow_triggers.py
  test/test_kas_workflows_round4.py test/test_ws_event_scoping_frames.py
  test/test_workflow_startup_lifecycle.py
  test/test_dashboard_server_composition_contract.py
  test/test_kas_workflows_router.py test/test_kas_workflows_router_bounds.py:
  266 passed.
- mypy src/kiro_crew: no issues in 4918 files; check_black_formatting.py,
  flake8 and isort on the changed files: pass (ws_event_scope.py is on
  the black baseline); check_file_line_cap.py: 0 failures, router.py at
  1,977 lines; scripts/docs-lint.sh: pass.

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
A Kiro Workflows step that asks while its chat is in Normal waits for a
person. When the person then switches the chat to Trust, the held step
should follow the switch as the next step would. That re-decision ran
inside GET /api/workflows/kas/state, so it happened only while a tab
polled, and it ran even with agent.kas_workflows turned off, because
that route stays readable for a run the switch was turned off under.

kas_workflow_triggers.recheck_step_approvals now runs where the mode
changes: after a successful apply_approval_mode (the mode route, and
every other caller of it), after the approval card's Trust or YOLO
press, and in the waiting turn after a Trust-reads press. It decides
nothing while the switch is off, reads no config when nothing is held,
and never fails the mode change. The state route decides nothing.

Specs: docs/system-specs/modules/security.md (the POST /api/chat/mode
paragraph) and learn-cron-dashboard.md (slot_approval and the
kas_workflow_triggers.py entry).

Moved onto our copy of #25449 with git rebase --onto. Conflict:
learn-cron-dashboard.md keeps main's current text around the
kas_workflow_triggers.py entry. The new test fixture patches
project_root.recent_project_dirs, the name the base made public.
kas-workflows.md, "The dashboard": the state route no longer
re-decides held approvals; a chat's mode change does.

Verified after the move:
- pytest -n 8 on the nine files below and
  test/test_kas_workflows_step_gate.py: 511 passed.
- docs-lint.sh: pass.

Verified on the first base (31930a7):
- pytest -n0 test/test_kas_workflow_triggers.py
  test/test_kas_workflow_mode_recheck.py test/test_chat_mode_security.py
  test/test_chat_runner_coverage_approval.py
  test/test_kas_workflows_parity_routes.py
  test/test_kas_workflows_l4_recipes.py test/test_kas_workflows_optin_gate.py
  test/test_kas_workflows_round4.py test/test_approval_modes_trust_policy.py:
  all pass (391 after one test fix in the new file).
- mypy src/kiro_crew: no issues in 4918 files; check_black_formatting.py,
  black --check, flake8 and isort on the changed files: pass;
  scripts/docs-lint.sh: pass.

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
A Kiro Workflows run lives in its chat's Kiro Agent process. When that
process dies mid-run, the chat needs a reconnect turn. That turn went
out from GET /api/workflows/kas/state and GET /api/workflows/kas/runs,
so a run reconnected only while a tab polled, and even with
agent.kas_workflows turned off, since both routes stay readable for a
run the switch was turned off under.

runtime_death gains subscribe(listener): every announced death calls
the listeners after the record is stored, and a failing listener breaks
nothing. The dashboard's Kiro Workflows triggers subscribe; each death
schedules one reconnect_after_process_exit pass, which sends nothing
while the gateway stops or the switch is off, and otherwise sends the
reconnect turn to each chat the router's due_reconnects names, keeping
its interval and try bounds. A chat whose turn is running is waited for
(up to BOOT_RECOVERY_TURN_SECS), because that turn most likely ran on
the process that died; one still busy afterwards is left to its next
ordinary turn. Turn admission now reattaches on an ordinary turn only
while the switch is on. The read routes send no turn. With the boot
pass, these are the only ways a run reconnects; none is a timer. The
visible reconnect turn is unchanged.

Specs: docs/system-specs/modules/runtime-ownership.md (the subscriber,
its one consumer, and the tests that pin it), learn-cron-dashboard.md
(the kas_workflow_triggers.py entry) and docs/feature-map/README.md.

Moved onto our copy of #25449 with git rebase --onto. That base has
no run ledger, so the exit pass no longer awaits ensure_ledger: the
runs it reconnects are in the mirror. Its tests mirror an undriven run
of chat-1 (name_chat_session, listed_run) in place of writing a ledger
file, and the switch-off case checks that no chat was tried. The
router_recovery.py comments already name the crash pass in the base,
so this commit no longer edits them. Conflicts: the poll's
_auto_reconnect is deleted; learn-cron-dashboard.md and the feature
map keep main's current text around this commit's lines. The parity
route test patches project_root.recent_project_dirs.
kas-workflows.md, "The dashboard": no read sends a turn; a process
exit does.

Verified after the move:
- pytest -n 8 on the twelve files below: 227 passed;
  test/test_flake_pattern_ratchet.py: 75 passed.
- black, isort and flake8 on the changed test file; docs-lint.sh:
  pass.

Verified on the first base (31930a7):
- pytest -n0 test/test_runtime_death_is_a_process_event.py
  test/test_runtime_death_subscribe.py test/test_acp_runtime_death.py
  test/test_kas_workflow_triggers.py test/test_kas_workflows_parity_routes.py
  test/test_kas_workflows_boot_recovery.py test/test_kas_workflows_recovery.py
  test/test_kas_workflows_optin_gate.py test/test_chat_runner_kas_observe.py
  test/test_held_note_turn_starts.py test/test_workflow_startup_lifecycle.py
  test/test_kas_workflow_mode_recheck.py: 227 passed.
- test/test_flake_pattern_ratchet.py: 75 passed.
- mypy src/kiro_crew: no issues in 4918 files; check_black_formatting.py,
  flake8 and isort on the changed files: pass; comment history and brand
  checks against origin/feat/kas-wf-2b-engine: pass;
  check_file_line_cap.py: 0 failures; scripts/docs-lint.sh: pass.

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
Turn admission's code runs on chat_runner's globals (chat_turn.compose),
and test_chat_runner_composition_contract.py refuses an owner that
imports, at load, a name the runner's tests rebind: such an owner keeps
its own object and a patch of the runner stops applying there. The
reattach gate added in the previous commit imported
kas_workflows_enabled in turn_admission.py, and the new
test_chat_runner_kas_observe.py case patches it on the runner. The
runner now imports it and turn admission names it under TYPE_CHECKING,
as it does for every other runner seam. Behaviour is unchanged.

Found by scripts/local-gate.py --base origin/feat/kas-wf-2b-engine at
4d3c5e3456: backend batch 1/7 passed (23,842 tests), batch 2/7 failed
one test,
test_chat_runner_composition_contract.py::test_no_owner_captures_a_name_tests_rebind_on_the_runner
(26,146 passed).

Verified on this tree (the gates for the whole branch, item (d)):
- pytest -n0 test/test_chat_runner_composition_contract.py
  test/test_chat_runner_kas_observe.py test/test_kas_workflows_optin_gate.py
  test/test_held_note_turn_starts.py: 196 passed. The 285 contract,
  facade, boundary, composition, posture and Kiro Workflows test files:
  13,200 passed.
- scripts/local-gate.py --base origin/feat/kas-wf-2b-engine (the port's
  own diff; main's merge-base would also rerun #25449's tests), with
  test_find_ui_auto.py's "continue with github" case deselected (it
  fails the same way on the engine head): backend 7/7 batches pass,
  168,161 tests. Frontend batches 1-3 pass (28,606 tests); batch 4 has
  the one known failure, UsageTab.spendChartHarness.test.tsx, which
  fails on the engine head too (website/ is untouched), 12,056 passed;
  batch 5, run by hand from the gate's own plan: 8,658 passed. Gate
  exit 1 for that one test only.
- HARNESS_BASE_REF=origin/feat/kas-wf-2b-engine
  scripts/check_harness_parity.py: pass. HARNESS_BASE_REF=origin/main:
  pass.
- check_black_formatting.py, check_subprocess_encoding.py, isort
  --check-only and flake8 over src/kiro_crew test conftest.py
  xdist_budget.py, mypy src/kiro_crew (no issues in 4918 files): pass.
  check_comment_history.py and check_brand_name.py against the engine
  head and against the merge-base with origin/main: pass.
  check_file_line_cap.py: 0 failures. test_flake_pattern_ratchet.py: 75
  passed. scripts/docs-lint.sh: pass.

Co-authored-by: kyleseaman <2904635+kyleseaman@users.noreply.github.com>
A Kiro Workflows run lives in its chat's Kiro Agent process, and the
idle sweep measures only the chat's own turns. So a step still working
session.timeout_secs after the chat's last turn was killed with the
process, and a chat holding a run parked on a question lost its process
at every idle expiry.

The session manager's idle hold (set_idle_hold, the sweep's union with
session.idle_exempt_keys and its re-check just before each idle reset)
moved down into our copy of #25449 with its tests and its session.md
paragraph (e49bb656f0 there). This commit keeps the dashboard half:
the workflow triggers install idle_held_sessions as that hold, naming
the chat of every run a live process here drives that is running, or
paused on an ask waiting for a person. Other paused runs, finished runs
and runs with no live process hold nothing.

Specs: session.md names the installer in place of "no code installs
one yet"; kas-workflows.md, "Reconnect and boot recovery", says the
triggers install it; learn-cron-dashboard.md (kas_workflow_triggers.py).

Moved onto our copy of #25449 with git rebase --onto. session.py,
session_cleanup.py, session_parts/sweeps.py and
test/test_session_idle_hold.py are the base's (its shorter mid-sweep
comment keeps session_cleanup.py at the 2,000-line cap). The hold tests
name the run's parent session for chat-1 in place of a ledger entry;
learn-cron-dashboard.md keeps main's current text around the entry.

Verified after the move: pytest -n 8 on test_kas_workflow_triggers,
test_session_idle_hold, test_session_bindings, test_facade_bindings and
metrics/test_session_duration: 557 passed. black --check and flake8 on
the changed files, check_file_line_cap.py (0 failures) and docs-lint.sh
pass.

Ran on the first base (31930a7): pytest -n 4 on
test_session_idle_hold, test_kas_workflow_triggers,
test_session_idle_exempt_keys, test_session_cleanup,
test_idle_sweep_backend_activity and test_idle_compaction: 243 passed;
the mid-sweep hold test fails with the pre-reset re-check removed.
The process-exit reconnect fired on every Kiro Agent process death and
sent its reconnect turn at once. An idle expiry is a death too, so a
chat holding a paused run got a reconnect turn and a new process at
every expiry, and a reconnect sent inside KAS's claim window was
refused ("just claimed by another process") with nothing retrying.

The runtime_death listener now acts only on a crash (expected False)
of a process that drove a run. It arms one pass
EXIT_RECONNECT_WAIT_SECS (45 s: KAS's 30 s run.claim TTL plus the boot
pass's 15 s slack) after the crash; a crash inside the wait moves the
pass after it, with both crashes' chats. The pass reconnects only the
chats whose runs the crashed process drove (slots_driven_by, read at
the death; due_reconnects(only=...) marks no other chat tried). The
live walk showed why: reconnecting every due chat started another
chat's process in the same project, its KAS stale-run sweep claimed
the crashed chat's run, and KAS refused that chat's reconnect.

The router half (slots_driven_by, due_reconnects(only=...) and the
router tests for both) moved down into our copy of #25449 (4bcb9aa52f
there); this commit keeps the dashboard half: the crash-only listener,
EXIT_RECONNECT_WAIT_SECS, its tests and the handler docstrings.

Specs: learn-cron-dashboard.md (kas_workflow_triggers.py),
runtime-ownership.md (the death subscriber), feature-map README, and
kas-workflows.md ("The dashboard" says the reconnect follows a crash
only; "Reconnect and boot recovery" names the crash listener as the
caller of due_reconnects and slots_driven_by).

Moved onto our copy of #25449 with git rebase --onto. router.py and
router_recovery.py are the base's, which already carry the router
half and read the run's chat from its parent session, not a ledger.
The tests name each run's parent session for its chat in place of a
ledger entry, and learn-cron-dashboard.md no longer says the pass
reads the run ledger. Conflicts in learn-cron-dashboard.md and the
feature map keep main's current text around this commit's lines.

Verified after the move: pytest -n 8 on test_kas_workflow_triggers,
test_kas_workflows_recovery, test_runtime_death_subscribe and
test_kas_workflows_parity_routes: 61 passed; black --check, flake8 and
docs-lint.sh pass.

The gate set on the branch head (this tree):
- AGENTS.md pre-commit gate: black gate, subprocess encoding,
  isort --check-only, flake8, mypy --platform linux src/kiro_crew (no
  issues in 5,016 files), check_comment_history.py and
  check_brand_name.py (each after its --test) against the merge-base
  with origin/main (378ec94) and against the branch below,
  check_file_line_cap.py (0 failures; no file this branch changes
  crosses 1,600 lines that main had under it): pass.
- docs_lint.py --test and docs-lint.sh pass; --strict-identifiers has
  the base's 99 findings and none in a spec this branch edits.
- check_harness_parity.py --test, then HARNESS_BASE_REF at origin/main
  and at the branch below: pass. scripts/scrub-lint.sh is not in the
  tree.
- Fast-gate source gates (--test, then the check, bases at
  378ec94): all pass; verify_vendor_manifest passed once the
  worktree's generated _vendor/__pycache__ folders (ignored, never
  committed) were removed.
- KAS pin diff against origin/main, Kyle's engine head and the branch
  below: empty.
- pytest: test_security_posture.py with test_kas_pin.py 85 passed;
  the flake-pattern ratchet 75 passed; every kas workflow test file
  with test_chat_runner_kas_observe, test_kas_slot_needs_person,
  test_runtime_death_subscribe and test_held_note_turn_starts 800
  passed; the session map, idle hold, facade bindings and session
  duration tests 596 passed.
- scripts/local-gate.py --base feat/kas-workflows-engine (this
  branch's diff; the known test_find_ui_auto "continue with github"
  case deselected), every batch of its plan run by label: backend 1/7
  to 7/7 23,824, 26,881, 24,442, 27,801, 26,307, 27,300 and 20,315
  passed, none failed; frontend 1/5 to 5/5 9,156, 9,091, 10,207,
  11,865 and 10,022 passed, with two known failures and website/
  identical to the base: ChatPageDrafts "leaves the draft alone when
  a staged prefill belongs to another slot" (passes alone) and
  UsageTab.spendChartHarness.

Ran on the first base (31930a7):
- pytest -n 4 on test_kas_workflow_triggers, test_runtime_death_subscribe,
  test_kas_workflows_boot_recovery, _recovery, _router, _router_bounds
  and _parity_routes: 180 passed.
- AGENTS.md static gate: black, subprocess encoding, isort, flake8 and
  mypy src/kiro_crew clean; check_comment_history and check_brand_name
  pass against the merge-base with origin/main and against
  origin/feat/kas-wf-2b-engine; check_file_line_cap, the flake-pattern
  ratchet (75 passed) and docs-lint pass; the KAS pin diff is empty.
- check_harness_parity.py passes with HARNESS_BASE_REF at
  origin/feat/kas-wf-2b-engine and at origin/main.
- scripts/local-gate.py (base origin/main, the known test_find_ui_auto
  "continue with github" case deselected): the first run stopped at
  backend 4/10 on the defect fixed in 8137814ab2. The plan's batches
  were then run one at a time: backend 1/10 to 10/10 pass (15,903,
  27,144, 25,912, 25,164, 27,977, 28,611, 25,964, 29,308, 22,735 and
  10,787 tests) except one test in 7/10,
  test_push_guard_diagnostics.py::TestPushGuardChildren::
  test_a_signal_inside_popen_wait_still_reaps_the_child, which fails
  only inside that batch and passes alone (41 passed, serial and -n 4);
  the branch changes no file it reads. Frontend 1/6 to 6/6 pass except
  the known UsageTab.spendChartHarness case (website/ is untouched).
  Backend 4 to 6, 9, 10 and the frontend batches ran before 5ba26a6fa9,
  which adds an inventory test entry and a type-only import.
- Live walk on the pinned KAS 0.66.117: two engine crashes, each
  reconnected 45.0 s later and resumed; no other chat was reconnected.
Each boot pass logged main's guard for every chat it reconnected:
"Loading the transcript window of <chat> on the event loop; the reader
did not await load_window_off_loop first". A chat restored at gateway
start has not read its transcript window, and queuing the reconnect
turn read it on the event loop, stalling the gateway on a large
transcript.

_send_reconnect, the one sender the boot pass, the crash pass and the
reconnect route share, is now async and awaits load_window_off_loop
before it queues the turn, then reads the chat again in case it went
away meanwhile. Spec: kas-workflows.md "The dashboard".

Ran: pytest -n 4 on the kas workflow tests with the dashboard's
(test_kas_workflows_*, test_kas_workflow_*,
test_chat_runner_kas_observe, test_kas_slot_needs_person,
test_runtime_death_subscribe, test_held_note_turn_starts): 804 passed.
The new triggers test fails with the load taken out. black, isort,
flake8 and mypy --platform linux on the changed files: clean.
kas-workflows.md "The dashboard" grouped GET .../slots/{slot}/runs with
GET .../state as starting no process. The runs route serves chat_runs,
which lists through a live Kiro Agent process and spawns the query
process when none is up. The bullet now says so; the state route still
starts none.

Ran: scripts/docs-lint.sh: pass.

Gates, walk fix pass. The full set on tree 47ea77b8aa (c2bcfb3bcd,
before the two doc commits): the AGENTS.md pre-commit gate (mypy
--platform linux with no issues in 5,016 files; comment history and
brand name against 378ec94 and the branch below), docs-lint.sh,
harness parity, the fast-gate source gates and the KAS pin diffs: pass;
docs_lint.py --strict-identifiers: the same 99 findings, none in
kas-workflows.md. pytest: security posture 85, flake ratchet 75, kas
workflow tests with the dashboard's 846, session tests 596 passed.
local-gate.py --base f5a7d972bb (everything that changed in the tree
since its last gated head): backend 196,535 passed in 8 batches and one
failure, test_pending_steer_queue.py's held-steer case, which passes
alone (20 passed); frontend 52,095 passed in 6 batches and the two known
failures, ChatPageDrafts.test.tsx and
UsageTab.spendChartHarness.test.tsx, on a website/ identical to
378ec94.

On this commit's tree, which differs by the base's and this commit's
spec wording only: the same static gates pass, test_docs_*.py 608 passed
and 50 skipped, the kas workflow tests 846 passed.
The crash pass and boot recovery check that a chat is idle (and, for
the crash pass, that the gateway is not stopping) before they send it
a reconnect turn. The sender then reads a cold chat's transcript
window on a worker thread before it queues the turn, so a turn the
person started during that read was not seen, and a reconnect turn
was queued behind it.

Both callers now load the window before their check. The sender's own
load then returns without suspending, so nothing runs between the
check and the queued turn. The reconnect route, which queues behind a
running turn on purpose, is unchanged. Spec: kas-workflows.md "The
dashboard".

Ran: the two new tests (a turn starts during the window read, crash
pass and boot pass) with the change undone: both failed; pytest -n 4
on the kas workflow tests: 852 passed. black, isort, flake8 and mypy
--platform linux on the changed files: clean; docs-lint.sh, comment
history against 378ec94 and the file line cap: pass.

Gates: the full set on this commit's tree
802e8f601d: the AGENTS.md pre-commit gate (mypy --platform linux with
no issues in 5,016 files, comment history and brand name against
378ec94 and the branch below, file line cap with 0 failures),
docs-lint.sh, harness parity, the fast-gate source gates and the KAS
pin diffs: pass; docs_lint.py --strict-identifiers: the same 99
findings, none in kas-workflows.md. pytest: security posture 85, flake
ratchet 75, kas workflow tests with the dashboard's 852, session tests
596 passed. local-gate.py --base e6c50751ef: backend 22,503, 26,309,
23,843, 29,608, 28,717, 29,818, 24,117 and 11,627 passed, none
failed; frontend 52,095 passed and the two known failures
(ChatPageDrafts.test.tsx "leaves the draft alone when a staged prefill
belongs to another slot", UsageTab.spendChartHarness.test.tsx).

Gates on tree da9b5eddd9 (this branch restacked
onto the base's four new commits, its own changes unchanged): the
AGENTS.md pre-commit gate (mypy --platform linux with no issues in 5,016
files; comment history and brand name against 378ec94 and the base),
docs-lint.sh, harness parity against main and the base, the fast-gate
source gates and the KAS pin diffs: pass; docs_lint.py
--strict-identifiers: the same 99 findings, none in kas-workflows.md.
pytest: doc tests 608, kas workflow tests 862, security posture with
test_kas_pin.py 85, flake ratchet 75, every test file naming
kas_workflows 868 passed; none failed. Focused on the changed code, as
the 2026-11-24 rule for small fixes says; no full local gate.

Gates on tree cbb12089af (this branch restacked
onto the base's three new commits, its own changes unchanged): the
AGENTS.md pre-commit gate (mypy --platform linux with no issues in 5016
files; comment history and brand name against 378ec94 and the base),
docs-lint.sh, harness parity, the fast-gate source gates and the KAS
pin diffs against the merge base 378ec94, Kyle's engine head and the
base: pass; docs_lint.py --strict-identifiers: the same 99 findings,
none in kas-workflows.md. pytest: doc tests 608, kas workflow tests
864, security posture with test_kas_pin.py 85, flake ratchet 75,
every test file naming kas_workflows 870 passed. None failed. Focused
on the changed code, as the 2026-11-24 rule for small fixes says;
no full local gate.
The step composer's model picker needs a route. POST
/api/workflows/kas/runs/{workflow_id}/steps/{node_id}/model takes
{model?, effort?, path?} and serves set_step_model: at least one field,
each a string of at most 200 characters, else 400 invalid_model; a step
that has not started answers 404 step_unknown, a refusal 409. It
answers the model and effort now in force. It is a control, so with the
switch off it is refused while a run is held, like a reply.

The transcript route's answer carries the step's model reading
(model, effort, defaultEffort, modelOptions, effortOptions), which the
picker shows and offers.

Spec: kas-workflows.md, "The dashboard".

Gates on this tree (run as e86039a41c, tree 1b87eb7): the
AGENTS.md pre-commit gate (black gate, subprocess encoding, isort
--check-only, flake8, mypy, comment history and brand against
378ec94 and against 6555385a57), file line cap, docs-lint and
HARNESS_BASE_REF=origin/main check_harness_parity.py pass; the KAS pin
files equal origin/feat/kas-wf-2b-engine; pytest -n0
test/test_kas_workflows_*.py 791 passed; the flake ratchet passes.
scripts/local-gate.py --base 6555385a57 (this branch before the step,
so the base commits under it count too), every batch by
label, the known find_ui "continue with github" case deselected:
backend 8 batches, 196,595 passed; frontend 6 batches, 52,095 passed
and 2 failed, both known on main: ChatPageDrafts "leaves the draft
alone when a staged prefill belongs to another slot" and
UsageTab.spendChartHarness "mounts a dollar chart, and no credits
chart, for a harness that bills in dollars".
Brings the engine branch, now on origin/main 704bfc3, under the
dashboard routes. Nine files conflicted; each keeps main's change and
the routes':

- dashboard/ws_event_scope.py: main's layout of _OWNER_ONLY_EVENTS
  with kas_workflow_revision as its last member.
- dashboard/chat_turn/turn_dispatch_gates.py: main's replay flag and
  _prompt_hooks_fired mark, inside the branch that skips the prompt
  hooks on an observe turn.
- dashboard/chat_api/slot_approval.py: after a mode change, main's
  kept-grants notice, then the step approvals rechecked.
- dashboard/slot_projection.py: a workflow parked on a person still
  counts as needs-input, with main's in_flight name.
- dashboard/chat_regenerate.py, test/test_security_posture.py: both
  sides' imports and entries.
- feature-map/README.md: main's Workflows row, then the Kiro Workflows
  row.
- runtime-ownership.md: main's sub-agent sentence, without its "no
  observer registry" sentence, since this branch adds the one
  subscriber, described in the next paragraph.
- learn-cron-dashboard.md: main's ws.py entry, then the
  kas_workflow_triggers.py entry.

Ran on this tree: black, isort and flake8 on the six changed Python
files: clean. pytest on the branch's own 21 test files and every test
file that imports a conflicted module or chat_turn/tool_approval.py
(105 files): 4,225 passed, 2 expected failures.
With main's 1,988 lines under it, dashboard/chat_turn/tool_approval.py
came to 2,025 lines, over the 2,000-line cap. _kas_step_mode_reader,
how a workflow step reads its parent chat's approval mode, moves whole
into its own owner, chat_turn/kas_step_mode.py, which the chat runner
composes like the others, so chat_runner._kas_step_mode_reader still
resolves and still runs on the runner's names. The plan handoff
comment beside the person-only check is rewrapped and says permission
request. The file is at 2,000 lines. learn-cron-dashboard.md lists the
new owner, and cli.md names its path.

test_kas_workflows_optin_gate.py's "fixture sanity" comment, which the
Inclusive Language check rejects, says what the line checks.

Ran on this tree: black, isort and flake8 on the five changed Python
files: clean. check_file_line_cap: 0 failures. pytest on the
composition, facade and line-cap tests, the workflow chat session and
opt-in gate tests and every test file that imports tool_approval,
turn_admission or the new owner (24 files): 1,563 passed.
Bring in the engine branch's commit that adds Kiro Agent's own
send_message to the chat's workflow tools. The merge met no conflict;
this branch's exact-list test of those tools follows in the next
commit.
The exact-list test of the tools a chat's active agent gains now lists
Kiro Agent's own send_message after validate_workflow, as the engine
branch adds it to WORKFLOW_CHAT_TOOLS, and drops the assertion that the
tuple leaves it out.

Checks run on this commit: black --check, isort --check-only and flake8
on the test file; check_black_formatting.py, and check_comment_history.py
and check_brand_name.py on the change, all passed; pytest
test/test_kas_workflows_chat_session.py test/test_kas_workflows_chat.py,
44 passed.
Brings the engine branch, now on origin/main 190fef0, under the
dashboard routes. One file conflicted, and kept both sides:

- security.md: main's paragraph on an app's unattended pooled task,
  then the paragraph on per-slot approval modes in main's wording with
  this branch's sentence on rechecking the held step approvals.

dashboard/chat_turn/tool_approval.py merged cleanly but came to 2,011
lines, over the 2,000-line cap: main brought it to 1,999 and this
branch adds the plan hold's 12. The credential hint, which only the
deny steer and the spec hooks' recovery read (_CREDENTIAL_HINT_CLASSES
and _credential_tool_hint_for), moves whole into
chat_turn/deny_chokepoints.py with its deny_guidance imports, so
tool_approval.py is at 1,982 lines. The chat runner composes both
owners, so chat_runner._credential_tool_hint_for still resolves and
runs on the runner's names. turn_spec_hooks.py names the new owner in
its type-checking imports, the base-surface test lists the two names
under deny_chokepoints, and learn-cron-dashboard.md's owner table says
where the hint now lives.

Ran on this tree: black --check, isort and flake8 on the four changed
Python files: clean. check_black_formatting.py, check_file_line_cap (0
failures), docs-lint, comment-history and brand checks: passed. mypy
--platform linux src/kiro_crew: no issues in 5,309 files. pytest on
the branch's own 21 test files and every test file that names the
chat runner's composition, the moved owners, the deny guidance, the
plan hold or the two specs (110 files): 6,483 passed, 2 skipped, 2
failed, the base-surface rows fixed above; after the fix the base
surface and composition contract tests: 457 passed.
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Sensitive Change Review

Sensitive files changed:

  • src/kiro_crew/security_posture_sinks_gateway.py

  • @romdr posted a complete reasoning template for 3c5da62.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

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

@romdr
romdr added this pull request to stack #47363 December 4, 2026 18:10
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 3c5da6274167c9fc81a278addd03c022afcef174 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the backend wiring sits behind agent.kas_workflows, the turn markers need a router-issued secrets.token_hex token, and the PR changes nothing under website/, so no rendered evidence is needed.

Notes

  • _kas_launch and turn._kas_observe in turn_admission.py match marker-shaped text even with the switch off. A message that fully matches a marker gets an "expired" reply instead of a model turn. Checking kas_workflows_enabled first would make the "with the switch off, chats behave as on main" claim literally true.
  • The limit the PR states is permanent until fixed: a command-watch poll's permission request that arrives between turns is denied, which fails the run. File a follow-up issue and pin a test before the switch can ever default on.

[DESIGN-REVIEWED] 3c5da62

Description read

[DESCRIPTION-READ] fa6b04b91f1e3044e0faa699352a2cf2169f24dd579bb5fe2dc5b1acc8419aa8

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 Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

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

First-Principles-Verdict: PASS

Every item is behind the agent.kas_workflows switch, which is off by default. Two parts have no consumer in this repository yet; that can be undone because they are reachable only with the switch on.

Notes

  • Item 10 — zero consumers: api_workflow_engine returns kas_backend and kas_workflows so that "the settings UI can explain whether the switch has any effect". No file under website/src reads workflows/engine or kas_backend (0 matches). Subtraction: drop both fields and return only engine until a settings control reads them.
  • Item 9 — rides along: the 619-line scripts/capture_kas_workflow.py is not among the twenty-one modules wired to the switch. It does have a cause: the base's test/test_kas_workflows_live_capture.py:4 and the X-capture rule already name this script. So this is inventory, not a finding.

What this change ships

Inventory (10 items) — 8 justified

Intent: let a dashboard chat on Kiro Agent start, follow and answer Kiro Workflows runs that survive idle timeouts, crashes and restarts. This is an ADDITION, off by default.

  1. 22 owner-only /api/workflows/kas/* routes (recipes, runs, controls, approvals, questions, reconnect) — justified
  2. A chat's turn can launch, observe and reconnect a run without sending a prompt — justified
  3. A plan approval waits for the person in every approval mode, and a Trust/YOLO sweep skips it — justified
  4. A step's approval follows the chat's current mode, and a mode change re-decides held steps — justified
  5. The idle sweep keeps a chat's process alive while its run works or waits for a person — justified
  6. A crash sends a reconnect turn after 45 s, through runtime_death.subscribe (the base docstring said "adds it with its first consumer") — justified
  7. Rewind, edit-resend, regenerate and Kiro Crew's own workflow authoring answer 409 while a run is live — justified
  8. A coalesced, owner-only kas_workflow_revision frame on /api/ws — justified
  9. A live-capture script — rides along, undeclared
  10. GET /api/workflows/engine with its kas_backend and kas_workflows fields — zero consumers

[FIRST-PRINCIPLES-REVIEWED] 3c5da62

Description read

[DESCRIPTION-READ] 72e934c89c9b00ed6aab96b93217a0c511e1b4c76131c7817df5c164d25d93cf

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.

@romdr

romdr commented Dec 4, 2026

Copy link
Copy Markdown
Author

Sensitive change review

  • Head commit: 4fe8134
  • What rule changed: No sandbox, command floor, secret scrubbing or redaction rule changed. The only sensitive file, src/kiro_crew/security_posture_sinks_gateway.py, gains two rows in _GATEWAY_SINKS, the list of output paths that redact text before it leaves the gateway. The Settings > Security panel lists these rows, and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted requires one for every module that calls a redactor. The rows name the two modules of this PR that do: dashboard/handlers/kas_workflows.py (the run rows, recipe details, step transcripts and error text the Kiro Workflows routes serve to the dashboard; every JSON body and error passes through the credential and exfiltration-URL redactor _redact_obj on its way out) and kas_workflows/chat.py (the run names a refused rewind or edit-and-resend names in its 409 answer; they come from the router's rows, which Kiro Agent and the recipe author supply, and pass through redact_via_context where the refusal is built). They sit after the existing "Workflow management responses" row, before the three Kiro Workflows rows of the PR below.
  • Before -> after (what was allowed/blocked, now): Before, on the PR below (a54a4ac), the list had 126 gateway rows (235 with the delivery part). After, on this head, it has 128 (237), and the Settings > Security panel lists two more output paths. Nothing that was allowed or blocked changes: no gate, mask or matcher reads these rows.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The rows cannot break a command or lock a user out, because only the Settings > Security panel and the tests read them. If a row were wrong, meaning its module did not redact what the row says, the panel would claim coverage that is not there, and a credential inside a recipe, a run name, a step transcript or an error from Kiro Agent could reach the browser unredacted through a Kiro Workflows route or a refused rewind.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result, because no sandbox rule or mask reads these rows. Checked instead on this head: each named module calls the redactor where its row says (dashboard/handlers/kas_workflows.py: _redact_obj on the error text and on each JSON body the routes answer, 14 calls; kas_workflows/chat.py: redact_via_context on each run name in runs_since, the list a refused rewind answers), and the registry imported from this head lists 128 gateway rows with these two and the three below. On the top of the stack before the merge of main 190fef0 (ccf8b8d, which contains every commit of this PR but its last merge), on a scratch gateway bound to 127.0.0.1 and ::1, GET /api/security/posture lists all six Kiro Workflows rows the stack adds.
  • No regression:
    • Tools still work (which tools/commands were run, result): No tool, command rule, sandbox mask or approval reads _GATEWAY_SINKS, so no tool's allow or deny can change. On the top of the stack (ccf8b8d), on a scratch gateway on loopback on 2026-12-03, three chats each started a workflow through these routes whose step wrote labels.md with its file tools and got its answer through send_message, and all three runs completed; three more runs started from the dashboard's launch route ran their first steps, one of which wrote its plan file with its file tools; one was paused and all three were stopped through the run control route.
    • Backward compatible (old config / old data / old callers still work, how checked): The tuple keeps its shape of (label, module, detail) and no existing row changes or moves out, so security_posture_controls, which joins the two parts, the Settings > Security panel and the tests read it as before. No config file or stored data holds these rows. Checked by test/test_security_posture_facade.py (the two parts join in registry order) and the snapshot shape tests in test/test_security_posture.py, both passing on this head.
    • Existing tests (which suites passed on this head): On 4fe8134, in a clean checkout with Python 3.12: test/test_security_posture.py, test/test_security_posture_facade.py, test/test_core_issue_radar_decoupling.py, test/test_core_auto_improvement_decoupling.py, test/test_core_aws_control_decoupling.py (the tests that read this list), plus test/test_kas_workflows_plan_redaction.py, test/test_kas_workflows_step_transcripts.py, test/test_kas_workflows_round4_l2.py, test/test_kas_workflows_round5.py, test/test_kas_workflows_chat.py and test/test_kas_workflows_chat_session.py (the redaction in the routes and the chat's refusal): 260 passed, 0 failed. The full suite is left to CI.
  • How to undo: Revert this PR's merge commit. The rows and the two modules' redacting code come in together, so reverting both keeps the redactor call-site test green; removing only the rows while the modules stay would fail that test. With Kiro Workflows off (agent.kas_workflows, off by default) the routes answer 409 engine_not_kas, except the reads and Stop of a run the gateway still holds.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — 🔴 changes requested (blocking)

GPT 6.1 found at least one blocking issue that must be resolved before merging 3c5da6274167c9fc81a278addd03c022afcef174. 1 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

This comment is updated in place on each push.

BLOCKING -- src/kiro_crew/dashboard/chat_turn/turn_admission.py:1572 -- Recheck the workflow switch before dispatching queued actions

_launch_reply = await launch_kas_workflow_from_turn(slot.key, message, client)
Trigger: A launch or reconnect is queued behind a busy chat, then the operator disables agent.kas_workflows before it drains. _turn_admit dispatches the marker to launch_from_turn, whose launch and reconnect paths never check the current switch.
Outcome: The queued turn sends workflow create/invoke or reconnect/resume requests after workflows have been disabled, bypassing the HTTP refusal and ordinary-turn reattachment gate.
Anchor: defect
Fix: Recheck the current workflow gate before dispatching launch/reconnect markers; consume refused tokens and return a refusal without starting or resuming work.

BLOCKING -- src/kiro_crew/dashboard/handlers/kas_workflows.py:755 -- Keep accepted launch payloads recoverable until dispatch

launch.message(run_label or name or source.strip()),
Trigger: api_kas_run_start accepts a launch into a busy chat and returns 202, but the queue waits over 600 seconds—for example, behind a plan approval. Only the token-bearing message is queued; take_launch expires its process-local payload before dispatch. A gateway restart also discards that payload.
Outcome: The accepted launch drains as “expired” rather than starting its run, losing its source, inputs and options despite the queued request remaining.
Anchor: residual/crash-data-loss-corruption
Fix: Retain authenticated, recoverable launch data for the lifetime of accepted queued work, and revalidate it when dispatched rather than expiring it while it waits.

[BLOCK-MERGE] 3c5da62
[GPT-REVIEWED] 3c5da62

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 (src/kiro_crew/dashboard/chat_turn/turn_admission.py:1571-1572): harm is LOW–MEDIUM. A launch or reconnect gets queued while workflows are on. It is detected at turn_admission.py:1386 and dispatched unconditionally at :1571. launch_from_turn (kas_workflows/router.py:1720-1752) only checks token, slot and binding, never kas_workflows_enabled (engine.py:43). So a run requested before the operator turned the switch off still starts.
Remedy cost is trivial. loaded_cfg is already in scope, and the ordinary-turn path below already gates on kas_workflows_enabled(loaded_cfg) (:1586). The fix is one guard on that same existing helper, plus consuming the token. That cost does not exceed the harm, so it is not grounds to downgrade.

F2 (fenced, src/kiro_crew/dashboard/handlers/kas_workflows.py:755): confirmed. Only the token message is queued (:754-759). The payload lives in memory in _launches with LAUNCH_TTL_SECS=600 (router_base.py:45) and is dropped by _expire_launches (router.py:1215-1218) or by a restart. The drained turn then answers "expired… nothing was started" (router.py:1736).
This loss is loud and the user can launch again, but the conditions are not extreme: a chat staying busy for more than 10 minutes, for example behind a plan approval, is ordinary. That fails the FLAG rarity bar.

[ADJUDICATION] 3c5da6274167c9fc81a278addd03c022afcef174 total=1 uphold=1 downgrade=0
UPHOLD F1 src/kiro_crew/dashboard/chat_turn/turn_admission.py:1572 reason=harm-warrants-remedy
[GPT-ADJUDICATED] 3c5da6274167c9fc81a278addd03c022afcef174

[ADJUDICATION-FENCED] 3c5da6274167c9fc81a278addd03c022afcef174 fenced=1 flagged=0
UPHOLD-FENCED F2 src/kiro_crew/dashboard/handlers/kas_workflows.py:755 -- An accepted 202 launch whose queue wait exceeds the in-memory 600s TTL (router_base.py:45, router.py:1215) or spans a restart loses its source/inputs; waiting behind a busy chat or plan approval is ordinary, so the conditions are not extreme enough to FLAG.
[GPT-ADJUDICATED-FENCED] 3c5da6274167c9fc81a278addd03c022afcef174

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 3c5da6274167c9fc81a278addd03c022afcef174 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 3c5da6274167c9fc81a278addd03c022afcef174 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 3c5da62

Verdict parsed from the review's SHA-scoped output markers for commit 3c5da6274167c9fc81a278addd03c022afcef174.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 3c5da6274167c9fc81a278addd03c022afcef174 false-positive: <reason, 20 to 500 characters>

romdr added 8 commits December 5, 2026 03:37
The workflow routes checked a launch's model and effort and a new
recipe's name against patterns that end in "$", with match. The
anchored-pattern ratchet counts that shape, because "$" also matches
before a final newline: dashboard/handlers/kas_workflows.py went from
0 to 2 sites. Both checks now use fullmatch.

A model or effort that ends in a newline, such as "high\n", passed the
check before and now answers 400 invalid_model or invalid_effort; the
new test pins that. The recipe name is stripped before its check, so
it cannot end in a newline and what it accepts does not change.

Checks run on this commit's tree:
- pytest -n 4 on the 8 test files that import the handler module:
  121 passed
- pytest -n0 test/test_wait_discipline_ratchet.py
  test/test_anchored_pattern_match_ratchet.py: this layer's file is no
  longer reported; 3 failed, 61 passed, the failures naming only layer
  1's sites (test_kas_workflows_step_transcripts.py, router.py,
  workflow_markers.py), which this branch gets when layer 1's fix
  1134b7a is merged up
- the same two files on a trial merge of 1134b7a into this commit
  (not committed, aborted after): 64 passed in committed-baseline mode
  and 64 passed with GITHUB_BASE_REF=main and FLAKE_RATCHET_BASE set to
  d646881
- pytest -n0 test/test_flake_pattern_ratchet.py against 2359152:
  81 passed
- black, isort, flake8 on the two files, mypy --platform linux on the
  handler, the comment-history, brand and line-cap gates: clean
The dashboard routes keep three module-level lists that no per-test
floor reset: the one boot-recovery task a process starts
(dashboard/handlers/kas_workflows.py _BOOT_RECOVERY), what a trigger
install undoes (dashboard/kas_workflow_triggers.py _UNSUBSCRIBE), and
the crash listeners that install subscribes (runtime_death.py
_listeners). A task one test started kept every later boot recovery
on the worker from starting, and a listener one test left would
schedule a reconnect for that test's chats when a later test
announced a death.

A new guard in test/conftest_resets_dashboard.py,
_fresh_kas_workflow_dashboard_state, gives every test an empty list
for each, through _floor_monkeypatch and only for a module already
loaded. It is bound in that file's block in test/conftest.py (1,998
lines here).

Checks run on this tree:
- pytest (-n auto) on test/test_process_cache_floor_ratchet.py,
  test_conftest_guards.py, test_conftest_teardown_imports.py,
  test_conftest_import_budget.py, test_conftest_parts_reach.py,
  test_platform_collect_ignore.py,
  test_host_isolation_floor_worker_budget.py, every
  test/test_kas_workflow*.py and test/test_runtime_death*.py,
  test_chat_runner_kas_observe.py and test_kas_slot_needs_person.py:
  1,014 passed, 1 failed. The failure is
  test_every_new_module_level_cache_has_a_per_test_reset naming the
  five router and chat names of layer 1, which the layer 1 reset
  (test/conftest_resets_kas_workflows.py) covers once it is merged
  up; none of this layer's state is named
- a two-test leak check, not committed: without the guard the second
  test reads the three entries the first one left, with it none
- black --check, isort --check-only, flake8 on the two files: clean
- check_black_formatting.py, check_subprocess_encoding.py,
  check_comment_history.py and check_brand_name.py against 2359152,
  check_file_line_cap.py: passed
Six /api/workflows/kas routes confined their project directory inline
(_project_dir reads the recent-projects file and resolves every root),
and recipe create and delete resolved the home directory inline in
_recipe_dir_allowed. Both now run with asyncio.to_thread.

A launch (POST /api/workflows/kas/runs) and the observe turn starter
queued a turn on a chat restored at gateway start without loading its
transcript window first, so the queue read the window from disk on
the loop. The launch now awaits load_window_off_loop and answers 400
invalid_slot if the chat closed meanwhile. The observe starter, which
the router calls synchronously, queues such a chat's turn from a task
once the window is loaded, after the same closed and busy checks, and
drops the router's observe token when the turn does not start, as a
start refused at once does. The kas-workflows spec says so.

Checks: pytest test/test_kas_workflow*.py,
test_chat_runner_kas_observe.py and test_held_note_turn_starts.py,
858 passed and 1 new test failed on a client read after close, fixed
and its file rerun, 21 passed; the five new tests fail on the unfixed
code. black, isort, flake8, mypy --platform linux on the handler, the
comment-history, brand, line-cap and agent-SDK boundary gates and
docs-lint pass.
…rd routes

Brings in the engine layer's ratchet fixes, per-test resets and model review fixes, so this layer is tested with them.
Brings in fullmatch for the model, effort and recipe name checks, so the anchored-pattern ratchet passes on this layer.
Brings in the RouteAccess labels of the 22 workflow routes this layer adds, so the route label test passes.
Brings in the per-test resets of the boot recovery list, the trigger unsubscribe list and the runtime death listeners.
Brings in the project and recipe directory checks off the event loop, and a launch and an observe turn that read a restored chat's window off the loop first, each with its tests.
@romdr

romdr commented Dec 5, 2026

Copy link
Copy Markdown
Author

Sensitive change review

  • Head commit: afd7cea
  • What rule changed: No sandbox, command floor, secret scrubbing or redaction rule changed. The only sensitive file, src/kiro_crew/security_posture_sinks_gateway.py, gains two rows in _GATEWAY_SINKS, the list of output paths that redact text before it leaves the gateway. The Settings > Security panel lists these rows, and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted requires one for every module that calls a redactor. The rows name the two modules of this PR that do: dashboard/handlers/kas_workflows.py (the run rows, recipe details, step transcripts and error text the Kiro Workflows routes serve to the dashboard; every JSON body and error passes through the credential and exfiltration-URL redactor _redact_obj on its way out) and kas_workflows/chat.py (the run names a refused rewind or edit-and-resend names in its 409 answer; they come from the router's rows, which Kiro Agent and the recipe author supply, and pass through redact_via_context where the refusal is built). They sit after the existing "Workflow management responses" row, before the three Kiro Workflows rows of the PR below.
  • Before -> after (what was allowed/blocked, now): Before, on the PR below (94483f0), the list had 127 gateway rows (236 with the delivery part). After, on this head, it has 129 (238), and the Settings > Security panel lists two more output paths. Nothing that was allowed or blocked changes: no gate, mask or matcher reads these rows.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The rows cannot break a command or lock a user out, because only the Settings > Security panel and the tests read them. If a row were wrong, meaning its module did not redact what the row says, the panel would claim coverage that is not there, and a credential inside a recipe, a run name, a step transcript or an error from Kiro Agent could reach the browser unredacted through a Kiro Workflows route or a refused rewind.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result, because no sandbox rule or mask reads these rows. Checked instead on this head: each named module calls the redactor where its row says (dashboard/handlers/kas_workflows.py: _redact_obj on the error text and on each JSON body the routes answer, 14 calls; kas_workflows/chat.py: redact_via_context on each run name in runs_since, the list a refused rewind answers), and the registry imported from this head lists 129 gateway rows with these two and the three below. On the top of the stack before the merge of main 190fef0 (ccf8b8d, which contains every commit of this PR but the merges that brought in main 190fef0 and fa5f024 and the fixes of the PR below, and this PR's five fix commits since then: a test fixture, the routes' access labels, fullmatch for a launch option and a recipe name, per-test resets, and the routes' file reads run off the event loop; none of them changes a redactor call), on a scratch gateway bound to 127.0.0.1 and ::1, GET /api/security/posture lists all six Kiro Workflows rows the stack adds.
  • No regression:
    • Tools still work (which tools/commands were run, result): No tool, command rule, sandbox mask or approval reads _GATEWAY_SINKS, so no tool's allow or deny can change. On the top of the stack (ccf8b8d), on a scratch gateway on loopback on 2026-12-03, three chats each started a workflow through these routes whose step wrote labels.md with its file tools and got its answer through send_message, and all three runs completed; three more runs started from the dashboard's launch route ran their first steps, one of which wrote its plan file with its file tools; one was paused and all three were stopped through the run control route.
    • Backward compatible (old config / old data / old callers still work, how checked): The tuple keeps its shape of (label, module, detail) and no existing row changes or moves out, so security_posture_controls, which joins the two parts, the Settings > Security panel and the tests read it as before. No config file or stored data holds these rows. Checked by test/test_security_posture_facade.py (the two parts join in registry order) and the snapshot shape tests in test/test_security_posture.py, both passing on this head.
    • Existing tests (which suites passed on this head): On afd7cea, in a clean checkout with Python 3.12: test/test_security_posture.py, test/test_security_posture_facade.py, test/test_core_issue_radar_decoupling.py, test/test_core_auto_improvement_decoupling.py, test/test_core_aws_control_decoupling.py (the tests that read this list), plus test/test_kas_workflows_plan_redaction.py, test/test_kas_workflows_step_transcripts.py, test/test_kas_workflows_round4_l2.py, test/test_kas_workflows_round5.py, test/test_kas_workflows_chat.py and test/test_kas_workflows_chat_session.py (the redaction in the routes and the chat's refusal): 264 passed, 0 failed. The full suite is left to CI.
  • How to undo: Revert this PR's merge commit. The rows and the two modules' redacting code come in together, so reverting both keeps the redactor call-site test green; removing only the rows while the modules stay would fail that test. With Kiro Workflows off (agent.kas_workflows, off by default) the routes answer 409 engine_not_kas, except the reads and Stop of a run the gateway still holds.

@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 Dec 5, 2026
romdr added 4 commits December 5, 2026 06:45
The workflow engine change no longer carries
scripts/capture_kas_workflow.py, to stay under the Design Review
lane's diff cap. The script, unchanged, and the three lines of
kas-workflows.md that name it come back here.

Checks: scripts/docs-lint.sh passed; check_file_line_cap.py 0 failures.
test_reconnects_run_at_most_concurrency_at_a_time held each reconnect
on an event that only a second reconnect in flight could set. A
recovery that ran reconnects one at a time, the regression the test is
there to catch, never set it, so the test hung until pytest-timeout
killed the worker instead of failing at that line.

The reconnects now wait on a release the test owns, and the test waits
for two in flight with kiro_crew.testing.wait.await_until under the
lost-run bound, so a serial recovery fails naming the bound. The
reconnect counts in_flight down in a finally, and the peak is read
before the release, after every reconnect task has run up to its first
wait. A second test runs the same check with concurrency 1 under
pytest.raises(AssertionError) and a short bound marked flake-ok: there
the expiry is the result under test.

Ran (Python 3.12, PYTHONPATH=src):
- before, the old test with concurrency=1 and --timeout=20: hangs,
  "Failed: Timeout >20.0s" at the gather
- after, the new test with concurrency=1 and --timeout=60:
  "AssertionError: 2 reconnects in flight at once with concurrency=1
  had not happened after 30.03s (lost-run bound 30.00s)"
- pytest test/test_kas_workflows_boot_recovery.py: 15 passed
- pytest test/test_flake_pattern_ratchet.py
  test/test_wait_discipline_ratchet.py: 135 passed
- black --check, isort --check-only, flake8 on the file; comment
  history, brand and line cap scripts: clean
The setting's description said no surface read the switch yet, so
setting it changed nothing. This layer wires it: with it on, a
dashboard chat's session on Kiro Agent gets the workflow tools, the
/api/workflows/kas/* routes answer, and the gateway reconnects a chat's
interrupted runs at start, and Settings can write it. The description
now says so, in the config field, config-baseline.json and the
configuration doc together. No translation catalog carries the
sentence.

Ran (Python 3.12, PYTHONPATH=src):
- pytest test/test_config_baseline.py
  test/test_configuration_doc_facts.py
  test/test_configuration_doc_defaults.py: 29 passed
- check_black_formatting, black --check, isort --check-only, flake8 on
  sections_agent.py; line cap (the file at 2,000 lines), comment
  history, brand, scripts/docs-lint.sh: clean
@romdr

romdr commented Dec 5, 2026

Copy link
Copy Markdown
Author

Sensitive change review

  • Head commit: 9b94d7a
  • What rule changed: No sandbox, command floor, secret scrubbing or redaction rule changed. The only sensitive file, src/kiro_crew/security_posture_sinks_gateway.py, gains two rows in _GATEWAY_SINKS, the list of output paths that redact text before it leaves the gateway. The Settings > Security panel lists these rows, and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted requires one for every module that calls a redactor. The rows name the two modules of this PR that do: dashboard/handlers/kas_workflows.py (the run rows, recipe details, step transcripts and error text the Kiro Workflows routes serve to the dashboard; every JSON body and error passes through the credential and exfiltration-URL redactor _redact_obj on its way out) and kas_workflows/chat.py (the run names a refused rewind or edit-and-resend names in its 409 answer; they come from the router's rows, which Kiro Agent and the recipe author supply, and pass through redact_via_context where the refusal is built). They sit after the existing "Workflow management responses" row, before the three Kiro Workflows rows of the PR below. Since the last review, on afd7cea, this PR's own changes are a bounded wait in one test, scripts/capture_kas_workflow.py brought here from the PR below with the same content, and a corrected Settings description for agent.kas_workflows, the switch, off by default, that turns these routes and a chat's workflow tools on. None of them touches a sink row or a redactor call.
  • Before -> after (what was allowed/blocked, now): Before, on the PR below (e2e1c33), the list had 127 gateway rows (236 with the delivery part). After, on this head, it has 129 (238), and the Settings > Security panel lists two more output paths. Nothing that was allowed or blocked changes: no gate, mask or matcher reads these rows. The Settings description of agent.kas_workflows said "This build has no surface that reads it yet, so setting it changes nothing.", which is false on this PR. It now says that when the switch is on, a dashboard chat's model can start Kiro Agent workflow runs, the dashboard can start, follow and answer them, and the gateway reconnects a chat's interrupted runs when it starts. The switch's default (off) and what it turns on are unchanged; an operator reading the setting is now told what turning it on allows.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The rows cannot break a command or lock a user out, because only the Settings > Security panel and the tests read them. If a row were wrong, meaning its module did not redact what the row says, the panel would claim coverage that is not there, and a credential inside a recipe, a run name, a step transcript or an error from Kiro Agent could reach the browser unredacted through a Kiro Workflows route or a refused rewind. If the Settings description were wrong, an operator could turn the switch on without knowing what it allows, which is what the old description did; the text changes no command's allow or deny.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result, because no sandbox rule or mask reads these rows. Checked instead on this head: each named module calls the redactor where its row says (dashboard/handlers/kas_workflows.py: _redact_obj on the error text and on each JSON body the routes answer, 14 calls; kas_workflows/chat.py: redact_via_context on each run name in runs_since, the list a refused rewind answers), and the registry imported from this head lists 129 gateway rows with these two and the three below. The new Settings description matches what the switch turns on in this head's code: dashboard/server_runtime/workflow_startup.py installs the turn starter, so a dashboard chat's session on Kiro Agent gets the workflow tools; the /api/workflows/kas/* routes answer, and with the switch off they answer 409 engine_not_kas; boot recovery reconnects a chat's interrupted runs; and dashboard/handlers/core_config_schema.py makes the switch writable from Settings. The text is the same in config/sections_agent.py, config-baseline.json and docs/configuration.md, which test/test_config_baseline.py and the two configuration doc tests hold together. On the top of the stack before the merge of main 190fef0 (ccf8b8d, which contains every commit of this PR but the merges that brought in main 190fef0, fa5f024 and 1333983 and the fixes and size cut of the PR below; this PR's five fix commits since then: a test fixture, the routes' access labels, fullmatch for a launch option and a recipe name, per-test resets, and the routes' file reads run off the event loop; and this head's three: the bounded wait in the boot recovery concurrency test, the capture script brought here with the same content, and the corrected Settings description; none of them changes a redactor call), on a scratch gateway bound to 127.0.0.1 and ::1, GET /api/security/posture lists all six Kiro Workflows rows the stack adds.
  • No regression:
    • Tools still work (which tools/commands were run, result): No tool, command rule, sandbox mask or approval reads _GATEWAY_SINKS or the Settings description, so no tool's allow or deny can change. On the top of the stack (ccf8b8d), on a scratch gateway on loopback on 2026-12-03, three chats each started a workflow through these routes whose step wrote labels.md with its file tools and got its answer through send_message, and all three runs completed; three more runs started from the dashboard's launch route ran their first steps, one of which wrote its plan file with its file tools; one was paused and all three were stopped through the run control route.
    • Backward compatible (old config / old data / old callers still work, how checked): The tuple keeps its shape of (label, module, detail) and no existing row changes or moves out, so security_posture_controls, which joins the two parts, the Settings > Security panel and the tests read it as before. No config file or stored data holds these rows. Checked by test/test_security_posture_facade.py (the two parts join in registry order) and the snapshot shape tests in test/test_security_posture.py, both passing on this head. The description change keeps the setting's key, type and default: agent.kas_workflows stays a bool, off by default, so an existing config.json reads as before.
    • Existing tests (which suites passed on this head): On 9b94d7a, in a clean checkout with Python 3.12: test/test_security_posture.py, test/test_security_posture_facade.py, test/test_core_issue_radar_decoupling.py, test/test_core_auto_improvement_decoupling.py, test/test_core_aws_control_decoupling.py (the tests that read this list), plus test/test_kas_workflows_plan_redaction.py, test/test_kas_workflows_step_transcripts.py, test/test_kas_workflows_round4_l2.py, test/test_kas_workflows_round5.py, test/test_kas_workflows_chat.py and test/test_kas_workflows_chat_session.py (the redaction in the routes and the chat's refusal): 264 passed, 0 failed. Also on this head, the tests of its own changes, test/test_kas_workflows_boot_recovery.py, test/test_config_baseline.py, test/test_configuration_doc_facts.py and test/test_configuration_doc_defaults.py: 44 passed, 0 failed. The full suite is left to CI.
  • How to undo: Revert this PR's merge commit. The rows and the two modules' redacting code come in together, so reverting both keeps the redactor call-site test green; removing only the rows while the modules stay would fail that test. With Kiro Workflows off (agent.kas_workflows, off by default) the routes answer 409 engine_not_kas, except the reads and Stop of a run the gateway still holds. Reverting only the description commit 9b94d7a puts the old text back and changes no behaviour.

@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 Dec 5, 2026
romdr added 2 commits December 5, 2026 16:25
A launch, reconnect or observe marker queued behind a busy turn carried
no mark the queue merge stops at. With dashboard.merge_queued_messages
on, it merged with the next queued message, and turn admission, which
knows a marker only as the whole prompt, sent the merged text to the
model: no run started although the launch route had answered 202.

The three marker sites in the workflow routes now queue the marker with
a drains_alone meta key, and _dequeue_next_message stops at it as it
does at an automation steer, whatever the merge setting says. The
kas-workflows spec states the rule beside the launch route.

Ran (Python 3.12, PYTHONPATH=src):
- pytest test_kas_workflows_parity_routes.py -k never_merge: 1 failed
  without the fix (the four entries drained as one turn), 1 passed with
  it
- pytest test_kas_workflows_parity_routes.py test_kas_workflow_triggers
  .py test_kas_workflows_boot_recovery.py test_chat_runner_kas_observe
  .py test_merge_queued_messages.py test_held_note_turn_starts.py
  test_automation_steer_row_role.py: 129 passed
- check_black_formatting, check_subprocess_encoding, isort and flake8
  on the changed files, mypy src/kiro_crew, comment history, brand,
  line cap, scripts/docs-lint.sh: clean
The Coverage Gate measured dashboard/handlers/kas_workflows.py at 74.0%
of its lines, under the 80% every new source file must reach. The
routes it had no test for were the run control (pause, resume, stop,
delete), a step reply, an approval answer, a chat's run list and its
reconnect, and the start and stop of boot recovery.

New tests drive each through the real route table and the router: a
pause reaches Kiro Agent on the process that drives the run, an
unknown action and an undriven run are refused; a reply becomes a
prompt on the parked step's session, and a missing text, an unknown
step and a busy step are refused; an Allow answers the held permission
request and a stale key answers 409; a chat's runs come with the held
requests and the revision, and a failed listing is a 409; a reconnect
reaches an open chat once and resets its tries, a closed chat is a
400; boot recovery starts once per process, stops at shutdown and ends
quietly when it fails.

Ran (Python 3.12, PYTHONPATH=src):
- the gate's per-file check (scripts/check_per_file_coverage.py, floor
  80, backend baseline) on coverage of the 46 test files naming these
  modules, sysmon core, lines only: kas_workflows.py 72.1% (459/637)
  before, 86.0% (548/637) after
- pytest test_kas_workflows_parity_routes.py
  test_kas_workflows_boot_recovery.py: 50 passed
- the four ratchets against the layer below: 150 passed; black, isort,
  flake8, comment history and brand on the two files: clean
@romdr

romdr commented Dec 5, 2026

Copy link
Copy Markdown
Author

Sensitive change review

  • Head commit: 028d6a2
  • What rule changed: No sandbox, command floor, secret scrubbing or redaction rule changed. The only sensitive file, src/kiro_crew/security_posture_sinks_gateway.py, gains two rows in _GATEWAY_SINKS, the list of output paths that redact text before it leaves the gateway. The Settings > Security panel lists these rows, and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted requires one for every module that calls a redactor. The rows name the two modules of this PR that do: dashboard/handlers/kas_workflows.py (the run rows, recipe details, step transcripts and error text the Kiro Workflows routes serve to the dashboard; every JSON body and error passes through the credential and exfiltration-URL redactor _redact_obj on its way out) and kas_workflows/chat.py (the run names a refused rewind or edit-and-resend names in its 409 answer; they come from the router's rows, which Kiro Agent and the recipe author supply, and pass through redact_via_context where the refusal is built). They sit after the existing "Workflow management responses" row, before the three Kiro Workflows rows of the PR below. Since the last review, on 9b94d7a, this PR's own changes are one fix in the dashboard's chat queue and new tests: the launch, reconnect and observe messages the Kiro Workflows routes queue in a chat (dashboard/handlers/kas_workflows.py) carry a drains_alone mark in the queue entry, and the queue's merge of waiting messages stops at it (dashboard/chat_utils_injected_rows.py); and tests of the routes' run control, step reply, approval answer, a chat's run list and reconnect, and boot recovery's start and stop, which bring dashboard/handlers/kas_workflows.py over the Coverage Gate's 80% floor. Neither touches a sink row or a redactor call. It changes what a queued launch does, so that change is under Before -> after.
  • Before -> after (what was allowed/blocked, now): Before, on the PR below (e2e1c33), the list had 127 gateway rows (236 with the delivery part). After, on this head, it has 129 (238), and the Settings > Security panel lists two more output paths. Nothing that was allowed or blocked changes: no gate, mask or matcher reads these rows. For the queue: before, with dashboard.merge_queued_messages on, a launch queued behind a busy turn merged with the next queued message into one prompt. Turn admission knows a launch only as the whole prompt, so the chat's model got the merged text, with the launch's one-time token and the chat's project folder in it, and no run started although the launch route had answered 202; a queued reconnect was lost the same way. Now each of these messages runs as its own turn, whatever the setting says, and starts its run or reconnects its runs. Other queued messages merge as before.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The rows cannot break a command or lock a user out, because only the Settings > Security panel and the tests read them. If a row were wrong, meaning its module did not redact what the row says, the panel would claim coverage that is not there, and a credential inside a recipe, a run name, a step transcript or an error from Kiro Agent could reach the browser unredacted through a Kiro Workflows route or a refused rewind. If the queue mark were wrong, a launch could again reach the model as text with its token, and no run would start; the token is good only for this chat's own launch turn and expires, and the mark changes no command's allow or deny.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result, because no sandbox rule or mask reads these rows. Checked instead on this head: each named module calls the redactor where its row says (dashboard/handlers/kas_workflows.py: _redact_obj on the error text and on each JSON body the routes answer, 14 calls; kas_workflows/chat.py: redact_via_context on each run name in runs_since, the list a refused rewind answers), and the registry imported from this head lists 129 gateway rows with these two and the three below. The queue fix is shown by test/test_kas_workflows_parity_routes.py::test_workflow_turns_queued_behind_a_busy_turn_never_merge: on a busy chat with merging on, two launches posted to the launch route, a plain message and a reconnect drain as four turns, and turn admission answers each launch and the reconnect itself; without the mark the four drain as one merged turn that is not a launch. On the top of the stack before the merge of main 190fef0 (ccf8b8d, which contains every commit of this PR but the merges that brought in main 190fef0, fa5f024 and 1333983 and the fixes and size cut of the PR below; this PR's five fix commits since then: a test fixture, the routes' access labels, fullmatch for a launch option and a recipe name, per-test resets, and the routes' file reads run off the event loop; and the five since: the bounded wait in the boot recovery concurrency test, the capture script brought here with the same content, the corrected Settings description, the queue mark for the launch, reconnect and observe messages, and the route tests; none of them changes a redactor call), on a scratch gateway bound to 127.0.0.1 and ::1, GET /api/security/posture lists all six Kiro Workflows rows the stack adds.
  • No regression:
    • Tools still work (which tools/commands were run, result): No tool, command rule, sandbox mask or approval reads _GATEWAY_SINKS or the queue mark, so no tool's allow or deny can change. On the top of the stack (ccf8b8d), on a scratch gateway on loopback on 2026-12-03, three chats each started a workflow through these routes whose step wrote labels.md with its file tools and got its answer through send_message, and all three runs completed; three more runs started from the dashboard's launch route ran their first steps, one of which wrote its plan file with its file tools; one was paused and all three were stopped through the run control route.
    • Backward compatible (old config / old data / old callers still work, how checked): The tuple keeps its shape of (label, module, detail) and no existing row changes or moves out, so security_posture_controls, which joins the two parts, the Settings > Security panel and the tests read it as before. No config file or stored data holds these rows. Checked by test/test_security_posture_facade.py (the two parts join in registry order) and the snapshot shape tests in test/test_security_posture.py, both passing on this head. The queue mark is one more key in a queued entry's meta, which the saved queue keeps with the entry's other keys; an entry saved before this head has no mark and drains as before.
    • Existing tests (which suites passed on this head): On 028d6a2, in a clean checkout with Python 3.12: test/test_security_posture.py, test/test_security_posture_facade.py, test/test_core_issue_radar_decoupling.py, test/test_core_auto_improvement_decoupling.py, test/test_core_aws_control_decoupling.py (the tests that read this list), plus test/test_kas_workflows_plan_redaction.py, test/test_kas_workflows_step_transcripts.py, test/test_kas_workflows_round4_l2.py, test/test_kas_workflows_round5.py, test/test_kas_workflows_chat.py and test/test_kas_workflows_chat_session.py (the redaction in the routes and the chat's refusal): 264 passed, 0 failed. Also on this head, the tests of its own change and the queue's merge, test/test_kas_workflows_parity_routes.py (the new test included), test/test_kas_workflow_triggers.py, test/test_kas_workflows_boot_recovery.py, test/test_chat_runner_kas_observe.py, test/test_merge_queued_messages.py, test/test_held_note_turn_starts.py and test/test_automation_steer_row_role.py: 141 passed, 0 failed. The Coverage Gate's per-file check over the 46 test files that name these modules: dashboard/handlers/kas_workflows.py 86.0% (548/637), over the 80% floor. The full suite is left to CI.
  • How to undo: Revert this PR's merge commit. The rows and the two modules' redacting code come in together, so reverting both keeps the redactor call-site test green; removing only the rows while the modules stay would fail that test. With Kiro Workflows off (agent.kas_workflows, off by default) the routes answer 409 engine_not_kas, except the reads and Stop of a run the gateway still holds. Reverting only the queue commit 37be11a lets a queued launch merge again, with the lost run above.

@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 Dec 5, 2026
Three tests made a directory link with Path.symlink_to, which fails on
Windows without the symlink privilege (WinError 1314): the create and
delete refusals behind a linked .kiro in test_kas_workflows_l4_recipes.py
and the handler's refusal of a link in home in
test_kas_workflows_project_root.py. They now use the repository's
kiro_crew.testing.links.make_dir_link, which makes a junction on Windows
and the same directory symlink everywhere else. The routes confine a
path with os.path.realpath, which follows a junction as it follows a
symlink, so each test checks the same refusal on Windows.

Ran (Python 3.12, PYTHONPATH=src):
- pytest test_kas_workflows_l4_recipes.py
  test_kas_workflows_project_root.py: 37 passed
- the four ratchets against the layer below: 150 passed
- black, isort, flake8, comment history and brand on the two files:
  clean
@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 Dec 5, 2026
@romdr

romdr commented Dec 5, 2026

Copy link
Copy Markdown
Author

Sensitive change review

  • Head commit: 3c5da62
  • What rule changed: No sandbox, command floor, secret scrubbing or redaction rule changed. The only sensitive file, src/kiro_crew/security_posture_sinks_gateway.py, gains two rows in _GATEWAY_SINKS, the list of output paths that redact text before it leaves the gateway. The Settings > Security panel lists these rows, and test_every_redactor_call_site_is_a_registered_sink_or_allowlisted requires one for every module that calls a redactor. The rows name the two modules of this PR that do: dashboard/handlers/kas_workflows.py (the run rows, recipe details, step transcripts and error text the Kiro Workflows routes serve to the dashboard; every JSON body and error passes through the credential and exfiltration-URL redactor _redact_obj on its way out) and kas_workflows/chat.py (the run names a refused rewind or edit-and-resend names in its 409 answer; they come from the router's rows, which Kiro Agent and the recipe author supply, and pass through redact_via_context where the refusal is built). They sit after the existing "Workflow management responses" row, before the three Kiro Workflows rows of the PR below. Since the last review, on 028d6a2, this PR's own change is one test commit, 3c5da62: three tests make their directory links with the repository's kiro_crew.testing.links.make_dir_link instead of Path.symlink_to, so they also run on Windows without the symlink privilege; it changes no sink row, redactor call or rule. The changes reviewed on 028d6a2, since the review on 9b94d7a, are one fix in the dashboard's chat queue and new tests: the launch, reconnect and observe messages the Kiro Workflows routes queue in a chat (dashboard/handlers/kas_workflows.py) carry a drains_alone mark in the queue entry, and the queue's merge of waiting messages stops at it (dashboard/chat_utils_injected_rows.py); and tests of the routes' run control, step reply, approval answer, a chat's run list and reconnect, and boot recovery's start and stop, which bring dashboard/handlers/kas_workflows.py over the Coverage Gate's 80% floor. Neither touches a sink row or a redactor call. It changes what a queued launch does, so that change is under Before -> after.
  • Before -> after (what was allowed/blocked, now): Before, on the PR below (e2e1c33), the list had 127 gateway rows (236 with the delivery part). After, on this head, it has 129 (238), and the Settings > Security panel lists two more output paths. Nothing that was allowed or blocked changes: no gate, mask or matcher reads these rows. For the queue: before, with dashboard.merge_queued_messages on, a launch queued behind a busy turn merged with the next queued message into one prompt. Turn admission knows a launch only as the whole prompt, so the chat's model got the merged text, with the launch's one-time token and the chat's project folder in it, and no run started although the launch route had answered 202; a queued reconnect was lost the same way. Now each of these messages runs as its own turn, whatever the setting says, and starts its run or reconnects its runs. Other queued messages merge as before.
  • Worst case if wrong (breaks commands / leaks secret / locks user out): The rows cannot break a command or lock a user out, because only the Settings > Security panel and the tests read them. If a row were wrong, meaning its module did not redact what the row says, the panel would claim coverage that is not there, and a credential inside a recipe, a run name, a step transcript or an error from Kiro Agent could reach the browser unredacted through a Kiro Workflows route or a refused rewind. If the queue mark were wrong, a launch could again reach the model as text with its token, and no run would start; the token is good only for this chat's own launch turn and expires, and the mark changes no command's allow or deny.
  • Evidence checked (which sandbox result proves it): N/A for a sandbox result, because no sandbox rule or mask reads these rows. Checked instead on this head: each named module calls the redactor where its row says (dashboard/handlers/kas_workflows.py: _redact_obj on the error text and on each JSON body the routes answer, 14 calls; kas_workflows/chat.py: redact_via_context on each run name in runs_since, the list a refused rewind answers), and the registry imported from this head lists 129 gateway rows with these two and the three below. The queue fix is shown by test/test_kas_workflows_parity_routes.py::test_workflow_turns_queued_behind_a_busy_turn_never_merge: on a busy chat with merging on, two launches posted to the launch route, a plain message and a reconnect drain as four turns, and turn admission answers each launch and the reconnect itself; without the mark the four drain as one merged turn that is not a launch. On the top of the stack before the merge of main 190fef0 (ccf8b8d, which contains every commit of this PR but the merges that brought in main 190fef0, fa5f024 and 1333983 and the fixes and size cut of the PR below; this PR's five fix commits since then: a test fixture, the routes' access labels, fullmatch for a launch option and a recipe name, per-test resets, and the routes' file reads run off the event loop; and the six since: the bounded wait in the boot recovery concurrency test, the capture script brought here with the same content, the corrected Settings description, the queue mark for the launch, reconnect and observe messages, the route tests, and the directory links of three tests; none of them changes a redactor call), on a scratch gateway bound to 127.0.0.1 and ::1, GET /api/security/posture lists all six Kiro Workflows rows the stack adds.
  • No regression:
    • Tools still work (which tools/commands were run, result): No tool, command rule, sandbox mask or approval reads _GATEWAY_SINKS or the queue mark, so no tool's allow or deny can change. On the top of the stack (ccf8b8d), on a scratch gateway on loopback on 2026-12-03, three chats each started a workflow through these routes whose step wrote labels.md with its file tools and got its answer through send_message, and all three runs completed; three more runs started from the dashboard's launch route ran their first steps, one of which wrote its plan file with its file tools; one was paused and all three were stopped through the run control route.
    • Backward compatible (old config / old data / old callers still work, how checked): The tuple keeps its shape of (label, module, detail) and no existing row changes or moves out, so security_posture_controls, which joins the two parts, the Settings > Security panel and the tests read it as before. No config file or stored data holds these rows. Checked by test/test_security_posture_facade.py (the two parts join in registry order) and the snapshot shape tests in test/test_security_posture.py, both passing on this head. The queue mark is one more key in a queued entry's meta, which the saved queue keeps with the entry's other keys; an entry saved before this head has no mark and drains as before.
    • Existing tests (which suites passed on this head): On 3c5da62, in a clean checkout with Python 3.12: test/test_security_posture.py, test/test_security_posture_facade.py, test/test_core_issue_radar_decoupling.py, test/test_core_auto_improvement_decoupling.py, test/test_core_aws_control_decoupling.py (the tests that read this list), plus test/test_kas_workflows_plan_redaction.py, test/test_kas_workflows_step_transcripts.py, test/test_kas_workflows_round4_l2.py, test/test_kas_workflows_round5.py, test/test_kas_workflows_chat.py and test/test_kas_workflows_chat_session.py (the redaction in the routes and the chat's refusal): 264 passed, 0 failed. Also on this head, the tests of its own change and the queue's merge, test/test_kas_workflows_parity_routes.py (the new test included), test/test_kas_workflow_triggers.py, test/test_kas_workflows_boot_recovery.py, test/test_chat_runner_kas_observe.py, test/test_merge_queued_messages.py, test/test_held_note_turn_starts.py and test/test_automation_steer_row_role.py: 141 passed, 0 failed; and the two files of the directory-link commit, test/test_kas_workflows_l4_recipes.py and test/test_kas_workflows_project_root.py: 37 passed, 0 failed. The Coverage Gate's per-file check over the 46 test files that name these modules, on 028d6a2: dashboard/handlers/kas_workflows.py 86.0% (548/637), over the 80% floor; on Linux this head's three tests make the same symlinks as before. The full suite is left to CI.
  • How to undo: Revert this PR's merge commit. The rows and the two modules' redacting code come in together, so reverting both keeps the redactor call-site test green; removing only the rows while the modules stay would fail that test. With Kiro Workflows off (agent.kas_workflows, off by default) the routes answer 409 engine_not_kas, except the reads and Stop of a run the gateway still holds. Reverting only the queue commit 37be11a lets a queued launch merge again, with the lost run above.

@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 Dec 5, 2026

This branch has not been deployed

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

Labels

readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant