Repository navigation
Content query: per-file read errors, missing join columns, and three reader edge cases - #2127
Conversation
…iter at the start of a value, keep very long times from raising - The first column is taken from the first 'Row: 0' line instead of a vote over every line that looks like a row, so 'Row: <n> <word>=' lines inside a value cannot outvote it and turn the dump into unrecognised text. The vote stays for a text with no 'Row: 0' line. - A value that holds ', <name>=' for a column of the dump is flagged at any offset, including offset zero; a value that starts with a plain 'name=' is not. - A time with more digits than Python's integer string conversion limit is reported as out of range instead of raising ValueError. Items 3 to 5 of abrignoni#2093. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ut the join columns as incomplete - An OSError on a matched file no longer stops the artifact: that file's rows are skipped with a log line, its path stays in the source list, the other folders are still read, and Content Query Files shows it as 'file not readable'. The error text names the exception class and strerror only, since str(OSError) holds the local path; this also covers the sibling read of the MMS joins, which put it in Parse Note. - If mms_addr.txt has rows but no msg_id or type column, or mms.txt has rows but no _id column, the join takes that file as incomplete, so an unmatched row says unknown with the reason instead of a definite no. - Notes updated; last_update_date 2026-11-26 on the twelve artifacts. Items 1 and 2 of abrignoni#2093. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Test data is now included for every changed artifact module. Thank you! |
A synthetic ALEX case for the module test harness, so CI keeps the fixes of this PR: an sms.txt whose first body holds four 'Row: <n> example=' lines (more than the real rows), a body that starts with ', seen=' and a date of 5,000 digits; and an mms.txt with an mms_addr.txt whose rows print no msg_id column. Run on main, the SMS, MMS and Content Query Files units of this case fail (the SMS dump is read as unrecognised text and gives no rows); on this branch all 39 units pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t first columns
Taking the first 'Row: 0' line as row 0 lost the real rows when a
row-like line came before them ('Row: 0 example=x', then 'Row: 0 _id=1',
'Row: 1 _id=2'), a case the vote of abrignoni#2082 read correctly. When 'Row: 0'
lines name different first columns, each reading is now tried and the
one kept has the fewest rows that cannot be split, then the least text
before its first row, then the earliest 'Row: 0'. A single real row
whose value quotes 'Row: 0' and 'Row: 1' lines still keeps its own
first column. Tests for both.
Review of abrignoni#2127.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the Row: 0 readings Trying a wrong 'Row: 0' reading on a large dump makes the whole text one row of hundreds of thousands of names, and the repeated-name check (columns.count for each name) was quadratic over that list: a 59,478 row MediaStore-sized dump with one quoted 'Row: 0' line did not finish in five minutes. It now counts with a Counter (1.9 s for that dump), and at most four 'Row: 0' readings are tried (3.0 s with twenty quoted names). Test with a 20,000 row dump. Review of abrignoni#2127. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Pushed three more commits:
51e18af and 578cb6e belong together. If you'd rather keep #2130 out of this PR, I can move both to a separate one. |
…a sequence Comparing readings let a sequence quoted inside an SMS body replace the real rows: three real '_id' rows, the last one not splittable, whose body quotes 'Row: 0 example=x' and 'Row: 1 example=y', gave the two quoted lines as the rows. The earliest 'Row: 0' reading is now kept whenever a 'Row: 1' line with the same first column follows it; the readings are compared only when it does not (a row-like line before the rows, or a single real row that quotes rows). Test with the example from the review. Review of abrignoni#2127. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a set _row_zero_names checked each new name against the whole list, which was quadratic in the number of distinct 'Row: 0' names (40,000 took 11.4 s) although at most MAX_READINGS of them are ever tried. It now keeps a set for membership, preserves the order in the list, and stops at MAX_READINGS names (0.19 s for the same text). Test with 40,000 names. Review of abrignoni#2127. Co-Authored-By: Claude Opus 5.5 <[email protected]>
parse_text collected the 'Row: 0' names from one scan of the lines, _row_starts made its own, and _row_starts called _row_zero_names for a third while holding its list. The candidates are now found once in parse_text and passed to both helpers, and released before the rows are split on the usual paths. Same output; a 59,478 row dump parses in 1.13 s instead of 1.30 s with the same peak memory. Review of abrignoni#2127. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ng them The fallback kept every parsed reading until it picked one, so a single row whose value quotes several distinct 'Row: 0' markers before a large tail held up to four parsed copies of that tail. It now keeps only the best score and dump seen so far, with the same tie-breaking. Same output; 64 MB to 46 MB peak on a row quoting four markers before a 200,000 line tail. Review of abrignoni#2127. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rojection cause file not readable covers a copy ALEAPP could open or read, Detail gives the class and system text, and a failed copy into the report folder can show as FileNotFoundError with the cause in the run log. A missing msg_id or type column no longer names a projection as its cause, since neither ALEX nor android_triage uses one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Maxi, I pushed a notes-only commit (1935e2e) after a notes audit: "file not readable" now says ALEAPP could not open or read its copy, and that a failed copy into the report folder can show FileNotFoundError with the cause in the run log. The MMS note no longer names a projection as the cause of a missing column, since neither ALEX nor android_triage uses one. Your description still says 35 strict cases and 39 unit tests; at this head it is 39 and 44. |
abrignoni
left a comment
There was a problem hiding this comment.
Thanks Maxi, nice work on all five. Merging.
Fixes #2093, the five follow-ups from the review of #2082. Each has a test that fails on main and passes here.
scripts/content_query_reader.pyRow: 0line, not from a vote over every line that looks like a row. Lines inside a value likeRow: 1 example=xcan no longer outvote_idand turn the dump into unrecognised text. The vote is kept only for a text with noRow: 0line. Test:test_row_lines_inside_a_value_do_not_outvote_the_first_column., <column>=is flagged at any offset, including offset zero. A value that starts with a plainname=is still not flagged. Test:test_delimiter_at_the_start_of_a_value_is_flagged.int()moved inside the guarded block. A value past Python's 4,300-digit limit is reported as out of range, and the note gives its digit count instead of the whole value. Test:test_unset_and_bad_values.scripts/artifacts/contentQuery.pyOSErroron a matched file is caught per file. That file's rows are skipped with a log line, its path stays in the source list, and the other folders are still read. Content Query Files shows it asfile not readable. The error text keeps the exception class andstrerroronly, becausestr(OSError)holds the full local path. The same change covers the sibling read in the MMS joins, which put that path in Parse Note before. Tests:UnreadableFileTest.mms_addr.txthas rows but nomsg_idortypecolumn, ormms.txthas rows but no_idcolumn, the join treats that file as incomplete. Unmatched rows then say unknown with the reason, instead of "no address rows" orno. Test:test_missing_join_columns_leave_the_relation_unknown.last_update_dateis 2026-11-26 on all twelve artifacts, since the reader and_readchanges reach all of them.Also in this PR, from its review
alex_reader_edges, a synthetic case for the reader fixes. On main its SMS, MMS and Content Query Files units fail.Row: 0is followed by aRow: 1with the same first column it is kept, and otherwise up to four readings are compared. Four or more distinct row-like lines before the rows stay in Content query reader: a row-like line before the first real row #2130.Row: 0line did not finish before), and the row-like lines are found once, with at most four names collected and only the best reading kept.Checks (at 1935e2e)
run_test_cases.py --module contentQuery --strict: 39 PASS. The baselines that were there before are unchanged, and the four new ones are fromalex_reader_edges.--storage-views: 72 SKIP. These are tool output folders, not app containers.lint_changed.pyare clean.unittest discovergave the same failures on this branch as on main in a local Windows run (last compared at 6b4ea83).🤖 Generated with Claude Code