Commit Graph

3 Commits

Author SHA1 Message Date
mAi
c690113ea1 docs: design v3 — global cable_types, device UNIQUE, delete guardrail
Tight pass on round-4 answers (single commit per head's request):

- cable_types is GLOBAL — drop project_id, UNIQUE(name). Migration 001
  seeds the 5 defaults once; POST /api/projects no longer seeds them.
  API moves to top-level /api/cable-types. Renaming/recolouring affects
  every project. CASCADE from projects does not touch cable_types.
- devices: UNIQUE (project_id, name) added.
- projects: drawing_name defaults to "<name>.excalidraw" server-side
  on POST when omitted; editable via PATCH.
- DELETE /api/projects/:pid requires ?confirm=<name>; server checks
  name match, returns 400 if missing or mismatched.
- io_markers: no type_id (Power-by-convention, UI soft-warn). Confirmed
  v0 stance.
- Bundles ignored on export — carries over from v2.
- §0 changelog rewritten as "what changed in v3 / what carried over".
- §2 schema rewritten; FK-shape paragraph updated to call out the one
  global table.
- §3 endpoints: cable-types moved to top level; POST/DELETE projects
  show new defaults + guardrail semantics.
- §4 export table notes cable_types pulled from global.
- §7 "edit cable type" flow gains the cross-project-effect banner +
  ON DELETE RESTRICT inline-error UX.
- §8 slice 1 rewritten: no per-project seeding; legend reads global.
- §9 all six v2 questions marked resolved with the v3 answer per item.
- Trailer changes to "DESIGN v3 READY — coder shift gated".
- CLAUDE.md mirrors: global cable_types, device UNIQUE per project,
  drawing_name default, delete guardrail.
2026-05-15 16:32:20 +02:00
mAi
b734e7f874 docs: design v2 — framework rescope, mDock deploy, no runtime importer
Revision after m's answers (2026-05-15):

- mCables is a framework. Top-level `projects` table; LOFT and OFFICE
  are separate projects, each backed by one drawing. project_id is
  denormalised onto every row for cheap project-scoped queries; CASCADE
  from projects wipes a project's whole subgraph.
- IO diamonds are wall-outlet terminators (type=Power), not inter-frame
  bridges. paired_with_id removed.
- No runtime importer. The seed Cable-Management.excalidraw is the
  visual-grammar reference for the exporter only. /api/sync/import is
  dropped from MVP; only /api/sync/export remains (one-way, manual).
- No cable inventory fields. Strictly visual structure for v0.
- DB at ./data/mcables.db (project-local, gitignored).
- Deploy: raw docker on mDock under /home/m/stacks/mcables/ (NOT Dokploy).
  Conventions verified live (mgreen, mgeo, msports-garmin patterns).
  Port 7777, container_name mcables, image from Gitea registry, Gitea
  Actions self-hosted runner builds + deploys on push to main.
- Bind 0.0.0.0:7777 on the LAN. No auth.
- UI gains a projects picker; all CRUD endpoints scoped under
  /api/projects/:pid/.
- Slices re-planned: empty bootstrap → frame+device → port+cable →
  IO+cable-type editing → export.
- Open questions trimmed; six new ones (drawing-name policy, device
  uniqueness, non-Power IO, bundle export, cross-project cable types,
  delete guardrail).

Ends with DESIGN v2 READY FOR REVIEW.
2026-05-15 16:13:24 +02:00
mAi
f429111462 docs: design pass 1 — schema, API, importer, sync, slices
Inventor shift 1. Reads the live Cable-Management.excalidraw on
mxdrw.msbls.de, lands on:

- vanilla JS modules + SVG diagram (no build step) served by a single
  Go binary with embed.FS
- SQLite schema with frames, devices, ports, cable_types, cables,
  io_markers, bundles (cgo-free driver)
- HTTP API under /api/, /api/state as the editor's one-shot loader
- importer that respects port-on-edge geometry (ports are positional,
  not containerId-bound) and resolves arrow endpoints to port/device/IO
- bundle detection MVP: same-endpoints-pair → suggestion
- sync model: DB authoritative, Excalidraw is a projection, manual
  import/export buttons with element-ID stability and conflict flagging
- five vertical slices for the coder shift, smallest end-to-end first
- nine open questions for m before code starts

Ends with DESIGN READY FOR REVIEW.
2026-05-15 12:26:27 +02:00