Skip to content
This repository was archived by the owner on Jun 11, 2026. It is now read-only.

Migrate posts react to pure command runner#93

Merged
patosullivan merged 1 commit into
masterfrom
po/testing-strategy-phase-3b-small-write-path-proof
Jun 3, 2026
Merged

Migrate posts react to pure command runner#93
patosullivan merged 1 commit into
masterfrom
po/testing-strategy-phase-3b-small-write-path-proof

Conversation

@patosullivan

@patosullivan patosullivan commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

Migrates tlon posts react to the pure command-runner architecture. Next PR will migrate everything, this is just demonstrating the shape/scale.

  • Adds a pure posts react runner plus process-backed runtime deps.
  • Routes only posts react ... through the new runner; all other posts paths stay on legacy dispatch.
  • Preserves legacy reaction parsing, help behavior, payload formatting, and success output.
  • Adds unit and source/built CLI coverage for the migrated path and a non-react legacy sentinel.

Testing

  • npm run check

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.

Pull request overview

This PR migrates the tlon posts react subcommand onto the “pure command-runner” architecture, while leaving other posts subcommands on the legacy dispatcher. It adds a new pure runner with process-backed runtime deps, updates main.ts routing so only posts react uses the new runner, and adds unit + CLI matrix coverage to lock in legacy-compatible behavior and output.

Changes:

  • Added a pure posts react command runner (scripts/commands/posts.ts) with legacy-compatible parsing, ID formatting, and output.
  • Added a process-backed runtime dependency adapter for posts (scripts/posts-runtime.ts) and routed only posts react through it in scripts/main.ts.
  • Added unit tests and CLI matrix cases covering posts react behavior and a legacy sentinel (posts unreact --help).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/posts-runtime.ts Adds process-backed PostsDeps adapter (auth + API facade + stdout/stderr writers) for the new runner.
scripts/main.ts Routes tlon posts react ... through the new pure runner while keeping other posts subcommands on legacy dispatch.
scripts/commands/posts.ts Implements the pure posts react runner (arg parsing, post ID normalization, reaction call, shared error handling).
scripts/commands/posts.test.ts Adds unit tests validating help/usage behavior, payload formatting, call ordering, and error handling semantics.
scripts/cli-test-matrix.ts Adds CLI coverage for posts react help/auth behavior and a non-react legacy sentinel (posts unreact --help).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@patosullivan patosullivan requested a review from arthyn June 1, 2026 21:00

@arthyn arthyn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, just the one question

],
"Usage: tlon posts react"
),
helpCase(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not sure this should be here since this only touches react right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, this is intentional. Since the PR changes the top-level posts dispatch, I wanted one guard proving non-react paths still stay on the legacy route. posts unreact --help is just a boundary check for that.

@patosullivan patosullivan merged commit 6932ff4 into master Jun 3, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants