Repository navigation
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS Default export contract re-pinned on a heavier payload; the authorizing record the PR itself defers to (RFC or maintainer override) is not verifiably in place. Watch
[DESIGN-REVIEWED] 8e9753c |
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 -- src/kiro_crew/cli_commands.py:3152 -- Initial legacy-space stamp makes concurrent exports discard valid vectors Adjudication (Opus 4.8) — is blocking on each finding proportionate?F1 conditions confirmed against code: legacy store ( Recovery path ( Rarity: the trigger is a microsecond-wide timing race between two adjacent reads that must coincide with a legacy store's one-time first stamp — a legacy-only artifact plus a contradicting-timing precondition — and the stamp value is the same bundled-default identity [ADJUDICATION] 8e9753c 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: |
First Principles Review (Fable 5) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK Default Not justified as shipped
What this change shipsInventory (10 items) — 7 justifiedIntent: FIX — make a memory export→import round trip keep its embedding vectors instead of silently degrading to keyword-only search.
List capped at 10: two trivial riders (a comment reword in Blockersproduct-shape change without accepted RFC — the default payload of [FIRST-PRINCIPLES-REVIEWED] 8e9753c |
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: |
750908c to
3638719
Compare
3638719 to
8f2153a
Compare
|
/ai-review override gpt 8f2153a: The mismatched-row-vector trigger requires a hand-tampered payload the export writer cannot produce (export ships each row's own stored BLOB verbatim, and the carry additionally requires an exact space-signature match plus an embedder that cannot re-derive); consequence is bounded to mis-ranking the tampered rows themselves — row text and keyword search import intact — and is curable by re-importing a clean payload, matching the adjudicator's FLAG rationale. |
Human judgment recorded@CrysisDeu marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Verify one behavior change: Suggestions
[UX-REVIEWED] 8e9753c |
cixuuz
left a comment
There was a problem hiding this comment.
The summary says episodic entries are re-embedded inline, but CLI import constructs a store without embed_fn; export's episodic query omits embedding, and write_episodic therefore lands those rows NULL on that path. They are also absent from semantic_unembedded and its CLI caveat. Please either carry/count episodic vectors too or state explicitly that episodic vector preservation is deferred and remains keyword-only until gateway backfill.
iamwhatever
left a comment
There was a problem hiding this comment.
This feature is good, but should we also export the model id as well? The embedding can only work when it is generated by the same model with what the user is using. Since we allow the user to switch the embedding model to their own one, so I think it is required to export this thing as well so the import side can do verification.
12ceebc to
ca233c3
Compare
|
|
ca233c3 to
2ea3c09
Compare
|
|
2ea3c09 to
67cefdd
Compare
|
|
Not approving for now: this PR still carries my own outstanding CHANGES_REQUESTED (export the embedding model id, since a vector is only reusable when it came from the same model), plus cixuuz's unanswered point that the CLI import builds a store without an embed_fn while the export omits the episodic embedding column. Both need resolving before approval. |
|
@iamwhatever — both points are already resolved on the current head
Head is fully green (readiness success). Re-requesting your review; happy to adjust if anything in the verification path looks off. |
|
@iamwhatever @bolichen97 — gentle re-request. Since the last review round the branch has been rebased onto current
Board on this head: every Linux and Windows shard, Coverage, Frontend Lint, E2E and both AI review lanes are green; the macOS shards are queued behind the runner backlog. The one remaining red is the First Principles lane, which asks for a maintainer decision on the default-on episodic vector carry in |
|
@iamwhatever @bolichen97 -- gentle follow-up on this one. Since the last update the branch was rebased once more onto current The single remaining red is the First Principles Review lane's product-shape item on the default export payload carrying vectors. That default is now a recorded maintainer decision (see the "Product decision" section in the description, with the round-trip rationale and Happy to address any review comments quickly. Thanks! |
|
@iamwhatever @bolichen97 -- daily follow-up, nothing changed since yesterday's recap: head is still Whenever you have a moment for a pass, I'll turn comments around quickly. Thanks! |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days. I reviewed the blockers but they require your input:
The mechanical items behind these — the merge conflict with When you've addressed these, the pipeline will re-assess on its next cycle. |
|
Triage note (open-PR overlap scan, 2026-10-05): this PR needs a rebase I read the full diff against merge-base Status: still needed on main. Issue #9732 is still open. On main, Rebase needed. The head is 2510 commits behind main.
Breaking change / P0: I did not open a new request-changes review. The default export payload does change: two new top-level keys, an Recommendation: rebase onto main, fold the vector carry into main's |
|
Superseded by #25775, which redoes this fix on current main after |
Summary
memory importrestores semantic entries with NULL embeddings (keyword-searchable only) until the gateway's boot-time re-embed sweep runs. Episodic entries fare no better on the CLI path: the export's episodic query omitsembedding, and import's inline_try_embedreturns None on the CLI store (noembed_fn), so they land NULL too.memory exportalso serializes each semantic row's embedding BLOB throughjson.dumps(..., default=str), shipping an unrestorablereprstring (~13.6 KB per 1024-dim row, measured).This change makes semantic AND episodic vectors travel end-to-end, and names the model they came from:
set_semantic/_write_semanticgain a keyword-onlyembeddingparameter mirroringwrite_episodic's. A valid vector (exact store width, finite, float32-packable) is persisted verbatim in place of the step-8.5 embed tail; anything else — including a legacyrepr-string payload — is dropped and the row lands NULL for the sweep. When the caller namesembedding_space, the durable space signature is re-read inside the sameBEGIN IMMEDIATEtransaction as the vector UPDATE, so a reconcile in another process cannot interleave between check and persist. Nothing in the persist branch can raise after the row commit.memory exportships each semantic and episodic row'sembeddingBLOB as base64 of its packed float32 bytes (key dropped when NULL; ~5.5 KB per 1024-dim row instead of ~25 KB as a JSON list, and decoded on import as onebytesobject rather than a thousand Python floats -- what keeps a 10,000-episode import'sjson.loadsbounded) and appends a top-levelembedding_space_sigafter every pre-existing key, the opt-inmarkdowncollection included. The signature is read on both sides of the row reads and shipped asNonewhen a live model swap landed in between, so vectors are never attributed to a space they may not belong to. A store with vectors but no recorded signature (it predates space versioning) is signed with the bundled model's space -- the provable identity of every un-versioned vector -- instead of shipping them unsigned. The payload is streamed:_write_export_jsonwritesjson.JSONEncoder(indent=2).iterencode()'s chunks straight to the file or stdout (identical bytes --dumpsis the join of those chunks), and the encoder'sdefaulthook encodes each vector BLOB only when it reaches that row, so a 10,000-episode export never holds the expanded vectors or the whole JSON string in memory at once (review point).--no-vectorsships the old-weight payload for piped backups: noembeddingkeys, no episodic vector read, unsigned.get_episodic_listgains an opt-ininclude_embeddingso the dashboard list payload keeps its shape.embedding_model(new top-level key, afterembedding_space_sig): the{"model_id", "dim"}identity the signature hashes, when this process can name it — the bundled model (the provable owner of every un-versioned vector) or the active backend (metadata-only, no model load);Noneotherwise. Vectors only rank against queries embedded by the SAME model, so a reader can see which one produced these, and import verifies the pair: a payload whose declared model does not produce its own signature is treated as unsigned and its vectors are not carried (review point).write_episodicgainsembedding_space, mirroringset_semantic: a supplied vector is persisted only while the store still records exactly that signature, re-read inside the insert'sBEGIN IMMEDIATEtransaction (the plain insert branch moves from the connection's implicit deferred transaction to an explicit immediate one for that reason).import_memoryaccepts the base64 form and a plain list alike (_valid_supplied_embedding), and carries payload vectors only when the payload signature matches the store's recorded space AND the store cannot re-derive them right now (embed_fnunset — the CLI store — or the shared embedder not ready: model absent, downloading, or a rejected custom path). Where the backend is ready, rows land through the existing write tail, preserving the invariant that a rederivable store's semantic vectors are a function of the row's own text — an import payload travels between installs and is not trusted where it can be recomputed. A fresh store (nothing recorded, no stored vectors, singleton-or-noembed_fn) adopts the payload's space when the active backend produces it, so a restore onto a new install carries vectors. Episodic rows follow the same rule: the payload vector is carried where the store cannot re-derive it and the spaces match; otherwise the write takes its own embed. The episodic import write is merge-only (preserve_existing=True, aswrite_episodic's own contract says import paths are): a carried vector switches the similarity dedup on for a store with noembed_fn, and without the guard an imported row the scan judged a longer near-duplicate of an ACTIVE episode would tombstone that episode; it is now skipped and counted. The return dict gainssemantic_unembeddedandepisodic_unembeddedcounts (existing keys unchanged).memory import(CLI) prints a_LEARN_EMBED_NOTE-style caveat when rows land without a vector (semantic and episodic counted separately), names the payload's model when its space differs from the store's (both fields scrubbed of terminal control sequences with_TERMINAL_CTRL_RE, like every other memory value the command prints), and includes thememory.db+memory_index.dbdirect-copy alternative.Deliberate contract update
The export default-shape guard in
test/test_memory_markdown_read.py("no flag, no shape change") is a deliberate contract update in this commit: the default payload gains two top-level keys (embedding_space_sig, thenembedding_model, both appended after every pre-existing key), the semanticembeddingfield changes from an unrestorablereprstring to a restorable base64 string, and episodic rows gain anembeddingthey never carried. The guard is re-pinned byte-exact on the new shape, and both directions degrade safely (an old payload imports with rows landing NULL for the sweep; a new payload read by an old consumer sees two extra keys and string-valuedembeddingfields). There is no escape hatch in the test, and none is claimed; the default itself is the maintainer decision recorded below.Payload size. At 1024 dims a vector row is ~5.5 KB as base64 (semantic rows already shipped ~13.6 KB of
reprstring each, so they SHRINK ~2.5x). Episodic rows are a NEW per-row payload: at the 10,000-episode export cap that is up to ~55 MB added to the default payload, written to stdout when--outputis absent -- streamed row by row, so the exporting process's peak memory is the store's rows with their compact BLOBs plus one encoded row, and the importing process decodes each vector as onebytesobject. Consumers that want the old-weight payload pass--no-vectors. Backup scripts that pipememory exportshould expect the larger payload;--no-vectorsships in this PR for consumers that need the old-weight shape.Product decision: the default export carries vectors (opt-out via
--no-vectors)Maintainer decision (@CrysisDeu, 2026-09-15):
kirocrew memory exportcarries semantic and episodic vectors by default;--no-vectorsstays as the opt-out. Rationale, on the round trip this change exists for:export→importsilently degraded the store to keyword-only search until a boot-time re-embed sweep ran — and never repaired it on the CLI path, where no embedder is available. A default that omits vectors would keep that degradation as the out-of-the-box behaviour and make the fix something only users who already know about the loss would turn on.reprper row before this change and now shrink ~2.5x), and opt-out-able with--no-vectorsfor piped or size-sensitive backups.embedding_space_sig,embedding_model), so an importing store that cannot use the carried vectors drops them and counts them under*_unembedded— carrying them is never worse than omitting them.This section records the decision and its grounds so the review lane's product-shape check (lens 9) has the shape stated in one place; it does not claim to be the record that lens reads, which lives on the base branch (an accepted RFC) or in a maintainer's
/ai-review override first-principles <head sha>: <decision>.Scope notes / documented trade-offs
reconcile_embedding_spaceIS restructured here (intended to ship, not out of scope as an earlier revision of this note said): the stale FAISS files are unlinked first, and the new signature is stamped in the SAME transaction as the vector clear, so a concurrent supplied-vector persist that re-reads the signature cannot commit a retiring-space vector. The genuine residual is the unlink-failure branch: vectors are cleared but the OLD signature is deliberately retained so the next boot retries the unlink (a stamped signature beside a surviving index would make the corruption permanent).semantic_unembeddedverification reads one row per imported entry; kept for accuracy on the rare import path.Testing
isort,flake8,mypy(1457 files), diff-scoped black gate, comment-history gate, brand gate. Test runs are left to CI per operator policy.repr), export→import vector round trip, foreign-space refusal, unsigned-store counting, fresh-store space adoption (both arms), ready-vs-unready embedder carry gating, CLI export shape (base64 vectors + signature +embedding_model, NULL key dropped, episodic rows included), streamed output byte-identical tojson.dumps(indent=2)for a multi-row payload,--no-vectors(no keys, no episodic vector read, unsigned), legacy unversioned store signed with the bundled space (empty unsigned store staysNone), CLI import caveat (present and absent), CLI model-mismatch line (present only when the payload's space was not carried).get_episodic_list(include_embedding=True)opt-in, export→import episodic vector round trip, unsigned payload counted, foreign-space payload not carried,write_episodic(embedding_space=)dropped on a re-signed store and kept on both insert branches when the space matches. A near-duplicate import (longer text, exact vector match) leaves the existing active episode in place and is counted as skipped.json.loads, refused by a strict encode) each refuse the carry without raising.embedding_model_for_signaturenames the bundled and active-backend spaces and leaves an unknown one unnamed.import_memorycount-shape assertions.Review
Two pre-push adversarial review rounds, each with two model-pinned read-only subagent lanes (GPT 5.6 mirroring codex-review, Opus mirroring claude-review + AUTOSDE). 16 findings triaged: 13 fixed (incl. in-transaction space check, float32-pack validation, unready-embedder carry gate, count-accuracy guards, key-order fix), 3 documented as trade-offs above. Gates re-run green after each fix round.
Closes #9732
Pattern harvest
Rule candidate: a durable state transition split across two commits — here "clear the vectors" then "stamp the new space signature" — is a TOCTOU window for every writer that checks one half of the pair before writing (the supplied-vector persist checks the signature). Stamp and clear in ONE transaction, and make any pre-commit go/no-go input (the stale-index unlink) resolve before that transaction opens. The same shape exists wherever a meta marker and the rows it describes are committed separately.