Refactor deterministic check execution plan#72
Merged
Conversation
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.
This pull request refactors the deterministic check runner to centralize and simplify the logic for building and executing check plans. The main change is the introduction of a new
deterministic-plan.tsmodule, which encapsulates the creation and execution of all policy, plugin, and tool checks in a unified, extensible way. This results in cleaner orchestration code, more maintainable check definitions, and a streamlined transcript/reporting system.Key changes include:
Refactoring and Centralization of Check Plan Logic:
src/runner/deterministic-plan.ts, which defines a newDeterministicCheckPlanEntryinterface and functions to build a unified run plan for all checks (policies, plugins, and tools). The plan is now built in one place and executed in a single loop, replacing scattered logic.src/runner/deterministic.ts) now delegates plan construction and execution to this new module, removing ad-hoc loops and duplicated logic for each check type. [1] [2] [3] [4]Transcript and Output Simplification:
src/runner/transcript.ts) now uses a singlewriteCheckResultmethod for all check types, instead of separate methods for policies, plugins, and tools. This is enabled by a newDeterministicTranscriptCheckResultinterface, which standardizes what is displayed for each check. [1] [2] [3] [4]Test Adjustments:
These changes make the runner codebase more modular, easier to extend with new check types, and more consistent in its output and error handling.