Skip to content

Refactor deterministic check execution plan#72

Merged
dbrosio3 merged 1 commit into
mainfrom
refactor-deterministic-check-execution-plan
Jul 1, 2026
Merged

Refactor deterministic check execution plan#72
dbrosio3 merged 1 commit into
mainfrom
refactor-deterministic-check-execution-plan

Conversation

@dbrosio3

@dbrosio3 dbrosio3 commented Jul 1, 2026

Copy link
Copy Markdown
Member

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.ts module, 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:

  • Introduced src/runner/deterministic-plan.ts, which defines a new DeterministicCheckPlanEntry interface 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.
  • The runner (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:

  • The transcript module (src/runner/transcript.ts) now uses a single writeCheckResult method for all check types, instead of separate methods for policies, plugins, and tools. This is enabled by a new DeterministicTranscriptCheckResult interface, which standardizes what is displayed for each check. [1] [2] [3] [4]
  • Removed logic for mapping names to display labels/details from the transcript, as this is now handled when constructing each check entry.

Test Adjustments:

  • Updated tests to use the new check result interface and label-based output, reflecting the refactored transcript API.

These changes make the runner codebase more modular, easier to extend with new check types, and more consistent in its output and error handling.

@dbrosio3 dbrosio3 merged commit 83734e1 into main Jul 1, 2026
1 check 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.

1 participant