Repository navigation
feat(metrics): add architecture import boundaries and pre-edit guard - #200
Open
avidianity wants to merge 5 commits into
Open
avidianity wants to merge 5 commits into
avidianity wants to merge 5 commits into
Conversation
Add boundaries configuration (zones, patterns, public_files, allow/deny rules with optional reasons, strict_zones, source_sets) with strict load-time validation, evaluate boundary rules over resolved runtime imports in codeint-metrics, and emit boundary Findings in TOON, JSON, SARIF, and Markdown reports from codeint check. Closes #176
Add built-in layered and hexagonal presets under boundaries.preset with zone and rule override semantics, expose per-Source-set boundary regression limits (defaulting to any_new_finding), and wire boundary Findings into CommitMeasurement and DiffReport across JSON, TOON, SARIF, and Markdown outputs. Closes #177
Add codeint guard <path> (text, toon, json) and the matching read-only guard tool in codeint mcp so developers and coding agents can inspect architectural zone membership, allowed and denied target zones, public_files constraints, allowed importers, and rule reasons for existing or planned files. Closes #178
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
Adds configurable architecture import boundaries (
zones,patterns,public_files,allow/denyrules,strict_zones, andlayered/hexagonalpresets) evaluated over resolved runtime imports across all supported languages, integrates boundary Budgets and Regression gating intocodeint checkandcodeint diff, and adds the pre-editcodeint guardcommand in both the CLI andcodeint mcp.Closes #169
Closes #176
Closes #177
Closes #178
Tier
Tier 2 from the tier check: default tier for application code across
crates/config,crates/metrics,crates/report,crates/cli,schema/codeint.schema.json, anddocs/reference.md.Task
Spec #169 and sub-issues #176, #177, #178:
boundarieszones,public_filesencapsulation,allow/denyrules with reasons,strict_zones, load-time validation, andcheckboundary Findings across TOON, JSON, SARIF, and Markdown (Zone boundary config, public_files encapsulation, and check boundary Findings #176)layeredandhexagonalpresets with user overrides, per-Source-set Budgets, andcodeint diffRegression gating with stable Finding identifiers (Architecture presets (layered, hexagonal), boundary Budgets, and diff Regressions #177)codeint guardcommand (existing, planned non-existent, unzoned, unconfigured) in CLI (text/JSON/TOON) andcodeint mcp(Pre-editcodeint guard <path>command in CLI and MCP #178)Fail-first test
crates/cli/tests/boundaries.rs(check_reports_directional_deny_allow_and_public_files_findings_across_formats,check_supports_layered_and_hexagonal_presets_with_user_overrides,diff_classifies_boundary_findings_and_gates_new_regressions_without_failing_on_preexisting) andcrates/cli/tests/guard.rs(guard_reports_zone_rules_public_files_and_importers_for_existing_and_planned_files)codeint.json has an unknown key boundaries,codeint.json has an unknown key boundaries.preset,error: unrecognized subcommand 'guard')Checks
cargo test --workspace --lockedcargo clippy --workspace --all-targets -- -D warningscargo fmt --checkcodeint diff b416af7lefthookpre-commit and commit-msgcargo run --package xtask -- merged-result)Safety proof
boundariessection incodeint.jsonexperience zero behavior change incheck,diff, andmcp.crates/cli/tests/check.rs(143/143),crates/cli/tests/mcp.rs, andcrates/cli/tests/boundaries.rsconfirmboundariesis omitted from JSON/TOON/Markdown/SARIF outputs andover_budget/regression checks when unconfigured; cachedCommitMeasurementdeserialization preserves backward compatibility via serde defaults.interrogate: none run below Tier 3.Runtime evidence
End-to-end CLI and MCP integration tests executed the compiled
codeintbinary on revision5525aa3across TypeScript, JavaScript, and Python fixture repositories and temporary Git repositories (boundaries,guard,mcp,referencetest suites all passed, andcodeint diff b416af7exited 0 with zero regressions).Gaps