Repository navigation
refactor: drop the unreachable control-secret derive fallback - #31339
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The PR claims the fallback is unreachable, and the code bears that out: the one constructor that sets a reference is What this change shipsInventory (4 items) — 4 justifiedIntent: give a MicroVM crew's turn route a single answer to "which secret is this crew's": the reference its launch recorded. This is a FIX (removes an unreachable branch).
[FIRST-PRINCIPLES-REVIEWED] 56fdac7 Description read[DESCRIPTION-READ] ab0525c91ec893b101d744e39ac72f6b72eef9a5dda03c5f58eb85d8b0cd3988 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The launch path is the only one that writes Notes
[DESIGN-REVIEWED] 56fdac7 Description read[DESCRIPTION-READ] f674c716ac3ad02096841a10bef70c86efe97222920ed6feb8816a7407e233a4 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 |
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: |
5ae6ce0 to
066cb7c
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/chat_turn/recovery.py, src/kiro_crew/dashboard/chat_turn/tool_rows.py, src/kiro_crew/dashboard/crash_dump_store.py, src/kiro_crew/dashboard/gateway_notice.py, src/kiro_crew/dashboard/session_transfer.py, src/kiro_crew/dashboard/session_transfer_intake.py, src/kiro_crew/snapshot_merge.py, test/test_crash_dump_store.py, test/test_session_transfer_import_body.py, test/test_slack_mirror_echo.py, test/test_transient_notice_parity.py since this head went green (31aa5b1 -> 0eecd84); CI re-running. [operator: bolichen97] |
066cb7c to
2084008
Compare
|
Rebased: main moved in src/kiro_crew/dashboard/chat_api/conductor_close.py, src/kiro_crew/dashboard/chat_api/slot_lifecycle.py, src/kiro_crew/dashboard/chat_handlers.py, src/kiro_crew/dashboard/handlers_system.py, test/test_channel_slot_close_binding.py, test/test_channel_slots.py, test/test_chat_handlers_composition_contract.py, test/test_conductor_close_closes_workers.py, test/test_config_live_restart_hint.py, test/test_config_meta_stamp.py, test/test_config_tailnet_fail_closed.py, test/test_coordinator_approval_slot_lane.py, test/test_crew_board_needs_you_dismiss.py, test/test_crewmate_feed_cold_store.py, test/test_crewmate_feed.py, test/test_eager_spawn_gate_config_source.py, test/test_open_slots_persistence_async_restore.py, test/test_open_slots_persistence_durability.py, test/test_open_slots_persistence_serialization.py, test/test_remote_crew_peer_slots.py, test/test_remove_slot_for_history_key.py, test/test_services_config_hot_reload.py, test/test_slot_chunk_retention.py, test/test_slot_close_nudge_race.py, test/test_slot_close_recreation_race_handover_metadata.py, test/test_slot_close_recreation_race_privacy_ratchet.py, test/test_slot_close_recreation_race.py, test/test_slot_close_recreation_race_takeover_dismissal.py, test/test_slot_close_recreation_race_takeover_ordering.py, test/test_slot_close_recreation_race_takeover_retraction.py, test/test_slot_create_refusal_builds_nothing.py, test/test_slot_list_rebuild.py, test/test_slot_needs_input_status.py, test/test_slot_ownership_checkpoint.py, test/test_slot_payload_lineage.py, test/test_slot_reset_interleaving_seam.py, test/test_stt_stream_config.py, test/test_unattended_slot_guardrails.py since this head went green (0eecd84 -> b993f2a); CI re-running. [operator: bolichen97] |
|
[operator: bolichen97] Both red backend shards (Linux and Windows, shard 2) come from main, not from this diff:
This PR waits for #31469 to merge, then rebases onto it and re-runs. No change to this diff. |
2084008 to
99a5411
Compare
control_secret_id built a secret name from the configured prefix and the record's tag when a matched MicroVM crew record carried no control_secret_ref. Every record is created by the launch with that reference set, and the field and its writer landed together, so no live record reaches the branch. Return "" for a record with no reference, the same "cannot authenticate" answer a row that owns no record already gets, and drop the path template and the tests that pinned its shape. Closes #24735
99a5411 to
56fdac7
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 56fdac7, no conflict, no open change request.
Problem / Motivation
Goal: The remote-crew turn route takes a MicroVM crew's control-secret name only from the reference its launch recorded, with no second way to build one.
control_secret_idinsrc/kiro_crew/dashboard/handlers_crew_turn.pyhad a fallback: when the matched crew record carried nocontrol_secret_ref, it built a name from the configuredsecret_path_prefixand the record's tag. No live record reaches that branch. The only writer of a crew record,MicroVmLaunchEngine.provision, setscontrol_secret_refwhen it creates the record, and the field and that writer landed in the same commit (#17540), so no older record without it exists.Why it matters
An unreachable branch on the path that picks which secret the gateway reads with the owner's AWS credentials is code a reader has to reason about on every security review of this route, and a second source of truth for a name the launch already recorded. Removing it leaves one answer to "which secret is this crew's".
Not a goal
What changed (motivation → approach → change)
The route already refuses a crew whose record carries no reference with
503 crew_secret_unavailable("the control secret reference is not recorded ... Relaunch the crew"), and the instances spec documents exactly that. The derive fallback was the one thing standing between that refusal and a record with an empty reference, and nothing produces such a record.So
control_secret_idnow returns the matched record'scontrol_secret_refas is, and""when there is no record or no reference. The_SECRET_PATHtemplate and theCloudConfigread that fed the fallback are gone. For a correctly launched crew nothing changes: the recorded reference was always preferred.The tests that pinned the template's shape go with it, and the test that asserted the derive ran is replaced by one asserting that a matched record with no reference resolves to nothing.
Backwards compatibility
Compatible: every crew record a launch writes carries
control_secret_ref, which was already the value returned; only the unreachable empty-reference branch now answers"".Reader: src/kiro_crew/dashboard/handlers_crew_turn.py:api_crew_turn -- crew page -- test_crew_turn_proxy.py::TestTheCredentialIsBoundToTheNodeTheTunnelDials and test_a_turn_against_a_really_registered_row_is_not_refused_for_its_secret (a recorded reference still reaches the crew; an empty one takes the existing
crew_secret_unavailablebranch)Reader: src/kiro_crew/dashboard/handlers_crew_turn.py:_SECRET_PATH -- crew page -- read only by the two shape tests in test/test_crew_turn_proxy.py, removed here
Tests
test_crew_turn_proxy.py::TestControlSecretIdLanePrecedence::test_a_matched_record_without_a_reference_resolves_nothing: a record matched on the row's node with nocontrol_secret_refresolves to"", so no name is guessed.test_the_secret_path_is_the_one_the_deploy_wroteandtest_the_path_shape_takes_the_configured_prefix, which pinned the deleted template.test_crew_turn_proxy.pyandtest_crew_turn_proxy_reply.pypass (111), plus the backend related set fromscripts/local-gate.py(158 passed).Proof: PROVEN test/test_crew_turn_proxy.py::TestControlSecretIdLanePrecedence::test_a_matched_record_without_a_reference_resolves_nothing (head 5ae6ce0)
Manual verification
N/A — unit coverage sufficient: the change removes a branch no launch reaches, and the remaining paths are covered end to end through the handler.
Screenshots / video
N/A — no frontend change.
Related Issues
Closes #24735
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)