Skip to content

AIFACTORY-FEAT-154: Agent host template: Factory agent base, handoff envelope and lifecycle stages

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 7 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 template has no generic agent abstraction and no event-driven handoff contract: the only agent is the concrete demo, the messaging model carries one create command and one created event, and no run, attempt or handoff event travels with the trace, blueprint and origin of the agent (Docs/Generic Agent Audit Report.md of the template, gaps 3 and 4). This feature adds the Factory agent base that every scaffolded agent derives from, the accepted envelope with the Factory scope on every message, and the lifecycle stages the runtime needs, Cancelled included. It builds on the single execution port of the earlier feature. Component: AI Agent host template (extend).

Delivers —
Stubs —
Realizes components: cmp-agent-template
adrs: ADR-0014, ADR-0024, ADR-0026, ADR-0028
Requirements —
Depends on AIFACTORY-FEAT-096 Agent host template: one execution port and Factory scope
Sources model/components.yaml, docs/architecture/ecosystem-composition.md, docs/planes/agent-runtime/agent-runtime.md, ConnectSoft.AI.SoftwareFactory.AgentTemplate/Docs/Generic Agent Audit Report.md

AIFACTORY-US-142: Agent host template: every scaffolded agent derives from the library FactoryAgentBase that enforces trace metadata and bounded attempts with backoff

enabling · persona asset-maintainer As an asset maintainer, I want every agent scaffolded from the template to derive from the one Factory agent base of the Factory libraries that owns the lifecycle, so that a concrete agent implements only its prompt and its validation, and no agent executes without trace metadata.

The Factory agent base is library code: IFactoryAgent, AgentRequest, AgentResult and AgentValidationResult live in ConnectSoft.Extensions.AI.Factory.Abstractions and FactoryAgentBase with its accept, prompt, run, validate, retry, complete or escalate pipeline lives in ConnectSoft.Extensions.AI.Factory, as ADR-0014 and docs/planes/agent-runtime/agent-runtime.md record. The exemplar SampleFactoryAgent of the template already derives from that base through the package references, so the template creates no second base; gap 3 of the audit report of the template is stale against the model on this point. What the template owns is the pin of the library version whose base refuses to execute an agent whose request carries no trace metadata (trace id, blueprint id, agent origin and the Factory scope of the earlier feature) instead of stamping it, and whose retry vocabulary says attempts with a backoff as ADR-0026 decision 6 unifies it; the host options for the attempt count and the backoff and their binding from the generated configuration; the registration of the escalation sink of the host; and the tests on the generated host that prove the pipeline, the refusal and the escalation. The refusal of a request without trace metadata is a PBI of the library feature component-extensions-ai (D113); the template consumes it by pin and changes no library type. The base, the contract types, the escalation sinks and their unit tests that Docs/Generic Agent Implementation Summary.md of the template records as written without a compiler are the starting point: the first task of this PBI builds and tests them, keeps what passes and moves every shared type that still sits in the template to the libraries of that feature.

Acceptance criteria

AC1 Given a concrete agent of a generated host that derives from the library FactoryAgentBase at the pinned version, when its execute operation runs with a scoped request, then the base accepts, builds the prompt, runs the model, validates, retries within the configured attempts with the configured backoff and completes or escalates, in the order docs/planes/agent-runtime/agent-runtime.md describes; the concrete agent implements only the prompt and the validation and the template defines no base of its own.
AC2 Given a request without the trace id or the Factory scope (tenant, project, run and attempt), when the pinned library base is asked to execute on a generated host, then it refuses before any model call and records the refusal with its reason; the blueprint id is refused only when the host adds it to the required set of the library options, and the agent origin is stamped by the base and is never required of a caller; a unit test on the generated host proves the refusal and that the model is never invoked (ADR-0014 keeps the trace id diagnostic and the scope authoritative).
AC3 Given validation fails on every attempt, when the attempts are exhausted, then the base escalates through the escalation sink the host registers with the issues of the last attempt and ends the attempt as failed with a failure class; the host options say attempts and backoff as ADR-0026 decision 6 requires and bind from the generated configuration, and the unit tests cover first-attempt success, retry then success and escalation.
Traces: adrs ADR-0014, ADR-0026, ADR-0028
Depends on feature:component-extensions-ai
Sources model/components.yaml, docs/planes/agent-runtime/agent-runtime.md, docs/planes/agent-runtime/services/agent-runtime-service/index.md, docs/architecture/adr/0014-run-and-lifecycle-envelopes.md, docs/architecture/adr/0026-requirements-to-ux-handoff.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-856 Compile and test the recorded Factory agent base work and hand the shared types to the libraries implementation The IFactoryAgent, FactoryAgentBase, request, result and validation types, the escalation sinks and the unit tests that Docs/Generic Agent Implementation Summary.md of the template records as written without a compiler are built and tested on the authoring solution; what passes is kept, what fails is corrected or removed; every shared type is moved to ConnectSoft.Extensions.AI.Factory.Abstractions and ConnectSoft.Extensions.AI.Factory under the feature component-extensions-ai and no copy remains in the template, which keeps its exemplar and its tests against the package reference (D113, the starting point of AC1 of AIFACTORY-US-142). ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-816 Pin the Factory libraries at the version with the trace-metadata refusal and the attempts-and-backoff options implementation The template pins ConnectSoft.Extensions.AI.Factory.Abstractions and ConnectSoft.Extensions.AI.Factory at the version whose FactoryAgentBase refuses a request without trace metadata and whose retry options say attempts and backoff (ADR-0026 decision 6); the host exposes the attempt count and the backoff as options bound from the generated configuration; no IFactoryAgent, FactoryAgentBase or request, result or validation type is defined in the template. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-817 Host-side wiring of the retry options and the escalation sink implementation The generated host binds the attempts and backoff options from its configuration into the library base, registers its escalation sink, and records a refusal of the base with its reason in the host log; an attempt whose attempts are exhausted ends as failed with the failure class the base assigns. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-818 Exemplar derived from the base and unit tests with a scripted model fixture The exemplar derives from the library FactoryAgentBase and implements only its prompt and validation; unit tests with a scripted model and recording doubles cover first-attempt success, retry then success, escalation after exhaustion and the trace-metadata refusal. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-819 Verify the Factory agent base on the authoring and generated solutions verification Run dotnet test -c Release --no-build on the authoring solution and on a generated host; the base tests pass and prove AC1 to AC3 of AIFACTORY-US-142, including the refusal of an agent without trace metadata (ADR-0014). ConnectSoft.AI.SoftwareFactory.AgentTemplate

AIFACTORY-US-143: Agent host template: the command, the event and the lifecycle events of the host carry the library envelope, the base-profile outbox writes it and the inbox dead-letters a message without scope

enabling · persona asset-maintainer As an asset maintainer, I want every message a generated agent host publishes or consumes to carry the envelope of ADR-0014 with the Factory scope, so that every event of an attempt is attributable to its tenant, project, run and attempt and a message without scope never reaches a handler.

The envelope is library code: AgentEventEnvelope of ConnectSoft.Extensions.AI.Factory.Messaging carries event id, occurred-at, agent id, trace id, blueprint id, agent origin and workflow step with no tenant, project, run, step, attempt or schema-version field, which the context of ADR-0014 records. The MessagingModel project of the template holds only the aggregate command and the aggregate event and references that package. The envelope and the lifecycle event types that Docs/Generic Agent Implementation Summary.md of the template records as written without a compiler are the starting point: the first task of this PBI builds and tests them, keeps what passes and moves the shared types to the messaging library. The tenant and project scope in the contracts is AIFACTORY-TASK-161 of component-extensions-ai, the run id, step id, attempt id and schema version on AgentEventEnvelope are a PBI of the same feature (D113), and the outbox that writes the ADR-0014 envelope on every published message in the transaction of the state transition is the work of component-base-template-factory-profile (AIFACTORY-TASK-580), which the agent template composes on through its base-template submodule. This PBI is narrowed to what the template owns: the aggregate command and event of the template and the agent lifecycle events carry the library envelope at the pinned version (event id, schema version, occurred-at, trusted tenant id, project id, run id, step id and attempt id where applicable, correlation id, causation id, producer identity and event type, with the trace id, blueprint id and agent origin kept as diagnostic fields); the generated host registers the inbox validation of the base profile so that a message without a tenant, project, run or attempt where one is required is dead-lettered with the reason recorded and never handled; and a scope-less message is proven dead-lettered on the generated host. The earlier envelope version is read for the stated window through the additive versioning of the library, as ADR-0014 decision 6 requires.

Acceptance criteria

AC1 Given a generated host publishes its aggregate command, its aggregate event or a lifecycle event, when the outbox of the base profile writes the record, then the message carries event id, schema version, occurred-at, tenant id, project id, run id, step id and attempt id where applicable, correlation id, causation id, producer identity and event type as ADR-0014 decision 1 lists them, and the record is written in the same transaction as the state transition (ADR-0012 decision 4); the registrations come from the base-template submodule, the message types from the pinned library.
AC2 Given a message arrives at the inbox of a generated host without a tenant, project, run or attempt where one is required, when the inbox validation the host registers from the base profile runs, then the message is dead-lettered with the reason recorded and no handler runs; a test on the generated host proves the dead-letter and the absence of a handler call (ADR-0014).
AC3 Given a message of the earlier envelope version, when the inbox reads it, then it is accepted for the stated compatibility window and mapped to the new version, as ADR-0014 decision 6 requires; a contract test asserts the required fields of ADR-0014 decision 1 (event id, schema version, occurred-at, tenant id, project id, run id, step id, attempt id, correlation id, causation id, producer identity, event type) on the envelope of every message type of the host, and docs/reference/event-envelope.md is revised to that field list so that it becomes a valid oracle afterwards.
Traces: adrs ADR-0012, ADR-0014, ADR-0028
Depends on AIFACTORY-US-142, feature:component-extensions-ai, feature:component-base-template-factory-profile
Sources model/components.yaml, docs/architecture/adr/0014-run-and-lifecycle-envelopes.md, docs/architecture/adr/0012-messaging-port-and-transport-profiles.md, docs/reference/event-envelope.md

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-857 Compile and test the recorded envelope work and hand the shared types to the messaging library implementation The AgentEventEnvelope and the lifecycle event types that Docs/Generic Agent Implementation Summary.md of the template records as written without a compiler are built and tested with the aggregate command and event of the template; what passes is kept, what fails is corrected or removed; the envelope and every shared message type are moved to ConnectSoft.Extensions.AI.Factory.Messaging under the feature component-extensions-ai and no envelope type remains in the template (D113, the starting point of AC1 of AIFACTORY-US-143). ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-820 Pin the library and submodule versions that carry the envelope and the outbox implementation The template pins ConnectSoft.Extensions.AI.Factory.Messaging at the version whose AgentEventEnvelope carries the fields of ADR-0014 decision 1 in a new schema version, and moves the base-template submodule to the commit of AIFACTORY-TASK-580 whose outbox writes that envelope in the transaction of the state transition; the aggregate command and event of the template and the lifecycle events derive from the pinned envelope; no envelope type is defined in the template. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-821 Inbox validation of the base profile registered on the generated host implementation The generated host registers the inbox validation of the base profile for every consumed message type so that a message without a required tenant, project, run or attempt is dead-lettered with the reason recorded before any handler runs; the registration is generated for every messaging profile the host can be generated with. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-822 Envelope contract test and the earlier-version compatibility fixture on the generated host fixture A contract test on the generated host asserts the required fields of ADR-0014 decision 1 on the envelope of every message type of the host; a fixture feeds a message of the earlier version and asserts that it is accepted and mapped; a fixture feeds a scope-less message and asserts the dead-letter and the absence of a handler call. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-852 Event envelope reference revised to the field list of ADR-0014 decision 1 documentation docs/reference/event-envelope.md lists the required fields of ADR-0014 decision 1 (event id, schema version, occurred-at, tenant id, project id, run id, step id, attempt id, correlation id, causation id, producer identity, event type) with the trace id as a diagnostic field, drops the admonition that the envelope exists only in documentation, and names AgentEventEnvelope of ConnectSoft.Extensions.AI.Factory.Messaging as its binding; the strict documentation build passes. ConnectSoft.AI.SoftwareFactory.Documentation
AIFACTORY-TASK-823 Verify the envelope on the outbox and the inbox of a generated host verification Run dotnet test -c Release --no-build on a generated host; the contract, outbox and inbox tests pass and prove AC1 to AC3 of AIFACTORY-US-143 against ADR-0014 decision 1, and docs/reference/event-envelope.md agrees with the asserted field list. ConnectSoft.AI.SoftwareFactory.AgentTemplate

AIFACTORY-US-144: Agent host template: the library lifecycle events map onto the attempt events AgentRuntimeService models, with the outcome, the observed cancellation and the sub-agent delegation on the envelope

enabling · persona asset-maintainer As an asset maintainer, I want a generated agent host to publish the lifecycle of an attempt under the event names AgentRuntimeService models, as one event family with a Cancelled outcome, so that the runtime and Run Control observe every terminal outcome of an attempt, cancellation included, on one timeline.

The lifecycle stages and events are library code: AgentLifecycleStage of ConnectSoft.Extensions.AI.Factory.Abstractions has Accepted, OutputValidated, Completed, Failed and Escalated, and FactoryAgentBase publishes AgentRunAccepted, AgentOutputValidated, AgentRunCompleted, AgentRunFailed and AgentRunEscalated through IAgentLifecyclePublisher with an AgentLifecycleEventMapper. There is no Cancelled stage; cancellation and unexpected exceptions rethrow without a terminal event, which the context of ADR-0014 records. The Cancelled stage and the terminal Failed with a failure class before rethrow of ADR-0014 decision 2 are PBIs of the library feature component-extensions-ai (D113) and are consumed by the template through its pin. The lifecycle stage, the five lifecycle event types, the publisher bridge and the lifecycle acceptance feature that Docs/Generic Agent Implementation Summary.md of the template records as written without a compiler are the starting point: the first task of this PBI builds and tests them, keeps what passes and moves the shared types to the libraries of that feature. The work of the template is the mapping of the lifecycle events of the library onto the envelope of ADR-0014 as one event family and not a second timeline, under the event names model/services/agent-mesh/AgentRuntimeService.yaml already gives an attempt: AttemptStarted, AttemptPhaseChanged, AttemptCheckpointed, AttemptDecisionRequested, AttemptCancellationObserved, AttemptOutcomeReported and SubAgentDelegated. The template introduces no event name of its own (D113). Accepted maps to AttemptStarted; Completed maps to AttemptOutcomeReported with the outcome value Succeeded; Failed, with or without a preceding Escalated, maps to one AttemptOutcomeReported with the outcome value Failed and its failure class; Cancelled maps to AttemptCancellationObserved, followed by AttemptOutcomeReported with the outcome value Cancelled; and a handoff to a sub-agent is published by the execution port as SubAgentDelegated with the child run id, the child agent id and the depth. The typed body an agent hands to the next step, as ADR-0026 types the handoff, is the output of the attempt whose hash the outcome event carries, and is not an event. AttemptPhaseChanged, AttemptCheckpointed and AttemptDecisionRequested belong to the attempt loop that AgentRuntimeService adds on the scaffolded host at I1 and are not published by the lifecycle pipeline of the template. A cancellation request stops the attempt within the cancellation budget of the host options and the port passes the token into the base. The port also calls the trace context method of the single observability registration with the AgentTraceContext of the request for the length of the attempt, because connectsoft.factory.agent_id is written on activities and log records only while an agent host makes that call (AIFACTORY-US-257 of the feature component-observability-factory-conventions); the call lives in the generated host and not in the library base, since a reference from ConnectSoft.Extensions.AI.Factory to the observability libraries would close a cycle. The acceptance suite of the template covers each stage on the real host, and the events of the host are its timeline, never the authoritative lifecycle of Run Control, which ADR-0024 keeps as the single writer of run truth.

Acceptance criteria

AC1 Given an attempt runs through the execution port of a generated host, when the library base publishes Accepted, Completed or Failed, with or without a preceding Escalated, or the port delegates to a sub-agent, then exactly one of AttemptStarted, AttemptOutcomeReported with the outcome value Succeeded, AttemptOutcomeReported with the outcome value Failed and its failure class, or SubAgentDelegated with the child run id, the child agent id and the depth is published on the envelope of ADR-0014 under the name model/services/agent-mesh/AgentRuntimeService.yaml gives that event; no event of the unmapped library family and no event name of the template is published beside it, and an attempt reports one outcome; the acceptance suite covers each stage on the real host (docs/planes/agent-runtime/agent-runtime.md).
AC2 Given a cancellation request arrives during an attempt, when the pipeline observes it, then the attempt stops within the cancellation budget of the host options and the Cancelled stage of the pinned library base is mapped to AttemptCancellationObserved, followed by AttemptOutcomeReported with the outcome value Cancelled as a terminal outcome distinct from Failed, as ADR-0014 decision 2 requires; a test proves the stop time is within the budget and that no outcome Succeeded follows.
AC3 Given an unexpected exception during an attempt, when the pipeline unwinds, then the terminal Failed of the pinned library base is mapped to AttemptOutcomeReported with the outcome value Failed and its failure class and published before the exception is rethrown (ADR-0014 decision 2); the events of the host remain its timeline and the authoritative outcome stays with Run Control (ADR-0024 decision 5).
Traces: adrs ADR-0014, ADR-0024, ADR-0026, ADR-0028
Depends on AIFACTORY-US-142, AIFACTORY-US-143, feature:component-extensions-ai, feature:component-observability-factory-conventions
Sources model/components.yaml, docs/planes/agent-runtime/agent-runtime.md, docs/planes/agent-runtime/services/agent-runtime-service/index.md, docs/architecture/adr/0014-run-and-lifecycle-envelopes.md, docs/architecture/adr/0024-durable-execution-substrate.md, model/services/agent-mesh/AgentRuntimeService.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-858 Compile and test the recorded lifecycle work and hand the shared types to the libraries implementation The AgentLifecycleStage, the five lifecycle event types, the lifecycle publisher bridge and the lifecycle acceptance feature that Docs/Generic Agent Implementation Summary.md of the template records as written without a compiler are built and tested on the authoring solution; what passes is kept, what fails is corrected or removed; the stage and the shared event types are moved to ConnectSoft.Extensions.AI.Factory.Abstractions and ConnectSoft.Extensions.AI.Factory.Messaging under the feature component-extensions-ai and no copy remains in the template (D113, the starting point of AC1 of AIFACTORY-US-144). ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-824 Mapping of the library lifecycle events onto the attempt event names AgentRuntimeService models contract The messaging model of the template defines AttemptStarted, AttemptCancellationObserved, AttemptOutcomeReported with the outcome value and, for a failure, its failure class, and SubAgentDelegated with the child run id, the child agent id and the depth on the pinned envelope, under the names model/services/agent-mesh/AgentRuntimeService.yaml gives these events and with no event name of its own, and a mapper from the library lifecycle events (Accepted to started, Completed to the outcome Succeeded, Failed with or without a preceding Escalated to one outcome Failed with its class, Cancelled to the observed cancellation followed by the outcome Cancelled) that replaces the default AgentLifecycleEventMapper so that one event family is published; the Cancelled stage itself is consumed from the pinned library. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-825 Lifecycle publisher registration, cancellation budget and sub-agent delegation from the port implementation The generated host registers the mapping publisher as its IAgentLifecyclePublisher; the execution port passes the cancellation token into the base and enforces the cancellation budget of the host options; the port publishes SubAgentDelegated with the child run id, the child agent id and the depth when the agent hands work to a sub-agent; the terminal Failed and Cancelled of the pinned base reach the envelope as AttemptOutcomeReported before rethrow. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-1304 Agent attribute on the telemetry of an attempt through the trace context method of the observability registration implementation The generated agent host pins the observability libraries at the version that carries the single enrichment registration and its trace context method, calls the registration once, and its execution port calls the trace context method with the AgentTraceContext of the request for the length of the attempt, so that the activities and log records of the attempt carry connectsoft.factory.agent_id with the agent origin beside the scope attributes and a signal outside an attempt carries none (AC5 of AIFACTORY-US-257, ADR-0014 decision 1); the call is made by the generated host and not by the library base, so no ConnectSoft.Extensions.AI package references the observability libraries; a test on the generated host reads the attribute from an activity and a log record of an attempt exported to the in-memory exporter and finds it absent outside the attempt. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-826 Acceptance scenarios per lifecycle stage on the real host fixture The acceptance suite of the template runs one scenario per stage on the real host, started, succeeded, failed, cancelled and delegated to a sub-agent, asserts the event name against model/services/agent-mesh/AgentRuntimeService.yaml, its envelope and its outcome value and, for cancellation, the stop within the budget, and asserts that no unmapped library event and no event under another name is published beside the family. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-827 Verify the lifecycle stages on a generated host verification Run dotnet test -c Release --no-build on a generated host; the acceptance scenarios of the five stages pass and prove AC1 to AC3 of AIFACTORY-US-144, the Cancelled outcome of ADR-0014 included, under the event names of model/services/agent-mesh/AgentRuntimeService.yaml. ConnectSoft.AI.SoftwareFactory.AgentTemplate

AIFACTORY-US-101: Agent host template: Factory agent base, handoff envelope and lifecycle stages is delivered and proven on a generated solution

enabling · persona asset-maintainer As an asset maintainer, I want AI Agent host template to carry a Factory agent base, handoff envelope and lifecycle stages, so that it serves AgentRuntimeService and WorkflowEngineService without later rework.

This is the integration PBI of the feature. The asset maintainer packs the agent template with the pinned Factory agent base, the library envelope on the base-profile outbox and inbox and the lifecycle mapping with Cancelled of the earlier PBIs, installs the package and instantiates it in the template pipeline. Every generated case restores, builds and passes its unit, architecture and acceptance tests, the lifecycle scenarios included, before the package is allowed to publish with a verified version; a case that fails any stage fails the run and blocks publication. The migrated tasks of this PBI are its proofs on the generated solution; the implementation lives in the behaviour PBIs and in the library and base-template features the feature depends on. The feature is done when every scaffolded agent derives from the library base and an agent without trace metadata is refused before execution, every message of the host carries the ADR-0014 envelope with a scope-less message dead-lettered, and the attempt events are published as one family under the names AgentRuntimeService models, with a Cancelled outcome that stops within the budget, which AgentRuntimeService and WorkflowEngineService need from the host they are scaffolded from (ADR-0024, ADR-0028).

Acceptance criteria

AC1 Given the template repository ConnectSoft.AI.SoftwareFactory.AgentTemplate with the work of this feature, when the template is packed, installed and instantiated in its pipeline, then the generated solution of every case builds and its tests pass, the lifecycle acceptance scenarios included, before the package publishes with a verified version (ADR-0028, model/components.yaml).
AC2 Given the work of AIFACTORY-TASK-571 (IFactoryAgent and FactoryAgentBase) is done, then the library interface and base class with execute, self-validate and retry, escalation and trace-metadata enforcement are pinned, the exemplar derives from the base, and a test proves that an agent without trace metadata is refused before execution (docs/planes/agent-runtime/agent-runtime.md).
AC3 Given the work of AIFACTORY-TASK-572 (the accepted envelope on every message of the host) is done, then the command, the event and the lifecycle events of the messaging model carry the ADR-0014 envelope with tenant, project, run, attempt, trace and the agent origin, the base-profile outbox writes it and the registered inbox validation checks it, and a message without scope is dead-lettered with a reason.
AC4 Given the work of AIFACTORY-TASK-573 (run, attempt and handoff lifecycle events with a Cancelled stage) is done, then AttemptStarted, AttemptCancellationObserved, AttemptOutcomeReported with its outcome value and SubAgentDelegated are published from the lifecycle pipeline as one event family under the names model/services/agent-mesh/AgentRuntimeService.yaml gives them, the template defines no event name of its own, the Cancelled stage stops the attempt within the cancellation budget, and the acceptance suite covers each stage (ADR-0014 decision 2, ADR-0024 decision 5).
Traces: adrs ADR-0014, ADR-0024, ADR-0026, ADR-0028
Depends on AIFACTORY-US-142, AIFACTORY-US-143, AIFACTORY-US-144
Sources model/components.yaml, docs/architecture/ecosystem-composition.md, docs/planes/agent-runtime/agent-runtime.md, model/services/agent-mesh/AgentRuntimeService.yaml

Tasks

Task Kind Expected output Repository
AIFACTORY-TASK-571 IFactoryAgent and FactoryAgentBase verification The generated cases prove the outputs of AIFACTORY-TASK-856 and AIFACTORY-TASK-816 to AIFACTORY-TASK-819 (AC2 of AIFACTORY-US-101): the exemplar derives from the pinned library base and a test proves that an agent without trace metadata is refused before execution. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-572 The accepted envelope on every message of the host verification The generated cases prove the outputs of AIFACTORY-TASK-857 and AIFACTORY-TASK-820 to AIFACTORY-TASK-823 (AC3 of AIFACTORY-US-101): every message of the host carries the ADR-0014 envelope, the outbox writes it and a scope-less message is dead-lettered with a reason. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-573 Run, attempt and handoff lifecycle events with a Cancelled stage verification The generated cases prove the outputs of AIFACTORY-TASK-858 and AIFACTORY-TASK-824 to AIFACTORY-TASK-827 (AC4 of AIFACTORY-US-101): the attempt events are published as one family under the names AgentRuntimeService models, the Cancelled stage stops the attempt within the budget and the acceptance suite covers each stage. ConnectSoft.AI.SoftwareFactory.AgentTemplate
AIFACTORY-TASK-662 Verify agent-template-contract-delivered by running the declared command verification Run dotnet build -c Release and dotnet test -c Release --no-build on the authoring solution and on every generated case of the matrix; they pass and prove AC1 to AC4 of AIFACTORY-US-101. ConnectSoft.AI.SoftwareFactory.AgentTemplate