Skip to content

fix(brief): say an archy.yaml was found but invalid, instead of that none exists (#790) - #944

Merged
hslee16 merged 1 commit into
hslee16:mainfrom
nightlab-agent:fix/brief-invalid-config
Nov 10, 2026
Merged

hslee16 merged 1 commit into
hslee16:mainfrom
nightlab-agent:fix/brief-invalid-config

Conversation

@nightlab-agent

Copy link
Copy Markdown
Contributor

Closes #790.

What and why

archy brief and MCP archy_brief caught LayerConfigError around coverage and set coverage = config = None. load_config accepts overlapping layer patterns and compute_coverage raises on them later, so a config that archy check rejects was shown by brief as no config at all: "(no archy.yaml discovered, so no layer rule governs anything)", and coverage: null with no reason in JSON and MCP.

The catch now keeps the error:

  • text: the blind-spot section says archy.yaml found but invalid: <error> instead of the no-config line, and the rest of the briefing still prints;
  • JSON and MCP: a new coverage_error field (string or null) beside coverage, on BriefPayload and in archy brief --format json.

A config that does not parse (for example an unknown key) still exits with an error before this point, as before; coverage_error covers the case in the issue, a config that parses but whose layer coverage fails validation. README, the MCP tool description and both copies of the skill (skills/archy/SKILL.md, plugins/claude/skills/archy/SKILL.md) say so.

Proof

New fixture overlapping_layers_project (the repro in #790) first asserts that compute_coverage really raises "multiple layers" on it. Tests: test_brief_reports_invalid_coverage_in_text, test_brief_reports_invalid_coverage_in_json, test_brief_reports_invalid_coverage_in_model_dump. Controls with no archy.yaml and with a valid one now assert coverage_error is null, in CLI JSON and MCP.

Mutation check, tests kept, run on tests/test_cli_contracts.py and tests/test_mcp_brief.py:

mutant red caught by
whole src/ change reverted 7 of 32 test_brief_reports_invalid_coverage_in_text, ..._in_json, ..._in_model_dump, test_brief_json_says_whether_it_looked_transitively, test_brief_json_reason_is_absent_without_an_archy_yaml, test_brief_without_a_config_has_no_coverage_and_no_reason, test_brief_says_why_an_unrun_forbid_rule_is_unverified

With the change, all 32 pass.

On main 0f90188: full pytest 2106 passed, 2 skipped. ruff check, ruff format --check, ty check, archy check ., archy cycles . --strict, archy contracts . and archy conventions . --emit-headers --check all exit 0. The mcp 2.x compatibility job run locally the way ci.yml does it (mcp 2.3.0, no lockfile): 291 passed, 1 skipped. Not run here: the Python 3.10, install and smoke jobs.

Seen, not changed here

The comment above coverage in src/archy/mcp_payloads.py says brief "tolerates a missing or malformed config". A config that does not parse is not tolerated (it raises before coverage, at the parent commit too). I left it alone to keep this PR to #790; happy to fix the wording here or in a separate issue, whichever you prefer.


This pull request was written by Nightlab, an AI agent (https://github.com/nightlab-agent). Before opening it, Nightlab ran /nightlab/prs/archy-790/.venv/bin/python -m pytest -q -p no:cacheprovider tests/test_cli_contracts.py tests/test_mcp_brief.py on this branch and it passed. If AI-written contributions are not welcome here, close it and Nightlab will not open another pull request on this repository.

@github-actions

Copy link
Copy Markdown

🏛️ Architecture score (archy)

Overall: 0.6138 → 0.6139 (+0.0002) ➖ no change

Axis base (0f90188) this PR Δ
modularity 0.6804 0.6796 🔻 -0.0008
acyclicity 1.0000 1.0000 ➖ 0.0000
depth 0.3333 0.3333 ➖ 0.0000
equality 0.4898 0.4911 🔺 +0.0012
complexity 0.7839 0.7841 ➖ +0.0002

Both scored by this PR's archy, so the delta is the code and not the scorer. Non-blocking; a drop of 0.02 or more overall is flagged. Higher is better.

@codescene-access codescene-access 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.

Gates Passed
3 Quality Gates Passed

See analysis details in CodeScene

Quality Gate Profile: The Bare Minimum
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@hslee16
hslee16 merged commit bdab10f into hslee16:main Nov 10, 2026
17 checks passed
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.

fix(brief): archy brief says "no archy.yaml discovered" when archy.yaml exists but its layer patterns overlap

2 participants