Skip to content

Make each tm- workflow's meta a literal first statement #424

Description

@sv-tmueller

Part of batch #423

What to build

The Workflow runtime refuses all three tm- workflows (tm-review-changes, tm-review-codebase, tm-map-codebase), by name and by path. Each file builds export const meta from SPEC and TIER_MODELS, and const SPEC comes before it. The runtime needs meta to be a plain literal and the first statement in the script. #405 hit this first, and #406's live run (PR #419) hit it again; both worked around it with a hand-modified copy. The installed 2.9.0 plugin ships the same code, so the slash commands likely fail to load as shipped.

Make meta a plain literal and the first statement in each of the three files. It carries the same content as today: name, description, and each phase's title, detail and model. Nothing outside the runtime reads meta.

Add a test that reads each workflow file and checks three things:

  • meta is the first statement.
  • meta evaluates in an empty node:vm context, which proves it has no outside references.
  • meta deep-equals the value SPEC produces today (name, description, and each phase's title, detail and model), so a SPEC edit without a matching meta edit fails CI.

The architect picks whether the literal copies SPEC or SPEC reads its phases from meta. The sync test is required either way.

Live run (lead step, after the tester passes). The lead runs the branch's tm-review-changes.js once, by path and unmodified, on this PR's own diff, and records in the PR body that it loaded, plus cost and wall-clock time. The owner approved this run (about $2, about 3.5 minutes last time) at batch sign-off on 2026-10-01.

Acceptance criteria

  • In all three tm- workflow files, export const meta is the first statement and a plain literal, with no identifiers, calls or interpolation.
  • A new test fails on today's main and passes after the fix. It checks position and evaluates the literal in an empty vm context.
  • The test checks that each meta deep-equals the value SPEC produces (name, description, and each phase's title, detail and model).
  • The lead's live run of the unmodified branch file loads. The PR body records that it loaded, plus cost and wall-clock time.
  • npm test passes, and the version in .claude/.claude-plugin/plugin.json is bumped.

Non-goals

  • Changing any stage, prompt or SPEC content.
  • Live runs of tm-review-codebase and tm-map-codebase. Each fans out over the whole repo and costs much more. The refusal happens when the file loads, so the static test covers both.
  • Porting the verify stage to tm-review-codebase (review agent orchestration #344 P2, next batch).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    size:SUnder 1 hour. One focused change.type:fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions