tlon-skill: Port posts react command runner to tlon-skill and restore build-smoke CI gate#5920
Merged
Conversation
… build-smoke CI gate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Re-integrates work into the in-monorepo
packages/tlon-skillCLI as PR 1 of 3 stacked PRs for the current phase of TLON-5771. The monorepo import predated standalone PR #93 (theposts reactmigration) 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 commit253a73d), reformatted with monorepo prettier; logic is unchanged.Changes
packages/tlon-skill/scripts/commands/posts.ts, a pureposts reactrunner (run(args, deps): Promise<number>) with self-containedextractNumericId,formatUd, andformatPostIdhelpers. These are deliberately not imported from the legacyscripts/posts.ts(which auto-runs on import). Help short-circuits before auth, and missing args throw usage errors before auth.packages/tlon-skill/scripts/posts-runtime.ts, the process-backed deps.authenticatecallsensureClient(['channels']), the current user is read via@tloncorp/api, andaddReactionfailures are rethrown ascommandError.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 addedoutput, CommandError formatting, and unexpected-error propagation. Includes one addition over the standalone file: arun(['unreact'], deps)test pinning that non-reactsubcommands return a usage error with no auth or API calls (the runner becomes the posts-family dispatcher in a later PR).scripts/main.tsso that incase 'posts',posts react ...routes through the migrated runner (without mutatingprocess.argv). All otherpostspaths still fall through to the legacy import-side-effect module.scripts/cli-test-matrix.tswith matrix cases (posts react --help, the same with global--url/--cookieflags to prove they are stripped before dispatch,posts unreact --helpto prove non-react paths stay on the legacy dispatch, and an auth-requiredposts react chat/~host/channel 170.141 👍case). Also centralized the hostile-help command list into a new exportedHOSTILE_HELP_COMMANDSand added a nestedposts react --helpentry.tests/hermetic/cli.test.tsandscripts/build-smoke.tsto consume the sharedHOSTILE_HELP_COMMANDSinstead of each rebuilding the list, removing duplication and adding nested-subcommand help coverage to both the source hermetic suite and the built-binary suite..github/workflows/ci.ymlwith atlon-skill build smokestep (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--compileand runs the full golden matrix under a hermetic env. Bun 1.3.4 is already set up earlier in the job.Decisions worth noting:
ci.ymlwas not ported. The suite is subprocess-heavy, so Bun coverage mostly measures the test process; the plan treats coverage as reporting-only.test:coverageremains inpackage.jsonfor local use.test:citrailing-arg quirk (pnpm run -r test runappendsrunto tlon-skill's chainedtestscript, producingbun test ./tests/hermetic runwhererunacts 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 therunarg 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 runpasses 234 tests, reproducing the roottest:citrailing-arg shape.pnpm prettier --checkon all touched files, clean.posts react --helpunder hostileTLON_CONFIG_FILE=/nonexistentand--config /nonexistent(exit 0, prints usage, empty stderr, no credential lookup).Risks and impact
Rollback plan
Revert