Skip to content

AIFACTORY-FEAT-161: Identity template: the Factory role model with per-project assignments and delegation records

Generated from the architecture model

This page is rendered from model/**/*.yaml by tools/docs_model during mkdocs build. Edit the YAML, not this page; hand-written design lives on the linked service, platform and plane pages.

A design artefact, not a tracker

This backlog is generated from model/backlog/ and validated against the architecture model. No work item exists in any tracker, and no item carries a date, an estimate or an assignee (ADR-0029).

Epic Ecosystem component extensions · Increment I0 Readiness · State elaborated · Route backend-developer · Phase before development · Build order 13 of 185 (Templates and libraries)

Before development

Template or library work: every task of this feature changes a template or a shared library the Factory builds on, and it lands before the Factory's own repositories of I0 are developed. The mark travels with every task (tag phase:before-development).

The Identity microservice owns accounts, credentials, MFA, memberships and roles for the Factory (D18, canonical ADR-0101), and the Authorization Server issues the seven Factory roles as claims from what Identity holds (ADR-0015). The Identity template carries today a flat user, role and claim model: a role is not bound to a project, Platform admin is not a tenant-wide role, and there is no record of a delegation with grantor, grantee, scope, expiry and reason. The template's own findings page records that the multi-valued claims contract (ServiceModel 1.1.x) is promoted and consumed, so repeating role claims can travel; what is missing is the model behind them. Component: Identity microservice (extend).

Delivers —
Stubs —
Realizes components: cmp-identity
adrs: ADR-0008, ADR-0015
bounded contexts: BC-32
Requirements —
Depends on —
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, ConnectSoft.IdentityTemplate/Docs/Consumer-Reported-Findings.md

AIFACTORY-US-240: Identity template: a role assignment binds a member, a role of the seeded catalogue and a project or tenant scope, and the claims API returns one role claim per assignment

enabling · persona asset-maintainer As an asset maintainer, I want the identity service to hold the seven Factory roles as assignments with a scope, so that the authorization server can issue project-scoped role claims from what the identity service holds.

ADR-0015 decision 5 defines seven roles and where each is assigned: Requester, Reviewer, Asset maintainer, Operator and Workspace admin per project, Platform admin for the tenant, Observer for a project or the tenant; decision 6 keeps membership itself per tenant in the identity service and has the roles issued as claims by the authorization server. The identity service is the system of record of role assignments and delegations (D18, amendment of ADR-0015 under D114): ProjectService of the Factory writes its membership commands through the API of this PBI and keeps a projection that it updates from the events this PBI raises, as the invariant of model/services/control-plane/ProjectService.yaml states, so no second writable copy of an assignment exists. The identity template carries a flat user, role and claim model in which a role has no scope. Its findings page records that claims now travel as a list of type and value pairs on the read and bulk-write contracts (the ServiceModel 1.1 stream), so a subject can hold several values of one claim type; what is missing is the model behind them. This PBI adds the role assignment: member, role, scope kind (project or tenant) and scope identifier, with who granted it and when. The template also serves generated products with roles of their own, so the role catalogue is data and the template holds no Factory role name in code: role name, allowed scope kinds, the roles a role covers and whether it may manage assignments are read from a role registration file, which the Factory seeds with its seven roles, and the assignment rules are evaluated against that catalogue. The project identifier is opaque to the identity service: it is stored and returned and never resolved. The service refuses a role the catalogue does not hold, a scope kind the catalogue does not allow for the role (in the Factory catalogue Platform admin with a project scope and a project role other than Observer with a tenant scope), an assignment for a subject who is not a member of the tenant, and a second identical assignment. The grant and the removal are written by a workload on behalf of a member (amendment of ADR-0015 on role writes, D115): the caller presents a workload token that holds the service scope of the write and names the acting member in the request, which is how ProjectService calls them with its own workload token; the user token of the member is not forwarded, because a user token has one audience. The identity service never trusts a role stated by the caller. It checks from its own records that the named actor holds a role that may manage assignments in that scope, in the Factory catalogue Workspace admin of the project or Platform admin of the tenant, and records the actor as grantor together with the workload that wrote. A write whose caller lacks the service scope, that names no actor, or whose actor lacks such a role by the records of the identity service is answered 403, and an assignment addressed by an identifier outside the tenant the request is made for is answered 404. A fresh tenant has no holder of such a role, so the first assignment is a bootstrap and the only write without an actor: a workload caller with the svc. scope of the internal API assigns the first Platform admin when a tenant is provisioned and is recorded as grantor; the first Workspace admin of a project is then assigned through the ordinary grant with that Platform admin named as actor. The internal claims API that the authorization server calls returns one role claim per assignment. Its claim type name and the value that carries the scope are written with the pinned ConnectSoft.Extensions.AI.Factory.Abstractions package, which holds the claim type names, the role names and the formatter and parser of the scoped role value (AIFACTORY-TASK-1173 of AIFACTORY-US-220 in feature component-extensions-ai), so that the authorization server, base and gateway templates pin the same names and none types them again. Each grant and removal raises an integration event, from which ProjectService updates its projection, and is kept for audit with the actor as grantor, the workload that wrote it and the time.

Acceptance criteria

AC1 Given a member of a tenant and the role catalogue seeded with the seven Factory roles, when a workload caller that holds the service scope of the write assigns the member one of the five project roles for a project and names as actor a member whom the records of the identity service hold as Workspace admin of that project, then the assignment is stored with member, role, project scope, the actor as grantor, the workload that wrote it and time, the project identifier is stored as an opaque value, and the internal claims API returns one role claim per assignment of the member, written with the formatter of the pinned Factory abstractions package (ADR-0015 decisions 5 and 6 and its amendment on role writes, D115, ADR-0008).
AC2 Given the assignment rules evaluated against the role catalogue, when a role the catalogue does not hold is assigned, Platform admin is assigned with a project scope, a project role other than Observer is assigned with a tenant scope, the subject is not a member of the tenant or the same assignment exists, then each request is refused with a validation or conflict answer that names the rule and nothing is stored; Observer is accepted with either scope; and a search of the template code finds no Factory role name outside the seeded registration file (ADR-0015 decision 5).
AC3 Given a workload caller that holds the service scope of the write, when it grants or removes an assignment and names an actor who by the records of the identity service is neither Workspace admin of the project nor Platform admin of the tenant, or names no actor, then the answer is 403 and nothing is stored or removed, whatever role the request states for the actor, and the same write from a caller without the service scope is answered 403; given an assignment identifier of another tenant, when a request made for the first tenant reads or removes it, then the answer is 404 (ADR-0015 decision 3, its amendment on a resource of another tenant, D113, and its amendment on role writes, D115; docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md).
AC4 Given a grant or a removal, when it commits in the identity service, the system of record of role assignments, then an integration event naming member, role, scope and grantor is published, from which ProjectService updates its projection as model/services/control-plane/ProjectService.yaml states, the audit record of the change names the actor as grantor, the workload that wrote it and the time, and a removed assignment no longer appears in the claims of the member (ADR-0015 decision 6 and its amendment on the system of record, FR-01).
AC5 Given a tenant that was just provisioned and has no role holder, when a workload caller with the svc. scope of the internal API assigns the first Platform admin, then the assignment is stored with the workload as grantor, and the same call without that scope or for a tenant that already has a Platform admin through the bootstrap is refused; when a workload caller that holds the service scope of the write then names that Platform admin as actor and assigns the first Workspace admin of a project, then the assignment is stored with the Platform admin as grantor and the workload that wrote it (ADR-0015 decisions 5 and 6, FR-01).
Traces: adrs ADR-0008, ADR-0015
Traces: requirements FR-01
Depends on feature:component-extensions-ai
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/adr/0008-openiddict-identity.md, docs/architecture/ecosystem-composition.md, docs/templates-docs/identity-backend-template.md, model/services/control-plane/ProjectService.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-1116 Role assignment contract with scope kinds and the schema of the role registration file contract The service contract of the template holds the role assignment requests and responses with member, role, scope kind and opaque scope identifier, the acting member on the grant and the removal request, the bootstrap request, which names no actor, and the two assignment events; the schema of the role registration file names per role its allowed scope kinds, the roles it covers and whether it may manage assignments; the Factory catalogue with the seven roles is a seeded file and the template code holds no Factory role name; the role claim value is written with the formatter of the pinned Factory abstractions package. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-594 Per-project role assignments for the seven Factory roles implementation A role assignment binds a member, a role of the catalogue and a project scope; Platform admin is the only assignment with tenant scope and Observer may hold either, as the seeded catalogue states; membership stays per tenant; the internal claims API returns one repeating role claim per project assignment so the Authorization Server can issue them; the grant and the removal accept a workload caller that holds the service scope of the write and names an actor, check from the records of the identity service that the actor holds a role of the catalogue that may manage assignments in that scope, answer 403 without the scope, without an actor or for an actor that lacks such a role, whatever role the request states, and record the actor as grantor with the workload that wrote. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1117 Role assignment table and its migration migration A migration adds the role assignment table with member, role, scope kind, scope identifier, tenant, grantor, the workload that wrote it and time, a unique index over member, role and scope, and the tenant filter in its mapping; the mapping test of the template covers it. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1172 Bootstrap of the first Platform admin and the first Workspace admin implementation The internal API holds a bootstrap operation, open only to a workload token with its svc. scope, that assigns the first Platform admin of a provisioned tenant once and records the workload as grantor; it is the only write that names no actor, and the first Workspace admin of a project is assigned through the ordinary grant with that Platform admin named as actor; a second bootstrap for the same tenant and a bootstrap without the scope are refused. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1118 Verify role assignments and their claims on the generated identity service verification Run the acceptance scenarios for the bootstrap, grant, refusal, removal and claims on the generated solution with the seeded Factory catalogue, every grant and removal written by a workload caller that names the actor; the rules of the seven roles hold, the 403 cases (a caller without the service scope, a write without an actor, an actor without the role by the records of the identity service although the request states one) and the 404 case answer as stated, and the audit record names the actor and the workload, which proves AC1 to AC5 of AIFACTORY-US-240 (ADR-0015). ConnectSoft.IdentityTemplate

AIFACTORY-US-241: Identity template: a delegation records grantor, grantee, role, scope, expiry and reason, is revocable, expires on its own and appears in claims only while valid

enabling · persona asset-maintainer As an asset maintainer, I want the identity service to record a delegation of a role with a bounded validity, so that a role holder can hand a role to another member for a period and every such hand-over is recorded and ends without anyone acting.

ADR-0015 decision 6 allows a role holder to delegate the same or a lesser role to another member for a bounded period; every delegation is recorded with grantor, grantee, scope, expiry and reason, is revocable at any time and expires automatically. The identity template has no such record. This PBI adds the delegation beside the role assignment. The amendment of ADR-0015 (D114) decides the order that makes a role lesser, and the role catalogue holds it as data: Observer is below every role; Requester, Reviewer, Asset maintainer and Operator are not comparable with each other and each is below Workspace admin; every role is below Platform admin. The same amendment makes the identity service the system of record of delegations: the delegation commands of ProjectService write through the API of this PBI, and ProjectService keeps a projection that it updates from the grant, revocation and expiry events, as the invariant of model/services/control-plane/ProjectService.yaml states. The grant and the revocation are written by a workload on behalf of a member (amendment of ADR-0015 on role writes, D115): ProjectService calls them with its own workload token, which holds the service scope of the write, and names the acting member in the request; the user token of the member is not forwarded, and the identity service never trusts a role stated by the caller. A holder may delegate the same role or a lesser one in the scope of its own assignment, where a tenant-scope assignment includes the projects of the tenant. The named actor of a grant is the grantor, and the check that the grantor holds the role runs against the records of the identity service for that actor. A delegation names grantor, grantee, the delegated role, the scope of the grantor assignment it derives from, an expiry and a reason. A grant whose caller lacks the service scope, that names no actor, or whose actor by those records holds no role in that scope that is the same as or above the delegated role is answered 403. The service also refuses a delegation to a subject who is not a member of the tenant, one without an expiry or with an expiry beyond the configured maximum, and one without a reason. A revocation names its actor the same way: the grantor, Workspace admin of the project and Platform admin may revoke the delegation at any time, each checked against the records of the identity service, and a revocation without an actor or by any other actor is answered 403. The record of a grant and of a revocation names the actor and the workload that wrote it. Validity is decided when claims are read, so an expired or revoked delegation never appears in the claims of the grantee even before the expiry sweep has run; the sweep marks it expired and raises the event. The claim of a delegated role carries the identifier of the delegation, so that a decision taken under it can be traced to the record, and the claims read returns the expiry of the delegation with it, so that the authorization server can bound the lifetime of a token that carries it. Grant, revocation and expiry each raise an integration event, and when the assignment of the grantor is removed its delegations are revoked with it.

Acceptance criteria

AC1 Given a member who by the records of the identity service holds a role in a project, when a workload caller that holds the service scope of the write names that member as actor and delegates that role or a lesser one to another member of the tenant with an expiry and a reason, then the delegation is stored in the identity service, the system of record of delegations, with the actor as grantor, grantee, role, scope, expiry, reason and the workload that wrote it, an event is raised from which ProjectService updates its projection as model/services/control-plane/ProjectService.yaml states, and the claims of the grantee hold the delegated role claim with the identifier of the delegation and its expiry (ADR-0015 decision 6, ADR-0008).
AC2 Given the role order the amendment of ADR-0015 decides and the role catalogue holds, in which Observer is below every role, Requester, Reviewer, Asset maintainer and Operator are not comparable with each other and each is below Workspace admin, and every role is below Platform admin, when a workload caller writes a delegation that names no actor, or names an actor who by the records of the identity service holds no role in that scope that is the same as or above the delegated role, then the answer is 403, whatever role the request states for the actor; when a delegation names a grantee outside the tenant, no expiry, an expiry beyond the configured maximum or no reason, then the request is refused with the rule named; nothing is stored in any of these cases (ADR-0015 decisions 5 and 6 and its amendments on the role order and on role writes, D115).
AC3 Given a valid delegation, when a workload caller that holds the service scope of the write revokes it and names as actor the grantor, Workspace admin of the project or Platform admin, each by the records of the identity service, or its expiry passes, then the next claims read of the grantee no longer holds the delegated role, the record keeps who ended it, through which workload and when, and an event for the revocation or the expiry is raised once (ADR-0015 decision 6, FR-01).
AC4 Given a grantor whose own assignment is removed, when the removal commits, then every delegation derived from that assignment is revoked with the removal as its reason; a delegation identifier of another tenant is answered 404, and a revocation that names no actor, or an actor who by the records of the identity service is neither the grantor nor Workspace admin of the project nor Platform admin, is answered 403 (ADR-0015 decision 3, its amendment on a resource of another tenant, D113, and its amendment on role writes, D115; docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md).
Traces: adrs ADR-0008, ADR-0015
Traces: requirements FR-01
Depends on AIFACTORY-US-240
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/adr/0008-openiddict-identity.md, model/services/control-plane/ProjectService.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-1119 Delegation contract, the lesser-role relation and the three delegation events contract The service contract of the template holds the delegation grant, revoke and read requests and responses, the acting member on the grant and the revoke request, the maximum expiry option, the relation of same and lesser roles, which is the order of the ADR-0015 amendment, read from the roles each catalogue entry covers, the expiry on the delegated role entry of the claims read, and the events for grant, revocation and expiry with delegation identifier, grantor, grantee, role and scope. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-595 Delegation records with bounded validity and revocation implementation A delegation records grantor, grantee, delegated role (the same or a lesser one by the relation of the catalogue), scope, expiry and reason; it is revocable at any time, expires on its own, raises an event on grant, revoke and expiry, and appears in the grantee's claims only while valid; grant and revocation accept a workload caller that holds the service scope of the write and names an actor, the grantor of a grant and the right to revoke are checked against the records of the identity service for that actor, a write without the scope, without an actor or with an actor that lacks the role is answered 403, and the record names the actor and the workload that wrote it. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1120 Delegation table, its migration and the expiry sweep migration A migration adds the delegation table with the workload that wrote the grant and the revocation, its tenant filter and an index over grantee and expiry for active rows; a scheduled sweep marks delegations past their expiry and raises the expiry event once per delegation. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1121 Verify delegation validity, revocation and expiry on the generated identity service verification Run the acceptance scenarios for grant, revocation, expiry with a controlled clock and removal of the grantor assignment, and the acceptance matrix of delegations over the seven roles: every admitted pair (the same role, Observer from any role, one of the four project roles from Workspace admin, any role from Platform admin) is stored and every refused pair is enumerated and refused, among them each of the twelve pairs between Requester, Reviewer, Asset maintainer and Operator, Workspace admin from any of those four, any other role from Observer and Platform admin from any other role; every grant and revocation is written by a workload caller that names the actor, each refused pair is answered 403 from the records of the identity service although the request states the role, a write without an actor is answered 403, and the record names the actor and the workload; claims hold the delegated role only while valid, which proves AC1 to AC4 of AIFACTORY-US-241 (ADR-0015). ConnectSoft.IdentityTemplate

AIFACTORY-US-242: Identity template: the role and delegation contracts are promoted as a minor ServiceModel version together with the Authorization Server client that reads them

enabling · persona asset-maintainer As an asset maintainer, I want the role assignment and delegation contracts to reach the authorization server in one coordinated promotion, so that no consumer of the identity contracts breaks on its next restore.

The authorization server calls the internal API of the identity service on every login, so its HTTP client is the first consumer of every contract change. The findings page of the template (Docs/Consumer-Reported-Findings.md of the template) records how the last change was sequenced: the multi-valued claims contract was a breaking change with a known downstream casualty, it was promoted as the 1.1 stream by explicit decision and not as a patch, and the consumer change landed in the same window; a patch-level promotion would have broken every consumer on its next restore. The page also shows how that alignment was proven before anything was published: a locally packed prerelease of the package passed the isolated consumer tests. This PBI applies the same sequencing to the role assignment and delegation contracts. They are added to the ConnectSoft.IdentityTemplate.ServiceModel package as an additive minor version. Publication is the gate of AIFACTORY-US-243, which depends on this PBI, so the proof here uses a locally packed prerelease candidate of the package: the HTTP client of the authorization server template (ConnectSoft.Extensions.Http.IdentityMicroservice in that template) builds against the candidate and maps the role claims with their scope and the valid delegations, and its claims tests pass. The move of its pin to the published version, with no downgrade warning, belongs to AIFACTORY-US-244, where the published version exists. A contract baseline test in the identity template compares the public surface of the package with the last published version and fails the pipeline when a breaking change is published under a patch or a minor version. Isolated consumer tests serialise and read the new contracts in JSON and in the data contract format, as the earlier alignment did, so that the wire shape is proven without a running service.

Acceptance criteria

AC1 Given the role assignment and delegation contracts, when the ServiceModel package is built, then it carries them as an additive minor version above the 1.1 stream, and isolated consumer tests read and write them in JSON and in the data contract format (ADR-0008, ADR-0015 decision 6; sequencing asked for by Docs/Consumer-Reported-Findings.md of the template; model/components.yaml).
AC2 Given a locally packed prerelease candidate of the ServiceModel package, when the HTTP client of the authorization server template is built against it from a local feed, then it maps one role claim per assignment with its scope and one per valid delegation with its expiry into the identity information it returns, its focused claims tests pass and it builds in Release, before anything is published (ADR-0015 decision 6, ADR-0008).
AC3 Given a change that removes or renames a member of a published contract, when the pipeline of the identity template runs with a patch or a minor version, then the contract baseline test fails and names the member, so that a breaking change is published only as a deliberate version step with its consumer change (FR-11, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md).
Traces: adrs ADR-0008, ADR-0015
Traces: requirements FR-11
Depends on AIFACTORY-US-240, AIFACTORY-US-241
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/adr/0008-openiddict-identity.md, docs/architecture/ecosystem-composition.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-596 Role and delegation contracts promoted with the Authorization Server consumer implementation The ServiceModel package carries the role-assignment and delegation requests and responses as a minor version, and the HTTP client of the Authorization Server template consumes them in the same window, first against a locally packed prerelease candidate, so no patch-level promotion breaks a consumer (the sequencing the findings page asks for). ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1122 Contract baseline test of the ServiceModel package contract A test compares the public surface of ConnectSoft.IdentityTemplate.ServiceModel with the surface of the last published version and fails when a member was removed or renamed under a patch or a minor version; the service-model pipeline of the template runs it before publication. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1123 Authorization Server HTTP client reads role assignments and delegations implementation The identity client of the authorization server template builds against the locally packed prerelease candidate of the ServiceModel package from a local feed and maps role claims with their scope and valid delegations with their expiry into the identity information it returns; its claims regression tests cover repeated roles across projects and an expired delegation; the pin of the published version follows in AIFACTORY-US-244. ConnectSoft.AuthorizationServerTemplate
AIFACTORY-TASK-1124 Verify the promoted contracts against their consumer verification Pack a prerelease candidate of the ServiceModel package locally, build the authorization server template against it and run its focused claims tests and the isolated consumer tests of the identity template; all pass and a planted removed member fails the baseline test, which proves AC1 to AC3 of AIFACTORY-US-242 (ADR-0015). ConnectSoft.IdentityTemplate

AIFACTORY-US-243: Identity template: the role model passes the full suites of the authoring pipeline and the Domain cases of the installer pipeline before the template and ServiceModel packages publish

evidence · persona asset-maintainer As an asset maintainer, I want the role model to be proven by the two pipelines the identity template has, so that the Factory resolves roles from an identity service that was scaffolded from a gated package.

The findings page of the template (Docs/Consumer-Reported-Findings.md of the template) records the gate the template has, and it has two parts. The authoring pipeline runs the acceptance scenarios through build/Invoke-IdentityTests.ps1, which checks discovery against completion and rejects missing, aborted, truncated and mismatched result files. The installer gate is the shared template pipeline: build/template-ci.json declares one Domain case per artifact kind with a test filter and keeps the Compatibility cases for manual selection, every generated configuration passes restore, build, mapper and options checks and a dependency audit, and the package is guarded so that no package source credential is copied into an installer. A database-backed acceptance run per generated case is not what the installer pipeline does and would not fit the bound of a validation job. This PBI makes the role model part of both pipelines as they are and is the proof of the feature. The authoring pipeline runs the full unit, architecture and acceptance suites with the role assignment, delegation and claims scenarios through the completeness runner. The installer pipeline generates the Domain cases of the manifest, whose test filter gains contract-level tests of the role assignment, delegation and claims boundary that run with local test doubles, and audits each generated graph. The Scripts check of the shared tooling runs in check mode and keeps the root Scripts folder in step with the Scripts folder of the base-template submodule. A failing case, an incomplete run or a package that holds a credential fails the run with the case and the stage named, and neither the template package nor the ServiceModel package is published. Publication of both packages requires the complete reports of both pipelines bound to the candidate and pushes versions that are not yet on the ConnectSoft feed. The PBI proves decisions 5 and 6 of ADR-0015 on the identity service and the release gate of FR-11.

Acceptance criteria

AC1 Given a change of the identity template, when its authoring pipeline runs, then the full unit, architecture and acceptance suites run with the role assignment, delegation and claims scenarios through the completeness runner, and a run that executes fewer tests than were discovered fails (ADR-0015 decisions 5 and 6, FR-11).
AC2 Given the same change, when the installer pipeline runs the shared installer jobs, then it generates the Domain cases of build/template-ci.json, whose test filter holds contract-level tests of the role assignment, delegation and claims boundary, restores and builds each case in Release, runs the filtered tests with the discovery and completion checks, audits each generated graph, and the Scripts check passes in check mode (FR-11, ADR-0015, docs/architecture/ecosystem-composition.md).
AC3 Given a failing case, an incomplete test run or a staged package that holds a package source credential, when either pipeline evaluates the run, then the run fails with the case and the stage named and neither the template package nor the ServiceModel package is published (FR-11, docs/architecture/ecosystem-composition.md).
AC4 Given complete reports of both pipelines bound to the candidate, when the publication jobs run, then the template package and the ServiceModel package are pushed with versions that were not on the feed, and a fresh install of the template version generates the Domain cases whose role, delegation and claims contract tests pass unchanged (ADR-0008, ADR-0015, model/template-parameters/connectsoft-identity.yaml).
Traces: adrs ADR-0008, ADR-0015
Traces: requirements FR-11
Depends on AIFACTORY-US-240, AIFACTORY-US-241, AIFACTORY-US-242, feature:component-base-template-findings
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md, docs/architecture/ecosystem-composition.md, model/template-parameters/connectsoft-identity.yaml, docs/architecture/catalogs/templates.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-1125 Role, delegation and claims contract tests in the test filter of the Domain cases operations The generated test projects hold contract-level tests of the role assignment, delegation and claims boundary that run with local test doubles, and the test filter of each Domain case in build/template-ci.json selects them; the role, delegation and claims acceptance scenarios stay in the authoring pipeline and run through build/Invoke-IdentityTests.ps1; a failing or incomplete case fails its pipeline with the case named. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1171 Scripts check of the identity template in check mode operations The manifest of the identity template holds the entry of the Scripts check, the root Scripts folder is written from the Scripts folder of the base-template submodule, and the pipeline runs the check in check mode beside the package snapshot check and fails with the missing and the changed files named. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1126 Publication of the template and ServiceModel packages on the reports of both pipelines operations The publication jobs of the template package and of the ServiceModel package require the complete report of the authoring pipeline and the complete reports of the Domain cases, bound to the candidate, and the package protection check, and refuse a version that is already on the feed with the reason. ConnectSoft.IdentityTemplate
AIFACTORY-TASK-1127 Verify the gate of the identity template on a green and a planted run verification One green run of both pipelines publishes both packages and a fresh install generates the Domain cases whose contract tests pass; a run with a planted failing delegation scenario stops before publication; both prove AC1 to AC4 of AIFACTORY-US-243 (ADR-0015, FR-11). ConnectSoft.IdentityTemplate

AIFACTORY-US-107: Identity template: the Factory role model with per-project assignments and delegation records is delivered and proven on a generated solution

enabling · persona asset-maintainer As an asset maintainer, I want Identity microservice to carry the Factory role model with per-project assignments and delegation records, so that it serves Accounts, credentials, MFA, memberships, roles (D18) without later rework.

This is the integration PBI of the feature. The identity service holds accounts, credentials, memberships and roles for the Factory and is the system of record of role assignments and delegations, of which ProjectService keeps a projection, and the authorization server issues the seven Factory roles as claims from what it holds. With role assignments bound to a project or the tenant and evaluated against a seeded role catalogue, the bootstrap of the first role holders, delegation records with bounded validity and revocation, the contracts promoted as a minor ServiceModel version together with the authorization server client, and the gate of the two pipelines, the asset maintainer runs the pipelines end to end: the full suites in the authoring pipeline, then pack, install, generate the Domain cases, build and test completely, then publish both packages. A failing or incomplete case blocks publication. The migrated implementation tasks sit under the PBIs that deliver them, and the verification task of this PBI is the proof on the published package. The feature is done when an identity service generated from the published package returns project-scoped role claims and valid delegations to the authorization server client.

Acceptance criteria

AC1 Given the template repository ConnectSoft.IdentityTemplate with the work of this feature, when the template is packed, installed and instantiated in its pipeline, then the generated solution builds and its tests pass before the package publishes with a verified version (ADR-0015, model/components.yaml).
AC2 Given the work of AIFACTORY-TASK-594 (per-project role assignments for the seven Factory roles) is done, then a role assignment binds a member, a role and a project scope, Platform admin is the only assignment with tenant scope and Observer may hold either, membership stays per tenant, and the internal claims API returns one repeating role claim per project assignment so the authorization server can issue them (ADR-0015 decision 5).
AC3 Given the work of AIFACTORY-TASK-595 (delegation records with bounded validity and revocation) is done, then a delegation records grantor, grantee, delegated role (the same or a lesser one), scope, expiry and reason, is revocable at any time, expires on its own, raises an event on grant, revoke and expiry, and appears in the claims of the grantee only while valid (ADR-0015 decision 6).
AC4 Given the work of AIFACTORY-TASK-596 (role and delegation contracts promoted with the Authorization Server consumer) is done, then the ServiceModel package carries the role-assignment and delegation requests and responses as a minor version, and the HTTP client of the authorization server template consumes them in the same window, so no patch-level promotion breaks a consumer (ADR-0008, docs/architecture/ecosystem-composition.md).
Traces: adrs ADR-0008, ADR-0015
Depends on AIFACTORY-US-240, AIFACTORY-US-241, AIFACTORY-US-242, AIFACTORY-US-243
Sources model/components.yaml, docs/architecture/adr/0015-factory-tenancy-under-canonical-adr-0100.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-683 Verify identity-template-factory-roles-delivered by running the declared command verification Run dotnet build -c Release and dotnet test -c Release --no-build on the identity service generated from the published package; they pass and prove AC1 to AC4 of AIFACTORY-US-107. ConnectSoft.IdentityTemplate