Skip to main content

Abstract Class: Repository

Defined in: packages/core/src/application/ports/repository.ts:38

Base class for all repository ports.

Encapsulates the three invariants shared by every repository implementation: workspace, ownership, and locality. Subclasses declare their storage operations as abstract methods.

Extended by

Constructors

Constructor

new Repository(config): Repository

Defined in: packages/core/src/application/ports/repository.ts:49

Creates a new Repository instance.

Parameters

config

RepositoryConfig

Workspace, ownership, locality, and config path for this repository

Returns

Repository

Methods

configPath()

configPath(): string

Defined in: packages/core/src/application/ports/repository.ts:88

Returns the absolute path to the config directory.

Returns

string

The config path (e.g. /project/.specd/config)


isExternal()

isExternal(): boolean

Defined in: packages/core/src/application/ports/repository.ts:79

Returns whether this repository points to data outside the current git repository.

Returns

boolean

true if this repository is external to the current git root


ownership()

ownership(): "owned" | "shared" | "readOnly"

Defined in: packages/core/src/application/ports/repository.ts:70

Returns the ownership level of this repository, as declared in specd.yaml.

Returns

"owned" | "shared" | "readOnly"

The ownership level


workspace()

workspace(): string

Defined in: packages/core/src/application/ports/repository.ts:61

Returns the workspace name this repository is bound to.

Returns

string

The workspace name (e.g. "billing", "default")