eager_eye 1.2.15 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84a1f7a4156669772686b2138d5015bd82e5859ec09d5b1cce55b795a896c8fe
4
- data.tar.gz: bc45520cd998ab972ee86c6654cd6ec111846eb417512eae4d588ace8135cab0
3
+ metadata.gz: edf21044e597735154b0b1acdcda9230749bf027e8b8acafe70c6aaa1da22b62
4
+ data.tar.gz: b7d6b716ff42f9e160c292a54ecf0344027c73e24eae29f6aecd34aae27d60ac
5
5
  SHA512:
6
- metadata.gz: c3a621919af0c95f005ba215d6db440504fa235e33ede88326ad1813f826f851e77bf20a7066200df993a18bc535c024142cc79930aab714b7db80995f2578f4
7
- data.tar.gz: 86702c9c9ad9b27dcd4fb0a581bdab8864f7eda953b983b4bb7c3a07e6d5f581f39544c2ddfdc0fdb3f4b7c71d84be73df608d02302df7e1db51e4c4eaa4294e
6
+ metadata.gz: 1849caab263614bdb85ed1ddcd15f63ae4199cd978ae56e2c8a690ca0e4c0e4616851f9a09f835d95e61adb457e35d5d07fbb3cb189c6394812f7064901cfaed
7
+ data.tar.gz: fe737b046298753a2fb9739f26307d46fbe4852a47f2a147fae56169259824dff4ced9f3f4cc3c6a37c58dbaea03785d2a1003d230d6b5c7cba56c4224ad011e
data/CHANGELOG.md CHANGED
@@ -7,6 +7,57 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.3.1] - 2026-06-12
11
+
12
+ ### Changed — precision (fewer false positives)
13
+
14
+ Validated against two large production apps (~1,080 hand-checked findings). These
15
+ changes cut false positives by ~53% (339 → 158) with near-zero recall loss
16
+ (5 findings), and lift the trustworthy detectors toward 100% precision.
17
+
18
+ - **Schema-aware column guard.** New `SchemaParser` reads `db/schema.rb` (found by
19
+ walking up from the scanned path) to learn every table's real columns. When a
20
+ receiver's model can't be inferred, a method whose name the schema knows as a
21
+ column (`comsn_rate`, `vat_rate`, `service_fee_rate`) is no longer mistaken for
22
+ an association/query method. `loop_association` and `custom_method_query` no
23
+ longer flag column reads on unresolved receivers.
24
+ - **Per-iteration association dedup.** `loop_association` reports a memoized
25
+ `belongs_to`/`has_one` read once per iteration instead of on every line — a
26
+ repeated read hits Rails' instance cache, not the database. Associations used
27
+ as a query-chain base (`x.assoc.find_by`, `x.assoc.where`) still report each
28
+ occurrence, since those re-query.
29
+ - **Serializer render-site awareness.** New `SerializerUsageParser` scans render
30
+ sites (`XxxBlueprint.render*`, AMS `(each_)serializer:`) and records, per
31
+ serializer + Blueprinter view, which associations are eager-loaded and whether
32
+ only single records are passed. `serializer_nesting` stays silent when an
33
+ association is preloaded at every render site of that view, or the serializer
34
+ is only ever handed single records. It never concludes "safe" for a view it
35
+ can't see rendered, so genuine N+1s are preserved.
36
+ - **`custom_method_query` refinements.** Skips Enumerable aggregates with a block
37
+ argument (`relation.sum(&:amount)`), per-batch queries inside
38
+ `in_batches`/`find_in_batches`, and relation query methods called directly on a
39
+ single iteration element (a SELECT alias such as `record.ids`, not a query).
40
+ - **`validation_n_plus_one`** ignores saves that skip validations
41
+ (`save(validate: false)` / `create(..., validate: false)`).
42
+
43
+ ### Added
44
+
45
+ - **`--baseline FILE` flag** — compare the current scan against a previously
46
+ captured JSON report and surface only issues that are NOT in the baseline.
47
+ Designed for the brownfield CI workflow: accept existing N+1s as the
48
+ baseline, fail builds only on regressions (new issues introduced by a PR).
49
+ Baseline files are produced by the existing `--format json` output (the
50
+ flag accepts either the full report-shaped object or a bare array of
51
+ issues). Malformed/missing baselines exit with a clear error message.
52
+ - **`EagerEye::Issue.from_h(hash)`** — public factory that rebuilds an
53
+ `Issue` from its serialized form (e.g. a parsed JSON entry). Coerces
54
+ `detector`/`severity` strings back to symbols and defaults severity to
55
+ `:warning` when absent. Round-trips through `to_h` and `to_json`.
56
+ - **`EagerEye::Baseline`** — the helper behind `--baseline`. Loads issues
57
+ from a JSON path (`Baseline.load_issues(path)`) and filters a current
58
+ issue list against them (`Baseline.filter(issues, path)`). Useful
59
+ programmatically for projects that wrap EagerEye in their own runner.
60
+
10
61
  ## [1.2.15] - 2026-05-01
11
62
 
12
63
  ### Fixed