Skip to content

chore(framework): the architecture rules are enforced where every tool passes - #895

Merged
blafourcade merged 4 commits into
nextfrom
chore/architecture-guard-lefthook-only
Sep 21, 2026
Merged

blafourcade merged 4 commits into
nextfrom
chore/architecture-guard-lefthook-only

Conversation

@blafourcade

Copy link
Copy Markdown
Contributor

What & why

The two architecture rules of #250 were enforced twice: as an architecture-rules pre-commit job, and as a Claude Code PreToolUse hook that refused the write itself.

The hook bought one turn of latency for a mechanism no other tool can host. Across every plugin shipped here the portable hook surface is SessionStart — SessionStart ×2, PostToolUse ×1, Stop ×1 — and the Codex profile wires SessionStart alone. A write-time refusal has no equivalent on Codex, Cursor or Copilot.

A guard this repository can only enforce for one of the tools it supports contradicts the premise of the repository, so it is removed rather than duplicated.

What still holds

Nothing that was enforced stops being enforced. The pre-commit job covers every edit that reaches a commit, whichever tool or person made it, and validate.yml replays it over the whole tree on each pull request. Only the moment of the refusal moves: commit time instead of write time.

The hook also failed open at every step by design, and nothing lints scripts/ or .claude/hooks/ — every one of those jobs globs cli/** — so it could have stopped working with nothing to say so.

How to verify

  • node scripts/check-architecture-rules.js → 350 governed file(s) checked, no violation
  • append - See aidd-context:01-memory here. to plugins/aidd-vcs/skills/01-commit/SKILL.md, rerun → exits 1 with …SKILL.md:36 addresses sibling plugin \"aidd-context\"
  • node scripts/check-tests-leave-git-alone.js -- node --test 'scripts/__tests__/**/*.test.js' → 498 tests, 0 failed
  • grep -rn check-architecture-rules .claude/ → nothing

architecture-scan.js keeps only the three functions the command uses; violationsForFile and actionFileNames were exported for the hook alone and are now private.

Refs #250

🤖 Generated with Claude Code

https://claude.ai/code/session_01FPREgkoNtK4PYh2YyZbztq

…l passes

The write-time refusal was a Claude Code PreToolUse hook. It bought one
turn of latency for a mechanism no other tool can host: across every
plugin shipped here the portable hook surface is SessionStart, and a
write-time refusal has no equivalent on Codex, Cursor or Copilot.

A guard this repository can only enforce for one of the tools it supports
contradicts the premise of the repository. The pre-commit job already
covers every edit that reaches a commit, whichever tool or person made it,
and validate.yml replays it over the whole tree on each pull request, so
nothing that was enforced stops being enforced.

The hook also failed open by design, and nothing lints scripts/ or
.claude/hooks/, so it could have stopped working without anything saying so.

architecture-scan.js keeps only the three functions the command uses.

Refs #250

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPREgkoNtK4PYh2YyZbztq
AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
@blafourcade
blafourcade requested a review from a team as a code owner September 21, 2026 04:33
blafourcade and others added 3 commits September 21, 2026 06:36
231 words to say a pre-commit job runs. The file breakdown is readable in
the code, the reason the write-time hook went lives in its own commit and
pull request, and "never refuses a citation with no file behind it" is a
test's job to state, not a sentence's.

What stays is the rule, and the one exemption a reader applying that rule
would otherwise trip over.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPREgkoNtK4PYh2YyZbztq
AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
ARCHITECTURE.md states the rule and the one exception to it. What runs the
rule belongs in the pre-commit gates table, which is where someone asks
what a commit checks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPREgkoNtK4PYh2YyZbztq
AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
A critical pass over the two documents, one reader at a time, found five
defects in this branch's own edits. All five are corrected here.

- The `--no-verify` sentence was replaced by a second falsehood. Checked
  against all nine workflows this time: no workflow fires on a push to a
  feature branch, `ci.yml` and `cli-ci.yml` fire on any pull request
  whatever its base, and only `validate.yml` filters `main` and `next`,
  minus three `cli` jobs it excludes.
- Reading "Claude Code" as "an AI coding tool" made line 9 false. The
  manifest it points at is `.claude-plugin/marketplace.json`; codex emits
  `.agents/plugins/`, cursor `.cursor-plugin/`, copilot `.plugin/`. All
  three substitutions are reverted. That framing needs a rewrite, not a
  word swap.
- The exemption bullet named one of the two holes in rule one.
  `isExemptFromOrthogonality` also exempts every path under
  `plugins/aidd-orchestrator/`.
- The doc test read tables by position, so a `Runs` cell could name a
  deleted script and stay green. Tables are now found by their header
  cells and read by column name. A fifth test opens the script the table
  names.
- Its failure message named one exemption bullet after this branch split
  it into two.

Nine attacks replayed against the rewritten parser: a missing script, an
un-backticked name and a wrong event go red; a blank line inside a table,
an escaped pipe and an inserted column stay green. Four semantic
mutations each redden exactly the test that names them.

503 tests pass. Referenced paths 0 dead, doc duplication 0, architecture
rules 350 governed files clean.

Refs #250

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPREgkoNtK4PYh2YyZbztq
AIDD-Session-Id: 2261efcd-a873-4e60-9893-2217f702bde2
@blafourcade
blafourcade merged commit 1e2b76e into next Sep 21, 2026
24 checks passed
@aidd-bot aidd-bot Bot mentioned this pull request Sep 24, 2026
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