Skip to main content
← Back to list
01Issue
FeatureTriagedSwamp ClubPublic
Assigneesstack72

Relationships

#2569 Docs: document extension member collision precedence and local overrides of pulled methods

Opened by stack72 · 9/27/2026

Follow-up to swamp-club#2562 (fixed in swamp-club/swamp#2646, released in v20260927.001720.0-sha.211145c6).

What changed

When several export const extension files add a member (method, check or resource spec) with the same name to one model type, swamp now registers one of them, chosen the same way on every load path:

  1. A member the base model defines always wins.
  2. A local or source-mounted extension beats a pulled one (files under .swamp/pulled-extensions/).
  3. Within one origin, the alphabetically first canonical source path wins.

Each loser gets a swamp-warning: line naming both files and the winner. swamp doctor extensions lists every collision in a new section. With --json, the report has a memberCollisions array (type, memberKind, name, winner, where null means the base model wins, and losers), and each entry in warnings carries its real category: TypeExtractionFailed, MemberCollision or ExtensionAttachFailed.

This means users can override a pulled package's method by adding a local extension with the same method name. Before this fix, the winner depended on load order, and the pulled package usually won.

Manual pages to update

  • content/manual/reference/extensions/management.md documents extensions that add methods to other types (export const extension, the Extends section of extension info), but says nothing about name collisions.
    • Add a short section on collision precedence.
    • Add a how-to snippet: "override a pulled method locally".
  • The swamp doctor extensions reference: add the memberCollisions field and the warning categories.
  • Behaviour change to mention: repos with collisions today may now resolve to a different extension, typically a local override instead of a pulled package.

The design doc (design/primitives/extensions.md, "Extension Member Collisions") and the bundled swamp skill (references/extension/references/model/api.md, "Name collisions") were updated in the same PR and can be used as source material.

02Bog Flow
✓OPEN◉TRIAGED○IN PROGRESS○SHIPPED+ 1 MOREASSIGNEDCLASSIFICATION

Triaged

9/28/2026, 4:59:38 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/28/2026, 4:59:06 PM

Sign in to post a ripple.