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

Relationships

#928 doctor extensions reports source-mounted bundles as unreferenced after repair

Opened by evrardjp · 7/2/2026· Shipped 7/2/2026

swamp doctor extensions --repair evicts bundle files for source-mounted extensions, but the next swamp doctor extensions --json immediately rebuilds/reports those same files as aggregateState.bundleOrphans / orphanBundleFileCount even though their catalog rows exist and are Indexed.

This makes the repair non-idempotent/noisy: local deleted-source OrphanedBundleOnly rows are fixed, but healthy source-mounted extension bundles continue to appear as orphan bundle files.

Reproduction

In a repo with source-mounted extensions configured in .swamp-sources.yaml, for example:

sources:
  - path: /path/to/repo
  - path: /path/to/swamp-extensions/arch-cloud-init
  - path: /path/to/swamp-extensions/capability-orchestrator
  - path: /path/to/swamp-extensions/maintainer-activity
  - path: /path/to/swamp-extensions/pi-session-telemetry
  - path: /path/to/swamp-extensions/qcow2-overlay-prep
  - path: /path/to/swamp-extensions/ssh-ca

Run:

swamp doctor extensions --repair --json
swamp doctor extensions --json

Observed behavior

After repair, swamp doctor extensions --json still reports overallStatus: pass, but includes bundle orphans like:

.swamp/bundles/0e898615/models/arch_cloud_init.js
.swamp/bundles/2b04d43d/models/capability_catalog.js
.swamp/bundles/2b04d43d/models/capability_plan.js
.swamp/bundles/5b22a6db/models/cloud_init_nocloud.js
.swamp/bundles/df619aa7/models/qcow2_overlay_prep.js
.swamp/bundles/26ebac94/models/maintainer_activity.js
.swamp/bundles/b01d5fc4/models/pi_session_telemetry.js
.swamp/bundles/53490ff9/models/ssh_ca.js
.swamp/report-bundles/26ebac94/reports/maintainer_briefing.js
.swamp/report-bundles/b01d5fc4/reports/pi_session_report.js
.swamp/report-bundles/53490ff9/reports/ssh_ca_inventory.js

However, the catalog DB has corresponding bundle_types rows for these source-mounted files, with state = Indexed and bundle_path pointing at the same .swamp/bundles/... or .swamp/report-bundles/... path.

The same run showed that deleted local source rows under extensions/ were correctly pruned: @local/local-infra@0.0.0 went from 5 OrphanedBundleOnly rows to 0. The remaining report is specifically about source-mounted extension bundle files.

Expected behavior

Once doctor extensions --repair runs, a subsequent doctor extensions --json should be clean/idempotent for source-mounted extension bundles that are referenced by Indexed catalog rows.

Either:

  • do not report source-mounted extension bundles as bundleOrphans when a catalog row references the same bundle path, or
  • if repair intentionally removes them, do not immediately recreate/re-report them as unreferenced bundle files on the next scan.

Environment

  • Swamp version: 20260702.205250.0-sha.1ba549d7
  • Command: swamp doctor extensions --repair --json, followed by swamp doctor extensions --json
  • Affected component: extension doctor aggregate/bundle orphan detection and repair for source-mounted extensions

Suggested fix area

This likely affects the extension doctor aggregate-state logic that computes bundleOrphans and/or the repair logic that evicts unreferenced bundle files. The fix should make bundle orphan detection use the same normalized bundle paths and source-mounted catalog rows that the extension loader writes, so healthy source-mounted bundles are not treated as unreferenced.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

7/2/2026, 11:01:51 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/2/2026, 9:52:59 PM
Editable. Press Enter to edit.

stack72 commented 7/2/2026, 11:02:05 PM

Thanks @evrardjp 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.