Add pkg/lint: offline typed findings replacing the CLI lint stub - #9
Open
Kiran01bm wants to merge 1 commit into
Open
Add pkg/lint: offline typed findings replacing the CLI lint stub#9Kiran01bm wants to merge 1 commit into
Kiran01bm wants to merge 1 commit into
Conversation
lint runs the same parse-and-classify pipeline as the front doors but with zero live facts, so it needs no database and is strictly conservative. Findings carry typed codes (unsupported-operation, blocking-idiom, table-rewrite, destructive) with error/warning severities; only errors flip the exit code. statement.Split is the new grammar-backed script splitter both lint and the coming suggest surface use. Second slice of PLAT-38440.
Kiran01bm
marked this pull request as ready for review
August 6, 2026 10:25
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the CLI
lintstub with a real offline linter:pkg/lintruns the same parse-and-classify pipeline as the front doors but with zero live facts, so it needs no database and is strictly conservative. Findings carry typed codes automation branches on — never prose. Second slice of the P2.5 dry-run/advisory surface, stacked on the plan-contract PR.What
pkg/lint:Check(script)returns a versionedReport(format_version: 1) of typed findings. Codes map from the classifier:unsupported-operation— the engine would refuse it (error; the only severity that flips the exit code)blocking-idiom— a safer native form exists; the finding carries it assuggestion(warning)table-rewrite— needs the copy-and-swap path, with the planner's typed reason (warning)destructive— column/constraint drops, same definition as the declarative differ (warning)statement.Split: grammar-backed script splitter returning canonical per-statement SQL — no hand-parsing; the comingsuggestsurface reuses it.lint [file](or stdin),--json, offline — no DB flags. A clean script prints nothing and exits 0; error findings exit non-zero via a typed sentinel.Why
The linter is the policy gate the tracker's E1 slice needs before execution: refuse what the engine cannot run safely, and surface what it would rewrite or gate, in CI, without touching a database. Deriving findings entirely from the classifier keeps one source of truth for safety judgment — the linter adds severity and presentation, never a second opinion.
Before / after
References
kiran01bm/p2-5-plan-contract)