Skip to content

refactor(cli): simplify command setup and fixtures - #1208

Merged
mldangelo-oai merged 18 commits into
mainfrom
refactor/pr1185-followup-08-cli
Oct 4, 2026
Merged

mldangelo-oai merged 18 commits into
mainfrom
refactor/pr1185-followup-08-cli

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

CLI commands repeat option and signal-handler setup. Share those paths and their fixtures while preserving the current command surface and output.

Changes

  • Reuse signal setup around the existing abort listeners and exit-code helper.
  • Preserve AbortSignal arguments at all cancellation callers and retain ordinary-error diagnostics.
  • Introduce fixture helpers with their CLI and publication-fixture consumers.
  • Remove the unused internal malformed-output flag while retaining noisy-stream parsing, errors and completion checks.

Testing

  • Fresh CLI-focused run: 862 passed, 1 skipped across 29 test modules.
  • The five portable source checks passed. SDK changes passed types and normal formatting; MCP changes passed MCP typecheck and relevant formatting checks.
  • The combined integration tree is byte-identical to the previously validated combined tree: both full SDK runs (3,566 passed, 53 skipped each), 209 MCP checks and installed-package checks remain applicable. These full suites were not rerun for this history-only integration.
  • Three fresh native reviews and an independent verifier passed for this exact base/head. Hosted CI and Codex/Copilot reviews run on the updated head.

Risk and rollout

Commands, flags, accepted values and defaults do not change. SIGINT/SIGTERM exit behavior and raw error text remain covered by the command-level checks.

Targets main, with dff04368 merged. The original refactor contribution is unchanged; conflicts from the landed parent PRs are resolved.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

codex added 2 commits October 3, 2026 19:14
Repository fixtures and hydration tools duplicate Git process setup. Share the existing invocation patterns with their actual consumers.
SDK entrypoints and tests repeat runtime, authentication and option setup. Share the setup at existing owners and introduce internal helpers with their first consumers.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T05:05:58.414385Z 5891e20 Manual request
🔒 Security Review ✅ Completed 2026-10-04T05:06:07.641151Z 5891e20 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 635f523.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 635f52367b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The refactoring preserves existing behavior and retains focused coverage for signals, diagnostics, settings, and fixtures.

Review effort: Balanced
Findings: None

What changed in this PR

Refactors shared CLI setup and test fixtures while preserving command behavior, cancellation handling, and diagnostics.

Changes:

  • Consolidates signal handling, scan-setting selection, output capture, and credential filtering.
  • Reuses temporary-directory, mock, pagination, error, and publication fixtures.
  • Strengthens command-level cancellation and diagnostic assertions.
File Description
sdk/​typescript/​src/​cli.ts Consolidates CLI setup and signal handling.
sdk/​typescript/​src/​cli-help.ts Simplifies option-label formatting.
sdk/​typescript/​tests-ts/​support/​linear-pagination.ts Adds an empty-page fixture.
sdk/​typescript/​tests-ts/​cli-fixtures.ts Expands shared CLI fixtures and types.
sdk/​typescript/​tests-ts/​skeleton.test.ts Reuses output capture fixtures.
sdk/​typescript/​tests-ts/​mock-scan.test.ts Reuses mocks and temporary directories.
sdk/​typescript/​tests-ts/​linear.test.ts Reuses pagination helpers.
sdk/​typescript/​tests-ts/​github.test.ts Replaces manual tracking with mocks.
sdk/​typescript/​tests-ts/​cli-workbench.test.ts Consolidates workbench fixtures and assertions.
sdk/​typescript/​tests-ts/​cli-verify-fix.test.ts Shares Linear and mock fixtures.
sdk/​typescript/​tests-ts/​cli-suggest-owners.test.ts Shares directories and adds error coverage.
sdk/​typescript/​tests-ts/​cli-skills.test.ts Reuses directory, error, and invocation fixtures.
sdk/​typescript/​tests-ts/​cli-signals.test.ts Reuses security and error fixtures.
sdk/​typescript/​tests-ts/​cli-serve.test.ts Reuses stream capture.
sdk/​typescript/​tests-ts/​cli-scan-prompts.test.ts Reuses directories and mocks.
sdk/​typescript/​tests-ts/​cli-scan-import.test.ts Simplifies failures and diagnostic assertions.
sdk/​typescript/​tests-ts/​cli-publish.test.ts Consolidates publication fixtures and mocks.
sdk/​typescript/​tests-ts/​cli-project-config.test.ts Shares client, directory, and security fixtures.
sdk/​typescript/​tests-ts/​cli-policy.test.ts Consolidates policy fixtures and mocks.
sdk/​typescript/​tests-ts/​cli-patch.test.ts Reuses patch, Git, pagination, and directory helpers.
sdk/​typescript/​tests-ts/​cli-patch-trust.test.ts Reuses temporary-directory creation.
sdk/​typescript/​tests-ts/​cli-patch-results.test.ts Extracts Node-backed Codex fixture setup.
sdk/​typescript/​tests-ts/​cli-launcher.test.ts Reuses temporary-directory creation.
sdk/​typescript/​tests-ts/​cli-history-paths.test.ts Uses mock call assertions.
sdk/​typescript/​tests-ts/​cli-feedback.test.ts Reuses directory and error fixtures.
sdk/​typescript/​tests-ts/​cli-export.test.ts Shares scan-copy, directory, and mock helpers.
sdk/​typescript/​tests-ts/​cli-diagnostics.test.ts Reuses security and warning fixtures.
sdk/​typescript/​tests-ts/​cli-deep-scan-summary.test.ts Uses shared errors and mocks.
sdk/​typescript/​tests-ts/​cli-dedupe.test.ts Simplifies failure and invocation assertions.
sdk/​typescript/​tests-ts/​cli-cloud-publish.test.ts Consolidates publication setup and mocks.
sdk/​typescript/​tests-ts/​cli-classify-severity.test.ts Strengthens exact diagnostic assertions.
sdk/​typescript/​tests-ts/​cli-authentication.test.ts Reuses authentication, security, and JSON fixtures.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

codex added 2 commits October 3, 2026 20:31
CLI commands repeat option and signal-handler setup. Share those paths and their fixtures while preserving the current command surface and output.

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed 635f52367b486ea18d20d0f089daf92510700700 against its own base aa2b7867856b46440c6b671cb29f2f21a43b700d with exactly three independent high-reasoning full-diff reviews, including every test diff, plus root verification. No serious introduced code defect identified.

857 focused SDK tests passed (1 skipped); fresh native host build, plugin/SDK builds, types and formatting passed.

Local validation was on macOS arm64. No model execution, local Windows run or full installed-package smoke. Reviewed sources remained unchanged. This review covers this exact head; it does not establish combined-stack validation against current main.

@mldangelo-oai
mldangelo-oai force-pushed the refactor/pr1185-followup-08-cli branch from 635f523 to 474d325 Compare October 3, 2026 21:09
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 474d325.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 474d325b88

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The broad CLI and fixture refactor still requires human review and fresh hosted validation after the documented restack.

Review effort: Balanced
Findings: None

codex and others added 11 commits October 3, 2026 21:34
# Conflicts:
#	sdk/typescript/src/security-policy.ts
#	sdk/typescript/tests-ts/api-policy.test.ts
#	sdk/typescript/tests-ts/api-post-scan.test.ts
#	sdk/typescript/tests-ts/component-scan.test.ts
#	sdk/typescript/tests-ts/security-policy.test.ts
# Conflicts:
#	sdk/typescript/src/cli.ts
#	sdk/typescript/tests-ts/cli-export.test.ts
# Conflicts:
#	sdk/typescript/tests-ts/support/shell.ts
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 10ef46c.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 10ef46c06c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The broad CLI signal, cancellation, output, and publication refactor warrants final human review after the documented stack restacking.

Review effort: Balanced
Findings: None

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed exact head 10ef46c06ca8917452e538cfb36932fe7a968960 against 33746cd2e1766cf658fffa72d8adf7a4c6422828. Exactly three fresh independent HIGH full-diff reviews, including every test diff, plus root verification are complete. No serious introduced product finding remains.

Approval is withheld while inherited installed-package/container checks fail on the cleanup assertion described in #1207 (package-behavior.mjs:202). This is a base fixture/cleanup-contract failure at this head, not a new finding in this PR contribution. Correct it upstream and rerun hosted checks.

Local validation: 862 SDK tests passed,1 skipped. Fresh macOS arm64 native host, plugin and SDK builds, types and formatting passed. Reviewed sources are unchanged. No model execution, local Windows run or full installed-package smoke. Source review is complete; merge readiness is not established.

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head ec065c2.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: ec065c2e98

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The refactor preserves existing behavior and is supported by broad command-level coverage.

Review effort: Balanced
Findings: None

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed ec065c2e986cab1c532437abb3fab546fea230cb against d519e01451b45a46ea2e9b6d3fd28489f8089d99. All 33 ordered file contributions and touched base/head blobs match the previously reviewed contribution, so the three independent full-diff passes and 862 passed / 1 skipped SDK validation are retained without duplicate reviews or tests. Root checked the inherited package lifecycle fixture change and the exact current GitHub diff; no serious introduced findings remain.

The inherited fixture passes against the #1207 production tarball with existing exact-version dependencies. This is not a clean installed-package smoke of this head; clean installation is blocked by unavailable registry versions. No model execution, local Windows run, or source edits.

This approves the reviewed source. Current-head hosted CI remains unfinished, and approval does not establish merge readiness.

Base automatically changed from refactor/pr1185-followup-07-runtime to main October 4, 2026 04:38
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 5891e20.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 5891e200a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

The broad CLI and test-suite refactor spans signal, authentication, publication, and scan-setting paths and warrants final human review.

Review effort: Balanced
Findings: None

@alandelong-oai alandelong-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Source review approved for 5891e200a5dcaa6ff6fe1635f572740a5f2929fc against dff043688e8e0d7cb9079525eec82ab61eed195f.

Retained exactly three independent HIGH full-diff review passes, including every test diff. Independently verified the actual GitHub three-dot diff, identical ordered contributions, all 33 touched paths at both base and head (bytes and modes), and the three historical report hashes. No actionable introduced source finding remains. No additional full source pass or local test was run for this restack; prior validation retains its original revision, execution time, and limitations.

Hosted CI was still unfinished at the separate 2026-10-04 05:14 UTC observation.

This is source approval, not a merge-readiness or combined-integration claim. No fresh model execution, local Windows validation, native rebuild, or clean installed-package smoke test is claimed.

@mldangelo-oai
mldangelo-oai merged commit ba9aa37 into main Oct 4, 2026
66 of 68 checks passed
@mldangelo-oai
mldangelo-oai deleted the refactor/pr1185-followup-08-cli branch October 4, 2026 08:10
@github-actions github-actions Bot mentioned this pull request Oct 4, 2026
3 tasks done
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.

4 participants