Repository navigation
fix(cloud): name the one Protocol keyword the Fargate engine may omit - #11432
iamwhatever wants to merge 1 commit into
Conversation
The LaunchEngine Protocol gained an optional `login_target` keyword on `begin_signin` and an `error` member on SigninHandle. The Fargate engine implements neither, which `launch_job` explicitly supports: `_begin_signin_with_target` inspects the signature and calls the three-argument shape when the keyword is absent, and `error` is documented as read through `getattr` so older handles still conform. The conformance test compared signatures for exact equality and pinned the handle's attribute set with an equality, so both assertions failed on a supported implementation and every branch merging main inherited the red. The omission is load-bearing. `_check_signin_target_supported` decides whether an engine can honour a requested identity by asking whether `begin_signin` accepts `login_target`, and refuses at preflight when it cannot, before anything is provisioned or billed. A Fargate container is handed its credential at run time and performs no interactive sign-in, so accepting the keyword to satisfy the test would turn that refusal into a launch that signs the crew in as the wrong identity. Both assertions stay exact. A module-level SUPPORTED_OMISSIONS names the single `(method, parameter)` pair this engine may leave off, with the reason, and the signature comparison accepts the Protocol's parameter list either whole or minus that one pair; anything else still fails. The handle's attribute set moves to the Protocol's current five members rather than being loosened, so a member added upstream still reds the test until the handle carries it. FargateSigninHandle gains `error = ""`, which is the truth for a handle that performs no sign-in.
|
Intent: Get Not a goal: changing the Protocol, changing what any engine actually does, |
GPT 5.6 Review — 🔴 changes requested (blocking)GPT 5.6 found at least one blocking issue that must be resolved before merging This comment is updated in place on each push. BLOCKING -- test/test_fargate_launch_engine.py:115 -- Protocol conformance ratchet is replaced by an allowlist Adjudication (Opus 4.8) — is blocking on each finding proportionate?F1 is fenced (annotate-only). I opened the test and the runtime it guards. The allowlist is pinned to exactly one The single permitted omission is independently guarded at runtime, so it cannot produce the "wrong identity" harm the keyword exists to close: The condition that would turn this loosening into unbounded harm — a new security-relevant keyword slipping through undetected — is one the test's own construction prevents (it reds), and the one shape it does admit is safe by an independent runtime refusal. Complete record, extreme/self-contradicting harm condition → FLAG. [ADJUDICATION] 33a6d0f total=0 uphold=0 downgrade=0 🏷️ Fenced finding(s) machine-flagged as likely edge caseThe security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override. The annotate-only pass judged the condition combination each one requires extreme, and pre-drafted the override rationale below. A repository writer must independently verify a rationale before posting it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop.
False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 33a6d0f |
Opus 4.8 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: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify mutant #5 once — a second optional Protocol keyword must still red the test — since the carve-out's boundary rests on the author's local run. Both base failures are mechanically real in the checkout: the Protocol ( What this change shipsInventory (4 items) — 4 justifiedIntent: FIX — turn main green by teaching two Fargate conformance tests the omission the runtime contract deliberately supports.
[FIRST-PRINCIPLES-REVIEWED] 33a6d0f |
|
self-added: no
The mutation evidence behind line 2, each run against this head's assertions:
I am not posting the override — a repository writer must decide that. The reason |
|
Measurement: main currently has TWO red Fargate tests, and this PR is the only one Observed on an unrelated PR's Windows shard (run 35175176922, a ledger-only change, So #11230 landed an engine whose This PR closes the first by NAMING the omission in Why the naming route matters, measured on origin/main: A Fargate container is handed its credential through task-definition secrets and runs Note the other three cannot merge on their current heads either: every open PR is |
|
The twelve reds on this board are no longer real. #11445 merged at 05:43:57Z as This PR's base is still What remains red on main is only break C, which is what this PR fixes: For the record, #11442 is now APPROVED and already rebased onto |
|
Closing: superseded by #11442, which merged and fixes the same red. #11442 took the other direction — the engine now accepts The conformance test on One note for the record, since the discussion on this PR turned on it: the reason No code from this branch is being carried forward. |
Problem / Motivation
Backend Tests (Windows)is red onmain, so every PR that merges currentmaininherits it. Two conformance tests in
test/test_fargate_launch_engine.pyfail:Because the shard matrix is fail-fast, that one failure also cancels a sibling
shard, so a contributor sees two red Backend Tests checks and a failed
PR Readinessfor something their branch never touched.Why it matters
Nobody can tell their own breakage from this one. A red that belongs to the base
teaches contributors to ignore red, which is how a real failure ships.
What changed (motivation → approach → change)
The one keyword the Fargate engine is allowed to leave out is now named, with
the reason, instead of the whole comparison being red about it.
begin_signin.login_targetSigninHandlegains a member the handle lacksFargateSigninHandlecarrieserror""🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged
LaunchEngine.begin_signingained an optionallogin_target, andSigninHandlegained
error.FargateLaunchEngineimplements neither, andlaunch_jobis builton exactly that:
_begin_signin_with_targetinspects the signature and calls thethree-argument shape when the keyword is absent, and
erroris documented as readthrough
getattr"so older handles still conform". The test compared signaturesfor equality and pinned the handle's attribute set with an equality, so a
supported implementation read as a broken one.
The omission is load-bearing, which is why this fixes the test and not the engine.
_check_signin_target_supporteddecides whether an engine can honour a requestedidentity by asking whether
begin_signinacceptslogin_target, and refuses atpreflight when it cannot — before anything is provisioned or billed. A Fargate
container is handed its credential at run time and performs no interactive
sign-in, so making it accept the keyword to satisfy the test would replace that
refusal with a launch that signs the crew in as the wrong identity: the defect the
keyword was added to close. Refusing inside
begin_signininstead would move thefailure after provisioning and strand a billing task.
So a module-level
SUPPORTED_OMISSIONSnames the single(method, parameter)pair, carrying that reasoning, and the signature comparison accepts the Protocol's
parameter list either whole or minus that one pair. The handle's attribute set
moves to the Protocol's current five members. In
src/kiro_crew/cloud/fargate_engine.py,FargateSigninHandlegainserror = "",which is the truth for a handle that performs no sign-in.
On the ratchet rule
a-ratchet-may-only-tightenis blocking and matchestest/**/*.py, so this isstated up front rather than left to be found.
Neither assertion is loosened. Both stay exact equalities. The signature check
gains one named exception whose reason is in the code beside it, and the handle's
member set moves to its new true value with its docstring — the rule's own
"Allowed" case. Nothing becomes
>=,<=,inorissubset, noskiporxfailappears, and no timing budget moves. A future optional keyword still redsthis test until someone decides, for that keyword, what was decided for this one.
The five mutants below are the evidence, including one that adds a second
optional keyword to the Protocol and confirms the carve-out does not stretch to
cover it.
Tests
The two failing tests are the tests. Verified in this order:
assertion text exactly.
test_fargate_launch_engine.pyandtest_cloud_launch_job.pyare green together (92 tests).required parameter, a reordered parameter list, a handle missing a Protocol
member, and a second optional Protocol keyword the engine omits.
Manual verification
N/A — unit coverage sufficient: the change is entirely within the assertions of
two tests plus one always-empty attribute, and the mutants exercise both the
carve-out and its boundary.
Pattern harvest
Rule candidate: review-prompt
Pattern: a conformance test that pins another module's Protocol with an exact
equality, when that Protocol documents a member or keyword as optional. The
equality then fails on a supported implementation, and the comfortable fix is to
make the implementation accept something it cannot honour.
Related Issues
Fixes #11417