Never invent a specification, a field, a code set, or a rule citation.
This repository's entire value is that every finding cites published text. A
rule citing a source you fabricated would be worse than no tool at all. If you
cannot find an authoritative published source, either register the rule with
implemented=False and a stated reason, or leave it out and note it in the
README. Never guess.
- Validates CEC QFER Consumption CSV filings, filer-side, before submission.
- Five profiles:
CEC-1306A-S1,CEC-1306A-S2,CEC-1306B,CEC-1308B-S1,CEC-1308C. CEC-1304is out of scope. Its instructions say reports "can be submitted by email or U.S. mail", its form is a spreadsheet, and it has no published CSV template.CEC-1306ASchedule 3 andCEC-1308BSchedule 2 are out for the same reason: SFTP channel, templates only on request.- Three published sources are cited: the instruction PDFs, the CSV templates,
and the June 24, 2025 DSP workshop deck. A rule picks one with
cites=. The README's source list is longer than that on purpose. It also records documents that were read and grounded nothing, so a later reader knows the ground was covered. Being listed there does not make a document citable.
- Offline only. No network calls at runtime, no telemetry, no accounts, no caching of input data. A code path reaching the network is a defect.
- Never claim or imply affiliation with, endorsement by, or approval from the California Energy Commission.
- Never write copy implying users, adopters, downloads, or production scale.
- No em dashes or en dashes anywhere.
make verifyenforces it. - Rule identifiers are permanent. Never renumber or reuse one.
- Never let an unevaluated rule report as passed. See ADR 0001 and
tests/test_fail_closed.py, which is load-bearing. - Never report an error at a value some published CEC document says is valid. When two published documents disagree, report the disagreement at warning or informational severity instead of picking a side. See ADR 0003 and ADR 0005.
- Never let a report be silent about something the reader noticed. Anything no
published rule covers goes in the advisory channel, with an
ADV-code, no severity and no citation, and it keeps the verdict offpass. Advisories are not a back door for checks that could not survive as rules: the code space is closed byADVISORY_CODES, an advisory cannot carry a severity or a citation, and the constructor refuses a message that does not say the published record fails to cover what it noticed. See ADR 0004 andtests/test_adversarial_input.py, also load-bearing. - Never withhold a finding without saying so. Identical findings, meaning same rule, same column, same message, merge into one line that reports its own count and example rows; nothing else merges. The one bounded listing, ten distinct findings per rule and column in the text rendering, states what it did not print and points at the JSON, which holds everything. See ADR 0006.
- Published documents differ from each other, not only from silence. Where one form's instructions publish text another's does not, the rule applies only to the form whose text says it, and applicability is derived from the transcribed quote rather than a list of profile ids. See ADR 0007.
- Write digit classes as
[0-9], never\d. Python's\dmatches every Unicode decimal digit andint()converts them, which once let a fullwidth Month through with no finding.
uv sync
make verifymake verify is the same set CI runs: format check, lint, type check, bandit,
tests with the coverage floor, and the dash check.
src/qfer_preflight/codes.pypublished code sets, each with its provenancesrc/qfer_preflight/profiles.pyform templates and exact header rowssrc/qfer_preflight/rules.pythe rule registry with citations and quotessrc/qfer_preflight/engine.pyexecution and the fail-closed gatingsrc/qfer_preflight/describe.pyrendering values and header rows in words, so a message names what the eye cannot see. It decides nothing.src/qfer_preflight/model.pycitation, rule, finding, advisory and report typesdocs/adr/decisions, including the fail-closed contract
Published artifacts are copied exactly, defects included. Two published header
typos (NumberofCustomers, RetailRatClass) are reproduced deliberately. Do
not "fix" them. See ADR 0002.