Skip to content

fix: .specsyncignore silently inert for BOM'd/corrupt/typo'd rules (closes #420) - #456

Open
0xLeif wants to merge 2 commits into
mainfrom
fix/420-specsyncignore
Open

fix: .specsyncignore silently inert for BOM'd/corrupt/typo'd rules (closes #420)#456
0xLeif wants to merge 2 commits into
mainfrom
fix/420-specsyncignore

Conversation

@0xLeif

@0xLeif 0xLeif commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Problem

.specsyncignore had several silent-failure modes:

  • A UTF-8 BOM silently disabled the first rule in the file.
  • One invalid-UTF-8 line poisoned the whole file — every rule was dropped.
  • Only one per-spec syntax order was accepted (category:path); the documented path:category order was ignored.
  • Typo'd/unmatchable rules did nothing — indistinguishable from working suppression.
  • The N/M exports documented partial-coverage summary warning had no category and could not be suppressed, so acknowledging undocumented exports could never yield a clean --strict run.
  • Suppression itself was invisible: no way to tell how many warnings a rule swallowed.

Repro (fixture: /var/tmp/scratch/w2/420/)

<BOOM>exports-documented
specs/ig/ig.spec.md: undocumented-export
undocumanted-export        # typo
  • Before: BOM disables rule 1; the typo vanishes silently; the summary warning is unsuppressible either way.
  • After: both valid rules apply (either syntax order), the typo'd line produces .specsyncignore line 3 matches no warning category: 'undocumanted-export', the summary is suppressible via the new exports-documented category, and the check output ends with ℹ N warning(s) suppressed by .specsyncignore.

Root cause

IgnoreRules::load read the file as one UTF-8 string (BOM and corrupt lines poisoned everything), accepted only one colon-order, and had no channel to report dead rules.

Fix

  • ignore.rs: BOM strip; per-line UTF-8 with a warning per skipped line; both per-spec orders (whichever side names a known category wins); unmatchable-line warnings; new ExportsDocumented category (classify N/M exports documented + from_str("exports-documented")).
  • commands/mod.rs: surfaces ignore_rules.warnings in every output format and prints N warning(s) suppressed by .specsyncignore.

Tests (all in-file, all passing)

test_load_tolerates_utf8_bom, test_load_invalid_utf8_line_skipped_not_poisoning, test_load_per_spec_path_first_order, test_load_warns_on_unmatchable_pattern, test_classify_exports_documented_summary, test_exports_documented_summary_suppressible.

File overlap note

src/commands/mod.rs ships in PR #455 (fix/435-db-schema-validation) — the whole current file there includes this visibility change. This PR ships src/ignore.rs in full.

Full suite: 1743 passed, 1 pre-existing root-only failure (unrelated). clippy --all-targets -- -D warnings clean.

Closes #420

BOM tolerance, per-line UTF-8 (one corrupt line no longer poisons
the file), both per-spec syntax orders accepted, warnings for
unmatchable lines, and a suppressible ExportsDocumented category
for the N/M exports-documented summary.
@0xLeif
0xLeif requested a review from a team as a code owner July 24, 2026 18:41
@0xLeif
0xLeif requested review from 0xGaspar, Kyntrin and tofu-ux July 24, 2026 18:41
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Corvin says...

      _
    <(;\  .oO(oh no...)
     |/(\
      \(\\
      " "\\

"Even the dumpster of code seems empty today."

CI Summary

Check Status
Validate action.yml ✅ Passed
Packaged Action Consumer ✅ Passed
Dependency Audit ✅ Passed
Code Coverage ✅ Passed
Format Check ❌ failure
Docs Site ✅ Passed
Spec Validation ❌ failure
Tests (build, test, clippy) ✅ Passed
VS Code Extension ✅ Passed
📋 Spec Validation Details

❌ SpecSync: Failed

Metric Value
Specs checked 62
Passed 62
Errors 1
Warnings 0
File coverage 100% (105/105)
LOC coverage 100% (87041/87041)

Errors

.specsync/sdd.json

  • meaningful changed paths are not covered by an active change: src/ignore.rs

Action Items

  • Review and fix -- meaningful changed paths are not covered by an active change: src/ignore.rs

Generated by specsync · Run specsync check --format github to reproduce


Powered by corvid-pet

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Corvin says...

      _
    <(;\  .oO(oh no...)
     |/(\
      \(\\
      " "\\

"Caw... validation failed..."

CI Summary

Check Status
Validate action.yml ✅ Passed
Packaged Action Consumer ✅ Passed
Dependency Audit ✅ Passed
Code Coverage ✅ Passed
Format Check ✅ Passed
Docs Site ✅ Passed
Spec Validation ❌ failure
Tests (build, test, clippy) ❌ failure
VS Code Extension ✅ Passed
📋 Spec Validation Details

❌ SpecSync: Failed

Metric Value
Specs checked 62
Passed 62
Errors 1
Warnings 0
File coverage 100% (105/105)
LOC coverage 100% (87089/87089)

Errors

.specsync/sdd.json

  • meaningful changed paths are not covered by an active change: src/commands/mod.rs, src/ignore.rs, tests/integration/check.rs

Action Items

  • Review and fix -- meaningful changed paths are not covered by an active change: src/commands/mod.rs, src/ignore.rs, tests/integration/check.rs

Generated by specsync · Run specsync check --format github to reproduce


Powered by corvid-pet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.specsyncignore per-spec syntax is dead; errors and the summary warning are unsuppressible

1 participant