Skip to content

refactor(sdk): share progress and event parsing - #1209

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

mldangelo-oai merged 18 commits into
mainfrom
refactor/pr1185-followup-09-progress

Conversation

@mldangelo-oai

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

Copy link
Copy Markdown
Collaborator

Summary

Progress, activity and cost paths repeat scalar and JSON parsing. Reuse internal helpers and simplify presentation without changing the rendered diagnostics or cost arithmetic.

Changes

  • Introduce JSON parsing and JSON-lines fixture writing with their first consumers.
  • Simplify worker progress, dashboards, history and CLI summary presentation.
  • Retain current Bedrock pricing, integer-unit calculations and timer cleanup.
  • Parse existing session text directly instead of constructing three synthetic event envelopes; retain root-event and failed-receipt filtering.

Testing

  • Fresh progress, cost, logs and dashboard run: 177 passed across 6 test modules.
  • The five portable source checks, SDK typecheck, normal formatting and plugin build passed on the updated head.
  • 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.
  • The policy test that previously timed out on macOS passed unchanged locally on Linux with the normal 30-second timeout. The new hosted CI run will verify macOS.
  • 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

Raw diagnostics, terminal escaping, event handling and cost totals remain compatibility boundaries. This patch owns the CLI presenter changes; command plumbing belongs to the separate CLI follow-up.

Targets main, with 634532d7 merged. Shared-helper conflicts are resolved by retaining the functions required by both parents. The resulting whole source tree is identical to the previously validated combined integration tree.

The related CLI, findings, publication, worker-launch, coordinator and CI follow-ups have landed. Their changes remain intact.

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-04T08:33:45.327119Z 12d8fa3 Manual request
🔒 Security Review ✅ Completed 2026-10-04T08:33:47.693020Z 12d8fa3 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 ce53558.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: ce53558401

ℹ️ 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

Final approval should follow the required restacking onto main and reconciliation of overlapping helpers with #1210.

Review effort: Balanced
Findings: None

What changed in this PR

Refactors SDK parsing, progress, cost, and presentation code while preserving behavior.

Changes:

  • Adds shared JSON and integer-validation helpers.
  • Simplifies progress, cost, dashboard, history, and CLI rendering.
  • Consolidates test fixtures, mocks, and JSON-lines writing.
File Description
sdk/​typescript/​src/​value.ts Adds shared JSON parsing.
sdk/​typescript/​src/​worker-progress.ts Reuses parsing and integer helpers.
sdk/​typescript/​src/​deep-progress.ts Consolidates progress validation.
sdk/​typescript/​src/​cost-model.ts Reuses token-count validation.
sdk/​typescript/​src/​cost.ts Simplifies progress aggregation.
sdk/​typescript/​src/​scan-activity.ts Reuses JSON parsing and simplifies extraction.
sdk/​typescript/​src/​scan-dashboard.ts Simplifies dashboard formatting.
sdk/​typescript/​src/​scan-history-renderer.ts Simplifies configuration rendering.
sdk/​typescript/​src/​patch-tui.tsx Simplifies detail formatting.
sdk/​typescript/​src/​cli.ts Simplifies summary and progress presentation.
sdk/​typescript/​tests-ts/​support/​json.ts Adds JSON-lines fixture writer.
sdk/​typescript/​tests-ts/​scan-logs.test.ts Reuses fixture helpers.
sdk/​typescript/​tests-ts/​cli-scan-logs.test.ts Reuses JSON and error helpers.
sdk/​typescript/​tests-ts/​cost.test.ts Reuses JSON-lines and directory helpers.
sdk/​typescript/​tests-ts/​deep-progress.test.ts Uses mocks and abort-event utilities.
sdk/​typescript/​tests-ts/​findings-dashboard.test.ts Consolidates timer and promise fixtures.
sdk/​typescript/​tests-ts/​scan-dashboard.test.ts Consolidates mocks and failing output 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
Progress, activity and cost paths repeat scalar and JSON parsing. Reuse internal helpers and simplify presentation without changing the rendered diagnostics or cost arithmetic.

@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 ce53558401667b309c940df97bd38e872f7a1e3f 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.

177 focused SDK tests passed; 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-09-progress branch from ce53558 to 5121708 Compare October 3, 2026 21:09
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 5121708.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 51217086fe

ℹ️ 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 cross-cutting refactor remains stacked on another change and requires restacking plus pending hosted validation before integration.

Review effort: Balanced
Findings: None

@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review the current head e4a7c08.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: e4a7c08a6e

ℹ️ 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 the reviewed parsing, filtering, arithmetic, presentation, and cleanup behavior without unresolved issues.

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 e4a7c08a6e44aef094cfcd475af9713d6e2a6d3f against d519e01451b45a46ea2e9b6d3fd28489f8089d99.

Completed exactly three fresh independent HIGH reasoning passes over the full PR diff and every test diff, followed by independent synthesis. No actionable introduced finding remains.

Fresh validation passed the native host and SDK/plugin builds, TypeScript and formatting checks, and 177 focused SDK tests.

Hosted CI was still pending at the latest check (2026-10-03T23:28:38.342694+00:00), with no failed jobs observed on this head. This source approval is not a statement that the PR is ready to merge. No model execution, local Windows validation, or full installed-package smoke test is claimed.

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 a2d2759.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: a2d27594d7

ℹ️ 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 validation while reducing duplicated parsing, formatting, and fixture code.

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 a2d27594d72aa6d8642b8bd75887a15003089915 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 17 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 at the 2026-10-04 05:14 UTC observation was unfinished and contained a failed macOS shard: CodexSecurity policy API > does not load instructions from the artifact checkout timed out after 30 seconds (1013 passed, 25 skipped, 1 failed). The complete test file is unchanged at the prior reviewed head, current head, and base. The cause is unknown; neither an introduced source defect nor flakiness has been established. See https://github.com/openai/codex-security/actions/runs/37178778995/job/111367588338.

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

Copy link
Copy Markdown
Collaborator Author

@codex review the current head 12d8fa3.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 12d8fa3d20

ℹ️ 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 while consistently reusing internal helpers and maintaining relevant test 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.

Source review approved for 12d8fa3d206eaec18c3bf313c165f49de09dd3b5 against base 634532d7f7fb21ccca49b4bca9bb9fa1df9308d6.

Completed exactly three fresh independent HIGH reviews of the full actual GitHub PR diff: 16 touched files, including all six changed test/support paths, plus root synthesis. The changed contribution supersedes the previous source reviews. No supported introduced finding remains.

Fresh focused validation: all five changed SDK test files passed (174 tests); plugin/SDK builds, type checks, formatting, production build and archive check passed. Root verified all 814 tracked source entries and all 540 archive members against the saved validation tree. Fourteen native artifacts were retained after executable source, dependency and artifact identity checks; no native compilation was run. Initial validation preparation rejected a README-only native difference before product execution; correcting that evidence check did not require rerunning tests.

The separate 08:33 UTC exact-head CI observation remains pending, with no failed jobs observed. The earlier macOS timeout belongs to the old a2d27594 head; its cause remains unknown and is not assigned to this head. Source approval and these focused checks do not establish completed CI, whole-stack integration, clean installed-package smoke, local Windows validation or model behavior.

@mldangelo-oai
mldangelo-oai merged commit b96739d into main Oct 4, 2026
70 of 86 checks passed
@mldangelo-oai
mldangelo-oai deleted the refactor/pr1185-followup-09-progress branch October 4, 2026 21:54
@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