fix(rulesets): HXA-03 stays native — remove misrouted enforce block (GT-516)#185
Conversation
…GT-516)
HXA-03 ("Infrastructure IMPLEMENTS Core ports") is a POSITIVE/structural
assertion. dependency-cruiser is a forbidden-dependency tool and cannot
verify a positive "X implements Y" claim, so an enforce block routing HXA-03
through it is semantically wrong: it can only ever degrade to a native
fallback or, with a from/to config, emit false positives. Per GT-516's own
design (and closure note), HXA-03 takes the documented per-rule NATIVE
path rather than an enforce block (HXA-06 keeps its enforce block, which
already degrades to a native fallback).
- Remove the enforce block from HXA-03 so it evaluates on the NativeEvaluator
path.
- Update the ADR-0002 pilot test: enforcer-routed = HXA-01/02/04/05/06/07 (6);
compiled = HXA-01/02/04/05/07 (5, unchanged); fallback = HXA-06 (1).
Low-risk: GT-516's real cross-runtime execution is GT-512-gated, so nothing
runs this enforce block live yet. Verified core-domain green (npx tsc &&
npx jest: 1018 passing) on this exact change.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📊 Bilingual Coverage ImpactPR Changes
Repository Coverage
✅ Good: All EN changes have ES counterparts. Generated by GitHub Actions |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bfd193fe3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "toolRuleId": "hxa-03-infra-implements-ports", | ||
| "runtime": "node" | ||
| } | ||
| "layer": "Infrastructure" |
There was a problem hiding this comment.
Keep HXA-03 on an executable enforcement path
With HXA-03 no longer carrying an enforce block here, compileRuleset drops it from both compiled and fallbacks, so evolith enforce compile --ruleset adr-0002 no longer reports any native fallback for this blocking rule. The stated fallback path is not currently executable either: the native ArchitectureRuleHandler only dispatches categories in SUPPORTED_CATEGORIES, which does not include layer-structure, so a native HXA-03 rule is skipped rather than checked. In ADR-0002 runs, "Infrastructure implements Core ports" therefore silently loses coverage unless a native HXA-03 handler is added or the rule remains explicitly routed as a native fallback.
Useful? React with 👍 / 👎.
Summary
GT-516 added an
enforce:block to rule HXA-03 insrc/rulesets/adr/adr-0002-hexagonal-architecture.rules.json, routing it to dependency-cruiser. HXA-03 ("Infrastructure (Adapters) implements Core ports") is a POSITIVE / structural rule — it asserts "X implements Y". dependency-cruiser is a forbidden-dependency tool and cannot verify a positive implements-assertion, so routing HXA-03 through it is semantically wrong: it can only ever degrade to a native fallback or, if someone later fills in afrom/toconfig, emit false positives.Per GT-516's own design (and its closure note), HXA-03 should take the documented per-rule NATIVE path rather than an
enforceblock.Change
enforceblock from HXA-03 so it evaluates on theNativeEvaluatorpath. (HXA-06 keeps itsenforceblock, which already degrades to a native fallback — unchanged.)policy-compiler.spec.ts) to the corrected partition:HXA-01/02/04/05/06/07(6)HXA-01/02/04/05/07(5, unchanged)HXA-06(1) — HXA-03 is now native-only and never enters the enforcer partition.The GT-516 round-trip test (
policy-compiler.roundtrip.spec.ts) needed no change: it asserts only the compiled set (still 5) and the derivedforbiddenconfig.Risk
Low. GT-516's real cross-runtime execution is GT-512-sandbox-gated, so nothing runs this
enforceblock live yet — this only corrects the authored routing + the design-time partition assertion.Verification
core-domaingreen on this exact change:npx tscclean,npx jest→ 1018 passing (16/16 enforcement suites, 101/101 suites total).🤖 Generated with Claude Code