Repository navigation
fix(brief): say an archy.yaml was found but invalid, instead of that none exists (#790) - #944
Merged
Conversation
🏛️ Architecture score (archy)Overall: 0.6138 → 0.6139 (+0.0002) ➖ no change
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. |
There was a problem hiding this comment.
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.
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.
Closes #790.
What and why
archy briefand MCParchy_briefcaughtLayerConfigErroraround coverage and setcoverage = config = None.load_configaccepts overlapping layer patterns andcompute_coverageraises on them later, so a config thatarchy checkrejects was shown bybriefas no config at all: "(no archy.yaml discovered, so no layer rule governs anything)", andcoverage: nullwith no reason in JSON and MCP.The catch now keeps the error:
archy.yaml found but invalid: <error>instead of the no-config line, and the rest of the briefing still prints;coverage_errorfield (string or null) besidecoverage, onBriefPayloadand inarchy 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_errorcovers 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 thatcompute_coveragereally 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 noarchy.yamland with a valid one now assertcoverage_erroris null, in CLI JSON and MCP.Mutation check, tests kept, run on
tests/test_cli_contracts.pyandtests/test_mcp_brief.py:src/change revertedtest_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_unverifiedWith the change, all 32 pass.
On
main0f90188: fullpytest2106 passed, 2 skipped.ruff check,ruff format --check,ty check,archy check .,archy cycles . --strict,archy contracts .andarchy conventions . --emit-headers --checkall exit 0. Themcp 2.x compatibilityjob run locally the wayci.ymldoes 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
coverageinsrc/archy/mcp_payloads.pysays 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.pyon 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.