Engineering record — internal detail. The manual is authoritative for product behaviour.
Port & warehouse modules
The container-first model, four operation types, twelve new tables, the demurrage engine, document PDFs and the warehouse gate bridge.
Scope
The largest module build on record: a port-to-warehouse container layer plus demurrage revenue and a working demo-request lead flow. The design introduces the container-first model, four operation types (import, export, domestic, cross-boundary), twelve new tables and seven enums, the demurrage engine, cargo document PDFs and an AI-layer extension.
Note
Design discipline
The plan mandates a specific skill and MCP set for the work and references DESIGN.md for the UI surface, which is the first plan in the record to bind implementation to the design contract.
The demurrage engine
- A clock that starts at container registration (AT_PORT) and whose port and detention phases are driven by gate events.
- Rule matching that picks the most specific active rule as of the breach date: customer over workspace default, then size tier.
- Billing only through the approval queue: the engine drafts a sales invoice with a demurrage line and a queue row; a human approves to issue and post.
- Idempotency: a container already billed for the current breach window is skipped, so a repeated daily scan cannot double-bill.
- A dedicated reference type so demurrage can never double-post against an ordinary sales invoice.
Shipping status
Phases 0 through 5 shipped; phase 6 was in progress at the time of the tasks document. Task reports recording completion notes for the later tasks exist in the delivery log (E-12).
Source records
- Design
- docs/superpowers/specs/2026-08-11-port-warehouse-modules-design.md
- Plan
- docs/superpowers/plans/2026-08-11-port-warehouse-modules-plan.md
- Tasks
- docs/superpowers/plans/2026-08-11-port-warehouse-modules-tasks.md