Skip to content

tlon-skill: Port posts react command runner to tlon-skill and restore build-smoke CI gate#5920

Merged
patosullivan merged 1 commit into
developfrom
po/tlon-5771-phase-m1-port-3b-and-ci-gates
Jun 11, 2026
Merged

tlon-skill: Port posts react command runner to tlon-skill and restore build-smoke CI gate#5920
patosullivan merged 1 commit into
developfrom
po/tlon-5771-phase-m1-port-3b-and-ci-gates

Conversation

@patosullivan

Copy link
Copy Markdown
Member

Summary

Re-integrates work into the in-monorepo packages/tlon-skill CLI as PR 1 of 3 stacked PRs for the current phase of TLON-5771. The monorepo import predated standalone PR #93 (the posts react migration) and dropped the built-binary CI gate, so this ports the migration and restores the gate. This is a port of already-reviewed code (standalone PR: tloncorp/tlon-skill#93; diff-of-record is commit 253a73d), reformatted with monorepo prettier; logic is unchanged.

Changes

  • Added packages/tlon-skill/scripts/commands/posts.ts, a pure posts react runner (run(args, deps): Promise<number>) with self-contained extractNumericId, formatUd, and formatPostId helpers. These are deliberately not imported from the legacy scripts/posts.ts (which auto-runs on import). Help short-circuits before auth, and missing args throw usage errors before auth.
  • Added packages/tlon-skill/scripts/posts-runtime.ts, the process-backed deps. authenticate calls ensureClient(['channels']), the current user is read via @tloncorp/api, and addReaction failures are rethrown as commandError.
  • Added packages/tlon-skill/scripts/commands/posts.test.ts, in-process tests with fake deps covering the help short-circuit, the missing-arg matrix before auth, post-id formatting (dotted, undotted, ~ship/-prefixed), the exact ✓ Reaction added output, CommandError formatting, and unexpected-error propagation. Includes one addition over the standalone file: a run(['unreact'], deps) test pinning that non-react subcommands return a usage error with no auth or API calls (the runner becomes the posts-family dispatcher in a later PR).
  • Updated scripts/main.ts so that in case 'posts', posts react ... routes through the migrated runner (without mutating process.argv). All other posts paths still fall through to the legacy import-side-effect module.
  • Updated scripts/cli-test-matrix.ts with matrix cases (posts react --help, the same with global --url/--cookie flags to prove they are stripped before dispatch, posts unreact --help to prove non-react paths stay on the legacy dispatch, and an auth-required posts react chat/~host/channel 170.141 👍 case). Also centralized the hostile-help command list into a new exported HOSTILE_HELP_COMMANDS and added a nested posts react --help entry.
  • Updated tests/hermetic/cli.test.ts and scripts/build-smoke.ts to consume the shared HOSTILE_HELP_COMMANDS instead of each rebuilding the list, removing duplication and adding nested-subcommand help coverage to both the source hermetic suite and the built-binary suite.
  • Updated .github/workflows/ci.yml with a tlon-skill build smoke step (pnpm --filter '@tloncorp/tlon-skill' build:smoke) after "Run Tests" and before "Build packages". This restores the built-binary golden matrix gate dropped in the monorepo move; it compiles the binary via bun --compile and runs the full golden matrix under a hermetic env. Bun 1.3.4 is already set up earlier in the job.

Decisions worth noting:

  • The coverage artifact from the standalone ci.yml was not ported. The suite is subprocess-heavy, so Bun coverage mostly measures the test process; the plan treats coverage as reporting-only. test:coverage remains in package.json for local use.
  • The root test:ci trailing-arg quirk (pnpm run -r test run appends run to tlon-skill's chained test script, producing bun test ./tests/hermetic run where run acts as a bun path filter) was verified harmless (all tests still execute). Documenting it here rather than changing the shared root script, since other packages rely on the run arg for vitest.

How did I test?

  • pnpm --filter '@tloncorp/tlon-skill' check (typecheck plus 93 unit tests, 141 hermetic tests, build smoke), exit 0.
  • pnpm --filter '@tloncorp/tlon-skill' test run passes 234 tests, reproducing the root test:ci trailing-arg shape.
  • pnpm prettier --check on all touched files, clean.
  • Built golden matrix confirms the new cases pass, including posts react --help under hostile TLON_CONFIG_FILE=/nonexistent and --config /nonexistent (exit 0, prints usage, empty stderr, no credential lookup).

Risks and impact

  • Safe to rollback without consulting PR author? Yes
  • Affects important code area: skill

Rollback plan

Revert

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

TLON-5771

@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

@patosullivan patosullivan merged commit 4f83b41 into develop Jun 11, 2026
4 checks passed
@patosullivan patosullivan deleted the po/tlon-5771-phase-m1-port-3b-and-ci-gates branch June 11, 2026 17: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.

2 participants