Initial GeoIntel V1 foundation
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
# M10 Master Autonomous Prompt for Codex
|
||||
|
||||
You are working on GeoIntel Kempen.
|
||||
|
||||
GeoIntel is a GeoAI Workbench for the Kempen. It must demonstrate GIS, remote sensing, raster/vector processing, AI object detection, segmentation architecture, QA/QC against reference geodata, and geospatial export.
|
||||
|
||||
Your job is to build the project in strict, reviewable passes.
|
||||
|
||||
## First Actions
|
||||
1. Read `docs/18-ultra-prep/CODEX_START_HERE.md`.
|
||||
2. Read all referenced files in order.
|
||||
3. Inspect the repository state.
|
||||
4. Identify the first incomplete pass from `prompts/codex/M10_PASS_SEQUENCE.md`.
|
||||
5. Execute only that pass.
|
||||
|
||||
## Build Rules
|
||||
- Backend-first where contracts or data models are involved.
|
||||
- API-driven frontend only; no hidden local fake state as final behavior.
|
||||
- Use durable abstractions for GIS, raster, detection, segmentation, QA/QC, and export.
|
||||
- Do not overbuild future modules, but leave documented extension points.
|
||||
- Every feature needs success, loading, empty, error, and unavailable states where relevant.
|
||||
- Keep V1 scope frozen. LiDAR, training, MLOps, QGIS plugin are not V1.
|
||||
|
||||
## Freedom
|
||||
You may improve implementation details, test coverage, documentation, typing, error handling, and UI clarity.
|
||||
|
||||
## Hard Constraints
|
||||
Do not change the product identity, tech stack, database strategy, or V1 scope without explicit user approval.
|
||||
|
||||
## Required End-of-Pass Report
|
||||
Use this format:
|
||||
|
||||
```md
|
||||
# Codex Pass Report
|
||||
## Pass
|
||||
## Completed
|
||||
## Changed Files
|
||||
## Commands Run
|
||||
## Test Results
|
||||
## Known Limitations
|
||||
## Risks / Follow-up
|
||||
## Next Recommended Pass
|
||||
```
|
||||
@@ -0,0 +1,49 @@
|
||||
# M10 Pass Sequence
|
||||
|
||||
## Pass 00 — Repo Audit and Setup Verification
|
||||
Goal: inspect repo, verify docs, identify missing package files, and create any minimal config files needed to run local development.
|
||||
|
||||
## Pass 01 — Backend Skeleton
|
||||
Goal: create FastAPI app structure, config, health endpoint, logging, error schema, and test setup.
|
||||
|
||||
## Pass 02 — Database Foundation
|
||||
Goal: add SQLAlchemy/SQLModel or chosen ORM structure, Alembic, PostGIS migration, and core tables.
|
||||
|
||||
## Pass 03 — Project and Area Domain
|
||||
Goal: implement project and area CRUD, geometry validation, GeoJSON input/output, and tests.
|
||||
|
||||
## Pass 04 — Dataset Manager Backend
|
||||
Goal: implement upload registry, storage paths, metadata model, dataset status state machine, and API contracts.
|
||||
|
||||
## Pass 05 — Vector Processing Core
|
||||
Goal: implement vector metadata extraction, GeoJSON import, clipping, CRS validation, and simple spatial metrics.
|
||||
|
||||
## Pass 06 — Raster Processing Core
|
||||
Goal: implement raster metadata extraction, bounds/resolution/bands, and safe unavailable states for advanced operations.
|
||||
|
||||
## Pass 07 — Frontend Foundation
|
||||
Goal: create React/Vite app, API client, layout, routing, design system primitives, and health/status view.
|
||||
|
||||
## Pass 08 — Map Workbench
|
||||
Goal: MapLibre page, project area drawing/import, layer toggles, vector display, and API integration.
|
||||
|
||||
## Pass 09 — Dataset Manager UI
|
||||
Goal: upload/list/status/metadata UI with error/empty/loading states.
|
||||
|
||||
## Pass 10 — Detection Pipeline Adapter
|
||||
Goal: implement detection run entity, adapter interface, demo/local adapter, result storage, and GeoJSON output.
|
||||
|
||||
## Pass 11 — QA/QC Engine
|
||||
Goal: implement polygon matching, IoU/precision/recall/F1, reference layer comparison, and QA output API.
|
||||
|
||||
## Pass 12 — Export Engine
|
||||
Goal: implement GeoJSON exports for areas, layers, detections, and QA findings.
|
||||
|
||||
## Pass 13 — Demo Workflow
|
||||
Goal: create a guided demo page for Geel building detection + QA against reference polygons using fixtures.
|
||||
|
||||
## Pass 14 — Smoke Test and Documentation Update
|
||||
Goal: add smoke scripts, update README quickstart, TODO, and pass report.
|
||||
|
||||
## Pass 15 — Polish Without Scope Creep
|
||||
Goal: improve UI clarity, validation copy, accessibility, and minor performance without changing scope.
|
||||
@@ -0,0 +1,74 @@
|
||||
# M11 Architect Master Prompt for Codex
|
||||
|
||||
You are implementing GeoIntel Kempen.
|
||||
|
||||
Before coding, read:
|
||||
|
||||
1. `docs/00-start/START_HERE.md`
|
||||
2. `docs/governance/GEOINTEL_CONSTITUTION.md`
|
||||
3. `docs/governance/ARCHITECTURE_INVARIANTS.md`
|
||||
4. `docs/governance/FORBIDDEN_DECISIONS.md`
|
||||
5. `docs/governance/DECISION_PRECEDENCE.md`
|
||||
6. `docs/specs/CANONICAL_DOMAIN_MODELS.md`
|
||||
7. `docs/specs/GIS_STANDARDS.md`
|
||||
8. `docs/specs/RASTER_STANDARDS.md`
|
||||
9. `docs/specs/STATE_MACHINES.md`
|
||||
10. `docs/workflows/GOLDEN_PATHS.md`
|
||||
11. `docs/build/BUILD_ORDER_DEPENDENCY_GRAPH.md`
|
||||
12. `docs/build/CODEX_OPERATING_SYSTEM.md`
|
||||
|
||||
Your mission is not to invent a new product. Your mission is to implement the documented GeoAI Workbench.
|
||||
|
||||
## First implementation target
|
||||
|
||||
Build the smallest stable vertical slice:
|
||||
|
||||
- backend skeleton;
|
||||
- config/env loading;
|
||||
- database connection placeholder or implementation;
|
||||
- project, area and dataset domain models;
|
||||
- response envelope;
|
||||
- error catalog integration;
|
||||
- demo reference and predicted building fixture loading;
|
||||
- QA/QC matching function on fixtures;
|
||||
- GeoJSON export for QA outputs;
|
||||
- minimal frontend route/shell if backend foundation is stable.
|
||||
|
||||
## Strict rules
|
||||
|
||||
- Do not introduce unapproved architecture.
|
||||
- Do not build frontend-only mock workflows.
|
||||
- Do not implement live YOLO before detection result lifecycle exists.
|
||||
- Do not implement live GRB WFS before demo reference workflow is stable.
|
||||
- Do not skip tests or smoke checks.
|
||||
- Do not remove docs to reduce conflicts; update canonical docs instead.
|
||||
|
||||
## Acceptable autonomous improvements
|
||||
|
||||
You may add:
|
||||
|
||||
- typed schemas;
|
||||
- helper services;
|
||||
- repository pattern if simple;
|
||||
- tests;
|
||||
- fixture validators;
|
||||
- clearer error messages;
|
||||
- frontend empty/loading/error states;
|
||||
- docs updates.
|
||||
|
||||
## Required final response from Codex
|
||||
|
||||
At the end of the pass, report:
|
||||
|
||||
```text
|
||||
Pass name:
|
||||
Implemented:
|
||||
Files changed:
|
||||
Commands run:
|
||||
Tests passed:
|
||||
Tests failed:
|
||||
Golden paths status:
|
||||
Architecture invariant status:
|
||||
Known limitations:
|
||||
Next recommended pass:
|
||||
```
|
||||
@@ -0,0 +1,37 @@
|
||||
# Codex Master Build Prompt — GeoIntel M2
|
||||
|
||||
You are working in the GeoIntel Kempen repository.
|
||||
|
||||
GeoIntel is a GeoAI Workbench for the Kempen region. Its core workflow is:
|
||||
|
||||
Data → Processing → Model inference → Geospatial output → QA/QC → Export.
|
||||
|
||||
Before coding, read:
|
||||
|
||||
1. README.md
|
||||
2. AGENTS.md
|
||||
3. docs/M2_ENGINEERING_PACKAGE.md
|
||||
4. docs/DEVELOPMENT_RULES.md
|
||||
5. docs/V1_SCOPE_FREEZE.md
|
||||
6. docs/SERVICE_ARCHITECTURE.md
|
||||
7. docs/API_CONTRACT_FREEZE_M2.md
|
||||
8. docs/DATABASE_IMPLEMENTATION_PLAN.md
|
||||
9. docs/ACCEPTANCE_MATRIX.md
|
||||
10. docs/TEST_CATALOG.md
|
||||
|
||||
Rules:
|
||||
|
||||
- Do not change the product direction.
|
||||
- Do not replace the chosen stack.
|
||||
- Do not introduce mock-only workflows as final functionality.
|
||||
- Do not implement LiDAR/training/MLOps/QGIS plugin in V1.
|
||||
- Do not create fake buttons without real routes or explicit disabled states.
|
||||
- Backend must be API-first and type-safe.
|
||||
- Frontend must use a central API client.
|
||||
- Spatial data must respect CRS and geometry validity.
|
||||
- Long-running work must use job/run status, not blocking requests.
|
||||
- Every completed pass must update TODO, changelog, and handoff notes.
|
||||
|
||||
First build target:
|
||||
|
||||
Implement the backend foundation, database models, health endpoint, project CRUD, area CRUD, dataset registration/upload skeleton, and test scaffolding.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Codex Pass 01 — Backend Foundation
|
||||
|
||||
You are implementing GeoIntel Kempen.
|
||||
|
||||
Read first:
|
||||
- AGENTS.md
|
||||
- docs/DEVELOPMENT_RULES.md
|
||||
- docs/SERVICE_IO_CONTRACTS.md
|
||||
- docs/API_EXAMPLE_RESPONSES.md
|
||||
- docs/SPRINT_BOARD_M4.md
|
||||
|
||||
Task:
|
||||
Build the FastAPI backend foundation only.
|
||||
|
||||
Required:
|
||||
- App factory or clear app entrypoint.
|
||||
- Settings loader from environment.
|
||||
- Health endpoint.
|
||||
- Standard error envelope.
|
||||
- Database session structure.
|
||||
- Test setup.
|
||||
- No GIS-heavy implementation yet.
|
||||
|
||||
Acceptance:
|
||||
- Backend imports cleanly.
|
||||
- Health endpoint test passes.
|
||||
- Error envelope test passes.
|
||||
- TODO and changelog updated.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Codex Pass 02 — Database & Domain Models
|
||||
|
||||
Task:
|
||||
Implement database models and baseline migrations for the GeoIntel core domain.
|
||||
|
||||
Read:
|
||||
- docs/DATABASE_SCHEMA.md
|
||||
- contracts/database/*
|
||||
- docs/MODULE_BUILD_CONTRACTS.md
|
||||
|
||||
Required:
|
||||
- projects
|
||||
- areas
|
||||
- datasets
|
||||
- analysis_runs
|
||||
- detections
|
||||
- segmentations
|
||||
- metrics
|
||||
- quality_checks
|
||||
- exports
|
||||
|
||||
Acceptance:
|
||||
- Migration can be generated/applied.
|
||||
- Geometry strategy documented in code comments where relevant.
|
||||
- Model tests pass.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Codex Pass 03 — Dataset Manager
|
||||
|
||||
Task:
|
||||
Implement dataset upload, metadata extraction dispatcher, dataset list/detail endpoints and frontend dataset table shell.
|
||||
|
||||
Read:
|
||||
- docs/MODULE_BUILD_CONTRACTS.md
|
||||
- docs/ACCEPTANCE_TEST_CATALOG.md
|
||||
- docs/DEMO_FIXTURE_MANIFEST.md
|
||||
|
||||
Required:
|
||||
- Upload endpoint.
|
||||
- Dataset status transitions.
|
||||
- GeoJSON metadata extraction.
|
||||
- Unsupported extension error.
|
||||
- Frontend route with empty/loading/error/success states.
|
||||
|
||||
Acceptance:
|
||||
- GeoJSON fixture upload works.
|
||||
- Dataset metadata appears in UI or API response.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Codex Pass 04 — Map & Area Workspace
|
||||
|
||||
Task:
|
||||
Implement project area creation and map workspace foundation.
|
||||
|
||||
Required:
|
||||
- Area API with GeoJSON polygon input.
|
||||
- Geometry validation.
|
||||
- Area FeatureCollection response.
|
||||
- Frontend map route.
|
||||
- Draw/import area UX shell.
|
||||
|
||||
Acceptance:
|
||||
- Demo area fixture can be loaded and displayed.
|
||||
- Area created via API is returned as GeoJSON.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Codex Pass 05 — AI Demo Pipelines
|
||||
|
||||
Task:
|
||||
Implement deterministic demo object detection and segmentation runs.
|
||||
|
||||
Read:
|
||||
- docs/MODEL_REGISTRY_SEED.md
|
||||
- docs/DETECTION_PIPELINE_SPEC.md
|
||||
- docs/SEGMENTATION_PIPELINE_SPEC.md
|
||||
|
||||
Required:
|
||||
- Model registry seeds.
|
||||
- Detection run endpoint.
|
||||
- Segmentation run endpoint.
|
||||
- Deterministic output from demo fixtures.
|
||||
- Store outputs as geospatial records.
|
||||
|
||||
Acceptance:
|
||||
- Detection run creates predictable building detections.
|
||||
- Segmentation run creates predictable vegetation/water polygons.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Codex Pass 06 — QA/QC and Exports
|
||||
|
||||
Task:
|
||||
Implement QA/QC comparison against reference features and GeoJSON/CSV export.
|
||||
|
||||
Read:
|
||||
- docs/QA_QC_SPECIFICATION.md
|
||||
- docs/QA_QC_ENGINE.md
|
||||
- docs/API_EXAMPLE_RESPONSES.md
|
||||
|
||||
Required:
|
||||
- IoU matching.
|
||||
- TP/FP/FN.
|
||||
- Precision/recall/F1.
|
||||
- GeoJSON export for detections and findings.
|
||||
- CSV metrics export.
|
||||
|
||||
Acceptance:
|
||||
- Expected QA metrics fixture passes.
|
||||
- Exports are downloadable and recorded.
|
||||
@@ -0,0 +1,115 @@
|
||||
# GeoIntel Day-One Master Prompt for Codex
|
||||
|
||||
You are working inside the GeoIntel Kempen repository.
|
||||
|
||||
GeoIntel Kempen is a GeoAI Workbench for the Kempen region. It combines geospatial data, raster/vector processing, object detection, segmentation, QA/QC against GRB/reference layers, and exports. It is not a generic CRUD app and not a simple map demo.
|
||||
|
||||
## First instruction
|
||||
|
||||
Before writing code, read these files in this order:
|
||||
|
||||
1. `README.md`
|
||||
2. `AGENTS.md`
|
||||
3. `docs/V1_SCOPE_FREEZE.md`
|
||||
4. `docs/REPOSITORY_CONVENTIONS.md`
|
||||
5. `docs/ARCHITECTURE.md`
|
||||
6. `docs/SERVICE_ARCHITECTURE.md`
|
||||
7. `docs/API_CONTRACTS.md`
|
||||
8. `docs/DATABASE_SCHEMA.md`
|
||||
9. `docs/DATABASE_IMPLEMENTATION_PLAN.md`
|
||||
10. `docs/DEFINITION_OF_READY.md`
|
||||
11. `docs/DEFINITION_OF_DONE.md`
|
||||
12. `docs/17-max-prep/M9_MAX_PREPARATION_PACK.md`
|
||||
13. `docs/17-max-prep/M9_AUTONOMOUS_BUILD_DOCTRINE.md`
|
||||
14. `docs/17-max-prep/M9_PASS_SCORECARDS.md`
|
||||
15. `docs/17-max-prep/M9_BUILD_BLOCKERS_AND_RECOVERY.md`
|
||||
|
||||
Then perform Pass 0.
|
||||
|
||||
## Pass 0: Repository Audit
|
||||
|
||||
Do not build new features in Pass 0.
|
||||
|
||||
Produce and commit/update:
|
||||
|
||||
- `docs/CODEX_EXECUTION_LOG.md`
|
||||
- `docs/BUILD_STATUS.md`
|
||||
- `docs/IMPLEMENTATION_GAP_REPORT.md`
|
||||
|
||||
The gap report must list:
|
||||
|
||||
- existing files,
|
||||
- missing implementation pieces,
|
||||
- highest-risk assumptions,
|
||||
- exact next build pass.
|
||||
|
||||
## Build order
|
||||
|
||||
After Pass 0, follow this order strictly:
|
||||
|
||||
1. Backend foundation
|
||||
2. Database and models
|
||||
3. API envelope and error handling
|
||||
4. Project and area APIs
|
||||
5. Dataset manager skeleton
|
||||
6. Demo fixture loading
|
||||
7. Frontend foundation
|
||||
8. Map workbench shell
|
||||
9. Raster/vector metadata skeleton
|
||||
10. QA/QC skeleton
|
||||
|
||||
Do not start YOLO, SAM, Sentinel, LiDAR, training studio, or advanced change detection until the foundation is green.
|
||||
|
||||
## Non-negotiable rules
|
||||
|
||||
- Keep FastAPI.
|
||||
- Keep React + TypeScript.
|
||||
- Keep PostgreSQL + PostGIS.
|
||||
- Use the documented response envelope.
|
||||
- Do not introduce a second API style.
|
||||
- Do not hardcode fake success states.
|
||||
- Do not silently swallow errors.
|
||||
- Do not remove documentation.
|
||||
- Do not replace real architecture with mock-only code.
|
||||
- Do not implement features outside V1 unless they are explicit stubs with clear disabled state.
|
||||
|
||||
## Allowed improvements
|
||||
|
||||
You may improve:
|
||||
|
||||
- internal folder organization if it remains compatible with repository conventions,
|
||||
- UI polish,
|
||||
- test coverage,
|
||||
- typing,
|
||||
- validation quality,
|
||||
- developer ergonomics,
|
||||
- logging.
|
||||
|
||||
If you improve beyond the spec, document it in `docs/PROPOSED_IMPROVEMENTS.md` and explain why it is safe.
|
||||
|
||||
## Required output after every pass
|
||||
|
||||
Update:
|
||||
|
||||
- `docs/CODEX_EXECUTION_LOG.md`
|
||||
- `docs/BUILD_STATUS.md`
|
||||
- `CHANGELOG.md`
|
||||
|
||||
Include:
|
||||
|
||||
- what changed,
|
||||
- commands run,
|
||||
- tests passed/failed,
|
||||
- unresolved gaps,
|
||||
- next recommended pass.
|
||||
|
||||
## Stop conditions
|
||||
|
||||
Stop and report instead of improvising when:
|
||||
|
||||
- database schema conflicts with docs,
|
||||
- required dependency cannot install,
|
||||
- CRS/geospatial calculation is ambiguous,
|
||||
- you cannot run tests,
|
||||
- a feature would require real external credentials,
|
||||
- you need to change a frozen architecture decision.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Codex Pass 00 — Repository Audit
|
||||
|
||||
## Goal
|
||||
|
||||
Audit the GeoIntel repository before any implementation work.
|
||||
|
||||
## Read first
|
||||
|
||||
- `AGENTS.md`
|
||||
- `docs/CODEX_MASTER_PROMPT.md`
|
||||
- `docs/V1_SCOPE_FREEZE.md`
|
||||
- `docs/M6_AUTONOMY_BOUNDARIES.md`
|
||||
- `docs/M6_QUALITY_GATES.md`
|
||||
- `docs/REPOSITORY_CONVENTIONS.md`
|
||||
|
||||
## Tasks
|
||||
|
||||
1. List the current repository structure.
|
||||
2. Verify required docs are present.
|
||||
3. Identify missing folders/files required before build.
|
||||
4. Identify contradictions in docs, if any.
|
||||
5. Identify first safe implementation pass.
|
||||
6. Do not write application code in this pass unless fixing repo hygiene such as missing `.gitkeep`.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Codex Pass 01 — Backend Foundation
|
||||
|
||||
## Goal
|
||||
|
||||
Create the FastAPI backend foundation without business shortcuts.
|
||||
|
||||
## Must implement
|
||||
|
||||
- backend package layout following repository conventions;
|
||||
- FastAPI app factory or app entrypoint;
|
||||
- health endpoint;
|
||||
- settings loader from environment;
|
||||
- structured error response shape;
|
||||
- basic logging config;
|
||||
- test skeleton;
|
||||
- backend README update.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- dataset processing;
|
||||
- AI inference;
|
||||
- authentication;
|
||||
- frontend work;
|
||||
- live external services.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- backend imports successfully;
|
||||
- health endpoint returns service status;
|
||||
- tests include import/smoke test;
|
||||
- `.env.example` remains authoritative.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,31 @@
|
||||
# Codex Pass 02 — Database and Models
|
||||
|
||||
## Goal
|
||||
|
||||
Add SQLAlchemy/Alembic/PostGIS-ready database foundation.
|
||||
|
||||
## Must implement
|
||||
|
||||
- database session management;
|
||||
- base model conventions;
|
||||
- models for Project, Area, Dataset, AnalysisRun, Metric, Export, Job;
|
||||
- migration scaffold;
|
||||
- geometry field strategy documented in code comments or docs;
|
||||
- indexes for FK and future geometry operations;
|
||||
- tests for model imports.
|
||||
|
||||
## Must preserve
|
||||
|
||||
- PostGIS as spatial database;
|
||||
- additive migration approach;
|
||||
- UUID or chosen ID strategy consistently.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- destructive migrations;
|
||||
- live GRB/OSM fetch;
|
||||
- AI tables beyond V1 scaffold unless already specified.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Codex Pass 02 — Projects, Areas, Datasets
|
||||
|
||||
Goal: make the core domain usable through API.
|
||||
|
||||
Implement:
|
||||
|
||||
- project CRUD endpoints
|
||||
- area creation with GeoJSON polygon validation
|
||||
- area listing
|
||||
- dataset registration
|
||||
- dataset upload skeleton
|
||||
- dataset metadata fields
|
||||
- consistent error envelopes
|
||||
|
||||
Acceptance:
|
||||
|
||||
- User can create a project.
|
||||
- User can attach an area.
|
||||
- User can upload/register a dataset.
|
||||
- Invalid geometry is rejected.
|
||||
@@ -0,0 +1,23 @@
|
||||
# Codex Pass 03 — Project and Area API
|
||||
|
||||
## Goal
|
||||
|
||||
Implement persisted project and area management.
|
||||
|
||||
## Must implement
|
||||
|
||||
- create/list/read/update project endpoints;
|
||||
- create/list/read area endpoints;
|
||||
- polygon validation;
|
||||
- area calculation with explicit units;
|
||||
- API schemas;
|
||||
- service layer;
|
||||
- tests for happy path and invalid polygon.
|
||||
|
||||
## UI not required
|
||||
|
||||
This pass is backend-only unless otherwise requested.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,18 @@
|
||||
# Codex Pass 03 — Raster and Vector Foundation
|
||||
|
||||
Goal: implement first real geospatial processing utilities.
|
||||
|
||||
Implement:
|
||||
|
||||
- vector import from GeoJSON fixture
|
||||
- vector metadata extraction
|
||||
- geometry validity checks
|
||||
- raster metadata extraction if Rasterio fixture exists
|
||||
- service boundaries for raster/vector operations
|
||||
- tests using fixtures
|
||||
|
||||
Acceptance:
|
||||
|
||||
- GeoJSON fixture can be imported.
|
||||
- Bounds and geometry type are calculated.
|
||||
- CRS metadata is preserved.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Codex Pass 04 — Dataset Manager
|
||||
|
||||
## Goal
|
||||
|
||||
Implement dataset upload and metadata foundation.
|
||||
|
||||
## Must implement
|
||||
|
||||
- upload endpoint;
|
||||
- local storage path based on storage architecture;
|
||||
- metadata extraction scaffold;
|
||||
- dataset record persistence;
|
||||
- type detection for vector/raster by extension;
|
||||
- safe file name handling;
|
||||
- tests using fixtures.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- heavy raster clipping;
|
||||
- external provider download;
|
||||
- AI inference.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Codex Pass 04 — Detection and QA Skeleton
|
||||
|
||||
Goal: prepare object detection and QA/QC without requiring heavy model artifacts yet.
|
||||
|
||||
Implement:
|
||||
|
||||
- model registry schema/service
|
||||
- detection run API contract
|
||||
- detection result storage model
|
||||
- GeoJSON export of detection results
|
||||
- QA/QC service with IoU, precision, recall, F1 calculations using polygon fixtures
|
||||
|
||||
Acceptance:
|
||||
|
||||
- QA calculations are tested with simple polygons.
|
||||
- Detection outputs can be stored and exported.
|
||||
- Heavy model execution is behind a service interface.
|
||||
@@ -0,0 +1,29 @@
|
||||
# Codex Prompt — Pass 05 Dataset Manager
|
||||
|
||||
You are working on GeoIntel Kempen.
|
||||
|
||||
Implement the Dataset Manager according to:
|
||||
|
||||
- docs/BUILD_TICKETS_M3.md T-007
|
||||
- docs/MODULE_CONTRACTS.md
|
||||
- docs/BACKEND_PACKAGE_MAP.md
|
||||
- docs/FRONTEND_ROUTE_MAP.md
|
||||
- docs/STORAGE_ARCHITECTURE.md
|
||||
|
||||
Rules:
|
||||
|
||||
- Do not create UI-only mock workflows.
|
||||
- Dataset records must be persisted.
|
||||
- Uploaded originals must be stored under the configured originals storage path.
|
||||
- Metadata extraction may be queued, but the status must be visible.
|
||||
- Return responses using the response envelope contract.
|
||||
- Add or update tests.
|
||||
- Update CHANGELOG.md.
|
||||
|
||||
Deliver:
|
||||
|
||||
- backend upload route
|
||||
- dataset model/schema/service
|
||||
- frontend dataset page
|
||||
- loading/error/empty states
|
||||
- docs update if implementation differs from spec
|
||||
@@ -0,0 +1,24 @@
|
||||
# Codex Pass 05 — Raster/Vector Metadata Core
|
||||
|
||||
## Goal
|
||||
|
||||
Make uploaded raster/vector datasets inspectable.
|
||||
|
||||
## Must implement
|
||||
|
||||
- raster metadata via Rasterio when available;
|
||||
- vector metadata via GeoPandas/Fiona when available;
|
||||
- CRS/bounds/feature count/bands/resolution where applicable;
|
||||
- robust fallback errors when dependencies are unavailable;
|
||||
- metadata endpoint;
|
||||
- tests with small fixtures.
|
||||
|
||||
## Must preserve
|
||||
|
||||
- raw inputs immutable;
|
||||
- metadata JSON persisted;
|
||||
- errors structured.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Codex Pass 06 — Frontend Workbench Shell
|
||||
|
||||
## Goal
|
||||
|
||||
Create the React/TypeScript frontend shell aligned with the design system.
|
||||
|
||||
## Must implement
|
||||
|
||||
- route layout;
|
||||
- navigation;
|
||||
- project list page;
|
||||
- project workspace placeholder with real API integration if backend exists;
|
||||
- typed API client foundation;
|
||||
- loading/error/empty states;
|
||||
- frontend README update.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- fake completed modules;
|
||||
- hardcoded production data;
|
||||
- AI/detection UI beyond navigation placeholders.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Codex Prompt — Pass 06 Raster and Vector Metadata
|
||||
|
||||
Implement raster and vector metadata extraction.
|
||||
|
||||
Use:
|
||||
|
||||
- Rasterio for raster metadata
|
||||
- GeoPandas/Shapely for vector metadata
|
||||
|
||||
Required docs:
|
||||
|
||||
- docs/RASTER_OPERATIONS_SPEC.md
|
||||
- docs/VECTOR_OPERATIONS_SPEC.md
|
||||
- docs/BUILD_TICKETS_M3.md T-008 and T-009
|
||||
- docs/TEST_CATALOG.md
|
||||
|
||||
Acceptance:
|
||||
|
||||
- GeoTIFF metadata extraction works for fixtures.
|
||||
- GeoJSON metadata extraction works for fixtures.
|
||||
- invalid files produce clear validation errors.
|
||||
- metadata is persisted to dataset metadata JSON.
|
||||
- frontend dataset detail page shows extracted metadata.
|
||||
|
||||
Do not remove the GIS stack to simplify installation. If local installation is hard, document Docker-first development.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Codex Pass 07 — Map Workbench
|
||||
|
||||
## Goal
|
||||
|
||||
Implement the first usable map workbench.
|
||||
|
||||
## Must implement
|
||||
|
||||
- MapLibre map container;
|
||||
- area drawing or import if feasible;
|
||||
- layer panel scaffold;
|
||||
- area details panel;
|
||||
- project/area API integration;
|
||||
- geometry display from backend;
|
||||
- error states.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- full GIS editing suite;
|
||||
- unsupported 3D;
|
||||
- live provider fetch.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,21 @@
|
||||
# Codex Prompt — Pass 08 GRB Reference Skeleton
|
||||
|
||||
Implement GRB reference integration skeleton.
|
||||
|
||||
Follow:
|
||||
|
||||
- docs/DATASET_STRATEGY.md
|
||||
- docs/DATA_CATALOG.md
|
||||
- docs/BUILD_TICKETS_M3.md T-010
|
||||
- adr/ADR-003-grb-strategy.md
|
||||
|
||||
Required:
|
||||
|
||||
- GRB service interface.
|
||||
- Configurable WFS endpoint.
|
||||
- Fetch-by-area method.
|
||||
- Cache or dataset registration path.
|
||||
- Clear source_unavailable status if the live endpoint is unreachable.
|
||||
- Fixture fallback only for tests and demo mode, clearly labeled.
|
||||
|
||||
Do not hardcode fake GRB as real data.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Codex Pass 08 — Test and Fixture Hardening
|
||||
|
||||
## Goal
|
||||
|
||||
Make the repo safer for autonomous future passes.
|
||||
|
||||
## Must implement
|
||||
|
||||
- deterministic backend fixtures;
|
||||
- smoke scripts where missing;
|
||||
- API contract tests for implemented endpoints;
|
||||
- frontend smoke/build check if frontend exists;
|
||||
- fixture manifest update.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,22 @@
|
||||
# Codex Prompt — Pass 09 Detection Pipeline Interface
|
||||
|
||||
Implement object detection pipeline interface.
|
||||
|
||||
Follow:
|
||||
|
||||
- docs/DETECTION_PIPELINE_SPEC.md
|
||||
- docs/DETECTION_CLASSES_CATALOG.md
|
||||
- docs/MODEL_REGISTRY_SPEC.md
|
||||
- docs/BUILD_TICKETS_M3.md T-011
|
||||
|
||||
Required:
|
||||
|
||||
- analysis run creation
|
||||
- detection service interface
|
||||
- model registry lookup
|
||||
- deterministic fixture detector for test/demo mode
|
||||
- detections persisted with class, confidence and geometry
|
||||
- GeoJSON output
|
||||
- frontend detection page can start run and view results
|
||||
|
||||
The interface must be compatible with later YOLO/Ultralytics implementation.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Codex Pass 09 — Detection Service Scaffold
|
||||
|
||||
## Goal
|
||||
|
||||
Add a safe detection pipeline scaffold that can later run YOLO.
|
||||
|
||||
## Must implement
|
||||
|
||||
- model registry table or config seed if not yet present;
|
||||
- detection run API scaffold;
|
||||
- job-backed analysis run creation;
|
||||
- output schema for detections;
|
||||
- no fake detection results marked as real;
|
||||
- optional demo fixture output clearly marked as fixture.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- GPU-only inference;
|
||||
- unpinned heavy dependency without policy update;
|
||||
- training studio.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Codex Pass 10 — Export Pipeline
|
||||
|
||||
## Goal
|
||||
|
||||
Implement first export flow for GeoJSON and metadata.
|
||||
|
||||
## Must implement
|
||||
|
||||
- export record model/service if not done;
|
||||
- GeoJSON export endpoint for areas or detections depending on available data;
|
||||
- metadata sidecar with source, CRS, timestamp, analysis id if relevant;
|
||||
- tests for valid export file.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,22 @@
|
||||
# Codex Prompt — Pass 10 QA/QC Engine
|
||||
|
||||
Implement QA/QC v1.
|
||||
|
||||
Follow:
|
||||
|
||||
- docs/QA_QC_SPECIFICATION.md
|
||||
- docs/QA_QC_ENGINE.md
|
||||
- docs/BUILD_TICKETS_M3.md T-012
|
||||
|
||||
Required:
|
||||
|
||||
- compare predictions with reference geometries
|
||||
- IoU threshold default 0.5
|
||||
- calculate precision, recall, F1
|
||||
- classify matches, false positives, false negatives
|
||||
- persist quality check and items
|
||||
- expose API endpoint
|
||||
- frontend QA page shows metrics and layers
|
||||
- deterministic fixture test must pass
|
||||
|
||||
Do not approximate metrics with counts only. Spatial matching is required.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Codex Prompt — Pass 11 Exports
|
||||
|
||||
Implement export layer.
|
||||
|
||||
Follow:
|
||||
|
||||
- docs/MODULE_CONTRACTS.md Export Contract
|
||||
- docs/BUILD_TICKETS_M3.md T-013
|
||||
- docs/STORAGE_ARCHITECTURE.md
|
||||
|
||||
Required:
|
||||
|
||||
- GeoJSON export for detection results
|
||||
- GeoJSON export for QA false positives/false negatives
|
||||
- JSON export for analysis summary
|
||||
- export records persisted
|
||||
- files stored under storage/exports
|
||||
- frontend export page lists downloads
|
||||
|
||||
Do not generate broken placeholder files.
|
||||
@@ -0,0 +1,22 @@
|
||||
# Codex Pass 11 — QA/QC Foundation
|
||||
|
||||
## Goal
|
||||
|
||||
Implement foundational geometry comparison utilities.
|
||||
|
||||
## Must implement
|
||||
|
||||
- IoU utility for polygons;
|
||||
- overlap-based matching strategy;
|
||||
- precision/recall/F1 calculation for matched objects;
|
||||
- tests for perfect match, partial match, no match, invalid geometry;
|
||||
- docs update if thresholds are chosen.
|
||||
|
||||
## Must not implement
|
||||
|
||||
- live GRB integration unless already implemented safely;
|
||||
- unclear thresholds without documentation.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Codex Prompt — Pass 12 Stabilization
|
||||
|
||||
Perform a stabilization pass.
|
||||
|
||||
Required checks:
|
||||
|
||||
- backend imports cleanly
|
||||
- migrations run
|
||||
- core API tests pass
|
||||
- frontend compiles
|
||||
- navigation works
|
||||
- no broken empty states
|
||||
- no unhandled API errors
|
||||
- README quickstart accurate
|
||||
- CHANGELOG updated
|
||||
|
||||
Do not add major new features in this pass.
|
||||
|
||||
Deliver:
|
||||
|
||||
- bug fixes
|
||||
- consistency improvements
|
||||
- documentation corrections
|
||||
- known issues list
|
||||
@@ -0,0 +1,17 @@
|
||||
# Codex Pass 12 — V1 Vertical Slice Review
|
||||
|
||||
## Goal
|
||||
|
||||
Audit what has been built and align it with the V1 scope freeze.
|
||||
|
||||
## Tasks
|
||||
|
||||
1. Compare implementation against `docs/V1_SCOPE_FREEZE.md`.
|
||||
2. Mark features as Done/Partial/Blocked.
|
||||
3. Identify regressions or architectural drift.
|
||||
4. Create a prioritized fix list.
|
||||
5. Do not add major new features.
|
||||
|
||||
## Output
|
||||
|
||||
Use `docs/M6_FINAL_HANDOFF_TEMPLATE.md` and update `docs/TODO.md`.
|
||||
@@ -0,0 +1,23 @@
|
||||
# Codex Prompt Pack
|
||||
|
||||
Use these prompts sequentially. Do not skip `PASS_00_REPO_AUDIT.md` on a fresh checkout.
|
||||
|
||||
## Recommended order
|
||||
|
||||
1. `PASS_00_REPO_AUDIT.md`
|
||||
2. `PASS_01_BACKEND_FOUNDATION.md`
|
||||
3. `PASS_02_DATABASE_MODELS.md`
|
||||
4. `PASS_03_PROJECT_AREA_API.md`
|
||||
5. `PASS_04_DATASET_MANAGER.md`
|
||||
6. `PASS_05_RASTER_VECTOR_METADATA.md`
|
||||
7. `PASS_06_FRONTEND_SHELL.md`
|
||||
8. `PASS_07_MAP_WORKBENCH.md`
|
||||
9. `PASS_08_TEST_AND_FIXTURE_HARDENING.md`
|
||||
10. `PASS_09_DETECTION_SERVICE_SCAFFOLD.md`
|
||||
11. `PASS_10_EXPORT_PIPELINE.md`
|
||||
12. `PASS_11_QA_QC_FOUNDATION.md`
|
||||
13. `PASS_12_V1_VERTICAL_SLICE_REVIEW.md`
|
||||
|
||||
## Rule
|
||||
|
||||
Each pass must produce a handoff using `docs/M6_FINAL_HANDOFF_TEMPLATE.md`.
|
||||
@@ -0,0 +1,31 @@
|
||||
# START HERE — GeoIntel Day 1 Master Prompt
|
||||
|
||||
You are Codex working on GeoIntel Kempen.
|
||||
|
||||
GeoIntel is a GeoAI Workbench for the Belgian Kempen. It must demonstrate geospatial data engineering, raster/vector processing, AI detection readiness, QA/QC against reference data and exportable GIS outputs.
|
||||
|
||||
## Required reading before edits
|
||||
|
||||
Read:
|
||||
|
||||
- `README.md`
|
||||
- `AGENTS.md`
|
||||
- `docs/V1_SCOPE_FREEZE.md`
|
||||
- `docs/REPOSITORY_CONVENTIONS.md`
|
||||
- `docs/SERVICE_ARCHITECTURE.md`
|
||||
- `docs/15-tomorrow-execution/M8_TOMORROW_EXECUTION_PACK.md`
|
||||
- `docs/16-autonomy-governance/AUTONOMY_BOUNDARIES.md`
|
||||
- `docs/16-autonomy-governance/QUALITY_GATE_MATRIX.md`
|
||||
|
||||
## Work rules
|
||||
|
||||
- Work pass by pass.
|
||||
- Do not skip validation.
|
||||
- Do not introduce mock-only business logic.
|
||||
- Preserve contracts.
|
||||
- Update docs and logs when changes are made.
|
||||
- Stop only for red-zone decisions or impossible dependency blockers.
|
||||
|
||||
## First action
|
||||
|
||||
Run pass `01_REPO_AUDIT_AND_PLAN.md`.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Pass 01 — Repository Audit and Build Plan
|
||||
|
||||
## Goal
|
||||
|
||||
Audit the repository and produce a concrete build plan for the first implementation day. Do not implement product features in this pass.
|
||||
|
||||
## Tasks
|
||||
|
||||
1. Inspect the repo structure.
|
||||
2. Confirm required docs are present.
|
||||
3. Identify missing foundation files.
|
||||
4. Decide exact implementation sequence for the day, staying within existing docs.
|
||||
5. Update `docs/CODEX_EXECUTION_LOG.md` with the audit result.
|
||||
6. Update `docs/TODO.md` only if tasks need clearer sequencing.
|
||||
|
||||
## Validation
|
||||
|
||||
- No broken files introduced.
|
||||
- No product scope changes.
|
||||
- No dependency changes unless only adding documentation.
|
||||
|
||||
## Completion output
|
||||
|
||||
Use the standard pass completion format.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Pass 02 — Backend Foundation
|
||||
|
||||
## Goal
|
||||
|
||||
Create the minimal FastAPI backend foundation.
|
||||
|
||||
## Implement
|
||||
|
||||
- `backend/app/main.py` or equivalent app entrypoint.
|
||||
- config/settings module using environment variables.
|
||||
- health endpoint.
|
||||
- consistent response envelope.
|
||||
- structured error handling foundation.
|
||||
- backend test setup.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Health endpoint must not require database.
|
||||
- No geospatial logic in route handlers.
|
||||
- Keep service layer boundaries ready.
|
||||
- Do not add auth.
|
||||
|
||||
## Validation commands
|
||||
|
||||
Run the available backend tests/import checks. If package tooling does not exist yet, add minimal test tooling according to dependency policy.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- App imports cleanly.
|
||||
- Health endpoint returns deterministic response.
|
||||
- Tests pass for health/config.
|
||||
- Execution log updated.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Pass 03 — Database and Domain Foundation
|
||||
|
||||
## Goal
|
||||
|
||||
Add the PostGIS-ready database/domain foundation.
|
||||
|
||||
## Implement
|
||||
|
||||
- SQLAlchemy database setup.
|
||||
- Alembic migration setup.
|
||||
- Core models: Project, Area, Dataset, AnalysisRun, Export.
|
||||
- Pydantic schemas matching API contract style.
|
||||
- Geometry handling strategy ready for PostGIS.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not store geometry as arbitrary strings in final domain models.
|
||||
- If test environment cannot run PostGIS, isolate integration tests and keep unit tests safe.
|
||||
- Do not remove future raster/AI fields because V1 starts smaller.
|
||||
|
||||
## Validation
|
||||
|
||||
- Backend imports.
|
||||
- Model metadata initializes.
|
||||
- Migration command documented or executed if environment allows.
|
||||
- Unit tests pass.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- Domain model can support project -> area -> dataset -> analysis.
|
||||
- Geometry metadata and CRS are represented.
|
||||
- Execution log updated.
|
||||
@@ -0,0 +1,31 @@
|
||||
# Pass 04 — Project, Area and Dataset API
|
||||
|
||||
## Goal
|
||||
|
||||
Implement first real API slice.
|
||||
|
||||
## Implement
|
||||
|
||||
- Project create/list/read.
|
||||
- Area create/list/read for a project.
|
||||
- Dataset registration endpoint and metadata placeholder contract.
|
||||
- Validation for GeoJSON polygon areas.
|
||||
- Contract tests with fixtures.
|
||||
|
||||
## Constraints
|
||||
|
||||
- No frontend-only fake data assumptions.
|
||||
- Invalid geometry must produce structured error.
|
||||
- Dataset upload may be scaffolded, but response contracts must be stable.
|
||||
|
||||
## Validation
|
||||
|
||||
- API tests.
|
||||
- Contract fixture comparison where possible.
|
||||
- Backend import.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- A client can create a project, add an area, register a dataset and retrieve them.
|
||||
- Responses follow the documented envelope.
|
||||
- Execution log updated.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Pass 05 — Frontend Shell
|
||||
|
||||
## Goal
|
||||
|
||||
Create the GeoIntel Workbench frontend shell.
|
||||
|
||||
## Implement
|
||||
|
||||
- React + TypeScript app foundation if not present.
|
||||
- Route layout: Home, Project Workspace, Map Workbench, Dataset Manager, Raster Lab, Vector Lab, Detection Lab, QA/QC, Exports.
|
||||
- API client with typed methods for implemented backend endpoints.
|
||||
- Empty/loading/error states.
|
||||
- Environment-based API base URL.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not build a generic admin dashboard.
|
||||
- Do not hardcode success data.
|
||||
- UI must reflect GeoAI Workbench identity.
|
||||
|
||||
## Validation
|
||||
|
||||
- TypeScript check/build.
|
||||
- Frontend tests if configured.
|
||||
- Manual smoke note in execution log.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- Frontend starts/builds.
|
||||
- Navigation works.
|
||||
- API client can call health/project endpoints.
|
||||
- Execution log updated.
|
||||
@@ -0,0 +1,31 @@
|
||||
# Pass 06 — Raster and Vector Metadata Foundation
|
||||
|
||||
## Goal
|
||||
|
||||
Add first geospatial metadata services.
|
||||
|
||||
## Implement
|
||||
|
||||
- GeoJSON/vector metadata extraction using GeoPandas/Shapely where available.
|
||||
- Raster metadata service interface using Rasterio where available.
|
||||
- Controlled unavailable-state if Rasterio/GDAL is not installed.
|
||||
- Metadata endpoint connected to dataset records.
|
||||
- Fixture-driven tests.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Do not fake metadata as real processing.
|
||||
- Unsupported file types must produce controlled errors.
|
||||
- Keep CRS/bounds/resolution fields explicit.
|
||||
|
||||
## Validation
|
||||
|
||||
- Vector metadata tests pass.
|
||||
- Raster service imports or unavailable-state test passes.
|
||||
- API contract remains stable.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- Demo GeoJSON fixture returns deterministic metadata.
|
||||
- Dataset metadata can be retrieved.
|
||||
- Execution log updated.
|
||||
@@ -0,0 +1,28 @@
|
||||
# Pass 07 — Vertical Slice Stabilization
|
||||
|
||||
## Goal
|
||||
|
||||
Stabilize the first working slice and prepare for next-day AI/GIS expansion.
|
||||
|
||||
## Implement
|
||||
|
||||
- Smoke script or documented smoke command sequence.
|
||||
- Changelog entry.
|
||||
- Updated TODO checklist.
|
||||
- Known limitations section.
|
||||
- Any missing tests for touched modules.
|
||||
|
||||
## Validate
|
||||
|
||||
Run all available checks:
|
||||
|
||||
- backend tests;
|
||||
- frontend build/typecheck;
|
||||
- smoke script;
|
||||
- import checks.
|
||||
|
||||
## Acceptance
|
||||
|
||||
- Foundation can be started or limitations are clearly documented.
|
||||
- No hidden failing imports.
|
||||
- Next recommended pass is listed.
|
||||
@@ -0,0 +1,85 @@
|
||||
# Day 1 Master Prompt for Codex
|
||||
|
||||
You are implementing GeoIntel Kempen.
|
||||
|
||||
GeoIntel is a GeoAI Workbench for the Belgian Kempen. It is not a generic dashboard, chatbot, reporting tool, or QGIS clone. The core pipeline is:
|
||||
|
||||
`data → processing → geospatial output → QA/QC → export`
|
||||
|
||||
## Mandatory reading
|
||||
|
||||
Before coding, read in this order:
|
||||
|
||||
1. `CODEX_START.md`
|
||||
2. `docs/00-start/START_HERE.md`
|
||||
3. `docs/20-run-readiness/RUN_READINESS_FINAL.md`
|
||||
4. `docs/20-run-readiness/PASS_SEQUENCE_FINAL.md`
|
||||
5. `docs/governance/GEOINTEL_CONSTITUTION.md`
|
||||
6. `docs/governance/ARCHITECTURE_INVARIANTS.md`
|
||||
7. `docs/governance/FORBIDDEN_DECISIONS.md`
|
||||
8. `docs/specs/CANONICAL_DOMAIN_MODELS.md`
|
||||
9. `docs/specs/STATE_MACHINES.md`
|
||||
10. `docs/workflows/GOLDEN_PATHS.md`
|
||||
|
||||
## Your first objective
|
||||
|
||||
Start with Pass 0 and Pass 1 only unless explicitly instructed otherwise.
|
||||
|
||||
Do not begin with YOLO/SAM, LiDAR, Sentinel automation, dashboards, chat, reports, MLOps, or QGIS plugins.
|
||||
|
||||
## Pass 0
|
||||
|
||||
Audit the repo, confirm the canonical start path, run available smoke scripts, and prepare the implementation workspace.
|
||||
|
||||
## Pass 1
|
||||
|
||||
Create the backend FastAPI foundation with health endpoint, response envelope, settings structure, router structure, and import/smoke tests.
|
||||
|
||||
## Non-negotiable rules
|
||||
|
||||
- Use FastAPI for backend.
|
||||
- Use React + TypeScript for frontend.
|
||||
- Use PostgreSQL + PostGIS as the target database.
|
||||
- Use Redis + RQ for async jobs when job processing is introduced.
|
||||
- Preserve the canonical response envelope.
|
||||
- Preserve state machine names.
|
||||
- Do not introduce unapproved dependencies without documenting why.
|
||||
- Do not hardcode demo-only paths into production logic.
|
||||
- Do not hide incomplete work with TODO comments as a substitute for implementation.
|
||||
- Do not change architecture invariants.
|
||||
|
||||
## Allowed improvements
|
||||
|
||||
You may improve:
|
||||
|
||||
- file organization within documented conventions;
|
||||
- type safety;
|
||||
- tests;
|
||||
- error handling;
|
||||
- developer experience;
|
||||
- documentation clarity;
|
||||
- small helper abstractions;
|
||||
- UI consistency when frontend work begins.
|
||||
|
||||
## Required output after each pass
|
||||
|
||||
Report:
|
||||
|
||||
```text
|
||||
Pass:
|
||||
Scope completed:
|
||||
Files changed:
|
||||
Commands run:
|
||||
Tests passed:
|
||||
Tests failed:
|
||||
Golden paths affected:
|
||||
Architecture invariants touched:
|
||||
Known limitations:
|
||||
Next pass:
|
||||
```
|
||||
|
||||
## Day 1 success target
|
||||
|
||||
At minimum, Day 1 should produce a backend that imports, has health/status endpoints, has a documented config structure, and has a clear path toward domain/database implementation.
|
||||
|
||||
A strong Day 1 may also include initial database models and project/area APIs, but only if Pass 1 is stable.
|
||||
@@ -0,0 +1,16 @@
|
||||
# Pass 00 — Final Repo Audit Prompt
|
||||
|
||||
Audit the GeoIntel repo before coding.
|
||||
|
||||
Tasks:
|
||||
|
||||
1. Read `CODEX_START.md`.
|
||||
2. Read `docs/20-run-readiness/RUN_READINESS_FINAL.md`.
|
||||
3. Run:
|
||||
- `bash scripts/check_repo_structure.sh`
|
||||
- `python scripts/smoke_docs.py`
|
||||
- `python scripts/validate_fixtures.py`
|
||||
- `python scripts/preimplementation_audit.py`
|
||||
4. Identify any missing directories needed for Pass 1.
|
||||
5. Do not implement product features.
|
||||
6. Produce a pass report.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Pass 01 — Backend Foundation Final Prompt
|
||||
|
||||
Implement only the FastAPI backend foundation.
|
||||
|
||||
Required deliverables:
|
||||
|
||||
- `backend/app/main.py`
|
||||
- `backend/app/core/config.py`
|
||||
- `backend/app/api/router.py`
|
||||
- `backend/app/api/routes/health.py`
|
||||
- response envelope helper/schema
|
||||
- controlled error response helper
|
||||
- backend README update if needed
|
||||
- minimal test for import and health route
|
||||
|
||||
Rules:
|
||||
|
||||
- Do not require PostGIS to run the health endpoint.
|
||||
- Do not implement full datasets or AI yet.
|
||||
- Do not add auth.
|
||||
- Do not introduce a different backend framework.
|
||||
- Keep structure compatible with future database and services.
|
||||
|
||||
Run relevant tests and report results.
|
||||
@@ -0,0 +1,20 @@
|
||||
# Pass 02 — Domain and Database Foundation Final Prompt
|
||||
|
||||
Implement database/domain foundation after backend health is stable.
|
||||
|
||||
Required deliverables:
|
||||
|
||||
- SQLAlchemy setup;
|
||||
- Alembic setup;
|
||||
- PostGIS-compatible geometry model strategy;
|
||||
- models for Project, Area, Dataset, AnalysisRun, Detection, Metric, Export;
|
||||
- Pydantic schemas;
|
||||
- migration instructions;
|
||||
- tests for model import and schema validation.
|
||||
|
||||
Rules:
|
||||
|
||||
- Follow `CANONICAL_DOMAIN_MODELS.md`.
|
||||
- Follow `STATE_MACHINES.md`.
|
||||
- Do not store geospatial data as arbitrary JSON when a PostGIS geometry column is the correct target.
|
||||
- If local PostGIS is unavailable, provide graceful test fallback but keep production target PostGIS.
|
||||
@@ -0,0 +1,73 @@
|
||||
# Day 1 Optimized Master Prompt for Codex
|
||||
|
||||
You are working on GeoIntel Kempen, a GeoAI Workbench for the Belgian Kempen.
|
||||
|
||||
Your goal is not to redesign the product. Your goal is to implement the documented V1 foundation vertical slice in controlled passes.
|
||||
|
||||
## Mandatory reading order
|
||||
|
||||
1. `CODEX_START.md`
|
||||
2. `docs/00-start/START_HERE.md`
|
||||
3. `docs/30-codex-optimization/CODEX_OPTIMIZATION_OVERVIEW.md`
|
||||
4. `docs/30-codex-optimization/CODEX_RUN_CHECKLIST.md`
|
||||
5. `docs/30-codex-optimization/PROMPT_DISCIPLINE.md`
|
||||
6. `docs/governance/GEOINTEL_CONSTITUTION.md`
|
||||
7. `docs/governance/ARCHITECTURE_INVARIANTS.md`
|
||||
8. `docs/governance/FORBIDDEN_DECISIONS.md`
|
||||
9. `docs/20-run-readiness/PASS_SEQUENCE_FINAL.md`
|
||||
10. Active pass prompt only.
|
||||
11. Relevant skill under `skills/`.
|
||||
|
||||
## First objective
|
||||
|
||||
Build the foundation vertical slice in pass order:
|
||||
|
||||
Project → Area → Dataset metadata → Reference polygons → Predicted detections → QA/QC → GeoJSON export → Minimal UI.
|
||||
|
||||
## Strict boundaries
|
||||
|
||||
Do not implement:
|
||||
|
||||
- heavy AI inference before the service contracts exist;
|
||||
- LiDAR processing;
|
||||
- model training;
|
||||
- MLOps;
|
||||
- QGIS plugin;
|
||||
- advanced report generation;
|
||||
- unrelated dashboards;
|
||||
- new frameworks not approved by ADR.
|
||||
|
||||
## Execution rules
|
||||
|
||||
- Work one pass at a time.
|
||||
- Keep changes small and coherent.
|
||||
- Use the relevant skill.
|
||||
- Respect API/database contracts.
|
||||
- Do not create permanent mock-only flows.
|
||||
- Use fixtures only where documented.
|
||||
- Run `make readiness` before and after major changes when possible.
|
||||
- Update `docs/CODEX_EXECUTION_LOG.md` and `CHANGELOG.md`.
|
||||
|
||||
## Required final report
|
||||
|
||||
End every pass with:
|
||||
|
||||
```md
|
||||
## Completed
|
||||
|
||||
## Changed files
|
||||
|
||||
## Commands run
|
||||
|
||||
## Test results
|
||||
|
||||
## Self-review scorecard
|
||||
|
||||
## Known limitations
|
||||
|
||||
## Contract deviations
|
||||
|
||||
## Next recommended pass
|
||||
```
|
||||
|
||||
If a blocker appears, stop and report it instead of guessing.
|
||||
@@ -0,0 +1,40 @@
|
||||
# Parallel Agent Coordination Prompt
|
||||
|
||||
Use this when running multiple Codex agents in separate worktrees.
|
||||
|
||||
You are one agent working on GeoIntel Kempen.
|
||||
|
||||
## Your assigned track
|
||||
|
||||
Set one:
|
||||
|
||||
- Backend foundation
|
||||
- Frontend shell
|
||||
- Fixtures/tests
|
||||
- Documentation/control layer
|
||||
- QA/QC engine
|
||||
|
||||
## Mandatory rules
|
||||
|
||||
- Read `docs/30-codex-optimization/PARALLEL_AGENT_STRATEGY.md`.
|
||||
- Stay inside the allowed paths for your track.
|
||||
- Do not change contracts owned by another track unless explicitly assigned.
|
||||
- Report merge risks.
|
||||
- Avoid broad formatting changes.
|
||||
- Keep commits/diffs isolated.
|
||||
|
||||
## Required final report
|
||||
|
||||
```md
|
||||
## Track
|
||||
|
||||
## Files changed
|
||||
|
||||
## Contracts touched
|
||||
|
||||
## Tests run
|
||||
|
||||
## Merge risks
|
||||
|
||||
## Needed from other tracks
|
||||
```
|
||||
@@ -0,0 +1,48 @@
|
||||
# Pass Completion Report Prompt
|
||||
|
||||
Use this at the end of every Codex implementation pass.
|
||||
|
||||
Produce a concise but complete report with:
|
||||
|
||||
## Completed
|
||||
|
||||
List what was actually implemented.
|
||||
|
||||
## Changed files
|
||||
|
||||
List each changed file and why it changed.
|
||||
|
||||
## Commands run
|
||||
|
||||
List commands and exact result status.
|
||||
|
||||
## Test results
|
||||
|
||||
Mention pass/fail/skipped and why.
|
||||
|
||||
## Self-review scorecard
|
||||
|
||||
Score 0-10:
|
||||
|
||||
- Scope control:
|
||||
- Architecture consistency:
|
||||
- Backend correctness:
|
||||
- Frontend correctness:
|
||||
- GIS correctness:
|
||||
- AI/ML correctness:
|
||||
- QA/QC correctness:
|
||||
- Tests:
|
||||
- Documentation:
|
||||
- Release readiness:
|
||||
|
||||
## Known limitations
|
||||
|
||||
List real limitations. Do not hide TODOs.
|
||||
|
||||
## Contract deviations
|
||||
|
||||
State explicitly whether any API, DB, storage, CRS, state machine or governance contract changed.
|
||||
|
||||
## Next recommended pass
|
||||
|
||||
Name the next pass and why.
|
||||
@@ -0,0 +1,99 @@
|
||||
# CODEX FIRST DAY MASTER PROMPT — M14 BUILD LAUNCH
|
||||
|
||||
You are implementing GeoIntel Kempen.
|
||||
|
||||
GeoIntel is a GeoAI Workbench for the Belgian Kempen. It is not a generic dashboard, chatbot, QGIS clone or report-only app. The product kernel is:
|
||||
|
||||
```text
|
||||
data -> processing -> geospatial output -> QA/QC -> export
|
||||
```
|
||||
|
||||
## Mandatory read order before coding
|
||||
|
||||
1. `CODEX_START.md`
|
||||
2. `docs/00-start/START_HERE.md`
|
||||
3. `docs/governance/GEOINTEL_CONSTITUTION.md`
|
||||
4. `docs/governance/ARCHITECTURE_INVARIANTS.md`
|
||||
5. `docs/governance/FORBIDDEN_DECISIONS.md`
|
||||
6. `docs/40-build-launch/SPRINT_1_SCOPE_FREEZE.md`
|
||||
7. `docs/40-build-launch/BUILD_SUCCESS_DEFINITION.md`
|
||||
8. `docs/40-build-launch/BUILD_ORDER_GRAPH.md`
|
||||
9. `docs/40-build-launch/CODEX_STOP_RULES.md`
|
||||
10. `docs/40-build-launch/MODULE_ACCEPTANCE_CRITERIA.md`
|
||||
11. `docs/specs/GIS_STANDARDS.md`
|
||||
12. `docs/specs/STATE_MACHINES.md`
|
||||
13. `docs/30-codex-optimization/PROMPT_DISCIPLINE.md`
|
||||
|
||||
## First implementation mission
|
||||
|
||||
Build Sprint 1 only.
|
||||
|
||||
Sprint 1 goal:
|
||||
|
||||
```text
|
||||
Project -> Area -> Dataset upload/registration -> Metadata extraction -> PostGIS persistence -> Minimal map display -> GeoJSON export baseline
|
||||
```
|
||||
|
||||
## Build exactly this first
|
||||
|
||||
1. Backend foundation.
|
||||
2. Database/PostGIS foundation.
|
||||
3. Project API.
|
||||
4. Area API.
|
||||
5. Dataset API for GeoJSON.
|
||||
6. Storage service.
|
||||
7. Metadata extraction for GeoJSON.
|
||||
8. Frontend shell.
|
||||
9. MapLibre map.
|
||||
10. Minimal dataset/area UI.
|
||||
11. Readiness/smoke tests.
|
||||
|
||||
## Do not build yet
|
||||
|
||||
- YOLO live inference.
|
||||
- SAM live segmentation.
|
||||
- GRB live WFS.
|
||||
- Sentinel automation.
|
||||
- LiDAR.
|
||||
- Training Studio.
|
||||
- AI Copilot.
|
||||
- Full report generator.
|
||||
- Multi-user auth.
|
||||
|
||||
If you encounter a task that belongs to a later module, add it to backlog/open issues and continue Sprint 1.
|
||||
|
||||
## Quality rules
|
||||
|
||||
- Do not introduce undocumented technologies.
|
||||
- Do not commit secrets.
|
||||
- Do not hardcode machine-specific paths.
|
||||
- Do not use permanent mock data.
|
||||
- Golden fixtures are allowed for tests and initial UI development.
|
||||
- Keep API responses canonical.
|
||||
- Keep geometry rules consistent with GIS standards.
|
||||
- Add tests/smoke checks where practical.
|
||||
- Update docs/status/changelog when behavior changes.
|
||||
|
||||
## Stop rules
|
||||
|
||||
Stop and report instead of continuing if:
|
||||
|
||||
- build breaks;
|
||||
- tests fail and cannot be fixed within the active scope;
|
||||
- architecture invariant would be violated;
|
||||
- API contract conflict appears;
|
||||
- a new dependency seems required but is not in ADRs;
|
||||
- Sprint 1 scope would be exceeded.
|
||||
|
||||
## Required final response after implementation pass
|
||||
|
||||
Report:
|
||||
|
||||
- files changed;
|
||||
- implementation summary;
|
||||
- commands run;
|
||||
- test results;
|
||||
- known limitations;
|
||||
- architecture invariants touched or confirmed untouched;
|
||||
- out-of-scope items deferred;
|
||||
- next recommended pass.
|
||||
@@ -0,0 +1,40 @@
|
||||
# Codex Module Contract — Detection Boundary
|
||||
|
||||
Build the detection architecture so real YOLO can be added safely, but V1 may use deterministic fixture mode first.
|
||||
|
||||
## Required Concepts
|
||||
|
||||
- model registry entry
|
||||
- analysis run
|
||||
- detection result
|
||||
- output layer
|
||||
- model mode: `fixture`, `stub`, `real`
|
||||
|
||||
## Required Backend
|
||||
|
||||
- detection service interface
|
||||
- fixture detection provider
|
||||
- analysis run persistence
|
||||
- detection persistence
|
||||
- GeoJSON export of detections
|
||||
|
||||
## Required Frontend
|
||||
|
||||
- detection run form
|
||||
- model selector
|
||||
- confidence threshold
|
||||
- mode indicator
|
||||
- results table
|
||||
- map overlay
|
||||
|
||||
## Required Tests
|
||||
|
||||
- fixture detection produces stable number of detections
|
||||
- output includes class, confidence and geometry
|
||||
- response clearly states mode
|
||||
|
||||
## Forbidden
|
||||
|
||||
- fake real model claims
|
||||
- silent fallback from real to fixture
|
||||
- detections without geospatial provenance
|
||||
@@ -0,0 +1,43 @@
|
||||
# Codex Module Contract — Project, Area, Dataset
|
||||
|
||||
Build only the project, area and dataset foundation.
|
||||
|
||||
## Required Backend
|
||||
|
||||
- `GET /projects`
|
||||
- `POST /projects`
|
||||
- `GET /projects/{project_id}`
|
||||
- `POST /projects/{project_id}/areas`
|
||||
- `GET /projects/{project_id}/areas`
|
||||
- `POST /projects/{project_id}/datasets/upload`
|
||||
- `GET /projects/{project_id}/datasets`
|
||||
|
||||
## Required Frontend
|
||||
|
||||
- project list
|
||||
- create project form
|
||||
- project workspace
|
||||
- area list
|
||||
- dataset list
|
||||
- upload form
|
||||
|
||||
## Required Validation
|
||||
|
||||
- project name required
|
||||
- area geometry required and valid
|
||||
- dataset file required
|
||||
- unsupported file types rejected with structured error
|
||||
|
||||
## Required Tests
|
||||
|
||||
- create/list/read project
|
||||
- create/list area using fixture polygon
|
||||
- dataset upload stores metadata record
|
||||
|
||||
## Do Not Build Yet
|
||||
|
||||
- real YOLO
|
||||
- real SAM
|
||||
- Sentinel
|
||||
- LiDAR
|
||||
- training studio
|
||||
@@ -0,0 +1,52 @@
|
||||
# Codex Module Contract — QA/QC Foundation
|
||||
|
||||
Build deterministic QA/QC using fixture GeoJSON files before real AI integration.
|
||||
|
||||
## Input
|
||||
|
||||
- predicted polygon layer
|
||||
- reference polygon layer
|
||||
- IoU threshold, default 0.5
|
||||
|
||||
## Required Metrics
|
||||
|
||||
- true positives
|
||||
- false positives
|
||||
- false negatives
|
||||
- precision
|
||||
- recall
|
||||
- f1
|
||||
- mean_iou for matched pairs
|
||||
|
||||
## Required Outputs
|
||||
|
||||
- summary metrics JSON
|
||||
- matched pairs list
|
||||
- false positives GeoJSON
|
||||
- false negatives GeoJSON
|
||||
|
||||
## Required Backend
|
||||
|
||||
- QA service with pure functions
|
||||
- API endpoint to run QA for two stored layers or fixture mode
|
||||
- persisted quality_check record
|
||||
|
||||
## Required Frontend
|
||||
|
||||
- QA run form
|
||||
- threshold input
|
||||
- metrics cards
|
||||
- map layers for FP/FN
|
||||
- explanation of IoU threshold
|
||||
|
||||
## Required Tests
|
||||
|
||||
- golden fixture test with deterministic counts
|
||||
- zero denominator test
|
||||
- invalid geometry test
|
||||
|
||||
## Forbidden
|
||||
|
||||
- presenting confidence as accuracy
|
||||
- changing IoU formula
|
||||
- computing area in EPSG:4326 degrees
|
||||
@@ -0,0 +1,26 @@
|
||||
# Contract Drift Audit Prompt
|
||||
|
||||
```text
|
||||
Audit GeoIntel for contract drift.
|
||||
|
||||
Compare implementation against:
|
||||
- contracts/api/
|
||||
- docs/API_SPECIFICATION.md
|
||||
- docs/API_CONTRACTS.md
|
||||
- docs/DATABASE_SCHEMA.md
|
||||
- docs/13-implementation-traps/API_RESPONSE_RULES.md
|
||||
|
||||
Find mismatches in:
|
||||
- endpoint paths
|
||||
- HTTP methods
|
||||
- request fields
|
||||
- response envelopes
|
||||
- error shape
|
||||
- status enum
|
||||
- date/timestamp fields
|
||||
- geometry fields
|
||||
- frontend TypeScript types
|
||||
- test expectations
|
||||
|
||||
Fix safe mismatches by aligning implementation to existing contracts. If the contract itself is clearly incomplete, update docs and explain why in CHANGELOG.md.
|
||||
```
|
||||
@@ -0,0 +1,29 @@
|
||||
# End-of-Pass Review Prompt
|
||||
|
||||
Use this prompt at the end of every Codex implementation pass.
|
||||
|
||||
```text
|
||||
You are reviewing your own GeoIntel implementation pass.
|
||||
|
||||
Do not add new features during this review. Inspect the changed files, run available checks, and produce fixes only for issues introduced by this pass.
|
||||
|
||||
Review against:
|
||||
- docs/12-build-control/M7_IMPLEMENTATION_CONTROL_LAYER.md
|
||||
- docs/11-quality/SELF_REVIEW_CHECKLIST.md
|
||||
- docs/11-quality/REGRESSION_TRAPS.md
|
||||
- docs/13-implementation-traps/GEOSPATIAL_CALCULATION_RULES.md
|
||||
- docs/13-implementation-traps/API_RESPONSE_RULES.md
|
||||
- docs/12-build-control/CODEX_DECISION_BOUNDARIES.md
|
||||
|
||||
Tasks:
|
||||
1. Summarize changed files.
|
||||
2. Identify contract drift.
|
||||
3. Identify missing tests.
|
||||
4. Identify geospatial correctness risks.
|
||||
5. Identify UI state gaps.
|
||||
6. Fix safe issues immediately.
|
||||
7. Update CHANGELOG.md and docs/BUILD_STATUS.md.
|
||||
8. List remaining risks and the next recommended pass.
|
||||
|
||||
Do not hide failures. If a test cannot run, document why and what command should be run later.
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
# Regression Hunt Prompt
|
||||
|
||||
```text
|
||||
Perform a regression hunt on GeoIntel.
|
||||
|
||||
Focus only on regressions, inconsistencies and broken contracts. Do not add new features.
|
||||
|
||||
Check:
|
||||
- API contracts versus implementation
|
||||
- database schema versus docs
|
||||
- frontend API client versus backend responses
|
||||
- status enums
|
||||
- CRS and geometry handling
|
||||
- fixture validity
|
||||
- QA/QC formula implementation
|
||||
- scripts and smoke tests
|
||||
- documentation truthfulness
|
||||
|
||||
For every issue found:
|
||||
- describe the issue
|
||||
- identify files affected
|
||||
- fix it if safe
|
||||
- otherwise add it to docs/BUILD_STATUS.md as an explicit known issue
|
||||
|
||||
End with:
|
||||
- tests run
|
||||
- tests not run
|
||||
- confidence level
|
||||
- recommended next pass
|
||||
```
|
||||
Reference in New Issue
Block a user