Repository navigation
feat(workflows): Kiro Agent workflow protocol, run mirror and opt-in - #25447
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change only adds code, the switch defaults to off, and nothing reads the new protocol, mirror or capability until #25449 lands. Notes
[DESIGN-REVIEWED] 752a066 Description read[DESCRIPTION-READ] b1078592daaa482a577b264b9db142a0d28556076354538ea54776364898e6dc 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS This PR is one layer of a stack. It adds opt-in surface, off by default, that nothing on this head reads yet. All of it can be removed later, because unknown config keys round-trip ( Notes
What this change shipsInventory (9 items) — 5 justifiedIntent: let a developer on Kiro Agent opt in to driving and watching KAS's own workflow runs from Crew — ADDITION (first slice).
[FIRST-PRINCIPLES-REVIEWED] 752a066 Description read[DESCRIPTION-READ] 71c80c4bb0de3678e892dc29f57faa38870c7779989c9618f8c336e9d1c3db99 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
a98d036 to
b8172e4
Compare
|
self-added: no
|
|
self-added: no
|
|
self-added: no
|
b8172e4 to
34493fd
Compare
|
self-added: yes
|
34493fd to
b831385
Compare
|
self-added: yes
|
bolichen97
left a comment
There was a problem hiding this comment.
Requesting changes: the new live capture is below the fixture floor.
Backend Tests (3.12, 6) (and the Windows shard 6) fail with 1 failure, 32880 passed:
FAILED test/test_real_adapter_fixture_pins.py::test_every_live_kiro_and_kas_fixture_is_at_its_floor - AssertionError: kas/workflow-run-live.jsonl:agent_version is 0.58.7, below floor 0.66.33: re-capture it
This PR adds test/fixtures/acp_frames/kas/workflow-run-live.jsonl, captured off KAS 0.58.7, while the live floor for kas fixtures is 0.66.33. Please re-capture it on a build at or above the floor (and update workflow-run-live.expected.json and the README row to match). Coverage Gate fails closed from the backend lane and should clear with that.
b4874fb to
1b0bd51
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Thanks, re-checked at 1b0bd51. My earlier point is fixed: Backend Tests (3.12, 6) and the Windows shard pass, so the live capture now meets the fixture floor.
What I checked on this head:
- The opt-in really defaults off:
agent.kas_workflowsisdefault=False.kas_workflows_enabledneeds both a Kiro Agent backend and the setting, and is "off on any doubt". - No regex in product code.
- No new refusals.
.github/black-baseline.txtonly shrinks (kas_wire.pyis now formatted).
One blocking point, Coverage Gate:
1 file(s) below 80% and not baselined — add tests, do not extend the baseline:
66.7% kas_workflows/engine.py (10/15)
engine.py is small, so a few unit tests cover it:
engine_forreturnsENGINE_KASfor a backend whose capabilities havenative_workflowsandENGINE_CREWotherwise;kas_workflows_enabledis False with noagentsection, False for a non-KAS backend with the setting on, False for KAS with the setting off, and True only for KAS with it on.
I'll approve once Coverage Gate is green.
1b0bd51 to
0e76028
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Thanks, re-checked at 0e76028. The coverage point is addressed: test/test_kas_workflows_engine.py now covers engine_for and every case of kas_workflows_enabled. Coverage Gate is still running, and I'll confirm engine.py once it reports.
One new blocking point, from the GPT 6.1 lane (upheld on adjudication), kas_workflows/mirror.py:466: loads skip the mirror's own run limits. A completed load or inspect goes through apply_load() → _fold_load() with no eviction, so 210 distinct responses keep 210 terminal rows. With 500 live rows held, loading another completed run and then applying its run_start passes _ensure(), because the row already exists, and promotes it to running. Both retention limits the mirror already declares are bypassed, the run store grows from harness input without bound, and dropped stays 0.
Please:
- evict terminal overflow after a load, as the event path does;
- apply the existing live-row limit before a terminal row moves back to running, and count it in
dropped; - add a test that loads past the terminal cap and restarts past the live cap.
Happy to approve once that and Coverage Gate are green.
The first slice of Kiro Workflows on Kiro Agent (KAS): the _kiro/workflow/* method and notification names with tolerant parsers (kas_workflows/wire.py), the run mirror that folds lifecycle frames and list/load answers into run rows (kas_workflows/mirror.py), the native_workflows backend capability (ACP_BACKENDS_NATIVE_WORKFLOWS, KAS only), and the developer opt-in agent.kas_workflows (off by default). The capability set is backed by a live KAS capture (test/fixtures/acp_frames/kas/workflow-run-live.jsonl) that test_kas_workflows_live_capture.py folds through the mirror, and is registered in check_harness_parity.py's X_FEATURE_SETS. Nothing reads the opt-in yet; with it off, behaviour matches main.
…without editable settings
0e76028 to
752a066
Compare
|
self-added: yes
|
|
@bolichen97 re your review of Nov 4 at b4874fb (fixture floor): re-captured, now on head 752a066.
Your later points on the same head are in too: |
bolichen97
left a comment
There was a problem hiding this comment.
Re-checked at 752a066. Every point from my reviews is fixed:
- the shard-6 fixture floor;
engine.pycoverage, now pinned bytest_kas_workflows_engine.py(Coverage Gate passes);- the run-cap finding: loads evict down to the terminal cap, and a finished run can't come back live past the live cap, counted in
dropped, with a test for each.
The opt-in stays off by default, there is no regex in product code and no new refusal. After a rerun for the installation rate limit, Opus 5.5, GPT 6.1, Design, First Principles and UX all pass, and all 97 checks are green. Approving.
Problem / Motivation
Goal: When Crew's agent backend is Kiro Agent (KAS), a developer can turn on Kiro Workflows and launch, watch, answer and control KAS workflow runs from the dashboard, with every question or approval a run raises held for a person.
Why it matters
Kiro Agent is the default harness and ships its own workflow engine (recipes, multi-step runs, steps that park for input), but Crew drops the whole
_kiro/workflow/*surface: a KAS chat cannot start a workflow, nobody sees a run's steps, and a step that asks a question stalls with no sign anywhere. A run left to channel auto-answer paths could have a person's answer given on their behalf.Not a goal
agent.kas_workflows); with it off, Crew behaves exactly as main.workflow_run, saved Crew workflows). They keep running.What changed (motivation → approach → change)
The first slice: the protocol model and the switch, with nothing reading the switch yet.
_kiro/workflow/*method and notification names, tolerant parsers, run-row control rules,NODE_PATH_SEPkas_workflows/wire.pykas_workflows/mirror.pykas_workflows/engine.pynative_workflowscapability,ACP_BACKENDS_NATIVE_WORKFLOWS(KAS only), its backend cardagent_sdk/backends_routing.py,capabilities.py,backend_cards.pyacp/kas_wire.pyagent.kas_workflows(default off), set only inconfig.json: no dashboard control and no reader on this headconfig/sections_agent.py,config/loader_builders.py,config-baseline.jsonkas_wire.pydropped from the black baseline (it is now black-clean).github/black-baseline.txtX_FEATURE_SETStest/fixtures/acp_frames/kas/workflow-run-live.jsonl,scripts/check_harness_parity.pyStack
Split out of #25395, which was over the 1 MB review cap. Merge bottom-up. Only a PR based on
maingets CI (ci.ymlandfast-gate.ymlrun onpull_request: branches: [main]), so each stacked PR is rebased ontomainonce the one below it merges. A and the B1a protocol PR do not depend on each other. C2's UI uses A's card, so C2 carries A's commit until A merges.feat/kas-wf-1-session-cardsmainfeat/kas-wf-2-backendmainfeat/kas-wf-2b-enginefeat/kas-wf-2-backendfeat/kas-wf-2c-dashboardfeat/kas-wf-2b-enginefeat/kas-wf-3-person-holdsfeat/kas-wf-2c-dashboardfeat/kas-wf-4-frontendfeat/kas-wf-3-person-holdsfeat/kas-wf-4b-frontend-uifeat/kas-wf-4-frontendBackwards compatibility
Compatible: the new switch defaults to off and nothing reads it in this PR; the capability set adds a field.
Removes nothing: only additions.
Tests
test_kas_workflows_mirror.py: the five bound tests (test_every_kept_kas_text_is_cut_to_the_reason_cap,test_per_id_maps_stop_taking_new_node_ids_at_the_cap,test_ids_sessions_models_and_list_rows_are_cut_like_any_kas_text,test_wide_lists_and_plans_are_capped_as_a_whole,test_live_runs_past_the_cap_are_not_recorded_and_each_lossy_input_logs_once) fail on the first commit and pass on the second.test_kas_workflows_wire.py,test_kas_workflows_mirror.py,test_agent_sdk_capabilities.py,test_editable_config_enum_parity.py.test_kas_workflows_engine.py: the engine choice and the single gate (KAS AND the opt-in, off on any doubt).test_kas_workflows_live_capture.pyfolds the live capture (KAS 0.66.70, kiro-cli 2.37.1, at the fixture floor) through the mirror, and checks therecipes_changedpush KAS 0.66 sends.check_harness_parity.py(tree and base),check_acp_frame_host_data.py, config baseline, pytest over the KAS and contract tests.Proof: not provable -- other: feature PR, not a fix; each behaviour has its own test named above.
Manual verification
N/A — no runtime path reads this code yet; the live capture is the end-to-end evidence.
Screenshots / video
N/A — this PR changes no website file, so it has no rendered surface.
Related Issues
N/A — no tracking issue, by the owner's choice.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)