update documentation and specs

This commit is contained in:
Forbes
2026-01-29 13:10:12 -06:00
parent d886a44288
commit f39aef0fc7
10 changed files with 546 additions and 1224 deletions

View File

@@ -1,137 +1,92 @@
# Silo Development Status
**Date:** 2026-01-23
**Last Updated By:** Claude Code Session
**Last Updated:** 2026-01-29
---
## Current State: MinIO File Upload Implementation
## Implementation Status
### Completed Work
### Core Systems
#### 1. Docker Compose - MinIO Service Added
- File: `deployments/docker-compose.yaml`
- Added MinIO service with versioning enabled
- Configured healthcheck and environment variables
- Note: Using `minio/minio:RELEASE.2024-01-16T16-07-38Z` for CPU compatibility
| Component | Status | Notes |
|-----------|--------|-------|
| PostgreSQL schema | Complete | 7 migrations applied |
| YAML schema parser | Complete | Supports enum, serial, constant, string segments |
| Part number generator | Complete | Scoped sequences, category-based format |
| API server (`silod`) | Complete | 35+ REST endpoints via chi/v5 |
| CLI tool (`silo`) | Complete | Item registration and management |
| MinIO file storage | Complete | Upload, download, versioning, checksums |
| Revision control | Complete | Append-only history, rollback, comparison, status/labels |
| Project management | Complete | CRUD, many-to-many item tagging |
| CSV import/export | Complete | Dry-run validation, template generation |
| Web UI | Complete | Items and schemas pages (htmx) |
| Docker Compose | Complete | Dev and production configurations |
| Deployment scripts | Complete | setup-host, deploy, init-db, setup-ipa-nginx |
| systemd service | Complete | Unit file and environment template |
#### 2. API Endpoints - File Upload/Download
- File: `internal/api/handlers.go`
### FreeCAD Workbench
| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/items/{partNumber}/file` | POST | Upload file and create revision |
| `/api/items/{partNumber}/file` | GET | Download latest revision file |
| `/api/items/{partNumber}/file/{revision}` | GET | Download specific revision file |
| `/api/items/{partNumber}/revisions` | POST | Create revision without file |
| Command | Status | Notes |
|---------|--------|-------|
| Silo_Save | Implemented | Auto-save + upload to MinIO |
| Silo_Commit | Implemented | Save with revision comment |
| Silo_Pull | Implemented | Download / create items |
| Silo_Push | Implemented | Batch upload modified files |
| Silo_Info | Implemented | View revision history |
| Silo_Register | Implemented | Generate part number for document |
| Silo_Open | Implemented | Open item by part number |
| Silo_Browse | Implemented | Browse items in list dialog |
#### 3. Routes Added
- File: `internal/api/routes.go`
- All new endpoints wired up
Workbench needs end-to-end testing with a running Silo instance.
#### 4. FreeCAD Client Updated
- File: `pkg/freecad/silo_commands.py`
- Added `_upload_file()` method for multipart form upload
- Updated `create_revision()` to optionally upload files
- Updated `Silo_Commit` command to save document and upload to MinIO
### Not Yet Implemented
#### 5. Build Status
- **Go code compiles successfully** - `go build ./...` passes
| Feature | Notes |
|---------|-------|
| Location API endpoints | Database tables exist (`locations`, `inventory`), no REST handlers |
| Inventory API endpoints | Database tables exist, no REST handlers |
| Date segment type | Schema parser placeholder only |
| Part number format validation | API accepts but does not validate format on creation |
| Unit tests | No test coverage |
---
## Where We Left Off
## Infrastructure
### Problem
MinIO container failing to start due to CPU architecture:
```
Fatal glibc error: CPU does not support x86-64-v2
```
### Solution in Progress
- VM being rebooted to newer architecture
- Already configured older MinIO image as fallback
| Service | Host | Status |
|---------|------|--------|
| PostgreSQL | psql.kindred.internal:5432 | Running |
| MinIO | localhost:9000 (API) / :9001 (console) | Configured |
| Silo API | localhost:8080 | Builds successfully |
---
## Next Steps After VM Reboot
## Schema Status
### 1. Start Services
```bash
cd /home/forbes/projects/silo-0062/deployments
sudo docker compose up -d
```
The part numbering schema (`kindred-rd`) is at **version 3** using the `{category}-{sequence}` format (e.g., `F01-0001`). This replaced the earlier `{project}-{type}-{sequence}` format. Projects are now managed as many-to-many tags rather than being embedded in part numbers.
### 2. Verify Services
```bash
# Check all services
sudo docker compose ps
# Check MinIO health
curl http://localhost:9000/minio/health/live
# Check Silo API with storage
curl http://localhost:8080/ready
```
### 3. Test File Upload
```bash
# Create test file
echo "Test content" > /tmp/test.FCStd
# Upload to existing item
curl -X POST \
-F "file=@/tmp/test.FCStd" \
-F "comment=Test upload" \
-F 'properties={"test": true}' \
http://localhost:8080/api/items/3DX15-A01-0002/file
```
### 4. Test File Download
```bash
# Download latest revision
curl http://localhost:8080/api/items/3DX15-A01-0002/file -o downloaded.FCStd
# Download specific revision
curl http://localhost:8080/api/items/3DX15-A01-0002/file/2 -o rev2.FCStd
```
### 5. Test from FreeCAD
1. Open FreeCAD with Silo workbench
2. Open an existing item: `Silo_Open` command
3. Make changes
4. Commit with file upload: `Silo_Commit` command
5. Verify file appears in MinIO console at http://localhost:9001
The schema defines 70+ categories across 10 groups:
- F01-F18: Fasteners
- C01-C17: Fluid Fittings
- R01-R44: Motion Components
- S01-S17: Structural Materials
- E01-E27: Electrical Components
- M01-M18: Mechanical Components
- T01-T08: Tooling and Fixtures
- A01-A07: Assemblies
- P01-P05: Purchased/Off-the-Shelf
- X01-X08: Custom Fabricated Parts
---
## Remaining MVP Tasks
## Database Migrations
| Task | Status | Priority |
|------|--------|----------|
| Start docker-compose with MinIO | Pending | **Next** |
| Test full upload/download flow | Pending | High |
| Implement date segment support | Pending | Medium |
| Implement part number validation | Pending | Medium |
| Add unit tests | Pending | Medium |
---
## File Changes This Session
```
modified: deployments/docker-compose.yaml (added MinIO service)
modified: internal/api/handlers.go (added file handlers)
modified: internal/api/routes.go (added file routes)
modified: pkg/freecad/silo_commands.py (added file upload)
```
---
## MinIO Console Access
Once running:
- **URL:** http://localhost:9001
- **Username:** silominio
- **Password:** silominiosecret
- **Bucket:** silo-files
| Migration | Description |
|-----------|-------------|
| 001_initial.sql | Core schema (items, revisions, relationships, locations, inventory, sequences) |
| 002_sequence_by_name.sql | Sequence naming changes |
| 003_remove_material.sql | Schema cleanup |
| 004_cad_sync_state.sql | CAD synchronization state |
| 005_property_schema_version.sql | Property versioning framework |
| 006_project_tags.sql | Many-to-many project-item relationships |
| 007_revision_status.sql | Revision status and labels |