Repository navigation
fix(flow): readiness import reads minimized network captures - #2785
Conversation
Since #2480, network captures keep only declared fields by default and write `body_minimized` instead of `body`. `readiness import` still read `body`, found none, and refused every recorded task with `save_unreadable`. That included recordings made exactly as READINESS.md said, and four nightly readiness e2e tests failed. The importer now rebuilds the save from the kept fields. A field the comparison needs (the task's `fields`, else every field of the save) that was withheld refuses the task with `save_fields_withheld`, naming the field and the recording flag that keeps it, instead of comparing part of the save. Withheld session tokens and secrets are expected and are counted, as for a raw body. READINESS.md now says to record with `--identifier`/`--param` for the save's fields, and the e2e recorder declares them.
Independent adversarial review: REQUEST CHANGESFrom: Grok The fix does what the nightly needs. The readiness e2e tests that fail on main with Blocking
Non-blocking
Tests at this head (Linux, Python 3.12, clean venv from the locks)
Generality gate:
Not run: a real recorded session with CI at this head: 24 pass, 20 skipped, and I didn't push to this branch, and I won't merge it. |
… truncated bodies as unreadable Grok on #2785: - the task's fields were checked against the last segment of each kept path, so a kept meta.note satisfied a withheld note and the import silently dropped it. Fields are now compared by full path, the names parse_body_fields gives them, and a named field the save doesn't carry refuses. - form saves are minimized to form_minimized, which the importer never read: they are rebuilt from its kept pairs with the same refusal. - an opaque or truncated body kept nothing and now refuses as save_unreadable, not save_fields_withheld.
Independent adversarial review: REQUEST CHANGESFrom: Grok All four items from my last review are addressed, and the probes now use the real minimizer. One fail-open path is left, in the new "a named field the save doesn't carry refuses" check: it compares names without regard to case, but the filter right after it is case-sensitive. Prior blockers
BlockingA. A task field named in a different case passes the presence check and is then dropped.
Tests at this head (Linux, Python 3.12, editable venv from the locks)
Generality gate:
Not run: a real recorded session with CI at this head (when I checked): 19 pass, 19 skipped, and 5 pending: I didn't push to this branch, and I won't merge it. |
Grok on #2785: the presence check lower-cased names while the filter after it is case-sensitive, so a task naming "Note" passed the check and then silently dropped "note". JSON and form field names are case-sensitive; both checks now compare them exactly, and a differently cased name refuses.
Independent adversarial review: APPROVEFrom: Grok The case-sensitivity gap from my last review is closed. The presence check and the filter in Prior blocker
Verification at this head (Linux, Python 3.12)
New adversarial probes (throwaway, not committed; each run for a raw body and a real-minimizer save)
Generality gate
CI at this headWhen checked: 15 pass, 19 skipped by the path filter, 9 pending (the Not runA real recorded session with I did not push to this branch and will not merge it. |
Problem
The nightly full run on
mainhas failed inflow core unitsince #2480 landed (24 Nov), and #2698 tracks it. Fourtests/e2e/test_readiness_adversarial_e2e.pytests fail becauseimport_episodesrefuses every task:save_unreadable: the capture did not keep the save's body.#2480 made network captures keep only declared field values. A save is now written as
body_minimized(kept values plus a keyed hash of each other field), with nobody.readiness.reference._from_networkstill readbody. So every readiness recording made the wayREADINESS.mddescribed (record --capture-network, no declared fields) could not be imported. Pull requests never runtests/e2e; only the nightly run does, which is why this lasted five days.Fix
_from_networkrebuilds the save frombody_minimized's kept fields (capture_privacy.restore_kept_json).fieldswhen it names them, else every field of the save. A withheld one refuses the task withsave_fields_withheld, naming the field and--param/--identifier(or raw bodies on a sealed recording). It never compares part of the save.withheld_fields, as they do for a raw body.READINESS.mdstep 1 now records with--identifier patient_id --param type --param note.record --paramdoes.Tests
tests/e2e/test_readiness_adversarial_e2e.pyandtests/e2e/test_readiness_e2e.pypass locally in a cleanuv sync --frozen --extra devenv (7 passed, 1 skipped).save_fields_withheld; a task naming its fields needs only those kept.tests/test_readiness_*.py: 92 passed.The other nightly failure, Desktop replay since #2291 (25 Nov), is separate and isn't fixed here.