Repository navigation
refactor: split main-action into focused modules - #11545
Merged
Merged
Conversation
Co-authored-by: lpcox <[email protected]>
Copilot
AI
changed the title
[WIP] Refactor main-action.ts into focused modules
refactor: split main-action into focused modules
Nov 13, 2026
lpcox
marked this pull request as ready for review
November 13, 2026 15:43
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review reports no active issues blocking approval.
No open issues 🎉
What changed in this PR
Addresses #11539 by extracting audit persistence, startup diagnostics, and cleanup from AWF’s main command handler, leaving it focused on workflow orchestration.
Changes:
- Separates redaction and audit snapshots into a module with private storage and read-only snapshot access.
- Moves diagnostics and teardown into dedicated modules, retaining cleanup ordering and single-flight execution.
- Preserves legacy
testHelpersimports and adds direct-export compatibility assertions.
| File | Description |
|---|---|
src/commands/main-action.ts |
Replaces extracted helpers with imports while retaining orchestration. |
src/commands/main-action.test.ts |
Exercises cleanup through its direct export. |
src/commands/main-action-startup-diagnostics.ts |
Houses startup records, exit markers, and incomplete-audit markers. |
src/commands/main-action-startup-diagnostics.test.ts |
Checks diagnostic export compatibility and direct usage. |
src/commands/main-action-cleanup.ts |
Isolates teardown with explicit state getters and single-flight execution. |
src/commands/main-action-audit.ts |
Isolates redaction, audit persistence, and private snapshot storage. |
src/commands/main-action-audit-handoff.test.ts |
Checks audit and cleanup export compatibility while retaining handoff coverage. |
Review effort: Max (dynamic)
Contributor
|
✅ Copilot review passed with no inline comments. @copilot Add the |
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.
The main action mixed orchestration with security-sensitive audit persistence, startup diagnostics, and cleanup. This extraction reduces the module from 988 to 505 lines without changing orchestration behavior.
createMainActionand existingtestHelpersimports; add direct-export compatibility assertions.Mutable closure-state consolidation remains deferred.