Skip to content

refactor: split main-action into focused modules - #11545

Merged
lpcox merged 2 commits into
mainfrom
copilot/refactor-split-main-action
Nov 13, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/refactor-split-main-action

Conversation

Copilot AI commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Audit: Isolate redaction and snapshot persistence; keep the snapshot store private with read-only access for cleanup.
  • Diagnostics: Group bounded startup records, exit markers, and incomplete-audit markers.
  • Cleanup: Separate teardown orchestration while preserving explicit state getters, ordering, and single-flight execution.
  • Compatibility: Preserve createMainAction and existing testHelpers imports; add direct-export compatibility assertions.

Mutable closure-state consolidation remains deferred.

Copilot AI changed the title [WIP] Refactor main-action.ts into focused modules refactor: split main-action into focused modules Nov 13, 2026
Copilot AI requested a review from lpcox November 13, 2026 15:39
@lpcox
lpcox marked this pull request as ready for review November 13, 2026 15:43
Copilot AI adaptive review requested due to automatic review settings November 13, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 testHelpers imports 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)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@lpcox
lpcox merged commit 1e9c676 into main Nov 13, 2026
49 of 50 checks passed
@lpcox
lpcox deleted the copilot/refactor-split-main-action branch November 13, 2026 16:24
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.

[Refactoring] Split src/commands/main-action.ts into focused modules

3 participants