Skip to content

fix(rulesets): HXA-03 stays native — remove misrouted enforce block (GT-516)#185

Merged
beyondnetPeru merged 1 commit into
developfrom
fix/gt-516-hxa-03-native-fallback
Jul 14, 2026
Merged

fix(rulesets): HXA-03 stays native — remove misrouted enforce block (GT-516)#185
beyondnetPeru merged 1 commit into
developfrom
fix/gt-516-hxa-03-native-fallback

Conversation

@beyondnetPeru

Copy link
Copy Markdown
Contributor

Summary

GT-516 added an enforce: block to rule HXA-03 in src/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 a from/to config, 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 enforce block.

Change

  • Remove the enforce block from HXA-03 so it evaluates on the NativeEvaluator path. (HXA-06 keeps its enforce block, which already degrades to a native fallback — unchanged.)
  • Update the ADR-0002 pilot test (policy-compiler.spec.ts) to the corrected partition:
    • enforcer-routed = HXA-01/02/04/05/06/07 (6)
    • compiled = HXA-01/02/04/05/07 (5, unchanged)
    • fallback = 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 derived forbidden config.

Risk

Low. GT-516's real cross-runtime execution is GT-512-sandbox-gated, so nothing runs this enforce block live yet — this only corrects the authored routing + the design-time partition assertion.

Verification

core-domain green on this exact change: npx tsc clean, npx jest1018 passing (16/16 enforcement suites, 101/101 suites total).

🤖 Generated with Claude Code

…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>
@github-actions

Copy link
Copy Markdown

📊 Bilingual Coverage Impact

PR Changes

  • Paired EN/ES files modified: 2
  • New EN files needing ES translation: 0

Repository Coverage

Metric Value
Total EN files 545
Total ES files 508
Paired files 0
Coverage 0%

Good: All EN changes have ES counterparts.


Generated by GitHub Actions

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@beyondnetPeru beyondnetPeru merged commit 99ac4af into develop Jul 14, 2026
15 checks passed
@beyondnetPeru beyondnetPeru deleted the fix/gt-516-hxa-03-native-fallback branch July 14, 2026 02:41
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.

1 participant