feat(T02-T11): IHF Phase 1 schema, controllers, views, and helpers
- Schema: hubs, widgets, widget_versions, interaction_events (append-only
trigger), annotations, users — single migration file
- Web layer: Types, Routes, FrontController with auth + AutoRefresh layout
- Controllers: Hubs (CRUD), Widgets (CRUD + versioning), InteractionEvents
(JSON capture, canonical event_type validation), Annotations (threaded,
append-only)
- Sessions controller for IHP auth
- Views: Hubs (index/show/new/edit), Widgets (index/show/new/edit),
Annotations (index/new), Sessions (login)
- widgetEnvelope helper with full data-* governance attributes
- Integration tests: Hub CRUD, Widget versioning, event capture, append-only
guard, annotation threading, validation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:42:43 +00:00
|
|
|
module Web.Routes where
|
|
|
|
|
|
|
|
|
|
import IHP.RouterPrelude
|
|
|
|
|
import Generated.Types
|
|
|
|
|
import Web.Types
|
|
|
|
|
|
|
|
|
|
-- Hubs
|
|
|
|
|
instance AutoRoute HubsController
|
|
|
|
|
|
|
|
|
|
-- Widgets
|
|
|
|
|
instance AutoRoute WidgetsController
|
|
|
|
|
|
|
|
|
|
-- Interaction Events (POST /widgets/:widgetId/events)
|
|
|
|
|
instance AutoRoute InteractionEventsController
|
|
|
|
|
|
|
|
|
|
-- Annotations (scoped to widget: /widgets/:widgetId/annotations/)
|
|
|
|
|
instance AutoRoute AnnotationsController
|
|
|
|
|
|
feat(P2+P3): IHF Phase 2 complete; register Phase 3 workplan
Phase 2 — Structured Feedback and Triage (IHUB-WP-0002):
- Schema: annotation_threads, requirement_candidates, triage_states,
reviewer_assignments; annotations extended with severity + thread_id
- AnnotationThreadsController: create threads, assign annotations
- RequirementCandidatesController: CRUD, escalation, triage lifecycle,
reviewer assignment, my-queue
- Annotation severity (low/medium/high/critical) with Tailwind color cues
- TriageDashboardAction on HubsController with autoRefresh
- Integration tests (T01–T09), SCOPE.md updated, docs/phase2-summary.md
Phase 3 — Governance and Decision Linkage (IHUB-WP-0003):
- Workplan registered: 9 tasks, State Hub workstream 5f201ee3
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-28 23:37:34 +00:00
|
|
|
-- Annotation Threads (scoped to widget)
|
|
|
|
|
instance AutoRoute AnnotationThreadsController
|
|
|
|
|
|
|
|
|
|
-- Requirement Candidates
|
|
|
|
|
instance AutoRoute RequirementCandidatesController
|
|
|
|
|
|
2026-03-29 10:38:50 +00:00
|
|
|
-- Requirements (Phase 3)
|
|
|
|
|
instance AutoRoute RequirementsController
|
|
|
|
|
|
|
|
|
|
-- Decision Records (Phase 3)
|
|
|
|
|
instance AutoRoute DecisionRecordsController
|
|
|
|
|
|
2026-03-29 12:27:30 +00:00
|
|
|
-- Deployment Records (Phase 4)
|
|
|
|
|
instance AutoRoute DeploymentRecordsController
|
|
|
|
|
|
feat(P5): IHF Phase 5 complete — agent-assisted distillation
Adds bounded AI support to the IHF governance loop. All AI outputs are
attributed (model_ref), reviewable (AgentReviewRecord), and reversible.
No autonomous decisions; no silent requirement promotion.
- T01: Schema — agent_proposals, agent_review_records,
confidence_annotations (migration 1743379200)
- T02: AgentProposalsController (index/show/accept/reject, idempotent
review guard), global nav "Agent" link
- T03: SummarizeClusterAction — Claude API cluster summary on widget show
- T04: DraftRequirementAction — AI requirement draft; acceptance creates
RequirementCandidate (human-gated)
- T05: DetectDuplicatesAction — duplicate_flag proposal on candidate show
- T06: DetectPolicySensitivityAction — policy_flag with
ConfidenceAnnotations per concern scope
- T07: ProposeImplementationAction — impl_proposal from decision show
- T08: AgentAuditDashboardAction — autoRefresh; KPI row, unreviewed queue,
recent proposals, attribution log matrix
- T09: integration tests, SCOPE.md updated, phase5-summary.md, flake.nix
adds http-conduit/aeson/string-conversions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 15:54:33 +00:00
|
|
|
-- Agent Proposals (Phase 5)
|
|
|
|
|
instance AutoRoute AgentProposalsController
|
|
|
|
|
|
2026-03-29 21:03:00 +00:00
|
|
|
-- Phase 6 — Cross-Framework UI Adaptation
|
2026-03-29 21:11:03 +00:00
|
|
|
|
|
|
|
|
-- API endpoint: POST /api/v1/interaction-events
|
|
|
|
|
instance CanRoute ApiInteractionEventsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api"
|
|
|
|
|
_ <- string "/v1"
|
|
|
|
|
_ <- string "/interaction-events"
|
|
|
|
|
endOfInput
|
|
|
|
|
pure CreateApiInteractionEventAction
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiInteractionEventsController where
|
|
|
|
|
pathTo CreateApiInteractionEventAction = "/api/v1/interaction-events"
|
|
|
|
|
|
2026-03-29 21:03:00 +00:00
|
|
|
instance AutoRoute EnvelopeEmissionContractsController
|
|
|
|
|
instance AutoRoute InteractionReportingContractsController
|
|
|
|
|
instance AutoRoute WidgetAdapterSpecsController
|
|
|
|
|
|
feat(P7): IHF Phase 7 complete — advanced observability and operational integration
T01 schema: friction_scores, bottleneck_records, hub_health_snapshots,
cross_hub_propagations + migration 1743552000.
T02 Widget Pain Heatmap: computeFrictionScore (formula documented), RecomputeFriction
action, colour-coded grid view (green/yellow/amber/red).
T03 Workflow Bottleneck Analysis: detectBottlenecks across 4 pipeline stages
(candidate 30d, requirement 60d, decision 30d, observation 14d), idempotent,
severity from age ratio, resolve action.
T04 Hub Health Correlation: computeHubHealth (deduction table documented),
append-only HubHealthSnapshot, health history view, badge on hub Show page.
T05 Cross-Hub Propagation: annotation_cluster + widget_type_friction heuristics,
idempotent detection, acknowledge/resolve lifecycle.
T06 Operational Review Board: 4-panel AutoRefresh global dashboard — health matrix,
top-10 friction, bottleneck stage counts, open propagations.
T07 gate: 5 describe blocks in Test/Integration.hs; SCOPE.md updated Phase 7
complete; docs/phase7-summary.md written.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 21:49:22 +00:00
|
|
|
-- Phase 7 — Advanced Observability
|
|
|
|
|
instance AutoRoute CrossHubPropagationsController
|
|
|
|
|
|
feat(P8): IHF Phase 8 complete — Federated Hub Maturity
Implements the final phase of the IHF v0.1 specification:
- WidgetOwnership: delegated ownership registry (local/delegated/global),
append-only audit artefacts, ownership badge on widget show page
- HubRoutingRule + RoutingEngine: priority-ordered inter-hub routing engine;
null-inclusive category/widget-type matching; RouteNowAction for manual
re-evaluation; RoutedCandidates view per hub
- FederatedPolicyOverlay: draft → active → retired lifecycle; activated
overlays are immutable (same pattern as Phase 6 contracts); policy
compliance dashboard with decision coverage metrics
- StewardshipRole: named governance roles per hub; point-in-time revocation
pattern; hub and ops-board integration
- ArchiveRecord + is_archived: soft-delete on widgets; lineage inspector
traces full traceability chain (Widget → Events → Annotations → Candidates
→ Requirements → Decisions → Deployments → Signals + ArchiveRecord)
- FederatedGovernanceDashboard: 5-panel autoRefresh org-wide governance view
(ownership coverage, routing activity, policy compliance, stewardship
coverage, archive activity)
Schema: widget_ownerships, hub_routing_rules, federated_policy_overlays,
stewardship_roles, archive_records; ALTER widgets ADD is_archived;
ALTER requirement_candidates ADD routed_to_hub_id
Migration: 1743638400-ihf-phase8-federated-hub-maturity.sql
Tests: Phase 8 integration tests appended to Test/Integration.hs
Docs: docs/phase8-summary.md; SCOPE.md updated to Phase 8 complete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 22:53:01 +00:00
|
|
|
-- Phase 8 — Federated Hub Maturity
|
|
|
|
|
instance AutoRoute WidgetOwnershipsController
|
|
|
|
|
instance AutoRoute HubRoutingRulesController
|
|
|
|
|
instance AutoRoute FederatedPolicyOverlaysController
|
|
|
|
|
instance AutoRoute StewardshipRolesController
|
|
|
|
|
instance AutoRoute ArchiveRecordsController
|
|
|
|
|
instance AutoRoute FederatedGovernanceController
|
|
|
|
|
|
feat(WP-0009): IHF GAAF Compliance Foundation — type registries, extension manifests, architectural contracts
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>
2026-03-31 21:17:39 +00:00
|
|
|
-- GAAF Compliance Foundation (IHUB-WP-0009)
|
|
|
|
|
instance AutoRoute TypeRegistriesController
|
|
|
|
|
instance AutoRoute HubCapabilityManifestsController
|
|
|
|
|
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
-- Phase 9 — External API Surface (IHUB-WP-0010)
|
|
|
|
|
|
|
|
|
|
-- Admin: API consumers, keys, webhooks, dashboard
|
|
|
|
|
instance AutoRoute ApiConsumersController
|
|
|
|
|
instance AutoRoute ApiKeysController
|
|
|
|
|
instance AutoRoute WebhookSubscriptionsController
|
|
|
|
|
instance AutoRoute ApiDashboardController
|
|
|
|
|
|
|
|
|
|
-- /api/v2/ REST endpoints (manual routing for versioned prefix)
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2WidgetsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/widgets"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexWidgetsAction
|
|
|
|
|
, do _ <- string "/"; wId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowWidgetAction { widgetId = Id wId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2WidgetsController where
|
|
|
|
|
pathTo ApiV2IndexWidgetsAction = "/api/v2/widgets"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowWidgetAction { widgetId } = "/api/v2/widgets/" <> tshow widgetId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
|
|
|
|
|
instance CanRoute ApiV2InteractionEventsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/interaction-events"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexInteractionEventsAction
|
|
|
|
|
, do _ <- string "/"; eId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowInteractionEventAction { interactionEventId = Id eId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2InteractionEventsController where
|
|
|
|
|
pathTo ApiV2IndexInteractionEventsAction = "/api/v2/interaction-events"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowInteractionEventAction { interactionEventId } = "/api/v2/interaction-events/" <> tshow interactionEventId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
pathTo ApiV2CreateInteractionEventAction = "/api/v2/interaction-events"
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2AnnotationsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/annotations"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexAnnotationsAction
|
|
|
|
|
, do _ <- string "/"; aId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowAnnotationAction { annotationId = Id aId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2AnnotationsController where
|
|
|
|
|
pathTo ApiV2IndexAnnotationsAction = "/api/v2/annotations"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowAnnotationAction { annotationId } = "/api/v2/annotations/" <> tshow annotationId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
pathTo ApiV2CreateAnnotationAction = "/api/v2/annotations"
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2RequirementCandidatesController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/requirement-candidates"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexRequirementCandidatesAction
|
|
|
|
|
, do _ <- string "/"; rcId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowRequirementCandidateAction { requirementCandidateId = Id rcId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2RequirementCandidatesController where
|
|
|
|
|
pathTo ApiV2IndexRequirementCandidatesAction = "/api/v2/requirement-candidates"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowRequirementCandidateAction { requirementCandidateId } = "/api/v2/requirement-candidates/" <> tshow requirementCandidateId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
|
|
|
|
|
instance CanRoute ApiV2DecisionRecordsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/decision-records"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexDecisionRecordsAction
|
|
|
|
|
, do _ <- string "/"; drId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowDecisionRecordAction { decisionRecordId = Id drId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2DecisionRecordsController where
|
|
|
|
|
pathTo ApiV2IndexDecisionRecordsAction = "/api/v2/decision-records"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowDecisionRecordAction { decisionRecordId } = "/api/v2/decision-records/" <> tshow decisionRecordId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
|
|
|
|
|
instance CanRoute ApiV2DeploymentRecordsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/deployment-records"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexDeploymentRecordsAction
|
|
|
|
|
, do _ <- string "/"; drId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowDeploymentRecordAction { deploymentRecordId = Id drId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2DeploymentRecordsController where
|
|
|
|
|
pathTo ApiV2IndexDeploymentRecordsAction = "/api/v2/deployment-records"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowDeploymentRecordAction { deploymentRecordId } = "/api/v2/deployment-records/" <> tshow deploymentRecordId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
|
|
|
|
|
instance CanRoute ApiV2OutcomeSignalsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/outcome-signals"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexOutcomeSignalsAction
|
|
|
|
|
, do _ <- string "/"; osId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowOutcomeSignalAction { outcomeSignalId = Id osId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2OutcomeSignalsController where
|
|
|
|
|
pathTo ApiV2IndexOutcomeSignalsAction = "/api/v2/outcome-signals"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowOutcomeSignalAction { outcomeSignalId } = "/api/v2/outcome-signals/" <> tshow outcomeSignalId
|
feat(WP-0010): IHF Phase 9 — External API Surface and Consumer SDKs
Delivers the full Phase 9 external API layer:
- Versioned REST API (/api/v2/) with OpenAPI 3.1 spec; enum arrays for
widget_type, event_type, annotation category drawn live from registry tables
- OAuth 2.0 client credentials flow (/api/v2/token); hub:*:write scopes
gated on active HubCapabilityManifest FK
- API key management: SHA256-hashed tokens, key_prefix for display,
one-time reveal on creation, revocation support
- TypeScript and Python consumer SDKs generated from registry tables
(/api/v2/sdk/ihf-client.ts, /api/v2/sdk/ihf-client.py)
- Webhook delivery: HMAC-SHA256 signing, append-only webhook_deliveries,
fire-and-forget dispatch via forkIO, 3-retry logic
- Admin API dashboard with 24h stats (request count, error rate, last seen)
- Rate limiting (per-minute) and daily quota enforcement via api_request_log
- Schema migration: api_consumers, api_keys, webhook_subscriptions (CHECK
constraint on 6 framework lifecycle topics), webhook_deliveries
(append-only trigger), api_request_log
- ARCHITECTURE-LAYERS.md scorecard: 3.34 → 3.41 (approaching Strong)
- contracts/functional/interaction-reporting-v1.md extended with Phase 9
endpoint catalogue and 422 validation error format
GAAF: no bare TEXT discriminators; webhook event_type uses CHECK constraint
over 6 allowed framework lifecycle topic strings (not widget event types).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 19:52:20 +00:00
|
|
|
|
|
|
|
|
instance CanRoute ApiV2RegistriesController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/"
|
|
|
|
|
choice
|
|
|
|
|
[ do _ <- string "widget-types"; endOfInput; pure ApiV2ListWidgetTypesAction
|
|
|
|
|
, do _ <- string "event-types"; endOfInput; pure ApiV2ListEventTypesAction
|
|
|
|
|
, do _ <- string "annotation-categories"; endOfInput; pure ApiV2ListAnnotationCategoriesAction
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2RegistriesController where
|
|
|
|
|
pathTo ApiV2ListWidgetTypesAction = "/api/v2/widget-types"
|
|
|
|
|
pathTo ApiV2ListEventTypesAction = "/api/v2/event-types"
|
|
|
|
|
pathTo ApiV2ListAnnotationCategoriesAction = "/api/v2/annotation-categories"
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2OpenApiController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/"
|
|
|
|
|
choice
|
|
|
|
|
[ do _ <- string "openapi.json"; endOfInput; pure ApiV2OpenApiJsonAction
|
|
|
|
|
, do _ <- string "openapi.yaml"; endOfInput; pure ApiV2OpenApiYamlAction
|
|
|
|
|
, do _ <- string "docs"; endOfInput; pure ApiV2DocsAction
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2OpenApiController where
|
|
|
|
|
pathTo ApiV2OpenApiJsonAction = "/api/v2/openapi.json"
|
|
|
|
|
pathTo ApiV2OpenApiYamlAction = "/api/v2/openapi.yaml"
|
|
|
|
|
pathTo ApiV2DocsAction = "/api/v2/docs"
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2TokenController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/token"
|
|
|
|
|
endOfInput
|
|
|
|
|
pure ApiV2CreateTokenAction
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2TokenController where
|
|
|
|
|
pathTo ApiV2CreateTokenAction = "/api/v2/token"
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2SdkController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/sdk"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2SdkIndexAction
|
|
|
|
|
, do _ <- string "/ihf-client.ts"; endOfInput; pure ApiV2SdkTsAction
|
|
|
|
|
, do _ <- string "/ihf-client.py"; endOfInput; pure ApiV2SdkPyAction
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2SdkController where
|
|
|
|
|
pathTo ApiV2SdkIndexAction = "/api/v2/sdk"
|
|
|
|
|
pathTo ApiV2SdkTsAction = "/api/v2/sdk/ihf-client.ts"
|
|
|
|
|
pathTo ApiV2SdkPyAction = "/api/v2/sdk/ihf-client.py"
|
|
|
|
|
|
feat(WP-0011): IHF Phase 10 — Hub Registry and Widget Marketplace
Delivers the hub registry discovery UI, widget pattern library,
governance template library, and marketplace dashboard.
Key changes:
- Schema: widget_patterns (widget_type FK to registry), widget_pattern_versions,
pattern_adoptions, governance_templates (categories JSONB, validated at
controller), governance_template_clones — all GAAF-compliant, no bare TEXT
type discriminators
- Migration: 1743897600-ihf-phase10-hub-registry.sql
- HubRegistry controller + views: browsable view over hub_capability_manifests,
hub_health_snapshots, hubs with per-hub GAAF compliance indicator
- WidgetPatterns controller + views: publish, version, adopt; adoption
triggers manifest amendment draft when new types are introduced
- GovernanceTemplates controller + views: CRUD, clone with category
validation against annotation_category_registry
- MarketplaceDashboard controller + view: full-text search, widget-type
filter, sort, trending panel, autoRefresh
- API v2: /api/v2/hub-registry, /api/v2/widget-patterns (+ adopt endpoint)
- OpenAPI spec updated with Phase 10 paths
- GAAF scorecard: Customization 2.5 → 3.2; overall 3.41 → 3.56 (Strong)
- CLAUDE.md: Phase 10 complete; active workplan → Phase 11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 20:14:43 +00:00
|
|
|
-- Phase 10 — Hub Registry and Widget Marketplace (IHUB-WP-0011)
|
|
|
|
|
instance AutoRoute HubRegistryController
|
|
|
|
|
instance AutoRoute WidgetPatternsController
|
|
|
|
|
instance AutoRoute GovernanceTemplatesController
|
|
|
|
|
instance AutoRoute MarketplaceDashboardController
|
|
|
|
|
|
|
|
|
|
-- /api/v2/ Phase 10 endpoints
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2HubRegistryController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/hub-registry"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexHubRegistryAction
|
|
|
|
|
, do _ <- string "/"; hId <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowHubRegistryAction { hubId = Id hId }
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2HubRegistryController where
|
|
|
|
|
pathTo ApiV2IndexHubRegistryAction = "/api/v2/hub-registry"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowHubRegistryAction { hubId } = "/api/v2/hub-registry/" <> tshow hubId
|
feat(WP-0011): IHF Phase 10 — Hub Registry and Widget Marketplace
Delivers the hub registry discovery UI, widget pattern library,
governance template library, and marketplace dashboard.
Key changes:
- Schema: widget_patterns (widget_type FK to registry), widget_pattern_versions,
pattern_adoptions, governance_templates (categories JSONB, validated at
controller), governance_template_clones — all GAAF-compliant, no bare TEXT
type discriminators
- Migration: 1743897600-ihf-phase10-hub-registry.sql
- HubRegistry controller + views: browsable view over hub_capability_manifests,
hub_health_snapshots, hubs with per-hub GAAF compliance indicator
- WidgetPatterns controller + views: publish, version, adopt; adoption
triggers manifest amendment draft when new types are introduced
- GovernanceTemplates controller + views: CRUD, clone with category
validation against annotation_category_registry
- MarketplaceDashboard controller + view: full-text search, widget-type
filter, sort, trending panel, autoRefresh
- API v2: /api/v2/hub-registry, /api/v2/widget-patterns (+ adopt endpoint)
- OpenAPI spec updated with Phase 10 paths
- GAAF scorecard: Customization 2.5 → 3.2; overall 3.41 → 3.56 (Strong)
- CLAUDE.md: Phase 10 complete; active workplan → Phase 11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 20:14:43 +00:00
|
|
|
|
|
|
|
|
instance CanRoute ApiV2WidgetPatternsController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2/widget-patterns"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexWidgetPatternsAction
|
|
|
|
|
, do _ <- string "/"; pId <- parseUUID
|
|
|
|
|
choice
|
|
|
|
|
[ do _ <- string "/adopt"; endOfInput
|
|
|
|
|
pure ApiV2AdoptWidgetPatternAction { widgetPatternId = Id pId }
|
|
|
|
|
, do endOfInput
|
|
|
|
|
pure ApiV2ShowWidgetPatternAction { widgetPatternId = Id pId }
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2WidgetPatternsController where
|
|
|
|
|
pathTo ApiV2IndexWidgetPatternsAction = "/api/v2/widget-patterns"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowWidgetPatternAction { widgetPatternId } = "/api/v2/widget-patterns/" <> tshow widgetPatternId
|
|
|
|
|
pathTo ApiV2AdoptWidgetPatternAction { widgetPatternId } = "/api/v2/widget-patterns/" <> tshow widgetPatternId <> "/adopt"
|
feat(WP-0011): IHF Phase 10 — Hub Registry and Widget Marketplace
Delivers the hub registry discovery UI, widget pattern library,
governance template library, and marketplace dashboard.
Key changes:
- Schema: widget_patterns (widget_type FK to registry), widget_pattern_versions,
pattern_adoptions, governance_templates (categories JSONB, validated at
controller), governance_template_clones — all GAAF-compliant, no bare TEXT
type discriminators
- Migration: 1743897600-ihf-phase10-hub-registry.sql
- HubRegistry controller + views: browsable view over hub_capability_manifests,
hub_health_snapshots, hubs with per-hub GAAF compliance indicator
- WidgetPatterns controller + views: publish, version, adopt; adoption
triggers manifest amendment draft when new types are introduced
- GovernanceTemplates controller + views: CRUD, clone with category
validation against annotation_category_registry
- MarketplaceDashboard controller + view: full-text search, widget-type
filter, sort, trending panel, autoRefresh
- API v2: /api/v2/hub-registry, /api/v2/widget-patterns (+ adopt endpoint)
- OpenAPI spec updated with Phase 10 paths
- GAAF scorecard: Customization 2.5 → 3.2; overall 3.41 → 3.56 (Strong)
- CLAUDE.md: Phase 10 complete; active workplan → Phase 11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 20:14:43 +00:00
|
|
|
|
feat(WP-0012): IHF Phase 11 — Advanced AI Federation
- Schema: AgentRegistration, ModelRoutingPolicy, AgentDelegation,
CollectiveProposal, CollectiveProposalContribution, AiGovernancePolicy,
AgentPerformanceRecord + ALTER TABLE agent_proposals
(migration 1744156800; CHECK constraints on trust_level, status,
consensus_status — GAAF compliant)
- Bridge: scripts/llm_bridge.py (llm-connect subprocess seam) +
Application/Helper/AgentBridge.hs (callBridge, callAgent,
checkGovernancePolicy, jsonArrayTexts)
- Routing: Application/Helper/ModelRouter.hs (resolveAgent,
resolveAllAgents) + ModelRoutingPolicies CRUD
- Registry: AgentRegistrations CRUD (Index/Show/New/Edit/Performance),
DeactivateAgentAction, ComputeAgentPerformanceAction
- Delegation: AgentDelegations controller + views, DelegateSubtaskAction
with token budget enforcement at bridge call time
- Collective: CollectiveProposals controller + views,
CreateCollectiveProposalAction (fan-out → synthesis → consensus detection)
- Governance: AiGovernancePolicies CRUD + ToggleAiGovernancePolicyAction;
checkGovernancePolicy enforced at all 4 Phase 5 invocation points
- Phase 5 wiring: replaced callClaudeApi in Widgets, DecisionRecords,
RequirementCandidates with resolveAgent + callAgent + token tracking
- llm-connect feature requests: ~/llm-connect/FEATURE_REQUESTS.md
(FR-1 HTTP serve, FR-2 RoutingPolicy, FR-3 async, FR-4 BudgetTracker)
- GAAF scorecard: 3.61 (up from 3.56); Functional 3.4→3.6, Extensions 3.8→3.9
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 20:57:17 +00:00
|
|
|
-- Phase 11 — Advanced AI Federation (IHUB-WP-0012)
|
|
|
|
|
instance AutoRoute AgentRegistrationsController
|
|
|
|
|
instance AutoRoute ModelRoutingPoliciesController
|
|
|
|
|
instance AutoRoute AgentDelegationsController
|
|
|
|
|
instance AutoRoute CollectiveProposalsController
|
|
|
|
|
instance AutoRoute AiGovernancePoliciesController
|
|
|
|
|
|
feat(WP-0013): IHF Phase 12 — Platform Memory and Continuous Learning
Closes the long-range feedback loop: outcome signals now enrich the full
traceability chain and feed back into routing, triage, and AI proposals.
Schema (T01):
- outcome_correlations (CHECK correlation_type)
- pattern_performance_records
- adaptive_threshold_configs
- institutional_knowledge_entries (GIN tsvector FTS)
- learning_insights (CHECK insight_type)
- ALTER TABLE decision_records + requirement_candidates: outcome_summary JSONB
- AFTER INSERT trigger trg_enrich_lineage on outcome_signals
- contracts/core/ updated (outcome-summary-columns-v1, append-only addendum)
Correlation engine (T02):
- Application/Helper/CorrelationEngine.hs: pure annotation→outcome SQL
- Web/Controller/OutcomeCorrelations.hs: ComputeCorrelationsAction + index
Pattern performance (T03):
- Web/Controller/PatternPerformance.hs: ComputePatternPerformanceAction
Adaptive thresholds (T04):
- Web/Controller/AdaptiveThresholds.hs: CalibrateThresholdsAction
- Application/Helper/FrictionScore.hs: applyAdaptiveWeights
Institutional knowledge (T05):
- DistilDecisionAction in DecisionRecords controller
- Web/Controller/InstitutionalKnowledge.hs: QueryKnowledgeBaseAction
Lineage enrichment (T06):
- Web/Controller/LineageEnrichment.hs: EnrichLineageAction (batch backfill)
- enrich_lineage_on_outcome_batch() PL/pgSQL helper in migration
Learning dashboard (T07):
- Web/Controller/LearningDashboard.hs: 5-panel autoRefresh view
- "Learning" nav link in FrontController
API v2 learning endpoints (T08):
- GET /api/v2/outcome-correlations, /pattern-performance, /knowledge-base/{id}
- OpenAPI schemas: OutcomeCorrelation, PatternPerformanceRecord, InstitutionalKnowledgeEntry
GAAF scorecard + docs (T09):
- Core 3.8→3.9, Functional 3.6→3.8, overall 3.61→3.68
- CLAUDE.md: IHF v0.2 complete, no active workplan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 23:14:15 +00:00
|
|
|
-- Phase 12 — Platform Memory and Continuous Learning (IHUB-WP-0013)
|
|
|
|
|
instance AutoRoute OutcomeCorrelationsController
|
|
|
|
|
instance AutoRoute PatternPerformanceController
|
|
|
|
|
instance AutoRoute AdaptiveThresholdsController
|
|
|
|
|
instance AutoRoute InstitutionalKnowledgeController
|
|
|
|
|
instance AutoRoute LineageEnrichmentController
|
|
|
|
|
instance AutoRoute LearningDashboardController
|
|
|
|
|
|
|
|
|
|
instance CanRoute ApiV2LearningController where
|
|
|
|
|
parseRoute' = do
|
|
|
|
|
_ <- string "/api/v2"
|
|
|
|
|
choice
|
|
|
|
|
[ do _ <- string "/outcome-correlations"; endOfInput
|
|
|
|
|
pure ApiV2IndexOutcomeCorrelationsAction
|
|
|
|
|
, do _ <- string "/pattern-performance"; endOfInput
|
|
|
|
|
pure ApiV2IndexPatternPerformanceAction
|
|
|
|
|
, do _ <- string "/knowledge-base"
|
|
|
|
|
choice
|
|
|
|
|
[ do endOfInput; pure ApiV2IndexKnowledgeBaseAction
|
|
|
|
|
, do _ <- string "/"; eid <- parseUUID; endOfInput
|
|
|
|
|
pure ApiV2ShowKnowledgeBaseAction { knowledgeEntryId = Id eid }
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath ApiV2LearningController where
|
|
|
|
|
pathTo ApiV2IndexOutcomeCorrelationsAction = "/api/v2/outcome-correlations"
|
|
|
|
|
pathTo ApiV2IndexPatternPerformanceAction = "/api/v2/pattern-performance"
|
|
|
|
|
pathTo ApiV2IndexKnowledgeBaseAction = "/api/v2/knowledge-base"
|
2026-04-04 09:55:12 +00:00
|
|
|
pathTo ApiV2ShowKnowledgeBaseAction { knowledgeEntryId } = "/api/v2/knowledge-base/" <> tshow knowledgeEntryId
|
feat(WP-0013): IHF Phase 12 — Platform Memory and Continuous Learning
Closes the long-range feedback loop: outcome signals now enrich the full
traceability chain and feed back into routing, triage, and AI proposals.
Schema (T01):
- outcome_correlations (CHECK correlation_type)
- pattern_performance_records
- adaptive_threshold_configs
- institutional_knowledge_entries (GIN tsvector FTS)
- learning_insights (CHECK insight_type)
- ALTER TABLE decision_records + requirement_candidates: outcome_summary JSONB
- AFTER INSERT trigger trg_enrich_lineage on outcome_signals
- contracts/core/ updated (outcome-summary-columns-v1, append-only addendum)
Correlation engine (T02):
- Application/Helper/CorrelationEngine.hs: pure annotation→outcome SQL
- Web/Controller/OutcomeCorrelations.hs: ComputeCorrelationsAction + index
Pattern performance (T03):
- Web/Controller/PatternPerformance.hs: ComputePatternPerformanceAction
Adaptive thresholds (T04):
- Web/Controller/AdaptiveThresholds.hs: CalibrateThresholdsAction
- Application/Helper/FrictionScore.hs: applyAdaptiveWeights
Institutional knowledge (T05):
- DistilDecisionAction in DecisionRecords controller
- Web/Controller/InstitutionalKnowledge.hs: QueryKnowledgeBaseAction
Lineage enrichment (T06):
- Web/Controller/LineageEnrichment.hs: EnrichLineageAction (batch backfill)
- enrich_lineage_on_outcome_batch() PL/pgSQL helper in migration
Learning dashboard (T07):
- Web/Controller/LearningDashboard.hs: 5-panel autoRefresh view
- "Learning" nav link in FrontController
API v2 learning endpoints (T08):
- GET /api/v2/outcome-correlations, /pattern-performance, /knowledge-base/{id}
- OpenAPI schemas: OutcomeCorrelation, PatternPerformanceRecord, InstitutionalKnowledgeEntry
GAAF scorecard + docs (T09):
- Core 3.8→3.9, Functional 3.6→3.8, overall 3.61→3.68
- CLAUDE.md: IHF v0.2 complete, no active workplan
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 23:14:15 +00:00
|
|
|
|
feat(T02-T11): IHF Phase 1 schema, controllers, views, and helpers
- Schema: hubs, widgets, widget_versions, interaction_events (append-only
trigger), annotations, users — single migration file
- Web layer: Types, Routes, FrontController with auth + AutoRefresh layout
- Controllers: Hubs (CRUD), Widgets (CRUD + versioning), InteractionEvents
(JSON capture, canonical event_type validation), Annotations (threaded,
append-only)
- Sessions controller for IHP auth
- Views: Hubs (index/show/new/edit), Widgets (index/show/new/edit),
Annotations (index/new), Sessions (login)
- widgetEnvelope helper with full data-* governance attributes
- Integration tests: Hub CRUD, Widget versioning, event capture, append-only
guard, annotation threading, validation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 01:42:43 +00:00
|
|
|
-- Sessions
|
|
|
|
|
instance AutoRoute SessionsController
|
feat(WP-0015/B1-B6): StaticPages controller and public intro/tutorial UI
B1 — Web/Controller/StaticPages.hs: LandingAction, CapabilitiesAction,
TutorialAction, ExtensionGuideAction (no auth guard)
B2 — Web/View/StaticPages/Landing.hs: hero, traceability chain, capability
grid, GAAF status bar, CTAs to capabilities and management UI
B3 — Web/View/StaticPages/Capabilities.hs: 12-phase capability map, GAAF
scorecard, API v1/v2 surface table, learning loop, type registry system
B4 — Web/View/StaticPages/Tutorial.hs: 6-step developer tutorial (widgets,
events, governance, deployment, learning, federation)
Web/View/StaticPages/ExtensionGuide.hs: 6-step hub extension guide
(HubCapabilityManifest, type registry, widgets, patterns, agents)
with GAAF rules summary
B5 — Web/Routes.hs: StaticPagesController manual routes; "/" → Landing,
"/capabilities", "/tutorial", "/extension-guide"
Web/Types.hs: StaticPagesController data type
B6 — Web/FrontController.hs: import StaticPagesController; register route
(last, catches root); nav adds About/Tutorial/Extend links and
separator; logo now links to LandingAction
B7 (deployment verification) remains pending until devenv up is available.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:02:44 +00:00
|
|
|
|
|
|
|
|
-- WP-0015 — Public intro / tutorial pages (manual routing so / is the root)
|
|
|
|
|
instance CanRoute StaticPagesController where
|
|
|
|
|
parseRoute' = choice
|
2026-04-29 13:49:23 +02:00
|
|
|
[ do _ <- string "/"; endOfInput; pure LandingAction
|
feat(WP-0015/B1-B6): StaticPages controller and public intro/tutorial UI
B1 — Web/Controller/StaticPages.hs: LandingAction, CapabilitiesAction,
TutorialAction, ExtensionGuideAction (no auth guard)
B2 — Web/View/StaticPages/Landing.hs: hero, traceability chain, capability
grid, GAAF status bar, CTAs to capabilities and management UI
B3 — Web/View/StaticPages/Capabilities.hs: 12-phase capability map, GAAF
scorecard, API v1/v2 surface table, learning loop, type registry system
B4 — Web/View/StaticPages/Tutorial.hs: 6-step developer tutorial (widgets,
events, governance, deployment, learning, federation)
Web/View/StaticPages/ExtensionGuide.hs: 6-step hub extension guide
(HubCapabilityManifest, type registry, widgets, patterns, agents)
with GAAF rules summary
B5 — Web/Routes.hs: StaticPagesController manual routes; "/" → Landing,
"/capabilities", "/tutorial", "/extension-guide"
Web/Types.hs: StaticPagesController data type
B6 — Web/FrontController.hs: import StaticPagesController; register route
(last, catches root); nav adds About/Tutorial/Extend links and
separator; logo now links to LandingAction
B7 (deployment verification) remains pending until devenv up is available.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 02:02:44 +00:00
|
|
|
, do _ <- string "/capabilities"; endOfInput; pure CapabilitiesAction
|
|
|
|
|
, do _ <- string "/tutorial"; endOfInput; pure TutorialAction
|
|
|
|
|
, do _ <- string "/extension-guide"; endOfInput; pure ExtensionGuideAction
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
instance HasPath StaticPagesController where
|
|
|
|
|
pathTo LandingAction = "/"
|
|
|
|
|
pathTo CapabilitiesAction = "/capabilities"
|
|
|
|
|
pathTo TutorialAction = "/tutorial"
|
|
|
|
|
pathTo ExtensionGuideAction = "/extension-guide"
|