fix/tariff-cov
needs attentionviewing older commit0b43396 · incrementalpre-PRreviewed 2026-08-07 01:39 UTC0H · 2M · 6L · 1I- Purpose
- Fix tariff rate pipeline coverage gaps — scraper reliability, zone pairing, silent data loss, and CI gate hardening
- Goal
- Land a fully-tested, production-safe CFE tariff rate pipeline with proper CI gating
- Sub-goals
- SG-1: Fix silent data loss in CFE rate pipeline
- SG-2: Make CFE rate engine reach any month and fail loudly
- SG-3: Stop bad division response killing every division after it
- SG-4: Refuse to overwrite a month with a scrape carrying no price
- SG-5: Seed TOU schedules for all 15 SIN zones
- SG-6: Pair each Valle de México table with its own zone
- SG-7: Make unit tests block a PR
- SG-8: Quarantine known-broken packages
- SG-9: Add E2E scope gate (skip smoke for inert PRs)
- SG-10: Un-quarantine @batu/utility-bills-cfe after repair
- What
- Adds E2E scope gate (skip browser smoke for inert PRs, fail-safe by construction) and un-quarantines @batu/utility-bills-cfe after PR #380 repaired it. Reverts TOU seed changes to scope separately.
- Why
- TOU seed fix belongs in its own PR. Un-quarantine closes the lifecycle loop. E2E gate avoids 30-minute waits on CI-only PRs.
- Areas
- .github/workflows+117−11domains/utility+168−15services/utility/tariffs/cfe+1370−185infra/cdk/src/stacks/services/utility/tariffs/cfe+246−101apps/platform/src/api+13−0.claude/rules+95−0scripts/db+104−0package.json+1−1
- Blast
- 27 files, ~2100 adds / ~313 dels across tariff service, domain, CDK infra, CI workflows, and ontology docs.
Findings · 9
correctness4
gh api failure detection is fragile — sentinel can miss partial failures
.github/workflows/e2e.yml:68
If gh api writes partial output to stdout before failing, the || echo fallback is not reached and FILES contains partial data without the sentinel — potentially missing live files and incorrectly skipping the smoke.
docs/* and .claude/* globs match only one directory level
.github/workflows/e2e.yml:97
In a bash case statement, docs/* matches docs/foo but not docs/foo/bar.md. Nested docs (e.g. docs/loops/loop-c-per-commit-spec.html) fall through to the * catch-all and are classified as live — triggering the smoke unnecessarily.
Missing scope output inverts the fail-safe
.github/workflows/e2e.yml:113
The gate step checks steps.scope.outputs.touches_live != 'true'. If scope exits without setting the output, touches_live is empty (which is != 'true'), so the smoke is silently skipped — the opposite of the stated fail-safe.
wc -l count may be off-by-one at the 300-file boundary
.github/workflows/e2e.yml:80
echo $FILES | wc -l counts newline characters. A trailing newline inflates the count by one. Low stakes since 300 is a rough heuristic.
security1
github.repository interpolated into gh api URL
.github/workflows/e2e.yml:51
No injection risk on pull_request trigger, but if trigger changes to pull_request_target this becomes a vector.
conventions1
Skip notice text says 'Required check passed' before the job exits
.github/workflows/e2e.yml:84
Minor: the notice fires before the job actually completes. 'Required check will be bypassed' would be more accurate.
tests1
Config-only files (tsconfig.*, turbo.json) fall through to live wildcard
.github/workflows/e2e.yml:55
Non-package.json config files have no explicit case arm so they trigger E2E. Conservative false-positive (safe) but erodes the gate's value over time.
improvement2
LIVE string accumulation is O(n²) in shell
.github/workflows/e2e.yml
Bash string append via VAR is O(n²) in total bytes for large diffs. A boolean flag would be cleaner and O(1).
API-failure sentinel string is fragile
.github/workflows/e2e.yml
If the API ever returns a filename containing __API_FAILED__, the gate fires a false fail-safe. Capturing exit status separately is more robust.
History · 14 commits
- 1ed035eneeds attentionincremental0H · 2M · 5L2026-08-11 02:03
- fcbe80dblockedfull6H · 12M · 14L2026-08-10 22:02
- 92353bdblockedincremental1H · 9M · 7L2026-08-10 19:32
- 5f2213eneeds attentionincremental1H · 6M · 10L2026-08-09 05:35
- c30da44needs attentionincremental1H · 4M · 2L2026-08-09 04:54
- 5940f56needs attentionincremental0H · 3M · 7L2026-08-07 19:15
- f222512needs attentionfull2H · 9M · 15L2026-08-07 18:58
- eec3b04needs attentionincremental2H · 1M · 4L2026-08-07 18:27
- 0b43396needs attentionincremental0H · 2M · 6L2026-08-07 01:39current
- 3eb9789needs attentionincremental0H · 3M · 5L2026-08-06 18:30
- 87fc06aneeds attentionincremental0H · 4M · 9L2026-08-06 01:21
- 76bcc76needs attentionincremental0H · 1M · 5L2026-08-06 00:51
- 8948608needs attentionincremental0H · 3M · 4L2026-08-05 23:49
- e44f6bbneeds attentionfull3H · 6M · 9L2026-08-05 19:29