Skip to content
bitzorcas
中EN

Concept

Generated Output, Profiles, and Composition Evidence

Examine native Consumer Solution output, Host composition, Business Starter, commercial package closure, manifests, plans, and ownership boundaries.

Last updated

[!TIP] This page dissects the output of the dotnet new bitzorcas-host template matrix. For greenfield projects prefer the bitz scaffolder; both channels share the same verified consumer baseline.

Template output is a customer-owned solution plus a commercial package-consumption closure. The main example is Acme.ServiceDesk, generated from default-business-multi + sqlsugar, with differences for Mini, Single, and extension Profiles called out.

Ownership boundary

Consumer repository

Hosts

Business Starter source

Unit / Architecture Tests

Manifest / Plan / Lock Files

Commercial Feed

Profile / Framework / Workflow / Licensing

Generators / ORM / Platform / Industry

Customers may modify Hosts and Starter Module while preserving generated architecture rules. Framework, Platform, Workflow, Licensing, and Generators arrive as NuGet packages and should not be copied into a local fork.

Multi Business tree

Acme.ServiceDesk/
├── Acme.ServiceDesk.slnx
├── Directory.Build.props
├── Directory.Build.targets
├── Directory.Packages.props
├── NuGet.Config
├── README.md
├── composition-manifest.json
├── composition-manifest.schema.json
├── composition-plan.json
├── src/
│ ├── Hosts/
│ │ ├── Acme.ServiceDesk.Api/
│ │ │ ├── Authentication/
│ │ │ ├── Composition/
│ │ │ ├── Configuration/
│ │ │ ├── Schema/
│ │ │ ├── Tenancy/
│ │ │ ├── Program.cs
│ │ │ └── appsettings*.json
│ │ ├── Acme.ServiceDesk.AppHost/
│ │ └── Acme.ServiceDesk.ServiceDefaults/
│ └── Modules/Business/Starter/
│ ├── Acme.ServiceDesk.Modules.Business.Starter.Contracts/
│ └── Acme.ServiceDesk.Modules.Business.Starter.Application/
└── tests/
├── Acme.ServiceDesk.Unit.Tests/
└── Acme.ServiceDesk.Architecture.Tests/

Output has no JobHost, frontend project, deployment YAML, maintenance script, or foundation product source. If a file is absent, first inspect the Profile contract rather than assuming interrupted generation.

Base output differences

Project/capabilityMini API SingleDefault Business SingleDefault Business Multi
API✓✓✓
ServiceDefaults✓✓✓
Unit / Architecture Tests✓✓✓
Business Starter Contracts/Application—✓✓
AppHost——✓
Tenancy contractfixed tenant contextfixed tenant contextauthenticated tenant_id claim
Deploymentnonenoneaspire
SQL Server development orchestration——AppHost

Mini Development Shell runs without SQL Server. Business Profiles require a real database contract. Single relies on a deployment runbook for connection and schema; Multi uses AppHost for development orchestration.

API Host is the composition root

Program.cs owns:

  • fail-closed configuration validation;
  • ServiceDefaults, Problem Details, Forwarded Headers, and OpenAPI;
  • current tenant, current user, and persistence execution context;
  • generated Module, Endpoint, and ORM Adapter registration;
  • Mediator pipelines, License, JWT, and Authorization;
  • health, tenant middleware, and Endpoint mapping;
  • process entries for schema or Platform operations.

Business rules do not belong in Host. Inspect composition calls:

Terminal window
rg -n 'AddBitzOrcas|MapBitzOrcas|MapAllGeneratedEndpoints|UseBitzOrcasModules' \
src/Hosts/Acme.ServiceDesk.Api/Program.cs

SqlSugar and EF Core emit different Program.cs code. Provider selection is physical registration, not a runtime decision from manifest. Real rg hits across both wiring surfaces:

bitzorcas-host session
$ 
68: typeof(TenantSurfaceRestrictionPipelineBehavior<,>),
79:builder.Services.AddBitzOrcasSqlSugar(options =>
137:app.UseBitzOrcasModules();
138:app.MapAllGeneratedEndpoints();

AppHost ordering

Multi AppHost:

  1. creates SQL Server and PrimaryDatabase;
  2. creates a one-shot API project resource named schema-migrator;
  3. passes --migrate-schema apply and waits for the database;
  4. starts long-running API with database and Persistence identity;
  5. uses WaitForCompletion(schemaMigrator) to prevent startup after migration failure.
Terminal window
rg -n 'AddSqlServer|AddDatabase|schema-migrator|WaitForCompletion' \
src/Hosts/Acme.ServiceDesk.AppHost/Program.cs

Authorization Multi also adds RabbitMQ and authorization-bootstrap. Other Multi Profiles should not contain those resources.

Business Starter is a complete vertical slice

The Contracts WorkItem is both aggregate and persistence fact:

  • derives from TenantAggregateRoot<string>;
  • [BitzTable] declares tenancy and soft delete;
  • [BitzColumn] declares title constraints;
  • public parameterless construction exists only for ORM materialization;
  • business creation flows through Create, returning stable errors for invalid tenant/title.

Application CreateWorkItemCommand:

  • generates POST /api/work-items through [GenerateEndpoint];
  • implements IAuthorizedRequest with resource and Create action;
  • resolves tenant from trusted ICurrentTenant;
  • saves through ICommandRepository<WorkItem,string>;
  • relies on generated transaction, DI, Endpoint, and ORM wiring.
Terminal window
rg -n 'BitzTable|TenantAggregateRoot|GenerateEndpoint|ICommandRepository' \
src/Modules/Business/Starter

Do not add a parallel Entity, Mapper, MappingSpec, DataPort, or Infrastructure project for the same fact. That breaks the unified aggregate path and architecture gate.

Commercial packages and central versions

Directory.Packages.props controls versions, while NuGet.Config fixes Feed source mapping. API consumes a Profile package:

OutputProfile packageORM package
MiniBitzOrcas.Profile.Mini.Apimatching SqlSugar or EF Core Infrastructure
BusinessBitzOrcas.Profile.Default.Businessmatching SqlSugar or EF Core Infrastructure

Starter Contracts depend on Domain, Persistence Metadata, and Generator packages. Application depends on Application, Modularity, and a conditional Industry package. Project direction remains Host → Application → Contracts.

composition-manifest.json

The manifest is resolved composition fact, currently schemaVersion=2:

FieldPurpose
profileChoice/profileId/profilePackageIdpublic selection and commercial Profile
runtimeAdapterphysical ORM
tenancy/deploymentrequest isolation and topology
platformModule/industryExtensionconditional closure
hosts/projectsphysical solution members
modules/capabilitiesModules, Endpoints, Jobs, tenancy contracts
packages/packageReferences/projectReferencesdependency closure and direction
generators/endpointAssemblies/jobAssembliescompile-time discovery
licenseFeaturesRuntime License requirements
verificationsuggested verification commands
excludedexplicitly unselected capabilities
Terminal window
# Confirm schema, Profile, and ORM identity first.
# Then review runtime members, License requirements, and explicit exclusions.
jq '{
schemaVersion,
profileChoice,
runtimeAdapter,
hosts,
modules,
capabilities,
licenseFeatures,
excluded
}' composition-manifest.json

Manifest does not read runtime state or prove Feed tokens, License, database, or business configuration.

composition-plan.json

Plan is the physical output list, currently schemaVersion=1:

  • selectedProjects: projects that belong in the solution;
  • selectedEndpoints / selectedJobs: entries declared by the Profile;
  • writeFiles: files native generation should create;
  • removePaths: paths removed for the selected branch.
Terminal window
# selected fields describe selection; writeFileCount describes physical output.
# removePaths should agree with conditional pruning for the current Profile.
jq '{
schemaVersion,
selectedProjects,
selectedEndpoints,
selectedJobs,
writeFileCount: (.writeFiles | length),
removePaths
}' composition-plan.json

Plan is not input to another script. Editing it adds no project, package, or Endpoint. Generate another Profile from the exact template version into an empty directory.

Platform Profile increments

Authorization output adds:

  • BitzOrcas.Platform.Authorization and matching Provider/CAP wiring;
  • platform.authorization license feature;
  • Authorization schema/operations command;
  • Platform adoption tests;
  • RabbitMQ, post-schema bootstrap, and separate operations identity in Multi AppHost.

MasterData adds its runtime package, Provider, license feature, and adoption tests, but not Authorization RabbitMQ/bootstrap files. Implementation still comes from commercial packages; Consumer owns Host wiring and adoption evidence.

Industry Profile increments

Finance, HR, Auction, and Legal Profiles add the matching industry package and capability to Starter Application and retain IndustryExtensionAdoptionTests. They do not generate a new industry business-module source tree; customers build their owner Module on the package contract.

Inspect manifest closure because Auction or Legal can include Finance through dependencies.

Test projects

Unit Tests cover Result, License composition, Profile/ORM, schema, Starter Aggregate, and conditional extension adoption. Architecture Tests enforce:

  • no copied Framework/Platform source;
  • no ORM/Host dependency from Application;
  • aggregate invariants remain in the aggregate;
  • owner-private types do not leak through public contracts;
  • Handler and Endpoint stay slice-local;
  • Module/Host references and generated wiring obey boundaries.
Terminal window
dotnet test tests/Acme.ServiceDesk.Architecture.Tests \
--configuration Release

Keep these as continuous gates after generation.

Extension locations

RequirementModify/addDo not modify
New invariantowner Module AggregateAPI Program.cs
New use casesame Module Command/Query + Handlergeneric Framework
New Endpointgeneration attribute on the use caseglobal handwritten route registration
New persistent fieldunified aggregate metadata + schemaparallel Entity/Mapper
Platform/Industry adoptionHost wiring, owner contract, testsmanifest text alone
Commercial package upgradecentral versions + locks + evidencecopied commercial source

See also

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%