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

Relationships

#739 Add deleteResource to MethodContext and document dataRepository.delete in skills

Opened by stack72 · 6/21/2026· Shipped 6/21/2026

Problem

writeResource and readResource exist as ergonomic wrappers on MethodContext that handle modelType/modelId internally. There is no equivalent for deletion. Model authors who need to clean up stale data (e.g. removing error rows when a target recovers) must drop to the lower-level dataRepository.delete(context.modelType, context.modelId, dataName) — a pattern that is undiscoverable because the docs present dataRepository as read-only.

Additionally, the skill reference files only document three read methods on dataRepository. The public UnifiedDataRepository interface (src/domain/data/repositories.ts:200-205) also exposes delete, which is not documented.

Related: swamp-club/swamp-club#713 (added delete to the manual reference page).

Proposed solution

1. Add deleteResource to MethodContext

Signature (mirrors readResource — no specName, just instanceName):

deleteResource?: (instanceName: string) => Promise<void>;

Files to change:

  • src/domain/models/model.ts:237 — add deleteResource to the MethodContext interface, after readResource
  • src/domain/models/data_writer.ts — add a createResourceDeleter factory next to createResourceReader (line 715). Implementation: closure over repo.delete(modelType, modelId, instanceName)
  • src/domain/models/in_process_executor.ts:130-166 — create the deleter and wire it onto the context object
  • src/worker/remote_method_context.ts:356-556 — add the remote execution path (parallel to writeResource/readResource)
  • src/serve/data_plane.ts — add the corresponding data plane endpoint for remote delete

Note: deleteResource should NOT be available in checks (same as writeResource/createFileWriter).

2. Update skill documentation

All in .claude/skills/swamp/references/extension/references/model/:

  • api.md:333 — add delete row to the "Key dataRepository methods for model authors" table; add a deleteResource API section documenting the new wrapper
  • typing.md:81 — add deleteResource to the context fields table
  • checks.md:17 — note that deleteResource is not available in checks
  • examples.md — add a reconciliation example showing deleteResource for cleaning up stale stored data
  • testing.md — add testing pattern for delete operations

3. Note on findAllForModelSince

The original issue (swamp-club/swamp-club#713) listed findAllForModelSince as author-facing, but it is private on FileSystemUnifiedDataRepository (line 272) and not on the public UnifiedDataRepository interface. It should not be documented as available to model authors.

Environment

swamp source at src/domain/data/repositories.ts, src/domain/models/model.ts, src/domain/models/data_writer.ts, src/domain/models/in_process_executor.ts


Automoved by swampadmin from https://github.com/swamp-club/swamp/issues/1639

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 2 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

6/21/2026, 11:01:14 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/21/2026, 10:12:25 PM

Sign in to post a ripple.