Tevrin — Specification (0.7.0)

2026-11-17 · Ben Fielder · 0.7.0, built on the 0.6.1 codebase in this repo. Earlier versions: docs/0.1.0/SPEC.md … docs/0.6.1/SPEC.md. Stack: STACK.md. Source: Ben’s 0.7.0 brief (2026-11-17), the research notes in docs/0.7.0/tevrin-engine-extraction.md (all suggestions, order-of-work steps 1–5), the interview answers in §10, and a survey of the lifecycle, gate, job, agent and artifact code. Amended 2026-11-21 (Ben): 0.7.0 also moves the whole SDLC pack onto the engine runner (§3.10, step 6 below), superseding D-0.7.0-34. Amended 2026-11-22 (Ben): 0.7.0 retires the tevrin CLI (§3.11).

How this spec relates to 0.1.0–0.6.1. 0.7.0 is an increment on the released 0.6.1 app. Everything in the earlier specs stays in force unless this document amends it. Amended items are listed in §3.0 and marked (amends …). New requirements continue from FR-260, domain rules from §4.49, decisions use D-0.7.0-n, and milestones continue from M54. Earlier tests stay green unless an amendment changes what they assert; then update the test and name the amendment in it.

1. Overview

0.7.0 extracts Tevrin’s orchestration into a reusable engine: the state machine, job queue, approval gates, artifact store, LLM layer and run log. A pipeline is then described by a definition (YAML) plus a small pack of named C# extension points. Today’s software lifecycle becomes the first and only pack, SDLC. Tevrin becomes a platform, but users see the same product.

The work follows steps 1–5 of the research notes:

  1. Characterisation tests. Run the whole SDLC flow end to end on the Fake LLM provider and snapshot every transition, gate, artifact and job. Every later milestone keeps the snapshot unchanged.
  2. Lift out the generic pieces. Move the job queue, LLM layer, artifact rules, gates, notifications, audit, redaction and run log into new Tevrin.Engine.* projects. Namespace moves only.
  3. String keys. AgentKind, ArtifactType and GateType become string keys, with the current values as constants in the SDLC pack.
  4. Generic state machine. A definition model, loader and validator, and a generic Apply(run, transition) with guards. The SDLC lifecycle is written as a definition plus guards. Old and new machines run side by side until they agree everywhere, then the old one is removed.
  5. Generic API and UI. Definition-driven read endpoints and gate decisions, and engine views (run timeline, stage list, artifact viewer and diff, gate inbox, run replay) that work for any definition with no frontend code.
  6. The SDLC on the engine runner (added 2026-11-21). The engine AgentStageRunner gains the hooks the SDLC needs, then all eight SDLC agents move onto it one at a time, and the SDLC’s own agent runner is deleted.

Success means:

  • The SDLC works exactly as in 0.6.1. The characterisation snapshot from M54 is unchanged at the end of every milestone, and every 0.1.0–0.6.1 test stays green (renamed or moved where the code moved).
  • Tevrin.Engine.* assemblies never reference Aide.* or Tevrin.Pack.*. An architecture test enforces it.
  • The SDLC lifecycle is the YAML file sdlc.pipeline.yaml plus named guards and handlers. Nothing in the engine mentions a phase, a plan, a review or a release.
  • LifecycleStateMachine, PhaseOrder, GateRules.RequiredGate and the Phase-keyed InvalidationCascade table no longer exist.
  • A fixture definition in the engine tests (not a product pack) runs end to end: agent stage → code-guarded stage with retry and feedback → gate → agent stage. It also renders in the engine UI with no frontend change.
  • Each run is pinned to its definition hash, so editing the YAML never changes a run already in progress.
  • Every agent run records its input, output, tokens, latency, model and prompt version, so the run replay shows it. Each stage has timings and each run has a cost total.
  • Every SDLC agent runs through the engine AgentStageRunner. AgentRunner and ArtifactAgentJob no longer exist, and the golden prompt tests and characterisation snapshots are unchanged (§3.10).

In scope (0.7.0): characterisation tests (§3.1) · engine projects and the lift (§3.2) · string keys (§3.3) · pipeline definitions and packs (§3.4) · the generic state machine and switch-over (§3.5) · generic stage execution and run logging (§3.6) · generic API (§3.7) · engine UI (§3.8) · release housekeeping (§3.9) · the SDLC on the engine runner (§3.10) · retiring the CLI (§3.11).

Out of scope (0.7.0):

  • Any pack other than SDLC. The coaching pack (Impulse) and the other candidate pipelines (debate desk, forecasting, QA lab, job applications, on-call triage, content studio, agent economy) are future work. Engine tests use fixture definitions only.
  • Packaging (step 7): NuGet and npm packages, a dotnet new tevrin-pack template, and tevrin pipeline validate / tevrin run start in the CLI.
  • Running schedule and webhook triggers. They are modelled and validated but refused at load (§4.49, D-0.7.0-3).
  • Starting, advancing, cancelling or rolling back runs through the generic API. SDLC runs still start and move through the existing project endpoints (D-0.7.0-4).
  • Parallel stages, fan-out, ensembles, map-reduce, agent-to-agent conversation, tool permission tiers, mid-stage approval of tool calls, outcome scoring and a per-agent feedback store. They are added when a pack needs them (research notes: “let the engine grow out of three real packs”).
  • Uploading or editing definitions at runtime. Definitions ship inside pack assemblies.
  • Renaming the existing Aide.* projects, namespaces, tables or stored identifiers (0.6.0 §4.29 stays). Only new projects use Tevrin.*.
  • Changing the engine’s licence: it stays PolyForm Shield for now (D-0.7.0-46).
  • Any change to SDLC behaviour, prompts, copy, scoring or the review decision table.

2. Users and permissions

Unchanged roles. Engine views and endpoints use the project’s existing permissions:

Action Who Unauthorised
Read pipeline definitions (GET /api/pipelines…) Any signed-in user 401 UNAUTHENTICATED
Read a run, its stages, timeline, artifacts, gates, replay Anyone who can view the project (0.1.0 Viewer and up) 404 NOT_FOUND for a project they can’t see (as today)
Approve or reject a gate through the engine endpoints Whoever may decide that gate today (the existing gate endpoint’s rule, unchanged) 403 FORBIDDEN
Gate inbox (/gates) Signed-in users; it lists only gates on projects they can see —
Read agent run inputs in the replay Same as reading agent run outputs today (Runs page) 404 NOT_FOUND

Auth is unchanged (0.1.0–0.6.0: email and password, GitHub OAuth, API tokens).

3. Functional requirements

3.0 Amended earlier requirements (summary)

Earlier What changes Where
CLAUDE.md rule 8, 0.1.0 §4.1 / FR-11 (lifecycle via the domain state machine, every transition unit-tested) Lifecycle changes go only through the engine state machine running the SDLC definition. Every allowed and forbidden SDLC transition keeps a unit test, now against the definition FR-287–FR-293
0.1.0 §4.1 phase order, status-follows-phase table; 0.5.0 §4.27 analysis first Read from sdlc.pipeline.yaml (stages, status: per stage, start stages). Same values FR-290, §4.57
0.1.0 §4.2 gates by approval mode (GateRules.RequiredGate) A gate: block on the entered stage. Same table FR-283, §4.53
0.1.0 §4.4 invalidation cascade (hard-coded table) Derived from stage inputs and each artifact’s cascade setting. Same result for every SDLC type FR-289, §4.54
0.1.0 FR-23 agent kinds, artifact types, gate types (enums) String keys. The same wire values, as constants in the SDLC pack FR-269–FR-271
0.1.0 FR-13/17/20/27–29 agent job triggers Generic trigger strings; phase_entered is still read and means stage_entered FR-273
0.1.0 one execution job per project (ux_jobs_project_id_active_execution) Declared in the definition’s concurrency block. The index stays for the SDLC FR-286
0.1.0 agent run record Adds the run, the stage, the redacted rendered input and per-stage timings FR-297
CLAUDE.md Layout and Stack New Tevrin.Engine.* and Tevrin.Pack.Sdlc projects, frontend/src/engine/ FR-262, FR-309
0.1.0 FR-52 CLI, and the CLI parts of 0.2.0 FR-93, 0.4.0 FR-156, 0.5.0 FR-194, 0.6.0 FR-200 and D-V6-2/D-V6-14 (the tevrin command, the aide alias, the Tevrin.Cli and Aide.Cli packages, the CLI environment variables such as TEVRIN_TOKEN and TEVRIN_GIT_TOKEN) Retired; the spec-verifier treats these CLI acceptance criteria as retired, not missing: the CLI projects, tests, CI pack step, docs guide and marketing links are removed. API tokens stay for scripts and the API. A rebuild guide is in the docs FR-322
0.1.0 FR-24–FR-26 agent runs, 0.6.1 plan validation (the SDLC AgentRunner) Every SDLC agent runs through the engine AgentStageRunner with SDLC hooks, context providers and tools; plan validation is a validate: block. Same prompts, records, events, retries and errors FR-310–FR-321, §4.60

3.1 Characterisation tests (step 1)

ID Requirement Layer
FR-260 Integration tests drive the full SDLC flow end to end on the Fake LLM, Git, deploy and tracker providers and record a characterisation snapshot: the ordered list of state transitions, gates (type, status, decision), artifact versions (type, version, status, content hash), jobs (type, trigger, outcome), agent runs (agent, prompt version, status) and project events, normalised by §4.58. Snapshots are committed JSON files under backend/tests/Aide.IntegrationTests/Characterisation/Snapshots/ backend
FR-261 Each scenario in §4.58 has its own snapshot. A test fails with a readable diff when a run’s snapshot differs from the committed one. Updating a snapshot needs an explicit UPDATE_SNAPSHOTS=1 run, and no milestone after M54 may change a committed snapshot backend

FR-260 acceptance

  • Given the strict scenario, when the test creates a project, approves each draft and gate, executes the plan, passes review and releases, then the snapshot lists every transition from refinement to release/released with checkpoints 1–6 (release is entered at checkpoint 6 and completing it adds none, 0.2.0 §4.10) and the gates spec_approval, plan_approval and pre_release, all approved.
  • Given any scenario run twice, then both snapshots are byte-identical (no ids, timestamps or random values leak in).

FR-261 acceptance

  • Given a code change that makes plan_approval also required in advisory mode, when the advisory scenario runs, then it fails and the diff shows the extra gate.
  • Given CI on any commit after M54, then no file under Snapshots/ has changed since the M54 commit (a CI step compares them with git diff --exit-code <M54 sha> -- …).

3.2 Engine projects and the lift (step 2)

ID Requirement Layer  
FR-262 New projects in backend/Aide.slnx: Tevrin.Engine.Domain (pure: definition model, state machine, guard, gate and artifact rules), Tevrin.Engine.Runtime (job queue, LLM providers, artifact store, gates, notifications, audit, run log, EF entity configurations), Tevrin.Engine.Api (generic endpoints and the SignalR contract), Tevrin.Pack.Sdlc (the SDLC definition, key constants, guards, handlers, the IPipelinePack class) and tests/Tevrin.Engine.Tests (engine tests with fixture definitions). Aide.* projects stay as the SDLC implementation and the host backend  
FR-263 Architecture tests: (a) no Tevrin.Engine.* assembly references Aide.* or Tevrin.Pack.*; (b) Tevrin.Engine.Domain references no EF Core, ASP.NET Core or Npgsql; (c) Tevrin.Engine.Runtime references no ASP.NET Core; (d) the existing Aide.Domain rule stays. They run in Tevrin.Engine.Tests from M55 backend  
FR-264 The Postgres job queue moves to the engine with no behaviour change: JobWorker, JobContracts (IJobHandler, JobHandlerRegistration, JobDeferredException, ended and succeeded hooks), JobEnqueuer, JobPolicy and the Job entity. FOR UPDATE SKIP LOCKED, leases, retries, dead letters and deferral are unchanged backend  
FR-265 The LLM layer moves to the engine: ILlmProvider, LlmRequest, LlmCompletion, LlmResolver, LlmStreaming, LlmTools, the HTTP providers (Anthropic, OpenAI, Ollama), Aide.Infrastructure/Llm/* and FakeLlmProvider. The SDLC’s canned fake responders (FakeAgentResponders, FakePromptBlocks, FakeStackScripts, FakeToolScripts) stay in the SDLC side and register with the engine’s Fake provider backend (Amended by D-0.7.0-21/-25: pieces that hold SDLC values or project rules stay on the SDLC side, namely LlmResolver, LlmProviderCatalog, PromptLibrary, RestoreRules, NotificationDispatcher, NotificationSweeper and GateTimerService. The generic parts are in the engine.)
FR-266 The generic artifact rules move to the engine: ArtifactIntegrity, ContentHash, LineDiff, RestoreRules, ArtifactRules (the parts that don’t name a type) and the Artifact entity. SDLC-only rules (CodebaseSummaryRules, CodebaseSummaryWait) stay backend (Amended by D-0.7.0-21/-25: pieces that hold SDLC values or project rules stay on the SDLC side, namely LlmResolver, LlmProviderCatalog, PromptLibrary, RestoreRules, NotificationDispatcher, NotificationSweeper and GateTimerService. The generic parts are in the engine.)
FR-267 Gate mechanics move to the engine: GateFollowUp, GateResolution, GateTimers, approval links, the notification channels (in-app, email, Slack, Teams, signed webhooks) and the notification sweeper, audit events, SecretRedaction and PromptTemplate backend (Amended by D-0.7.0-21/-25: pieces that hold SDLC values or project rules stay on the SDLC side, namely LlmResolver, LlmProviderCatalog, PromptLibrary, RestoreRules, NotificationDispatcher, NotificationSweeper and GateTimerService. The generic parts are in the engine.)
FR-268 AgentRun and its rules (AgentRunRules, AgentRunWarnings, LlmOutputLimits) move to the engine run log backend  

FR-262 acceptance

  • Given the solution after M55, then it builds with -warnaserror and the dependency arrows are only: Pack → Engine; Aide.* → Engine and Pack; Engine → nothing of ours.
  • Given the characterisation suite after M55, then every snapshot is unchanged.

FR-263 acceptance

  • Given someone adds using Aide.Domain.Lifecycle; in Tevrin.Engine.Runtime, when CI runs, then the architecture test fails and names the reference.

FR-264–FR-268 acceptance

  • Given the moved code, then no public behaviour, table, column, job type string or wire value changes, and no migration is added.
  • Given dotnet build src/Aide.Api, then openapi/api.json is unchanged. If a moved DTO’s namespace changes a schema name, the client is regenerated and the frontend still type-checks.

3.3 String keys (step 3)

ID Requirement Layer
FR-269 AgentKind is replaced by a string agent key. The SDLC pack defines SdlcAgents constants with today’s wire values (idea_refinement, spec_generator, plan_generator, code_generator, code_review, repository_analyst, stack_analyst, build_fix). Prompt lookup uses the key (Prompts/<key>.md) backend
FR-270 ArtifactType is replaced by a string artifact key. SdlcArtifacts holds project_request, technical_specification, implementation_plan, optimization_plan, codebase_summary, source_items, stack_profile backend
FR-271 GateType is replaced by a string gate key. The engine owns escalation (every pipeline can escalate); SdlcGates holds spec_approval, plan_approval, pre_release backend
FR-272 Job types are engine constants stage.run, agent.run, gate.timer, trigger.fire, plus types a pack registers. The SDLC pack registers every 0.6.1 job type string unchanged (idea_refinement, execution, review, build_check, …). A job whose type has no registered handler fails at enqueue with an error in the log, not at claim backend
FR-273 AgentJobTrigger is replaced by trigger strings: user_requested, stage_entered, gate_rejected, artifact_rejected, artifact_corrupted, validation_failed. New payloads write stage_entered. Payloads that say phase_entered read as stage_entered backend
FR-274 The database keeps the same stored values. EF enum-to-string conversions become plain string columns. Any migration is limited to column types or lengths, and is reviewed for zero data change. API DTOs keep the same JSON values, and openapi/api.json stays byte-identical: a schema transformer still emits the SDLC enum components (D-0.7.0-24, amending D-0.7.0-7). Config keyed by agent name keeps binding backend + data

FR-269–FR-274 acceptance

  • Given the characterisation suite after M56, then every snapshot is unchanged.
  • Given a 0.6.1 database with queued and dead-lettered jobs and agent runs, when M56’s build starts on it, then every row reads back and every queued job runs (integration test seeded with 0.6.1-shaped rows, including a phase_entered payload).
  • Given dotnet build src/Aide.Api, then openapi/api.json is unchanged, so the generated client and the frontend are unchanged (D-0.7.0-24).
  • Given Models__CodeReview (or Models:codeReview) in configuration, then it binds to the code_review agent exactly as in 0.6.1.

3.4 Pipeline definitions and packs (step 4, part 1)

ID Requirement Layer
FR-275 A pipeline definition model in Tevrin.Engine.Domain and a YAML loader in Tevrin.Engine.Runtime (YamlDotNet, safe parsing with no type tags). Top-level keys: pipeline, version, title, trigger, approval_modes, default_approval_mode, start, artifacts, stages, statuses, status_changes, concurrency, settings. §4.49 gives the full shape backend
FR-276 A validator rejects a definition with every problem listed at once, each with a code from §4.49 and the YAML path: parse errors, duplicate ids, unknown guard / handler / tool / job type / status / artifact / stage names, unreachable stages, loops with no cap, schema references that don’t resolve, artifacts read but never produced, unsupported triggers backend
FR-277 Each definition has a definition hash (§4.50). The first time a hash is used, its canonical content is stored in pipeline_definitions. A run stores the hash it started with and always loads that stored definition (pinning) backend + data
FR-278 Pack registration: IPipelinePack { string Id; void Register(IPackRegistry) }. A pack registers its definitions (embedded YAML), prompts, JSON schemas, IGuards, IStageHandlers, IAgentTools, job handlers, agent context providers (IAgentContextProvider), invalidation hooks (IInvalidationHook) and run settings (IRunSettingsProvider). Names are namespaced by pack id (sdlc.working-copy-prepared) backend
FR-279 Artifacts in a definition: key, title, format (markdown or json), optional schema (JSON Schema file in the pack), approval (required or auto_lock) and cascade (downstream, self_and_downstream or none). Dependencies come from stage inputs (§4.54). When schema is set, an agent’s output is validated against it before it’s stored backend
FR-280 Stages: an id, title, and one kind: an agent stage (agent: { key, prompt, model, tools[], job_type }, inputs, output), a code stage (handler: <pack>.<name>, an IStageHandler), or a manual stage (no agent or handler; work happens through pack endpoints, as SDLC execution and release do today) backend
FR-281 Transitions: linear by default (next is the following stage). A stage may declare on_success: <stage>, on_reject: <stage> and loop: { to: <earlier stage>, on: <outcome>, max_iterations: <int or { setting: <name> }> } backend
FR-282 Guards: requires: before entering a stage (built-ins artifact_locked: <key>, no_pending_gates: { except: [...] }, and named IGuards), and validate: after a stage’s output (named IGuards, plus the artifact schema), with on_invalid: { retry_with_feedback, max_attempts, then: escalate | fail } backend
FR-283 Gates: gate: { type: <key>, modes: [...], approves: <artifact key or none>, approval_links: true|false } on a stage means that gate must be approved to enter it in the listed approval modes (§4.53) backend
FR-284 Triggers: trigger: { kind: manual | schedule | webhook, … }. Only manual runs in 0.7.0; schedule and webhook parse and are refused by the validator with DEF_TRIGGER_NOT_SUPPORTED (D-0.7.0-3) backend
FR-285 Statuses: each stage has a status: (the pack’s status while in it). statuses: declares the pack’s custom statuses, each mapped to a generic run status (§4.57). status_changes: declares named status-only moves (from, to, optional completes_run, error_code to return when from doesn’t match) backend
FR-286 Concurrency: concurrency: { exclusive: [{ job_type, scope: project | run }] }. The enqueuer refuses a second active job of that type in that scope. The SDLC declares { job_type: execution, scope: project }, and the existing partial unique index stays as its database backstop backend
FR-290 The SDLC lifecycle is written as Tevrin.Pack.Sdlc/Definitions/sdlc.pipeline.yaml (§4.51 sketch), with SdlcPack registering the guards in §4.52, the existing job handlers and the pack’s custom statuses and status changes. It passes the validator, and the app fails its readiness check (like StackCatalogHealthCheck) if any registered definition is invalid backend

FR-276 acceptance

  • Given a definition whose plan stage requires velocity.load-rules and no pack registers it, then validation fails with DEF_UNKNOWN_GUARD at stages[1].validate[0].guard.
  • Given a loop with no max_iterations, then DEF_UNCAPPED_LOOP. Given a stage nothing can reach, then DEF_UNREACHABLE_STAGE. Given three problems, then all three are reported in one result.

FR-277 acceptance

  • Given a run started on hash H1, when the YAML is edited and the app restarts with hash H2, then the run keeps using H1’s stages and gates, and a new run uses H2.
  • Given H1 names a guard the current build no longer registers, then moving that run returns 409 DEFINITION_UNAVAILABLE and logs the missing names; reads still work.

FR-290 acceptance

  • Given sdlc.pipeline.yaml, then loading and validating it gives no errors, and its stage order, statuses, gates and start stages equal 0.6.1’s PhaseOrder, StatusFor, RequiredGate and Start results (unit test).

3.5 Generic state machine and switch-over (step 4, part 2)

ID Requirement Layer
FR-287 PipelineStateMachine.Apply(RunState, Transition, RunFacts, Definition) in Tevrin.Engine.Domain returns the new stage, pack status, generic status and checkpoint, or a DomainError. Transition kinds: advance, loop, rollback, fallback, status_change, noop (§4.51). Pure, no I/O. Guards are evaluated before Apply by the runtime and passed in as RunFacts (named guard results plus built-in facts) backend
FR-288 RequestAdvance returns either an applied transition or “gate needed” (gate key), or GATE_PENDING when that gate is already pending, exactly as 0.6.1 does. Unmet requires: return PHASE_PRECONDITION_FAILED with every unmet reason in declared order (§4.52) backend
FR-289 The invalidation cascade is computed from the definition (§4.54). The SDLC’s step resets (AllSteps, StepsOfOtherPlans) move to an SDLC IInvalidationHook backend
FR-291 Parity mode (M58 only): every lifecycle move in the app goes through a ParityStateMachine that calls both the old LifecycleStateMachine and the new engine with the SDLC definition, and throws in tests (logs an error in production) when their results differ in stage, status, checkpoint, error code or unmet reasons. A generated parity test also runs both machines over every combination in §4.56 backend
FR-292 Switch-over: once parity holds across the unit, integration and characterisation suites with zero differences, the app uses only the engine. The run (pipeline_runs) is the source of truth for stage, status and checkpoint. projects.current_phase, status and checkpoint stay as a copy written in the same transaction, so 0.6.1 queries and DTOs are unchanged (D-0.7.0-8) backend + data
FR-293 Removal: after switch-over, LifecycleStateMachine, PhaseOrder, TransitionKind, GateRules.RequiredGate / GuardedEntry / GatedArtifact, the Phase-keyed cascade table and ParityStateMachine are deleted. Every SDLC transition test in Lifecycle/LifecycleStateMachineTests is kept, rewritten against the engine and the SDLC definition, with the same cases and expected results (rule 8) backend
FR-294 Runs: a migration adds pipeline_runs (§5). The SDLC creates one run per release version: project creation and “new version” each start a run; the previous run ends completed. An idempotent host backfill (run at startup before the job worker, D-0.7.0-28; the migration only adds tables and columns) creates one run per existing release version (the current one from the project’s phase, status and checkpoint; earlier ones completed/released) and links existing transitions, gates and agent runs to them backend + data

FR-288 acceptance

  • Given advisory mode in specification with the spec locked, when advance is requested, then the outcome is “gate needed: spec_approval”. Given that gate is pending, then 409 GATE_PENDING. (Same as 0.6.1.)

FR-291 acceptance

  • Given the M58 commit, then the parity test reports 0 differences over all §4.56 combinations, and CI is green with parity mode on in every test.

FR-292/FR-293 acceptance

  • Given the characterisation suite after FR-293, then every snapshot is unchanged.
  • Given grep -r "LifecycleStateMachine\|PhaseOrder" backend/src, then nothing is found.

FR-294 acceptance

  • Given a 0.6.1 database with a project in review at checkpoint 4 on its second release version, when the migration runs, then that project has two runs: the first completed (status released), the second at stage review, status reviewing, checkpoint 4, pinned to the SDLC definition hash; and its transitions, gates and agent runs point at the matching run.

3.6 Generic stage execution and run logging

ID Requirement Layer  
FR-295 An engine AgentStageRunner runs any agent stage: load the pinned definition, collect the latest locked versions of the stage’s inputs, ask registered IAgentContextProviders for extra context, render the prompt, call the LLM through the resolver with the stage’s tools, validate the output (FR-296), store it as a new draft (or auto-locked) artifact version, and record the agent run. The SDLC’s repository and Git context (AgentRepoContext, iteration context, repo tools) become SDLC context providers and IAgentTools. AgentRunner, ArtifactAgentJob and the SDLC agent job handlers call the engine runner; SDLC-specific job handlers (execution, repository and stack analysis, build check, release) stay in the SDLC side backend (Amended by D-0.7.0-34: in 0.7.0 the SDLC agents keep their own runner, pinned by golden prompt tests; the engine runner ships for new packs and is proven on the fixture pipeline. D-0.7.0-38 supersedes this: the SDLC moves onto the engine runner in §3.10.)
FR-296 validate: on an agent stage: when a guard or the schema rejects the output, the stage reruns the agent with the findings appended as feedback (trigger validation_failed) up to max_attempts, then follows then: (escalate raises an escalation gate; fail marks the agent run and job failed). Where the SDLC validates output today (plan validation, build-fix plans), it is expressed this way with today’s attempt counts and end result (§4.55) backend  
FR-297 Run logging: agent_runs gains pipeline_run_id, stage_id, input (the rendered prompt and messages, redacted with SecretRedaction, capped at 1 MB with input_truncated) and latency_ms (time to first token, when streaming). A new stage_executions table records each entry into a stage (run, stage, iteration, checkpoint, entered and exited times, outcome). The run exposes a cost total (sum of its agent runs’ cost_estimate) and a token total backend + data  
FR-298 Prompt comparison: an endpoint groups a pipeline’s agent runs by agent key and prompt version, with counts and average tokens, cost, latency, duration and failure rate (§6) backend  

FR-295 acceptance

  • Given the fixture definition fixture-review in Tevrin.Engine.Tests (draft → check → approve → summarise, with a fixture guard), when a run starts on the Fake provider, then the engine runs both agent stages, stores both artifacts and records both agent runs, with no SDLC code loaded.
  • Given the characterisation suite after M59, then every snapshot is unchanged.

FR-296 acceptance

  • Given §4.55’s worked example, then the agent runs three times, the second and third prompts contain the guard’s findings, and the run ends with a pending escalation gate.

FR-297 acceptance

  • Given an agent run whose prompt contains sk-ant-…, then input stores it redacted.
  • Given an SDLC review cycle, then stage_executions has rows for execution iteration 1, review iteration 1, execution iteration 2, review iteration 2, each with entered and exited times.

3.7 Generic API (step 5, part 1)

ID Requirement Layer
FR-299 Definition endpoints: list registered pipelines (id, title, version, current hash, pack) and get a definition by hash (stages with titles, kinds, inputs, outputs, gates, transitions; artifacts with titles and formats; statuses) backend
FR-300 Run endpoints: list a project’s runs; get a run (stage, pack status, generic status, checkpoint, hash, started and completed times, cost and token totals); list its stages with state (pending, active, completed, skipped), iteration count and timings; and a paged timeline that merges transitions, stage executions, agent runs, gate events and artifact versions in time order backend
FR-301 Run artifact and gate endpoints: list artifacts by key with their versions, get a version, diff two versions (LineDiff); list the run’s gates; approve or reject a gate. Gate decisions call the same gate service as /api/projects/{id}/gates/{gateId}/…, with the same rules, errors, follow-ups and audit events backend
FR-302 Gate inbox endpoint: pending gates across every project the user can see, newest first, cursor-paged, filterable by pipeline and gate key. The live hub sends pipelineRunUpdated, stageUpdated and gateUpdated events on the existing project groups backend
FR-303 Replay endpoint: one run’s timeline with each agent run’s full input and output (permission as FR-300), for the replay view. Read-only; it never re-runs anything backend

FR-301 acceptance

  • Given a pending plan_approval gate, when an Owner approves it through /api/pipeline-runs/{runId}/gates/{gateId}/approve, then the transition, events, notifications and snapshot are identical to approving it through the project endpoint.
  • Given a Viewer, then 403 FORBIDDEN. Given a decided gate, then 409 GATE_NOT_PENDING.

FR-300 acceptance

  • Given a run with 120 timeline entries, when the first page (50) is fetched and the cursor followed, then all 120 come back once each, in order.

3.8 Engine UI (step 5, part 2)

ID Requirement Layer
FR-304 frontend/src/engine/ holds the engine UI (stand-in for the future @tevrin/engine-ui package): API hooks, RunTimeline, StageList, ArtifactViewer, ArtifactDiff, GateInbox, GateDecision, RunReplay, PromptComparison. An ESLint rule forbids imports from src/features/** and src/app/** into src/engine/**. Generic pieces used by both (diff view, Markdown view) move into src/engine/ and the SDLC features import them from there frontend
FR-305 Every engine component renders from the definition and the run data only. Labels come from definition titles; there is no stage, artifact or gate name in src/engine/ frontend
FR-306 A Pipeline tab on the project (/projects/[projectId]/pipeline) shows the current run’s stage list, run summary (status, checkpoint, cost, tokens), timeline and artifacts, with a run picker for earlier runs. Replay (/projects/[projectId]/pipeline/replay?runId=) steps through the timeline one entry at a time, showing each agent run’s input and output and each artifact version with its diff to the previous version frontend
FR-307 A Gate inbox page (/gates, nav item “Gates”) lists pending gates across projects with approve and reject actions (the reject comment is optional, as today: 0.1.0 FR-13). Escalation gates link to the project, as their notifications do frontend
FR-308 The SDLC stage stepper and stage navigation read the stage list, order and titles from the SDLC definition instead of a hard-coded phase list. Every existing SDLC page, route and copy is unchanged frontend

FR-305 acceptance

  • Given an MSW handler that serves the fixture-review definition and a run of it, when the Pipeline tab and replay render, then they show its stages, artifacts and gate, with no change to src/engine/ (Vitest).

FR-307 acceptance

  • Given two projects, one the user can’t see, then the inbox lists only the visible project’s gates. Given an empty inbox, then “No gates waiting for you”. Given a load error, then the shared error state.

FR-308 acceptance

  • Given every existing SDLC page test, then it passes unchanged. Given a project in analysis, then the stepper shows Analysis first, as in 0.6.1.

3.9 Release housekeeping

ID Requirement Layer
FR-309 Version 0.7.0 in the three version sources; a changelog entry (“Pipeline engine”: SDLC unchanged, Pipeline tab, gate inbox, replay); CLAUDE.md Layout, Stack and rule 8 updated for the engine projects; STACK.md notes YamlDotNet and the JSON Schema validator; a docs-site guide Pipelines and packs (engine architecture, definition reference from §4.49, writing a guard, the dependency rule) and an operations note on definition pinning. At release: docs/history/0.7.0.md, SPEC and PROGRESS to docs/0.7.0/ frontend + docs

3.10 The SDLC on the engine runner (step 6)

(Added 2026-11-21, D-0.7.0-38.) The whole SDLC pack runs on the engine. Every SDLC agent runs through AgentStageRunner, and the SDLC’s other stage work runs as pack extension points. Users see no change: the characterisation snapshots (FR-261) and the golden prompt tests (GoldenPromptTests, all eight agents) stay unchanged at every commit. The hooks below are engine extension points with no SDLC types. The SDLC supplies its implementations in Tevrin.Pack.Sdlc or the Aide.* host.

ID Requirement Layer
FR-310 Host run ids and redelivery. The runner takes the agent run id from the caller. A redelivered job whose agent run already succeeded returns the stored output and makes no LLM call and no new agent run. A run left running by a lost lease is handled as in 0.6.1 backend
FR-311 Run events. IAgentStageHooks gains run started, completed and failed hooks, and the budget refusal reaches the host. The SDLC hook writes RUN_STARTED, RUN_COMPLETED, RUN_FAILED and BUDGET_EXCEEDED with 0.6.1’s payloads, actors and order backend
FR-312 Request options and run metadata. A host hook supplies per-call MaxTokens (0.5.0 FR-160) and ContextTokens (FR-162), because they’re project and admin settings, not definition fields. The agent run records the catalogue version, packs, agent key and the full list of input artifact versions, as in 0.6.1 backend
FR-313 Content transform. A pack hook turns validated model output into stored artifact content. The SDLC’s renders the plan into Markdown with the aide-plan block and adds the deploy-file steps (0.6.1), byte for byte as today backend
FR-314 Corrective input. A pack hook builds a retry’s input: the previous output in PREVIOUS_* variables, the SDLC feedback wording, and the host error codes (INVALID_PLAN, MISSING_SECTIONS). The planning stage gets validate: [{ guard: sdlc.plan-valid }] with on_invalid: { retry_with_feedback: true, max_attempts: 2, then: fail } (§4.55). Every other place the SDLC validates output today is expressed the same way, with today’s attempt counts backend
FR-315 Transactions and failures. The agent run and its token accounting commit in their own transaction, before the artifact is stored, as in 0.6.1. A transient provider failure leaves the agent run running and the queue retries the job. A permanent failure fails it with 0.6.1’s error code and message. Where the engine default differs, a host hook chooses backend
FR-316 Host checks. A pre-run hook can refuse a run with an error code before the model is called. The SDLC uses it for credential invalidation (0.2.0 FR-78), the provider-disabled check (FR-157) and the source-items budget (FR-172). A post-store hook carries the corruption alert and regeneration (0.1.0 FR-20) backend
FR-317 SDLC context and tools. AgentRepoContext, the iteration context and the codebase summary become SDLC IAgentContextProviders. The repository tools used by the execution and build-fix agents become IAgentTools, listed in each stage’s agent.tools backend
FR-318 Document agents move. repository_analyst, stack_analyst, idea_refinement, spec_generator, code_review and plan_generator run through the engine runner. Their job handlers (AgentJobHandlers, RepositoryAnalysisJobHandler, StackAnalysisJobHandler, ReviewJobHandler, and the RefinementService and AnalysisService callers) only load the job, call the runner and apply the SDLC follow-ups (review decision, analysis chaining) backend
FR-319 Tool agents move. code_generator (execution) and build_fix run through the engine runner with the SDLC tools. The step loop, commits, pushes and build-check orchestration stay SDLC code, registered as IStageHandlers where they are stage work (handler: on the stage) backend
FR-320 Old runner removed. Once all eight agents have moved: AgentRunner, ArtifactAgentJob and their SDLC-only helpers are deleted, along with the run-path code in AgentRunJobEndedHook. An architecture test fails if an Aide.* type outside the engine hooks calls the LLM resolver directly. The docs guide Pipelines and packs and CLAUDE.md Layout say the SDLC runs on the engine runner backend + docs
FR-321 Definition version and re-pin. The sdlc.pipeline.yaml changes (FR-314, FR-319) bump its version and so its hash. At start-up, non-final SDLC runs pinned to the earlier 0.7.0 SDLC hash are re-pinned once to the new hash. This is idempotent, logged, and safe on several replicas of the same build, because both definitions describe the same behaviour (the earlier one left plan validation to host code). Runs pinned to any other unknown hash still get 409 DEFINITION_UNAVAILABLE backend

FR-310 acceptance

  • Given a spec_generation job whose agent run succeeded, when the job is redelivered, then the Fake provider gets no new call, no new agent run is created, and the artifact is unchanged.

FR-311, FR-315 acceptance

  • Given each agent’s move commit, then every characterisation snapshot and golden prompt file is unchanged (CI’s freeze step).
  • Given the Fake provider failing transiently once and then succeeding, then the agent run stays running, the job is retried and succeeds, and the events match 0.6.1’s existing test.
  • Given a project over its token budget, then the job fails with BUDGET_EXCEEDED, the event is written, and the model is never called.

FR-313, FR-314 acceptance

  • Given the §4.55 SDLC example (plan invalid on attempt 1, valid on attempt 2), then there are two agent runs, the second prompt carries PREVIOUS_* and 0.6.1’s feedback wording, and the stored plan is identical to 0.6.1’s output for the same Fake response.
  • Given a plan invalid on both attempts, then the job fails with INVALID_PLAN, as in 0.6.1.

FR-316 acceptance

  • Given a disabled provider, an invalidated credential, or source items over budget, then the run is refused with 0.6.1’s error code and the model is never called.
  • Given scenario 14 (a corrupted artifact regenerated), then its snapshot is unchanged.

FR-320 acceptance

  • Given the backend source, then no AgentRunner or ArtifactAgentJob type exists, and the architecture test passes.

FR-321 acceptance

  • Given a run in review pinned to the earlier SDLC hash, when the API starts, then the run is pinned to the new hash, one log entry is written, and the next review cycle behaves as before. A second start changes nothing.

3.11 Retiring the CLI

(Added 2026-11-22, D-0.7.0-45.) Ben retired the command-line tool. The API it called stays, and so do personal API tokens.

ID Requirement Layer
FR-322 The tevrin CLI and the deprecated aide alias are removed: Aide.Cli, Aide.Cli.Alias and Aide.Cli.Tests, their solution entries, the System.CommandLine package, and the CI pack and test steps. The docs guide, the configuration and error-code sections, and the marketing nav, FAQ and product entries no longer mention it. The Account page describes tokens as being for scripts and the API. A docs page, Reference → Retired CLI, records the snapshot commit (e8c3990): the commands, config, exit codes, dependencies and tests, and step-by-step restore instructions. The changelog entry for 0.7.0 says the CLI is retired backend + frontend + docs + CI

FR-322 acceptance

  • Given the repo, then no Aide.Cli* project or System.CommandLine reference exists, CI has no CLI step, and openapi/api.json is unchanged.
  • Given the docs site, then no page links guides/cli/, and the Retired CLI page lists the files at e8c3990 and the restore steps.
  • Given the Account page, then the token copy mentions scripts and the API, not the CLI. Creating and revoking tokens works as before.

4. Domain rules

4.49 Definition shape and validation

pipeline: <id>                # kebab-case, unique across packs
version: <int>
title: <text>
trigger: { kind: manual }     # schedule | webhook parse, refused in 0.7.0
approval_modes: [strict, advisory, autonomous]
default_approval_mode: advisory
start: [<stage id>, ...]      # first is the default; a pack IRunStartSelector picks among them
settings: [<name>, ...]       # values come from the pack's IRunSettingsProvider (per project)
artifacts:
  <key>: { title, format: markdown|json, schema?, approval: required|auto_lock, cascade: downstream|self_and_downstream|none }
statuses:
  <name>: { generic: active|running|waiting_on_gate|completed|failed|cancelled }
status_changes:
  <name>: { stage, from: [<status>], to: <status>, completes_run?: bool, error_code: <CODE>,
            error_message?: <text>, reason?: <text>, wrong_stage_message?: <text> }   # D-0.7.0-29, D-0.7.0-31
concurrency: { exclusive: [{ job_type, scope: project|run }] }
stages:
  - id: <id>
    title: <text>
    status: <status>
    agent?: { key, prompt, model?, tools?: [<pack>.<tool>], job_type? }   # job_type defaults to agent.run
    handler?: <pack>.<name>
    handlers?: [<pack>.<name>]         # D-0.7.0-43: secondary stage handlers, run only when named; the stage's kind is unchanged
    inputs?: [<artifact key>]
    output?: <artifact key>
    requires?: [{ artifact_locked: <key> } | { no_pending_gates: { except: [<gate>] } } | { guard: <pack>.<name> }]
    validate?: [{ guard: <pack>.<name> }]
    on_invalid?: { retry_with_feedback: bool, max_attempts: 1-10, then: escalate|fail }
    gate?: { type: <key>, modes: [...], approves?: <artifact key>, approval_links?: bool }
    on_success?: <stage> ; on_reject?: <stage>
    loop?: { to: <earlier stage>, on: <outcome>, max_iterations: <1-100> | { setting: <name> }, requires?: [...], title?: <text> }
    enqueue_on_enter?: <job_type>      # D-0.7.0-27
    agents?: [{ key, job_type, prompt?, inputs?, output?, tools?, validate?, on_invalid? }]   # D-0.7.0-42; validate/on_invalid check the binding's output (D-0.7.0-44)
rollback_status?: <status>          # D-0.7.0-26

Validator codes (reported together, each with its YAML path):

Code When
DEF_PARSE YAML doesn’t parse, or a key has the wrong type
DEF_DUPLICATE_ID Two stages, artifacts, statuses or status changes share an id
DEF_UNKNOWN_STAGE / DEF_UNKNOWN_ARTIFACT / DEF_UNKNOWN_STATUS A reference names something not declared
DEF_UNKNOWN_GUARD / DEF_UNKNOWN_HANDLER / DEF_UNKNOWN_TOOL / DEF_UNKNOWN_JOB_TYPE No pack registered that name
DEF_STAGE_KIND A stage has both agent and handler
DEF_UNREACHABLE_STAGE No path from a start stage reaches it (via next, on_success, on_reject, loop)
DEF_UNCAPPED_LOOP A loop (or an on_reject pointing backwards) has no max_iterations
DEF_LOOP_FORWARD loop.to is not an earlier stage
DEF_SCHEMA_NOT_FOUND schema names a file the pack doesn’t embed, or it isn’t valid JSON Schema
DEF_ARTIFACT_NO_PRODUCER An artifact is in some inputs but no stage outputs it and no pack handler declares it
DEF_UNKNOWN_SETTING { setting: x } names a setting not in settings
DEF_TRIGGER_NOT_SUPPORTED trigger.kind is schedule or webhook (0.7.0)
DEF_UNKNOWN_PROMPT An agent stage’s prompt (agent.prompt, else the agent key) isn’t one its pack registered, doesn’t parse, requires {{FEEDBACK}}, or requires a placeholder that is neither a stage input nor a registered context name; checked only for a pack that registers prompts (D-0.7.0-33)

Example: a definition with loop: { to: draft } on stage check, no max_iterations, and validate: [{ guard: fixture.missing }] → two errors: DEF_UNCAPPED_LOOP at stages[1].loop and DEF_UNKNOWN_GUARD at stages[1].validate[0].guard.

4.50 Definition hash

The hash is SHA-256 (lower-case hex) of the definition’s canonical JSON: the parsed model serialised with sorted keys, no insignificant whitespace, LF line endings and UTF-8. Comments, key order and YAML formatting don’t change it. Changing any value does.

  • Two files that differ only in a comment → same hash.
  • max_attempts: 3 → 4 → different hash.

4.51 Generic transitions and the SDLC mapping

Kind From → to Checkpoint Notes
advance stage → its next (or on_success) +1 requires: and the entry gate must be met
loop stage → loop.to unchanged iteration +1; refused past the cap
rollback any → an earlier or same stage set to the target checkpoint status becomes the pack’s rollback status if declared, else the stage status
fallback any → an earlier stage after a cascade unchanged status = the target stage’s status
status_change same stage, named in status_changes unchanged from must match, else the declared error_code (with error_message). A request naming another stage is refused with WRONG_PHASE and wrong_stage_message when that is set, and the target is ignored when it isn’t (D-0.7.0-31)
noop same stage unchanged  

A new run starts at checkpoint 1. These are 0.6.1’s checkpoint rules, made generic.

0.6.1 0.7.0
Advance advance
ReviewCycle (review → execution) loop on review with on: review_required, max_iterations: { setting: review_cycles }
Rollback rollback (SDLC rollback status rolled_back)
InvalidationFallback fallback
ReleaseNoop noop on release
ReleaseCompleted status_change release_completed: [releasing, awaiting_merge] → released, completes_run, error NOT_RELEASING
ReleaseAwaitingMerge status_change release_awaiting_merge: releasing → awaiting_merge, error NOT_RELEASING
ReleaseMergeAbandoned status_change release_merge_abandoned: awaiting_merge → releasing, error NOT_RELEASING
NewVersion a new run (start stage refinement, or analysis chosen by the SDLC start selector); errors NOT_RELEASED, VERSION_IN_PROGRESS, STACK_INFER_NO_CODE stay in the SDLC service

review_cycles is maxReviewCycles + extraReviewCycles (FR-14), so the engine cap equals today’s. The review decision itself (score, stall, escalation) stays in the SDLC ReviewDecisionRules; the cap is a backstop.

SDLC definition sketch:

pipeline: sdlc
start: [refinement, analysis]
stages:
  - { id: analysis, title: Analysis, status: active, agent: { key: stack_analyst, job_type: stack_analysis }, output: stack_profile,
      on_success: refinement }
  - { id: refinement, title: Refinement, status: active, agent: { key: idea_refinement, job_type: idea_refinement },
      inputs: [source_items, codebase_summary], output: project_request,
      requires: [{ guard: sdlc.leaving-analysis }] }
  - { id: specification, title: Specification, status: active, agent: { key: spec_generator, job_type: spec_generation },
      inputs: [project_request, codebase_summary], output: technical_specification,
      requires: [{ artifact_locked: project_request }] }
  - { id: planning, title: Planning, status: active, agent: { key: plan_generator, job_type: plan_generation },
      inputs: [technical_specification, codebase_summary], output: implementation_plan,
      requires: [{ artifact_locked: technical_specification }],
      gate: { type: spec_approval, modes: [strict, advisory], approves: technical_specification, approval_links: true } }
  - { id: execution, title: Execution, status: building,
      requires: [{ artifact_locked: technical_specification }, { artifact_locked: implementation_plan },
                 { guard: sdlc.plan-has-steps }, { guard: sdlc.working-copy-prepared }],
      gate: { type: plan_approval, modes: [strict], approves: implementation_plan, approval_links: true } }
  - { id: review, title: Review, status: reviewing, agent: { key: code_review, job_type: review },
      inputs: [technical_specification, implementation_plan], output: optimization_plan,
      requires: [{ guard: sdlc.plan-steps-completed }],
      loop: { to: execution, on: review_required, max_iterations: { setting: review_cycles } } }
  - { id: release, title: Release, status: releasing,
      requires: [{ guard: sdlc.release-eligible }, { no_pending_gates: { except: [pre_release] } }],
      gate: { type: pre_release, modes: [strict, advisory, autonomous], approval_links: true } }

The exact keys (job types, inputs, guard names) are fixed during M57 to match 0.6.1 behaviour; this sketch is not normative where they differ. The loop’s own entry check (optimisation plan locked with steps left, working copy prepared) is the guard sdlc.review-cycle-ready on the loop.

4.52 Entry checks

For entering stage S: evaluate S’s requires: in declared order and collect every unmet reason (built-ins have fixed messages, guards return their own), then check S’s gate when the run’s approval mode is in modes. All unmet reasons are returned together. SDLC guards return 0.6.1’s exact messages.

Example (0.6.1 parity): entering execution with the spec locked, the plan not locked, 0 steps and the working copy prepared → PHASE_PRECONDITION_FAILED with [“The implementation plan is not approved.”, “The implementation plan has no steps.”].

SDLC guards: sdlc.leaving-analysis (stack profile approved; composition pinned or generalist), sdlc.plan-has-steps, sdlc.working-copy-prepared, sdlc.plan-steps-completed, sdlc.release-eligible (latest review for this checkpoint is release_eligible or escalation accept), sdlc.review-cycle-ready. analysis is entered only as a start stage; advance into it is refused (“Analysis is only entered when a version that infers its stack starts.”).

4.53 Entry gates

A stage’s gate is required when the run’s approval mode is in its modes. For the SDLC (equals 0.6.1 RequiredGate):

Entering strict advisory autonomous
planning spec_approval spec_approval —
execution plan_approval — —
release pre_release pre_release pre_release
others — — —

Escalation gates are engine-owned and never guard entry.

4.54 Cascade from the definition

Artifact A depends on B when the stage that outputs A has B in its inputs, transitively. Approving a new version of B invalidates every artifact that depends on B, unless B’s cascade is none. With self_and_downstream, the fallback stage includes B’s own producing stage. The fallback stage is the earliest producing stage of the invalidated set, used only when the run is in a later stage. The pack’s IInvalidationHook adds pack effects (SDLC: step resets).

SDLC result (must equal 0.6.1 §4.4, unit test per row):

Approved Invalidated SDLC step reset Fallback (when later)
project_request technical_specification, implementation_plan, optimization_plan all steps specification
technical_specification implementation_plan, optimization_plan all steps planning
implementation_plan optimization_plan steps of other plans execution (the step reset counts as produced in execution, as in 0.6.1)
optimization_plan — none —
codebase_summary (none) — none —
source_items (none) — none —
stack_profile (self_and_downstream) project_request, technical_specification, implementation_plan, optimization_plan all steps analysis

4.55 Validate and retry

Attempt n’s output fails validation → if retry_with_feedback and n < max_attempts, rerun with the findings appended (trigger validation_failed); else follow then. Findings are the guard’s messages plus schema errors (path and message), capped at 8,000 characters.

Example (fixture): max_attempts: 3, then: escalate. Attempt 1 fails “weekly volume +25% > 10%”, attempt 2 fails the same, attempt 3 fails “taper missing” → 3 agent runs, 2 with feedback, then one pending escalation gate on the run. With then: fail, the third agent run and its job end failed.

SDLC: (amended by D-0.7.0-34, then D-0.7.0-38) the planning stage declares validate: [{ guard: sdlc.plan-valid }] with on_invalid: { retry_with_feedback: true, max_attempts: 2, then: fail } (FR-314). The retry input comes from the SDLC corrective-input hook, and a final failure is INVALID_PLAN. Example: attempt 1 fails sdlc.plan-valid with one of 0.6.1’s plan-validation messages → attempt 2 receives the previous plan (PREVIOUS_*) plus that message in 0.6.1’s wording and returns a valid plan → two agent runs, one plan artifact version, the job succeeds.

4.60 Agent stage order with hooks

The runner runs one attempt in this order. The order is 0.6.1’s AgentRunner order, and the snapshots check it:

  1. Pre-run host check (FR-316). On refusal, the job fails with the hook’s code and no model call is made.
  2. Budget check (FR-26). On refusal, BUDGET_EXCEEDED.
  3. Create or load the agent run by the host id (FR-310). If it already succeeded, return its stored output and stop.
  4. Run started hook (FR-311).
  5. Collect inputs and context providers, then render. On a retry, the corrective-input hook adds PREVIOUS_* and the feedback (FR-314).
  6. Call the model with the host options (FR-312). Tokens are recorded.
  7. Validate (§4.55). Then the run and its tokens commit in their own transaction with the run’s verdict (FR-315). The host writes its run-completed or run-failed event in this commit, so 0.6.1’s order (RUN_COMPLETED before ARTIFACT_CREATED) holds. This applies to rejected retry attempts too. If the output is invalid, retry from step 5 or follow then.
  8. Content transform (FR-313), an optional host veto on storing (0.6.1 skips a draft it may not create), store the artifact version, then the post-store hook (FR-316).

Inputs: an input the host supplies through prompt values is not read again. When the host lists the run’s input artifacts itself, that list is stored. Otherwise the engine lists only the inputs it read. Context providers skip names the host supplies (SuppliedPlaceholders). The pinned definition is resolved as for lifecycle moves (D-0.7.0-37): registered, or stored and runnable. Otherwise DEFINITION_UNAVAILABLE.

On a transient failure at any step, the agent run stays running and the error is rethrown to the queue. On a permanent provider or pre-call failure, the run failed hook fires and the run and job fail. A then: fail verdict doesn’t use that hook: the host writes its failure event from the step 7 commit, which carries the failure.

4.61 Move order and parity

Agents move one per commit, in this order: spec_generator, idea_refinement, stack_analyst, code_review, plan_generator, then repository_analyst, build_fix, code_generator. (Reordered in M62c: the first five already have an agent stage in sdlc.pipeline.yaml. The last three have none, and adding stages would change the stepper (FR-308), so they bind through an agents: list on an existing stage (D-0.7.0-42).) Each commit keeps the characterisation snapshots, the golden prompt files and that agent’s existing tests unchanged. There is no side-by-side parity mode: the snapshots and golden files are the parity check. If a snapshot change looks unavoidable, the build stops and asks Ben. Snapshots are never re-baselined without a decision.

4.56 Parity combinations (M58)

The parity test enumerates: every stage × every pack status × every transition kind × approval mode × each boolean fact in LifecycleSnapshot toggled one at a time from both “all true” and “all false” × review decision (none, each value, stale checkpoint) × escalation outcome × pending gates (none, each gate, two gates) × target phase and target checkpoint (below, equal, above, invalid). For each, both machines must return the same success/failure, error code, unmet reasons, stage, status and checkpoint.

4.57 Run status

Generic run status: completed, failed and cancelled are final; otherwise waiting_on_gate when a gate on the run is pending, running when a job for the run is queued or running, else active. A pack status maps to a generic one through statuses.

SDLC statuses: active, building, reviewing, releasing, rolled_back and awaiting_merge → generic as computed above (awaiting_merge waits on a merge outside Tevrin, not a gate, so it’s active or running while the merge poll job runs); released → completed. A run ends completed when release_completed applies; a new version’s run starts at refinement/analysis, active, checkpoint 1.

4.58 Characterisation snapshots

Scenarios: (1) strict happy path; (2) advisory; (3) autonomous; (4) a gate rejected then approved (agent rerun with feedback); (5) a draft rejected; (6) two review cycles then release-eligible; (7) escalation continue, rollback and accept; (8) approving a new project request mid-execution (cascade and fallback); (9) rollback to checkpoint 2; (10) release refused, awaiting_merge, then merged; and merge abandoned; (11) new version; (12) stack inference (analysis → refinement); (13) build check with one failed attempt and a fix; (14) a corrupted artifact regenerated.

Normalisation: ids become <type>#n in first-seen order; timestamps, durations, tokens, costs and lease owners are dropped; content hashes stay (the Fake provider is deterministic); entries are ordered by creation sequence; JSON is written with sorted keys and LF.

4.59 Concurrency

Enqueueing a job type listed in concurrency.exclusive checks for an active (queued or running) job of that type in the same scope and refuses with CONFLICT semantics (the caller’s existing error, e.g. EXECUTION_IN_PROGRESS where 0.6.1 had one). Types not listed may run in parallel.

5. Data

One additive migration in M56 only if column types change (FR-274), and these in M58–M59 (all additive, expand only):

Table Key fields Constraints Notes
pipeline_definitions hash (PK, char 64), pipeline_id, version, pack_id, canonical_json (jsonb), created_at PK on hash Written on first use, never updated
pipeline_runs id (v7), project_id, pipeline_id, definition_hash FK, subject_id (SDLC: release version id), current_stage, pack_status, status (generic), checkpoint, approval_mode, iterations jsonb (stage → count), started_at, completed_at, xmin Unique (pipeline_id, subject_id); at most one non-final run per (project_id, pipeline_id) (partial unique index) Source of truth for stage, status, checkpoint
stage_executions id (v7), pipeline_run_id, stage_id, iteration, checkpoint, entered_at, exited_at, outcome Index (pipeline_run_id, entered_at) Per-stage timings
state_transitions + pipeline_run_id (FK, backfilled, then not null), kind (string)   from_phase/to_phase hold stage ids (same values)
approval_gates + pipeline_run_id (FK, backfilled)   type is a string key (same values)
agent_runs + pipeline_run_id (nullable FK), stage_id, input (text), input_truncated (bool), latency_ms (nullable)   Existing rows keep input null. stage_id is the existing phase column, which already holds the stage id (D-0.7.0-32)
artifacts + pipeline_run_id (FK, backfilled)    

projects.current_phase, status, checkpoint stay, written with the run in one transaction (D-0.7.0-8). Removing them is a later contract step. Retention unchanged.

§3.10 needs no schema change: it writes the same agent_runs, artifacts, events and stage_executions rows as 0.6.1. Any column it does turn out to need is added by an expand-only migration. The re-pin (FR-321) updates pipeline_runs.definition_hash and writes the new definition to pipeline_definitions.

6. API

All existing endpoints are unchanged in route, behaviour and JSON values (FR-274 may turn enum schemas into strings). §3.10 changes no endpoint, and openapi/api.json stays byte-identical. New, additive, contract and client regenerated:

Method Route Response Errors Auth
GET /api/pipelines [{ id, title, version, hash, packId }] — signed in
GET /api/pipelines/{pipelineId}/definitions/{hash} definition summary (FR-299) NOT_FOUND → 404 signed in
GET /api/pipelines/{pipelineId}/prompt-stats?projectId= [{ agentKey, promptVersion, runs, avgInputTokens, avgOutputTokens, avgCost, avgLatencyMs, avgDurationMs, failureRate }] NOT_FOUND → 404 project viewer (all visible projects when no projectId)
GET /api/projects/{id}/pipeline-runs runs, newest first NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId} run (FR-300) NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId}/stages [{ id, title, state, iterations, enteredAt, exitedAt, durationMs }] NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId}/timeline?cursor=&limit= { items: [{ at, kind, … }], next } (limit 1–200, default 50) VALIDATION → 400, NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId}/artifacts [{ key, title, versions: [{ version, status, hash, createdAt }] }] NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId}/artifacts/{key}/versions/{version} artifact version NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId}/artifacts/{key}/diff?from=&to= line diff VALIDATION → 400, NOT_FOUND → 404 project viewer
GET /api/pipeline-runs/{runId}/gates gates NOT_FOUND → 404 project viewer
POST /api/pipeline-runs/{runId}/gates/{gateId}/approve · /reject as the project gate endpoints as the project gate endpoints, plus DEFINITION_UNAVAILABLE → 409 as the project gate endpoints
GET /api/pipeline-gates?status=pending&pipelineId=&gateType=&cursor= { items, next } VALIDATION → 400 signed in (visible projects only)
GET /api/pipeline-runs/{runId}/replay?cursor=&limit= timeline items with agent input and output NOT_FOUND → 404 project viewer

Live hub events (existing project groups): pipelineRunUpdated (run DTO), stageUpdated (stage DTO), gateUpdated (gate DTO).

Error codes

Code Status Meaning User-facing copy
DEFINITION_UNAVAILABLE 409 The run’s pinned definition names guards, handlers or tools this build doesn’t register “This run uses a pipeline definition this version of Tevrin can’t run. Ask an admin to check the deployment.”

Every other error is an existing code with its existing status (PHASE_PRECONDITION_FAILED, WRONG_PHASE, GATE_PENDING, GATE_NOT_PENDING, INVALID_TARGET_VERSION, NOT_RELEASING, NOT_RELEASED, VERSION_IN_PROGRESS, STACK_INFER_NO_CODE, INVALID_PLAN, VALIDATION, NOT_FOUND, FORBIDDEN, CONFLICT). Definition validator codes (§4.49) are startup and readiness errors, not API errors.

7. Pages and UI

Route Page Content States
/projects/[projectId]/pipeline Pipeline Run picker, summary (pipeline title, status badge, checkpoint, cost, tokens, hash short form), stage list with states and timings, timeline, artifacts list → viewer and diff loading · empty (“No runs yet”) · error · not found
/projects/[projectId]/pipeline/replay?runId= Replay Previous/next stepper and a scrubber over the timeline; agent entries show input and output side by side (scrolling monospace blocks); artifact entries show the diff to the previous version loading · error · not found
/gates Gate inbox Pending gates (project, pipeline, gate title, artifact link, age, overdue badge), approve and reject dialogs (an engine GateDecision dialog with the same copy as gate-dialogs, which the engine boundary can’t import) loading · empty · error
Existing SDLC pages unchanged Stepper reads stages from the definition (FR-308) unchanged

Prompt comparison shows as a section on the Pipeline page (“Prompt versions”): a table per agent key. Devices: desktop-first, usable at 360px (tables scroll inside their card). Accessibility: WCAG 2.2 AA, keyboard-operable stepper and scrubber, live region for new timeline entries. Styles follow the 0.6.0 design system.

8. Non-functional requirements

  • Behaviour: the characterisation snapshots are the contract. No milestone may change them (FR-261).
  • Performance: definitions are parsed once per hash and cached. Apply is pure and allocation-light (< 1 ms). A lifecycle move adds at most one row read and write (pipeline_runs) over 0.6.1. Timeline pages answer in < 300 ms for a run with 5,000 entries (indexed by run and time).
  • Security: definitions load only from pack assemblies (embedded resources), never from users. YAML parsing allows no type tags or anchors that expand beyond 1 MB. Agent input is redacted before storage and shown only to users who can see agent outputs. Engine endpoints check project permissions on every call; the gate inbox filters by visibility in SQL.
  • Observability: structured logs for each transition (run, stage, kind, checkpoint, definition hash), each validation retry and each DEFINITION_UNAVAILABLE. An OpenTelemetry activity per stage execution and per agent run, tagged with run and stage.
  • Tests: no test calls a real LLM (rule 10). Engine tests use fixture definitions and the Fake provider. Every §4 table row and worked example is a unit test.
  • Compatibility: stored job payloads, artifact content, gate types, event types and wire values from 0.6.1 read unchanged. Rolling back the deploy to 0.6.1 after M58’s migration is safe because the migration is expand-only and the project columns stay current.

9. Environments

Unchanged: dev loop, Docker Desktop Kubernetes, Railway preview and production. No new accounts, secrets or services. New NuGet dependencies: YamlDotNet and a JSON Schema validator (e.g. JsonSchema.Net), added to Directory.Packages.props.

10. Decisions and assumptions

ID Decision By Status
D-0.7.0-1 Extract in place in this repo with new Tevrin.* projects; Aide.* stays as the SDLC implementation and host. Engine split into its own repo is a later step Ben (2026-11-17) agreed
D-0.7.0-2 One feature version, 0.7.0, covering research steps 1–5. Step 7 (packaging) and every non-SDLC pack are out Ben agreed
D-0.7.0-3 Triggers: all three modelled and validated; only manual runs. schedule/webhook refused with DEF_TRIGGER_NOT_SUPPORTED Ben (interview) agreed
D-0.7.0-4 Generic API is read-only plus gate decisions; SDLC runs start and move through the existing project endpoints Ben (interview) agreed
D-0.7.0-5 Generic UI is added beside the SDLC pages (Pipeline tab, replay, gate inbox); the SDLC stepper reads the definition; no SDLC page is rebuilt Ben (interview) agreed
D-0.7.0-6 After parity, the old state machine is removed in 0.7.0; parity cases live on as definition tests Ben (interview) agreed
D-0.7.0-7 String keys keep every stored and wire value. Amended by D-0.7.0-24: the OpenAPI enum components are kept, so the contract is unchanged Claude assumed
D-0.7.0-8 pipeline_runs is the source of truth; projects.current_phase/status/checkpoint stay as a same-transaction copy so 0.6.1 queries, DTOs and a deploy rollback still work. Dropping them is a later contract step Claude assumed
D-0.7.0-9 The engine’s “run” is called a pipeline run (pipeline_runs, /api/pipeline-runs) because “runs” already means agent runs (/api/projects/{id}/runs, Runs page) Claude assumed
D-0.7.0-10 One SDLC pipeline run per release version; “new version” starts a new run, and the old run ends completed Claude assumed
D-0.7.0-11 Projects stay a platform concept owned by the host; every run belongs to a project, and engine permissions are the project’s Claude assumed
D-0.7.0-12 One database and one migration history: engine entity configurations live in Tevrin.Engine.Runtime and are applied by AideDbContext; migrations stay in Aide.Infrastructure Claude assumed
D-0.7.0-13 Entry gates are declared on the stage they guard. A stage with only a gate is a valid manual approval stage Claude assumed
D-0.7.0-14 The engine UI lives in frontend/src/engine/ with a lint boundary instead of a separate npm workspace package (packaging is step 7) Claude assumed
D-0.7.0-15 gate.timer and trigger.fire are reserved engine job types with no use in 0.7.0; the gate reminder/overdue sweep moves to the engine as a hosted sweep, unchanged (Amended by D-0.7.0-25: the sweeper stays on the SDLC side, because its single loop mixes delivery retries with SDLC sweeps) Claude assumed
D-0.7.0-16 Agent input is stored redacted and capped at 1 MB per run; older runs have none Claude assumed
D-0.7.0-17 Run replay is read-only. Re-executing a run against a new prompt version is future work Claude assumed
D-0.7.0-18 Parity mode throws in tests and logs in production, and exists only between M58’s start and FR-293 Claude assumed
D-0.7.0-19 Fan-out, parallel stages, tool permission tiers, conversation stages, outcome scoring and the feedback store wait for the packs that need them research notes / Ben agreed
D-0.7.0-20 Seams for the engine lift (M55): IEngineDbContext (implemented by AideDbContext), IJobExceptionClassifier, telemetry and log scopes through DI, ISecretProtector as an interface. Nothing holding SDLC values moves; the worker’s log category becomes Tevrin.Engine.Runtime.Jobs.JobWorker Claude assumed
D-0.7.0-21 The LLM layer, PromptTemplate, AgentRunRules, artifact, gate and AgentRun types were keyed by SDLC enums, so they move in M56 (string keys) or M58 (Phase), not M55. FR-264–FR-268 complete across M55–M56 Claude assumed
D-0.7.0-22 The characterisation recorder treats arrays made only of id labels as sets, sorted by kind then number. The snapshots were re-sorted once, and the freeze base moved to that commit. This is the only allowed snapshot edit in 0.7.0 Claude assumed
D-0.7.0-23 Tevrin.Pack.Sdlc is the bottom of the SDLC side: it references only the engine, and Aide.* references it. The key constants (SdlcAgents, SdlcArtifacts, SdlcGates, SdlcJobTypes) live there, and the engine owns EngineGates.Escalation and EngineJobTypes. The host composes guards that need Aide.Domain rules Claude assumed
D-0.7.0-24 The OpenAPI contract stays byte-identical (amends D-0.7.0-7): DTO fields become strings, but a schema transformer still emits the SDLC enum values, so the client and frontend types don’t change Claude assumed
D-0.7.0-25 More lift seams: ILlmCatalog, IApprovalLinkPolicy, an engine NotificationChannelOptions binding the same section, and Microsoft.Extensions.Http in the engine runtime. An architecture test fails if engine source contains an SDLC key literal. Log categories follow the moved types Claude assumed
D-0.7.0-26 Definition packages and model: YamlDotNet 18.1.0 and JsonSchema.Net 8.0.5 (last MIT release) in Tevrin.Engine.Runtime only (Q4). §4.49 gains rollback_status, loop.requires and on_reject: { to, max_iterations }; agent.prompt is optional; artifact format, approval and cascade default to markdown, required and downstream, written into the canonical JSON. Canonical JSON escapes only the quote, backslash and C0 controls, and stored JSON is read back with a JSON reader, not the YAML loader. The loader uses the event parser only (no tags, alias expansion capped at 1 MB, depth 64, one document) Claude assumed
D-0.7.0-27 SDLC definition and guards: guards read an SdlcLifecycleFacts fact; requires: runs only on advance and loop; a loop checks only loop.requires (never the target’s requires or gate) and its outcome is supplied by the caller (the review loop also fires on escalation continue); the loop counter for review_cycles is projects.review_cycle. New stage field enqueue_on_enter: <job_type>. Stage inputs follow what the 0.6.1 handlers read. A missing input is allowed Claude assumed
D-0.7.0-28 Pipeline runs, backfill and dual write: with no valid SDLC definition every save touching lifecycle rows throws and readiness fails (fail closed). pipeline_runs.status stores only active, completed, failed or cancelled. Link columns and state_transitions.kind stay nullable in 0.7.0. The host PipelineRunBackfillService (not the migration) runs at start-up before the job worker, idempotent and safe on several replicas. A SaveChanges interceptor copies project state onto its run in the same transaction Claude assumed
D-0.7.0-29 The state machine’s messages and definition fields: TransitionMessages holds 0.6.1’s exact texts; new optional loop.title, status_changes.*.reason and error_message, with defaults written into the canonical JSON. The SDLC definition sets enqueue_on_enter on specification, planning, review and release. Engine error codes PHASE_PRECONDITION_FAILED, GATE_PENDING, WRONG_PHASE and INVALID_TARGET_VERSION are added. IInvalidationHook gains FallbackStages Claude assumed
D-0.7.0-30 A loop’s max_iterations cap refuses only a loop that would otherwise be allowed, and the SDLC’s review_cycles is max(maxReviewCycles + extraReviewCycles, review_cycle + 1), so the backstop never refuses a cycle 0.6.1 allows Claude assumed
D-0.7.0-31 Switch-over: lifecycle decisions go only through the engine and fail closed. The old state machine, PhaseOrder, TransitionKind, phase-keyed GateRules lookups, InvalidationCascade.Effect, PhaseJobs and the parity code are removed. Decisions read the current run; when run and project disagree the project copy wins and it is logged. The Phase enum stays as the SDLC’s typed stage id. status_changes.*.wrong_stage_message reproduces 0.6.1’s WRONG_PHASE text. Transition tests became SdlcLifecycleTransitionTests with the same expected results Claude assumed
D-0.7.0-32 Run logging data (amends §5): no stage_id column on agent_runs (the existing phase column holds it). Migration RunLogging adds input, input_truncated and latency_ms, and stage_executions. Input is [role] blocks redacted and capped at 1 MB; latency is time to the first streamed output. Stage executions are written by the run-sync interceptor, with no history backfill. Reads skip the input column Claude assumed
D-0.7.0-33 The engine agent stage runner (adds DEF_UNKNOWN_PROMPT to §4.49): prompts come from the pack’s registered prompts and are checked only for a pack that registers some. Inputs fill {{KEY}}, context {{NAME}}, feedback {{FEEDBACK}}. Each attempt is its own agent run. Validate/retry findings are pointer: message, capped at 8,000 characters; a rejected attempt’s run stays succeeded with a validation_rejected error. IAgentStageHooks lets the host add budget checks and audit events Claude assumed
D-0.7.0-34 The SDLC’s agents stay on their own runner in 0.7.0. Moving them would change recorded behaviour: run ids, run events, token options, retry wording, plan post-processing, and transaction and failure handling. Golden prompt tests pin all eight agents. The engine AgentStageRunner ships for new packs. The hooks it needs before the SDLC can move are listed in PROGRESS.md Ben (2026-11-19) superseded by D-0.7.0-38
D-0.7.0-35 The generic API (FR-298–FR-303): endpoints live in Tevrin.Engine.Api with no SDLC types, and the host plugs in permissions, the gate service, transitions, job filtering and ProblemDetails through IRunAccessPolicy, IGateDecisionService, IPipelineTransitionSource, IRunActivityPolicy and IEngineProblems. The current stage is active and later stages pending, also after a rollback or loop. DEFINITION_UNAVAILABLE applies when the pinned definition names something this build doesn’t register. The timeline is one flat item type with cursor (time, kind, id); replay caps each input and output at 200,000 characters. Migration PipelineTimelineIndexes adds indexes Claude assumed
D-0.7.0-36 Gate inbox (FR-307): the reject comment is optional, as today (corrects FR-307’s wording). The engine GateDecision dialog reuses gate-dialogs’ copy, not its code. A gate whose type no stage declares is an escalation and links to the project. The page joins the live groups of at most 10 listed projects. The sidebar’s Lifecycle list keeps the hard-coded phases; the stepper and Previous/Next buttons read the definition Claude assumed
D-0.7.0-37 Audit fixes: SDLC moves decide with the run’s pinned definition (registry, then stored JSON) and refuse an unrunnable one with 409 DEFINITION_UNAVAILABLE; one-per-project exclusivity comes from concurrency.exclusive (scope: run is refused with DEF_PARSE in 0.7.0, as jobs carry no run id); the engine has a Tevrin.Engine activity source for stage-execution and agent-stage spans; the 300 ms timeline target is measured, not gated (the test gates at 1,000 ms) Claude assumed
D-0.7.0-38 0.7.0 also moves the whole SDLC pack onto the engine runner (§3.10): the D-0.7.0-34 hooks are built, all eight agents move, and the old runner is deleted. The work ships in a second build PR, before the release PR Ben (2026-11-21) agreed
D-0.7.0-39 The snapshot freeze (FR-261) holds through §3.10, with no re-baseline. The hooks exist so that the move changes nothing recorded. An unavoidable snapshot change stops the build for Ben’s decision Claude (from Ben’s 0.7.0 brief: “the current SDLC orchestration must work in the same way”) assumed
D-0.7.0-40 Token limits (MaxTokens, ContextTokens) come from a host options hook, not from new definition fields, because they’re project and admin settings (FR-312) Claude assumed
D-0.7.0-41 Non-final SDLC runs pinned to the earlier 0.7.0 SDLC hash are re-pinned at start-up instead of keeping both definitions runnable. The earlier definition differs only in where behaviour is declared: v2 adds the repo tools (agent.tools), the agents: bindings and plan validation as validate:, and v3 adds the remaining validate: guards and stage handlers (D-0.7.0-43/-44). The behaviour is the same (FR-321). This narrows “editing the YAML never changes a run in progress” for this one SDLC upgrade. Rolling back to an earlier 0.7.0 build after the re-pin isn’t supported: that build can’t parse version 2, so re-pinned runs get DEFINITION_UNAVAILABLE until you roll forward. 0.6.1 is unaffected. The same short window applies during a deploy overlap (documented in docs/operations/pipeline-definitions.md) Claude assumed
D-0.7.0-42 Agents with no stage of their own bind through an agents: list on an existing stage: each entry is { key, job_type, prompt?, inputs, output?, tools }, and keys are unique across the pipeline. code_generator and build_fix go on execution, repository_analyst on refinement. Stages, transitions and the stepper are unchanged; AgentStageRequest names the agent (default: the stage’s primary agent). It is additive to §4.49 and lands with the FR-321 hash bump Ben (2026-11-21) agreed
D-0.7.0-43 FR-319 is built as written: the SDLC’s code-stage work (the execution step loop with commits and pushes, and the build check) runs as IStageHandlers named by handler: on the stage, and the engine dispatches them. The jobs and their queueing, the step and commit events and the run timeline stay exactly as in 0.6.1 (snapshots frozen). If that proves impossible, the build stops for Ben. Shape: a handlers: [<pack>.<name>] list on a stage (like agents:, D-0.7.0-42). It never changes the stage’s kind, handler names are unique across the pipeline, an unregistered entry is DEF_UNKNOWN_HANDLER, and the list is left out of the canonical JSON when empty. The SDLC’s execution stage declares handlers: [sdlc.execution, sdlc.build-check] and stays a manual stage, so the definitions API data is unchanged. The engine’s StageHandlerRunner resolves a handler by name from the pinned definition. The job handlers stay the entry points, so queueing is unchanged. Runs on a definition that doesn’t declare the handler call the SDLC handler directly Ben (2026-11-22) agreed
D-0.7.0-44 FR-314 is built as written: every SDLC output check is a validate: guard in the definition, not only plan validation. That covers spec sections, stack profile, review parse and requirement, refinement parse, repository-analysis sections, and the build-fix plan. Each keeps 0.6.1’s attempt count, retry wording and final code. Together with D-0.7.0-43 this is definition version 3, one hash bump. The start-up re-pin moves non-final runs from v1 and v2 to v3 Ben (2026-11-22) agreed
D-0.7.0-45 The CLI is retired in 0.7.0. The snapshot is the docs page plus commit e8c3990 (current main when the CLI was removed), with no tag and no source copy in the repo. API tokens are kept Ben (2026-11-22) agreed
D-0.7.0-46 Q1: the engine keeps the PolyForm Shield licence for now. Revisit when its packages are published Ben (2026-11-22) agreed
D-0.7.0-47 Q2: stored agent-run inputs keep the 1 MB cap Ben (2026-11-22) agreed
D-0.7.0-48 Q4: JsonSchema.Net stays pinned at 8.0.5, the last MIT release. Don’t upgrade to 9.x (commercial OSMF EULA) Ben (2026-11-22) agreed

11. Open questions

ID Question Who Blocks
Q1 Should the engine keep PolyForm Shield or get a more permissive licence when its packages are published? Ben resolved: keep it for now (D-0.7.0-46)
Q2 Is 1 MB per agent run the right cap for stored inputs, given execution prompts with large repo context? Ben resolved: keep 1 MB (D-0.7.0-47)
Q3 Should the gate inbox replace the Home dashboard’s pending-gates card, or sit beside it? Default: beside it Ben nothing (default applies)
Q4 JsonSchema.Net is pinned at 8.0.5, the last MIT release, because 9.x uses the commercial OSMF EULA (D-0.7.0-26). Stay on 8.x, accept the EULA, or switch libraries? Ben resolved: stay on 8.0.5, MIT (D-0.7.0-48)

12. Milestones

  1. M54 Version and characterisation (FR-260, FR-261, FR-309 bump): version sources to 0.7.0, the §4.58 scenarios and committed snapshots, the snapshot-freeze CI step.
  2. M55 Engine projects and the lift (after M54; FR-262–FR-268): new projects, architecture tests, namespace moves only. Snapshots unchanged.
  3. M56 String keys (after M55; FR-269–FR-274): keys and SDLC constants, trigger strings, the 0.6.1-rows integration test, contract and client regenerated if schemas change. Snapshots unchanged.
  4. M57 Definitions and packs (after M56; FR-275–FR-286, FR-290): model, loader, validator with every §4.49 row as a test, hashing (§4.50), pack registry and extension points, sdlc.pipeline.yaml and SDLC guards, readiness check, fixture definitions in Tevrin.Engine.Tests.
  5. M58 Generic state machine (after M57; FR-287–FR-289, FR-291–FR-294): PipelineStateMachine, definition-driven cascade, pipeline_runs and the backfill migration, parity mode and the §4.56 parity test, switch-over, then removal of the old machine with the transition tests rewritten. Snapshots unchanged.
  6. M59 Stage execution and run logging (after M58; FR-295–FR-298): AgentStageRunner, context providers and tools, validate/retry (§4.55), stage_executions, agent run input and latency, cost totals, prompt stats. Snapshots unchanged.
  7. M60 Generic API (after M59; FR-299–FR-303): endpoints, hub events, contract and client regenerated, integration tests including approving a gate through both routes.
  8. M61 Engine UI (after M60; FR-304–FR-308): src/engine/ and its lint boundary, Pipeline tab, replay, gate inbox, prompt comparison, definition-driven stepper, MSW fixture-definition tests.
  9. M62 SDLC on the engine runner (after M61; FR-310–FR-321; branch build/tevrin-0.7.0-sdlc-engine, second build PR). Snapshots and golden prompt files are unchanged at every commit.
    • M62a Hooks (FR-310–FR-316): engine hooks with fixture-pipeline tests in Tevrin.Engine.Tests, and SDLC hook implementations with no caller yet. Includes the §4.60 order test.
    • M62b Context and tools (FR-317): SDLC context providers and tools; prompts rendered through them match the golden files.
    • M62c Document agents (FR-318): the five agents with a stage, one commit each, in §4.61 order.
    • M62d Bound agents (FR-319, FR-321, D-0.7.0-42): engine agents: bindings, engine tool session, definition v2 and the re-pin, then repository_analyst, build_fix and code_generator.
    • M62e Removal (FR-320): delete the old runner, add the architecture test, update the docs guide and CLAUDE.md.
    • M62f Stage handlers and guards (FR-319, FR-314, D-0.7.0-43/-44): engine dispatch of handler: stages, SDLC execution and build-check handlers, validate: guards for every SDLC output check, definition v3, and a re-pin of v1 and v2.
  10. M63 Retire the CLI (FR-322; branch build/tevrin-0.7.0-remove-cli, third build PR): remove the projects, tests, CI steps, docs and marketing references, and add the Retired CLI docs page.
  11. M64 Release 0.7.0 (after M63, on Ben’s confirmation): changelog date, docs guide “Pipelines and packs”, docs/history/0.7.0.md, SPEC and PROGRESS to docs/0.7.0/, CLAUDE.md row and layout. Manual checks for Ben: a full SDLC project on preview behaves as on 0.6.1 (strict and advisory), an existing 0.6.1 project mid-review continues after the deploy, the Pipeline tab and replay on a real run, the gate inbox, and the Docker Desktop redeploy and smoke test.