feat(gui): introduce product-manifest seam#150
Merged
Conversation
Extract the implicit "what Flavian exposes" knowledge into an explicit, typed ProductManifest so the GUI engine can render any PMDS product from a descriptor — groundwork toward the unified Trajan app. Zero user-visible behaviour change. - Add the ProductManifest type and flavianManifest in src/shared/product (pure, node-free data; reuses TaskKind/DockerCommand/QaScript/PipelineKind/ThemeStarter). - Engine reads from the active manifest: a command-spec interpreter + parser registry in core/product, the manifest injected into registerHandlers, and the renderer shell reading brand + nav from it. - Panels read their step catalogs from the manifest; remove the now-dead docker-commands / qa-commands / paths modules. - Mark the extension point with a typed Aurelius scaffold (a second product is just another manifest), intentionally not wired in. - Add tests proving the engine renders commands/screens from a manifest; keep the packaged smoke test green. - Brief: packages/gui/docs/GUI-PLATFORM.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The "active product is Flavian" test compared the registry's manifest to a directly-imported flavianManifest by reference. That relies on the tsx test loader deduping two import specifiers (the barrel's ./flavian vs the test's direct import) to one module instance — true on case-insensitive Windows, but on Linux CI flavian.ts is evaluated twice, so the objects are structurally equal but not reference-equal. Compare activeManifest to PRODUCTS.flavian (same registry module — always reference-safe) and check id/displayName by value. Production is unaffected: electron-vite bundles main and renderer separately and the barrel dedupes per bundle. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What & why
Step 1 of evolving
packages/guifrom the Flavian-only desktop app into a generic engine thatrenders any PMDS product (Flavian, Aurelius, Nerva) from a typed descriptor — the unified
destination is Trajan. This PR extracts the implicit "what Flavian exposes" knowledge into an
explicit
ProductManifest, with zero user-visible behaviour change.See
packages/gui/docs/GUI-PLATFORM.mdfor the three-layer architecture and the staged plan.Three layers
core/main/renderer+ the manifest interpreters. Knows no product.src/shared/product/(pure, node-free data). Declares identity, projectmarkers, and screens → steps → (command, parser, prerequisites). Reuses the engine's existing
vocabulary (
TaskKind,DockerCommand,QaScript,PipelineKind,ThemeStarter).*Panel.tsx, now reading their step catalogs from the manifest.Changes
src/shared/product/:manifest.ts(the type),flavian.ts(a faithful reproduction oftoday's catalog),
index.ts(registry +activeManifest+ selectors),aurelius.ts(typedextension-point scaffold, intentionally not wired in).
src/core/product/:command-spec.ts(CommandDescriptor→RunSpec) andparsers.ts(output-parser registry).
main/index.tsinjectsactiveManifestintoregisterHandlers; handlers build specs, selectparsers, and derive dialog copy from it.
core/{locate-root,run-prerequisites,pipeline-run,run-init}take their product specifics asinputs; removed the now-dead
docker-commands.ts,qa-commands.ts,paths.ts.renderer/App.tsxreads brand + nav from the manifest; the panels + project gate read theircatalogs from it.
Extension point (Aurelius)
A second product is just another manifest: author
src/shared/product/aurelius.ts, register it inindex.ts→PRODUCTS, and flipACTIVE_PRODUCT_ID. No engine/core/renderer change. A typedscaffold is included, intentionally inactive.
Deferred (noted in the doc)
Panel presentation prose, the
window.flavian/flavian:*bridge namespace, and build identity(
@flavian/gui, window title, installer name) stay "Flavian" for now — shared transport / buildidentity, out of scope for this behaviour-preserving seam.
Test plan
pnpm --filter @flavian/gui typecheck✅ (node + web)pnpm --filter @flavian/gui lint✅pnpm --filter @flavian/gui test✅ 53 passed (was 41; adds thecommand-spec+manifestengine tests)pnpm --filter @flavian/gui build✅pnpm --filter @flavian/gui smoke✅ packaged app launches; shell brand rendersFlavian🤖 Generated with Claude Code