generated from coulomb/repo-seed
feat(WP-0009): IHF GAAF Compliance Foundation — type registries, extension manifests, architectural contracts
Some checks failed
Test / test (push) Has been cancelled
Some checks failed
Test / test (push) Has been cancelled
Implements IHUB-WP-0009: closes four GAAF-2026 gaps before domain hub work begins. - TypeRegistry helper + controllers/views (hub_kind, hub_capability_manifest) - HubCapabilityManifest entity with validation and registry linkage - ARCHITECTURE-LAYERS.md + CI-enforced boundary contracts - Alembic migration 1743724800, fitness tests (Test/Architecture/) - GAAF spec, Operational Architecture spec, domain hub extension guide - Updates to CLAUDE.md, SCOPE.md, Schema.sql, Routes, FrontController, Types state_hub_sync: pending (tunnel was STALE at completion time; run fix-consistency) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import Generated.Types
|
||||
import IHP.Prelude
|
||||
import IHP.ControllerPrelude
|
||||
import Application.Helper.RoutingEngine (applyRoutingRules)
|
||||
import Application.Helper.TypeRegistry (validateWidgetType, validateAnnotationCategory)
|
||||
|
||||
instance Controller HubRoutingRulesController where
|
||||
beforeAction = ensureIsUser
|
||||
@@ -33,10 +34,16 @@ instance Controller HubRoutingRulesController where
|
||||
action CreateHubRoutingRuleAction = do
|
||||
let rule = newRecord @HubRoutingRule
|
||||
hubs <- query @Hub |> orderByAsc #name |> fetch
|
||||
mMatchWidgetType <- paramOrNothing @Text "matchWidgetType"
|
||||
mMatchCategory <- paramOrNothing @Text "matchCategory"
|
||||
wtResult <- case mMatchWidgetType of { Nothing -> pure (Right ()); Just "" -> pure (Right ()); Just t -> liftIO (validateWidgetType t) }
|
||||
catResult <- case mMatchCategory of { Nothing -> pure (Right ()); Just "" -> pure (Right ()); Just c -> liftIO (validateAnnotationCategory c) }
|
||||
rule
|
||||
|> fill @'["sourceHubId","targetHubId","matchCategory","matchWidgetType","priority","notes"]
|
||||
|> validateField #sourceHubId nonEmpty
|
||||
|> validateField #targetHubId nonEmpty
|
||||
|> (case wtResult of { Left msg -> attachFailure #matchWidgetType msg; Right () -> id })
|
||||
|> (case catResult of { Left msg -> attachFailure #matchCategory msg; Right () -> id })
|
||||
|> ifValid \case
|
||||
Left r -> render NewView { rule = r, hubs }
|
||||
Right r -> do
|
||||
@@ -52,8 +59,14 @@ instance Controller HubRoutingRulesController where
|
||||
action UpdateHubRoutingRuleAction { hubRoutingRuleId } = do
|
||||
rule <- fetch hubRoutingRuleId
|
||||
hubs <- query @Hub |> orderByAsc #name |> fetch
|
||||
mMatchWidgetType <- paramOrNothing @Text "matchWidgetType"
|
||||
mMatchCategory <- paramOrNothing @Text "matchCategory"
|
||||
wtResult <- case mMatchWidgetType of { Nothing -> pure (Right ()); Just "" -> pure (Right ()); Just t -> liftIO (validateWidgetType t) }
|
||||
catResult <- case mMatchCategory of { Nothing -> pure (Right ()); Just "" -> pure (Right ()); Just c -> liftIO (validateAnnotationCategory c) }
|
||||
rule
|
||||
|> fill @'["matchCategory","matchWidgetType","priority","notes"]
|
||||
|> (case wtResult of { Left msg -> attachFailure #matchWidgetType msg; Right () -> id })
|
||||
|> (case catResult of { Left msg -> attachFailure #matchCategory msg; Right () -> id })
|
||||
|> ifValid \case
|
||||
Left r -> render EditView { rule = r, hubs }
|
||||
Right r -> do
|
||||
|
||||
Reference in New Issue
Block a user