Root cause: devenv shell reads devenv.nix only; IHP's Haskell setup is in
flake.nix's devenv.shells.default which is only loaded by nix develop.
Fix: create devenv.yaml to register IHP as a devenv input (pinned to the
same rev as flake.lock) with overlays.default applied. Update devenv.nix
to set IHP_LIB/IHP env vars and enable languages.haskell with pkgs.ghc
(IHP-overlay GHC) + all project packages; add ghcid explicitly.
devenv.lock pins IHP at df3922d (matches flake.lock).
scripts/compile-check: updated header comments and added IHP_LIB echo;
switches from ghcid to ghci one-shot (ghcid not available in all shells).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Int16→Int in score/stars functions; uuid-based readMay→UUID.fromText;
autoRefresh do-notation fix; id→\x->x ambiguity in HubRoutingRules;
MarketplaceDashboard replaced raw SQL with IHP query builder; optional
hub selector in TypeRegistry views via CanSelect (Text, Maybe Id) instance
added to Web.View.Prelude; import consolidations to Web.View.Prelude.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes 46 compile errors across 18 controllers and views:
- BridgeResponse missing from explicit import lists (Widgets, RequirementCandidates,
DecisionRecords, AgentDelegations) — dot-notation HasField resolution fails without
the type in scope under DuplicateRecordFields
- unId not in IHP v1.5 — replaced all fmap (Id . unId) with fmap coerce
- respondWith not in IHP — replaced with plain redirectTo in 5 controllers
- [hubId] list param to sqlQuery — replaced with (Only hubId) tuple
- deleteWhere not in IHP — replaced with query/filterWhere/fetch/deleteRecords
- fill @'["label"] mismatch — field is label_ in generated types, not label
- PersistUUID/toUUID (persistent-style) — replaced with (Only id)
- intercalate + jsonArrayTexts ambiguity in GovernanceTemplates — hid Index import,
removed local duplicates, added Data.Text (intercalate)
- Int16 not in scope in AntifragilityDashboard — changed to Int (score :: Int)
- typeArraySection type mismatch in HubCapabilityManifests/Edit — unified to [Text]
- renderForm arity mismatch — added action param to DecisionRecords/New.renderForm
- Missing qualified Data.Aeson import in AdaptiveThresholds
- Missing ?request::Request constraint in Api/V2/WidgetPatterns.renderJsonWithStatus
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix compilation errors across 6 controllers and 29 views: import cleanup,
ResponseException pattern for API auth, type fixes, unused import removal.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CrossHubPropagation: IHP.Prelude.head returns Maybe a; use List.head
(Data.List.head, already imported qualified) for non-empty-guarded lists
- Sessions: currentUserOrNothing is pure Maybe, not IO; use case...of instead of >>=
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Sessions: replace raw authenticate/unsetSession with IHP login/logout/verifyPassword
- Widgets/New, Widgets/Show: consolidate imports to Web.View.Prelude
- Widgets/Show: unwrap Id newtype for childrenOf comparison, Double → Scientific in renderSignalValue
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Web/Controller/Prelude.hs (was missing; 8 controllers failed to import it)
- Add .ghci-core and scripts/compile-check-core to compile Layer 1+2 in
isolation without loading Main.hs or any controller/view (Layer 3)
- Fix Application/Helper/BottleneckDetector.hs: replace coerce :: Id' -> UUID
with unpackId (IHP Id' wraps a type family; Data.Coerce cannot cross it)
- Fix devenv.nix: add pkgs.nodePackages.tailwindcss so devenv process scripts
find the tailwindcss binary (devenv v2 builds scripts with only local packages)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
devenv v2 requires devenv.nix to exist even when the full shell
configuration lives in flake.nix via IHP's devenv.flakeModule.
Contains project-specific overrides (GHCRTS, tailwind process);
IHP core (postgres, ghcid, RunDevServer) still comes from the flake module.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- scripts/compile-check: runs ghcid in isolation (no postgres/tailwind) for fast
incremental compilation feedback; writes errors to /tmp/ihub-compile-errors.txt
- .ghci: add -fkeep-going so GHC reports all module errors in one pass
- WP-0016 workplan: documents module dependency layers, error-fix SOP,
and autonomous ralph-loop approach for iterative error fixing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Convert all remaining `<- paramOrNothing / param / paramOrDefault /
currentUserOrNothing` monadic binds to `let` — these functions are pure
(ImplicitParams-based) in IHP v1.5, so `<-` is a type error in an IO
do-block.
Controllers fixed:
AgentDelegations, AiGovernancePolicies, Annotations, ApiConsumers,
CollectiveProposals, DecisionRecords, DeploymentRecords,
HubCapabilityManifests, HubRoutingRules, InstitutionalKnowledge,
OutcomeCorrelations, RequirementCandidates, TypeRegistries,
WebhookSubscriptions, Widgets,
Api/V2/{Annotations,InteractionEvents,Token}
WebhookSubscriptions: remove orphaned `Right () ->` case arm that was
left inside a bare `unless` block (structural parse error).
Also carries forward all in-progress fixes from the working tree:
helpers (AgentBridge, ApiRateLimit, BottleneckDetector,
CrossHubPropagation, FrictionScore),
views (CanSelect instances, HSX lambda extraction, formFor wrappers),
env/build (envrc GHCi perms, flake.nix Tailwind + GHC resource limits,
static/app.css additional Tailwind output).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The last action still calling callClaudeApi directly. Now routes through
resolveAgent (task_type="policy_sensitivity") + checkGovernancePolicy +
callAgent, consistent with all other Phase 11 AI invocations. Adds
agentRegistrationId, tokensIn, tokensOut to the created AgentProposal and
handles blocked_by_policy the same way as the other 4 actions.
Remove callClaudeApi and its direct HTTP imports from
Application/Helper/Controller.hs — no longer referenced anywhere.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>