Repository navigation
docs(rules): enforce mock fixture isolation and add PR review resolution tools - #510
Merged
Merged
Conversation
…ion tools - Add strict mock & test fixture isolation rule to core_engineering.md: production component and service source files must never embed static mock datasets or fallback mock branches. - Standardize cleanState, setupModule, and bootstrap helpers in typescript_javascript.md to eliminate mutable let state and memory leaks in Angular Jasmine tests. - Update xmc_review_pr skill with mock fixture leakage audit directives and CLI thread resolution workflow. - Enhance tools/github_utils.py with GraphQL resolve_review_thread helper supporting both GraphQL Node IDs and numeric comment IDs. - Add --resolve-thread CLI option to tools/review_pr_post_inline_comment.py. - Enhance tools/review_pr_verify_posted.py with resilient dynamic table parsing. - Add unit tests across all updated tools modules. TAG=agy CONV=1825d39c-2b63-4440-a73d-1b8cb1967563
There was a problem hiding this comment.
Code Review
This pull request updates the engineering rules and guidelines to enforce strict mock and fixture isolation, ensuring that mock data resides exclusively in test files. It also enhances the PR review automation tools by adding programmatic thread resolution via the GitHub GraphQL API and improving markdown table parsing to support dynamic column layouts. The review feedback highlights three robust error-handling improvements in tools/github_utils.py: adding defensive checks for GraphQL query and mutation responses to prevent potential AttributeError crashes when errors are returned, and wrapping comment ID parsing in a try-except block to gracefully handle invalid formats.
…to SRP and function size targets
VLukiantsev
marked this pull request as ready for review
August 20, 2026 16:17
andrzejfudro
approved these changes
Aug 21, 2026
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.
Summary
Enforces strict mock data and test fixture isolation in production source files, standardizes
cleanStatetest double lifecycle patterns to prevent memory leaks in UI tests, and enhances PR review CLI tooling with automated GitHub GraphQL review thread resolution.Motivation & Context
During the PR #490 code review and subsequent reflection audit:
DashboardsPageembedded mock experiment datasets and fallback routing inside a production component file because rules only audited function line length. Adding an explicit rule clarifies that production source files must never contain mock datasets or synthetic fallback logic.cleanState,setupModule, andbootstraphelpers in UI tests eliminates top-level mutableletstate and prevents DOM reference leakage across specs.--resolve-threadtoreview_pr_post_inline_comment.pyautomates thread resolution.Key Changes
.agents/rules/):core_engineering.md: Added strict Mock & Fixture Isolation rule prohibiting static mock datasets, default sample entities, or conditional fallback mock branches inside production source code.languages/typescript_javascript.md: StandardizedcleanState,setupModule, andbootstraptesting helpers fromxmanager_cloud/ui/app/testing/testand enforced hermetic Angular DI in test doubles..agents/skills/):xmc_review_pr/SKILL.md: Added Mock & Fixture Leakage Check to Phase 2 subagent prompt guidelines and documented--resolve-threadin Mode B.tools/):tools/github_utils.py: Addedresolve_review_thread()utilizing GitHub GraphQLresolveReviewThreadmutation, supporting both GraphQL Node IDs and numeric comment IDs.tools/review_pr_post_inline_comment.py: Added--resolve-thread <thread_id>CLI argument.tools/review_pr_verify_posted.py: Enhanced markdown table parsing to dynamically resolve column header mappings.github_utils_test.py,review_pr_post_inline_comment_test.py, andreview_pr_verify_posted_test.py.Verification & Testing
tools/venv/bin/python3 -m unittest discover -s tools -p "*_test.py"executed with 211 passed tests.mypy tools/github_utils.py tools/review_pr_post_inline_comment.py tools/review_pr_verify_posted.pypassed with 0 errors.buildifier,gofmt,golangci-lint,addlicense,ruff) verified.🧪 Trajectory & Outcome Benchmark Results
cmd/ui/app/pages/dashboards/dashboards_page.tsanddashboards_page_test.tsfor Single Responsibility Principle (SRP) compliance, test double isolation, and clean state testing practices."🎯 LLM-as-a-Judge Outcome Scorecard
cleanStatetest standardsVerdict:
PASSEDRelated Issues / Bugs
N/A
TAG=agy
CONV=1825d39c-2b63-4440-a73d-1b8cb1967563