You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(artifact): flatten protobuf packages and decouple files from knowledge bases (#321)
**Because**
- The protobuf package structure was nested
(`artifact/artifact/v1alpha`) and needed flattening to
`artifact/v1alpha` for consistency across the codebase
- Files were tightly coupled to a single knowledge base, limiting
reusability
- Resource IDs needed to follow AIP standard with unique constraints and
proper scoping
- The System resource used RFC-1034 IDs instead of hash-based IDs like
other resources
**This commit**
- Flattens protobuf imports from `protogen-go/artifact/artifact/v1alpha`
to `protogen-go/artifact/v1alpha`
- Decouples files from knowledge bases - files are now namespace-scoped
and can be associated with multiple KBs via a junction table
(`file_knowledge_base`)
- Adds 7 database migrations:
- `000048`: Add slug columns to knowledge_base and file tables
- `000049`: Add unique constraints for resource IDs (AIP standard)
- `000050`: Unify System schema to use hash-based IDs with `sys-` prefix
- `000051`: Unify storage paths
- `000052`: Rename chunk content destination
- `000053`: Add ID column to chunk table with `chk-` prefix
- `000054`: Create junction table and migrate file-KB relationships
- Renames `KnowledgeBaseFile*` to `File*` throughout repository and
service layers
- Updates all integration tests to use the flattened proto paths and new
file API structure
- Removes deprecated code: `pkg/usage/usage.go`,
`pkg/client/http/registry.go`
- Updates handler parsing to support new file resource pattern:
`namespaces/{namespace}/files/{file}`
0 commit comments