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

Relationships

↔ sibling #464↔ sibling #486

#479 feat: giga-swamp phase 2 — Catalog schema v4 + repository interface

Opened by stack72 · 5/28/2026· Shipped 5/28/2026

Problem

Phase 1 (issue #464) introduced the Namespace value object and config plumbing. Phase 2 makes the data model namespace-aware — the catalog, the repository interface, and the DataRecord type all learn about namespaces. This is the first phase where existing behavior could break if defaults are wrong.

Proposed Solution

1. Catalog schema bump to v4

Bump CATALOG_SCHEMA_VERSION to 4 in catalog_store.ts. Add namespace TEXT NOT NULL DEFAULT '' column. Update primary key to (namespace, type_normalized, model_id, data_name). Add idx_namespace index. Update all upsert/delete/query SQL methods to include namespace.

The self-healing backfill already drops and rebuilds the catalog when the schema version changes, so the upgrade is automatic. All existing solo-mode data gets namespace = ''.

2. Repository interface

The FileSystemUnifiedDataRepository takes Namespace in its constructor (injected by the factory from config). All writes use the constructed namespace internally. Read methods gain an optional namespace filter parameter for future cross-namespace queries (Phase 4). The interface method signatures for writes do not change — namespace is a construction-time property, not a per-operation parameter.

3. DataRecord

Add namespace: string field to the DataRecord interface. Update DataRecordMapper to populate namespace from catalog rows (fromRow) and from context (fromData).

4. Repository factory

repository_factory.ts reads namespace from the resolved config and passes it to the repository constructor. When no namespace is configured, it passes SOLO_NAMESPACE.

Boundary constraints

  • Do NOT change filesystem paths or storage layout — that is Phase 3
  • Do NOT change the path resolver or locking — that is Phase 3
  • Do NOT add CEL expression support — that is Phase 4
  • Do NOT add CLI output columns — that is Phase 5
  • Do NOT change DEFAULT_DATASTORE_SUBDIRS — it has destructive migration side effects

Ship Gate

  • deno check passes
  • deno lint passes
  • deno fmt passes
  • deno run test passes (some existing tests will need updates to pass SOLO_NAMESPACE or expect namespace field in DataRecord, but behavioral assertions must not change)
  • Catalog rebuild test: delete _catalog.db, run swamp data list, verify results are identical
  • Solo mode invariant: all data commands produce identical output to before

Design Context

Full design doc: resources/giga-swamp.md

This is Phase 2 of 7. Depends on Phase 1 (#464). The catalog self-healing backfill is the upgrade path for every existing user — test it thoroughly.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

5/28/2026, 11:46:03 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/28/2026, 10:45:24 PM
stack72 linked related to #4645/28/2026, 9:45:01 PM
stack72 linked related to #4865/29/2026, 4:31:32 PM

Sign in to post a ripple.