module Web.View.StaticPages.Tutorial where import Web.View.Prelude data TutorialView = TutorialView instance View TutorialView where html TutorialView = [hsx|
← Home

Developer Tutorial

How IHF works from a developer perspective — widget lifecycle, governance flow, outcome loop.

{-- Step 1: Hubs and Widgets --}

{stepBadge "1"} Hubs and Widgets

A Hub is a bounded domain of responsibility (e.g. Dev Hub, Ops Hub, Fin Hub). Hubs own Widgets — the smallest semantically governable interaction unit. Each widget has a widget_id (stable UUID), a widget_type (from the registry), and a version history.

-- Every rendered widget wraps its HSX in widgetEnvelope
{"widgetEnvelope widgetId viewContext [hsx|...|]" :: Text}

The envelope injects data-widget-id and data-view-context attributes, enabling client-side event capture without coupling to implementation.

{-- Step 2: Interaction Events --}

{stepBadge "2"} Interaction Events

When a user or agent interacts with a widget, an InteractionEvent is recorded — clicked, viewed, submitted, dismissed, etc. Events are append-only: a PostgreSQL trigger prevents UPDATE and DELETE on the interaction_events table.

POST /api/v1/interaction-events
POST /api/v2/interaction-events

Events flow into Annotations (human/agent commentary with category) and eventually surface as RequirementCandidates.

{-- Step 3: Governance flow --}

{stepBadge "3"} Governance Flow

RequirementCandidates go through a triage lifecycle: open → triaged → reviewed → promoted or dismissed. Phase 5 agents can draft Requirements from widget clusters using the Anthropic API. Promoted candidates become Requirements, which are linked to DecisionRecords.

{flowBox "RequirementCandidate" "open · triaged · reviewed"} {arrow_} {flowBox "Requirement" "linked to Decision"} {arrow_} {flowBox "DecisionRecord" "policy refs · impl refs"}
{-- Step 4: Deployment and outcomes --}

{stepBadge "4"} Deployment and Outcomes

A DecisionRecord links to a DeploymentRecord. After deployment, OutcomeSignals are recorded (also append-only) and evaluated via ChangeEvaluations. Outcome feedback flows back to the DecisionRecord, closing the governance loop.

{-- Step 5: Learning --}

{stepBadge "5"} Continuous Learning (Phase 12)

Phase 12 layers a learning engine on top of the governance loop:

{-- Step 6: Hub federation --}

{stepBadge "6"} Hub Federation

Multiple hubs interact via routing rules, stewardship roles, and federated policy overlays. Cross-hub propagation patterns are detected automatically. The GAAF compliance layer enforces type registry discipline and contract stability across hub boundaries.

Build a domain hub extension → Full Capabilities → Management UI →
|] where stepBadge n = [hsx| {n :: Text} |] flowBox label_ sub_ = [hsx|
{label_ :: Text}
{sub_ :: Text}
|] arrow_ = [hsx|
|]