Skip to main content
← Back to list
01Issue
BugOpenSwamp CLITeam
AssigneesNone

Relationships

#1439 .swamp.yaml rewritten with quote style change + lastSkillMigrationWarning on read-only operations

Opened by webframp · 7/28/2026

Summary

Running swamp extension quality manifest.yaml --json in an extension directory that has tools: [claude] and local skill copies (e.g. .claude/skills/swamp/) causes .swamp.yaml to be rewritten. Two mutations occur:

  1. Quote style flip: double-quoted strings become single-quoted ("2026-06-15..."'2026-06-15...')
  2. New field appended: lastSkillMigrationWarning: '<timestamp>'

This is a one-time reformatting cost — once committed, subsequent runs won't produce a diff unless the serializer changes again. The question is whether this is the desired, stable behavior or whether future serializer changes could flip-flop the quoting style.

How Discovered

I have a multi-extension repo (137 extensions). Using @webframp/extension-maintenance to audit all extensions, the audit method calls swamp extension quality manifest.yaml --json in each extension directory. After a full audit run, 56 .swamp.yaml files show as modified in git status.

Reproduction

cd /path/to/multi-extension-repo
git checkout -- '**/.swamp.yaml'   # reset to clean state
git status                          # confirm clean

# Run any swamp command that visits extension directories:
swamp extension quality manifest.yaml --json
# (in an extension dir with tools: [claude] and .claude/skills/ present)

git diff .swamp.yaml

Diff

 swampVersion: 20260615.105123.0
-initializedAt: "2026-03-30T18:04:23.433Z"
+initializedAt: '2026-03-30T18:04:23.433Z'
 repoId: 1db3cfed-ae13-49d4-b8ff-8a0338a3b273
 gitignoreManaged: true
 tools:
   - claude
-upgradedAt: "2026-06-15T23:25:31.184Z"
+upgradedAt: '2026-06-15T23:25:31.184Z'
+lastSkillMigrationWarning: '2026-07-28T02:49:56.574Z'

Root Cause (from source inspection)

The CLI startup path in src/cli/mod.ts calls detectLocalBundledSkills(). When local copies are found and the warning interval has elapsed, it writes the updated marker via RepoMarkerRepository.write(), which re-serializes the entire file through @std/yaml stringify. The @std/yaml serializer prefers single quotes, producing a diff against files originally written with double quotes.

This fires during read-only operations (extension quality, extension info, etc.) because it's in the CLI startup path, not gated on whether the command is mutating.

Questions

  1. Is the single-quote style the stable long-term format? If so, I'll commit the reformatting as a one-time cleanup and move on.
  2. Should lastSkillMigrationWarning writes be suppressed during non-interactive / read-only / --json invocations? The warning is meant for interactive users, but the side-effect fires on every invocation.
  3. Could the marker write be made conditional on actual field changes (skip rewrite if only the serialization style differs)?

Environment

  • swamp version: 20260727.193526.0-sha.03dabbb5
  • OS: Linux x86_64 (NixOS)
  • Repo: webframp/swamp-extensions (137 extensions)
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

7/28/2026, 2:55:59 AM

No activity in this phase yet.

03Sludge Pulse
Editable. Press Enter to edit.

webframp commented 7/28/2026, 2:58:33 AM

PR capturing the one-time reformat: https://github.com/webframp/swamp-extensions/pull/297 — leaving it open pending feedback on whether single-quote style is the stable target.

webframp commented 7/28/2026, 3:09:08 AM

Additional finding: deno fmt (which CI runs) enforces double-quoted YAML strings. So swamp writes single quotes via @std/yaml stringify, then deno fmt --check fails because it expects double quotes. The workaround is running deno fmt after swamp touches these files, but ideally swamp's serializer would match deno's preferred style to avoid the round-trip.

The PR (https://github.com/webframp/swamp-extensions/pull/297) now passes CI by running deno fmt on the affected files before committing. The actual diff is just the new lastSkillMigrationWarning field — no quote style change survives.

Sign in to post a ripple.