Skip to content

fix(extensions): remove silent @swamp/ datastore auto-update (swamp-club#478)#1472

Merged
stack72 merged 1 commit into
mainfrom
worktree-478
May 29, 2026
Merged

fix(extensions): remove silent @swamp/ datastore auto-update (swamp-club#478)#1472
stack72 merged 1 commit into
mainfrom
worktree-478

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented May 29, 2026

Summary

Closes swamp-club#478 — the first-party residual (finding ADV-13) identified during #465's autoupdate audit.

Datastore was the only extension kind that silently force-pulled registry-latest within a 24h window (maybeAutoUpdateDatastoreExtension, introduced by #942). Every other kind — models, workflows, vaults, drivers, reports — is pinned to the committed upstream_extensions.json lockfile (hardened by #465), reports available updates non-destructively via swamp extension list / swamp extension outdated, and moves version only on an explicit swamp extension pull / swamp extension update.

This PR removes the datastore anomaly rather than gating it behind a config flag, bringing datastores in line with every other kind. After this change no extension kind auto-updates — closing ADV-13 with no residual and no new config surface.

Changes

  • Delete src/libswamp/extensions/datastore_auto_update.ts and its test.
  • Remove maybeAutoUpdateSwampDatastore, buildLocalEditsWarning, the 4 call sites, and the now-dead imports from src/cli/resolve_datastore.ts (datastore resolution now matches every other kind: resolveDatastoreType (lockfile-pinned) → createProvider, no registry round-trip).
  • Remove the 3 datastore-auto-update re-exports from the libswamp barrel.
  • Trim the buildLocalEditsWarning test + unused imports from resolve_datastore_test.ts.
  • Reword two stale comments in extension_list_freshness.ts that referenced the deleted file.
  • Update design/extension.md: the 24h cache is no longer "used by datastore auto-update"; added a line clarifying the freshness surfaces never auto-pull.

Shared machinery is retained — extension_update_check_cache, checkExtensionVersion, FileExtensionUpdateCheckRepository, local-edits detection, and the freshness composer all have other live consumers (extension list / outdated / update / open).

Net: −579 lines.

Relationship to prior work

Test Plan

  • deno fmt --check, deno lint, deno check — clean
  • deno run test src/cli/resolve_datastore_test.ts — 23 passed
  • deno run test — 6444 passed; 1 unrelated pre-existing flake (integration/workflow_test.ts model-delete/workflow --json stdout parse under full-suite parallelism), which passes 33/33 in isolation and touches no datastore code
  • deno run compile — binary builds

Follow-ups (not in this PR)

🤖 Generated with Claude Code

…lub#478)

Datastore was the only extension kind that silently force-pulled
registry-latest within a 24h window (maybeAutoUpdateDatastoreExtension,
introduced by #942). Every other kind — models, workflows, vaults,
drivers, reports — is pinned to the committed upstream_extensions.json
lockfile (hardened by #465), reports available updates non-destructively
via `swamp extension list` / `outdated`, and moves version only on an
explicit `swamp extension pull` / `update`.

This removes the datastore anomaly rather than gating it behind a flag,
bringing datastores in line with every other kind. After this change no
extension kind auto-updates. Fully closes the ADV-13 first-party residual
identified during #465's autoupdate audit, with no new config surface.

Effectively reverts #942 (which closed #939's daily-freshness request).
The visibility #939 wanted is preserved by the `extension list`/`outdated`
freshness surfaces; only the silent pull is gone.

Shared machinery is retained (extension_update_check_cache,
checkExtensionVersion, FileExtensionUpdateCheckRepository, local-edits
detection, the freshness composer) — all have other live consumers.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

CLI UX Review

Blocking

None.

Suggestions

None.

Verdict

PASS — This PR removes silent datastore auto-update behavior with no visible UX regressions. The user-facing extension surfaces (swamp extension list, swamp extension outdated, swamp extension pull) are untouched. The deleted buildLocalEditsWarning message was only reachable via the now-removed auto-update code path. The extension_list_freshness.ts changes are comment-only; the updateStatus output shape and values are identical. Users who want datastore updates now run swamp extension pull explicitly, which is more predictable than the previous silent behavior.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Adversarial Review

This PR removes the silent datastore auto-update path (maybeAutoUpdateDatastoreExtension and all call sites), aligning datastores with every other extension kind that only moves version on explicit user action.

Critical / High

None found.

Medium

None found.

Low

  1. src/cli/resolve_datastore.tsresolve import removed but join retained: The resolve import was only used by the deleted maybeAutoUpdateSwampDatastore function. Its removal is correct and the remaining join import is still used throughout the file. No issue — just noting completeness of the cleanup.

  2. Design doc phrasing (design/extension.md:121): "no extension kind is auto-pulled or upgraded as a side effect" is a strong invariant claim. If a future PR introduces auto-pull for any kind, this line will need updating. Not a code bug — just a documentation maintenance note.

Verdict

PASS — Clean, mechanical deletion with no dangling references, no broken imports, and no behavioral regressions. All 4 call sites removed, both source files and their tests deleted, barrel exports trimmed, and stale comments updated. The shared infrastructure (extension_update_check_cache, checkExtensionVersion, FileExtensionUpdateCheckRepository, local-edits detection) is correctly retained as it has other live consumers. grep confirms zero remaining references to any deleted symbol across the codebase.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Code Review

Clean removal of the datastore auto-update anomaly. The PR is well-scoped and thorough.

Blocking Issues

None.

Suggestions

None — this is a clean deletion. All references to the removed code have been eliminated:

  • datastore_auto_update.ts and its test deleted entirely
  • maybeAutoUpdateSwampDatastore, buildLocalEditsWarning, and all 4 call sites in resolve_datastore.ts removed
  • resolve correctly dropped from the @std/path import (only join remains)
  • assertStringIncludes and buildLocalEditsWarning removed from test imports
  • libswamp barrel re-exports removed
  • Stale comment references in extension_list_freshness.ts updated
  • Design doc updated to clarify no extension kind auto-pulls
  • No dangling references remain anywhere in the codebase
  • Shared machinery (extension_update_check_cache, checkExtensionVersion, FileExtensionUpdateCheckRepository, local-edits detection) correctly retained for live consumers

The libswamp import boundary is respected — resolve_datastore.ts (a CLI module) no longer imports from src/libswamp/mod.ts for this feature, and the barrel no longer exports the deleted types.

Net −579 lines with a clear security improvement (closing ADV-13).

@stack72 stack72 merged commit 1a58a4b into main May 29, 2026
11 checks passed
@stack72 stack72 deleted the worktree-478 branch May 29, 2026 14:39
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.

feat: auto-update @swamp/ datastore extensions once per day

1 participant