Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneesstack72

Relationships

#453 version-drift check reads first `version:` literal, not export const model.version

Opened by dougschaefer · 5/26/2026· Shipped 5/26/2026

Description

The extension push version-drift check (added in swamp 20260526) verifies that a model's version matches its manifest version. But it resolves the model version by statically scanning for the first version: string literal in the model file, rather than reading the version field of export const model. If a model file declares any object literal with a version property before export const model, the check reports that unrelated value as the "model version" and emits a false-positive drift warning that cannot be silenced without corrupting the unrelated constant.

Steps to reproduce

  1. Create a model file with a helper/constant carrying a version field before the model export:
    const SCHEMA_TEMPLATE = { version: "1.0.0", /* ... */ };
    
    export const model = {
      type: "@you/thing",
      version: "2026.05.26.1", // matches manifest
      // ...
    };
  2. Set the manifest version: to 2026.05.26.1 (matching export const model.version).
  3. Run swamp extension push <manifest> --dry-run --json.

Expected

No version-drift warning — export const model.version ("2026.05.26.1") equals the manifest version.

Actual

"check": "version-drift",
"output": "card.ts: model version \"1.0.0\" differs from manifest version \"2026.05.26.1\" (update the model's version field to align)"

The check picked up the first version: literal in the file (SCHEMA_TEMPLATE.version = "1.0.0") instead of export const model.version.

Real-world impact

In a real card-development model, the first version: was a card-schema constant (SCHEMA_TEMPLATE.version = "1.0.0") that is serialized verbatim into a scaffolded schema.json — it legitimately must stay "1.0.0" and cannot be a CalVer. So the false positive is permanent: the model version is genuinely aligned, but the check keeps flagging the unrelated constant. The fix is to read the resolved export const model.version (the same value the model loader uses) rather than the first textual version: match.

Environment

  • swamp 20260526.145459.0-sha.335f9a2d
  • Linux (WSL2), Deno-bundled extension model
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 2 MOREPR_LINKED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

5/26/2026, 7:04:09 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/26/2026, 6:27:15 PM
Editable. Press Enter to edit.

stack72 commented 5/26/2026, 7:04:15 PM

Thanks @dougschaefer for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.