Skip to content

Align @nestm/storage with Files SDK ownership and conditional-operation policy #29

Description

@kauandotnet

Context

Artifact Studio's Workspace Storage v1 milestone should use this layering:

Artifact Studio tenant/binding/crypto policy
  -> @nestm/storage capability workspace and CAS
    -> Files SDK generic data plane
      -> FS / S3

Files SDK already owns generic adapters, file operations, capabilities, retries, transfer/sync, plugins, and a framework-neutral gateway. @nestm/storage should remain the hardened NestJS 12 and workspace-capability layer, not a second generic storage SDK.

Official references: Files SDK, plugins, gateway, and capabilities.

Current alpha.8 correctness gap

Normal operations pass through the configured Files instance, but conditional operations call adapter extensions directly:

Workspace mutations use those conditional paths (workspace writes). Consequently, Files SDK transforming, veto, and observation plugins do not consistently see workspace operations. Enabling encryption, validation, audit, versioning, or soft-delete plugins could produce split behavior between ordinary and conditional calls.

Alpha.8 already enforces prefix, read-only mode, key budgets, and default operation controls for these extensions. This issue is about the missing common policy/plugin boundary; it must not weaken CAS by emulating conditional writes with head-then-write.

Scope

  • Define one documented transformation/veto/observation boundary covering ordinary and conditional read/write/delete/promotion operations.
  • Make plugin compatibility explicit. Unsupported combinations must fail closed at construction or invocation, never silently bypass protection.
  • Preserve native create-only, compare-and-replace, exact-read, compare-and-delete, and promotion guarantees.
  • Delegate generic transfer/sync, provider loading, and gateway mechanics to Files SDK where its contract is equivalent; keep only NestM policy or compatibility code.
  • Retain NestJS 12 named-store DI, StorageWorkspace permissions/limits/CAS, safe AI tools, and bounded public errors.
  • Treat Files SDK conditional capabilities as an upstream contribution target; retain local FS/S3 extensions until upstream offers equivalent guarantees.

Acceptance criteria

  • A transforming write plugin cannot yield plaintext or unvalidated conditional workspace writes.
  • Veto and observation hooks cover create, replace, exact read, conditional delete, and promotion with documented failure semantics.
  • No conditional operation is weakened into a check-then-mutate sequence.
  • Prefix, read-only, timeout, retry, signal, and physical-key-budget conformance remains green for FS and S3.
  • The responsibility boundary and plugin compatibility matrix are documented.
  • Duplicate generic operations have an explicit delegate/keep decision and follow-up coverage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions