Skip to content

fix(action): harden memory gap patcher (robust parsing & sorted gap insertion)#9

Open
HKati wants to merge 1 commit into
mainfrom
HKati-patch-6
Open

fix(action): harden memory gap patcher (robust parsing & sorted gap insertion)#9
HKati wants to merge 1 commit into
mainfrom
HKati-patch-6

Conversation

@HKati
Copy link
Copy Markdown
Owner

@HKati HKati commented Nov 10, 2025

What

  • Replace duplicated parsing and write loops with a single robust path.
  • Ignore malformed JSON lines and records without a proper ts.
  • Sort records chronologically and insert gap markers only on sorted pairs.
  • Tolerate non-integer threshold_seconds (float -> int; fallback 0).
  • Remove duplicate output writes.

Why

Previous version duplicated logic and could write outputs twice; malformed lines
weren't always ignored; the data structure was mixed (rec vs (ts, rec)),
which was error-prone.

Validation

  • Smoke test with valid/invalid lines → emits a single gap when delta > threshold.
  • Inputs/defaults unchanged; CI usage unaffected.

…ologically, tolerate non-integer threshold

- Ignore malformed/ts-free JSONL lines.
- Parse threshold as float -> int; fallback to 0 on error (min 0).
- Build timeline from parsed timestamps only; sort chronologically.
- Insert 'gap' markers from adjacent sorted pairs (no duplicate loops).
- Single-pass write; remove duplicate output writes.

CI-only change; deterministic behavior; backward-compatible for valid inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant