Repository navigation
refactor(config): flatten the store-binding chain in the resolver - #12803
Conversation
|
Intent: Make the three-way memory-store choice in |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] c86485f |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsThe diff is a pure structural refactor: the nested conditional expression and the new No findings. [OPUS-REVIEWED] c86485f 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 Confirm CI ran the store-binding suites green on this head — the claimed 787-test pass is the only evidence I could not reproduce. What this change shipsInventory (1 item) — 1 justifiedIntent: make the three-way memory-store precedence in
The diff is exactly the one hunk the description claims (7+/10−, one file, comment untouched); I verified the rewritten form at [FIRST-PRINCIPLES-REVIEWED] c86485f |
ebf6169 to
ae826be
Compare
ae826be to
21e7287
Compare
|
Tracked at #12877, filed earlier today from run 35759085445 — a different head than this one. Why it is not attributable here:
Left unfixed on purpose. The fix belongs to #12877 and lands in
|
The memory-store choice in resolve_agent_bindings read as a nested conditional expression whose middle arm was itself a conditional, so the three-way decision (execution record, passthrough, configured member) had to be reassembled from the reader's inside out. State the three arms as an if/elif/else in the order they are decided. Same arms, same order, same short-circuiting: require_member_memory_store is still reached only when no execution record and no passthrough apply, so its directory validation and refusal fire on exactly the same inputs.
21e7287 to
c86485f
Compare
|
The root cause landed on So this branch is now rebased onto Supporting attribution, for the record: the same test — The diff itself is unchanged by the rebase: still one file, Gates re-run on the rebased head with the Python 3.12 parity venv: Disposition of every verdict on the previous headThe rebase preserved the diff byte-for-byte, so each of these was reviewed against identical content:
No unresolved review threads. |
GPT 5.6 Review —
|
|
Housekeeping: there are two The rate-limit window described above also broke the GPT lane's update-in-place. That lane failed with "Could not read this PR's comments after 3 attempts", so when it retried it posted a second
The Full state on Not merging and not arming auto-merge — landing is the maintainers' call. |
…odotdev#12803) The memory-store choice in resolve_agent_bindings read as a nested conditional expression whose middle arm was itself a conditional, so the three-way decision (execution record, passthrough, configured member) had to be reassembled from the reader's inside out. State the three arms as an if/elif/else in the order they are decided. Same arms, same order, same short-circuiting: require_member_memory_store is still reached only when no execution record and no passthrough apply, so its directory validation and refusal fire on exactly the same inputs.
Problem / Motivation
resolve_agent_bindingsinsrc/kiro_crew/config/loader.pypicks which memorystore a session reads. It made that three-way choice as one conditional
expression nested inside another, so the reader had to unwrap it from the inside
out to learn which arm wins.
Why it matters
That statement decides a memory silo. Reading the wrong store answers a crew
with someone else's memory and nothing goes red — the prompt is well formed and
the content is plausible. A reader is the only detector this code has, so how
easily the precedence can be read is part of how safe it is.
What changed (motivation → approach → change)
The store choice now reads top to bottom as the three cases it always was.
execution_context.store.store_idDEFAULT_MEMORY_STORErequire_member_memory_store(...)One
if/elif/elsereplaces the nested conditional expression. Nothing elsemoves: the same three conditions in the same order, spelled the same way
(
execution_context is not None, then barepassthrough), andrequire_member_memory_storeis still evaluated only in the last arm, so itsdirectory validation and its
UnknownMemoryStorerefusal fire on exactly theinputs they fired on before.
This is the whole diff — 7 added lines, 10 removed, one file, no import moved
and no comment rewritten. It is one module's turn in a behavior-preserving
readability sweep of
src/kiro_crew/config/; the module's mechanical-candidatequeue is empty after it.
The
kiro_agentconditional three lines below keeps its expression form onpurpose. It is one two-arm conditional that already reads top to bottom, not a
nested one, so flattening it would add lines without making any precedence
easier to see. Folding both assignments under a single
ifon the sharedexecution_context is not Nonetest would couple two independent bindings toone branch structure, which is a larger change than a readability pass should
make.
Backwards compatibility
Compatible: the statement chooses the same store for every combination of
execution_contextandpassthrough, and raises the same exception in the samecases, so no caller or configuration behaves differently.
Tests
No new tests. The change is provably equivalent rather than a behavior change,
and the existing suites already cover every arm:
test/test_config_loader.py,test/test_crew_memory_store_binding.py,test/test_member_memory_ownership.pyand
test/test_memory_v2_isolation.py— 787 tests, all passing on this head.Manual verification
N/A — unit coverage sufficient: a pure control-flow flatten of one assignment
has no runtime surface that a manual step reaches but the store-binding and
ownership suites do not.
Why no screenshot: backend-only diff — one Python statement in
config/loader.py, no frontend path touched, so nothing rendered changes.Related Issues
no linked issue: routine readability work, not a reported defect.
Checklist