Skip to content

fix(cloud): bring the Fargate engine up to the widened LaunchEngine protocol - #11422

Closed
pepmach wants to merge 1 commit into
mainfrom
fix/fargate-engine-login-target-protocol
Closed

pepmach wants to merge 1 commit into
mainfrom
fix/fargate-engine-login-target-protocol

Conversation

@pepmach

@pepmach pepmach commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Restore FargateLaunchEngine conformance with the widened LaunchEngine protocol. Default identities keep the existing immediate sign-in result. A non-default identity returns a verified refusal because the Fargate engine does not pin a Kiro identity.

Problem / Motivation

Current main fails two deterministic tests in test/test_fargate_launch_engine.py. The Fargate engine lacks the login_target keyword and its sign-in handle lacks the protocol's error member.

Merge Contract state
#9840 (9ab334b435) Added login_target to LaunchEngine.begin_signin and error to SigninHandle.
#11230 (2e4cc9e16b) Added the Fargate implementation from an older base, without those members.
Combined on main The signature and handle-member conformance tests fail.

Why it matters

Every pull request whose merge ref includes current main inherits these Backend Tests failures. The fail-fast matrix then cancels sibling work and blocks PR Readiness for unrelated changes.

What changed (motivation → approach → change)

Keep the widened protocol as the source of truth. In src/kiro_crew/cloud/fargate_engine.py, FargateSigninHandle now provides an empty error, and FargateLaunchEngine.begin_signin accepts login_target.

A missing or default target preserves the existing immediate success path. A non-default target sets a one-sentence error on the handle, so the launch job records a verified refusal instead of claiming that Fargate pinned the requested Kiro identity.

The cloud system specification records this behavior. The protocol-member test now includes error, and one behavior test covers None, the default target, and a non-default target.

Tests

Evidence Result
Original reproduction 2 failed: begin_signin: ['instance_id', 'profile', 'region'] != ['instance_id', 'profile', 'region', 'login_target']; the protocol-member test also showed the pre-merge error mismatch.
Red-first focused run 3 failed: signature mismatch, FargateSigninHandle is missing error, and unexpected keyword argument 'login_target'.
Focused red-first tests after fix 3 passed.
test/test_fargate_launch_engine.py 46 passed.
Fargate and cloud-launch job set 93 passed.
Black ratchet, isort, mypy, docs lint, changed-file flake8, whitespace Passed.
Whole-tree flake8 Only the unrelated src/kiro_crew/dashboard/handlers/sessions.py:7 F401 on main, tracked by #11415.

Manual verification

N/A. Unit coverage exercises the protocol signatures, concrete handle members, and all three login-target cases without calling AWS.

Related Issues

Fixes #11417

Also resolves #11416 (same defect, filed in parallel)

Pattern harvest

Not generalizable: cross-PR merge race (#9840 widened a Protocol, #11230 added an implementer from an older base; each green alone). The signature-conformance test that caught it is the right guard; nothing to add.

Checklist

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

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

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of ac225d1041da87ce0732936abcfb21ae5262acce — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

When wiring engine_for later, validate login_target pre-provision — this refusal fires post-provision, leaving a billing Fargate task on a FAILED job.

[DESIGN-REVIEWED] ac225d1

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of ac225d1041da87ce0732936abcfb21ae5262acce and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] ac225d1

False positive or not applicable? A repository writer can comment:
/ai-review override gpt ac225d1041da87ce0732936abcfb21ae5262acce: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] ac225d1

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable ac225d1041da87ce0732936abcfb21ae5262acce: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

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

First-Principles-Verdict: PASS

Accepting login_target bypasses the preflight refusal: a non-default target now fails after provision(), not before — safe only while nothing registers this engine.

What this change ships

Inventory (6 items) — 6 justified

Intent: unwedge main's red Backend Tests by making the Fargate engine conform to the already-widened LaunchEngine protocol — a FIX (red on base, issues #11417/#11416, base test asserts four attributes against a five-attribute protocol).

  1. Fargate begin_signin accepts the protocol's login_target keyword; the red conformance tests pass — justified
  2. Fargate sign-in handle carries an empty error member — justified
  3. A non-default Kiro identity on a Fargate launch records a verified refusal instead of claiming sign-in success — justified
  4. Protocol-member test now asserts five attributes including error — justified
  5. New test covers None, default, and non-default targets — justified
  6. cloud.md engine row documents the refusal, same commit — justified

[FIRST-PRINCIPLES-REVIEWED] ac225d1

@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 Sep 17, 2026
@didhd didhd mentioned this pull request Sep 17, 2026
5 tasks done
didhd added a commit to didhd/KiroCrew that referenced this pull request Sep 17, 2026
Give macOS Cmd+W to the native Window menu and use Option+Shift+W
for session close. Preserve hide-to-tray for the main window and ask
before discarding unsaved work in secondary windows. Keep browser
pages and their control owners alive until the user confirms closing.

Include the Fargate protocol compatibility repair from PR kirodotdev#11422 so
inherited backend CI failures do not hide regressions in this change.

Co-authored-by: Stan Tian <273962421+pepmach@users.noreply.github.com>
didhd added a commit to didhd/KiroCrew that referenced this pull request Sep 17, 2026
Give macOS Cmd+W to the native Window menu and use Option+Shift+W
for session close. Preserve hide-to-tray for the main window. Confirm
every secondary close before renderer teardown: unload probes can
discard unsaved work when a renderer accepts or times out. Keep browser
pages and their control owners alive until the user confirms closing.

Include the Fargate protocol compatibility repair from PR kirodotdev#11422 so
inherited backend CI failures do not hide regressions in this change.

Co-authored-by: Stan Tian <273962421+pepmach@users.noreply.github.com>
didhd added a commit to didhd/KiroCrew that referenced this pull request Sep 17, 2026
Give macOS Cmd+W to the native Window menu and use Option+Shift+W
for session close. Preserve hide-to-tray for the main window. Confirm
every secondary close before renderer teardown: unload probes can
discard unsaved work when a renderer accepts or times out. Keep browser
pages and their control owners alive until the user confirms closing.

Include the Fargate protocol repair from PR kirodotdev#11422 and the ledger test
fixture repair from PR kirodotdev#11445 so inherited backend CI failures do not
hide regressions in this change. Correct the remaining crew event
fixture to use its valid type without changing production validation.

Co-authored-by: Stan Tian <273962421+pepmach@users.noreply.github.com>
Co-authored-by: Raymond Chen <45910466+chenmingwei23@users.noreply.github.com>
…rotocol

#9840 added the login_target keyword and SigninHandle.error contract. #11230's Fargate engine predates that widening.

Add both missing members. Default targets keep the existing immediate success path. Non-default targets return a verified refusal because the Fargate engine does not yet pin a Kiro identity.

Fixes #11417
Duplicate report: #11416
@pepmach
pepmach force-pushed the fix/fargate-engine-login-target-protocol branch from ab31b00 to ac225d1 Compare September 17, 2026 06:11
@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention labels Sep 17, 2026
@pepmach

pepmach commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

Superseded: jeeshofone's #11442 merged at 06:22 with the same two protocol members plus a preflight login_target_refusal (refusing before provisioning -- the better shape). Closing this one; #11417 is already closed by that merge.

@pepmach pepmach closed this Sep 17, 2026
@pepmach
pepmach deleted the fix/fargate-engine-login-target-protocol branch September 17, 2026 06:40
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

1 participant