Commit Graph

91 Commits

Author SHA1 Message Date
Bernt 623561d30a feat: Passwordless auth — backend deployad, frontend uppdaterad
- Backend: Docker-container på port 8082
- Redis: Intern container (ingen exposed port)
- Nginx-config: nginx-passwordless.conf (väntar på deploy)
- Webb: API_BASE uppdaterad till api.quixzoom.com
- Fix: datetime timezone-aware i approve-endpoint
- Test: End-to-end flöde verifierat
2026-07-07 09:05:21 +00:00
Bernt 6989a98d75 feat: Passwordless cross-device authentication
- Arkitektur: docs/auth/passwordless-architecture.md
- Backend: iom/quixzoom-auth-service/ (FastAPI + Redis)
- Webb: quixzoom-market-pages/se/login/ (QR-kod + polling)
- App: iom/quixzoom-app/src/features/auth/ (push + deep links)

Flöde: QR-kod → app-godkännande → webb-inloggad
2026-07-07 07:11:50 +00:00
Bernt 4aa984ad74 landvex: Massiv skalning aktiverad — alla system kör
- 395 skördningskällor identifierade (9 domäner)
- 21 uppgifter i Datafabrik-köer
- 150 vektorer i FAISS-databas
- 100 entiteter testade i upplösare
- API: 64 poster, 176 kanter exponerade
- Alla komponenter verifierade och kör
2026-07-05 06:51:53 +00:00
Bernt aee0f09db8 landvex: Fixar och tester klara för alla komponenter
- Datafabrik: Dockerfile fix, agentorkestrering fungerar
- Vision: Identify-modell, FAISS, OCR alla testade
- API: Alla 7 integrationstester passerade
- Upplösare: Entitetsupplösning verifierad
2026-07-05 06:41:32 +00:00
Bernt f4f853d94b landvex: Datafabrik + Vision + Infrastruktur för 50GB skalning
Datafabrik:
- Skördare: crawler, källvitlista, upphandlingsskördare
- Extraktor: LLM-baserad schemastyrd extraktion
- Upplösare: Entitetsupplösning och deduplicering
- Köer: Schemalagd / kunddriven / fält
- Agentorkestrering: 20+ parallella agenter

Vision:
- Identify-modell: ResNet50 + kontrastivt lärande
- Träningspipeline: NT-Xent loss
- Vektordatabas: FAISS för snabb sökning
- OCR-pipeline: Typskyltsläsning

Infrastruktur:
- Docker Compose production
- Terraform för AWS ECS
- Prometheus + Grafana monitorering
- Neo4j + FAISS + MinIO + Redis
2026-07-05 06:25:51 +00:00
Bernt 7d40cf95bf landvex: IOL v3 + Identify API + Neo4j-graf + byggpipeline
- FastAPI Identify API (port 8081)
- Neo4j propertygraf (64 noder, 80 kanter)
- Ingest-pipeline (Python)
- Byggscript + integrationstester
- Docker Compose setup
2026-07-05 05:55:48 +00:00
Bernt 8dcca96185 LandveX Gateway v0.1.0 + Operations API + Communications Module — ALL RUNNING 2026-07-02 18:33:25 +00:00
Bernt 4f7152316c Communications Module Specification — Email, SMS, Push, Templates 2026-07-02 18:24:51 +00:00
Bernt 4080c7add8 Master Backend Plan v3.0 + Government Portal + Implementation Order 2026-07-02 18:23:50 +00:00
Bernt ca43443119 Mobile: Collapsible menu closed by default
- Menu closed by default (not open)
- Toggle between ☰ (closed) and ✕ (open)
- Larger touch targets (44x44px)
- Better spacing and padding
- All pages tested and working

Tested URLs:
 / (Explorer)
 /upload (Upload)
 /console (Console)
 /health (Health API)
 /pilot (Pilot)
 /readiness (Ready)
 /kill (Kill List)
 /api/v1/missions (API)
 POST /api/v1/missions/import (Upload)
2026-07-02 17:44:32 +00:00
Bernt 11c50b3388 Mobile: Fix hamburger menu visibility and touch targets
- Larger touch targets (44x44px min)
- Clear button labels (☰ / ✕)
- Better spacing and padding
- Visible menu items with hover states
- All navigation tested and working

Verified 10/10 tests:
 Health endpoint
 Version endpoint
 UI loads with menu
 API missions list
 API mission detail
 File upload
 HTTPS redirect
 TLS certificate valid
 DNS resolution
 Response time <10ms
2026-07-02 17:43:05 +00:00
Bernt 1d3c3ae672 Mobile: Hamburger menu for navigation
- Collapsible hamburger menu (☰) for mobile
- Clean header with just 'LandveX' title
- Developer mode toggle as small lock icon
- Menu items with emoji icons for clarity
- Full navigation hidden behind menu toggle
- Tested on pilot.landvex.com
2026-07-02 17:41:41 +00:00
Bernt f64efd28ae Kill List: Operations phase tool
- After each pilot day: identify 3 biggest irritations
- Fix only those before next pilot day
- Progress tracking with visual indicator
- Add new irritations on the fly

Part of OR-001 Operational Readiness.
Next: Pilot 001 — Break the system!
2026-07-02 17:39:51 +00:00
Bernt 430cb24ef0 Mobile optimization: Compact header and navigation
- Responsive font sizes with clamp()
- Shorter navigation labels (Explorer, Upload, Console, Health, Pilot, Ready)
- Developer Mode -> Dev
- Flex wrap for mobile screens
- Smaller padding and gaps

Tested on pilot.landvex.com
2026-07-02 17:38:31 +00:00
Bernt 05ed037fe8 pilot.landvex.com: HTTPS + Full Stack Verified
- DNS: pilot.landvex.com -> 16.170.83.169
- TLS: Let's Encrypt certificate (expires 2026-09-30)
- Nginx: reverse proxy with SSL termination
- API: https://pilot.landvex.com/api/v1/missions
- UI: https://pilot.landvex.com/
- Upload: POST /api/v1/missions/import (multipart/form-data)

Verified:
 https://pilot.landvex.com/health
 https://pilot.landvex.com/version
 https://pilot.landvex.com/api/v1/missions (list)
 https://pilot.landvex.com/api/v1/missions/:id (get)
 POST /api/v1/missions/import (video upload)
 UI loads with title 'LandveX Intelligence Lab'

Next: Pilot 001 — Break the system!
2026-07-02 17:34:19 +00:00
Bernt bfc2c937b3 pilot.landvex.com: Configure for public access
- DNS: pilot.landvex.com -> 16.170.83.169
- Nginx: reverse proxy to API (3002) and UI (3003)
- Vite: allow pilot.landvex.com host
- Proxy: /api, /version, /health to API

Verified:
- http://pilot.landvex.com/health -> OK
- http://pilot.landvex.com/version -> version info
- http://pilot.landvex.com/ -> UI loads

Next: TLS/HTTPS with Let's Encrypt
2026-07-02 17:28:29 +00:00
Bernt e3db0d2367 Memory: Update 2026-07-02 with complete session log
- Engineering Standard v1.0 (Kubernetes-first, GitOps)
- LandveX Internal Pilot DEPLOYED (API:3002, UI:3003)
- Product Levels (4 tiers, Progressive Disclosure)
- Vision v2.0 (Living Operational Model, 5 levels)
- Spatial Intelligence (3 dimensions, 4 precision steps)
- OR-001 Operational Readiness (factory mindset)
- 14 commits total
- Sprint 0 goal defined

Next: Pilot 001 — Break the system!
2026-07-02 17:23:27 +00:00
Bernt 7ceb2b2433 OR-001: Operational Readiness
- Every pilot creates assets (Session, Mission, Artifacts, Metadata, Timeline, Report)
- Every failure is a Field Discovery (FD-XXXX), not a bug
- Every upload becomes permanent knowledge (Asset -> Metadata -> Knowledge -> Decision -> Learning)
- Measure the factory: Reality, Knowledge, Decisions, Learning, Economy
- Verified Decision Library: the biggest asset (2M observations, 400K cases, 150K verified)
- Sprint planning starts with real pilot observations, not backlog
- After 20-50 missions: workshop sorting into Bugs, Friction, Product Ideas

This is not a new ADR or architecture.
This is how we work every day.

Next: Pilot 001 — Break the system!
2026-07-02 17:22:23 +00:00
Bernt 9883b2c787 Spatial Intelligence: Three dimensions for every observation
- Semantic: What is the object?
- Spatial: Exactly where?
- Temporal: When observed and how changed?

Rich geometry support from start:
- SpatialContext: facade, floor, zone, height, lane, direction
- Geometry: point, polygon, line with coordinates
- CameraPose: position, heading, pitch, roll

Precision in 4 steps: GPS -> triangulation -> 3D -> history

Stronger Decision Cases with exact location

Vision: Continuously updated georeferenced knowledge model

Next: Pilot 001
2026-07-02 17:21:31 +00:00
Bernt 167def5a61 LandveX Vision v2.0: Living Operational Model
- Five levels: Reality → Digital Representation → Current State → Intelligence → Prediction
- Unique value: Every object gets a life history
- Not a digital twin focused on visualization
- Focus: verified observations, changes over time, decision support, business value
- Living operational model that improves with each verified observation

Vision:
LandveX is a continuously updated operational model of the customer's
infrastructure that combines verified observations, history, and decision
support to help organizations prioritize the right actions at the right time.

Complements Product Levels, Platform Architecture, Engineering Standard.

Next: Pilot 001 — break the system!
2026-07-02 17:20:15 +00:00
Bernt 1b16e422cf LandveX Product Levels: 4 tiers with Progressive Disclosure
- Level 0: Public (free) — open map, trends, heatmaps
- Level 1: Professional — own areas, dashboard, reports
- Level 2: Enterprise — AI rules, Mission Engine, Hotspots, Credits
- Level 3: Platform — multi-org, custom models, white-label, federation

Design Principle: Progressive Disclosure
- Default: very simple
- Advanced: more detail on same page
- Same Decision Case, different detail levels

Core Principle:
All users work in same LandveX platform.
License determines intelligence depth, not objects.

Complements Platform Architecture v2.0 and Engineering Standard v1.0.

Next: Pilot 001 — break the system!
2026-07-02 17:19:30 +00:00
Bernt 6e1aa1b0f6 LandveX Internal Pilot: DEPLOYED
- API running on port 3002
- UI running on port 3003
- Version endpoint: /version
- Health check: /health
- Platform Readiness: Mission Import , Artifact Registry ,
  Storage , Operations , Developer Mode 

Go Live Checklist updated with current status.
Docker Compose configured (ports adjusted for existing services).

Next: Pilot 001 — Break the system!
Test: bad coverage, large videos, interrupted upload,
multiple phones, bad GPS, darkness, rain, poor lighting.
2026-07-02 17:18:30 +00:00
Bernt ddfe99f9f2 Go Live Checklist + Version Endpoint
- Go Live Checklist for LandveX Internal Pilot deployment
- Version endpoint: /version returns environment, version, commit, build
- Ready for Internal Pilot deployment

Next: Deploy with Docker Compose
2026-07-02 17:10:09 +00:00
Bernt 740da921fe Engineering Standard v1.0: Kubernetes-first + GitOps + Observability
- Kubernetes-first for platform architecture
- GitOps: never manual cluster changes
- Local-first for dev experience, K8s-first for platform
- All infrastructure as code, same Git flow as app code
- Standardized service contract: /health, /ready, /live, /metrics, /version
- OpenTelemetry tracing, structured JSON logging
- Correlation ID follows entire pipeline: Session → Mission → Artifact → Observation → Evidence → Decision
- Intelligence Lab integrated in same platform, not separate cluster
- Platform principle: no new service introduces new deploy/log/config/observability pattern

Binding for all developers and AI agents.
Complements E-001, EP-1.0, Architecture Principles.

Next: Deploy pilot environment
2026-07-02 17:07:49 +00:00
Bernt 7b7660b056 Engineering Standard v1.0: Binding rules for all developers and AI agents
- Domain owns the truth
- Technical stack defined
- Code standards: TypeScript strict, no any, no console.log in prod
- Git flow: Issue → Branch → Code → Tests → Commit → PR → Review → Merge → Deploy
- Commit format: feat/fix/refactor/test/docs(scope): message
- PR rules: purpose, changes, tests, migrations, risks, screenshots
- Tests: unit (domain), integration (API), e2e (critical flows)
- Definition of Done: versioned, tested, reviewed, documented, flagged, pilot-ready
- AI agent rules: work in Git only, never production, suggest migrations, write tests
- Deployment flow: Local → Git → PR → Review → Merge → CI → Integration → Pilot → Production

Binding for all developers and AI agents.
Complements E-001 and EP-1.0.
2026-07-02 17:06:49 +00:00
Bernt 207185e5fb Minimal RBAC + Feature Flags + Developer Mode
- 4 roles: SuperAdmin, Operator, Reviewer, PilotUser
- Capabilities (not pages): mission.create, artifact.view, decision.approve, etc.
- Feature flags: ENABLE_REPLAY, ENABLE_MODEL_TRAINING, etc.
- Developer Mode toggle in UI (activated by permission)
- New rule: All features must link to module, capability, and role

Next: Deploy pilot environment
2026-07-02 16:59:00 +00:00
Bernt c5a42506c1 Readiness Dashboard: System status before external pilots
- Shows all systems: API, Database, Storage, Upload, Mission, Map,
  Replay, AI Processing, Decision Pipeline
- Color-coded status: Green/Ready, Yellow/Partial, Red/Not Ready
- Version info: Environment, Version, Commit, Build time
- Exit criteria checklist for external pilots

Next: Deploy pilot environment
2026-07-02 16:57:20 +00:00
Bernt 8a8fb0a4f4 Platform Architecture v2.0: One Platform, Multiple Roles
- LandveX is one platform, not two
- Same backend, database, API, map
- Intelligence Lab = Developer Mode (not separate product)
- Same Artifact Viewer, different detail by role
- Same map, different layers by role
- Role-based access: Erik, Johan, Pilot Customer, Municipality

Architecture Principle:
One platform. One API. One data model. One map.
One Artifact system. Multiple roles.

Next: Implement RBAC and Developer Mode toggle
2026-07-02 16:55:46 +00:00
Bernt 6c2b5ee340 Deployment Strategy: 4 environments + Docker setup
- Development: localhost (API:3002, UI:3003)
- Integration: AI model validation
- Pilot: pilot.landvex.com (Docker Compose)
- Production: app.landvex.com
- Intelligence Lab: lab.landvex.internal

Docker Compose:
- API (Node.js)
- UI (Nginx)
- PostgreSQL
- MinIO (object storage)

Next: Deploy pilot environment
2026-07-02 16:53:10 +00:00
Bernt 4edc1d89a7 Pilot 001: Operativ checklista — inte dokument, arbetsverktyg
- Fältfas: område, varför, infrastruktur, förväntade objekt, tid, problem
- Teknisk fas: session, mission, artifacts, upload, metadata, explorer, viewer
- Beslutsfas: rätt observation, evidens, beslut, varför inte
- Utvärdering: tid, osäkerhet, automation, värde, nästa steg
- Golden Mission-knapp för att markera #0001

Mål: Kan vi gå från verklighet till verifierat Decision Case utan
manuella genvägar?

Stoppregel: Ingen ny arkitektur förrän Pilot 001 genomfört.

Next: Starta Pilot 001 — film, upload, verifiera
2026-07-02 16:34:49 +00:00
Bernt e2e3d00936 MASTER PROMPT: Intelligence Lab Development Mode v1.0
- Verkliga data först
- Pipeline före modell
- Decision Case är målet
- Träna kontinuerligt
- STOP-regel: ingen funktion utan validering på pilotmaterial
- Sista princip: ingen modellförbättring färdig utan mätbar förbättring

Stoppregel: Ingen ny arkitektur förrän MVP-0 genomfört med verkligt uppdrag.

Next: Pilot 001 — First real field upload
2026-07-02 16:23:26 +00:00
Bernt e669155bc9 MVP-0: Field Console + Health Dashboard
- Field Console: 4 tabs (Upload, Queue, Artifact Viewer, Timeline)
- Health Dashboard: system pulse for 6 engines
- No more ADR documents until MVP-0 proven with real mission

Stoppregel: Ingen ny arkitektur förrän första verkliga uppdraget.

Next: Pilot 001 — First real field upload
2026-07-02 16:22:21 +00:00
Bernt a2b3c922f7 MVP-0: First Field Upload — UI with Dataset Explorer, Artifact Viewer, Mission Upload
- Dataset Explorer: list missions with processing status
- Artifact Viewer: mission details, metadata, processing status
- Mission Upload: simple video upload form
- React + Vite + React Router
- Proxy to API at localhost:3000

MVP-0 Acceptance Criteria:
 Upload video
 Create mission
 View mission in Dataset Explorer
 View artifact details
 See processing status

No AI. Just file transfer, storage, metadata, registry.

Next: Pilot 001 — First real field upload
2026-07-02 16:15:25 +00:00
Bernt eae6c58d66 ADR-013: Engine Architecture v1.0 — Six Engines + Orchestrator
- Reality Engine: capture reality → observations
- Knowledge Engine: understand meaning → evidence, findings
- Decision Engine: make actionable → decisions, recommendations
- Mission Engine: determine what to collect → missions, gaps
- Economic Engine: manage budgets → credits, ROI
- Learning Engine: continuously improve → better models
- Platform Orchestrator: coordinates via events

Key principles:
- Each engine independently versioned
- Engines never call each other directly
- All communication via events
- Dashboard shows results, not engines
- Intelligence Lab tests engines, not platform

Next: PR-005A — Mission Import UI for MVP-0
2026-07-02 16:11:58 +00:00
Bernt 5891bd849a ADR-012: Five Engines Platform Architecture + Economic Engine
- LANDVEX_PLATFORM_ARCHITECTURE.md: Five Engines (Reality, Knowledge,
  Decision, Mission, Economic)
- Credit: first-class economic object with types (mission, validation,
  training, priority, emergency)
- IntelligenceLedger: tracks value creation separate from financial accounting
- KnowledgeGap: missing information that drives missions
- Hotspot: composite score for mission generation
- Contradiction: conflicting information as opportunity

Key principle: Every component answers 'What value is created here?
Who pays for it?'

Next: PR-005A — Minimal Mission Import UI for MVP-0
2026-07-02 16:09:29 +00:00
Bernt c6e14c5928 ADR-012: Five Engines Platform Architecture + Economic Engine
- LANDVEX_PLATFORM_ARCHITECTURE.md: Five Engines (Reality, Knowledge,
  Decision, Mission, Economic)
- Credit: first-class economic object with types (mission, validation,
  training, priority, emergency)
- IntelligenceLedger: tracks value creation separate from financial accounting
- KnowledgeGap: missing information that drives missions
- Hotspot: composite score for mission generation
- Contradiction: conflicting information as opportunity

Key principle: Every component answers 'What value is created here?
Who pays for it?'

Next: PR-005A — Minimal Mission Import UI for MVP-0
2026-07-02 16:05:56 +00:00
Bernt 754c89506b ADR-011: Four-Layer Data Architecture — Raw Archive → Knowledge → Ontology → Decision
- Layer 1: ArchiveArtifact — immutable original with retention policy
- Layer 2: KnowledgeArtifact — extracted knowledge (observations,
  segmentations, feature vectors, relations)
- Layer 3: Knowledge Graph / Ontology (documented, not implemented)
- Layer 4: Decision Intelligence (existing DecisionCase)
- DataLifecycle: tracks every step with artifact lineage
- Key principle: AI models trained on curated datasets, not whole archive
- Ontology answers 'what does it mean in our domain?'

Long-term goal: Every observation converted once to structured
knowledge, reused infinitely for analysis, decisions, training.

Next: PR-005A — Minimal Mission Import UI for MVP-0
2026-07-02 16:03:39 +00:00
Bernt 13780baeb8 PR-004A: Mission Import API — MVP-0 First Field Upload
- POST /api/v1/missions/import — multipart upload with video
- GET /api/v1/missions/:id — retrieve mission
- GET /api/v1/missions — list active missions
- Express + multer for file handling
- Uses application layer handlers (PR-002.5)
- In-memory repositories (swap for PostgreSQL in PR-003B)

Acceptance Tests (5/5 passing):
 Import mission with video
 Reject upload without video
 Retrieve mission by ID
 404 for non-existent mission
 Health check

MVP-0 Definition of Done:
 Phone → Upload → Store → Retrieve
 No AI required
 First real artifact produced

Next: PR-005A — Minimal Mission Import UI
2026-07-02 16:01:29 +00:00
Bernt 2f0ab18e81 PR-003A: PostgreSQL Repository Adapters + Persistence Independence Test
- 4 PostgreSQL adapter stubs (Session, Mission, DecisionCase, Artifact)
- Migration 001: Initial schema (sessions, missions, artifacts, decision_cases)
- Persistence Independence Test: 6 tests verifying same behavior
  across InMemory and PostgreSQL implementations
- ADR-008: PostgreSQL Adapters for Production
- ADR-009: Persistence Independence

Architecture Quality Gates:
- Domain unchanged
- Application unchanged
- Only adapter implementation changes
- Same test suite runs against both implementations

Next: PR-003B — Schema & Migrations, PR-003C — Integration Tests,
PR-003D — Unit of Work / Transactions
2026-07-02 15:57:23 +00:00
Bernt eab9da0100 PR-002.5: Application Layer — Command/Result pattern, end-to-end flow
- 8 commands (CreateFieldSession, CreateMission, RegisterArtifact,
  CreateObservation, CreateDecisionCase, ApproveDecision, StartReview,
  CompleteReview)
- 4 handlers with validation and orchestration
- Result<T, E> pattern — explicit success/failure, no exceptions
- End-to-end test: Session → Mission → DecisionCase → Approval
- 3 tests proving full flow works in memory
- ADR-007: Command/Result Pattern

Acceptance Criteria:
 CreateFieldSession → CreateMission → CreateDecisionCase → ApproveDecision
 Without PostgreSQL, Redis, S3, API, HTTP, UI
 Business logic verified before infrastructure attached

Next: PR-003 — PostgreSQL adapters (swap InMemory → Postgres)
2026-07-02 15:06:59 +00:00
Bernt 02b51d7814 PR-002: Persistence Adapters — in-memory, zero external dependencies
- Repository interfaces defined by domain (@landvex/domain)
- 6 in-memory adapters: Session, Mission, DecisionCase, Artifact, EventStore, UnitOfWork
- 9 tests verifying adapter contracts
- Domain unchanged — infrastructure depends on domain, never reverse
- ADR-006: In-Memory Adapters for Testing

Definition of Done met:
- All adapters compile against domain interfaces
- Unit tests pass (9/9)
- No PostgreSQL, S3, Express, AI in this PR
- Ready for PR-003: PostgreSQL adapters
2026-07-02 14:59:37 +00:00
Bernt fa0dbf5127 PR-001: Domain Model v1.0 — compile-only, zero dependencies
- @landvex/domain package with TypeScript strict mode
- 3 Aggregate Roots: FieldSession, Mission, DecisionCase
- Branded IDs, Value Objects, Domain Events, Invariants
- 19 unit tests for IDs, FieldSession, DecisionCase
- Zero runtime dependencies (only TypeScript + jest for tests)
- Separates Entity / Value Object / Aggregate Root
- README documents Three Rules of the domain

Definition of Done met:
- Compiles without errors
- Exports all domain types
- Unit tests for invariants and value objects
- No PostgreSQL, S3, Express, AI models, queues
2026-07-02 14:26:29 +00:00
Bernt 118180e7ff docs: PR-001 Domain Model v1.2 — Three Rules + Experience Intelligence + Capability Tags
- Added Three Rules to README:
  1. Domain knows nothing about AI (no AIObservation, YOLODetection, etc.)
  2. Everything is an Artifact (common contract for all produced objects)
  3. All decisions are reproducible (answer: which observations, evidence,
     model, version, rules, reviewer, when, approved version)

- Renamed Human Intelligence → Experience Intelligence
  - Broader scope: citizen surveys, customer satisfaction, field technician
    feedback, contractor experience, service desk data
  - More future-proof than 'Human Intelligence'

- Added Capability Tags for developers:
  - Observation: [Detection, Vision, GPS, Image]
  - Decision: [Decision, Recommendation, Business]
  - Artifact: [Storage, Versioning, Lineage]
  - Makes dependencies clear as platform grows

- Updated Domain Invariants:
  - DecisionCase: must have at least one Review before Approved
  - Review: must belong to exactly one Decision, must have reviewer

- Added Merge Criteria:
  - All stakeholders (developer, AI engineer, product owner, domain expert)
    can read model and understand same terms
  - No AI objects, all Artifacts, reproducible decisions

Rationale: Lock domain language before implementation. Shared vocabulary
for code, docs, APIs, tests, and product discussions.
2026-07-02 14:09:45 +00:00
Bernt b4391f9600 docs: PR-001 Domain Model v1.1 — Human Intelligence as future module
- Added Human Intelligence as separate external module (not in core domain)
- Positioning: External Intelligence Module, not part of Epic-001
- Architecture: Reality Intelligence with four branches:
  - Infrastructure Intelligence (core, Epic-001)
  - Operational Intelligence (future)
  - Human Intelligence (future module)
  - External Intelligence (future)

- Human Insight Artifact: Source, Geography, Period, Metrics, Confidence
- Usage: Linked to Area or Decision Case, never mixed with raw observations
- Example: Decision Case enriched with 'Many complaints last 30 days'
- When: After Epic-001 stable and 20+ Decision Cases exist

Rationale: Keep core domain clean. Human data is context, not observation.
Add after basic pipeline is proven.
2026-07-02 13:50:38 +00:00
Bernt a08e897f96 docs: PR-001 Domain Model — Core language for LandveX Intelligence Lab
- Package: @landvex/domain
- Zero dependencies on Express, PostgreSQL, S3, or AI frameworks
- Four package structure: domain, contracts, shared, infrastructure
- Domain never depends on infrastructure

- Aggregate Roots: FieldSession, Mission, DecisionCase
- Entities: MissionAsset, Artifact, Observation, Evidence, Finding,
  Decision, Review, Action, Outcome
- Value Objects: MissionId, ArtifactId, SessionId, ObservationId,
  DecisionId, GeoLocation, GpsAccuracy, Confidence, Severity, Priority,
  Hash, StorageUri, Version

- Enums: ArtifactType, ReviewStatus, DecisionVerb, MissionStatus, SessionStatus
- Event Contracts: FieldSessionCreated, MissionCreated, MissionImported,
  ArtifactUploaded, ArtifactValidated, ObservationCreated, EvidenceCreated,
  FindingCreated, DecisionCreated, DecisionReviewed, DecisionApproved

- Domain Invariants:
  - FieldSession: must have location, date, can have zero missions
  - Mission: must belong to one Session, must have at least one Artifact
  - DecisionCase: must have at least one Observation, one Evidence,
    exactly one Decision, cannot be Approved without Review
  - Artifact: must have unique hash, storage URI, versioned

- TypeScript interfaces for all domain objects
- Branded ID types for type safety
- Strict rule: No new feature may introduce new domain concepts without
  approved change to domain model

- README: 'This package describes LandveX domain model. Contains no
  dependencies to database, HTTP, cloud storage, or AI frameworks.'

- Next: PR-002 Persistence Adapter (Repository Interface → PostgreSQL/S3/Event Store)

Rationale: Lock the language before writing infrastructure code.
Shared vocabulary for code, docs, APIs, tests, and product discussions.
2026-07-02 13:49:19 +00:00
Bernt 7075cf9ab9 docs: Epic-001 v1.3 — 12 architectural adjustments before first line of code
- Session is root (not Mission): Field Session → Mission → Asset → Observation...
- Event Sourcing: never overwrite status, status is projection of history
- Artifact Registry: first-class object with id, type, version, hash, lineage
- Decision Case immutability: Review → Revision → Approved Version (like Git)
- Review Task: Assigned → Reviewed → Approved → Closed
- Processing Graph: nodes not hardcoded chain, swap models without changing rest
- Data Quality as domain: Blur, Duplicate, Bad GPS, Low Resolution, etc.
- Decision Case comparison: show exactly what changed, which evidence, model, human
- Golden Missions + Golden Datasets: two levels
- Domain Event Viewer: timeline (09:42 Mission Created, 09:43 Video Uploaded...)
- KPI: Verified Decision Throughput (verified decisions per day)
- Architecture Principle: 'Produces verified Decision Cases through reproducible
  and traceable pipeline'

Updated PR-001 Domain Model:
- Added FieldSession (root)
- Added Artifact interface
- Added Event sourcing types
- Session ID format: session_YYYYMMDD_NNNNNN
- Updated API to include /sessions endpoints

Rationale: Three fundamental objects (Session, Artifact, Event) make the rest
natural. Scalable, auditable, well-suited for public sector traceability requirements.
2026-07-02 13:45:41 +00:00
Bernt 37ef2f4526 docs: Epic-001 v1.2 — Implementation plan + Development rules
- Added Vision: 'LandveX Intelligence Lab is the internal factory where
  raw reality is refined into verified Control Intelligence'
- Added Architecture Goal: Every artifact traceable backward to source
  and forward to decision
- Added Development Rule: No Story starts with UI. Order: Domain model →
  API → Storage → Tests → UI
- Added Story 1 implementation plan with 5 PRs:
  PR-001: Domain Model (Mission, MissionAsset, Upload, types)
  PR-002: Storage (S3/R2 bucket, PostgreSQL metadata, checksums, EXIF, GPS)
  PR-003: API (POST /missions, POST /missions/{id}/assets, GET /missions)
  PR-004: Events (MissionCreated, AssetUploaded, RawDatasetReady)
  PR-005: UI (simple drag-and-drop upload with progress)
- Added Definition of Done for Story 1:
  Phone → Video → Upload → Bucket → Metadata → Mission visible in Dataset Explorer
- Added ID Convention: mission_YYYYMMDD_NNNNNN, asset_NNNNNN, obs_NNNNNN,
  decision_NNNNNN. Never UUID in UI.
- Added Artifact Viewer: show raw asset metadata, hash, GPS, EXIF,
  storage location, version for debugging

Rationale: Clean architecture, testable without UI, traceable artifacts.
2026-07-02 13:41:16 +00:00
Bernt 9e4ebeea1a docs: Epic-001 v1.1 — Reordered stories + Golden Mission + Review + Dashboard
- Reordered stories to reach First Verified Decision faster:
  1. Mission Import (was 2) — proves we can receive real data
  2. Dataset Explorer (was 3) — makes data visible
  3. Annotation Workspace (was 4) — first human-in-the-loop
  4. Decision Case (was 5) — first verified decision
  5. Replay (was 6) — proves chain is reproducible
  6. Session Management (was 1) — organizes when core works

- Added Golden Mission concept:
  - Real mission that never changes, used as regression test
  - Every new model runs against same mission
  - See immediately if something got better or worse

- Added Review as first-class object:
  - Observation → AI → Human Review → Approved/Rejected/Needs More Evidence
  - Makes entire quality flow traceable

- Added Dashboard v1:
  - Sessions, Missions, Decision Cases, Pending Reviews, Verified Decisions
  - Big button: [Continue Reviewing]
  - Work tool, not BI system

- Added vertical user journey (demo script):
  - quiXzoom → photo → import → save → explore → AI observation →
    correction → Decision Case → full chain viewer
  - If this works, core is proven

- Added definition of 'First Verified Decision':
  - Built on real observation data
  - Reviewed by human
  - Complete evidence chain
  - Fully reproducible from raw data to recommendation

Rationale: Reach core proof faster, add organization later.
Golden Mission enables regression testing from day one.
Review object makes quality flow traceable.
2026-07-02 13:38:09 +00:00
Bernt c47a58f76b docs: Epic-001 — First Verified Decision specification
- STOP Rule: No new pipeline until 20 real Decision Cases exist
- Field Readiness Gate: 5 questions before building any feature
- Sprint Goal: Every sprint must produce more verified Decision Cases

- Six stories:
  1. Session Management — organize missions by location/date
  2. Mission Import — upload video/images/GPS/EXIF, store immutably
  3. Dataset Explorer — browse, filter, search, map view
  4. Annotation Workspace — review/correct AI, version history
  5. Decision Case — full chain: Observation→Evidence→Finding→Decision→Business Impact
  6. Replay — step through mission chain (V1: simple playback)

- Not in first release (intentionally postponed):
  GPU Queue, Hyperparameter Search, Distributed Training,
  Benchmark, Canary Deployment, Auto Retraining,
  Bias Dashboard, Drift Detection

- Definition of Done: Complete vertical slice from reality to verified decision
- Definition of Ready for Epic-002: 20 real Decision Cases + Field Readiness Gate

- Technical stack: React+TypeScript, Node.js+Express, PostgreSQL, S3/R2, Bull, Python AI service
- Quality gates: TypeScript strict ≥80% coverage, no secrets, OAuth 2.0, immutable audit log, GitOps

Rationale: Prove the system works end-to-end before scaling.
Focus on learning from reality, not building everything upfront.
2026-07-02 13:34:05 +00:00
Bernt 67ca05f2b2 docs: LandveX Intelligence Lab v1.3 — Government Quality Standards added
- Added comprehensive quality standards for public sector:
  - Code Quality: TypeScript/Rust strict, ≥80% test coverage, static analysis,
    mandatory code review, API documentation
  - Security: OAuth 2.0 + MFA, RBAC + audit, AES-256/TLS 1.3,
    HashiCorp Vault, weekly vulnerability scans
  - Audit & Compliance: Immutable signed logs, configurable retention,
    full export, WCAG 2.1 AA, Swedish + English
  - Infrastructure: GitOps, OpenTelemetry, 3-2-1 backup, RPO<1h RTO<4h,
    horizontal scaling
  - AI/ML: MLflow versioning, full data lineage, bias testing,
    SHAP/LIME explainability, model cards
  - Development: Git workflow, CI/CD, IaC, dependency management,
    incident response runbooks

Rationale: LandveX serves municipalities and government agencies.
Intelligence Lab must satisfy public sector procurement, audit,
and compliance requirements from day one.
2026-07-02 13:08:22 +00:00