diff --git a/docs/getting-started.de.md b/docs/getting-started.de.md index 685e4905..c73c29a3 100644 --- a/docs/getting-started.de.md +++ b/docs/getting-started.de.md @@ -494,3 +494,5 @@ Mit dem Standard `gateway_api = true` konfiguriert die SKE-DNS-Erweiterung Exter > [!NOTE] > Die SKE-DNS-Erweiterung installiert keine Gateway-API-CRDs. Die optionale Envoy-Gateway-Demo installiert sie automatisch. Installieren Sie für andere Gateway-API-Implementierungen kompatible CRDs separat. Sobald die CRDs verfügbar sind, wird ExternalDNS beim nächsten Cluster-Reconcile konfiguriert; ein zusätzliches OpenTofu-Apply ist nicht erforderlich. + +[State-Koordination](state-locking.de.md). diff --git a/docs/getting-started.md b/docs/getting-started.md index 92f5ccdc..8e69ae06 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -460,3 +460,5 @@ With the default `gateway_api = true`, the SKE DNS extension configures External > [!NOTE] > The SKE DNS extension does not install Gateway API CRDs. The optional Envoy Gateway demo installs them automatically. For other Gateway API implementations, install compatible CRDs separately. Once the CRDs are available, ExternalDNS is configured during the next cluster reconcile; no additional OpenTofu apply is required. + +[State coordination](state-locking.md). diff --git a/docs/state-locking.de.md b/docs/state-locking.de.md new file mode 100644 index 00000000..765b049f --- /dev/null +++ b/docs/state-locking.de.md @@ -0,0 +1,63 @@ +# State-Locking auf STACKIT Object Storage + +[English](state-locking.md) | [Deutsch](state-locking.de.md) + +Der geprüfte EU01-Object-Storage-Endpunkt erzwingt keine bedingte Objekterzeugung +(`If-None-Match: *`). OpenTofus S3-Einstellung `use_lockfile = true` stellt dort +deshalb keinen gegenseitigen Ausschluss her. Ein erfolgreicher Plan oder ein +vorhandenes `.tflock`-Objekt belegt kein funktionierendes Locking. Die unabhängige +Reproduktion steht in [Issue #262](https://github.com/stackitcloud/stackit-landing-zone/issues/262). +Ein nativer Service-Feature-Request ist gestellt; ein Implementierungstermin ist +nicht angekündigt. Andere Regionen erst nach Prüfung ihres Endpunkts bewerten. + +## Accelerator ohne Configurator + +STACKIT S3 bleibt als State-Speicher nutzbar, wenn Zugriffe **organisatorisch +serialisiert** sind. Pro State darf genau ein CLI-/Pipeline-Verantwortlicher +gleichzeitig arbeiten, einschließlich Plan, Apply, Destroy, Import, Refresh, +Migration und Recovery. Getrennte Application-States können unabhängig laufen. +Verantwortung und gemeinsames Ausführungsverfahren festlegen; die Concurrency- +Gruppe eines Workflows koordiniert weder eine unabhängige CLI noch andere Repositories. + +Das Application-Backend-Beispiel setzt ausdrücklich `use_lockfile = false`, weil +der Endpunkt diese Sperre nicht erzwingen kann. Gleichzeitiger Zugriff wird damit +nicht sicher. Wenn organisatorischer Einzelzugriff nicht garantiert werden kann, +ein Backend mit unabhängig geprüftem atomarem Locking verwenden. Keinen zweiten +leeren State anlegen und bestehende States nur mit geprüftem Verfahren und +wiederherstellbarer Sicherung migrieren. + +## Vom Configurator verwaltete Ausführungen + +Der Configurator serialisiert in PostgreSQL über alle API-Replikate hinweg: + +- Ein physischer S3-Pfad aus Endpunkt, Bucket und Key gehört zu genau einem + logischen verwalteten Plattform- oder Application-State. Registrierungen für einen + anderen logischen State oder Arbeitsbereich werden auch bei parallelen + Anfragen abgewiesen. +- Plattform-Ausführungsreservierungen und Application-Dispatch-Reservierungen + sind atomare Datenbankoperationen. Getrennte States können parallel laufen; + derselbe State bekommt keine konkurrierenden verwalteten Ausführungen. +- Ablauf von Zugangsdaten oder Tickets belegt keinen gestoppten Prozess. + Bereits übernommene abgebrochene/fehlgeschlagene Plattform-Läufe bleiben bis + zur bestätigten Bereinigung oder explizit geprüften Recovery-Klärung gesperrt. + Application-Reconciliation sperrt auch Drift und Destroy; Ticketablauf allein + hebt die Sperre nicht auf. +- Quellen-, Eigentümer-, Mandanten-, gespeicherte Plan-, State-Versions- und + Recovery-Prüfungen gelten weiter. Historische Recovery-Nachweise bleiben unveränderlich. + +Der S3-Deskriptor des Runners behält aus Kompatibilitätsgründen +`useLockfile=true`; das Objekt ist ein zusätzliches Signal, **nicht der +Synchronisationsmechanismus**. Diese Änderung migriert weder State-Objekte und +-Schlüssel noch gespeicherte Pläne. Historische Aliase eines physischen States +lassen die Migration zur Prüfung durch den Betreiber scheitern, statt einen +Schreiber auszuwählen oder die Zuordnung still zu überschreiben. + +Die Koordination umfasst verwaltete Ausführungspfade einer Configurator- +Installation mit gemeinsamer Datenbank. Unabhängige CLI-Schreiber und andere +Installationen mit eigener Datenbank sind nicht eingeschlossen. Zugangsdaten und +State-Pfade einer Ausführungsverantwortung zuordnen; externer Notfallzugriff +benötigt gestoppte verwaltete Schreiber und State-Abgleich vor Wiederaufnahme. + +Die Configurator-Betreiber-IaC nutzt ihre bestehende umgebungsweite Concurrency +über Workflows hinweg. Die Kunden-Ausführungsdatenbank schützt diese nicht; +direkte Betreiber-CLI-Zugriffe folgen ebenfalls dem Einzelzugriffsverfahren. diff --git a/docs/state-locking.md b/docs/state-locking.md new file mode 100644 index 00000000..d411fad7 --- /dev/null +++ b/docs/state-locking.md @@ -0,0 +1,59 @@ +# State locking on STACKIT Object Storage + +[English](state-locking.md) | [Deutsch](state-locking.de.md) + +The tested EU01 Object Storage endpoint does not enforce conditional object +creation (`If-None-Match: *`). Therefore OpenTofu's S3 `use_lockfile = true` does +not establish mutual exclusion there. A successful Plan or an existing `.tflock` +object does not prove locking works. The independent reproduction is recorded in +[issue #262](https://github.com/stackitcloud/stackit-landing-zone/issues/262). +A native service feature request exists; implementation has no announced schedule. +Do not assume support in another region without qualifying that endpoint. + +## Accelerator without Configurator + +STACKIT S3 remains usable for State storage when access is **operationally +serialized**. Exactly one CLI/pipeline operator may work on a given State at a +time, including Plan, Apply, Destroy, import, refresh, migration and recovery. +Separate Application States can run independently. Agree ownership and a shared +execution procedure; one workflow's concurrency group does not coordinate an +independent CLI or another repository. + +The application backend example sets `use_lockfile = false` explicitly because +this endpoint cannot enforce its lock. This does not make concurrent use safe. +If organizational single-writer operation cannot be guaranteed, use a backend +with independently qualified atomic locking. Do not create a second empty State +or migrate an existing State without a reviewed procedure and recoverable backup. + +## Configurator-managed executions + +The Configurator serializes executions in PostgreSQL, shared by all API replicas: + +- A physical S3 location (endpoint, bucket, key) belongs to one logical managed + platform or application State. Registrations for another logical State or + workspace are rejected, including concurrent registrations. +- Platform execution reservations and application dispatch reservations are + atomic database operations. Separate States can run concurrently; the same + State cannot have competing managed executions. +- Expiry of a credential/ticket is not evidence that an issued process stopped. + Claimed cancelled/failed platform runs remain blocking until confirmed cleanup + or explicit reviewed recovery clearance. Application reconciliation blocks + drift and Destroy too; ticket expiry alone does not release the hold. +- Existing source, owner, tenant, saved-plan, State-version and recovery checks + remain in force. Historical recovery evidence stays immutable. + +The Runner's S3 descriptor retains `useLockfile=true` for compatibility; that +object is an additional signal, **not the synchronization mechanism**. No State +object, State key or stored plan is migrated by this change. A historical physical +State alias causes migration to fail for operator review, rather than choosing a +writer or silently rewriting ownership. + +This coordination covers the managed execution paths of one Configurator +installation using its database. Independent CLI writers or another installation +with a separate database are outside it. Keep those credentials and State paths +under one execution authority; any emergency external access requires stopping +managed writers and reconciling State before managed execution resumes. + +Configurator operator IaC uses its existing cross-workflow environment concurrency. +It is not protected by the customer execution database; direct operator CLI access +must follow the same single-writer procedure. diff --git a/landing-zone-configurator/app/apps/api/db/098_managed_state_serialization.sql b/landing-zone-configurator/app/apps/api/db/098_managed_state_serialization.sql new file mode 100644 index 00000000..c1d56570 --- /dev/null +++ b/landing-zone-configurator/app/apps/api/db/098_managed_state_serialization.sql @@ -0,0 +1,96 @@ +-- Conditional S3 writes do not provide mutual exclusion on the qualified endpoint. +-- Bind each physical object to exactly one logical State before issuing credentials. +CREATE TABLE lzc.managed_state_targets ( + target_sha256 text PRIMARY KEY CHECK(target_sha256 ~ '^[a-f0-9]{64}$'), + tenant_id uuid NOT NULL REFERENCES lzc.tenants(id), + owner_kind text NOT NULL CHECK(owner_kind IN ('platform','application')), + owner_id text NOT NULL, + created_at timestamptz NOT NULL DEFAULT clock_timestamp() +); +ALTER TABLE lzc.managed_state_targets ENABLE ROW LEVEL SECURITY; +ALTER TABLE lzc.managed_state_targets FORCE ROW LEVEL SECURITY; +CREATE POLICY managed_state_target_migration ON lzc.managed_state_targets TO configurator_migration USING(true) WITH CHECK(true); + +CREATE FUNCTION lzc_auth.bind_managed_state_target(p_descriptor jsonb,p_tenant uuid,p_kind text,p_owner text) RETURNS void +LANGUAGE plpgsql SECURITY DEFINER SET search_path=pg_catalog AS $$ +DECLARE fingerprint text; bound lzc.managed_state_targets; +BEGIN + IF p_descriptor->>'endpoint' IS NULL OR p_descriptor->>'bucket' IS NULL OR p_descriptor->>'key' IS NULL + THEN RAISE EXCEPTION 'state_backend_binding_invalid' USING ERRCODE='40001'; END IF; + fingerprint:=encode(sha256(convert_to(jsonb_build_array(p_descriptor->>'endpoint',p_descriptor->>'bucket',p_descriptor->>'key')::text,'UTF8')),'hex'); + INSERT INTO lzc.managed_state_targets(target_sha256,tenant_id,owner_kind,owner_id) + VALUES(fingerprint,p_tenant,p_kind,p_owner) ON CONFLICT DO NOTHING; + SELECT * INTO bound FROM lzc.managed_state_targets WHERE target_sha256=fingerprint; + IF bound.tenant_id<>p_tenant OR bound.owner_kind<>p_kind OR bound.owner_id<>p_owner + THEN RAISE EXCEPTION 'state_backend_already_managed' USING ERRCODE='40001'; END IF; +END $$; +REVOKE ALL ON FUNCTION lzc_auth.bind_managed_state_target(jsonb,uuid,text,text) FROM PUBLIC; + +CREATE FUNCTION lzc.guard_managed_state_target() RETURNS trigger +LANGUAGE plpgsql SECURITY DEFINER SET search_path=pg_catalog AS $$ +DECLARE descriptor jsonb; backend uuid; +BEGIN + IF TG_TABLE_NAME='platform_states' THEN + FOREACH backend IN ARRAY ARRAY[NEW.backend_id,NEW.pending_backend_id] LOOP + IF backend IS NULL THEN CONTINUE; END IF; + SELECT b.descriptor INTO descriptor FROM lzc.state_backends b WHERE b.id=backend AND b.tenant_id=NEW.tenant_id; + PERFORM lzc_auth.bind_managed_state_target(descriptor,NEW.tenant_id,'platform',NEW.state_key); + END LOOP; + ELSE + IF NOT EXISTS(SELECT 1 FROM lzc.application_job_grants g WHERE g.job_id=NEW.job_id AND g.tenant_id=NEW.tenant_id AND g.state_key=NEW.descriptor->>'key') + THEN RAISE EXCEPTION 'state_backend_binding_invalid' USING ERRCODE='40001'; END IF; + PERFORM lzc_auth.bind_managed_state_target(NEW.descriptor,NEW.tenant_id,'application', + (SELECT instance_id::text FROM lzc.application_job_grants WHERE job_id=NEW.job_id)); + END IF; + RETURN NEW; +END $$; +REVOKE ALL ON FUNCTION lzc.guard_managed_state_target() FROM PUBLIC; +CREATE TRIGGER managed_platform_state_target BEFORE INSERT OR UPDATE OF backend_id,pending_backend_id ON lzc.platform_states + FOR EACH ROW EXECUTE FUNCTION lzc.guard_managed_state_target(); +CREATE TRIGGER managed_application_state_target BEFORE INSERT ON lzc.application_job_backends + FOR EACH ROW EXECUTE FUNCTION lzc.guard_managed_state_target(); + +-- Conflicting historical registrations require operator review; never silently +-- assign one writer's existing State to another logical platform or application. +DO $$ +DECLARE binding record; +BEGIN + FOR binding IN + SELECT b.descriptor,s.tenant_id,'platform'::text AS kind,s.state_key AS owner + FROM lzc.platform_states s JOIN lzc.state_backends b ON b.id=s.backend_id OR b.id=s.pending_backend_id + UNION ALL + SELECT b.descriptor,b.tenant_id,'application',g.instance_id::text + FROM lzc.application_job_backends b JOIN lzc.application_job_grants g ON g.job_id=b.job_id + LOOP + PERFORM lzc_auth.bind_managed_state_target(binding.descriptor,binding.tenant_id,binding.kind,binding.owner); + END LOOP; +END $$; + +-- Expiring a capability cannot stop a process that already received S3 credentials. +CREATE FUNCTION lzc.guard_platform_state_serialization() RETURNS trigger +LANGUAGE plpgsql SECURITY DEFINER SET search_path=pg_catalog AS $$ +BEGIN + IF NEW.state_key IS NULL THEN RETURN NEW; END IF; + PERFORM pg_advisory_xact_lock(hashtextextended('managed-platform-state:'||NEW.state_key,0)); + IF EXISTS(SELECT 1 FROM lzc.plan_runs r WHERE r.state_key=NEW.state_key AND r.id<>NEW.id + AND r.input_claimed AND r.status IN ('failed','cancelled') AND NOT r.cleaned + AND NOT EXISTS(SELECT 1 FROM lzc.runner_cleanup_receipts receipt WHERE receipt.runner_id=r.id AND receipt.app_id=r.runner_app_id) + AND NOT EXISTS(SELECT 1 FROM lzc.platform_reconciliations receipt WHERE receipt.run_id=r.id AND receipt.state_key=r.state_key)) + THEN RAISE EXCEPTION 'state_locked' USING ERRCODE='40001'; END IF; + RETURN NEW; +END $$; +REVOKE ALL ON FUNCTION lzc.guard_platform_state_serialization() FROM PUBLIC; +CREATE TRIGGER platform_state_serialization BEFORE INSERT ON lzc.plan_runs + FOR EACH ROW EXECUTE FUNCTION lzc.guard_platform_state_serialization(); + +-- Reconciliation remains a durable hold for every operation, including drift +-- and destroy. Ticket expiry alone never proves that the previous writer stopped. +CREATE OR REPLACE FUNCTION lzc_auth.application_execution_blocked(p_job uuid,p_instance uuid,p_tenant uuid,p_purpose text,p_apply_only boolean DEFAULT false) RETURNS boolean +LANGUAGE sql SECURITY DEFINER SET search_path=pg_catalog AS $$ + SELECT EXISTS( + SELECT 1 FROM lzc.application_dispatches d WHERE d.tenant_id=p_tenant AND d.instance_id=p_instance AND d.job_id<>p_job + AND (NOT p_apply_only OR EXISTS(SELECT 1 FROM lzc.application_jobs j WHERE j.id=d.job_id AND j.operation='apply')) + AND (d.status NOT IN ('succeeded','failed','reconciliation_required') OR + (d.status='reconciliation_required' AND NOT lzc_auth.application_recovery_replan_valid(d.job_id))) + ); +$$; diff --git a/landing-zone-configurator/app/apps/api/db/099_application_project_git.sql b/landing-zone-configurator/app/apps/api/db/099_application_project_git.sql new file mode 100644 index 00000000..92ef44a9 --- /dev/null +++ b/landing-zone-configurator/app/apps/api/db/099_application_project_git.sql @@ -0,0 +1,73 @@ +INSERT INTO lzc.application_execution_sources(revision,provider_lock_sha256,tofu_version,contract_version,status) + SELECT '2b581f23dd40ccd4425e5e9efd93fb2c44cc8f8a',provider_lock_sha256,tofu_version,contract_version,'supported' + FROM lzc.application_execution_sources WHERE revision='c83f3d910ab20131d1cba898023317c0e818843b'; +UPDATE lzc.application_execution_sources SET replacement_revision='2b581f23dd40ccd4425e5e9efd93fb2c44cc8f8a' WHERE revision<>'2b581f23dd40ccd4425e5e9efd93fb2c44cc8f8a'; + +DO $$ +DECLARE table_name text; constraint_name text; definition text; signature text; + old_source text := '''c83f3d910ab20131d1cba898023317c0e818843b'''; new_source text := '''2b581f23dd40ccd4425e5e9efd93fb2c44cc8f8a'''; +BEGIN + FOREACH table_name IN ARRAY ARRAY['application_job_grants','application_runner_tickets'] LOOP + constraint_name:=table_name||'_accelerator_revision_check'; + SELECT pg_get_constraintdef(oid) INTO definition FROM pg_constraint WHERE conrelid=('lzc.'||table_name)::regclass AND conname=constraint_name; + IF definition IS NULL OR strpos(definition,old_source)=0 THEN RAISE EXCEPTION 'project_git_source_constraint_missing'; END IF; + EXECUTE format('ALTER TABLE lzc.%I DROP CONSTRAINT %I',table_name,constraint_name); + EXECUTE format('ALTER TABLE lzc.%I ADD CONSTRAINT %I %s',table_name,constraint_name,replace(definition,old_source,old_source||','||new_source)); + END LOOP; + FOREACH signature IN ARRAY ARRAY['lzc.issue_application_job_grant()','lzc_auth.reserve_application_dispatch(uuid,uuid)','lzc_auth.delegated_application_plan_operation(uuid,uuid,text,jsonb)','lzc_auth.application_execution_compatibility_valid(uuid,jsonb)','lzc.validate_application_access_inputs()'] LOOP + definition:=pg_get_functiondef(signature::regprocedure); + IF strpos(definition,old_source)=0 THEN RAISE EXCEPTION 'project_git_source_guard_missing: %',signature; END IF; + EXECUTE replace(definition,old_source,old_source||','||new_source); + END LOOP; + definition:=pg_get_functiondef('lzc.validate_application_audit_inputs()'::regprocedure); + EXECUTE replace(definition,'NEW.inputs->>''acceleratorRevision'' IS DISTINCT FROM '||old_source, + 'coalesce(NEW.inputs->>''acceleratorRevision'','''') NOT IN ('||old_source||','||new_source||')'); + FOREACH signature IN ARRAY ARRAY['lzc_auth.request_application_upgrade(uuid,uuid,uuid,uuid,uuid,jsonb,boolean)','lzc_auth.request_application_platform_upgrade(uuid,uuid,uuid,uuid,uuid,boolean)'] LOOP + definition:=pg_get_functiondef(signature::regprocedure); + definition:=replace(definition,'source<>'||old_source,'source NOT IN ('||old_source||','||new_source||')'); + IF strpos(definition,'upgrade_application_execution(p_session,p_instance,'||old_source)=0 THEN RAISE EXCEPTION 'project_git_audit_upgrade_anchor_missing: %',signature; END IF; + definition:=replace(definition,'upgrade_application_execution(p_session,p_instance,'||old_source,'upgrade_application_execution(p_session,p_instance,'||new_source); + definition:=replace(definition,' THEN RAISE EXCEPTION ''application_upgrade_removal_blocked''', + ' OR (coalesce(ordered.resolved_settings#>>''{git,enabled}'',''false'')=''true'' AND coalesce(settings#>>''{git,enabled}'',''false'')<>''true'') THEN RAISE EXCEPTION ''application_upgrade_removal_blocked'''); + EXECUTE definition; + END LOOP; + definition:=pg_get_functiondef('lzc.guard_application_upgrade_binding()'::regprocedure); + EXECUTE replace(definition,' IF app IS DISTINCT FROM expected_app THEN', + ' IF candidate.resolved_settings ? ''git'' THEN expected_app:=expected_app||jsonb_build_object(''git'',candidate.resolved_settings->''git''); END IF;'||chr(10)||' IF app IS DISTINCT FROM expected_app THEN'); +END $$; + +-- Keep the database resolver equivalent to the domain parameter contract. +DO $$ +DECLARE definition text; +BEGIN + definition:=pg_get_functiondef('lzc_auth.resolve_application_upgrade_settings(jsonb,jsonb,text)'::regprocedure); + definition:=replace(definition,'"role_assignments":[]','"role_assignments":[],"git.enabled":false,"git.flavor":"git-10","git.acl":[]'); + definition:=replace(definition,'''observability.plan_name'') OR fields','''observability.plan_name'',''git.enabled'',''git.flavor'',''git.acl'') OR fields'); + definition:=replace(definition,'''observability.plan_name'',''role_assignments''] LOOP','''observability.plan_name'',''role_assignments'',''git.enabled'',''git.flavor'',''git.acl''] LOOP'||chr(10)|| + ' IF path LIKE ''git.%'' AND NOT settings ? ''git'' AND NOT fields ?| ARRAY[''git.enabled'',''git.flavor'',''git.acl''] THEN CONTINUE; END IF;'); + definition:=replace(definition,' IF rule->>''source''=''input'' THEN',' IF path LIKE ''git.%'' AND path<>''git.enabled'' AND settings#>>''{git,enabled}'' IS DISTINCT FROM ''true'' THEN rule:=NULL; END IF;'||chr(10)||' IF rule->>''source''=''input'' THEN'); + definition:=replace(definition,'rule->''choices'' @> jsonb_build_array(value)','rule->''choices'' @> CASE WHEN path=''git.acl'' THEN value ELSE jsonb_build_array(value) END'); + definition:=replace(definition,'path IN (''env'',''observability.plan_name'')','path IN (''env'',''observability.plan_name'',''git.flavor'')'); + definition:=replace(definition,'path IN (''secretsmanager_enabled'',''observability.enabled'')','path IN (''secretsmanager_enabled'',''observability.enabled'',''git.enabled'')'); + definition:=replace(definition,'path=''role_assignments'' AND','path IN (''role_assignments'',''git.acl'') AND'); + EXECUTE definition; +END $$; + +CREATE FUNCTION lzc.validate_application_git_inputs() RETURNS trigger +LANGUAGE plpgsql SECURITY DEFINER SET search_path=pg_catalog AS $$ +DECLARE ordered lzc.application_instances; expected jsonb; actual jsonb; cidr text; +BEGIN + SELECT * INTO ordered FROM lzc_auth.application_order_snapshot(NEW.instance_id,(NEW.inputs->>'applicationUpgradeId')::uuid); + expected:=ordered.resolved_settings->'git'; actual:=NEW.inputs#>'{variables,application,git}'; + IF actual IS DISTINCT FROM expected OR (expected IS NOT NULL AND NEW.inputs->>'acceleratorRevision' IS DISTINCT FROM '2b581f23dd40ccd4425e5e9efd93fb2c44cc8f8a') + THEN RAISE EXCEPTION 'application_git_binding_mismatch' USING ERRCODE='42501'; END IF; + IF expected->>'enabled'='true' THEN + IF coalesce(expected->>'flavor','') !~ '^git-[0-9]+$' OR jsonb_typeof(expected->'acl') IS DISTINCT FROM 'array' OR jsonb_array_length(expected->'acl')=0 + THEN RAISE EXCEPTION 'application_git_access_invalid' USING ERRCODE='42501'; END IF; + FOR cidr IN SELECT jsonb_array_elements_text(expected->'acl') LOOP PERFORM cidr::inet; END LOOP; + END IF; + RETURN NEW; +END $$; +REVOKE ALL ON FUNCTION lzc.validate_application_git_inputs() FROM PUBLIC; +CREATE TRIGGER validate_application_git_inputs BEFORE INSERT ON lzc.application_jobs + FOR EACH ROW EXECUTE FUNCTION lzc.validate_application_git_inputs(); diff --git a/landing-zone-configurator/app/apps/api/src/applications/routes.ts b/landing-zone-configurator/app/apps/api/src/applications/routes.ts index 1e5c1ab6..b5c05e13 100644 --- a/landing-zone-configurator/app/apps/api/src/applications/routes.ts +++ b/landing-zone-configurator/app/apps/api/src/applications/routes.ts @@ -265,6 +265,8 @@ export function registerApplications( if (error instanceof Error && "code" in error && error.code === "40001") { if ( [ + "state_backend_already_managed", + "state_backend_binding_invalid", "application_order_quota_exceeded", "application_order_quota_changed", "application_order_decision_conflict", diff --git a/landing-zone-configurator/app/apps/api/src/applications/service.ts b/landing-zone-configurator/app/apps/api/src/applications/service.ts index 23a1cbd9..3d416921 100644 --- a/landing-zone-configurator/app/apps/api/src/applications/service.ts +++ b/landing-zone-configurator/app/apps/api/src/applications/service.ts @@ -3456,7 +3456,10 @@ export class Applications { const platform = contract(approved).document; if ( platform.targets[published.target_key]?.audit_router && - execution.revision !== applicationExecutionCurrentRevision + ![ + "c83f3d910ab20131d1cba898023317c0e818843b", + applicationExecutionCurrentRevision, + ].includes(execution.revision) ) throw new ApplicationError( 409, @@ -3495,6 +3498,7 @@ export class Applications { ? [] : (settings.role_assignments ?? []), services: { + ...(settings.git !== undefined ? { git: settings.git } : {}), secretsmanager_enabled: settings.secretsmanager_enabled === true, observability: { enabled: observability.enabled === true, diff --git a/landing-zone-configurator/app/apps/api/src/applications/state-recovery.ts b/landing-zone-configurator/app/apps/api/src/applications/state-recovery.ts index 87797fca..f85d8455 100644 --- a/landing-zone-configurator/app/apps/api/src/applications/state-recovery.ts +++ b/landing-zone-configurator/app/apps/api/src/applications/state-recovery.ts @@ -495,6 +495,7 @@ export class ApplicationStateRecoveries { initial_owner_email: z.email().nullable().optional(), target_key: z.string(), custom_roles: z.array(z.unknown()).optional(), + git: z.object({ enabled: z.boolean() }).optional(), }), platform_contract: z.object({ organization_id: z.uuid().optional(), @@ -535,6 +536,7 @@ export class ApplicationStateRecoveries { ownerEmail: vars.application.initial_owner_email ?? vars.application.owner_email, customRoles: !!vars.application.custom_roles?.length, + git: vars.application.git?.enabled === true, ...(target.audit_router ? { audit: { diff --git a/landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts b/landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts new file mode 100644 index 00000000..f21759b2 --- /dev/null +++ b/landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts @@ -0,0 +1,68 @@ +import { z } from "zod"; +import type { Dialogue } from "./dialogue.js"; + +// Closed, reviewed boundaries are rendered by the application. A model selects +// relevant facts with current-turn evidence; it cannot rewrite their meaning. +export const architectureAdviceSelections = z + .array( + z.strictObject({ + fact: z.enum([ + "git-instance-topology", + "application-git", + "state-coordination", + ]), + quote: z.string().min(1).max(1200), + }), + ) + .max(3) + .default([]) + .describe( + "Select reviewed factual advice only when the CURRENT USER asks about that boundary: git-instance-topology for managed Git user capacity, maximum instance size or multi-instance topology; application-git for optional Git in Application templates or its SNA/private reachability; state-coordination for conditional S3 writes, locking and CLI versus Configurator concurrency. Copy a nonempty exact current USER quote establishing the question. Advice only; not a setup/change instruction, other service, old history or generic field enumeration. Otherwise []. These facts are rendered by the application; do not generate an alternative implementation or workaround.", + ); + +const facts = { + "git-instance-topology": { + topic: "devops-git", + en: "Git10 (git-10) supports up to 10 Git users; Git100 (git-100) supports up to 100 users per instance. A single instance cannot serve more than 100 users. The Accelerator's root devops object creates one central Git instance. For more users, divide teams or projects across independent Application Git instances, or evaluate another supported architecture. Application templates use git.enabled, git.flavor and git.acl; central Git uses devops.git_flavor and devops.allowed_network_ranges. Multiple instances provide neither automatic user distribution nor federation, shared repositories or a shared user directory. Decide the ownership and user partition before provisioning. Source-IP ACLs control access to public managed endpoints; project placement does not make them SNA-private. This is advice; nothing has been changed or deployed.", + de: "Git10 (git-10) unterstützt bis zu 10, Git100 (git-100) bis zu 100 Git-Nutzer pro Instanz. Eine einzelne Instanz kann nicht mehr als 100 Nutzer bedienen. Das Root-Objekt devops des Accelerators erstellt eine zentrale Git-Instanz. Für mehr Nutzer Teams oder Projekte auf unabhängige Application-Git-Instanzen aufteilen oder eine andere unterstützte Architektur prüfen. Application-Templates nutzen git.enabled, git.flavor und git.acl; zentrales Git nutzt devops.git_flavor und devops.allowed_network_ranges. Mehrere Instanzen bieten weder automatische Nutzerverteilung noch Föderation, gemeinsame Repositories oder ein gemeinsames Nutzerverzeichnis. Verantwortung und Nutzeraufteilung vor der Bereitstellung festlegen. Quell-IP-ACLs schützen öffentliche managed Endpunkte; die Projektzuordnung macht sie nicht SNA-privat. Nur Beratung; nichts geändert oder deployt.", + }, + "application-git": { + topic: "project-templates", + en: "An Application template can offer one optional managed STACKIT Git instance in its project. The Platform Owner controls git.enabled (default false), git.flavor and git.acl, either fixed or as bounded order choices. Enabling Git requires an explicit non-empty source-CIDR allowlist. Flavor IDs are git-10 (up to 10 users) and git-100 (up to 100 users per instance); display labels are not input values. Corporate/SNA placement does not make this endpoint private. Separate project instances partition users, not endpoint visibility; SNA or firewall rules cannot turn the managed public endpoint into a private service. Existing orders require a reviewed template/source upgrade. Provider 0.114.0 replaces Git on flavor or ACL changes; the Configurator rejects destructive Application upgrades, so repository/data migration needs a separate reviewed procedure. Git IAM permissions and Git-user onboarding are separate. No template, project or service has been changed.", + de: "Ein Application-Template kann eine optionale verwaltete STACKIT-Git-Instanz im eigenen Projekt anbieten. Der Platform Owner steuert git.enabled (Standard false), git.flavor und git.acl fest oder als begrenzte Bestellauswahl. Aktivierung benötigt eine explizite, nicht leere Quell-CIDR-Freigabeliste. Flavor-IDs sind git-10 (bis 10 Nutzer) und git-100 (bis 100 Nutzer pro Instanz); Anzeigenamen sind keine Eingabewerte. Corporate/SNA macht den Endpunkt nicht privat. Getrennte Projektinstanzen teilen Nutzer auf, nicht die Sichtbarkeit; SNA- oder Firewall-Regeln machen den öffentlichen managed Endpunkt nicht zum privaten Service. Bestehende Bestellungen benötigen einen geprüften Template-/Quell-Upgrade. Provider 0.114.0 ersetzt Git bei Flavor-/ACL-Änderungen; der Configurator weist destruktive Application-Upgrades ab, deshalb ist eine separat geprüfte Repository-/Datenmigration nötig. Git-IAM-Rechte und Git-Nutzereinrichtung bleiben separat. Kein Template, Projekt oder Service wurde geändert.", + }, + "state-coordination": { + topic: "management-state", + en: "Conditional writes are not enforced on the tested STACKIT EU01 S3 endpoint; use_lockfile=true does not establish mutual exclusion there. Standalone CLI/pipeline operation requires organizational single-writer discipline per State. The Configurator uses atomic PostgreSQL execution/dispatch reservations shared by all its API replicas and binds each physical S3 path to one logical State. Expired tickets do not prove that a Runner stopped; verified cleanup or reviewed recovery is required. Independent CLI writers and installations with separate databases are outside this coordination. The native S3 feature is requested, with no announced implementation date. This advice performs no execution or State changes.", + de: "Der geprüfte STACKIT-EU01-S3-Endpunkt erzwingt keine bedingten Schreibzugriffe; use_lockfile=true stellt dort keinen gegenseitigen Ausschluss her. Standalone-CLI/Pipelines benötigen organisatorischen Einzelzugriff pro State. Der Configurator nutzt atomare PostgreSQL-Ausführungs-/Dispatch-Reservierungen gemeinsam über alle API-Replikate und bindet jeden physischen S3-Pfad an einen logischen State. Abgelaufene Tickets beweisen keinen gestoppten Runner; geprüfte Bereinigung oder freigegebene Recovery ist nötig. Unabhängige CLI-Schreiber und Installationen mit separaten Datenbanken sind nicht koordiniert. Die native S3-Funktion ist angefragt, ohne angekündigten Umsetzungstermin. Diese Beratung führt nichts aus und verändert keinen State.", + }, +} as const; + +export function reviewedArchitectureAdvice( + selections: z.infer, + message: string, + language: "de" | "en", + availableTopics: readonly string[], +): Dialogue | null { + if ( + !selections.length || + selections.some( + (selection) => + !message.includes(selection.quote) || + !availableTopics.includes(facts[selection.fact].topic), + ) + ) + return null; + const chosen = [ + ...new Set(selections.map((selection) => selection.fact)), + ].map((id) => facts[id]); + // Keep the same public response budget as all other dialogue paths. + const explanation = chosen.map((fact) => fact[language]).join("\n\n"); + if (explanation.length > 3000) return null; + return { + explanation, + questions: [], + changes: [], + references: [...new Set(chosen.map((fact) => fact.topic))], + }; +} diff --git a/landing-zone-configurator/app/apps/api/src/assistant/knowledge-topics.generated.ts b/landing-zone-configurator/app/apps/api/src/assistant/knowledge-topics.generated.ts index 891ea0f7..d28d0eed 100644 --- a/landing-zone-configurator/app/apps/api/src/assistant/knowledge-topics.generated.ts +++ b/landing-zone-configurator/app/apps/api/src/assistant/knowledge-topics.generated.ts @@ -33,7 +33,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/providers.tf", @@ -60,6 +60,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [ "https://docs.stackit.cloud/platform/access-and-identity/service-accounts/how-tos/manage-service-account-keys/", @@ -107,7 +117,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "landing-zone-configurator/app/packages/domain/src/common-validation.ts", @@ -117,7 +127,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/apps/api/src/assistant/knowledge.ts", sha256: - "8548b2866c39a15590d12fc02372b99776cf2f8494962faaf32fd3205049414d", + "462529c3216cd8ba2446d7aacfc07b7bee564c2169899fd77d35f09b7aaaa7e6", }, { path: "src/modules/landing-zone/3-network.tf", @@ -134,6 +144,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [ "https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/resources/network_area", @@ -204,7 +224,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/providers.tf", @@ -214,7 +234,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "landing-zone-configurator/app/apps/api/src/assistant/editor.ts", @@ -226,6 +246,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A01", "A21", "A23"], @@ -279,7 +309,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "landing-zone-configurator/app/packages/domain/src/common-validation.ts", @@ -296,6 +326,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A02", "A23"], @@ -323,8 +363,8 @@ export const assistantKnowledgeTopics = { { id: "management-state", file: "management-state.md", - version: 2, - checkedOn: "2026-10-21", + version: 3, + checkedOn: "2026-11-18", qualification: "local-draft-not-reviewed-release", groups: ["management"], mandatory: false, @@ -334,7 +374,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/modules/management/variables.tf", @@ -374,13 +414,23 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/apps/api/src/deployments/preparations.ts", sha256: - "86a2708906940ec745aa8f80fa0d9fedbedcc98ad2f6eec38a8eb6775dd25d36", + "166cd0af1b8869e8356d343e155114b2620fb9ee638b819571a90456f325263c", }, { path: "landing-zone-configurator/app/packages/domain/src/initial-plan.ts", sha256: "5a5b2fe26d1231d1e2eb866cb82df35720f4cd366043723fba42fe166d7a6197", }, + { + path: "landing-zone-configurator/app/apps/api/db/098_managed_state_serialization.sql", + sha256: + "2e84859a543c35ea2638afb79ca6562d82b8cecb8be21fa7dfa45cad192c7c01", + }, + { + path: "docs/state-locking.md", + sha256: + "df9c9bfdc86897a4e3ee5c78f49692b2fc0e6262517c60a2f1634501df09fa63", + }, { path: "landing-zone-configurator/app/apps/api/src/assistant/editor.ts", sha256: @@ -391,15 +441,25 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A03", "A16", "A23"], fieldPaths: ["bucket_naming"], source: "landing-zone-configurator/docs/assistant-knowledge/management-state.md", - text: "# Management Project and State Foundations\n\n## Purpose\n\nManagement project, state storage and operating identities; distinguish optional\nmonitoring and the backend of the current Accelerator deployment.\n\n## Accelerator Contract\n\nmodule.management always exists under the governance platform folder; no\nmanagement_enabled switch. Root inputs derive ownership, naming and labels.\nSecrets Manager is a foundation, independent of workload secretsmanager_enabled.\nBackend bootstrap/configuration is a separate execution prerequisite.\n\nbucket_naming defaults to project-id: all management/workload bucket names contain\nthe full owning project UUID and distinct purpose suffixes within 63 characters.\nSTACKIT names are global. Explicit legacy preserves existing bucket names; never\nswitch existing buckets without reviewing replacement/migration. A failed Apply\nwith no buckets can keep its original project/state and use project-id naming.\n\n## Dependencies\n\nGovernance, naming and credentials. Monitoring, audit and federation stay optional.\n\n## Dialogue\n\n“Only SNA first” scopes the draft change, not a targeted cloud operation. Full\nnative Apply includes management and other enabled inputs. Discuss ownership,\nlifecycle and recovery without requesting state or credentials.\n\n## Examples\n\nobservability=null, audit_logs=null, federated_identity_providers=[] disables\noptional services, not management/governance. This is not a complete run.\n\n## Limits\n\nA bucket proves no backend setup, migration, encryption, locking or recovery.\nNever pull/mutate state as a chat action. Plan, Apply, Destroy, recovery and\npublication require separate authorization. No targeted Terraform workaround.\nA source correction may reuse a failed Bootstrap checkpoint only after explicit\nowner reconciliation of its exact state version, with supported pinned provenance\nand no lock, migration, separate recovery or active run. Use a new preparation\nand reviewed Plan; never restart with empty state or retry the consumed Plan.\n\n## Credentials\n\nUse approved external bindings. No keys, passphrases, state or plans in chat.\n\n## Sources\n\nFingerprint root/management and credential docs. Re-review before regeneration;\nsource snapshots do not qualify operational recovery.\n", + text: '# Management Project and State Foundations\n\n## Purpose\n\nManagement/State; monitoring!=backend.\n\n## Accelerator Contract\n\nmodule.management always exists under the governance platform folder; no management_enabled.\nRoot derives owner/names/labels. Foundation SM!=workload secretsmanager_enabled.\nSeparate backend bootstrap. bucket_naming=project-id embeds full project UUID/purpose\nwithin63 chars; global names. Explicit legacy preserves names; review replacement/migration before\nswitching. Failed Apply with no buckets can retain project/State and use project-id naming.\n\n## Dependencies\n\nGovernance/naming/credentials; optional monitoring/audit/federation.\n\n## Dialogue\n\n"Only SNA first" scopes the draft, not a targeted Apply: full native Apply includes management and enabled inputs.\nDiscuss lifecycle/recovery without State/credentials.\nEU01 S3 ignores conditional writes: use_lockfile=true is not mutual exclusion (issue262).\nNative feature requested, no date. Standalone: organizational single writer per State.\nConfigurator uses PostgreSQL execution/dispatch guards and one logical owner per physical S3 path.\nTicket expiry does not prove a stopped Runner; require cleanup/recovery clearance.\nExternal writers/separate databases are not coordinated.\n\n## Examples\n\nobservability=null,audit_logs=null,federated_identity_providers=[] disables optional services, not foundations.\n\n## Limits\n\nBucket!=configured backend/encryption/locking/recovery. Never read/mutate State in chat.\nSeparate approval for Plan/Apply/Destroy/recovery/publication; no targeted Terraform workaround.\nReuse failed Bootstrap checkpoint only after explicit exact-version owner reconciliation, supported pinned\nsource and no lock/migration/separate recovery/active run. New preparation/reviewed Plan; never empty\nState or replay of consumed Plan.\n\n## Credentials\n\nApproved external bindings; no keys/passphrases/State/plans in chat.\n\n## Sources\n\nRoot/management/credential/State sources; no recovery qualification.\n', sha256: - "33139dc2767df839f67b761b2084ad43cb5747693f8ef6b6bb80d6ae18f4d94e", + "799f747c67d3403fbb6f7856974f3c38bc558ddb6f1ed29a412bf7155aba7930", }, { id: "observability", @@ -415,7 +475,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/modules/management/variables.tf", @@ -440,7 +500,7 @@ export const assistantKnowledgeTopics = { { path: "src/modules/landing-zone/variables.tf", sha256: - "b42f23055c9b2cf2878bf4c38a44dc8aa1a4a36ba8af32ccbb6a3a4574d00b8f", + "f8c0c2456c3ced8022e25563aa5e5e0cae0ec2ecc6a09d947743090d645bc0b9", }, { path: "src/modules/platform-kubernetes/variables.tf", @@ -455,7 +515,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts", sha256: - "7af8d5469272cec70e60b74a241622e4613844b555bd339c1cd0006cd40199a4", + "329a05857571b3ffdace9fb10a1c1ecbf340a806cdfda85d91cee032ff1b7ba5", }, { path: "landing-zone-configurator/app/apps/api/src/assistant/editor.ts", @@ -467,6 +527,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [ "https://docs.stackit.cloud/products/logging-and-monitoring/observability/reference/service-plans-observability/", @@ -504,12 +574,12 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/modules/management/variables.tf", @@ -539,7 +609,7 @@ export const assistantKnowledgeTopics = { { path: "src/application/variables.tf", sha256: - "c184c2677b23cab5aa57d4a53541ee18ef2d34795cbe1d18417e9f4222cf221e", + "57eb91adbbd03adca952aeefdb7c3a05a607cd8627cffd52b0fd9dbaef3fb53c", }, { path: "src/modules/management/3-object-storage.tf", @@ -549,7 +619,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/packages/contracts/src/recovery/catalogue.ts", sha256: - "2d8231b4e96374663c3cf79ddf8417b74671481605e4cca13fcddcbbb8e4f9ef", + "512002ecff4e8d78a107ee16361a3cc609b27e9f1ab344488a3dc5b4a42cfb14", }, { path: "src/modules/management/5-observability.tf", @@ -571,6 +641,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A03", "A16", "A23", "A24"], @@ -608,12 +688,12 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/modules/management/variables.tf", @@ -635,6 +715,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A03", "A16", "A23"], @@ -689,7 +779,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "landing-zone-configurator/app/packages/domain/src/common-validation.ts", @@ -706,6 +796,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [ "https://docs.stackit.cloud/products/network/core-networking/dns/how-tos/manage-dns-zones/", @@ -785,7 +885,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "landing-zone-configurator/app/apps/api/src/assistant/editor.ts", @@ -797,6 +897,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A04", "A06", "A15", "A24"], @@ -875,12 +985,12 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/modules/connectivity/variables.tf", @@ -907,6 +1017,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A07", "A16", "A24"], @@ -1057,7 +1177,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/modules/firewall-config/variables.tf", @@ -1067,7 +1187,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/providers.tf", @@ -1089,6 +1209,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A13", "A16", "A23", "A24"], @@ -1188,7 +1318,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/_firewall-bootstrap.tf", @@ -1220,6 +1350,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A13", "A16", "A23"], @@ -1238,8 +1378,8 @@ export const assistantKnowledgeTopics = { { id: "devops-git", file: "devops-git.md", - version: 2, - checkedOn: "2026-11-17", + version: 3, + checkedOn: "2026-11-18", qualification: "local-draft-not-reviewed-release", groups: ["platform"], mandatory: false, @@ -1249,7 +1389,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/modules/devops/variables.tf", @@ -1259,7 +1399,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/providers.tf", @@ -1274,15 +1414,37 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts", sha256: - "7af8d5469272cec70e60b74a241622e4613844b555bd339c1cd0006cd40199a4", + "329a05857571b3ffdace9fb10a1c1ecbf340a806cdfda85d91cee032ff1b7ba5", + }, + { + path: "src/modules/landing-zone/8-git.tf", + sha256: + "2d0990417d4e0c6fdb442ec9fadde4213b5d0f310608ec42af4bbeb80208532e", + }, + { + path: "landing-zone-configurator/app/packages/domain/src/template-parameters.ts", + sha256: + "7fcf163c6fbb766a0d40cdc7fa0a6832071b094365fca5eed586368b17dddfcb", }, { path: "landing-zone-configurator/app/apps/api/src/assistant/serving-schema.ts", sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, + ], + externalSources: [ + "https://docs.stackit.cloud/products/developer-platform/git/basics/plan-size-of-git-service/", ], - externalSources: [], scenarios: ["A08", "A24"], fieldPaths: [ "devops", @@ -1292,9 +1454,9 @@ export const assistantKnowledgeTopics = { ], source: "landing-zone-configurator/docs/assistant-knowledge/devops-git.md", - text: '# DevOps Git Service\n\n## Purpose\n\nCentral managed Git, separate from GitHub login, forks and Configurator CI.\n\n## Accelerator Contract\n\nRoot derives project, ownership and naming; passes git_flavor and\nallowed_network_ranges. devops=null skips deployment. git_flavor defaults to\nnull, NOT git-10/git-100: null or an ACL-only object creates no Git instance.\nLive catalogues are needed for real sizes and regional availability.\n\n## Dependencies\n\nManagement/governance, identity foundations, provider rights and deliberate ACLs.\nA fork proves neither provisioned Git nor service-account rights.\n\n## Dialogue\n\nBroad setup requests ("Please add a central git instance to the config") start\na dialogue. Ask missing size/capacity and access decisions, preserving user\nanswers across turns. Only propose a complete new component. There is no enabled\nflavor default: ask instead of inventing git-10. A verified catalogue can ground\na labelled recommendation, never entitlement or availability. Ask actual CIDRs\nas free text, without invented examples or preset networks. A blank answer never\nmeans consent to allow all. Separate operator, runners and integrations; do not\ninfer migrations or secrets.\n\n## Examples\n\ndevops=null opts out. Selected git_flavor plus deliberate allowed_network_ranges\ncan propose Git. git-10 illustrates syntax, not entitlement or capacity.\n\n## Limits\n\nEditor acceptance changes only the local draft. ACLs do not qualify backup/restore,\nmigration, SSO or CI execution. No arbitrary Git appliances, prices, performance\nor availability promises. Root wiring, not child parameters, defines support.\n\n## Credentials\n\nProvisioning and Git-user access are separate. No PATs, SSH private keys, Git\npasswords or CI secrets in chat; no hidden Configurator profile-ID dependency.\n\n## Sources\n\nRoot calls, DevOps variables and provider configuration in the manifest.\nRefresh source bindings after review; live product facts stay separate.\n', + text: "# DevOps Git Service\n\n## Purpose\n\nGit !=GitHub login/forks/Configurator CI.\n\n## Accelerator Contract\n\nRoot derives project/owner/name; inputs git_flavor,allowed_network_ranges.\ndevops=null skips; git_flavor=null (default), even with ACLs, creates no Git.\nCatalogue !=entitlement/prices.\n\n## Dependencies\n\nManagement/governance/identity/rights/ACLs; fork!=Git/SA rights.\n\n## Dialogue\n\nRetain answers; complete grounded proposals.\ngit-10 (Git10) <=10 users; git-100 (Git100) <=100 per instance, shared repositories/CI/CD. Size for intended Git users and\ngrowth; company-wide does not imply <=100. Above100 discuss separate team/project instances or another\narchitecture, not an invented larger flavor. Multiple instances are not federated Git. Root devops is one central instance; use project Git for separate team/project instances.\nOptional project Git: git.enabled/flavor/acl. Clarify central versus selected project-template scope; never change both silently.\nAsk missing access/public egress CIDRs. Company/private SNA/examples/blank answers do not grant public access. Distinguish operators/runners/integrations.\n\n## Examples\n\ngit_flavor+explicit ACL proposes central Git; project Git is separate/default disabled.\n\n## Limits\n\nEditor: local draft only; no arbitrary appliances/prices/performance/availability claims.\nPinned Provider0.114 flavor AND ACL changes replace Git; review repository/data migration.\nACL!=backup/restore/migration/SSO/CI.\n\n## Credentials\n\nProvisioning !=Git-user access. No PATs/SSH/passwords/CI secrets/hidden IDs.\n\n## Sources\n\nNative inputs/resources and official sizing docs.\n", sha256: - "a9bb755e1f46889b295811afa6d01bacf047405ad3db14fa66df59984822ce21", + "ef5a0d868b6aa568fc5d5f6fba7d161171dda6abc55a9c0915b8b00d013221e9", }, { id: "platform-kubernetes", @@ -1313,7 +1475,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/modules/platform-kubernetes/variables.tf", @@ -1328,7 +1490,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "src/providers.tf", @@ -1350,6 +1512,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A05", "A09", "A15", "A16", "A24"], @@ -1430,8 +1602,8 @@ export const assistantKnowledgeTopics = { { id: "project-templates", file: "project-templates.md", - version: 8, - checkedOn: "2026-11-06", + version: 9, + checkedOn: "2026-11-18", qualification: "local-draft-not-reviewed-release", groups: ["projects"], mandatory: false, @@ -1445,12 +1617,12 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/modules/landing-zone/variables.tf", sha256: - "b42f23055c9b2cf2878bf4c38a44dc8aa1a4a36ba8af32ccbb6a3a4574d00b8f", + "f8c0c2456c3ced8022e25563aa5e5e0cae0ec2ecc6a09d947743090d645bc0b9", }, { path: "landing-zone-configurator/app/apps/api/src/assistant/application-permission-dialogue.ts", @@ -1475,7 +1647,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/packages/domain/src/application-plan.ts", sha256: - "fdfa84c952c89939554b6699fb516c8a22b3e82c38c7d561254d18266b93ea0f", + "08628eb4bf4bf7997628924cb0bf372c30ceacc9d8410d31d726e792969d8616", }, { path: "landing-zone-configurator/app/packages/domain/src/application-access.ts", @@ -1512,6 +1684,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [ "https://github.com/stackitcloud/terraform-provider-stackit/blob/v0.114.0/stackit/internal/services/iaas/network/resource.go", @@ -1532,6 +1714,11 @@ export const assistantKnowledgeTopics = { "landing_zones[*].custom_roles[*].permissions", "landing_zones[*].custom_roles[*].permissions[*]", "landing_zones[*].env", + "landing_zones[*].git", + "landing_zones[*].git.acl", + "landing_zones[*].git.acl[*]", + "landing_zones[*].git.enabled", + "landing_zones[*].git.flavor", "landing_zones[*].network_area_key", "landing_zones[*].network_enabled", "landing_zones[*].network_prefix_length", @@ -1553,9 +1740,9 @@ export const assistantKnowledgeTopics = { ], source: "landing-zone-configurator/docs/assistant-knowledge/project-templates.md", - text: '# Landing-Zone Projects and Application Templates\n\n## Purpose\n\nTemplates/IAM.\n\n## Accelerator Contract\n\nlanding_zones:corporate/region/area,project_code/env/owner_email,network/roles/services.\nPublic:corporate=false; drafts:projectTemplates/policies.\nAutomatic=null:Corporate resolves regional SNA default_prefix_length before Plan; numeric to Provider0.114; preserve DNS.\nProvider0.114: null prefix+DNS(even []) invalid; native resolves, overrides win; Public provider sizing.\n\n## Dependencies\n\nVerified identity/governance; regional SNA; separate credentials. Public!=Corporate; namespaces:Platform K8s.\n\n## Dialogue\n\nNew:name/kind/region/settings; reuse keys.\nCentral=Corporate; Internet-only=Public; local network=true. Preserve settings. "100 projects"=capacity!=examples/quota; reserve Platform space.\n/26:network_prefix_length=26; Automatic=null, never mandatory /24 or disabled DNS.\nNew:granular; Owner optional.\nIDP!=Configurator roles!=project IAM.\nImmutable accessProfile!=order input: schemaVersion=1,mode=granular;\ninitialOwnerEmail=user/SA!=requester; permissions/automationPermissions=official IDs. Default191=184+7 keys; automation184.\nVM-only narrower +keys. Keys: iam.service-account.{get,list},\niam.service-account-key.{create,delete,edit,get,list}. Keys use ALL SA rights, also elsewhere; privileged Platform SAs outside. No SA create/delete/role/member admin.\nADD keys=seven, requester default; preserve owner/SKE/automation.\nDefaults: server-backup/server-update/run-command (schedules/restore/OS updates/commands), IaaS backups/snapshots writes. Install agent separately; old profiles unchanged; new version+upgrade.\nAll project rights incl.IAM selectable.\nADD SKE=catalogue ske union (both unless specified). Preserve rights. Public+Corporate=both; clarify duplicates.\nSKE IAM!=K8s RBAC; no default IAM role/member admin.\nOwner={schemaVersion:1,mode:owner}: all project rights for both, incl.IAM/project; no immutable audit/routing claim.\nAtomic; no legacy roles.\nPublic+Corporate: ONE common missing owner; preserve explicit owners.\n"Platform service account"=prepared config/org email; ambiguity asks.\nWorkload+services recommended. Legacy: confirm removed roles/context/native Owner defaults.\nPublication needs owner; additive grants; nothing saved/executed.\n\n## Examples\n\n/28:Automatic+DNS.\n\n## Limits\n\nVersion/State bound; review migrations; never delete State. Match region/area/DNS. Empty roles/ACLs!=security; live acceptance.\n\n## Credentials\n\nSeparate grants; no secrets/profile IDs.\n\n## Sources\n\nIaC.\n', + text: '# Landing-Zone Projects and Application Templates\n\n## Purpose\n\nTemplates/IAM.\n\n## Accelerator Contract\n\nlanding_zones:corporate/region/area,project_code/env/owner_email,network/roles/services.\nPublic:corporate=false; drafts:projectTemplates/policies.\nAutomatic=null:Corporate resolves regional SNA default_prefix_length before Plan; numeric to Provider0.114; preserve DNS.\nProvider0.114: null prefix+DNS(even []) invalid; native resolves, overrides win; Public provider sizing.\n\n## Dependencies\n\nVerified identity/governance; regional SNA; separate credentials. Public!=Corporate; namespaces:Platform K8s.\n\n## Dialogue\n\nNew:name/kind/region/settings; reuse keys.\nCentral=Corporate; Internet-only=Public; local network=true. Preserve settings. "100 projects"=capacity!=examples/quota; reserve Platform space.\n/26:network_prefix_length=26; Automatic=null, never mandatory /24 or disabled DNS.\nNew:granular; Owner optional.\nIDP!=Configurator roles!=project IAM.\nImmutable accessProfile!=order input: schemaVersion=1,mode=granular;\ninitialOwnerEmail=user/SA!=requester; permissions/automationPermissions=official IDs. Default191=184+7 keys; automation184.\nVM-only narrower +keys. Keys: iam.service-account.{get,list},\niam.service-account-key.{create,delete,edit,get,list}. Keys use ALL SA rights, also elsewhere; privileged Platform SAs outside. No SA create/delete/role/member admin.\nADD keys=seven, requester default; preserve owner/SKE/automation.\nDefaults: server-backup/server-update/run-command (schedules/restore/OS updates/commands), IaaS backups/snapshots writes. Install agent separately; old profiles unchanged; new version+upgrade.\nAll project rights incl.IAM selectable.\nADD SKE=catalogue ske union (both unless specified). Preserve rights. Public+Corporate=both; clarify duplicates.\nSKE IAM!=K8s RBAC; no default IAM role/member admin.\nOwner={schemaVersion:1,mode:owner}: all project rights for both, incl.IAM/project; no immutable audit/routing claim.\nAtomic; no legacy roles.\nPublic+Corporate: ONE common missing owner; preserve explicit owners.\n"Platform service account"=prepared config/org email; ambiguity asks.\nWorkload+services recommended. Legacy: confirm removed roles/context/native Owner defaults.\nPublication needs owner; additive grants; nothing saved/executed.\n\n\nProject Git: settings.git={enabled,flavor,acl}; disabled; one instance/project.\nPolicy: fixed/bounded input git.enabled/git.flavor/git.acl. Explicit nonempty source CIDRs.\nPublic endpoint, never SNA/firewall-private. Public source ACLs; Git-capable Runner; old orders unchanged.\nIDs: git-10 <=10, git-100 <=100 users/instance; Git10/Git100=labels. Above100: separate instances/architecture;\nno invented larger flavor/federation. Team/project instances partition users, NEVER make endpoints private. Provider0.114 flavor/ACL changes replace.\n\n## Examples\n\n/28:Automatic+DNS.\n\n## Limits\n\nVersion/State bound; review migrations; never delete State. Match region/area/DNS. Empty roles/ACLs!=security; live acceptance.\n\n## Credentials\n\nSeparate grants; no secrets/profile IDs.\n\n## Sources\n\nIaC.\n', sha256: - "61ba07a49d65dd834fe06833ad9446e395303b3421a61f6e0fae5c726ce41782", + "47f1a0b20f63254c542e113f05c2fcc60c43cead231c6a9840f7fa36b4405889", }, { id: "sandbox-projects", @@ -1571,7 +1758,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/modules/sandboxes/variables.tf", @@ -1581,7 +1768,7 @@ export const assistantKnowledgeTopics = { { path: "src/main.tf", sha256: - "1f6d3d6a9d126c4f2567e672fd8f9814cdd0fe5dcc7a2c122035ed551a4462dc", + "d516767ee5f77cf2d6e50c4308e77a8a93fecda6afccb7119bf6c2e085bc85a5", }, { path: "landing-zone-configurator/app/packages/domain/src/common-document.ts", @@ -1598,6 +1785,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A11", "A14", "A23"], @@ -1629,7 +1826,7 @@ export const assistantKnowledgeTopics = { { path: "src/variables.tf", sha256: - "ef9ad5d43e0fff5fb0bbb7f0e29e8caf86ae2e2a2362348c0fe4d268f039e128", + "78181893e1049bf39abfd4da5cb9b13f59832f8e1086b7e13b6735bd794d6d68", }, { path: "src/_landing-zone-kubernetes.tf", @@ -1661,6 +1858,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: ["A12", "A14", "A16", "A23", "A24"], @@ -1720,7 +1927,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/apps/api/src/assistant/knowledge.ts", sha256: - "8548b2866c39a15590d12fc02372b99776cf2f8494962faaf32fd3205049414d", + "462529c3216cd8ba2446d7aacfc07b7bee564c2169899fd77d35f09b7aaaa7e6", }, { path: "landing-zone-configurator/app/apps/api/src/assistant/service.ts", @@ -1740,7 +1947,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts", sha256: - "7af8d5469272cec70e60b74a241622e4613844b555bd339c1cd0006cd40199a4", + "329a05857571b3ffdace9fb10a1c1ecbf340a806cdfda85d91cee032ff1b7ba5", }, { path: "landing-zone-configurator/docs/application-execution-lifecycle.md", @@ -1760,7 +1967,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/packages/domain/src/application-upgrades.ts", sha256: - "6353cf78042c048cffc5b0b5cb0c1197336bdf5e25c2e0856ce2fac3426116ee", + "e31d4b6c69df6a461bd96645a1a426b37d59ba2b933d9f81b19755988286e499", }, { path: "landing-zone-configurator/app/apps/api/src/applications/upgrades.ts", @@ -1770,7 +1977,7 @@ export const assistantKnowledgeTopics = { { path: "landing-zone-configurator/app/packages/contracts/src/application-upgrades.ts", sha256: - "50c9f8568bbd1657ca03c860f08b0488eb03d7cb5d542de968491aee0cb9b4bb", + "e45b65577480f8dc4a4d4f31220a5259819702fcb604d13d5be473a37f633c76", }, { path: "landing-zone-configurator/app/apps/api/db/093_platform_destructive_impact_review.sql", @@ -1787,6 +1994,16 @@ export const assistantKnowledgeTopics = { sha256: "19479e341dc1270eccc27c35dcbe18ee0b0548b7eb63039b18240533f91df2b0", }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/language.ts", + sha256: + "f39f022cb7937e53e7e0b603b2c007e6dfbc3daf15af5a6e525e7aafbc14b2ad", + }, + { + path: "landing-zone-configurator/app/apps/api/src/assistant/architecture-advice.ts", + sha256: + "f36592dd17219bda680038d4e49107415818c4e852e33c717d9652b0cc3c7ae3", + }, ], externalSources: [], scenarios: [ diff --git a/landing-zone-configurator/app/apps/api/src/assistant/knowledge.ts b/landing-zone-configurator/app/apps/api/src/assistant/knowledge.ts index dd2a2274..fb314408 100644 --- a/landing-zone-configurator/app/apps/api/src/assistant/knowledge.ts +++ b/landing-zone-configurator/app/apps/api/src/assistant/knowledge.ts @@ -82,7 +82,7 @@ const fieldOverviewNotes: Record = { "dns-zones": "connectivity.dns_zones und regionale connectivity_regions-Einträge enthalten die Zonen mit stabilen Schlüsseln und den Feldern dns_name, name, description, default_ttl, type, contact_email, acl und network_area_key. SNA default_nameservers legt Resolver fest, keine autoritative Zone. type hat den nativen Default primary. Primary verwaltet die führenden DNS-Einträge bei STACKIT und wird für eine neue dort verwaltete Firmenzone empfohlen. Secondary repliziert eine Kopie vom externen Primary. Beide sind autoritativ; primary/secondary bezeichnet nicht public/private oder die Sichtbarkeit. Der native Accelerator bildet die benötigte Konfiguration externer Primary-Server für Secondary nicht ab; daher kein vollständiges Secondary-Setup und keine stille Umwandlung bestehender Secondary-Zonen. default_ttl hat den nativen Default 3600 Sekunden; 60 bis 99999999 sind im Editor zulässig. Kürzere TTL erleichtert Änderungen, verlängerte TTL hält Cache-Einträge länger. Kontakt und SNA-Zuordnung aus bestätigten Angaben erhalten; kein erfundener Kontakt. ACL wird im gepinnten Provider nicht durchgesetzt und ist kein Zugriffsschutz. Leere Zonen-Map bedeutet keine Zone. Eine freie Subdomain ist keine kostenlose DNS-Service-Zusage. Verfügbarkeit, Delegation, Propagation und Erreichbarkeit bleiben separat zu prüfen. Nur Feld- und Rollenübersicht: nichts geändert, gespeichert oder ausgeführt.", "devops-git": - 'devops=null überspringt das DevOps-Modul. Das native Objekt enthält git_flavor (Standard null) und allowed_network_ranges (Schema-Default ["0.0.0.0/0"]). git_flavor=null erstellt keine Git-Instanz; auch ein reines ACL-Objekt aktiviert Git nicht. Der offene ACL-Default ist keine Zustimmung zu öffentlichem Zugriff: Zugriffsnetze bewusst wählen. Ein Flavor muss bei gewünschtem Git explizit gewählt und für Projekt/Region separat geprüft werden; kein automatisch aktivierter Git-Flavor. Das Root-Modul leitet Projekt, Ownership und Namen ab. Managed Git ist getrennt von GitHub-Anmeldung, Forks und Configurator-CI. Keine Verfügbarkeits-, Leistungs-, Backup- oder Migrationsgarantie; keine Zugangsdaten oder privaten Schlüssel im Chat. Diese Feldübersicht schlägt keine Konfiguration vor und speichert oder provisioniert nichts. Entwurfsübernahme, Speichern, autorisierter Plan und ausdrücklicher Apply bleiben getrennte Schritte.', + 'devops=null überspringt das DevOps-Modul. Das native Objekt enthält git_flavor (Standard null) und allowed_network_ranges (Schema-Default ["0.0.0.0/0"]). git_flavor=null erstellt keine Git-Instanz; auch ein reines ACL-Objekt aktiviert Git nicht. Der offene ACL-Default ist keine Zustimmung zu öffentlichem Zugriff: Zugriffsnetze bewusst wählen. Ein Flavor muss bei gewünschtem Git explizit gewählt und für Projekt/Region separat geprüft werden; kein automatisch aktivierter Git-Flavor. Das Root-Modul leitet Projekt, Ownership und Namen ab. Git10 unterstützt bis zu 10, Git100 bis zu 100 Git-Benutzer pro Instanz. Mehr Benutzer benötigen getrennte Team-/Projektinstanzen oder eine andere Architektur, keine erfundene größere Klasse. Optionales Projekt-Git verwendet separat git.enabled, git.flavor und git.acl im Application-Template; es ist standardmäßig deaktiviert und nicht privat an die SNA angebunden. Managed Git ist getrennt von GitHub-Anmeldung, Forks und Configurator-CI. Keine Verfügbarkeits-, Leistungs-, Backup- oder Migrationsgarantie; keine Zugangsdaten oder privaten Schlüssel im Chat. Diese Feldübersicht schlägt keine Konfiguration vor und speichert oder provisioniert nichts. Entwurfsübernahme, Speichern, autorisierter Plan und ausdrücklicher Apply bleiben getrennte Schritte.', vpn: "connectivity.vpn beziehungsweise connectivity_regions[*].vpn enthält display_name, plan_id, routing_type, availability_zones und connections. null deaktiviert die optionale VPN-Konfiguration. Native Schema-Defaults sind plan_id=p100 und routing_type=ROUTE_BASED; das ist kein Verfügbarkeits-, Berechtigungs- oder Leistungsnachweis. availability_zones benötigt tunnel1 und tunnel2. connections ist eine Map mit stabilen Verbindungsschlüsseln: display_name, enabled (Standard true), local_subnets, remote_subnets und static_routes sowie tunnel1 und tunnel2. Jeder Tunnel enthält remote_address, optionales peering mit local_address/remote_address sowie phase1 und phase2. Die Phasen konfigurieren encryption_algorithms, integrity_algorithms, dh_groups und rekey_time; phase2 zusätzlich dpd_action und start_action. Netze, Gegenstellen, Routing und Kompatibilität müssen getrennt geprüft werden; für reine SNA-interne Kommunikation ist kein VPN erforderlich. vpn_pre_shared_keys ist ein separater geschützter Eingang pro Verbindung mit tunnel1/tunnel2, nicht Teil des öffentlichen connectivity-Objekts. Werte ausschließlich außerhalb des Chats über TF_VAR_vpn_pre_shared_keys oder eine gitignorierte tfvars-Datei bereitstellen; keine PSK-Werte anfordern, anzeigen oder durch den Assistant exportieren. Feldübersicht ist kein Einrichtungsvorschlag: nichts gespeichert oder ausgeführt. Plan, geschützte Zugänge und Apply benötigen separate autorisierte Prüfung.", "audit-logs": "Zentrale Audit-Protokollierung nutzt Telemetry Link → Telemetry Router → S3-Archiv und genau ein Abfrageziel. Mit observability != null ist das Ziel deren OTLP-Endpunkt; Ereignisse stehen dem eingebauten Grafana Audit Logs Dashboard zur Verfügung. Technische Observability-Credentials dienen der Ingestion/Abfrage, nicht dem SSO-Login ins Grafana. Grafana-Admin-Zugang ist für die Anbindung nicht nötig. Ohne Observability bleibt eine eigene Logs-Instanz das Abfrageziel.\n\nFür die direkte Dev-Umstellung auf die vorhandene Observability einen frischen Plattform-Plan prüfen und Apply separat freigeben. Alte Logs-Instanz, Tokens und Destination werden entfernt; damit geht deren bisherige Historie verloren. Keine historische Nachlieferung. Router, Links, Projekte und S3-Archiv bleiben erhalten, sofern der konkrete Plan dies bestätigt. Bereits korrekt angebundene Application-Bestellungen brauchen für diesen zentralen Zielwechsel kein eigenes Update. Bestehende unverbundene Bestellungen benötigen dagegen erst den freigegebenen Plattform-Upgrade-Pfad und ihren frischen Plan/Apply. Das ist nicht derselbe Vorgang.\n\nObservability braucht einen logs-fähigen Plan und hat eigene Aufbewahrung und Kosten. audit_logs.retention_days steuert das S3-Archiv und nur im Fallback die Logs-Instanz; es setzt keine Observability-Aufbewahrung. Router-Egress-Bereiche ergänzen die ACL des gewählten Ziels. router_egress_cidrs=null nutzt den öffentlichen STACKIT-Feed; eine explizite Liste muss nicht leer sein. acl betrifft Logs-Clients, observability.acl Observability.\n\naudit_logs enthält retention_days, acl, s3_object_lock, router_egress_cidrs und link_scopes. Der native Object-Lock-Default ist true, auch bei verschachteltem null; explizites false entscheidet vor Erstellung dagegen. Bei aktivem GOVERNANCE-Lock gilt 1–365 Tage, kein reversibler Schalter und keine Compliance-Zusage. Neue Audit-Entwürfe brauchen Retention, ACL und eine ausdrückliche Lock-Auswahl zusammen. Organisations-Links erben keine Projekte/Ordner. managed_resources=true ergänzt verwaltete Projekte/Ordner derselben Region und neue Bestellungen; keine gleichzeitigen manuellen link_scopes.\n\nZustellung in Dashboard und S3 mit frischen Ereignissen separat prüfen. Keine Zustellgarantie aus einem erfolgreichen Apply ableiten. Nur Beratung; noch nichts gespeichert oder ausgeführt.", diff --git a/landing-zone-configurator/app/apps/api/src/assistant/language.ts b/landing-zone-configurator/app/apps/api/src/assistant/language.ts new file mode 100644 index 00000000..350f5195 --- /dev/null +++ b/landing-zone-configurator/app/apps/api/src/assistant/language.ts @@ -0,0 +1,40 @@ +export function resolveAssistantLanguage( + preference: "de" | "en" | undefined, + history: { role: "user" | "assistant"; content: string }[], + message: string, +): "de" | "en" { + if (preference) return preference; + const sources = [ + message, + ...history + .filter((entry) => entry.role === "user") + .map((entry) => entry.content) + .reverse(), + ]; + for (const source of sources) { + const answer = + source.split(/(?:My answer|Meine Antwort)\s*:\s*/i).at(-1) ?? source; + if ( + /(?:answer|reply|respond|antworte|antworten).{0,30}(?:english|englisch)/i.test( + answer, + ) + ) + return "en"; + if ( + /(?:answer|reply|respond|antworte|antworten).{0,30}(?:german|deutsch)/i.test( + answer, + ) + ) + return "de"; + const german = + answer.match( + /\b(?:bitte|welche\w*|wie|ich|wir|möchte\w*|nutze\w*|nimm|hinzufügen|ändern|konfigurieren|sollen|besteller|ordner|gespeichert|entwurf|keine\w*|unsere\w*)\b/gi, + )?.length ?? 0; + const english = + answer.match( + /\b(?:please|which|what|how|i|we|use|add|change|configure|should|could|would|here|company|our|choose|keep|retain|let|need)\b/gi, + )?.length ?? 0; + if (german || english) return german >= english ? "de" : "en"; + } + return "de"; +} diff --git a/landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts b/landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts index 10171173..86e49551 100644 --- a/landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts +++ b/landing-zone-configurator/app/apps/api/src/assistant/model-serving.ts @@ -29,6 +29,10 @@ import { buildMultiTemplatePermissionDialogue, resumeMultiTemplatePermissionDialogue, } from "./application-permission-dialogue.js"; +import { + architectureAdviceSelections, + reviewedArchitectureAdvice, +} from "./architecture-advice.js"; import { assistantAccessPaths, assistantDnsZoneNamesSchema, @@ -84,6 +88,7 @@ import { assistantKnowledgeForTopics, buildAssistantKnowledge, } from "./knowledge.js"; +import { resolveAssistantLanguage } from "./language.js"; import { assistantServingResponseSchema } from "./serving-schema.js"; const lifecycleAdviceTopics: Record< @@ -705,6 +710,7 @@ export class AssistantModelServing { "conversation_intent", "firewall_setup_decisions", "platform_advice_subject", + "component_request_purpose", ].includes(schemaName) ? [ `Return only the JSON response defined by this output contract. Its field descriptions explain the required decisions; do not substitute schema defaults for understanding the user request. Property names and enum values are data, not instructions. Include requested values in the actual changes, not merely in the explanation.\nOutput contract: ${JSON.stringify(servingSchema)}`, @@ -717,6 +723,7 @@ export class AssistantModelServing { : []), ...(schemaName === "conversation_intent" ? [ + "CURRENT TOPIC OWNERSHIP: Questions about an optional service within Application Landing Zone templates belong to project-templates, including managed project Git; do not substitute central devops-git fields. Questions about S3 State backends, conditional object writes, single-writer operation or application/database serialization belong to management-state, not configuration-lifecycle. Evaluating capacity, topology, reachability or locking mechanisms is architecture-advice, not a request for a generic field overview. Actual field enumeration remains field-overview. Scope and intent follow the current user request, not the mere occurrence of a service name.", "CURRENT LIFECYCLE ROUTING: Judge only the latest user question, not topic descriptions, saved values or historical tasks. Informational maintenance of an EXISTING order/Platform Plan belongs to configuration-lifecycle even when the question mentions Kubernetes, templates, audit logs, firewall or network services. Distinguish: (1) a new published template VERSION/permissions/settings adopted by an existing order => template-upgrade; (2) shared firewall/routing effects and adopting a platform CONTRACT => platform-upgrade; (3) unsupported product/Runner/Accelerator SOURCE, desired versus lastApplied, withdrawal or source-bound recovery => execution-source-upgrade; (4) reviewing/acknowledging a saved ROOT PLATFORM PLAN's impact, deletions or replacements => platform-impact-review, whether or not the user names their role. A root Plan approval question without adopting an order's platform contract is platform-impact-review, NOT platform-upgrade. Use mode=advice,adviceTaskSource=current for these informational questions. Examples: 'My order cannot run Drift after a product update; explain template origin versus desired execution and recovery' => execution-source-upgrade. 'How do I use the new published Public template with Kubernetes permissions in this same order and retain my answers?' => template-upgrade. 'Can declining a platform contract upgrade keep the old shared firewall?' => platform-upgrade. 'Mein Plattformplan entfernt die alte zentrale Audit-Ablage. Kann ich die Auswirkungen bestätigen, woran bindet das und brauche ich einen neuen Plan?' => platform-impact-review. The same applies to any known root-platform resource changes, not only audit logging. A component configuration migration is not an order platform-contract upgrade. In particular, explaining how native audit routing changes from Logs to existing Observability/Grafana belongs to topic=audit-logs, adviceTask=field-overview, even when the user calls this an upgrade and asks whether orders need updates. Reserve platform-upgrade for adopting a different order platform contract or shared firewall effects. A new component setup or an actual draft/proposal instruction is not one of these information tasks; preserve draft handling and the latest topic switch. CURRENT FOLLOW-UP ROUTING: A short direct answer to the latest unresolved configuration question continues its requested draft. For an exact existing folder choice after the server asks the target of a pending reader/owner assignment, use topic=governance-folders, mode=draft, and accessAssignment.source for the original USER assignment request, not the assistant question. Saved values alone never authorize assignments; no unresolved question means no continuation.", ] : []), @@ -1223,6 +1230,7 @@ export class AssistantModelServing { ? customApplicationAccessIntent : allApplicationAccessIntents; const intentSchema = z.strictObject({ + reviewedArchitecture: architectureAdviceSelections, applicationAccessLanguage: z .enum(["de", "en"]) .default("de") @@ -1406,13 +1414,14 @@ export class AssistantModelServing { "platform-upgrade", "execution-source-upgrade", "field-overview", + "architecture-advice", "capability-boundary", "policy-request", "other", ]) .default("other") .describe( - "For current informational existing-order or Platform Apply questions select topic=configuration-lifecycle,mode=advice,adviceTaskSource=current. Choose the subject of the LATEST USER QUESTION: template-upgrade means adopting a published same-family template VERSION or revised template permissions/settings in an EXISTING order, including retained answers and self-service approval. Mentioning the Platform Owner is not itself a shared platform change. platform-upgrade means shared platform/firewall/routing effects and adopting the actual approved platform CONTRACT in an existing order. execution-source-upgrade means product/Runner/Accelerator SOURCE compatibility, origin/desired/lastApplied, withdrawn packages or interrupted-job recovery; comparing template origin while discussing execution remains this task. platform-impact-review means deciding whether a saved ROOT PLATFORM PLAN with dependent Applications, deletions or replacements may Apply, and what impact acknowledgement binds. The user need not name their role: the saved root Plan and its impact approval are the subject. That is not configuring audit/firewall services and not an order's template/contract upgrade. These tasks only explain workflows: actual proposal/setup requests remain draft/other. Never infer the current task from historical questions or component words alone. application-access for current advice about Application project IAM permission profiles, granular VM versus full owner, initial project owner or workload automation rights (topic=project-templates,mode=advice); never use it for actual proposals or unrelated network/IPv4 fields. NUR die LETZTE Nutzernachricht bewerten: capability-boundary bei der Frage, ob Accelerator/Chat Firewall-Regeln oder NAT ueberhaupt konfigurieren kann; policy-request bei einem Auftrag, Firewall-Regeln, NAT, Aliase oder Routen zu definieren/vorzuschlagen. Beide verwenden topic=firewall-policy, adviceTaskSource=current und haben Vorrang vor einem laufenden Infrastruktur-Setup. Fruehere Regelfragen sind KEIN aktueller Auftrag. Eine Antwort mit unbekannter Verkehrskapazitaet hat adviceTask=other. field-overview fuer aktuelle Informationsfragen nach nativen konfigurierbaren Feldern, Defaults oder Grenzen, ohne Einrichtungsauftrag. Das gilt auch fuer eine VPN-Felduebersicht mit der Frage, wie PSKs separat hinterlegt werden (keine geheimen Werte). Sonst other.", + "For current informational existing-order or Platform Apply questions select topic=configuration-lifecycle,mode=advice,adviceTaskSource=current. Choose the subject of the LATEST USER QUESTION: template-upgrade means adopting a published same-family template VERSION or revised template permissions/settings in an EXISTING order, including retained answers and self-service approval. Mentioning the Platform Owner is not itself a shared platform change. platform-upgrade means shared platform/firewall/routing effects and adopting the actual approved platform CONTRACT in an existing order. execution-source-upgrade means product/Runner/Accelerator SOURCE compatibility, origin/desired/lastApplied, withdrawn packages or interrupted-job recovery; comparing template origin while discussing execution remains this task. platform-impact-review means deciding whether a saved ROOT PLATFORM PLAN with dependent Applications, deletions or replacements may Apply, and what impact acknowledgement binds. The user need not name their role: the saved root Plan and its impact approval are the subject. That is not configuring audit/firewall services and not an order's template/contract upgrade. These tasks only explain workflows: actual proposal/setup requests remain draft/other. Never infer the current task from historical questions or component words alone. application-access for current advice about Application project IAM permission profiles, granular VM versus full owner, initial project owner or workload automation rights (topic=project-templates,mode=advice); never use it for actual proposals or unrelated network/IPv4 fields. NUR die LETZTE Nutzernachricht bewerten: capability-boundary bei der Frage, ob Accelerator/Chat Firewall-Regeln oder NAT ueberhaupt konfigurieren kann; policy-request bei einem Auftrag, Firewall-Regeln, NAT, Aliase oder Routen zu definieren/vorzuschlagen. Beide verwenden topic=firewall-policy, adviceTaskSource=current und haben Vorrang vor einem laufenden Infrastruktur-Setup. Fruehere Regelfragen sind KEIN aktueller Auftrag. Eine Antwort mit unbekannter Verkehrskapazitaet hat adviceTask=other. architecture-advice for evaluating a concrete workload, capacity/user limit, architecture choice, service reachability or State concurrency/recovery mechanism. Answer that question using the reviewed topic, rather than replacing it with a generic field list. This includes whether Git100 serves 250 users, per-project Git reachability in SNA and conditional-S3 versus database coordination. field-overview only for an actual request to enumerate native configurable fields/defaults, without an architecture or workload decision or setup request. Das gilt auch fuer eine VPN-Felduebersicht mit der Frage, wie PSKs separat hinterlegt werden (keine geheimen Werte). Sonst other.", ), adviceTaskSource: z .enum(["current", "none"]) @@ -1681,16 +1690,71 @@ export class AssistantModelServing { if (!intentResult.success) throw new AssistantInferenceError("intent_schema"); const classifiedIntent = intentResult.data; + if (classifiedIntent.mode === "advice") + classifiedIntent.applicationAccessLanguage = resolveAssistantLanguage( + undefined, + history, + message, + ); + const componentRoots = + context.topics + .find((topic) => topic.id === classifiedIntent.topic) + ?.inputs.filter((input) => assistantEditorInputs.includes(input)) ?? []; if ( classifiedIntent.mode === "advice" && - classifiedIntent.adviceTaskSource === "current" && - Object.hasOwn( - assistantApplicationUpgradeAdvice, - classifiedIntent.adviceTask, - ) && - lifecycleAdviceTopics[ - classifiedIntent.adviceTask as keyof typeof assistantApplicationUpgradeAdvice - ].has(classifiedIntent.topic) + componentRoots.length === 1 && + Object.hasOwn(assistantEditorPolicies, componentRoots[0]!) + ) { + const purposeSchema = z.strictObject({ + purpose: z.enum(["information", "prepare-draft"]), + quote: z.string().min(1).max(1200).nullable(), + }); + const checkedPurpose = purposeSchema.safeParse( + await this.complete( + [ + { + role: "system", + content: + "Determine the purpose of the CURRENT USER message for this supported component. prepare-draft means the user explicitly asks to add, configure or prepare a reviewable configuration proposal. Missing size, access networks or other choices do NOT turn that request into an information question: the setup flow must ask for them. Preparing a local draft is neither saving nor cloud execution; 'do not deploy' does not defer a draft request. information means asking about fields, defaults, capabilities or architecture, or explicitly deferring proposal preparation. Earlier assistant messages or requests do not select the current purpose. Ambiguous intent stays information. For prepare-draft copy a nonempty exact current USER quote establishing the request; otherwise quote=null. Do not answer the question, invent settings, or perform any changes.", + }, + { + role: "user", + content: JSON.stringify({ + component: classifiedIntent.topic, + message, + }), + }, + ], + assistantEditorResponseSchema(purposeSchema), + "component_request_purpose", + undefined, + stream?.signal, + ), + ); + if (!checkedPurpose.success) + throw new AssistantInferenceError("intent_schema"); + const purpose = checkedPurpose.data; + if (purpose.purpose === "prepare-draft") { + if (!purpose.quote || !message.includes(purpose.quote)) + throw new AssistantInferenceError("intent_evidence"); + classifiedIntent.mode = "draft"; + classifiedIntent.adviceTask = "other"; + classifiedIntent.adviceTaskSource = "none"; + classifiedIntent.editorContract = true; + classifiedIntent.editorInputs = componentRoots; + } + } + if ( + classifiedIntent.mode === "advice" && + ((classifiedIntent.adviceTaskSource === "current" && + Object.hasOwn( + assistantApplicationUpgradeAdvice, + classifiedIntent.adviceTask, + ) && + lifecycleAdviceTopics[ + classifiedIntent.adviceTask as keyof typeof assistantApplicationUpgradeAdvice + ].has(classifiedIntent.topic)) || + classifiedIntent.topic === "audit-logs") ) { // A workflow label can confuse a root Plan, template or order contract. // Verify this narrow subject from the latest question alone, without the large @@ -1727,11 +1791,18 @@ export class AssistantModelServing { throw new AssistantInferenceError("invalid_scope"); classifiedIntent.topic = "audit-logs"; classifiedIntent.adviceTask = "field-overview"; - } else { + } else if (subject.data.task !== "other") { classifiedIntent.adviceTask = subject.data.task; - if (subject.data.task === "other") - classifiedIntent.adviceTaskSource = "none"; - else classifiedIntent.topic = "configuration-lifecycle"; + classifiedIntent.adviceTaskSource = "current"; + classifiedIntent.topic = "configuration-lifecycle"; + } else if ( + Object.hasOwn( + assistantApplicationUpgradeAdvice, + classifiedIntent.adviceTask, + ) + ) { + classifiedIntent.adviceTask = "other"; + classifiedIntent.adviceTaskSource = "none"; } } // A closed current-turn workflow task owns its lifecycle topic. Requiring @@ -1804,6 +1875,23 @@ export class AssistantModelServing { ) throw new AssistantInferenceError("intent_evidence"); + if (classifiedIntent.mode === "advice") { + const advice = reviewedArchitectureAdvice( + classifiedIntent.reviewedArchitecture, + message, + classifiedIntent.applicationAccessLanguage, + context.rules.map((rule) => rule.id), + ); + if (advice) { + const dialogue = validateDialogue( + advice, + context.rules.map((rule) => rule.id), + ); + stream?.onText(dialogue.explanation); + return dialogue; + } + } + const policyBoundary = () => { const policyOverview = context.topics.find( (topic) => topic.id === "firewall-policy", @@ -2810,7 +2898,16 @@ export class AssistantModelServing { : []), ]); const referenceIds = topicKnowledge.rules.map((rule) => rule.id); - stream?.onText("Editor-Vorschlag wird geprüft. Noch nichts gespeichert."); + const editorLanguage = resolveAssistantLanguage( + undefined, + history, + message, + ); + stream?.onText( + editorLanguage === "en" + ? "Checking the Editor proposal. Nothing has been saved." + : "Editor-Vorschlag wird geprüft. Noch nichts gespeichert.", + ); const answer = await this.complete( [ { @@ -2827,7 +2924,7 @@ templateSetup contains source-checked USER decisions: its kinds and localNetwork When templateSetup.resolvedDefaults is non-null, the server has resolved every essential choice for this network-only request: use its region, and its networkAreaKey as settings.network_area_key for Corporate. Template kinds, local networks and delegated naming are already answered. Return questions=[] as required by the schema; do not ask the user to repeat native keys, naming, subnet defaults or other unrequested optional settings. Missing or ambiguous Corporate areas, missing region/naming and additional service choices retain the normal question contract. New component objects expose all their typed property slots: fill every explicitly requested value, use null only for unrequested native defaults. Never invent extra retention values. Required non-null creation decisions need actual user consent; otherwise ask questions with changes=[]. New map entries require all native mandatory fields, including Kubernetes region and node-pool name. Use existing nested paths for partial updates, preserving sibling values. All replies describe PROPOSALS, not completed setup. Field acceptance changes only the local draft, saving remains separate; no deployment, permissions granted, publication or Plan/Apply. Return the supplied JSON schema only. Reviewed knowledge: ${JSON.stringify({ fields: draftFields, ...topicKnowledge })} -CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English CURRENT USER request set replyLanguage=en and write all explanation/questions in English. For a German request set replyLanguage=de and write German. For a values-only answer continue the latest natural-language USER turn. The language of these curated rules, schema defaults or earlier ASSISTANT text does not choose the response language. An ordinary setup request receives focused questions or a clearly labelled, grounded best-practice proposal; never blame the user for missing native field syntax.`, +CURRENT RESPONSE LANGUAGE: ${editorLanguage === "en" ? "English" : "German"}. Your JSON must contain replyLanguage. For an English CURRENT USER request set replyLanguage=en and write all explanation/questions in English. For a German request set replyLanguage=de and write German. For a values-only answer continue the latest natural-language USER turn. The language of these curated rules, schema defaults or earlier ASSISTANT text does not choose the response language. An ordinary setup request receives focused questions or a clearly labelled, grounded best-practice proposal; never blame the user for missing native field syntax.`, }, { role: "user", @@ -2900,10 +2997,11 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English ]); let responseLanguage: "de" | "en" = "de"; try { - const { replyLanguage, ...provided } = z + const { replyLanguage: _modelLanguage, ...provided } = z .object({ replyLanguage: z.enum(["de", "en"]).default("de") }) .passthrough() .parse(answer); + const replyLanguage = editorLanguage; responseLanguage = replyLanguage; const dialogue = validateDialogue(provided, referenceIds); questionListSchema.parse(dialogue.questions); @@ -3788,7 +3886,9 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English targetAreaKeys.map((key) => [ key, firewallValues[key] != null - ? responseFirewallSchema(firewallValues[key]).optional() + ? requestedHa && objectValue(firewallValues[key]).ha == null + ? responseFirewallSchema(firewallValues[key]) + : responseFirewallSchema(firewallValues[key]).optional() : responseFirewallSchema(null), ]), ), @@ -3929,6 +4029,28 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English context.rules.map((rule) => rule.id), ); } + const requiredHaProposal = + firewallDraft && + canProposeFirewall && + !hasNewFirewall && + requestedHa && + existingFirewalls.some((firewall) => firewall.ha == null); + const firewallChanges = z + .array( + z.strictObject({ + path: z.literal( + singleFirewallForm + ? "connectivity.firewall" + : "connectivity.firewalls", + ), + value: firewallSchema, + }), + ) + .min(requiredHaProposal ? 1 : 0) + .max(canProposeFirewall ? 1 : 0) + .describe( + "ONE coherent native firewall patch when requested HA is absent on an existing appliance and technical prerequisites are available. Business sizing/traffic follow-ups do not defer this reviewable HA patch. Preserve all other saved fields and native IP defaults. Otherwise at most one patch; missing technical prerequisites mean no changes and targeted questions.", + ); if (dnsSettingsDraft || foundationDraft || networkDraft || firewallDraft) stream?.onText("Vorschlag wird geprüft. Noch nichts gespeichert."); const result = await this.complete( @@ -3987,7 +4109,7 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English ? "DNS CONTRACT: Suitable DNS settings delegate reviewable name, description and TTL proposals and a known contact default, not invented contacts, ACLs, new topology or execution. Existing DNS keys stay stable; no identity/folder naming delegation needed. Current configuration values are the authoritative saved baseline, even if older conversation messages describe a previous value or a name-only limitation. Reuse the saved domain unless the latest user explicitly requests a domain change; distinguish dns_name (domain) from name (display name). Preserve an existing DNS contact; for an unset contact propose saved owner_email, otherwise verified assistant.user_email, stating its source. Do not claim a saved value was just changed. Explain settings and missing business facts. Never ask whether to accept a proposal: dedicated field-selection controls handle that decision." : foundationDraft ? `NAMING CONTRACT: ${JSON.stringify(delegation)} is bounded naming delegation extracted from user requirements. Use explicitly supplied company names as written. For delegated company_code choose a concise resource naming abbreviation; for delegated rm_folders propose suitable names (1-40 chars) for EXISTING keys in currentPublicScalarValues.rm_folders. Without delegation use names explicitly supplied by the user or ask. rm_folders is the only supported nested governance patch: partial existing keys to {name:string}, never descriptions, owner_emails, reader_emails or new keys. Preserve all other metadata and internal/resource IDs. The existing organization_id is the sole UUID draft exception: reuse only the exact user-supplied UUID, never infer access or change tenant binding. owner_email may use actual user requirements, the saved owner address or verified assistant.user_email as a reviewable default. Naming delegation never permits guessing region, emails, grants, parent IDs or credentials. Prepare supported proposals now, not repeated naming questions. Say proposed, not saved or deployed. Missing foundation requirements remain questions, not invented values.` - : `${intent.topic === "configuration-lifecycle" ? "UPGRADE ADVICE: Distinguish three different bindings. A TEMPLATE upgrade is not merely changing a Git source: Platform Owner publishes a forward path within the SAME template family; requester opens order Updates, retains previous parameter answers, supplies new required answers, previews and confirms desired snapshot; same order/project/State/backend; then NEW actual Plan and separate normal Apply. Disallowed infrastructure/service/account/credential deletion/replacement and unknown evidence are hard-blocked, no checkbox bypass; exact-Plan project custom-role and role-assignment removals/replacements can be sensitive IAM transitions. The published path EXECUTION policy alone decides approval, independently of old/new NEW-ORDER policies. Explicit requester self-service lets Application Owner review a fresh Plan and confirm Apply WITHOUT additional Platform Owner approval. Separate Plan approval mode requires exact-Plan approval, even for ordinary changes. Editing a path appends a new immutable publication; existing targets/Plans retain their recorded policy, so adopt the new path and create a fresh Plan rather than retroactively unlocking old Plans. A PLATFORM update immediately changes shared firewall/routes for ALL dependent Applications; declining a contract upgrade cannot preserve a private old firewall. Before Platform Apply, dependency impact gate binds Plan/artifact/State/dependency set and blocks unknown/incomplete evidence, active executions/Recovery and changed State; the Platform Owner decides known deletions/replacements after reviewing Plan changes, counts, data-loss risk and affected Applications, with explicit impact acknowledgement and separate destructive Apply approval. AFTER a successful, proven Platform Apply, Platform Owner publishes the ACTUAL resulting approved platform contract and a forward contract path. The Application Owner explicitly adopts that contract for the SAME order, possibly keeping the same template version. Your answer MUST explicitly explain that the order contract binding does NOT update automatically: shared cloud changes already affect it, but adopting a new contract is a separate explicit action. Never claim that declining an upgrade automatically binds the order to the new contract, or that a template upgrade only changes Git source. These are separate from EXECUTION-SOURCE upgrades. Only for an Accelerator source upgrade, explicitly include BOTH a fresh Plan review (changes/replacements/deletions) AND the normal separate explicit Apply approval. The upgrade action itself only changes desired source; it never starts either operation. Preserve the same order/project/State identity. Distinguish immutable template origin, desired source, and last successful Apply source. lastApplied is neither the actual current State nor the source to use for interrupted-job Recovery. Failed Apply can change State/resources; Recovery uses the interrupted job source and blocks upgrade until reconciled. Withdrawn sources cannot execute; unresolved Recovery needs an operator-provided reviewed compatible package. Do not recommend reordering or promise unchanged failed State/no data loss. Chat performs no upgrade or execution. " : ""}ADVICE CONTRACT: The current topic is ${intent.topic}. Answer the actual question fully from that topic's reviewed Accelerator Contract and Limits, with its native field names and supported values. Cite that topic, not only a dependency. Distinguish native Accelerator/editor fields from the narrower chat patch whitelist: unsupported chat patches do NOT mean those fields are immutable or absent in the editor. A fields overview lists concrete fields and limits in explanation; never merely announce a list, replace the answer with follow-up questions, or invent missing features. Questions only resolve actual missing requirements for the current topic, never unrelated components. No changes or saved/deployed claim in advice mode. For governance, distinguish rm_folder_parent_id and organization roles from the names-only chat patch: names 1-40 characters; meaningful folder descriptions are rejected, not silently ignored. For sandbox projects the only native fields are project_name, project_owner_email and optional owner_emails; no native expiry or budget controls. For firewall policy list firewall_config aliases, routes, rules, outbound_nat and port_forwards, endpoint/TLS and pass/block/reject with in/out; explain external bootstrap and explicit HA policy synchronization separately from CARP/pfsync, without starting the infrastructure capacity questionnaire.`, + : `${intent.topic === "configuration-lifecycle" ? "UPGRADE ADVICE: Distinguish three different bindings. A TEMPLATE upgrade is not merely changing a Git source: Platform Owner publishes a forward path within the SAME template family; requester opens order Updates, retains previous parameter answers, supplies new required answers, previews and confirms desired snapshot; same order/project/State/backend; then NEW actual Plan and separate normal Apply. Disallowed infrastructure/service/account/credential deletion/replacement and unknown evidence are hard-blocked, no checkbox bypass; exact-Plan project custom-role and role-assignment removals/replacements can be sensitive IAM transitions. The published path EXECUTION policy alone decides approval, independently of old/new NEW-ORDER policies. Explicit requester self-service lets Application Owner review a fresh Plan and confirm Apply WITHOUT additional Platform Owner approval. Separate Plan approval mode requires exact-Plan approval, even for ordinary changes. Editing a path appends a new immutable publication; existing targets/Plans retain their recorded policy, so adopt the new path and create a fresh Plan rather than retroactively unlocking old Plans. A PLATFORM update immediately changes shared firewall/routes for ALL dependent Applications; declining a contract upgrade cannot preserve a private old firewall. Before Platform Apply, dependency impact gate binds Plan/artifact/State/dependency set and blocks unknown/incomplete evidence, active executions/Recovery and changed State; the Platform Owner decides known deletions/replacements after reviewing Plan changes, counts, data-loss risk and affected Applications, with explicit impact acknowledgement and separate destructive Apply approval. AFTER a successful, proven Platform Apply, Platform Owner publishes the ACTUAL resulting approved platform contract and a forward contract path. The Application Owner explicitly adopts that contract for the SAME order, possibly keeping the same template version. Your answer MUST explicitly explain that the order contract binding does NOT update automatically: shared cloud changes already affect it, but adopting a new contract is a separate explicit action. Never claim that declining an upgrade automatically binds the order to the new contract, or that a template upgrade only changes Git source. These are separate from EXECUTION-SOURCE upgrades. Only for an Accelerator source upgrade, explicitly include BOTH a fresh Plan review (changes/replacements/deletions) AND the normal separate explicit Apply approval. The upgrade action itself only changes desired source; it never starts either operation. Preserve the same order/project/State identity. Distinguish immutable template origin, desired source, and last successful Apply source. lastApplied is neither the actual current State nor the source to use for interrupted-job Recovery. Failed Apply can change State/resources; Recovery uses the interrupted job source and blocks upgrade until reconciled. Withdrawn sources cannot execute; unresolved Recovery needs an operator-provided reviewed compatible package. Do not recommend reordering or promise unchanged failed State/no data loss. Chat performs no upgrade or execution. " : ""}ADVICE CONTRACT: The current topic is ${intent.topic}. Do not invent an implementation path contrary to reviewed Limits: public managed endpoints cannot become SNA-private merely by firewall rules; independent instances are not federation; use exact documented native flavor IDs, never display labels as values. A service architecture recommendation must use the actual supported central versus per-project fields. Answer the actual question fully from that topic's reviewed Accelerator Contract and Limits, with its native field names and supported values. Cite that topic, not only a dependency. Distinguish native Accelerator/editor fields from the narrower chat patch whitelist: unsupported chat patches do NOT mean those fields are immutable or absent in the editor. A fields overview lists concrete fields and limits in explanation; never merely announce a list, replace the answer with follow-up questions, or invent missing features. Questions only resolve actual missing requirements for the current topic, never unrelated components. No changes or saved/deployed claim in advice mode. For governance, distinguish rm_folder_parent_id and organization roles from the names-only chat patch: names 1-40 characters; meaningful folder descriptions are rejected, not silently ignored. For sandbox projects the only native fields are project_name, project_owner_email and optional owner_emails; no native expiry or budget controls. For firewall policy list firewall_config aliases, routes, rules, outbound_nat and port_forwards, endpoint/TLS and pass/block/reject with in/out; explain external bootstrap and explicit HA policy synchronization separately from CARP/pfsync, without starting the infrastructure capacity questionnaire.`, }, ...history .slice(-12) @@ -3998,6 +4120,7 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English { role: "system" as const, content: + `CURRENT RESPONSE LANGUAGE: ${intent.applicationAccessLanguage === "en" ? "English. All explanation and questions MUST be in English." : "German. All explanation and questions MUST be in German."} Curated notes and earlier assistant messages do not choose the language. ` + "ANSWER COMPLETENESS: Put the complete factual answer in explanation itself, in the user's language. Use compact bullets and at most 2400 characters, leaving room within the 3000-character response contract. Group equivalent central/regional forms and nested field families instead of repeating long paths in prose. An introduction announcing rules or a list is not an answer: actually include the requested fields, supported values, limits and exclusions from the reviewed topic. Contract names, versions, dates and references are provenance, not substitutes for those facts. For project-template network sizing, distinguish template null from the effective non-null provider prefix: use the reviewed topic facts, explain which layer reads the SNA default and keeps DNS, and never invert the failing null+DNS combination. A requested Automatic choice needs no numeric sizing question. State that inherited size does not guarantee available addresses. Explain native defaults, including null meaning no optional service instance, where relevant; do not promote illustrative enabled values to defaults. For a pure fields/defaults/limits overview return questions=[]: no configuration decisions are missing to answer that informational request. Otherwise questions may ask only genuinely missing business decisions after the factual answer; never request technical IDs, secrets or bootstrap credentials, or move the answer's facts into questions. Before finishing, check that explanation stands alone without an absent continuation or a promised list. Do not invent facts, propose changes or claim anything was saved or executed.", }, ] @@ -4011,6 +4134,14 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English }, ] : []), + ...(intent.adviceTask === "architecture-advice" && selectedTopic + ? [ + { + role: "system" as const, + content: `CURRENT ARCHITECTURE QUESTION: Answer the actual question with this selected reviewed source. Keep capacity partitioning separate from network reachability: moving a managed service to another project does not change its endpoint type. Do not append an undocumented workaround. Use the exact native configuration scope and values from the source; central objects and project-template objects are not interchangeable. No changes, execution, or setup questionnaire. Source: ${context.rules.find((rule) => rule.id === selectedTopic.id)?.text ?? ""}`, + }, + ] + : []), ...(dnsSettingsDraft ? [ { @@ -4031,6 +4162,15 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English ], z.toJSONSchema( dialogueSchema.extend({ + ...(intent.adviceTask === "architecture-advice" + ? { + replyLanguage: z + .enum(["en", "de"]) + .describe( + "Required response language of the CURRENT USER question: English means en with all explanation/questions in English, German means de. Curated German field notes and earlier Assistant text do not select language.", + ), + } + : {}), ...(foundationDraft ? { replyLanguage: z @@ -4101,21 +4241,7 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English : 8, ), changes: firewallDraft - ? z - .array( - z.strictObject({ - path: z.literal( - singleFirewallForm - ? "connectivity.firewall" - : "connectivity.firewalls", - ), - value: firewallSchema, - }), - ) - .max(canProposeFirewall ? 1 : 0) - .describe( - "At most ONE coherent native firewall patch; combine all requested fields in it. New appliances require every mandatory field and requested HA together. Missing prerequisites mean changes=[], ask targeted questions. NEVER split a path across entries.", - ) + ? firewallChanges : z .array( z.union([ @@ -4292,6 +4418,8 @@ CURRENT RESPONSE LANGUAGE: Your JSON must contain replyLanguage. For an English if (!draftAllowed && dialogue.changes.length > 0) throw new Error("assistant_invalid_scope"); if (firewallDraft) { + if (!firewallChanges.safeParse(dialogue.changes).success) + throw new Error("assistant_invalid_scope"); if (!canProposeFirewall && dialogue.changes.length) throw new Error("assistant_invalid_scope"); const catalogueFields = { diff --git a/landing-zone-configurator/app/apps/api/src/deployments/preparations.ts b/landing-zone-configurator/app/apps/api/src/deployments/preparations.ts index 233ed442..1c341e92 100644 --- a/landing-zone-configurator/app/apps/api/src/deployments/preparations.ts +++ b/landing-zone-configurator/app/apps/api/src/deployments/preparations.ts @@ -106,7 +106,12 @@ export function preparationTfvars( >, ) { const values = recordValues(manifest.configuration); - if (manifest.accelerator.commit === platformUpgradeAcceleratorCommit) { + if ( + [ + platformUpgradeAcceleratorCommit, + "6398834bf20a4f24ea81c1f7dd0627025b4a81ce", + ].includes(manifest.accelerator.commit) + ) { const namespace = z.uuid().parse(manifest.platformContractNamespace); return serializeTfvars({ ...values, @@ -362,6 +367,7 @@ export class Preparations { // explicit reconciliation. Never make a fresh/empty bootstrap here. const compatibleSources = [ platformUpgradeAcceleratorCommit, + "6398834bf20a4f24ea81c1f7dd0627025b4a81ce", "c83f3d910ab20131d1cba898023317c0e818843b", "c4b43c36af198985980b17626c48d357795e3fbd", ]; diff --git a/landing-zone-configurator/app/apps/api/src/plans/routes.ts b/landing-zone-configurator/app/apps/api/src/plans/routes.ts index 15860c55..28ae1588 100644 --- a/landing-zone-configurator/app/apps/api/src/plans/routes.ts +++ b/landing-zone-configurator/app/apps/api/src/plans/routes.ts @@ -61,6 +61,17 @@ export function registerPlans( ) { return reply.code(409).send({ error: error.message }); } + if ( + error instanceof Error && + "code" in error && + error.code === "40001" && + [ + "state_locked", + "state_backend_already_managed", + "state_backend_binding_invalid", + ].includes(error.message) + ) + return reply.code(409).send({ error: error.message }); if (error instanceof CredentialError || error instanceof RepositoryError) return reply.code(error.status).send({ error: error.code }); if (error instanceof z.ZodError) diff --git a/landing-zone-configurator/app/apps/web/src/components/Applications.tsx b/landing-zone-configurator/app/apps/web/src/components/Applications.tsx index b20edd21..0c066b56 100644 --- a/landing-zone-configurator/app/apps/web/src/components/Applications.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/Applications.tsx @@ -114,6 +114,10 @@ const errors: Record = { "Der Runner ist noch aktiv oder sein Ende ist nicht nachgewiesen. Bitte später erneut prüfen.", application_plan_recovery_runner_unavailable: "Der Zustand des Runners konnte nicht eindeutig geprüft werden. Bitte später erneut prüfen.", + state_backend_already_managed: + "Dieser S3-State-Pfad ist bereits einer anderen verwalteten Landing Zone zugeordnet. Wähle einen eigenen State-Pfad.", + state_backend_binding_invalid: + "Die State-Zuordnung ist ungültig. Prüfe das ausgewählte Backend.", application_plan_recovery_state_locked: "Der Application-State ist gesperrt. Keine Freigabe möglich; die Sperre wird nicht verändert.", application_plan_recovery_state_invalid: diff --git a/landing-zone-configurator/app/apps/web/src/components/Deployments.tsx b/landing-zone-configurator/app/apps/web/src/components/Deployments.tsx index f8299da2..7c219e40 100644 --- a/landing-zone-configurator/app/apps/web/src/components/Deployments.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/Deployments.tsx @@ -80,6 +80,10 @@ const errors: Record = { "Der aktuelle Accelerator-Stand ist für neue Vorbereitungen nicht freigegeben. Bitte die Runner-Konfiguration prüfen lassen.", platform_upgrade_state_unavailable: "Für den Accelerator-Wechsel ist der vorhandene S3-State oder ein ausdrücklich geprüfter, unterstützter Bootstrap-Checkpoint erforderlich. Prüfe den Checkpoint und offene Ausführungen; deine Konfiguration bleibt erhalten.", + state_backend_already_managed: + "Dieser S3-State-Pfad ist bereits einer anderen verwalteten Landing Zone zugeordnet. Wähle einen eigenen State-Pfad.", + state_backend_binding_invalid: + "Die State-Zuordnung ist ungültig. Prüfe das ausgewählte Backend.", state_locked: "Der Plattform-State ist durch eine laufende Ausführung gesperrt. Prüfe den Ausführungsstatus und warte auf deren Abschluss.", backend_not_found: diff --git a/landing-zone-configurator/app/apps/web/src/components/PlanRuns.tsx b/landing-zone-configurator/app/apps/web/src/components/PlanRuns.tsx index a8383adc..c1764443 100644 --- a/landing-zone-configurator/app/apps/web/src/components/PlanRuns.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/PlanRuns.tsx @@ -136,6 +136,10 @@ const failures: Record = { "Das gespeicherte Plan-Artefakt konnte nicht bestätigt werden. Erstelle und prüfe einen neuen Plan.", runner_package_changed: "Der Runner wurde aktualisiert. Erstelle und prüfe einen neuen Plan, bevor du Apply freigibst.", + state_backend_already_managed: + "Dieser S3-State-Pfad ist bereits einer anderen verwalteten Landing Zone zugeordnet. Wähle einen eigenen State-Pfad.", + state_backend_binding_invalid: + "Die State-Zuordnung ist ungültig. Prüfe das ausgewählte Backend.", state_locked: "Der State ist durch eine andere Ausführung gesperrt. Prüfe den Ausführungsstatus.", apply_already_started: diff --git a/landing-zone-configurator/app/apps/web/src/components/ProjectTemplates.tsx b/landing-zone-configurator/app/apps/web/src/components/ProjectTemplates.tsx index 3678e72e..02fe1adf 100644 --- a/landing-zone-configurator/app/apps/web/src/components/ProjectTemplates.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/ProjectTemplates.tsx @@ -332,6 +332,7 @@ export function ProjectTemplates({ ? [ "env", "observability", + "git", "network_enabled", "network_prefix_length", ] diff --git a/landing-zone-configurator/app/apps/web/src/components/StateBackends.tsx b/landing-zone-configurator/app/apps/web/src/components/StateBackends.tsx index 95465340..9fc09be6 100644 --- a/landing-zone-configurator/app/apps/web/src/components/StateBackends.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/StateBackends.tsx @@ -277,8 +277,13 @@ export function StateBackends({
{t("Region")}
eu01
{t("State-Locking")}
-
{t("S3-Lockfile")}
+
{t("Über den Configurator koordiniert")}
+

+ {t( + "Der Configurator koordiniert seine Ausführungen auf diesem State. Starte dafür keine parallelen CLI- oder Pipeline-Läufe.", + )} +

diff --git a/landing-zone-configurator/app/apps/web/src/components/TemplateParameters.tsx b/landing-zone-configurator/app/apps/web/src/components/TemplateParameters.tsx index 64757959..dc72622d 100644 --- a/landing-zone-configurator/app/apps/web/src/components/TemplateParameters.tsx +++ b/landing-zone-configurator/app/apps/web/src/components/TemplateParameters.tsx @@ -50,6 +50,9 @@ const defaults: Record = { env: "dev", secretsmanager_enabled: true, "observability.enabled": false, + "git.enabled": false, + "git.flavor": "git-10", + "git.acl": [], "observability.plan_name": "Observability-Starter-EU01", }; @@ -270,6 +273,10 @@ export function TemplateParameters({ "landing_zones[*].observability.plan_name", template.region, ); + const gitCatalogue = useCatalogueOptions( + "landing_zones[*].git.flavor", + template.region, + ); const projectRoles = useCatalogueOptions( "role_assignments[*].role", template.region, @@ -278,7 +285,11 @@ export function TemplateParameters({ (field) => (field.path !== "role_assignments" || !template.accessProfile) && (field.path !== "observability.plan_name" || - templateObservabilityConfigurable(template)), + templateObservabilityConfigurable(template)) && + (!field.path.startsWith("git.") || + field.path === "git.enabled" || + template.parameterPolicy?.fields["git.enabled"]?.source === "input" || + read(template.settings, "git.enabled") === true), ); const policy: TemplateParameterPolicy = template.parameterPolicy ?? { schema_version: 1, @@ -488,6 +499,27 @@ export function TemplateParameters({ ? t("Bei Bestellung auswählbar") : t("Automatisch verknüpft")} + {field.path === "git.enabled" && ( +

+ {t( + "Eigene verwaltete Git-Instanz im Application-Projekt. Bestehendes zentrales Git bleibt davon unabhängig.", + )} +

+ )} + {field.path === "git.flavor" && ( +

+ {t( + "Git10: bis zu 10 Nutzer. Git100: bis zu 100 Nutzer pro Instanz. Für mehr Nutzer eine Aufteilung oder andere Architektur planen.", + )} +

+ )} + {field.path === "git.acl" && ( +

+ {t( + "Öffentliche Quellnetze der Git-Nutzer und Runner angeben. Eine SNA-Anbindung des Projekts macht diesen verwalteten Git-Service nicht privat erreichbar.", + )} +

+ )}