fix: apps registry self-heals an empty table (fresh-DB first boot) - #34
Merged
Merged
Conversation
… all branches - Remove 58.6 MiB docker-compose binary and 15.2 MiB backend/main build artifact from the tree; gitignore backend/main (history purge is a separate coordinated follow-up) - Remove screenshots/ (6.2 MB of throwaway QA captures) - Remove orphan NATS container from docker-compose.yml (no Go consumer; event bus stays future design) + update README/CLAUDE.md references - Rewrite docs/architecture.md to match reality (ServeMux not Chi, Lit not React Router, actual module list, actual API surfaces, honest built-vs-vision split) - Fix .agent/workflows/development.md (Chi/App.tsx refs); stop gitignoring the intentionally-tracked .agent/ - CLAUDE.md: drop stale gotchas (README-React, inventory vet failure) and stale backlog items - Remove dead config fields (Anthropic/Stability/Gemini keys, unread since the OSS migration), unused @lit/task dep, leftover react.svg - CI now triggers on master, staging, and community (community receives external PRs but had no CI) - README: explain industry_erps/ and brand/; add docs/modularization-blueprint.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy9dVzYph7TEgJEGUKNqao
…rence conversions Odoo-style apps layer per docs/modularization-blueprint.md (Phase 0): Backend: - pkg/apps: Manifest/App/Router types, DB-backed Registry (apps table, migration 074), per-request route gating (404 app_disabled), dependency- validated enable/disable with audit logging, /api/v1/apps API (GET any role; POST enable|disable admin/owner) - cmd/server/catalog.go: manifests for all 37 unconverted modules (core, always-on) so the Apps page shows the whole platform truthfully - Reference conversions: millwork (owns millwork + configurator modules — one app, two modules) and governance, both registered through the gate; new unit tests for registry validation/gating and governance service - main.go: reuse quoteSvc for integrations (was a duplicate instance) Frontend: - app/src/apps/: manifest types, millwork + governance manifests, registry feeding the route table, path→tag resolution, and generated sidebar items - AppsService: enablement state, apps-changed events, fail-open semantics - Apps admin page (/admin/apps): categorized catalog, core badges, dependency hints, toggles; gable-app-disabled panel for gated routes - app.ts: memoize the routed page element so re-renders don't remount pages (remounting refired connectedCallback fetches); registry-first tag resolution; millwork/governance rows removed from routes.ts/tag map; app-shell renders manifest nav (Millwork, Governance) + Apps entry Verified end-to-end on a live Postgres 16: 74 migrations apply; catalog syncs 39 apps; disable/enable round-trips gate both millwork modules and governance (404 app_disabled ↔ 200); core apps refuse disable (409 app_core); unknown apps 404; audit_log records app.enable/app.disable; full go test suite green with DB; tsc/eslint/vite build/vitest green; Playwright walkthrough of Apps page → toggle → disabled panel → re-enable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy9dVzYph7TEgJEGUKNqao
…tform Third App Platform app (default DO hostname, no DNS) tracking a new apps-staging branch, isolated logical DB gable_apps on the shared gable-pg cluster. SPA built with empty VITE_API_URL → relative same- origin /api/* calls, so the assigned hostname needs no post-deploy config round-trip; VITE_DEMO_MODE=true enables the surface picker. Bring-up + teardown runbook added to .do/README.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy9dVzYph7TEgJEGUKNqao
…dealer) The old LICENSE was a broken stub: it claimed AGPL-3.0 but contained an AI-placeholder line instead of the license text AGPL requires shipping. Replace with a conditional dual-license grant reflecting the intended business model: - Single-dealer deployment (one dealer org running its own operations and portals) → GPL-3.0-or-later: no source-sharing obligation for merely hosting. - Multi-dealer operation (SaaS for dealers, customized resale, shared co-op instances) → AGPL-3.0-or-later: served dealers/users are entitled to the running version's source. Canonical full texts (SPDX) added under LICENSES/. README gains a plain-language licensing section + blueprint link in the docs table; CONTRIBUTING states the inbound=outbound dual grant (no CLA); app/package.json gets the SPDX expression. Note: grant wording should get counsel review before wide announcement. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy9dVzYph7TEgJEGUKNqao
go build ./cmd/server/main.go compiles only that one file (package "command-line-arguments"), silently excluding any sibling file in package main — which broke the DO image build the moment catalog.go joined cmd/server. Local dev and CI use package mode (go build ./...) so the landmine was invisible until the App Platform deploy. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy9dVzYph7TEgJEGUKNqao
On platforms where migrations run post-deploy (DO App Platform), the server's boot-time Sync fires before migration 074 creates the apps table: fail-open gating keeps the ERP up, but the registry stays empty until the next restart — GET /api/v1/apps returned null and toggles 404'd on the freshly provisioned apps-staging env. The registry now detects the exists-but-empty table (from List and from the 30s enablement-cache refresh), re-runs Sync once, and re-queries. Also: List serializes an empty catalog as [] instead of null. Reproduced and verified against a live server: TRUNCATE apps at runtime → next List self-heals to the full 39-app catalog. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hy9dVzYph7TEgJEGUKNqao
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.
No description provided.