Add Phase 2 artifact repository: types, blob store, gRPC service

Build the complete artifact pillar with five packages:
- artifacts: Artifact, Snapshot, Citation, Publisher types with Get/Store
  DB methods, tag/category management, metadata ops, YAML import
- blob: content-addressable store (SHA256, hierarchical dir layout)
- proto: protobuf definitions (common.proto, artifacts.proto) with buf
  linting and code generation
- server: gRPC ArtifactService implementation (create/get artifacts,
  store/retrieve blobs, manage tags/categories, search by tag)

All FK insertion ordering is correct (parent rows before children).
Full test coverage across artifacts, blob, and server packages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 09:56:34 -07:00
parent bb2c7f7ef3
commit b64177baa8
22 changed files with 5017 additions and 1 deletions

View File

@@ -22,7 +22,29 @@ Tracks implementation progress against the phases in `PROJECT_PLAN.md`.
- `config/config.go`, `config/config_test.go`
- `.golangci.yaml`, `Makefile`
## Phase 2: Artifact Repository — IN PROGRESS
## Phase 2: Artifact Repository — COMPLETE
**Deliverables:**
- [x] `artifacts` package: `Artifact`, `Snapshot`, `BlobRef`, `Citation`, `Publisher` types with `Get`/`Store` methods
- [x] `MIME` type alias for clarity
- [x] Tag and category management: `CreateTag`/`GetTag`/`GetAllTags`, `CreateCategory`/`GetCategory`/`GetAllCategories`, `GetArtifactIDsForTag`
- [x] Metadata store/retrieve operations (`StoreMetadata`/`GetMetadata`)
- [x] `blob` package: Content-addressable blob store (SHA256 hashing, hierarchical directory layout, read/write/exists)
- [x] YAML import: `ArtifactYAML`, `SnapshotYAML`, `CitationYAML` with `ToStd()` conversions and `LoadArtifactFromYAML`
- [x] Protobuf message definitions for all artifact types (`proto/exo/v1/common.proto`, `proto/exo/v1/artifacts.proto`)
- [x] gRPC service: `ArtifactService` with create/get artifacts, store/retrieve blobs, manage tags/categories, search by tag
- [x] `server` package: Full gRPC service implementation with proto-domain conversion helpers
- [x] buf.yaml for proto linting, buf.gen.yaml for code generation
- [x] Full test coverage for all packages (artifacts, blob, server)
**Files created:**
- `blob/blob.go`, `blob/blob_test.go`
- `artifacts/artifact.go`, `artifacts/citation.go`, `artifacts/publisher.go`, `artifacts/snapshot.go`
- `artifacts/metadata.go`, `artifacts/tagcat.go`, `artifacts/yaml.go`, `artifacts/artifacts_test.go`
- `proto/exo/v1/common.proto`, `proto/exo/v1/artifacts.proto`
- `proto/buf.yaml`, `proto/buf.gen.yaml`
- `proto/exo/v1/*.pb.go` (generated)
- `server/server.go`, `server/server_test.go`
## Phase 3: CLI Tools — NOT STARTED