Repository navigation
fix(E0): use the same verified-evidence gate for cross-repo learning (stacked on #982) - #986
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
5d4fa3e to
c7b8f15
Compare
|
…995) (#998) ## Event-chain position Addresses [#995](#995) (blocks E0 in [#984](#984)). Follow-up to the [E0 post-merge audit](#984 (comment)). ## Summary of changes ### `lib/learning_scheduler.ex` — repair `ingest_new_outcomes/1` The local outcome JSONL reader previously stored `File.stat.size` as the next offset after parsing with `String.split("\\n", trim: true)` and silently dropping undecodable records. A producer appending an incomplete JSON object during poll A would have poll A advance past the incomplete prefix; poll B would then read only its suffix and the entire event could be lost. **After this repair:** - **Only complete newline-terminated records are acknowledged.** `String.split("\\n", trim: false)` preserves the incomplete tail; it is buffered and prepended to the next poll's read so a producer that finishes between polls produces one complete record, not a suffix fragment. - **Offset tracks the last complete newline**, not file size. Incomplete trailing bytes remain at the old offset for retry. - **Malformed complete rows are quarantined** with a visible warning including file and line number, while valid rows after them still advance. - **File truncation/rotation detected**: when `size < last_offset`, the position resets to zero and re-scans. - **Missing/unreadable files** are logged as warnings, not silently swallowed. The `:enoent` case for the outcomes directory is explicit. - **Legacy integer offsets** are normalised via `normalise_position/1` for backward compatibility with pre-E0 persisted state. - **Stable event identity** via `local_source_id/2` (file + line ordinal hash) disambiguates distinct identical attempts while making replay of the same delivery detectable. ### `.github/workflows/actions.lock` — clusterfuzzlite sub-paths The lock file previously collapsed `google/clusterfuzzlite/actions/build_fuzzers@v1` and `google/clusterfuzzlite/actions/run_fuzzers@v1` to `google/clusterfuzzlite@v1`. The governance Allowlist Preflight checks actual action references in workflow files, so it reported these two as uncovered. Updated the lock entries to list the specific sub-paths used by `.github/workflows/clusterfuzzlite.yml`. ### `test/learning_scheduler_test.exs` — new fixture tests Comprehensive E0 replay/restart fixtures: | Test | Property verified | |---|---| | `normalise_position/1` | Legacy integer offsets, new map format, garbage reset | | `local_source_id/2` | Determinism, distinct lines/files produce distinct IDs | | Two-poll incomplete tail | Poll A credits 2 + buffers incomplete; Poll B completes and credits 1 more | | Restart safety | Persisted positions → re-poll yields 0 new; cold start re-reads | | Append after poll | Only new record credited | | Malformed row quarantine | Bad rows skipped; valid rows after them still counted | | Non-map JSON quarantine | Array rows quarantined | | File truncation/rotation | Offset reset, new content read | | Missing directory / empty dir | Zero outcomes returned | | Fleet-origin exclusion | `origin=gitbot-fleet` not counted locally | | Distinct identical attempts | Two physical lines with same payload → count 2 | | Empty lines | Blank lines between records not counted | | Legacy position compat | Integer offset 0 normalised and advanced correctly | ## Boundaries - No new Python, no new database, no breaking changes to unrelated modules. - Does not bypass CI/allowlist/signature requirements. - JSONL append-only journal preserved. - Fleet import logic (the model this repair follows) untouched. ## Still owed for full E0 acceptance - Executable pinned two-poll + restart tests with actual signed-commit/merge rule status. - Current-head ExUnit, format, and CI pass on this branch. - Remaining #982/#986 review thread resolution. - Full E0 receipt with exact head SHA after CI verifies this PR.



Stacked E0 consumer, base: PR #982's event-ingestion branch
This PR depends on #982 and event-chain #984. It uses
OutcomeTracker.qualified_outcome?/1from its actual base rather than duplicating the epistemic rule.successrecords.Status: DRAFT / NOT READY
mix format --check-formatted, Elixir integration tests, current-head governance/security checks and bot conversations pass on this stacked head.Supersedes #985, which mistakenly targeted main despite depending on the #982-only qualification function. That branch was not a valid standalone integration and will be closed unmerged.