The contract, not a capability wishlist
Know exactly
what runs.
The runtime resolves released roles, constrains dispatch, asks the host for decisions, and verifies evidence before advancing. Configuration cannot create a capability the host has not supplied.
One runtime, one project
Create
SquadRuntime.CreateAsync(IChatClient, SquadRuntimeOptions, SquadArtifactSource?, CancellationToken)snapshots options, resolves artifacts, loads the release catalog, validates the roster, and checks existing state. It does not own your chat client's lifetime.Confirm initialization and routing
The host confirms single-squad scope, profile/packs, roster, names, and channel before squad state or model calls are created. Routing approval confirms scope, producing owner, all input paths, and council/RAI coverage. Model classification is a proposal, not authorization.
Execute the bounded workflow
Delivery with inputs runs intake first, then research, approved planning with separate phase details, conditional council, approved production by one owner, and independent review. Each consequential host call has its own approval.
Inspect the result and dispose
Read status and verified evidence, not just response prose. Await the active run before disposing the runtime. Retain the original release and roster to continue its project-bound sessions.
| Scope | Execution | Success status |
|---|---|---|
| Delivery | Optional input intake → research → plan + phase-details → conditional council → produce → review. | Completed |
| Research | Research only. Supplied paths can inform research. No implementation is implied. | ResearchCompleted |
| Plan | With existing inputs: intake then planning. Without inputs: research then planning. Includes required council. No production. | PlanCompleted |
| Review | Reviews supplied existing input targets directly. Missing targets return InputRequired. No new delivery or automatic intake stage. | ReviewCompleted |
Express the intended scope in the request and check the routing proposal. Research-only and review-only requests cannot bypass a required council: council needs a planning stage, so that combination is blocked.
Select the release's actual roster
Profiles and packs come from squad-roster.instructions.md, not an embedded role map. The following names are from the exercised v0.16.2 catalog. The inspector prints the catalog for the release you actually acquire.
| Profile | Intended work |
|---|---|
default | Researcher, lead, developer, tester, and scribe. General build/delivery spine. |
full | All bundled roles, including intake-validator and all council seats. Opt-in external roles are not included. |
security | Security, supply chain, responsible AI, privacy, and fact checking. |
design | UX/UI design and accessibility. |
accessibility | Accessibility conformance and remediation with design support. |
architecture | System design, Azure architecture, and cost planning. |
azure | Azure architecture, IaC, deployment, diagnosis, as-built documentation, cost, security, and modernization roles. |
modernization | Legacy uplift, framework/dependency changes, migration, and architecture. |
compliance | Conformance evidence across security, supply chain, vulnerabilities, privacy, RAI, accessibility, and risk. |
operations | Azure diagnosis, performance, observability, as-built documentation, IaC, and deployment roles. |
product | Requirements, design, backlog planning, presentations, writing, experiments, data science, and intake. |
Each released profile includes the methodology spine. Role presence does not install a web-search service, cloud credentials, a shell, or any other execution tool.
Use full when you need intake and council. The default roster lacks specialized gates. Council requires architect, security, cost-manager, and product-owner, plus rai when needed. Delivery/plan requests with input artifacts need intake-validator. A missing seat fails closed; the runtime does not auto-add or substitute roles. Confirm the right roster before creating project state.
Optional additive packs
| Pack | Added roles |
|---|---|
power-platform | pp-architect, pp-connector |
m365-copilot | m365-agent-architect, m365-agent-integrator |
aws | aws-architect, aws-diagnose |
Packs select roles; they do not automatically install their external primary agents. Follow the pinned upstream catalog's Registered External Cast instructions in a host-managed artifact installation. Selected absent or disabled agents fail validation. full is not a workaround for missing opt-in dependencies.
Complete configuration reference
These defaults are from SquadRuntimeOptions. The DI binder accepts the data settings below and rejects unknown or host-only configuration keys. Lists must be contiguous indexed scalar lists; MemberNames maps roles to scalar names.
| Setting | Default | Meaning / allowed values |
|---|---|---|
ProjectPath | Current directory | Project root; normalized to a full path. Provide the intended writable project explicitly. |
Profile | default | One known profile in the resolved release catalog. |
Packs | [] | Zero or more known additive pack names. |
Version | latest | Latest published stable release, or an explicit stable vX.Y.Z tag. Not main, an arbitrary SHA, or a prerelease. A supplied source overrides default acquisition. |
NamingPolicy | null | Inferred as skip without names or provided with names. Explicit values: skip or provided. No alias generation. |
MemberNames | {} | Host-provided role → member-name map. Off-roster keys fail. Must agree with the naming policy. |
ApprovalChannel | null | Initialization uses in-chat. The only explicit supported value is in-chat. This means host callbacks, not a bundled transport. |
Mode | interactive | Only interactive single-squad mode is supported. Other modes return Unsupported. |
InputPaths | [] | Existing project-relative inputs, combined with routed inputs. Force intake for delivery/plan; mandatory targets for focused review. |
RequireCouncil | false | Host override requiring council. False does not prevent routing or risk classification from requiring it. |
IncludeRaiInCouncil | false | Include the RAI council seat when council runs. Does not independently request a council. |
MaxDispatches | 32 | Per-run dispatch limit, at least 1. |
MaxDepth | 4 | Maximum nested dispatch depth, at least 1. Child agents remain within their owner's scope. |
MaxModelCalls | 64 | Per-run model-call limit, at least 1. |
MaxToolCalls | 128 | Per-run tool-call limit, at least 1. |
MaxArtifactCharacters | 200000 | Bounded text artifact/read size, minimum 1024 characters. Not a token budget. |
MaxArtifactsPerDispatch | 16 | Artifact allocations per dispatch, minimum 2. Planning requires a primary plan and phase-details. |
RunTimeout | 00:30:00 | Positive TimeSpan, no more than one day. Begins after the runtime's in-process run lock is acquired; includes human waits during the run. |
EnableOpenTelemetry | false | Enable runtime tracing. Configure collection/export and data handling in the host. |
OpenTelemetrySourceName | HveSquad.AgentFramework.Runtime | Tracing source name. |
| Setting | Default | Contract |
|---|---|---|
ApproveAsync | null | Func<SquadApprovalRequest, CancellationToken, ValueTask<bool>>. Missing callback never grants approval. |
AskAsync | null | Func<SquadQuestion, CancellationToken, ValueTask<string?>>. Missing or unanswered input stops work. |
Tools | [] | List of trusted SquadToolRegistration records. See the effect and evidence contract below. |
ModelSelector | null | Func<SquadRosterEntry?, AgentCharter, SquadModelSelection?>. Null role identifies the coordinator. Return a caller-owned IChatClient and optional explicit model ID. |
SkillFilter | null | Func<SquadRosterEntry, SquadSkill, bool>. Filters specialist skill availability. Filtering out required resources may block completion. |
InstructionFilter | null | Func<SquadRosterEntry?, SquadInstruction, bool>. Filters loaded instruction availability; null role denotes the coordinator. |
LoggerFactory | null | Host-owned ILoggerFactory. Apply your own retention and redaction policy. |
Options and collections are snapshotted at creation. Changing the original options object is not live reconfiguration. Catalog tier preferences are not actual model IDs, prices, or proof that a provider supports a model.
Approvals are a host responsibility
| Approval kind | What the human confirms |
|---|---|
Initialization | The complete SquadInitializationProposal: scope, profile, packs, names, approval channel, and roster roles. |
Routing | SquadRoutingProposal: request, owner, inputs, council, RAI, and scope. Reject incomplete or incorrect classification. |
Plan | Dispatching the lead to plan from verified research or supplied evidence. |
Implementation | One producing owner's execution of the plan and any council conditions. |
ConsequentialTool | The exact tool and actual argument JSON. Earlier plan approval does not authorize this call. |
Requests include a description and may include role, tool name, arguments, initialization, evidence, and routing. Render these as data in your UI. Never treat model text, project files, or a notification file as an approval source. Questions carry Role and Question; only real host answers are recorded as confirmed.
A web or desktop host may implement the callbacks using its own UI. There is no shipped remote callback endpoint or durable suspended-approval protocol. Honor cancellation and timeout while waiting.
Make real effects explicit
Native tools read project files and write allocated methodology artifacts. They are not a general source editor. Register actual host capabilities through SquadToolRegistration; permissions in a charter do not provide an implementation.
options.Tools.Add(new SquadToolRegistration(
function, // Your actual AIFunction.
"edit", // A permission allowed by the role's charter.
["developer"], // Explicit roster role allowlist.
SquadToolEffect.ProjectWrite,
OutputEvidence: result => ExtractSuccessfulOutputs(result),
RequireOutputForCompletion: true));This is a registration pattern, not a bundled executor. function and ExtractSuccessfulOutputs must be supplied by the host. For a concrete contained writer, read ProjectFileWriter.cs and its registration in the sample.
| Effect | Boundary |
|---|---|
ReadOnly | Non-consequential local reads. Registration must honestly reflect the function's behavior. |
ProjectWrite | Consequential project outputs. Only during the approved production stage, with separate per-call approval. |
External | External side effects. Only during the approved production stage, with separate per-call approval. |
ExternalRead | External retrieval, such as research. Requires host approval even outside production. |
The evidence contract
OutputEvidenceisFunc<object?, SquadToolOutput>, called on the actual returned function result. It must attest only successful outputs, not model arguments or intended effects.SquadToolOutput(ProjectPaths, Receipt)lists existing project-relative output files and/or a meaningful successful external receipt. Failed operations and dry runs must not attest an applied effect.- Host effectful integrations need actual tools, explicit approvals, successful results, and honest output evidence. A call receipt without required output evidence does not complete an effect-producing role.
RequireOutputForCompletiondefaults to false. Set true when a host-specific producing role must demonstrate its configured effect. Optional tools do not make unrelated external actions mandatory.- Output files are hashed as raw bytes, including binary files, with a 64 MiB per-file limit. Repeated approved edits within one dispatch keep all receipts and verify the last content. Overlapping ownership across distinct dispatches fails closed.
- Tools need unique names, valid effects, charter permissions, and nonempty role allowlists. Native tool names cannot be shadowed. Enforce path/resource/tenant limits inside every host function; never mutate the Scribe's state or
.git.
A presenter needs a renderer. Register a ProjectWrite function whose successful evidence includes an actual .pptx. The runtime does not run skill scripts or bundle a renderer. It verifies file evidence, not the internal validity of an Office package. A prose report about a deck is not a deck.
Treat status as part of the API
SquadRunResult contains RunId, Status, ResponseText, Evidence, and Scope. A non-success result may contain useful, verified partial work. There is no separate Partial status enum.
| Status | Meaning and host action |
|---|---|
Completed | Delivery produced verified research, plan, output, and review with no reported blockers. Not deployed, released, or independently host-validated. |
ResearchCompleted | Focused research completed. No production claim. |
PlanCompleted | Focused plan completed, including applicable gates. No implementation claim. |
ReviewCompleted | Focused review of supplied targets completed. Not a new delivery. |
ApprovalRequired | A needed host approval callback is absent. Configure a real callback, then submit an explicit new turn as appropriate. |
ApprovalDenied | The host declined. Do not retry the action as if it had been approved. |
InputRequired | A host answer or existing review target is missing. Obtain the real input; do not invent it. |
Blocked | Missing role, failed gate, safety finding, unmet output contract, or another unmet precondition. Inspect response and evidence. |
Unsupported | The request requires an unimplemented mode or capability. Narrow the scope or implement the missing host/runtime feature explicitly. |
LimitReached | A dispatch, depth, model-call, or tool-call budget stopped the run. Review partial work and bound the next request. |
Failed | An execution failure occurred. Inspect diagnostics and actual side effects before any retry. |
Cancellation and timeout save the active run as failed with partial evidence, then rethrow OperationCanceledException. Acquisition, invalid options, state mismatch, and lock errors can also throw before the execution result handler. Host code must handle exceptions as well as result statuses.
What a dispatch record proves
SquadDispatchEvidence records dispatch ID, stage, role, agent, artifact path/hash, history path, summary, verdict, risk, blocking issues, model identity/source/tier, and provider-reported tokens. It may also contain companion artifacts, executed-host-tool receipts, and a structured return.
EvidenceKind is Artifact or StructuredReturn. For a return-only role, the primary path is a deterministic Scribe receipt, not a fabricated agent-authored document. Tool execution records contain name, effect, argument hash, outputs, and receipt. Unknown tokens, model identities, costs, and credits stay unknown; they are not recorded as zero or inferred from a tier.
Follow the release, not main
- Published stableGitHub release API
- Tag → commitExact resolved SHA
- APM installationMatched dependency graph
- InventoryAgents, rules, skill resources
Version = "latest" resolves /repos/Peter-N91/hve-squad/releases/latest, validates a published, non-draft, non-prerelease stable semantic-version tag, resolves the tag to a commit, and asks APM to install that commit. It never uses target_commitish, main, or a branch head.
The exercised release is v0.16.2, commit a941195c36dfb6181453f51ec4638b085ca3b3ad, using APM 0.18.0 in CI. The upstream APM manifest supplies the matched HVE Core dependency pin. A new default runtime checks the published release; an existing runtime retains its resolved artifacts and rejects hot swaps.
The APM cache normally lives under local application data at hve-squad-maf\artifacts, in a source-and-target-specific directory. Complete deployed agents, instructions, and skill resources are inventoried. Missing or changed files invalidate the cache and trigger acquisition. API authentication, rate-limit, and network errors are explicit; no silent alternative version or branch fallback is used.
Prepare a host-managed offline installation
On a connected machine, install the exact known commit into a dedicated artifact workspace. Keep this workspace separate from the consumer project and do not initialize Copilot squad state in the consumer.
New-Item -ItemType Directory -Force C:\SquadArtifacts\v0.16.2 | Out-Null
Set-Location C:\SquadArtifacts\v0.16.2
apm install "Peter-N91/hve-squad#a941195c36dfb6181453f51ec4638b085ca3b3ad" --target copilotPreserve the complete installed directory, including .github, .agents, and the acquisition metadata. Transfer it through your approved artifact process. Verify its contents and retain the release/commit record before making it available to an offline host.
using HveSquad.AgentFramework.Sources;
using HveSquad.AgentFramework.Runtime;
var source = new ProjectArtifactSource(@"C:\SquadArtifacts\v0.16.2");
using var squad = await SquadRuntime.CreateAsync(
chatClient, options, source, cancellationToken);This snippet uses the existing client/options from the setup guide. ProjectArtifactSource searches at or above the supplied directory for deployed agents. Check that it selected the intended root. Directory sources are host-managed overrides, not proof of published-release provenance, and can have Provenance.Release == null. Version does not relabel or validate an override as that release.
Offline artifact loading does not make a hosted model provider offline. You still need a reachable model and any explicitly registered external services. For authenticated release API access, provide a host-configured HttpClient to ReleaseArtifactSource; it does not automatically consume your application's provider credentials.
Advanced acquisition seams
ReleaseArtifactSource(version, target, httpClient, acquisitionFactory) accepts a stable tag or null for latest, defaults the APM target to copilot, and passes the exact pinned package spec to its acquisition factory. ApmArtifactSource additionally allows cacheDirectory, timeout (default 10 minutes), installer, and apmExecutable. These are host code options, not runtime JSON properties. Direct APM or directory overrides put provenance verification in the host's hands.
Persistence has an owner
The deterministic native Scribe owns .copilot-tracking\squad, including state.json, native.lock, roster/routing records, decisions, notifications, consumption, dispatch histories, and structured returns. Native MAF conversation sessions and confirmed answers are persisted with release, artifact fingerprint, and roster/configuration binding.
- Turns serialize within one runtime. An exclusive project file lock prevents simultaneous native state writers; it is not a distributed scheduler.
- Do not put horizontal replicas on the same project state and assume coordination, failover, or shared-filesystem lock semantics will work. Route each project to one active owner.
- Do not edit the state or invent receipts through host tools. Methodology outputs are allocated and checked; companion files and history are verified before advancing.
- Native state is versioned and distinct from Copilot state. Existing non-native state is rejected, even though the directory naming is similar.
- A new release, changed artifacts, profile, packs, names, or roster binding cannot silently resume an old conversation. Preserve the original setup, choose a fresh project, or implement an explicit reviewed migration. No automatic migration or reseeding is implemented.
- After interruption, a surviving active-run record is marked failed on the next turn. This is not automatic continuation of an interrupted external operation.
When the run stops, keep the boundary
APM not found, GitHub 403/429, or acquisition fails
Verify Git and APM on PATH, the tested APM version, outbound access, and rate-limit diagnostics. For authentication, supply an appropriately scoped host HTTP client. A pinned tag still needs release API access; choose a verified installed-directory source for disconnected loading. Do not switch to main as a workaround.
Off-roster intake-validator or a missing council seat
Use the inspector to check the exact release roster. Plan the profile before initialization; full includes bundled gate roles. An existing project's confirmed roster cannot be silently changed. Preserve state and use a fresh project or an explicit migration rather than deleting evidence to force a reseed.
ApprovalRequired, ApprovalDenied, or InputRequired
Wire the missing human callback, respect a denial, or provide the requested input. Inspect routing completeness and focused-review targets. The library has no remote approval endpoint and does not interpret a file containing “approved” as consent.
Session fingerprint, release, or schema mismatch
Restore the original release, full artifact tree, and confirmed configuration. Do not mutate state.json, copy Copilot state into place, or overwrite receipts. Back up and use an isolated project while designing any explicit migration.
Lock contention or an interrupted run
Find the owner of the project and wait for its run to finish. Stop it through its normal cancellation/lifecycle path if appropriate. A lock file's presence does not mean it is stale; exclusivity is held by the open file handle. Do not delete live lock files or run replicas concurrently.
“Completed” prose, but no accepted output evidence
Inspect the actual result status, dispatch record, output allocations, receipts, and hashes. Register the necessary host executor and truthful evidence extractor. A prose claim about edits, tests, deployment, or a deck cannot substitute for real execution. Never fabricate success to satisfy the gate.
LimitReached, cancellation, or model/tool failure
Inspect partial evidence before resubmitting. Split oversized work into bounded interactive turns. Adjust explicit budgets only after understanding call volume. Do not blindly retry external operations: use host-owned idempotency and reconcile actual effects. Check that your selected model implements reliable tool calls.
Need lower-level MAF composition?
HveSquadBuilder, SquadAgentFactory, and SquadWorkflowBuilder remain available for inspection/custom composition. They are not the governed runtime entry point and do not imply the same gate enforcement. Use SquadRuntime for the behavior documented here.