Skip to content

0.4.5 — accept string versions in Deck::activate(), correct structure diagrams, add CI checks - #16

Merged
veeqtoh merged 4 commits into
0.xfrom
v0.4.5
Aug 3, 2026
Merged

0.4.5 — accept string versions in Deck::activate(), correct structure diagrams, add CI checks#16
veeqtoh merged 4 commits into
0.xfrom
v0.4.5

Conversation

@veeqtoh

@veeqtoh veeqtoh commented Aug 3, 2026

Copy link
Copy Markdown
Member

Motivation and Context

Deck::activate() never accepted the string versions its release notes promised. The v0.4.2 entry states that get() and activate() both "support mixed types for version signature", but only get() was widened. Deck::activate('order-summary', 'v2') has raised a TypeError ever since. The CLI hid it, because ActivatePromptCommand parses to an int before calling — so the bug only surfaced for anyone calling the facade directly, which is exactly what the notes told them they could do.

Both methods now resolve through the ResolvesVersion trait, so 2, '2', and 'v2' are equivalent. Widening a parameter is backward compatible; passing an int is unaffected.

Unparseable versions produced a message with the version missing. Deck::get('order-summary', 'banana') reported Version for prompt [order-summary] does not exist. — note the empty gap. Both methods now throw InvalidVersionException naming the offending value.

Every prompt structure diagram was out of date. None showed the version-level metadata.json that make:prompt has written since v0.4.4. The README was wrong in two further ways: it showed a user.md that is not created without --user, and a second version that a single run does not create. It also described new versions as becoming active automatically, which stopped being true in v0.4.4.

Two CI gaps. Formatting was never checked, which is how the codebase drifted out of Pint compliance before v0.4.4. And CHANGELOG.md and the docs changelog drifted apart while preparing this very release.

Dependencies

None. No new packages, no migrations, no configuration changes.

Test Instructions

composer install
composer test          # 295 passing, up from 288
composer test:lint     # Pint

Each of the four commits was verified green in isolation, so the history is bisectable.

Manual QA:

  1. String versions activate. Deck::activate('order-summary', 'v2') and Deck::activate('order-summary', 2) both promote v2. Previously the first raised a TypeError.
  2. Bad versions report the value. Deck::get('order-summary', 'banana') throws Invalid version [banana] for prompt [order-summary]. Use a positive number like [1] or [v1].
  3. Diagrams match reality. php artisan make:prompt order-summary produces exactly the tree in the README — metadata.json, v1/metadata.json, v1/system.md, and no user.md.
  4. CI checks fire. Both new jobs run on this PR. The parity job was tested against three broken states (version missing from either file, and versions out of order); all three fail with a message naming the version.

Notes for review

  • The two code fixes are in one commit deliberately. Splitting them would create an intermediate state where get() names the offending value but activate() still TypeErrors on strings — a worse state to bisect to than either endpoint.
  • The style job runs on a single PHP version; formatting does not vary across the matrix.
  • Diagrams were copied from real scaffolds rather than written by hand.

veeqtoh added 4 commits August 3, 2026 18:41
Deck::activate() only accepted an int, so Deck::activate('order-summary', 'v2')
raised a TypeError. The 0.4.2 notes described both get() and activate() as
accepting mixed version types, but only get() was widened at the time. The CLI
masked it because ActivatePromptCommand parses to an int before calling.

Both methods now resolve through the ResolvesVersion trait, so 2, '2', and 'v2'
are equivalent. Passing an int continues to work.

An unparseable version previously produced a message with the version missing
entirely, such as "Version  for prompt [order-summary] does not exist." Both
methods now throw InvalidVersionException naming the offending value.
Every structure diagram omitted the version-level metadata.json that
make:prompt has written since 0.4.4. The README additionally showed a user.md
that make:prompt does not create without --user, and a second version that a
single run does not create.

Multi-version diagrams now mark which version is live, and the README shows
prompt:list output alongside the tree. Creating a version has not changed the
active version since 0.4.4, but the README still described new versions as
activating automatically.

Documents activate() accepting string|int, and corrects the get() signature,
which read ?int rather than string|int|null.

Diagrams were taken from real scaffolds rather than written by hand.
Formatting was never verified in CI, which let the whole codebase drift out of
Pint compliance before 0.4.4. The style check runs on a single PHP version
since formatting does not vary across the matrix.

CHANGELOG.md and the documentation site's changelog are written separately and
drift silently, which happened while preparing this release. The parity job
asserts every released version appears in both, in the same order.

The test workflow now runs `composer test` rather than calling Pest directly,
so CI and the documented contributor command cannot diverge.
@mintlify

mintlify Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Deck 🟢 Ready View Preview Aug 3, 2026, 5:43 PM

@veeqtoh
veeqtoh merged commit 7332710 into 0.x Aug 3, 2026
8 checks passed
@veeqtoh
veeqtoh deleted the v0.4.5 branch August 3, 2026 17:52
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