Skip to content

feat(trails): graduate scaffold-version sync into create surface#712

Merged
graphite-app[bot] merged 1 commit into
mainfrom
trl-942-graduate-scaffold-version-sync-into-the-create-surface
Jun 9, 2026
Merged

feat(trails): graduate scaffold-version sync into create surface#712
graphite-app[bot] merged 1 commit into
mainfrom
trl-942-graduate-scaffold-version-sync-into-the-create-surface

Conversation

@galligan

@galligan galligan commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Graduates scaffold-version sync into the create surface (TRL-942), applying the script-graduation doctrine from #711: the app owns scaffold-versions.generated.ts, so it now owns the derivation too.

  • New public create.versions trail (trails create versions): write mode regenerates apps/trails/src/scaffold-versions.generated.ts from the root package.json catalog/devDependencies; --check verifies it is current and fails actionably on drift. The @ontrails/* exact-pin invariant check rides along via a static import of the app's versions.ts.
  • Derivation lives in apps/trails/src/scaffold-version-sync.ts; the trail follows the release.check graduation precedent (resolveTrailRootDir, throw→ValidationError).
  • scripts/sync-scaffold-versions.ts is reduced to a thin compatibility wrapper that forwards to the trails CLI (with an inline --permit, the documented pattern for scripted invocations); scaffold-versions:sync/:check package scripts route through it so the wrapper stays a referenced entrypoint (knip-clean).
  • Test coverage moves to apps/trails/src/__tests__/create-versions-trail.test.ts (9 tests): the four ported pin-diagnostic cases plus write/check/drift/missing-dependency paths against temp roots.
  • Changeset: @ontrails/trails minor (new public trail).

Linear: TRL-942

Verification

  • bun test apps/trails/src/__tests__/create-versions-trail.test.ts (9 pass), app typecheck clean
  • Drift end-to-end: mutated generated file → check exits 1 with regenerate guidance; restored
  • bun run check, bun run build, bun run test, bun run publish:check, bun run wayfinder:dogfood, bun run changeset:check green at the stack tip

@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

TRL-942

galligan commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • queue:merge - adds this PR to the back of the merge queue
  • queue:priority - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@galligan galligan force-pushed the trl-942-graduate-scaffold-version-sync-into-the-create-surface branch from 40a5bea to 142b3f4 Compare June 9, 2026 19:24
@galligan galligan marked this pull request as ready for review June 9, 2026 20:25

@greptile-apps greptile-apps Bot 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.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@graphite-app

graphite-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

Merge activity

## Summary

Graduates scaffold-version sync into the `create` surface (TRL-942), applying the script-graduation doctrine from #711: the app owns `scaffold-versions.generated.ts`, so it now owns the derivation too.

- New public `create.versions` trail (`trails create versions`): write mode regenerates `apps/trails/src/scaffold-versions.generated.ts` from the root `package.json` catalog/devDependencies; `--check` verifies it is current and fails actionably on drift. The `@ontrails/*` exact-pin invariant check rides along via a static import of the app's `versions.ts`.
- Derivation lives in `apps/trails/src/scaffold-version-sync.ts`; the trail follows the `release.check` graduation precedent (`resolveTrailRootDir`, throw→`ValidationError`).
- `scripts/sync-scaffold-versions.ts` is reduced to a thin compatibility wrapper that forwards to the trails CLI (with an inline `--permit`, the documented pattern for scripted invocations); `scaffold-versions:sync`/`:check` package scripts route through it so the wrapper stays a referenced entrypoint (knip-clean).
- Test coverage moves to `apps/trails/src/__tests__/create-versions-trail.test.ts` (9 tests): the four ported pin-diagnostic cases plus write/check/drift/missing-dependency paths against temp roots.
- Changeset: `@ontrails/trails` minor (new public trail).

Linear: TRL-942

## Verification

- `bun test apps/trails/src/__tests__/create-versions-trail.test.ts` (9 pass), app typecheck clean
- Drift end-to-end: mutated generated file → check exits 1 with regenerate guidance; restored
- `bun run check`, `bun run build`, `bun run test`, `bun run publish:check`, `bun run wayfinder:dogfood`, `bun run changeset:check` green at the stack tip
@graphite-app graphite-app Bot force-pushed the trl-933-define-script-graduation-doctrine-for-trails-tooling branch from 6aca103 to 3f85361 Compare June 9, 2026 20:26

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 142b3f4a60

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

Comment on lines +20 to +24
cmd: [
'bun',
'apps/trails/bin/trails.ts',
'create',
'versions',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the repair script independent of CLI bootstrap

When apps/trails/src/scaffold-versions.generated.ts is missing or syntactically broken, this wrapper now starts the full Trails CLI before any regeneration can happen. The CLI bootstraps app, which imports trails like create-scaffold and therefore versions.ts; versions.ts imports the generated file at module load, so bun run scaffold-versions:sync exits with an import/parse error instead of repairing the file. The previous script wrote the generated file before dynamically checking versions.ts, so this turns the documented recovery command into something that cannot recover from the drift it is meant to fix.

Useful? React with 👍 / 👎.

@graphite-app graphite-app Bot force-pushed the trl-942-graduate-scaffold-version-sync-into-the-create-surface branch from 142b3f4 to bb5a219 Compare June 9, 2026 20:27
Base automatically changed from trl-933-define-script-graduation-doctrine-for-trails-tooling to main June 9, 2026 20:29
@graphite-app graphite-app Bot merged commit bb5a219 into main Jun 9, 2026
9 checks passed
@graphite-app graphite-app Bot deleted the trl-942-graduate-scaffold-version-sync-into-the-create-surface branch June 9, 2026 20:30
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.

1 participant