Skip to content

fix(foreignregion): resolve MDS073 rule-ID collision with slide-structure - #773

Draft
jeduden wants to merge 3 commits into
mainfrom
claude/amazing-hopper-dvfuwq
Draft

fix(foreignregion): resolve MDS073 rule-ID collision with slide-structure#773
jeduden wants to merge 3 commits into
mainfrom
claude/amazing-hopper-dvfuwq

Conversation

@jeduden

@jeduden jeduden commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

A scheduled architecture audit (/solid-architecture audit) swept the ~90 files touched since the last checkpoint (6680ff5..2ab4b29) and found one blocker: the foreign-regions: scanner and the MDS073 Slidev slide-structure rule both landed in the same window and independently claimed rule ID MDS073 — one through the rule.Rule registry, the other as an engine-emitted diagnostic that rides along the fix/check pipeline outside it. That makes .mdsmith.yml's per-rule enabled: false ambiguous for MDS073: it reliably disables the registered rule but has no effect on the foreign-region diagnostic.

  • Renumbered the foreign-region scanner's diagnostic from MDS073 to MDS074 (the next free ID) in internal/foreignregion/scan.go, and updated every comment/doc that names it (internal/config/foreignregion.go, internal/config/foreignregion_more_test.go, internal/engine/runner.go, internal/fix/fix_foreign_region_test.go, docs/reference/foreign-regions.md).
  • Added internal/integration/rule_id_uniqueness_test.go, a contract test that walks every registered rule.Rule.ID() plus foreignregion.RuleID and fails on any duplicate, so a repeat collision fails CI instead of shipping silently. Verified red (collision) before the rename, green after.
  • Ran mdsmith fix . to regenerate the <?catalog?> blocks in CLAUDE.md, AGENTS.md, .github/copilot-instructions.md, and docs/reference/index.md that quote foreign-regions.md's front-matter summary.
  • Recorded the audit findings in docs/development/architecture-audit.md (one blocker, fixed directly; one nice-to-have — mergedriver.go/runner.go approaching the 1000-line split threshold, no action needed yet) and advanced audit-from: to the current origin/main SHA.

No other blockers or tax findings surfaced in this sweep (no rule-to-rule imports, no reverse-layer imports, no Liskov breaks, no inverted test pyramid, no missing unit tests on a public surface). The one nice-to-have has no actionable fix yet, so no plan file was filed for it.

Test plan

  • go build ./...
  • go test ./... (all green)
  • go vet ./...
  • go tool -modfile=tools/go.mod golangci-lint run on touched packages (0 issues)
  • mdsmith check . (0 failures)
  • TDD: confirmed TestRuleIDsAreUnique fails against the pre-fix MDS073 collision, then passes after the rename

Generated by Claude Code

…ture

The foreign-region scanner's malformed-region diagnostic and the
slide-structure rule both independently claimed MDS073 when they landed
in the same window. Since the scanner's diagnostic rides along the
fix/check pipeline outside the rule.Rule registry, .mdsmith.yml could
not reliably disable one without ambiguity over the other.

Renumber the foreign-region diagnostic to MDS074 (the next free ID) and
add a contract test that walks every registered rule.Rule.ID() plus
foreignregion.RuleID and fails on any duplicate, so a repeat collision
fails CI instead of shipping silently. Also records the architecture
audit finding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDEzK19viwk2UZozpzLHuf
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (2ab4b29) to head (385d8e9).

Additional details and impacted files
Components Coverage Δ
Go 98.70% <ø> (ø)
TypeScript 99.54% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

claude added 2 commits July 26, 2026 19:27
Code review on PR #773 flagged that the audit workflow docs mandated a
plan file for every blocker with no branch for "already fixed in this
cycle," which is what this PR's own audit entry did. Codify the
exception explicitly in the project's audit-checklist binding instead
of leaving the deviation undocumented.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDEzK19viwk2UZozpzLHuf
…-cycle exception

Third code-review pass on PR #773 flagged that the generic skill
checklist's "File a plan" language had no carve-out, contradicting the
project-specific same-cycle-fix exception added in the previous commit
and the "follow the steps ... exactly" instruction in the project's
audit-checklist page. Thread the exception through Step 3 and Step 5
so the generic and project-specific docs agree.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RDEzK19viwk2UZozpzLHuf
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.

2 participants