Skip to main content

Declarative bootstrap

Before authentication becomes available, browser HTML navigations display only a localized “Starting the instance” message and an activity indicator. The page has no dependency on Console assets or identity storage. It polls GET /startup/ready every two seconds; this anonymous, non-cacheable probe returns an empty HTTP 503 while login is unavailable and HTTP 204 once administration or full readiness is available. The browser then replaces the waiting page with /login, preserving a validated local return URL. /startup also exposes the waiting page directly. Neither the page nor its probe discloses Bootstrap resources, errors or progress. API requests retain the ordinary initialization fence and Problem Details response; /health/ready continues to represent full application readiness. Authenticated Bootstrap progress and the temporary administrator-only sign-in policy are described below.

Agentstration treats Agentstration:Bootstrap:Path as the root of a profile catalog. Each immediate child directory is one independently selectable profile. Startup applies the ordered Agentstration:Bootstrap:InitialProfiles list only when Agentstration:Bootstrap:InitialBootstrapEnabled is true. Initial bootstrap is disabled by default.

Profiles use configuration order; files inside each profile use ordinal lexical filename order. Use profile order for dependencies across profiles and numeric filename prefixes for dependencies inside one profile. A file may contain one YAML resource or several YAML documents separated by ---. Bootstrap runs after persistence initialization under the fenced instance initialization lifecycle. Handlers only create absent resources and never reconcile existing ones. Legacy endpoint synchronization can run before and after Bootstrap only when Agentstration:Extensions:DiscoverOnStartup is explicitly enabled; it is disabled by default. New staged startup accepts extension-initiated announcements instead.

For example:

deploy/bootstrap/profiles/
base/
10-tenant.yaml
development/
00-platform-administrator.yaml
20-workspace.yaml
demo/
10-demo-resources.yaml

Profile names identify one immediate child directory. Absolute paths, separators, . and .. are rejected. A selected profile must exist and may appear only once. The root and selected profiles fail clearly when an enabled startup is misconfigured; an existing selected profile without YAML files is a valid no-op.

Initial topology​

An initial local topology is composed from four independent resources. The Platform administrator is intentionally first because it is global to the instance and does not belong to a Tenant or Workspace.

00-platform-administrator.yaml:

apiVersion: agentstration.io/v1
kind: PlatformAdministrator
metadata:
name: admin
definition:
displayName: Platform administrator
email: admin@example.test
passwordFrom:
configuration: Agentstration:Bootstrap:Secrets:AdminPassword

10-tenant.yaml:

apiVersion: agentstration.io/v1
kind: Tenant
metadata:
name: dev
definition:
displayName: Development

20-workspace.yaml:

apiVersion: agentstration.io/v1
kind: Workspace
metadata:
name: default
definition:
displayName: Default workspace
tenantRef:
name: dev

30-principal-default-context.yaml:

apiVersion: agentstration.io/v1
kind: PrincipalDefaultContext
metadata:
name: admin
definition:
principalRef:
localAccount: admin
tenantRef:
name: dev
workspaceRef:
name: default

PrincipalDefaultContext is a navigation preference, not an authorization grant. Its metadata.name must match principalRef.localAccount. The referenced account, Tenant, and Workspace must already exist, and the Workspace must belong to the referenced Tenant. A different persisted default is reported as a non-fatal conflict rather than overwritten.

A Platform administrator has instance-wide access to every active Tenant and Workspace, including resources created later. Bootstrap does not create Tenant memberships, Workspace memberships, or role assignments for that Principal. Ordinary Principals still require their normal memberships and roles.

Manual profile application and bindings​

After initialization, a Platform administrator can open System → Bootstrap profiles to compose profiles in lexical dependency order, choose an explicit Tenant or Workspace target, resolve profile bindings, preview the complete application, and apply it. Preview is side-effect free and its digest covers the ordered profile contents, scope, target, and binding selections. The retained application history records the actor, target, selections, outcomes, and partial failures.

Workspace profiles can declare ordinary interactive bindings. The connectedService binding is also supported in Instance and Tenant profiles; other ordinary binding kinds retain their existing restrictions. Automatic extension contribution bindings remain supported in all profile scopes. Each declaration is typed and may provide a default target for non-interactive application:

apiVersion: agentstration.io/v1
kind: BootstrapProfile
metadata:
name: solution-discovery
definition:
displayName: Solution discovery
targetScope: workspace
bindings:
- name: agent-model
targetKind: modelProfile
displayName: Agent model
required: true
defaultTarget:
name: reasoning-default
namespace: default

An ordinary resource references the declaration through a reserved structured object:

definition:
modelProfile:
binding: agent-model

The resolver replaces only an object containing the single binding property with the selected ResourceReference; it does not perform string interpolation. A selection cannot cross Workspace boundaries. It may reference existing state or a compatible resource planned earlier in the same composed application. Required unresolved bindings, unknown names, malformed placeholders, and unavailable or type-incompatible targets invalidate preview. Secret bindings carry only a resource reference, never the secret value.

Connected Service consumers​

Declare targetKind: connectedService and use connectedService: {binding: documents-database} in a Storage. The selected resource is resolved through the same native service revision/export validation as resourceRef; its values and Secret remain owned by the service. Use an explicit scope for an ancestor; unrelated scopes and stale, unavailable or incompatible dependencies are refused. A manual plan may select a connection created by an earlier producer profile. Preview stays read-only and marks unavailable predecessor validation as deferred.

The Nantes catalogue now separates nantes-postgresql (optional local connection) from nantes-alertes (consumer). Fresh local installations select them in that order; an existing nantes-alertes-postgresql connection remains the default. Managed previews select preview-postgresql-documents and explicitly bind its connection. No second Nantes password is needed. Existing installed resources are retained on replay.

Credentials and deployment​

Configure the path without putting a production password in YAML:

{
"Agentstration": {
"Bootstrap": {
"Path": "./bootstrap/profiles",
"InitialBootstrapEnabled": true,
"InitialProfiles": [
"base",
"production"
]
}
}
}

Supply the referenced value through any normal .NET configuration provider. For example, a container can mount declarations read-only and inject the secret separately:

volumes:
- ./bootstrap:/app/bootstrap:ro
environment:
Agentstration__Bootstrap__Path: /app/bootstrap/profiles
Agentstration__Bootstrap__InitialBootstrapEnabled: "true"
Agentstration__Bootstrap__InitialProfiles__0: base
Agentstration__Bootstrap__InitialProfiles__1: production
Agentstration__Bootstrap__Secrets__AdminPassword: ${ADMIN_PASSWORD}

The password must satisfy the ASP.NET Core Identity policy. Identity validates and hashes it; Agentstration never adds it to a canonical resource or logs it. If the declared account already exists and its Principal is already a Platform administrator, bootstrap skips it without resolving the password. Password changes therefore survive restarts. An existing account without the declared grant is a non-fatal conflict: startup continues without changing its password or granting new privileges.

Outside Development, Agentstration does not choose or activate an unattended topology. Supply explicit manifests and the referenced secret, or use the one-time interactive /bootstrap page. The page asks for the initial account, Tenant, and Workspace; it creates the same global Platform administrator plus its default context.

Visual Studio and local Development​

The default http and https launch profiles use deploy/bootstrap/profiles as their catalog, enable initial bootstrap, and select development. They are available from Visual Studio or the command line:

dotnet run --project src/Agentstration.Web
dotnet run --project src/Agentstration.Web --launch-profile https

Both Development profiles create admin / admin, Tenant dev, Workspace default, and the administrator's default context on a fresh instance. The known credential is a development fixture, not a secret: never use these profiles for an exposed or production instance. Development relaxes the local Identity password policy to accept it; every other environment retains the strong password policy.

Use the corresponding explicit profile when Development must start without applying initial profiles:

dotnet run --project src/Agentstration.Web --launch-profile http-NoBootstrap
dotnet run --project src/Agentstration.Web --launch-profile https-NoBootstrap

Build configuration and host environment are independent. dotnet run --configuration Release still uses the default http launch profile and its Development bootstrap settings. Use a NoBootstrap profile or --no-launch-profile when initial bootstrap must be disabled. A NoBootstrap profile changes only InitialBootstrapEnabled; the catalog path and selected profiles remain configured for later manual application.

When Visual Studio starts Agentstration.AppHost, select the profile on that startup project. Its https profile passes the resolved catalog path, activation flag, and ordered initial profiles to the orchestrated Console; https-NoBootstrap forwards the same catalog selection with initial bootstrap disabled:

dotnet run --project src/Agentstration.AppHost
dotnet run --project src/Agentstration.AppHost --launch-profile https-NoBootstrap

An invalid or duplicate profile name, a missing selected profile, malformed YAML, an unsupported apiVersion, an unknown kind, a missing required field, a missing referenced resource, or an absent referenced configuration value fails enabled startup explicitly.

InitialBootstrapEnabled controls startup application only. It does not disable profile loading itself: the PlatformAdmin-only Console and HTTP API can preview and apply explicit ordered profile lists independently of the startup flag.

Extension boundary​

Staged initial startup​

Startup always proceeds in phases, so extension announcements and late contributions can be accepted while dependent resources are prepared. No activation option is required:

{
"Agentstration": {
"Bootstrap": {
"Path": "./bootstrap/profiles",
"InitialBootstrapEnabled": true,
"ExtensionDependencyTimeout": "00:10:00",
"InitialProfiles": ["base"],
"InitialApplications": [
{
"Profiles": ["tenant-resources"],
"TargetLevel": "/tenants/acme"
},
{
"Profiles": ["workspace-resources"],
"TargetLevel": "/tenants/acme/workspaces/operations"
}
]
},
"Aep": { "Enrollment": { "AutoEnrollmentLevel": "/instance" } }
}
}

InitialProfiles target the instance. Each additional application selects profiles of one scope and an explicit target resolved after topology creation. Scoped applications use an existing global Platform administrator; the initial topology may create it first. InitialApplications use the same startup sequence as instance profiles.

The sequence is storage, structural preparation, topology, enrollment policies, required contributions, resolved references, dependent resources, then readiness. Within each phase, file/profile order remains deterministic. Required extensions are derived from selected public references and consumed bindings, not a global list. Unrelated optional extensions do not block startup.

The listener accepts health and POST /api/aep/enrollments/announce during this sequence. /health/ready and other operations return 503 until completion. Application workers start afterward, preserving their original order. A required extension may therefore arrive after its destination Workspace is created.

The dependency timeout is bounded between one second and thirty minutes and defaults to ten minutes, allowing recovery of an interrupted automatic assignment lease. Missing contributions report the profile/file, consumer and public identity; disabled contributions and ambiguous selectors fail explicitly. Newly discovered ordinary Tools keep their existing disabled default. An extension-declared bundle may enable its own required Tools through the existing trusted bundle lifecycle. Bootstrap never overrides an operator's disabled-resource decision just to satisfy a reference.

Changing the catalog while startup waits fails the application. Completed topology, assignments and resources survive retries; the handlers preserve existing state. Staged startup repeats the idempotent readiness sequence under the initialization lease even when the durable initialization version is already Ready. New optional announcements remain eligible for policy-driven assignment after startup.

All standalone startup uses this phased lifecycle. NoBootstrap skips initial profile application without selecting another startup path. Manual preview stays read-only and reports unavailable dependencies without enrolling or preparing them. Durable manual progress remains the separate workflow tracked by issue #871.

Public extension and contribution references​

A ModelProvider can select its extension by public AEP identity instead of a local registration name:

definition:
extension:
id: Agentstration.Extensions.Foundry
# instanceId: <stable-installation-uuid> # disambiguates several installations
contributionId: microsoft-foundry

Use either the existing name-based reference or the public selector, not both. Bootstrap resolves the selector to the enabled registration visible from the consumer's scope. An enrollment record must be Available. Multiple visible installations require an explicit instanceId; resolution never picks the first.

For an extension-owned resource, use a typed automatic profile binding:

definition: # inside profile.yaml
targetScope: workspace
bindings:
- name: search-tool
targetKind: tool
extensionTarget:
extensionId: example.search
kind: Tool
contributionId: search
# version: 1.0.0

The consumer uses the existing { binding: search-tool } placeholder at its Tool reference. Only bindings used by selected resources become extension requirements. The same replacement works inside a PackInstallation binding's target while Pack resources retain their normal ownership. Public contribution bindings cannot also declare defaultTarget or receive a local-name override from the apply API.

A direct structured placeholder is also available:

definition:
type:
extensionContribution:
extensionId: example.services
kind: ConnectedServiceType
contributionId: example-api
version: 1.0.0

Supported contribution kinds are Tool, ConnectedServiceType, StorageType and an installed bundle's DataSourceProfile. Their binding target kinds are tool, connectedServiceType, storageType and dataSourceProfile respectively. ExtensionRegistration selects the registration itself. Service and Storage Type placeholders replace the complete native type reference, including UID/version/ digest pins. Ordinary resources authored by Bootstrap keep their declared names and are referenced normally by later manifests.

Preview is read-only. Missing, disabled, wrong-version or ambiguous contributions invalidate it with a diagnostic. Resolved identities participate in its digest; application rejects changed authoritative selections.

Automatic SharedKeyFile enrollment​

Set Agentstration:Aep:Enrollment:AutoEnrollmentLevel to /instance, /tenants/<name-or-id>, or /tenants/<name-or-id>/workspaces/<name-or-id> to assign verified SharedKeyFile installations without manual scope selection. UUID-shaped segments select IDs; other segments select exact names. The target must exist and be active, and a Workspace must belong to the selected Tenant. Without a configured destination, assignment remains manual.

An instance profile can override the default for one extension or installation:

apiVersion: agentstration.io/v1
kind: ExtensionEnrollmentPolicy
metadata:
name: utilities-enrollment
definition:
extensionId: Agentstration.Extensions.Utilities
# instanceId: <stable-installation-uuid> # optional
autoEnrollmentLevel: /tenants/dev/workspaces/default

An installation-specific policy takes precedence over an extension policy, then the global default. Omit autoEnrollmentLevel from a policy to retain manual assignment for its selector even when a global default exists. Conflicting selectors are rejected. Policies are instance-owned and create-only; existing assignments, disabled registrations and explicitly unenrolled installations are preserved. SharedKeyFileAllowed: false cannot be overridden by a policy. The effective policy is also applied to verified announcements arriving later.

Each extension must still be configured with its own key file, authority URL, public endpoint and durable installation state. Aspire, Compose or the operator owns that process and key lifecycle; Bootstrap never launches extensions.

Several installations of one public extension can use independent trusted files under Agentstration:Extensions:<extension-id>:Instances:<instance-id>:SharedKeyFile:Path. An installation-specific EnrollmentMode or RegistrationName can also override that extension's defaults. Default registration names receive an installation suffix when needed; an explicitly configured name that is already bound to another installation fails instead of replacing its connection.

Each supported kind is implemented by an IBootstrapResourceHandler, which owns its business identity and calls the existing resource boundary. This avoids assuming that all resources use kind + metadata.name as their existence key.

Instance profiles declare ModelProvider and RuntimeProfile resources. ModelProfile and Agent may be declared at Instance, Tenant or Workspace scope. Workspace profiles support direct editable ModelProfile, Agent, Flow, and Entry manifests, with explicit access grants for ancestor dependencies. They also support PackInstallation with a bounded local ZIP source beneath the profile directory; those contained resources retain normal Pack ownership and immutability.

Agent generation preparation​

After creating an Agent, Bootstrap prepares its immutable executable revision through the Agent family service, using the exact ownership scope and generation. This is the preparation performed by the Console's Apply generation action; it does not start an extension process, create a server-hosted deployment or run model inference. A preparation failure fails the Bootstrap resource application.

Reapplication preserves the saved Agent definition and ETag. It may finish a missing initial revision only when the saved generation is still 1 and the saved definition exactly matches the selected Bootstrap definition. This also repairs unchanged Agents created by older Bootstrap versions. Existing revisions are reused. A changed manifest or a later manually edited generation is not activated automatically; use the ordinary explicit Apply action for those cases.

Flow authoring requirements​

Bootstrap Flow manifests use named output steps for every terminal result. Manifests must not use the removed, unreleased failure step. Declare at least one successful output and one error output; completed and error are the recommended names. An error output declares outcome: error and should provide a stable code, message, and an outputMapping when the failure payload must be preserved.

Every Agent and Tool step exposes success and error; both paths must be connected. Every Flow-call step must likewise connect each named error output declared by the called Flow, using that output name as the transition event. Put referenced Agents and child Flows earlier in lexical profile order than their consumers.

steps:
- { type: agent, name: answer, agent: { resourceId: support-agent } }
- { type: output, name: completed, outcome: success, outputMapping: "${transition.output}" }
- { type: output, name: error, outcome: error, code: SUPPORT_FAILED, message: The support Agent failed., outputMapping: "${transition.output}" }
transitions:
- { id: answer-completed, fromStep: answer, event: success, toStep: completed }
- { id: answer-error, fromStep: answer, event: error, toStep: error }

The empty Flow template already supplies both terminal outputs. In the visual Designer, adding an Agent, Tool, or Flow call automatically connects its conventional error event to the first error terminal when one exists. Bootstrap preview and Flow validation reject missing required error paths.

Complete local Bootstrap with an external extension​

The versioned bootstrap-openapi example enrolls an externally started OpenAPI extension, waits for its bundle and enabled discovery Tool, then creates a published ToolSet and a DataSource using the contributed DataSourceProfile. The bootstrap-workspace-example profile creates a published, active echo Flow and Entry in the explicit dev/default Workspace. Creating these resources does not contact example.invalid or execute upstream discovery.

Compose​

From the repository root, use the opt-in overlay on the deterministic topology:

docker compose -f deploy/compose/base.yml -f deploy/compose/bootstrap.yml config --quiet
docker compose -f deploy/compose/base.yml -f deploy/compose/bootstrap.yml up -d --build
curl --fail http://localhost:5080/health/ready

The overlay selects development and bootstrap-openapi at instance scope, then bootstrap-workspace-example at /tenants/dev/workspaces/default. It uses the public disposable Development account admin / admin. Use a separate Compose project and configure a real administrator password before adapting this example to another environment. The overlay adds an independent key volume for the OpenAPI extension, read-only key mounts on both sides, and persistent writable installation state. All Compose extension services now announce themselves using SharedKeyFile; assignment remains manual unless an automatic policy is enabled.

Health becomes live while required contributions are still pending. Readiness and normal APIs remain unavailable until the full Bootstrap completes. An extension may start after the server; no dependency on server readiness is needed for its announcement. Compose, Aspire, or the operator owns the extension process. Bootstrap does not install, launch, restart, or supervise it.

Stop and restart the topology without deleting volumes to retain installation IDs, keys, enrollment records and resources. Reapplication is create-only and keeps user changes. Do not run down --volumes when testing recovery. Rotating a key or replacing installation state is an explicit operator enrollment action; an existing identity is never inferred from a new key or process endpoint.

Aspire​

For the complete repository-owned example, use the explicit opt-in launch profile:

dotnet run --project src/Agentstration.AppHost --launch-profile https-BootstrapExtensions

Aspire starts OpenAPI externally, provisions its key and durable installation state, and forwards the same catalog and scoped applications as Compose. The existing https and https-NoBootstrap profiles retain their PairingCode/manual settings. For a separately managed external extension, configure trust explicitly and select SharedKeyFile mode rather than relying on those default profiles.

AppHost forwards dependency timeouts, ordered scoped InitialApplications, effective enrollment mode gates, AutoEnrollmentLevel, and external extension trust metadata. Its launch profile still owns catalog path resolution and initial activation, and its generated key files remain authoritative for bundled extensions. Configure the following keys in AppHost configuration (environment variables use double underscores in place of colons):

{
"Agentstration": {
"Bootstrap": {
"ExtensionDependencyTimeout": "00:10:00",
"InitialProfiles": ["development", "bootstrap-openapi"],
"InitialApplications": [{
"Profiles": ["bootstrap-workspace-example"],
"TargetLevel": "/tenants/dev/workspaces/default"
}]
},
"Aep": {
"EnrollmentMode": "SharedKeyFile",
"Enrollment": { "AutoEnrollmentLevel": "/instance" },
"Transport": {
"AllowedHttpHosts": ["localhost"],
"AllowedPrivateNetworkHosts": ["localhost"]
}
},
"Extensions": {
"Agentstration.Extensions.OpenApi": {
"EnrollmentMode": "SharedKeyFile",
"SharedKeyFile": { "Path": "/absolute/path/to/openapi.key" }
}
}
}
}

Start the OpenAPI extension separately with Aep:EnrollmentMode=SharedKeyFile, Aep:SharedKeyFile:Path pointing to that same key file, Aep:SharedKeyFile:AuthorityUrl pointing to the orchestrated server's HTTP endpoint, Aep:SharedKeyFile:PublicEndpoint pointing to its own reachable endpoint, and a durable Aep:SharedKeyFile:StateFile. For local HTTP, explicitly set Aep:SharedKeyFile:AllowInsecureHttp=true. OpenApi:AllowedDomains can remain unset for enrollment; a fresh installation denies outbound destinations until an allowlist is applied through Extensions or Bootstrap. Use stable externally advertised ports when retaining an installation across orchestration restarts. Start AppHost with a Bootstrap-enabled profile and override the ordinary profile's PairingCode mode with -- --Agentstration:Aep:EnrollmentMode SharedKeyFile. https-NoBootstrap continues to skip initial application while retaining the same phased host lifecycle.

Existing manually assigned PairingCode and SharedKeyFile installations remain valid. Keep automatic enrollment unset to preserve manual assignment. Startup always uses the phased lifecycle, waiting only for contributions selected by the enabled initial applications. Existing installations are not moved when a default or manifest policy changes.

Migrating legacy endpoint discovery​

Disable Agentstration:Extensions:DiscoverOnStartup before switching an existing connection to extension-initiated announcements. Retain its RegistrationName, public extension ID, exact scope, endpoint and SharedKeyFile trust mapping; use an explicit policy for that same scope. A matching enabled registration is reused. A disabled registration fails with registration_disabled and is never enabled by automatic assignment. Existing closed enrollment records remain closed. Inspect differing endpoints or scopes before enabling the policy; choose an explicit registration name to reject collisions rather than creating a distinct installation registration. Do not run legacy discovery alongside this migration, because its configuration synchronization remains a separate operator action.

Reproducible executable check​

After a Release build, run the repository-owned process smoke check:

python3 scripts/bootstrap/test-external-enrollment.py

It uses fresh temporary SQLite stores and a generated key, starts Web before the external OpenAPI host, checks the readiness/API barrier, verifies contributed and ordinary resources, then restarts both processes using the same state and checks installation, assignment and resource preservation. It requires no live model, upstream API or Docker. Logs stay in the printed temporary directory. The functional integration suite separately covers missing contributions, timeouts, partial provisioning failure, unrelated absent extensions and catalog changes.

Ollama instance, Tenant and Workspace example​

The repository includes a complete local example using qwen3:1.7b:

ProfileTargetResult
developmentInstanceDisposable admin / admin account, Tenant dev, Workspace default and navigation default
ollama-instanceInstanceSharedKeyFile enrollment override for Agentstration.Extensions.Ollama, bootstrap-ollama Model Provider and an explicit provider grant to dev
ollama-tenant/tenants/devollama-chat Model Profile (qwen3:1.7b, temperature 0.2) and a grant to dev/default
ollama-workspace/tenants/dev/workspaces/defaultollama-assistant Agent, with French instructions and no Tools

The Agent references the Tenant Model Profile by its ordinary name and the instance maf-builtin runtime. Platform provisioning already shares this runtime with business Workspaces. A Model Provider is instance-owned; visibility alone does not authorize its use by a Tenant. The example therefore declares each required discover/use grant explicitly, without granting another Tenant or Workspace access.

Start with Aspire​

Start Ollama locally and obtain the model first:

ollama serve
# In another terminal, once Ollama is listening:
ollama pull qwen3:1.7b
dotnet run --project src/Agentstration.AppHost --launch-profile https-BootstrapOllama

If Ollama already runs as a service, keep that process and run only the pull and AppHost commands. AppHost uses http://localhost:11434 by default; configure Ollama:Endpoint for another server. AppHost starts the existing Ollama AEP extension externally and provisions its shared key and durable installation ID. Only Ollama has an automatic enrollment override in these manifests. The other bundled extensions can remain pending without blocking this Bootstrap.

Use the public disposable Development account admin / admin to inspect the instance provider, the dev Model Profile and the dev/default Agent. The bootstrap creates configuration and does not download model weights or execute inference. The model name can be changed in deploy/bootstrap/profiles/ollama-tenant/10-model-profile.yaml before the first application; pull that model on the configured Ollama server as well.

Start with Compose​

The overlay reuses the existing Ollama topology, including its worker, per-extension key volumes and installation state:

docker compose -f deploy/compose/ollama.yml -f deploy/compose/bootstrap-ollama.yml up -d --build ollama
docker compose -f deploy/compose/ollama.yml -f deploy/compose/bootstrap-ollama.yml exec ollama ollama pull qwen3:1.7b
docker compose -f deploy/compose/ollama.yml -f deploy/compose/bootstrap-ollama.yml up -d --build
curl --fail http://localhost:5100/health/ready

The default HTTP port is 5100 and may be overridden by AGENTSTRATION_HTTP_PORT. Retain data, key and installation volumes on restart. Use these Development credentials only for this local fixture.

Bootstrap access-policy declarations​

An access declaration is local administrative Bootstrap input. It creates the existing UID-bound access overlay; it is not an exported overlay or a Pack resource. Managed bundle contexts are rejected in preview and apply. The resource belongs to the current profile target. Place its manifest before the policy, and apply the owner's profile before any descendant consumer:

apiVersion: agentstration.io/v1
kind: ResourceAccessPolicy
metadata: { name: bootstrap-ollama-to-dev }
definition:
resource: { kind: ModelProvider, name: bootstrap-ollama, namespace: default }
grants:
- targetLevel: /tenants/dev
actions: [discover, use]
includeDescendants: false

targetLevel uses the same active name/ID selectors as initial applications. Only descendants of the owning profile target are valid; self, sibling, ancestor, unknown and cross-Tenant targets fail. includeDescendants is optional and defaults to false. Bootstrap resolves the resource UID and current generation/version on the server and writes through the existing authorized, audited access-policy service. Preview performs no writes.

An existing overlay is skipped, including a policy whose grants were revoked. Bootstrap never merges or replaces it. Change an existing resource or policy through its ordinary administration boundary; editing an already-applied manifest does not reconcile it. Installing or starting an extension or downloading a model remains the external orchestrator/operator's responsibility.

The offline real-process check for this example is:

python3 scripts/bootstrap/test-external-enrollment.py --example ollama

It starts the actual Web and Ollama extension hosts, waits for SharedKeyFile enrollment, checks the instance provider, Tenant model and Workspace Agent, then restarts both processes with retained identities. It uses a local deterministic Ollama HTTP fixture for model discovery; no live Ollama backend, model weights or inference are required.

Required models and responsive administration​

The extension's transport credential remains private to its registration scope. A Tenant or Workspace using a shared instance Model Provider does not need a discover/use grant on that credential. The AEP adapter resolves it in a narrow infrastructure context, retaining the Secret's explicit registration consumer, ancestry and use-policy checks, then restores the caller before sending HTTP. This does not grant infrastructure access to provider Value Bindings or to the rest of inference. Missing or unauthorized credentials still fail before transport.

Staged startup queues Model Provider discovery before applying dependent Model Profiles. Each Model Profile requires its exact external model identifier, including its tag; a different installed model does not satisfy the dependency. Existing create-only profiles retain their saved definition and are checked against that definition. A required provider gets an immediate initial attempt even if a previous process retained a later retry deadline. Subsequent failures respect the discovery retry delay. Only providers needed by the selected profiles consume this wait. Optional providers are reconciled independently by the background discovery worker.

Agentstration:Bootstrap:ModelDependencyTimeout bounds each required profile's wait (default 00:02:00, allowed one second to thirty minutes). Aspire forwards this option. For example:

{
"Agentstration": {
"Bootstrap": {
"ModelDependencyTimeout": "00:02:00"
}
}
}

After topology and enrollment-policy setup, login is available to global Platform administrators while dependencies wait. Local login, Console BFF session issuance and validation, enabled OIDC sign-in, and retained authenticated sessions enforce this temporary admission rule. Workspace administrator membership alone is insufficient. Ordinary admission resumes at startup readiness.

The post-authentication gate checks retained user sessions before considering public endpoint metadata or session exit. A path prefix such as /_blazor or /api/auth cannot exempt a protected endpoint. Trusted BFF transport is identified by its verified workload authentication scheme; local session issuance and validation still apply the administrator admission policy. Startup navigation uses local redirects, with both return destinations and deployment path prefixes validated before generating browser URLs.

Browser entry after sign-in opens /startup/progress instead of the partial Console overview. The shared StepProgress component displays the coordinator's four actual stages: instance structure, required extensions/contributions, resources/dependencies, and finalization. Its selected panel follows the active stage until the administrator selects another stage; following can be resumed. Model/provider details are activity data in the generic resource panel. No panel is specific to an extension or provider implementation.

The page and permitted resource consultations use the existing Console frame, navigation and scope selector. A persistent preparation notice links back to progress, while the layout adapter avoids operational dashboard statistics. Command search remains disabled until readiness. The initial overview still opens progress, and execution/unsupported mutations remain fenced. Changing the consulted scope never changes a Bootstrap target. Stage completion and resource outcomes use the same visual primitives as other pages.

The page reads GET /api/bootstrap/startup every two seconds. This PlatformAdmin endpoint returns an attempt identity, revision, stage states, safe dependency identities and resource outcome counts. It exposes no raw exception, credential, manifest content or server file path. GET /api/bootstrap/startup/admission is an authenticated readiness-only probe used by Console routing. Both endpoints are non-cacheable and observe local state without contacting a provider or provisioning business resources. The anonymous /startup/ready login-availability probe remains empty and unchanged.

The progress tree includes only resource families present in the selected startup profiles. Structural resources, enrollment policies and required contributions are tracked alongside dependent application resources. Expanding a stage shows its actual kinds and processed/total counts; absent kinds are never rendered as 0/0. Grouping is presentation only and does not reorder dependency execution. Consecutive resources of the same kind form an ordered group; a later access-policy block has its own stable group identity, rather than sending progress back to an earlier policy group. Completed preparation groups fold automatically and can be reopened.

GET /api/bootstrap/startup/resources is PlatformAdmin-only and requires the current attemptId. Optional stepId, kind, groupId, state, search, offset and limit select a bounded server page (25 by default, at most 100; search at most 128 characters). A previous attempt returns 409. The overview snapshot carries family summaries, never all resource rows. Each row identifies its profile, source document and logical target and reports created/already-present/conflict, waiting/failure or blocked outcomes. Expand a row for the operations actually observed, including Agent definition/generation preparation. Observations retain no manifest body, secret value or arbitrary provider exception. Repeated waits update one bounded operation fact rather than appending an unbounded event log. These startup details remain process-local and restart with the current attempt; durable manual application history remains a separate contract.

For a blocked, unapplied initial Model Profile, Change provider or model opens a form in the progress panel. Choices use cached inventory and the original profile owner's provider access rules, regardless of the currently selected Console scope. Apply and resume submits a versioned substitution; the service revalidates provider identity, model availability and profile settings. A stale selection returns 409 instead of racing resource creation or another operator. The same profile name and ownership remain in place for dependent Agents.

GET /api/bootstrap/startup/resources/{resourceId}/model-options requires the current attemptId; optional providerName and providerNamespace select cached model choices. POST /api/bootstrap/startup/resources/{resourceId}/model-substitution accepts attemptId, version, an exact Instance provider, providerUid and model, returning 202. Both operations require a Platform administrator. Opening the form never initiates provider discovery or downloads a model.

Accepted substitutions are retained under Data:Directory/bootstrap-model-overrides using atomic, source-digest-bound records containing only provider/model choices and their actor/time. Source manifests and credential values are not copied or rewritten. A changed source invalidates replay, and a replaced provider requires reselection. If the model wait already failed, applying a valid correction starts a new attempt under the retained initialization lease; create-only replay retains existing resources. Other failures can still require an instance restart. Rows show the accepted substitution separately from actual application outcomes. See ADR-0247.

A reload reconnects to the current process-local attempt. Transient read failures retain the last snapshot and polling resumes automatically. At readiness the page keeps the completed results visible and stops polling. An explicit Open Console action opens a validated local return destination; completion never navigates away from the results automatically. These observations are not a durable startup journal or the manual Bootstrap application history. Startup readiness remains false until finalization. Worker communications open after structure creation, before the explicit built-in-resource and extension-contribution phases. A compatible Worker is required only by an instruction that needs execution; purely declarative profiles complete without one.

Administrators can still open provider/profile/extension repair pages with existing authorization and scope checks. Health readiness and ordinary execution routes remain unavailable. Authenticated AWP communication is admitted so Bootstrap can run discoveries through the normal durable Flow/Worker path. Atomic claims admit only server-selected Bootstrap assignments until final readiness; older pending work, recovery workers and Quartz scheduling remain suspended. Provider discovery runs independently of this fence. See ADR-0253 and ADR-0244.

If the deadline expires, the diagnostic identifies the profile, provider and exact missing model. The staged listener remains available for administrative repair; readiness stays false. Correct the saved provider configuration or install the required model upstream, inspect its discovery state, then restart the authority to retry Bootstrap. No model is substituted or downloaded automatically. Manual Bootstrap preview remains read-only and does not wait for upstream discovery.

Durable manual application and progress​

POST /api/bootstrap/applications returns 202 Accepted after persisting an application, with its stable URL in Location and its initial state in the body. Follow GET /api/bootstrap/applications/{applicationId} until definition.status is terminal. The ordinary Console HTTP timeout does not limit resource execution. Target, permission, catalog digest and resource validation are checked again by the processor before mutation; a rejected preview can therefore become a failed accepted application. Initial startup bootstrap retains its synchronous behavior.

Supply a GUID requestId with the application request. Retries with the same actor, selection and digest reuse that identity, including after completion. Reusing it for different input is rejected. A duplicate active selection from the same actor also follows the existing application. To intentionally reapply after completion, preview again and use a new request identity. At most 16 manual applications may be pending or running in the authoritative process.

The Console at /settings/bootstrap displays processed/total resources, the current resource when available, and created, skipped, conflict and failed counts. Refresh loads retained applications and resumes observing active ones. The application identity is pinned in the page URL, so a newer application from another action or administrator does not replace the selected application after reload. A temporary network failure reconnects to the same identity without submitting again. Progress is persisted at resource boundaries. It stores resource identifiers and outcomes, never manifest bodies or resolved Secret/Parameter values.

The Console can inspect each original profile YAML file from preparation, preview, the application's preparation step, or a startup resource's operation details. The read-only viewer includes profile.yaml and all top-level .yaml/.yml resource files, including every document in a multi-document file. It preserves authored valueFrom.configuration and reference markers: no configuration value is substituted. It reads the current catalogue, not an archived application snapshot. An existing preview digest is checked before displaying its source; when that catalogue changes, review a fresh preview before applying it.

POST /api/bootstrap/profiles/files accepts a profile, optional file, optional pinned source selection and optional expectedDigest. Without file, it returns the permitted filenames and profile digest; with file, it also returns the original YAML. The endpoint is Platform-administrator-only, including while startup waits, sends Cache-Control: no-store, retains catalogue size/link checks, and rejects paths outside that profile's top-level manifest allowlist.

Startup contribution rows retain their own expected extension ID, optional installation ID, contribution kind/ID/version and consuming resource. Operation details distinguish an unavailable extension from an unavailable contribution; they remain inspectable when another dependency becomes the active wait. Extension startup and enrollment still happen through their normal deployment mechanisms. The progress view opens the first unresolved dependency in plan order and places its expectation directly inside that resource's operation details. Model waits and their correction controls use the same row placement. Selecting or closing a row pauses automatic following; polling preserves that choice until following resumes. When a failure stops the plan, unopened resources are marked blocked rather than failed. Their operation details show the shared causal diagnostic and log reference, with the failing resource's identity when available. Initial discoveries run under an authorized Platform administrator created or retained by the structure phase. Their expanded resource rows show the expected Runtime capability, deadline, elapsed stage time and scoped Flow Run link. Missing Workers produce a bounded wait; timeout or cancellation prevents dependent creation. Attempt-bound admission is revoked on failure or retry, and create-only replay reuses materialized results. An explicit new application skips previously failed/cancelled discovery attempt keys, resumes an unfinished attempt and preserves successful discovery evidence. A failure in the current application stops it without an automatic retry loop.

POST /api/bootstrap/applications/{applicationId}/cancel requests cooperative cancellation. Already-created resources remain. The current resource may finish before cancellation takes effect. History distinguishes succeeded, partiallyApplied, failed, interrupted and cancelled. Process shutdown or restart interrupts active applications rather than replaying uncertain side effects; review history and preview again before explicitly reapplying. These operations retain the Platform administrator requirement and explicit target validation. The Bootstrap processor assumes one active authoritative process; this is not distributed multi-replica scheduling.

Reusable offline load profile​

The catalog includes the explicitly TEST ONLY load-test profile: 512 Tenant-scoped integer Parameters named bootstrap-load-test-001 through bootstrap-load-test-512. Choose a disposable Tenant explicitly. This profile requires no model provider, Secret, network, Docker or cloud account, and no standard launch profile applies it automatically. Preview is read-only; subsequent applications skip existing addresses and preserve changes. Builds do not generate its manifests. See the fixture notes and ADR-0246.

Duration depends on storage and hardware. The regression test holds a local handler for 16 seconds (beyond the ordinary 15-second request budget), closes the initiating client after acceptance, then verifies live durable progress, duplicate requests, completion and idempotent reapplication of all 512 committed resources.

Bootstrap catalog and manual application presentation​

The Bootstrap section uses the shared resource-list layout with catalog metrics, search, a scope filter and exact local paging of the already-loaded authorized catalog. Selection order, target/bindings, side-effect-free preview and explicit confirmation of that preview are retained. Preview results are paged at 25.

After submission, StepProgress displays preparation and ordered resource groups inside the same Bootstrap section. Its summary cards precede the step panels. Applications retain their ordered resource identities so pending groups survive reload without another preview or submission. Only names/kinds and relative source identities are added to history, not resource bodies or secrets. Older applications without this optional plan show only observed resources and say so explicitly. Application cancellation and audit details keep their existing authority and scope.

Manual plans with per-profile targets​

The Console preparation screen accepts profiles at different levels, each with its own target. Server-defined order is Instance → Tenant → Workspace; ordering within a level is preserved. Configuration of the catalog opens independently. Preview replaces the preparation screen, and confirmed application opens the shared progress component independently of the catalog. Back retains in-memory choices; any edit requires a new preview. Reloading an application resumes the same persisted identity. Preparation/preview drafts are not persisted.

The existing preview and application routes also accept applications instead of legacy profiles/target/bindings fields:

{
"profiles": [],
"applications": [
{ "profile": "topology" },
{ "profile": "tenant-settings", "plannedTarget": { "tenantName": "example" } },
{ "profile": "workspace-resources", "plannedTarget": { "tenantName": "example", "workspaceName": "default" } }
]
}

The actual scopes come from each profile descriptor, not caller-supplied scope values. target with exact tenantId/workspaceId selects existing topology; plannedTarget names topology declared earlier in the selected plan. Bindings belong to their own application item. An optional binding targetProfile refers to a preceding producer's declared resource and resolves its real owner after topology creation. The binding-target route accepts the same applications list plus consumerProfile for these planned choices.

Preview returns ordered per-profile targets and explicitly marks deferred semantic validation when topology or dependencies are not available yet. Those checks run before applying the profile; preview never writes topology or invents IDs. Missing, inactive, foreign-Tenant and operational targets fail validation. Confirmation pins the whole plan digest; application still returns 202 and one durable ID/request identity. The background worker executes the plan sequentially and reports safe profile/target identities through existing progress/history. Model requirements reuse the existing dependency barrier. A failure or cancellation stops subsequent work and retains resources already created; no rollback is promised.

The limit remains 16 unique local profiles per plan. Legacy homogeneous selections, exact Source profile selection and historical records remain compatible. Local and Source profiles cannot be mixed. See ADR-0248.

Following progress and inspecting failures​

Initial startup and manual application opt into the shared StepProgress viewport layout. Desktop panes use the remaining screen height and scroll independently; following keeps the current step and resource visible, including its bounded page. Filtering, paging or inspecting another step pauses following; scrolling alone keeps it enabled. The existing follow command resumes it. Startup resource queries optionally accept followResourceId to return the bounded page containing that matching resource; filters, group, attempt and administrator authorization still apply.

Manual applications retain optional per-resource and aggregate failure metadata: a bounded category/reason code and a generated diagnostic identity that appears in sanitized server logs. Initial snapshots and resource observations expose the same safe diagnostic while the process runs. Native validation codes are retained where available; arbitrary exception messages, provider bodies, manifest contents and secret/parameter values are excluded. The Console explains common dependency and publication failures, highlights the failed group and preserves preceding outcomes. Older history without diagnostic metadata explicitly states that the precise cause was not recorded. This additive JSON change needs no relational migration and does not introduce rollback or durable initial-startup history.

Initial progress automatically returns to following when an observed dependency wait ends and Bootstrap resumes applying resources. Scrolling a pane does not disable following. Selecting a different step or using resource filters/paging pauses inspection temporarily; resuming following clears those filters so they cannot hide the current resource. Terminal failures retain their diagnostic view.

Configured resource graphs and operation discovery​

The opt-in Nantes - Alertes profile is a complete Instance example applicable from /settings/bootstrap. ConnectedService, Vault, Secret and Schema handlers compose with Storage, DataSource and KnowledgeSource. A Schema may declare definition.publishVersion; publication delegates to the normal immutable Schema service.

resourceRef is accepted only at typed Bootstrap revision fields:

dataset:
storage:
resourceRef: {name: nantes-alertes-jsonb}
documentCollection: alertes
acquisition:
operation:
resourceRef: {name: nantes-operations, output: alertes}
parameters:
path: {dataset_id: 244400404_alertes-notifications-nantes-metropole}
query: {limit: 20}

The default namespace and logical scope are the consuming resource's application target. namespace and scopeRef are explicit selectors, subject to normal family permissions. Missing, wrong-kind, ambiguous and unsupported forward references fail. Type selectors also require version; extension-owned types continue to use extensionContribution. Storage connectedService.resourceRef resolves its exact revision and type; each explicit {requirementId, exportName} mapping resolves the complete authoritative export descriptor. documentCollection resolves a unique collection name within the selected Storage, never across storages.

An explicit ConnectedServiceOperationDiscovery instruction declares connectedService: {resourceRef: {name: ...}} and an operations array of {name, selector, enabled}. Selectors match protocol fields exactly (operationId, method, path or HTTP endpoint, optionally responseStatus and responseMediaType). An output alias does not rename an operation. Only an unambiguous, available, read-only operation can satisfy acquisition. An already modified/disabled operation is retained for explicit operator review.

Preview never invokes discovery. Rows identify deferred contract/parameter checks when earlier dependencies have not yet materialized. Execution validates resolved native definitions before creating consumers, stopping after the first failure. Discovery-bearing profiles support both initial Bootstrap and manual application. Their compatible Worker can connect before readiness, and only Bootstrap-owned assignments are admitted during initialization. Successful prerequisites remain after a partial application.

Ordinary literal fields may use an initializer wrapper:

literal:
valueFrom:
configuration: Agentstration:Bootstrap:Parameters:NantesPostgreSqlPort
type: integer
default: 5432

type supports string, integer, number, boolean, object and array. A nonempty configured value is parsed/validated as that type; an authored ordinary default is used only when configuration is absent/empty. A Secret's top-level valueFrom.configuration must use Agentstration:Bootstrap:Secrets:*; it has no plaintext manifest default. Values are evaluated on the authoritative server using normal IConfiguration precedence. Reapplication never rotates a configured Secret.

Preview exposes inputs containing profile/resource/key, type, protection, availability and logical creation scope, without resolved values. Preview/apply requests accept optional application-local inputs selections with profile, configuration key, kind (literal, parameter, secret) and the corresponding literal or exact scoped reference. Secured inputs accept only configured Secret references. Ordinary Parameter choices are limited to supported native bindings; Parameter creation retains Tenant ownership. The Console reuses the shared value binding editor and contextual creators. Explicit contextual creation is a separate user command; it does not make preview a write operation. Review again after changing a selection. Selections neither rewrite manifests nor host configuration.

AppHost forwards effective Agentstration:Bootstrap:* configuration to the authority also under NoBootstrap. Protected leaves use sensitive Aspire parameters; computed absolute catalogue path/activation and ordered initial profiles retain precedence. Other process configurations are unchanged. External configuration providers still require normal registration on the relevant host.

Discovery progress extends the existing durable application with operation (stage, start time and optional Flow Run ID). Console polling displays Worker wait, discovery execution and selection/validation, elapsed time and a logical-context Flow Run link. Unknown remote progress has no fabricated percentage. Cancellation and the bounded DiscoveryTimeout stop consumers and request cancellation through the existing discovery boundary. Stable instruction keys reconnect to unfinished runs or reuse completed evidence. Process restarts retain existing Interrupted semantics; there is no automatic replay, rollback, consumer repinning or operation reactivation.

Instance extension configuration​

An Instance profile can configure an authenticated installation using its public extension selector. Existing extension-reference preparation and bounded waits resolve it to the exact registration. Multiple installations require an explicit installation selector; no name fallback is allowed. The option contract id/version are authored; its actual descriptor digest is pinned at application (an optional explicit schemaDigest can require an exact known contract).

apiVersion: agentstration.io/v1
kind: ExtensionConfiguration
metadata:
name: openapi-options
namespace: default
definition:
extension:
id: Agentstration.Extensions.OpenApi
optionSet: io.agentstration.openapi/installation
version: 1.0.0
bindings:
- requirementId: AllowedDomains
kind: literal
literal:
- data.nantesmetropole.fr

Use the existing ExtensionEnrollmentPolicy earlier in the Instance topology phase when automatic SharedKeyFile enrollment is wanted. This resource does not establish trust from an arbitrary endpoint or bypass PairingCode authentication. Its handler is Instance-only. Preview discovers/validates the contract but never applies settings; existing infrastructure reports unresolved extension dependencies before application.

kind: parameter uses an exact parameter reference (address with namespace/kind/name, plus scopeRef: /instance); the Parameter's valueType: array stores a JSON list, limited to 128 elements and the normal 65,536-byte bound. kind: secret uses an exact secret reference for options that permit it. Secured options cannot use literal values. Create protected inputs through existing Secret/configuration initializers; never embed Secret values in ExtensionConfiguration documents.

Application delegates to the same configuration service as Extensions. A repeat keeps existing operator-edited desired values and Secret versions; it does not overwrite configuration with the profile defaults. Pending delivery is retried using the saved configuration. Unconfirmed activation reports a failure/pending diagnostic rather than allowing the profile to claim activation. This handler does not restart an extension or implement the later multi-scope enrollment orchestration from #1396.