Repository navigation
feat(fanclub): consolidate FanClub AI as opt-in Cloud-native subsystem (#57) - #69
Merged
Merged
Conversation
hanzoai#57) Replace the standalone Stack Node/SQLite prototype with an opt-in staged subsystem (CLOUD_ENABLE_STAGED=fanclub) inside hanzoai/cloud: - Identity: Hanzo IAM JWT validation via Cloud SanitizeIdentity plus PKCE code exchange (POST /v1/fanclub/oauth/exchange) with exact redirect URI allowlist and TokenValidator verification. No browser tenant switcher. - Persistence: Cloud Base (/v1/base) collections fc_members, fc_proposals, and fc_audit exclusively. Zero independent SQLite database. - Approvals & Tasks: Org-admin / SuperAdmin role gate, consent enforcement, atomic idempotency (409 on re-decide), durable simulation task enqueueing in Cloud Tasks (fanclub_action_simulation, external_side_effects=false), and dual audit receipts (fc_audit + Cloud tamper-evident AuditTrail). - Inference: HTTP /v1/chat/completions AIClient (CLOUD_AI_BASE_URL) with loopback/Hanzo-host egress guard, IAM bearer relay, aggregates-only prompting, and strict fail-closed 503 on unconfigured or model outages. - MCP & OpenAPI: All 14 endpoints are typed zip ops projected automatically into /v1/openapi.json and /mcp JSON-RPC 2.0 under the same IAM boundary. - UI: Embedded offline static FanClub console at /fanclub/index.html. Closes hanzoai#57. Co-authored-by: Hanzo Dev <[email protected]>
zeekay
added a commit
to hanzoai/stack
that referenced
this pull request
Nov 25, 2026
) Co-authored-by: Hanzo Dev <[email protected]>
zeekay
added a commit
to hanzoai/stack
that referenced
this pull request
Nov 25, 2026
…#2) * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * chore(stack): retire duplicate FanClub app after canonical Cloud migration Co-authored-by: Hanzo Dev <[email protected]> * docs(stack): point to Cloud as the sole FanClub application owner Co-authored-by: Hanzo Dev <[email protected]> * docs(stack): point to Cloud as the sole FanClub application owner Co-authored-by: Hanzo Dev <[email protected]> * docs(stack): reference landed Cloud-native FanClub app (hanzoai/cloud#69) Co-authored-by: Hanzo Dev <[email protected]> --------- Co-authored-by: Hanzo Dev <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates FanClub AI as an opt-in staged subsystem (
CLOUD_ENABLE_STAGED=fanclub) natively inhanzoai/cloud, replacing the legacy standalone Node/SQLite prototype inhanzoai/stack.Canonical Hanzo Services Only
SanitizeIdentity+TokenValidator; OIDC PKCE exchange (POST /v1/fanclub/oauth/exchange) with strict exact redirect URI allowlist;GET /v1/fanclub/mereturns IAM-validated org & admin roles. Zero client tenant selector.fc_members,fc_proposals,fc_auditvia existingbase.db(visible through/v1/base/collections/*and/mcp). Zero independent SQLite DB.IsOrgAdmin || IsSuperAdmin) proposal approvals with consent check, atomic idempotency (409 on replay), durable simulation task enqueueing (fanclub_action_simulation,external_side_effects: false), and dual audit receipts (fc_audit+ Cloud tamper-evidentAuditTrail)./v1/): Addedclients.AIHTTPAt(CLOUD_AI_BASE_URL) with loopback/Hanzo-host egress guard and IAM bearer relay;POST /v1/fanclub/chatsends aggregate org counts only and fails closed with HTTP 503 on unconfigured or upstream model outages (zero synthetic/external fallback)./mcp) & OpenAPI: All routes are typedzipops withzipdoc_gen.go, projected automatically to/v1/openapi.jsonand/mcpJSON-RPC 2.0 under the same IAM boundary.console/fanclub/, served at/fanclub/index.htmland/fanclub/. Clearly labels opt-in synthetic fixtures, deterministic rules baseline, simulation-only approvals, and unqualified train-to-serve.Verification Receipts
GOENV=off GOWORK=off GOPROXY=https://proxy.golang.org GOSUMDB=sum.golang.org GOFLAGS=-mod=readonly CGO_ENABLED=0 go build ./... && go vet ./...— PASSCGO_ENABLED=0 go test ./apps/fanclub/... ./clients/... ./apps .— PASS (includingTestAppsImportNothingOfTheirHost,TestFanClubCloudNativeE2E,TestTmpConsole)CGO_ENABLED=1 go test -tags 'sqlite_fts5 sqlite_math_functions' ./apps/... ./clients/... .— PASSCGO_ENABLED=0binary E2E against real Hanzo IAM (https://hanzo.ai), encrypted SQLCipher Base/Tasks, live Hanzo AI (https://api.hanzo.aimodelzen), live 503 model-outage fail-closed check, forged-header 401 rejection, unauthenticated & authenticated/mcptools/call fanclub_summary— ALL 10 CHECKS PASSED.Closes #57.