Repository navigation
feat(lint): migrate easyp lint to the easyprotoc compiler (milestones lint-easypc-infra + import-easyprotoc) - #258
Merged
Merged
Conversation
…cal HEAD baselines, resolved open questions
- TestLintLinked with 7 named cells: determinism, D-01 sort order, COMPILE routing, central comment suppression both flag sides, ModuleRule lifecycle, per-file ignore_only, 8-file race matrix - inert contract bindings in lint_model.go (rename-map header, LinkedFileInfo/LintRule/ModuleRule/Resolution/LinkedRuleName) - additive Options.LinkedRules/Core.linkedRules/parsedImports in core.go - RED evidence machine-validated: RED_EVIDENCE_OK (target_test_failed)
- LintLinked: walk -> parallel read pass -> linkSources -> linkedFiles wrap -> windowed (256) model build from linked trees via internal/ parallel -> indexed serial drain in walk order -> ModuleRule.Finish -> D-01 total sort by (path, rule, line, col) - lint_linked_read.go: readSource/protoInfoFromSource/ protoInfoFromLinked (tree dropped after build)/linkedFilesFromImport/ linkedFileFromImport/importCacheKey/cacheLintedOutline/parseOnTheirOwn - lint_suppressions.go: protoast Comments/Owner walk + main-verbatim pairing machine with byte-identical error texts - link.go additive: linkedFiles/linkedOutline/outline/resolution/ usesThrough (mutex + sync.Once discipline) - main-wins drain wrapper pin: fs.WalkDir: c.lintProtoInfoRead: %w - all 7 TestLintLinked cells green under -race; package green
- fallback_missing_import_command_error: *OpenImportFileError under the exact fs.WalkDir: c.lintProtoInfoRead: main-wins prefix - fallback_syntax_error_wrapper / fallback_read_error: same prefix pin for parse and pass-1 read failures, no COMPILE issues on the path - fallback_rules_still_run: rules run on the parseable files of a fell-back corpus (LINT-ENG-03), drain aborts at the missing import - fallback_outline_cache: sibling import served non-nil through linkedFileFromImport/cacheLintedOutline - 12/12 TestLintLinked cells green under -race
…still_run - recordingRule.Validate runs inside the parallel window, so observation order is scheduler-dependent; only Collect is walk-order serial - assert.ElementsMatch replaces the order-sensitive assert.Equal that failed ~50% of -race runs (4/8 local runs before the fix) - walk-order guarantee stays pinned by the module Collect assertion
- 16 named rows re-driving main's byte-identical suppression fixtures through LintLinked: the 9-cell EOF matrix, byte-exact directive error texts (path:line:column shape), policy independence both ways, and all three dialects (easyp:disable, nolint:, buf:lint:ignore) with legacy name validation - messagePascalCase double mirrors rules.MessagePascalCase exactly (same regexp, top-level messages only) so oracle expectations carry over - all rows green under -race; no engine divergence found in lint_suppressions.go
- config_ignore_walk_filter: Options.Ignore drops sub/ at the walk, rules never run there (recording double observes) - ignore_only_dir_prefix: prefix semantics via IgnoreOnly option, finding outside the prefix survives - ignore_only_finish_refilter: shouldIgnoreLinked applies to Finish output - finish_comment_refilter: Finish findings on suppressed lines dropped under AllowCommentIgnores and kept without it (both sides of the flag) - tab_directive_position_pin: suppression matches by line with a tab before the marker; directive-error column pinned to protoast's rune-based value (col 2) with the A4 byte-vs-rune divergence documented as a Phase 5 observable - 21 parity rows green under -race
- repeated_runs_byte_identical: 5 in-process runs byte-identical (D-01 + indexed drain, ROADMAP criterion 1) - race_shared_doubles_identity: shared stateless double instances, exact per-file rule/line counts under -race (criterion 4) - collect_serial_walk_order: unsynchronized Collect recording slice equals walk order twice (D-03) - ctx_cancel_surfaces: pre-cancelled context surfaces as context.Canceled - walk_order_error_precedence: first walk-order syntax error wins (a_bad over z_bad)
- mixed_corpus_compile_isolation: COMPILE isolated to the erroneous file, rules skipped corpus-wide - dep_file_diagnostic_through_engine: dep semantic error carries b.proto path, verbatim Ghost message - compile_bypasses_suppression: A6/IN-02 pin — ignoreOnly, comment ignores and directives never filter COMPILE - compile_deterministic_twice: multi-diagnostic corpus byte-identical across runs, D-03+D-01 sort composed
- TestLintUseValidationParity: 7 named cells pinning main's exact validation chain - unknown rule/group/except/ignore_only names -> errors.Is core.ErrInvalidRule + exact validateConfigRuleNames: prefixes - PACKAGE_NO_IMPORT_CYCLE 'is not implemented' special case pinned until Phase 6 - valid config constructs both engines with no second name validation; registry sanity cell - test-only: zero production files changed
…-only diff, subject attribution
…dency - Remove the internal/easypc lint path exclusion and its seal comment - Replace the AGENTS.md sealed-vendor prohibition with the pinned-module rule and add internal/protoast to the Layout table - Document the pinned github.com/easyp-tech/easyprotoc module and the internal/protoast D-07 seam in .spec/ARCHITECTURE.md and .spec/PACKAGES.md - Repoint the three stale compiler citations in link_test.go, internal/protoast/build.go and package_no_import_cycle_test.go - No behavior, schema or dependency changed
…toc dependency plan
- Replace the bare deferred session.Close with t.Cleanup - Report a non-nil close error through t.Errorf - Fix the pre-existing errcheck finding at source (D-08)
…n, untracked-path predicate
- ROADMAP collapsed (v1.1 shipped line + backlog); phase artifacts archived under .planning/milestones/v1.1-* - PROJECT evolved: v1.1 current state, validated capabilities, key decisions (module pin, branch topology, upstream branch deferral) - MILESTONES records v1.1 with closeout override note (phase 1/2 fingerprints stale due to comment-only/test-only edits; behavior re-proven by Phase 4) - REQUIREMENTS.md removed (archived as milestones/v1.1-REQUIREMENTS.md); tag v1.1 created locally
Upstream easyprotoc's lexer size guard compared len(src) against math.MaxUint32, which does not fit a 32-bit int — the linux/arm7 cross-build failed to compile. Fix pushed upstream as easyp-tech/easyprotoc PR #2 (one-line uint64 comparison, no behaviour change on 64-bit). Pin: v0.0.0-20261104120806-f378f3f3a05f -> v0.0.0-20261121194146-14f27ad9ce15 Verified: go build ./... (amd64 + linux/arm7), go vet, golangci-lint 0 issues, go mod tidy idempotent, full -race battery 34 ok / 0 FAIL / 0 race / 1 known skip.
TestAcceptanceGates builds the ratified v1.0 baseline binary from commit 1e9a596 and fails, by design, when the commit is absent. actions/checkout fetches depth 1, so the gate could never pass in CI. Fetch the baseline explicitly by full SHA (short SHA wants are rejected by upload-pack). Verified in a depth-1 clone: fetch succeeds and git worktree add at the baseline works.
…er code Merge origin/main (easyprotoc v0.1.0, protobuf v1.36.12, bounded sourceview.Session, legacy breaking removal, core.Position) into feat/lint-easypc-infra and clean up the branch before merge: - Remove temporary planning/agent files (.planning/, .claude/CLAUDE.md, .spec/features/lint-easypc-infra/, .gitignore and .agents/ tweaks) - Remove branch-pinned oracle test (internal/api/acceptance_gates_test.go) and its shallow-fetch workaround in .github/workflows/tests.yml - Remove dead go-protoparser helpers and phase-parity tests from internal/core (comment_suppressions.go, proto_comments.go, position_probe_test.go, position_parity_test.go, legacy dom.go and proto_info_read.go code) - Update TestLinkSources non-local import case for easyprotoc v0.1.0 non-ErrFileNotFound error propagation - Run go mod tidy against main's dependency pins
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
Milestones on this branch: v1.0 lint-easypc-infra (7 phases) + v1.1 import-easyprotoc (4 phases) — both shipped and verified on the branch.
Final state:
easyp lintruns on the easyprotoc compiler. v1.0 migrated lint from go-protoparser to the compiler +protoastmodel; v1.1 replaced the interim vendored copy with the public modulegithub.com/easyp-tech/easyprotoc(pinnedv0.0.0-20261104120806-f378f3f3a05f) and reconciled the branch withmain#253, which already uses the same module in the breaking path. Output format, paths and exit codes stay byte-identical; only the three v1.0 rules (PACKAGE_NO_IMPORT_CYCLE,SYNTAX_SPECIFIED,FIELD_NOT_REQUIRED) and deterministic ordering are visible to users.Status: all 11 phases verified
passed(goal-backward verification, securitythreats_open: 0, nyquist validated). Final acceptance on the public module: 34-package-racebattery green (0 FAIL, 0 races, one known environment skip), Gates A–D ×2, golden 94 byte-exact, both D-07 position gates,bin/golangci-lint run ./...=0 issues., zero schema drift. Tagv1.1.v1.1 import-easyprotoc (latest)
Phase 1: Merge main #253 + reconciliation
Merge commit
994c503(parents: branch base →5d36266). Blob-exact resolution of the threeinternal/coreconflicts:breaking_profiles.gofromorigin/main(easyprotoc/protoc path),dom.gofrom the branch (Position = protoast.Position),core.goas the import union; lint contour byte-frozen, 9-file first-parent changeset. Full-racebattery green on the merge tree.Phase 2: Consumer swap + vendored tree removal
One atomic commit (
5342455): consumer imports switched to the public packages (easyprotoc/protoc,easyprotoc/protoc/syntax,easyprotoc/parser), all 648 vendored files deleted (48.go, 555.proto,VENDORED.md, both cmd binaries),go mod tidya no-op (pins unchanged, no replace/vendor).Phase 3: Seal removal + docs + lint green
One docs commit (
9320361):.golangci.ymlexclusion, AGENTS.md sealed-vendor rule and three stale compiler citations removed;.specdocuments the pinned module and theinternal/protoastseam (D-07 rune columns). The pre-existingSession.Closeerrcheck (internal/sourceview/session_test.go) fixed at source in a separate test commit (6f52840) — lint goes to exactly0 issues.without suppressions.Phase 4: Acceptance on the module
Full v1.0 acceptance set re-proven on the final tree (
6f52840): 34-package-racebattery (the 7 vendored test packages are gone by design), Gates A–D ×2 vs1e9a596, golden 94 byte-exact, D-07a/b, core/CLI matrices, lint0 issues., schema drift 0, exact pins, empty live-surface seal grep.Requirements: IMPORT-REC-01, IMPORT-DEP-01, IMPORT-CONS-01, IMPORT-VENDRM-01, IMPORT-SEAL-01, IMPORT-PARITY-01 — all complete.
v1.0 lint-easypc-infra
Goal:
easyp lintruns on the compiler with byte-identical output, paths and exit codes — invisible to users except three new rules and deterministic ordering. Other subsystems untouched.Phase 1: Vendor the compiler
Compiler +
internal/protoastcopied byte-verbatim from the lab @08cef10; zero new dependencies; lint/breaking read models split; rune-column position contract proven.Phase 2: Linker + error routing
(*Core).linkSourcesthree-outcome classifier + typedlintResolverseam; COMPILE remark class; exit codes 0/1/2 proven through the Action path.Phase 3: Two-pass engine
LintLinked: parallel windows of 256,ModuleRuleCollect/Finish for cross-file rules, deterministic total ordering, central suppression filter,lint.usevalidation parity.Phase 4: Port all rules
All 41 registry rules ported with main-wins semantics in 6 batches; per-batch parity tests (53 cells, full-registry closure: 41 rules fire, 73→94 findings pinned); colocated tests keep main's literals.
Phase 5: Flip the lint path
One atomic commit: old lint path deleted, rename consolidation, class-1 COMPILE cells through Action — the single user-visible change point; rollback =
git revert.Phase 6: New rules + schema/MCP regen
Three new rules, verbatim lab ports, teeth-corpus parity; schemas + MCP descriptions updated atomically.
Phase 7: Acceptance
wazero v1.9.0 data race fixed (first full green
-race ./...); acceptance gates A–D ×2 through baseline (1e9a596) + HEAD binaries; SC3 battery green.Verification
-race ./...suite on the final tree: 34 packages, 0 FAIL, 0 races, one known environment skip (TestGenerateGoHeaderUsesCompilerVersion—protoc-gen-goabsent), 3 no-test packagesbin/golangci-lint run ./...: exactly0 issues.(fix at source, no suppressions)go run ./cmd/easyp schema-genidempotent)easyprotoc v0.0.0-20261121194146-14f27ad9ce15, protobufv1.37.0-rc.1);go mod tidy -diffempty; no replace/vendorGOOS=linux GOARCH=arm GOARM=7 go build ./cmd/easyp ./cmd/easyp-mcpgreen (requires the upstream 32-bit lexer fix — see Follow-ups)testsgreen, including the acceptance baseline oracle fetch in the shallow checkoutKey Decisions
main); no compiler code lives in this repo. Fixes go upstream via a version bump.git revert.Risks & Dependencies
feat/easyp-integration(generation metadata, changesLinkerror semantics) is deliberately not taken — it belongs to the codegen series.Success Metrics & Release Criteria
-racesuite, lint 0 issues, schema drift empty, acceptance gates, golden 94, D-07Follow-ups (post-close)
len(src)withmath.MaxUint32, which does not compile on 32-bit targets and broke the CIlinux/arm7cross-build (pre-existing on the branch, not caused by v1.1). The one-lineuint64fix is open upstream as easyp-tech/easyprotoc#2; this branch pins that commit (v0.0.0-20261121194146-14f27ad9ce15). Re-pin to upstreammainonce the PR merges.TestAcceptanceGatesbuilds the v1.0 baseline from commit1e9a596and fails when absent; the workflow now fetches it explicitly by full SHA in the depth-1 checkout.Milestone closeout notes
.planning/milestones/v1.1-*; tagv1.1on the close commit.stalebecause Phase 3 edited covered files (one test-only errcheck fix; two comment-only files, proven by the comment-only diff gate). Behavioral acceptance was re-proven on the final tree by Phase 4 — no behavioral coverage lost.