Skip to content

fix(ci): allowlist .claude/ in the structure lint - #59

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/pyautomemory-ci-validation-mpida2
Aug 25, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
claude/pyautomemory-ci-validation-mpida2

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

What

One line in scripts/validate_structure.py:

 ALLOWED_TOP_DIRS = {
+    ".claude",  # agent tooling (session hooks, settings), not content
     ".git",
     ".github",

Why

main is red. Commit 498e1a8 added a tracked .claude/ directory (hooks/session-start.sh, settings.json) without adding it to ALLOWED_TOP_DIRS, so the structure lint reports:

ERROR: unexpected top-level directory: .claude/ (content belongs under wiki/ or bibliography/)
Repository structure is invalid (1 problem(s)).

One root cause, both legs of validate.yml:

  • make validate → validate-structure exits 1
  • make test → tests/test_validate_structure.py::test_actual_repository_layout_is_valid, which asserts the live repo layout validates

So every PR opened against main was red on arrival, regardless of its contents.

.claude/ is agent tooling, not knowledge content — it belongs beside .git/.github in the allowlist rather than being relocated under wiki/ or bibliography/, which are the two content homes the lint exists to protect.

Verification

Locally, on this branch:

  • make validate → "Repository structure is valid."
  • python -m pytest tests/ -q → 69 passed

Both red without the change, green with it.

Scope

Deliberately one line. .claude/ is a generated artifact — per 498e1a8's own message the hook's canonical source is PyAutoMind/policy/session_start_hook.sh, installed by PyAutoMind/scripts/repos_sync.py. I checked PyAutoMind and PyAutoBrain for a template copy of validate_structure.py carrying the same allowlist; there is none, so this is a genuine single-site fix with no template drift following from it.

Worth noting for later: repos_sync can install .claude/ into any repo without knowing about that repo's structure lint. PyAutoMemory is the only one that has such a lint today, which is why it is the only one that broke.


Generated by Claude Code

Commit 498e1a8 added a tracked `.claude/` directory (the SessionStart hook
and its settings.json) without adding it to `ALLOWED_TOP_DIRS` in
scripts/validate_structure.py, so `make validate-structure` reports

    ERROR: unexpected top-level directory: .claude/

on main. That fails both `make validate` and `make test` (via
tests/test_validate_structure.py::test_actual_repository_layout_is_valid),
which is every leg of validate.yml — so main is red and any PR opened
against it is red on arrival.

`.claude/` is agent tooling, not content, and belongs beside `.git`/
`.github` in the allowlist rather than under wiki/ or bibliography/.

Verified locally: `make validate` and `python -m pytest tests/ -q`
(69 passed) both green with this change, both red without it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoUmRWL7vsdd2N57DmgUvh
@Jammy2211
Jammy2211 merged commit 463cdcb into main Aug 25, 2026
1 check passed
Jammy2211 pushed a commit that referenced this pull request Aug 25, 2026
main landed the same .claude/ allowlist fix in #59 (93a0b6b) while this branch
was in flight. Same one-line change, different comment wording — resolved in
main's favour, so 05aa803 here now contributes nothing and the file is
byte-identical to main. Kept as a merge rather than a rebase: the branch is
pushed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ex9YARe5kDjsT3Ug7LKQ1r
@Jammy2211
Jammy2211 deleted the claude/pyautomemory-ci-validation-mpida2 branch August 25, 2026 15:53
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