Commit Graph

101 Commits

Author SHA1 Message Date
0bd86096b6 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 05:35:44 +02:00
a35b575505 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 05:21:11 +02:00
505498f76e chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 05:06:37 +02:00
45d1c35423 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 04:52:04 +02:00
93d53ff330 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 04:37:30 +02:00
1bd280bd56 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 04:22:53 +02:00
69afbc9d01 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 04:08:19 +02:00
8129184d73 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 03:53:40 +02:00
58297bee85 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 03:39:04 +02:00
1c34319739 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 03:24:27 +02:00
5cdca9ec1e chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 03:09:50 +02:00
1a4859c11d chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 02:55:09 +02:00
36e05970e0 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 02:40:30 +02:00
234849b3a4 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 02:26:05 +02:00
1c3e98eba3 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-21:
  - update .custodian-brief.md for inter-hub
2026-04-21 02:11:38 +02:00
debc0b7d81 fix(WP-0014/A2): fix devenv shell — IHP_LIB, ghci, ghcid now available
Some checks failed
Test / test (push) Has been cancelled
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>
2026-04-12 13:11:41 +00:00
2c22766cd6 fix(WP-0017/E5): Layer 3 error fixes — round 3 (24 files)
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>
2026-04-12 13:11:32 +00:00
3737845e02 fix(WP-0017/E4): Layer 3 error fixes — round 2 (18 files)
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>
2026-04-12 12:17:45 +00:00
c40f11d657 fix(WP-0017/E3): Layer 3 error fixes — controllers and views
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>
2026-04-11 23:40:31 +00:00
58cad31042 fix(WP-0017/E1): Layer 2 + Sessions fixes
- 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>
2026-04-11 08:37:04 +00:00
34be62de04 feat(WP-0016/C2-C3): close build infrastructure workplan
C2: document actual GHC cache behavior (-fbyte-code, no .o files, .hi
caching via -fwrite-interface) and correct CLAUDE.md cache claim.
C3: create IHUB-WP-0017 error-fix loop workplan (ralph-compatible,
5 tasks E1-E5, runs inside devenv shell).
WP-0016 status → done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 23:36:06 +00:00
469ed6c758 fix(WP-0016): Layer 3 compilation fixes — Sessions auth, Widgets import consolidation, Scientific type
- 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>
2026-04-10 23:13:09 +00:00
563983fa7f feat(WP-0016/C5): compilation layers docs and -fwrite-interface flag
- CLAUDE.md: add "Compilation Layers" section (C5) — layer map,
  compile-check tool usage, cache location, error-fix discipline
- .ghci: add -fwrite-interface so interface files are cached even
  on partial-success builds (completes C4 spec)
- WP-0016: mark C5 done; annotate C4 ✓ note in workplan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 20:03:54 +00:00
64a9d4eeb4 feat(WP-0016/C1-C4): Layer 2 isolation and clean-base infrastructure
- 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>
2026-04-10 15:38:01 +00:00
3d2e8ec9e1 fix(WP-0014/A1): add devenv.nix required by devenv v2+
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>
2026-04-10 11:31:00 +00:00
a6baab7080 feat(WP-0016): build infrastructure — ghcid standalone script and error-fix loop workplan
- 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>
2026-04-10 09:46:56 +00:00
a2e9b5b52f fix(WP-0014/A2): replace Prelude import in AgentRegistrations controller
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 08:41:26 +00:00
ce42607fca fix(WP-0014/A2): close remaining pure-param and structural compilation errors
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>
2026-04-10 01:14:08 +00:00
5510ae22da 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
74bab5f6f2 fix(WP-0014/A2): continued type-correctness fixes and Tailwind CSS output
- Schema.sql: add FK constraints for phases 6–12 so IHP generates Id X
  instead of UUID for FK columns (widget_adapter_specs, friction_scores,
  hub_routing_rules, agent_proposals, hub_capability_manifests, etc.)
- HubHealth, ModelRouter, ApiInteractionEvents: remove toUUID() wrappers
  now that FK columns carry proper Id types
- FederatedGovernance/Dashboard, HubRoutingRules/Index: same Id comparison fix
- AgentProposals/Index, DecisionRecords/Index, ApiConsumers/Edit: Id type fixes
- BottleneckDetector: add Data.Coerce import; CrossHubPropagation: add guard
- ApiKeys: qualify cryptohash-sha256 import to resolve package ambiguity
- WebhookDeliveryJob: use LBS.fromStrict; remove duplicate diffUTCTime
- Sessions/New: use renderFlashMessages (IHP built-in)
- ArchiveRecords/LineageInspector: simplify renderChainStep signature
- static/app.css: Tailwind CSS output (2011 lines) — A3 confirmed
- workplans/IHUB-WP-0015-local-deployment-intro-ui.md: add workplan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 01:49:41 +00:00
34cc18b4c7 chore(WP-0014): update workplan — A2/A3/A4 complete, A1/A5 pending build
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-04 09:55:41 +00:00
f1978c3888 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>
2026-04-04 09:55:12 +00:00
ffd5fbb900 fix: migrate DetectPolicySensitivityAction to routed agent pattern
Some checks failed
Test / test (push) Has been cancelled
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>
2026-04-03 12:34:07 +00:00
0f505feb2d 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-03 12:34:07 +00:00
9643173618 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T09: todo → done
2026-04-03 14:32:09 +02:00
c0e79f29dc chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T08: todo → done
2026-04-03 14:32:08 +02:00
0f3313a614 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T07: todo → done
2026-04-03 14:32:08 +02:00
fae7c676ba chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T06: todo → done
2026-04-03 14:32:08 +02:00
87dd81bbee chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T05: todo → done
2026-04-03 14:32:08 +02:00
2e8fbf6d4e chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T04: todo → done
2026-04-03 14:32:08 +02:00
876feb8ce3 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T03: todo → done
2026-04-03 14:32:08 +02:00
eb6f6faef0 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T02: todo → done
2026-04-03 14:32:08 +02:00
0c77c1e125 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-03:
  - IHUB-WP-0013-T01: todo → done
2026-04-03 14:32:08 +02:00
eb0803b8d7 chore(WP-0013): create Phase 12 workplan — Platform Memory and Continuous Learning
Some checks failed
Test / test (push) Has been cancelled
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-01 22:59:56 +00:00
4a32593990 chore(consistency): sync task status from DB [auto]
Some checks failed
Test / test (push) Has been cancelled
Updated by fix-consistency on 2026-04-02:
  - update .custodian-brief.md for inter-hub
2026-04-02 00:51:48 +02:00
a5a83f6c03 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-02:
  - update .custodian-brief.md for inter-hub
2026-04-02 00:51:48 +02:00
38dea6cb5f chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-02:
  - update .custodian-brief.md for inter-hub
2026-04-02 00:51:48 +02:00
6df1d35724 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-02:
  - update .custodian-brief.md for inter-hub
2026-04-02 00:51:48 +02:00
0167bce5d0 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-01:
  - update .custodian-brief.md for inter-hub
2026-04-02 00:51:48 +02:00
0dbbf6ea51 chore(consistency): sync task status from DB [auto]
Updated by fix-consistency on 2026-04-01:
  - update .custodian-brief.md for inter-hub
2026-04-02 00:51:48 +02:00