fix(WP-0014): pre-flight compilation fixes, Tailwind pipeline, and admin seed

A2 — Compilation fixes:
- Remove inline FK constraints from Schema.sql; IHP schema compiler cannot
  parse them. Add 1744329600-restore-fk-constraints.sql migration to restore
  referential integrity at the DB level.
- Rename `#label` → `#label_` throughout to avoid clash with Haskell built-in.
- Fix `hub.id == hid` UUID comparisons to use `toUUID hub.id`.
- Replace non-existent `setStatus`/`respondJson` calls with
  `renderJsonWithStatusCode` throughout Api controllers.
- Fix qualified package import for `cryptohash-sha256` in Auth.hs.
- Add `CanSelect (Text, Text)` instance in Helper.View.
- Refactor HSX inline lambdas to named helper functions in 100+ views
  (GHC cannot infer types for anonymous functions inside quasi-quoted HSX).
- Fix missing imports (IHP.QueryBuilder, IHP.Fetch, Web.Routes, Only, etc.)
  across helpers and controllers.
- Remove duplicate `diffUTCTime` definition in BottleneckDetector.
- Change `createEventForHub` return type from `IO ResponseReceived` to `IO ()`.
- Seed type-registry vocabulary via 1744502400-seed-type-registries.sql
  (moved from Schema.sql where IHP does not execute INSERT statements).

A3 — Tailwind build pipeline:
- Add `tailwindcss` to flake.nix native packages.
- Uncomment `tailwind.exec` process in devenv shell config.
- Add tailwind/tailwind.config.js (scans Web/View/**/*.hs).
- Add tailwind/app.css with @tailwind directives.

A4 — Admin user seed:
- Add 1744416000-seed-admin-user.sql: inserts admin@inter-hub.local
  with bcrypt-hashed password admin1234! (cost 10).
- Add .env.example documenting all required environment variables
  and default admin credentials.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-04 09:55:12 +00:00
parent ffd5fbb900
commit f1978c3888
147 changed files with 2710 additions and 2075 deletions

View File

@@ -88,7 +88,7 @@ instance CanRoute ApiV2WidgetsController where
instance HasPath ApiV2WidgetsController where
pathTo ApiV2IndexWidgetsAction = "/api/v2/widgets"
pathTo ApiV2ShowWidgetAction { widgetId } = "/api/v2/widgets/" <> show widgetId
pathTo ApiV2ShowWidgetAction { widgetId } = "/api/v2/widgets/" <> tshow widgetId
instance CanRoute ApiV2InteractionEventsController where
parseRoute' = do
@@ -101,7 +101,7 @@ instance CanRoute ApiV2InteractionEventsController where
instance HasPath ApiV2InteractionEventsController where
pathTo ApiV2IndexInteractionEventsAction = "/api/v2/interaction-events"
pathTo ApiV2ShowInteractionEventAction { interactionEventId } = "/api/v2/interaction-events/" <> show interactionEventId
pathTo ApiV2ShowInteractionEventAction { interactionEventId } = "/api/v2/interaction-events/" <> tshow interactionEventId
pathTo ApiV2CreateInteractionEventAction = "/api/v2/interaction-events"
instance CanRoute ApiV2AnnotationsController where
@@ -115,7 +115,7 @@ instance CanRoute ApiV2AnnotationsController where
instance HasPath ApiV2AnnotationsController where
pathTo ApiV2IndexAnnotationsAction = "/api/v2/annotations"
pathTo ApiV2ShowAnnotationAction { annotationId } = "/api/v2/annotations/" <> show annotationId
pathTo ApiV2ShowAnnotationAction { annotationId } = "/api/v2/annotations/" <> tshow annotationId
pathTo ApiV2CreateAnnotationAction = "/api/v2/annotations"
instance CanRoute ApiV2RequirementCandidatesController where
@@ -129,7 +129,7 @@ instance CanRoute ApiV2RequirementCandidatesController where
instance HasPath ApiV2RequirementCandidatesController where
pathTo ApiV2IndexRequirementCandidatesAction = "/api/v2/requirement-candidates"
pathTo ApiV2ShowRequirementCandidateAction { requirementCandidateId } = "/api/v2/requirement-candidates/" <> show requirementCandidateId
pathTo ApiV2ShowRequirementCandidateAction { requirementCandidateId } = "/api/v2/requirement-candidates/" <> tshow requirementCandidateId
instance CanRoute ApiV2DecisionRecordsController where
parseRoute' = do
@@ -142,7 +142,7 @@ instance CanRoute ApiV2DecisionRecordsController where
instance HasPath ApiV2DecisionRecordsController where
pathTo ApiV2IndexDecisionRecordsAction = "/api/v2/decision-records"
pathTo ApiV2ShowDecisionRecordAction { decisionRecordId } = "/api/v2/decision-records/" <> show decisionRecordId
pathTo ApiV2ShowDecisionRecordAction { decisionRecordId } = "/api/v2/decision-records/" <> tshow decisionRecordId
instance CanRoute ApiV2DeploymentRecordsController where
parseRoute' = do
@@ -155,7 +155,7 @@ instance CanRoute ApiV2DeploymentRecordsController where
instance HasPath ApiV2DeploymentRecordsController where
pathTo ApiV2IndexDeploymentRecordsAction = "/api/v2/deployment-records"
pathTo ApiV2ShowDeploymentRecordAction { deploymentRecordId } = "/api/v2/deployment-records/" <> show deploymentRecordId
pathTo ApiV2ShowDeploymentRecordAction { deploymentRecordId } = "/api/v2/deployment-records/" <> tshow deploymentRecordId
instance CanRoute ApiV2OutcomeSignalsController where
parseRoute' = do
@@ -168,7 +168,7 @@ instance CanRoute ApiV2OutcomeSignalsController where
instance HasPath ApiV2OutcomeSignalsController where
pathTo ApiV2IndexOutcomeSignalsAction = "/api/v2/outcome-signals"
pathTo ApiV2ShowOutcomeSignalAction { outcomeSignalId } = "/api/v2/outcome-signals/" <> show outcomeSignalId
pathTo ApiV2ShowOutcomeSignalAction { outcomeSignalId } = "/api/v2/outcome-signals/" <> tshow outcomeSignalId
instance CanRoute ApiV2RegistriesController where
parseRoute' = do
@@ -240,7 +240,7 @@ instance CanRoute ApiV2HubRegistryController where
instance HasPath ApiV2HubRegistryController where
pathTo ApiV2IndexHubRegistryAction = "/api/v2/hub-registry"
pathTo ApiV2ShowHubRegistryAction { hubId } = "/api/v2/hub-registry/" <> show hubId
pathTo ApiV2ShowHubRegistryAction { hubId } = "/api/v2/hub-registry/" <> tshow hubId
instance CanRoute ApiV2WidgetPatternsController where
parseRoute' = do
@@ -258,8 +258,8 @@ instance CanRoute ApiV2WidgetPatternsController where
instance HasPath ApiV2WidgetPatternsController where
pathTo ApiV2IndexWidgetPatternsAction = "/api/v2/widget-patterns"
pathTo ApiV2ShowWidgetPatternAction { widgetPatternId } = "/api/v2/widget-patterns/" <> show widgetPatternId
pathTo ApiV2AdoptWidgetPatternAction { widgetPatternId } = "/api/v2/widget-patterns/" <> show widgetPatternId <> "/adopt"
pathTo ApiV2ShowWidgetPatternAction { widgetPatternId } = "/api/v2/widget-patterns/" <> tshow widgetPatternId
pathTo ApiV2AdoptWidgetPatternAction { widgetPatternId } = "/api/v2/widget-patterns/" <> tshow widgetPatternId <> "/adopt"
-- Phase 11 — Advanced AI Federation (IHUB-WP-0012)
instance AutoRoute AgentRegistrationsController
@@ -296,7 +296,7 @@ instance HasPath ApiV2LearningController where
pathTo ApiV2IndexOutcomeCorrelationsAction = "/api/v2/outcome-correlations"
pathTo ApiV2IndexPatternPerformanceAction = "/api/v2/pattern-performance"
pathTo ApiV2IndexKnowledgeBaseAction = "/api/v2/knowledge-base"
pathTo ApiV2ShowKnowledgeBaseAction { knowledgeEntryId } = "/api/v2/knowledge-base/" <> show knowledgeEntryId
pathTo ApiV2ShowKnowledgeBaseAction { knowledgeEntryId } = "/api/v2/knowledge-base/" <> tshow knowledgeEntryId
-- Sessions
instance AutoRoute SessionsController