Guard the agent-config topology with a unit test - #728
Merged
Conversation
AGENTS.md is loaded in every agent session; agents/docs/ is loaded by nothing and is only read because an always-loaded file points at it. Three failure modes are therefore silent: a doc nothing points at, a pointer that stops resolving, and a fact restated in AGENTS.md that has drifted from the build files it was copied from. AgentConfigTest checks all three, plus a line budget on AGENTS.md and that .claude/settings.json only ever points at scripts that exist in the shared agents/ directory. Plain JUnit, no Android dependencies, so it runs in the existing unit-test job.
kasnder
marked this pull request as ready for review
August 20, 2026 12:21
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.
Follow-up to #727. That PR made
AGENTS.mda short entry point withagents/docs/read on demand; nothing yet stops that structure decaying back into one long file, or a pointer going stale without anyone noticing. This adds the mechanical half, modelled on DuckDuckGo'sAiConfigCheckerGradle gate.What it checks
app/src/test/java/net/kollnig/missioncontrol/AgentConfigTest.java— plain JUnit, no Android or Robolectric dependency, so it runs inside the existing unit-test job.everyAgentDocIsReachableFromAnAlwaysLoadedFileagents/docs/, so a docAGENTS.mddoes not point at will never be readeveryPathReferenceResolvesagentsMdDoesNotRestateVolatileVersionsAGENTS.mddrifts from the build files without anything failingagentsMdStaysShortEnoughToLoadEverySessionvendorWiringPointsAtSharedScriptsCLAUDE.mdgrowing its own copy of the guidance, or.claude/settings.jsonpointing at a script that no longer existsReference scanning skips fenced code blocks, globs, placeholders and absolute paths, and only treats a path as a repo reference when its first segment exists at the repo root — so package paths (
src/main/java/) and build outputs (app/build/outputs/apk/…) don't produce false positives.Testing
The container has no Android SDK, so Gradle couldn't run the suite here. Instead the test was compiled with
javacand run underJUnitCoredirectly:repoRoot()helper supports (module dir and repo root), matching the existingassetPath()pattern inBlockingBaselineSubsetTest.agents/docs/triage.md→triaging.md, an injectedNDK 27.2.12479018 and JDK 17line, 60 filler lines, and a renamed hook script. The tree is clean and green afterwards.Worth confirming the suite passes under
./gradlew :app:testGithubDebugUnitTestin CI, since I couldn't run it locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01TL2vW7nHBGUqkA55wCHRqj
Generated by Claude Code