DevTeam Agentic

Follow a mobile feature from a Jira ticket to reviewed code on a story branch. Learn where a person decides, where an agent works, and where to look when progress stops.

Based on the v0.5.0 onboarding and coding-pattern photos and the iOS PR snapshot from November 25, 2026.

Start here

DevTeam Agentic is a Python desktop app for running a supervised software-delivery workflow. A person creates a story from an idea or Jira ticket. Agent roles prepare the spec, design and plan, then implement, review and test the change. The app records each attempt and pauses for decisions. The onboarding names Orbit as the local repo folder and devteam as the package and launch command name.

  1. Create a storyChoose platform, repos and inputs.
  2. Review the planApprove requirements, design, architecture and docs.
  3. Build the changeAgents commit phases, review code and run QA.
  4. Decide at Gate 5The story can finish on its story branch.
Each approval before Gate 5 makes the next stage ready. Resume starts the next stretch of agent work.
  1. Orientation. Read the story walkthrough and explain what changes when someone approves a gate.
  2. Triage and review. Use the recovery table and iOS PR case to explain a stop and request the right evidence.
  3. Coding and testing. Trace the code paths, then draft a scoped patch and test plan in the change lab.

technical reference · 12 coding modules

Follow a story through all 14 stages

Fictional case. A ticket asks for an offline retry button on the Android trip screen. Create story AND-901, choose the target app repo and base branch, and add a code reference and a Figma link if available. StoryCreator checks the Git inputs and creates the story and related rows. The resulting story is READY at Product discovery.

Press Resume. The workflow engine selects the role, pins the config revision and model, checks prerequisites, and records a run. The supervisor launches it after commit. Agent stages can chain to the next agent stage within the same Resume until the engine reaches a gate or needs input.

Documented stage order with the evidence to look for
StageOwnerOutput or decision
1. Product discoveryPO agentFeature specification (spec.md). May ask a blocking clarification question.
2. Requirements reviewHuman · Gate 1Approve the requirements revision or request changes from discovery.
3. UX designUX Scout and platform UX builderDesign asset catalog, screen design and design token set. The scout reads the Figma material.
4. UX reviewHuman · Gate 2Review the UX deliverables. The documented Skip UX path applies when there is no Figma design.
5. ArchitectureArchitectArchitecture plan, feature data model and interface contract.
6. Architecture reviewHuman · Gate 3Review the architecture revisions and return actionable notes if changes are needed.
7. Technical planningTech leadTask plan (tasks.md) and test case plan.
8. Spec auditSpec auditorAutomated specification audit report.
9. Documentation reviewHuman · Gate 4Review the plan, tasks and audit together before implementation.
10. ImplementationAndroid or iOS developer agentPhase commits on story/AND-901, phase checkpoints and an implementation report.
11. Code reviewTech lead or iOS code reviewerReview report with APPROVED or CHANGES_REQUESTED. The snapshot shows up to two review loopbacks to implementation.
12. QAPlatform QA agentQA report with PASS or FAILED and test evidence.
13. Final approvalHuman · Gate 5Review the latest revisions and final evidence. Approval finishes the story.
14. DoneTerminal stateFINISHED. The guide describes optional cleanup of clean worktrees, with story branches retained.

When you approve

The engine checks that the open decision request still scopes the revisions you reviewed. Approved artifacts become ACTIVE and older approved revisions can become SUPERSEDED. At an intermediate gate the next stage becomes READY. Press Resume when ready for it to start.

When evidence needs work

Request changes records a reason and required changes, then leads back to the producer stage. Resume lets the agent create a new revision. A discovery clarification follows its own decision path and feeds your answer back into discovery.

Check your understanding of Gate 1

The retry spec says “retry on failure” but omits what should happen while the network is still offline. Request changes with a concrete acceptance criterion. On Resume, compare the resulting spec revision to your correction before deciding. After approval, the next stage is ready for another Resume.

stage prompts, budgets and scope · agent-run contract

Read the code in the order it runs

Start with src/devteam/app.py and di.py. The uv run devteam entry point boots Flet, reads configuration, and builds the app's object graph with AppContainer.create. The container opens and migrates SQLite, wires repositories, runners and services, and gives the UI its ViewModels. Startup marks leftover running attempts as interrupted and runs the Setup gate when required.

  1. Flet viewRenders one ViewModel state and sends actions.
  2. Workflow engineValidates the action and commits state through repositories.
  3. Run supervisorSchedules the runner and consumes the stream.
  4. Runner and toolsProduce artifacts and events for the engine.
The engine persists checkpoints, artifacts and run results, then the ViewModel refreshes. The runner boundary supports either scripted or real execution.
If you want to understandRead under src/devteam/Question to answer
Startup and dependency injectionapp.py, config.py, di.pyWhere do configuration, storage, runners and services enter the app?
Story and stage vocabularydomain/models.py, domain/stages.py, domain/routing.pyWhich stage comes next, which platform role owns it, and what can change?
Approval, Resume and finalizationengine/workflow.py, engine/creation.pyWhat does one action validate and commit? When does it schedule work?
Scheduling, cancellation and worktreesengine/supervisor.py, engine/runner.py, engine/stage_router.py, engine/workspaces.pyWhich runner was selected? Which event or phase is the last durable milestone?
Agent session and policyagents/sdk_runner.py, agents/session.py, agents/tool_gate.py, agents/prompts/Which prompt, output shape and permissions did this attempt receive?
Persistence and UI feedbackdata/migrations.py, data/repositories/, ui/screens/stories/Which rows prove the outcome, and how does the screen display it?
Walk through a transaction for an approval or Resume

WorkflowEngine.perform normalizes action inputs and dispatches the action inside one transaction. Approval checks the open request and current artifact scope before saving the decision and updating the story. Nested repository operations share the outer unit of work. When an action queues a run, launch happens after the commit. A decision read-back supports the UI acknowledgement. The photographed guide calls out a distinct outcome-unknown state when that read-back fails.

Conceptual trace
ViewModel action
  → perform
    → transaction: validate scope, save decision and update state
  → commit
  → launch any queued run and acknowledge a recorded decision

Why it matters. If a decision write fails partway through, expect the transaction to roll back. Check the decision and activity views before re-submitting an outcome-unknown action.

Walk through an agent session and a checkpoint

StageRouter chooses the simulated or SDK runner. The real runner selects the platform task from TASKS or IOS_TASKS, prepares the working folder with templates and approved inputs, and opens a Claude session via MARS. The app fetches Jira input for discovery. The runner emits events such as Said, ToolDenied, PhaseDone, Usage and Finished. The supervisor consumes them, and the engine records the phase checkpoint and commit SHA. On completion the engine can adopt new drafts as IN_REVIEW revisions and advance the story.

The async generator yields between pieces of work so the supervisor can stream progress and handle cancellation. Resume consults the saved phase checkpoints. Check both the last recorded checkpoint and the worktree when investigating a crash between a commit and a recorded event.

Connect the coding patterns to concrete behavior
  • Frozen models and state unions. Pydantic models and frozen dataclasses represent snapshots. A story update creates a new value. A ViewModel uses explicit states such as loading, loaded and failed so the view can render each case.
  • Manual dependency injection, protocols and strategy. The composition root hands collaborators their dependencies. A repository Protocol describes the operations the engine needs. The runner protocol lets the supervisor work with either implementation.
  • Repository decorator and unit of work. A dev fault wrapper can simulate a failure around repository operations. SQLite persists real state, and the transaction groups all writes for an action.
  • Immutable evidence. Follow the story to stage runs, checkpoints, artifact revisions, decision requests and decisions. Activity events give a chronological trace. StoryCheckout links a story to its local Git workspace.
  • Typed failures at the boundary. Service failures carry actionable context. The engine distinguishes source problems, expected agent stops, and unexpected crashes so the UI can show a relevant recovery action.

complete source tree · startup and screens · database and evidence · transaction walkthrough

Workspaces, setup and tool permissions

A story can use multiple selected checkouts. The app prepares a separate Git worktree on its story branch for each writable repo, with reference checkouts for context. The Setup gate checks prerequisites up front. Verify your platform and the current setup instructions before attempting a real run.

Android

The app and selected libraries can be in separate repos. The prep layer creates a composite Gradle workspace, finds the SDK and a compatible JDK, and performs a build check. The agent's allowed Gradle call can be rewritten to the composite root under ToolGate policy.

iOS

The documented workflow uses one app monorepo worktree. Preparation includes Git LFS, the Ruby/Bundler and CocoaPods steps as needed, and Xcode checks. The iOS build tool wraps xcodebuild with story-specific DerivedData. The PR snapshot calls out phase commits and build verification for the developer, plus a read-only reviewer.

Trace a ToolGate denial

The first layer offers tools for the stage and role. A per-call PreToolUse check applies the pinned and current policies, with denial taking precedence. The check considers the operation, path, checkout scope and allowed command. A denial is recorded in the run's evidence. For example, a write to a reference checkout is a scope problem. Check the selected checkout and the action the role is allowed to take.

For a build failure with an allowed call, check workspace preparation and the actual build output. For a denied call, compare the event to the task specification, policy and checkout scope. Keep PR review findings focused on the policy boundary and the narrowest change that implements the intended role.

Which integration owns the evidence?
  • MARS / Claude. The corporate gateway connects the app's agent session to its model. Separate sign-in, connection, and agent execution failures.
  • Jira / Figma. The app's services bring ticket text and design inputs into the working folder. Check source visibility, sign-in and the saved Story references.
  • Git / GitHub. Check the selected base branch, checkout scope, worktree state, phase commit and build. Git history shows what changed. Stage and decision records show what the app accepted.

integration and preparation details · tool operations · setup settings

Triage a stop and review the evidence

Start with three values from Story Detail and Activity: stage, story status and most recent attempt. Then inspect the open decision request or the last durable phase, the stop reason, and the worktree or artifact revision attached to it. Use the following recovery paths as snapshot guidance.

What you seeWhat the evidence meansNext action to evaluate
WAITING_FOR_HUMANAn approval, clarification, asset selection or token conflict can have an open request.Review its kind and scoped revisions. Resolve the request through its UI action.
READY after CancelThe attempt is PAUSED. Completed phase checkpoints remain.Resume the same attempt with its pinned config. Confirm the checkpoint before resuming.
READY after startupA previously live run can be marked INTERRUPTED.Inspect the latest commit and checkpoint. Resume or follow the current Reconcile path if needed.
READY after unexpected runner crashThe engine keeps checkpoints via its crash recovery path.Inspect the exception and resume state. Confirm the run identity in the current code.
BLOCKED with source errorA required source was unreadable. The snapshot labels this F02.Restore Jira, Figma or repo access as indicated, then use Recheck source.
BLOCKED with agent stopConnection, rate limit, budget, turns or workspace/build failure may have failed the attempt. Drafts were not adopted on the documented stop path.Fix the recorded cause and use Recheck. A new attempt can follow.
BLOCKED before a run existsA required model or permission check failed before the attempt was created.Compare available model and required role operations, then recheck after authorized settings changes.
  1. Lab A · An interrupted implementation

    Fictional timeline. 09:02 implementation starts on AND-901. At 09:08, Phase 1 records commit a1b2c3d. At 09:10, the app quits while Phase 2 is running. On reopening, the story is Ready and the attempt is Interrupted. What do you collect and what action would you suggest?

    Open the worked answer

    Capture story and run IDs, platform, status, pinned config, last phase checkpoint and the current story-branch commit. Check for uncommitted or uncheckpointed Phase 2 work. If the snapshot's Resume prerequisites hold, tell the developer to expect Phase 1 to be skipped and watch for the next Phase 2 event. If workspace history conflicts with the stored checkpoint, collect the discrepancy and verify the current Reconcile flow with the owner.

  2. Lab B · Review the photographed iOS PR

    The PR description documents iOS developer and reviewer prompts, phase reporting, verification via ios_build, and an Android Gradle guidance change. Read the description and list the evidence you would require for review.

    Open the review checklist

    Verify platform routing reaches the intended roles. Review prompt, task table and ToolGate rules together. Look for each implementation phase checkpoint and commit, a build result tied to that commit, and read-only reviewer evidence and expected review report. Confirm which tests were authored, which were executed, and who runs QA. The photo shows the PR open and ready to merge at capture time. Ask for the current status and checks before relying on it.

iOS PR snapshot in text · error taxonomy and tests

Plan a change and prove it locally

With a current checkout and the owner's setup instructions, start in the documented simulated mode with an isolated data directory and local fixture repos. Make one story, run it to Gate 1, request changes, and compare the two artifact revisions. Confirm the intended runner from its events. Before running real stages, check platform dependencies, approved credentials and the working repo list.

Documented local entry points

The screenshots show uv sync and uv run devteam. They describe DEVTEAM_DATA_DIR for isolated state, DEVTEAM_SCENARIO for seeding a fresh database, and DEVTEAM_REAL_STAGES for real-run selection. Confirm environment parsing and fixture remotes in the current checkout. For a simulated exercise use the current repo's documented no-real-stages setting.

uv run pytest tests/test_workflow_engine.py -q
uv run ruff check .
uv run pyright

These are historical examples. Follow current test paths and project commands if they differ.

Lab C · Show the last completed phase when a story is paused

Fictional change request. A developer wants to know what Resume will skip from Story Detail. Add a read-only line for a paused or interrupted implementation attempt when a checkpoint exists. Use the saved phase and existing timestamp or commit evidence if the current view exposes it.

Open the proposed code path and test plan
  1. Trace the existing Story Detail load from the screen to its ViewModel state and repository reads. Compare the latest attempt selection and checkpoint ordering with engine/supervisor.py and the workflow's Resume path.
  2. Project phase evidence from the relevant attempt into the view state using the existing read path. Render the line in the paused/interrupted case. Keep completion and Resume semantics in the engine.
  3. Seed fixture stories for a paused attempt with checkpoints out of display order, an interrupted attempt with a checkpoint, an attempt without checkpoints, a newer attempt beside older evidence, and a running or finished story. Assert that the visible phase is from the correct attempt and use the existing no-data presentation for absent evidence.
  4. Exercise Cancel and Resume with the simulated runner. Confirm that the line describes the same phase the engine skips, that no extra state writes occur, and that the UI refreshes after Resume.

Review handoff. Attach a before/after screen, the fixture test results and a note about how the code selects the attempt. Check current repository and ViewModel APIs before proposing concrete edits.

Review a change by layer

Use a seeded real database graph for transaction and workflow behavior, a scripted session fake for the SDK event and output contract, and a fixed-clock ViewModel test for display. For a gate change, include stale revision scope and rollback cases. For a runner change, include cancellation, intermediate phase evidence and typed stops. For a role change, verify both the offered tool set and the per-call policy.

local run and CI commands · change recipes and capstones

Use an AI agent to support the developer

Use the current checkout or a sanitized excerpt in the workspace your team has approved. Include the affected platform, current branch or SHA, story stage and relevant events. Start with an evidence-backed explanation. Review the proposed test scope and patch before asking the agent to edit.

Diagnose a blocked or paused story

I am triaging DevTeam story [key/platform] at [stage]. Here are the story and run states, activity events, checkpoint and worktree status: [sanitized evidence]. Inspect the current workflow and recovery code. Identify the first boundary where progress stopped, distinguish story status from attempt status, and cite the file and symbol behind each conclusion. Give the next UI action or evidence to collect and explain what I should see afterward. Report any uncertainty. Work read-only.

Look for a handoff like “Ready + Interrupted after startup, Phase 1 checkpoint present, compare the worktree HEAD before Resume.”

Review a platform workflow change

Review this DevTeam diff [diff or branch]. Trace platform routing through the task table, role prompt, tool policy and artifact schema. Check phase commits, build evidence and the reviewer permission boundary. Return prioritized findings with file and line, impact and the smallest test that would prove each issue. Mark any point that needs runtime evidence. Work read-only.

Look for findings that identify the exact changed behavior, affected stage and supporting evidence.

Plan a patch

Plan a DevTeam change for [one behavior and acceptance criteria]. Trace the user-facing entry point to the ViewModel, workflow action and repository or runner. Identify the smallest implementation location, current callers and relevant invariants around transactions, revision scope, checkpointing and permissions. Return a proposed edit and a test plan with exact file and symbol references from this checkout. Work read-only.

For Lab C, a useful plan locates the existing phase read path and limits the edit to the view state and rendering.

Design regression tests

Find the closest existing DevTeam tests for [behavior]. Propose a fixture-based success case, the affected failure case and a retry or cancellation case where relevant. For each, give the setup, action and observable assertions. Reuse simulated runners, scripted SDK events and seeded repositories where available. Identify which checks require platform tooling. Return commands and expected outcomes. Work read-only.

Look for an assertion on durable state, such as “the story stays at the same gate after the transaction rolls back.”

DevTeam technical reference

The following chapters put the onboarding diagrams, tables and implementation notes into searchable text. The settings, file names and counts describe the November 2026 snapshot.

Stack and source tree

Python 3.12, uv, Flet and Pydantic v2
Python is used across the app and tests. uv sync installs locked dependencies using uv.lock. Flet, labeled 1.0.4 in the photo, uses Python components to render a Flutter desktop UI. flet build packages it for macOS, Windows and Linux. Frozen Pydantic models represent the domain.
SQLite, asyncio, HTTPX and truststore
A single database file uses WAL, foreign keys and numbered migrations. Asyncio handles background runs, streams and cancellation. HTTPX and the OS trust store handle corporate TLS and HTTPS for MARS and Figma.
Claude Agent SDK, MARS and AWS Bedrock
The SDK wheel bundles the Claude Code CLI. The app starts an isolated subprocess and talks to Bedrock through MARS with Entra sign-in.
Git, Android Gradle and iOS Xcode
Scoped Git worktrees, a composite Gradle root, and platform tools including Xcode, CocoaPods, Bundler and Git LFS. The app uses Atlassian CLI for Jira and checks gh sign-in in Setup.
Figma, Keychain and SVG conversion
Figma REST provides design frames and exports. OAuth PKCE or a personal token can be stored in macOS Keychain. svgelements supports conversion to Android VectorDrawable XML.
Ruff, Pyright, pytest, pre-commit and Actions
Lint/format, static types, tests, local hooks and CI. The snapshot lists roughly 45 test files.
src/devteam/
  app.py, config.py, di.py      entry point, DEVTEAM_* config, composition
  domain/                    pure models and rules
    models.py, stages.py      Story, StageRun, Artifact, Decision, Checkpoint, stage order
    agents.py, routing.py     role, config, operation, denial and platform role selection
    work.py, evidence.py      WorkState and data-driven pages with typed actions
    catalog.py               known platforms, repos, branches and key prefixes
  engine/
    workflow.py              perform, _advance, _start_run, finish_run, _open_gate
    supervisor.py, runner.py async supervision, AgentRunner and RunEvent
    simulated_runner.py, stage_router.py, workspaces.py
    creation.py, agent_settings.py, pages.py, ids.py, errors.py, models.py
  agents/
    sdk_runner.py, session.py, tool_gate.py
    prompts/, templates/      versioned role instructions and document templates
  services/                  git, Jira, MARS, Figma, build, setup and subprocess wrappers
  data/                      db.py, migrations.py, repositories/, seed/
  dev/                       fault injection and local fixture Git remotes
  ui/                        shell, screens, components, theme and navigation.py

The layers are Flet views, ViewModels, engine/domain, infrastructure and external systems. A stored EvidencePage carries cards, blocks and buttons. evidence_view renders them, and buttons send typed actions to perform. Fault wrappers in the Dev menu exercise the designed Figma failure states. For Android developers, Flet components resemble Compose, ViewModels and frozen state resemble StateFlow, composition resembles hand-written Hilt, migrations resemble Room, and the supervisor has a background-work responsibility like WorkManager.

Startup, navigation and screens

  1. devteam.app:run configures logging and invokes Flet with the assets directory. main(page) loads AppConfig.from_env() and sets title, typography, theme and window size. A failure can display StartupFailedScreen.
  2. AppContainer.create opens and migrates SQLite, seeds a prototype's fresh DB, creates default role configs if needed, and wires repositories, runners, workspaces, the engine and supervisor, StoryCreator, AgentSettings, MARS, Figma and Setup.
  3. Construct Navigator and Shell, screen, DevMenu and Quit ViewModels. ⌘/Ctrl + Shift + D opens the Dev menu. Alt + ← goes back. Quit asks when runs are live.
  4. interrupt_runs() marks old Running attempts Interrupted and stories Ready. Bind the supervisor to Flet's loop and listeners. shell.load() chooses Setup if the version needs checks, Get Started for a checked empty workspace, or Overview. Render with page.render(App) and schedule a background Setup check pass.

ui/navigation.py holds an observable stack of typed Route entries with parameters. navigate pushes, select resets for a sidebar destination, and back pops. The Figma frame codes use F for failure, E for empty state, S for settings and D for dialog. Theme files under ui/theme/ hold tokens, 18 documented text styles and the Material 3 theme.

Overview, Stories and New Story
Metrics, decisions waiting and story summaries. Search and filter by status. Enter story inputs and see clone progress.
Story Detail, Decisions, Artifacts and Activity
Stage tracker, evidence pages and live actions. Open/resolved/superseded requests. Artifact revision history and single revision detail. Story or global timeline.
Settings, Setup, Connection and Figma
Role models and policies, revisions and denials. Machine checks. MARS sign-in and connection tests. Figma sign-in and token settings.
Get Started, Dev Menu and errors
Empty-workspace onboarding. Prototype seed scenarios, faults and real-stage selection. Startup-failed, not-found and workspace-failed screens.

Stage prompts, budgets and decision scope

The photographed glossary lists 13 roles. Each is a Claude Code session configured with its own role instructions, selected model and tool policy. The role prompt files are versioned under agents/prompts/, based on the captured dev-team plugin (ua-marketplace 0.1.0). The app owns Jira retrieval, artifact storage and gate requests. Each stage has a role, output schema, templates and permitted operations. Read the table below with the stage and artifact table.

StagePrompt filePlaceholder turns / cost cap
1 Discoverypo_agent.md40 / $2
3 UXux_builder.md, ios_ux_builder.md30 / $2
5 Architecturearchitect.md60 / $5
7 Technical plantech_lead_planning.md60 / $4
8 Spec auditspec_auditor.md30 / $2
10 Implementationandroid_developer.md, ios_developer.md120 / $12
11 Code reviewtech_lead_code_review.md, ios_code_review.md60 / $5
12 QAqa_agent.md, ios_qa_agent.md40 / $3

The guide labels the amounts as per-attempt placeholder limits pending per-role tuning. NewStoryVM calls StoryCreator after remote and clone checks. The creation transaction inserts the story, checkouts and references, creates an Activity event, and leaves the story Ready at discovery. StoryDetailVM sends Resume to perform → _advance → _start_run. The starter selects role, model and tool configuration, pins it, and writes the Running run before the supervisor starts.

_open_gate records DecisionRequest(APPROVAL) with the scoped exact revisions and selection ID where applicable. SIS identifies an input selection set and ASC an approval proposal. A stale scope gets a specific mismatch error. Approval adopts the exact revisions. Request changes sends both the reason and required changes back to the producer. A request becomes Resolved or Superseded, with an immutable decision for a resolved request. Code review has a documented two-return cap before moving on to QA.

Agent-run inputs, files and event stream

  1. Select the stage task from TASKS or IOS_TASKS. Load MARS settings fresh. Product discovery can fetch Jira with acli and attach its reduced JSON.
  2. _prepare() puts templates, approved inputs and any rejected candidates in the per-stage working folder. Attach repo worktrees via add_dirs, references last. Build the role prompt, user context, allowed ToolGate policy and stage JSON schema.
  3. Launch claude_agent_sdk.query with isolated CLAUDE_CONFIG_DIR, MARS/Bedrock environment, Android JDK/SDK variables if needed, and the devteam MCP tools report_phase, place_asset and ios_build as applicable.
  4. Stream Said, ToolCalled, ToolDenied, PhaseDone and Usage. After a local phase commit, report_phase yields the evidence for a checkpoint with the commit SHA. Resume passes the completed phases back to the runner.
  5. Read structured results and output files, yield Finished(StageOutput), close the stream and call finish_run. The engine adopts drafts as In Review revisions and chains or waits at a gate.
<data-dir>/work/<STORY>/ARCHITECTURE/
  templates/       read-only plan-template.md, research-format.md, etc.
  inputs/          approved earlier artifacts, e.g. spec.md and ux-screens.md
    reviewed/      rejected candidates when changes were requested
  ux/              read-only design.json, tokens.json and assets/
  jira-issue.json  product-discovery input when applicable
  plan.md          an example generated artifact body
  data-model.md    an example generated artifact body
<workspace>/stories/<STORY>/
  settings.gradle                  composite root with includeBuild per repo
  .gradle/devteam-composite.gradle app-owned init script
  <AppRepo>/                       writable story branch or detached reference
  <LibraryRepo>/                   a separate selected worktree

SDK 401/403 or authentication_failed maps to Connection, 429/5xx/529 to Busy, error_max_turns to Turns, and error_max_budget_usd to Budget. A result escalation supplies the agent's own explanation. A workspace or build preparation failure blocks with Build. Unexpected crash recovery preserves checkpoints. Interrupted and paused attempts can preserve run identity and config when resuming. Reconcile is the documented resolution action for an interrupted attempt that needs it. Cleanup retains branches and removes only clean worktrees in the documented flow.

Tool operations and least privilege

artifact.read, repository.read and repository.write
Read approved artifacts or scoped repo code, and edit/commit only in writable story checkouts. Read, Glob and Grep use resolved folder scope. The stage working folder allows output and protects the supplied inputs, templates and UX evidence.
verification.run
Run approved builds and tests. The documented Gradle task families include assemble, compile, test, lint and check. The app rewrites the command with its story composite root and init script, and controls -p, --init-script, -I, -c and -g.
jira.read, figma.inspect and figma.export
Role permissions for the discovery Jira input and design inspection/export. The app fetches Jira and Figma data and stages it for agents.

The allow-list contains scoped Git operations such as status, diff, log, show, rev-parse, branch, add and commit. Push, checkout/reset, protected targets, chaining, pipelines, redirects and substitution are denied in the captured policy. Explore is the named sub-agent type and inherits per-call checks. Both pinned and current policy must allow an operation. Denials carry a reason and produce ToolDenial evidence, shown by the S21 failure design.

Integrations and Android/iOS preparation

MARS. MarsAuth.check reads the setup settings, checks TCP where useful, runs apiKeyHelper for a short-lived token, and posts a one-token Haiku request in Bedrock invocation format. Direct TCP may be skipped behind a proxy. The documented errors distinguish missing setup, signed out, unreachable and TLS. mars_signin.py requests an Entra device code, displays code and URL, polls handling authorization_pending and slow_down, and atomically writes the cache with mode 0600. MarsSettings.agent_env sets Bedrock variables and removes bundled PYTHON* env entries that would affect the helper. Tests inject the HTTP transport.

Figma. Generate verifier, S256 challenge and state, receive a browser redirect on loopback, check state and exchange code plus verifier. Save access/refresh/expiry to the DevTeam Figma Keychain entry. Use read-only current_user:read and file_content:read scopes. OAuth uses a Bearer header, while the personal token path uses X-Figma-Token. Refresh starts one day before expiry. GET /v1/files/:key/nodes inspects frames, then selected exports via GET /v1/images/:key are batched by format and scale and downloaded from signed URLs. Outputs feed UX Builder as design JSON, tokens and SVG/PNG or Android VectorDrawable assets. Tests use mock transport and fake TokenStore.

Jira and Git. Check auth and use acli jira workitem view <KEY> --fields all --json. issue_summary reduces the documented ~35 KB response to ~1 KB of title, description, acceptance criteria, links and comments, converting rich text to plain text. It feeds discovery as source content. Git checks remotes, clones with submodules and prepares separate story worktrees. It fetches the base, prunes stale registry entries and reuses an existing valid checkout under a per-clone lock. Disable interactive prompts and request predictable output. Finder's PATH can omit tools, so inspect the service's path discovery. Tests inject a CLI run function and local file:// Git remotes.

Android. One app plus up to 18 selected libraries; add a detached, read-only app reference if it was not selected and is required to compile. story_build.py writes composite settings.gradle using includeBuild and the init script. android_env.py discovers Android SDK and a suitable JDK 17+. The guide shows a first compile of :UA-App-Android:app:compileGoogleDevDebugKotlin.

iOS. Use the UA-Mobile-Customer-iOS monorepo worktree. Skip LFS smudge on add, then run git lfs pull. Use bundle install and bundle exec pod install as needed, with Pods reuse when current. ios_build runs xcodebuild with per-story DerivedData.

SQLite, schema and evidence relationships

TablesStored data
app_meta, projects, storiesScenario/setup/schema metadata, project name/platform, and story input, stage and status.
stage_runs, checkpoints, agent_configsAttempts and usage, phase and commit resume evidence, revisioned role settings.
artifacts, decision_requests, decisionsRevisions and bodies, request kind and scope, outcome and author.
activity_events, tool_denials, evidence_pagesAppend-only timeline, refused calls and stored page documents.
story_state, story_checkouts, code_references, figma_referencesWorkState JSON, scoped repos/paths and code/design refs from New Story.

The data model hub is Story. One Project can have multiple Stories. AgentConfig belongs to a role and is pinned by a StageRun. data/repositories/protocols.py declares 14 interfaces, implemented in sqlite.py. Migrations use PRAGMA user_version and back up the old file to devteam.db.v<n>.bak. A DB from a newer build can raise DatabaseTooNewError. The described macOS source location is ~/Library/Application Support/DevTeam/devteam.db, and the packaged data base is under ~/Library/Application Support/com.united.devteam.devteam/data. DEVTEAM_DATA_DIR overrides it.

Setup, configuration and quality checks

Setup requires setup_passed_at and matching setup_version. Checks cover the OS and disk (10 GB, 25 GB with iOS), bundled Claude Code, MARS, Git 2.23+ including identity and repo access, GitHub CLI, Jira CLI auth and Figma. Android checks the JDK 17+ and SDK. iOS checks Xcode license, selection and simulator runtime, Git LFS and Ruby/Bundler (Ruby 3.3+ in the snapshot). services/setup/fixes.py describes OS-specific repair steps. Settings can reopen Setup and the app shows an attention banner on later launches when needed.

DEVTEAM_PROTOTYPE, DEVTEAM_DATA_DIR, DEVTEAM_SCENARIO
Prototype mode shows the sample-data badge, Dev menu and Setup bypass. The data-dir override isolates DB, work and Claude config. Seed scenarios are first_run, sample, alternate and just_created.
DEVTEAM_USER_NAME, DEVTEAM_USER_ROLE, DEVTEAM_GIT_REMOTE
Override OS full name, the Engineering Lead role and the app's remote Git template.
DEVTEAM_RUN_STEP, DEVTEAM_REAL_STAGES, DEVTEAM_SKIP_SETUP
0.4 seconds between simulated events by default. Unset real stages use the Dev selection or capable stage defaults, a comma-separated list selects, and a POSIX empty value simulates them all. Setup bypass is a development-only option.
Figma environment
DEVTEAM_FIGMA_CLIENT_ID, DEVTEAM_FIGMA_CLIENT_SECRET and DEVTEAM_FIGMA_REDIRECT_URI override figma-oauth.toml. FIGMA_ACCESS_TOKEN is the documented dev fallback.
uv sync
uv run pre-commit install
uv run ruff check .
uv run ruff format --check .
uv run pyright
uv run pytest -q
# The live marker is on-demand in an approved MARS environment.
uv run pytest -m live
# Scratch simulation documented for POSIX shells.
DEVTEAM_DATA_DIR=/tmp/devteam-play DEVTEAM_SCENARIO=sample DEVTEAM_REAL_STAGES= uv run devteam

Tests use migrated in-memory DB fixtures and local fake remotes with a documented 60-second timeout. CI runs lint, types and tests on macOS, Windows and Ubuntu, builds with Flet per OS, keeps zip artifacts 14 days in the screenshot, and sends a Teams card. scripts/build_macos.py builds locally, scripts/screenshot_tour.py renders Figma frames to PNG, and scripts/make_icon.py builds icons.

Milestones, docs and iOS pull request

  1. V1, M0–M5. Foundations, SQLite and seeds. Read-only screens. WorkflowEngine and simulated gates. New Story and clone checks. Revisioned role settings. Three-OS builds and database survival across upgrades.
  2. V2, M6–M11. MARS connection and SDK spike. Supervisor, live progress, cancellation and interruption. Real discovery using Jira. Architect, planning and audit stages. Real implementation, review and QA. Figma scout and builder integration.
  3. V3–V4, M12–M14. Setup tests and OS-specific fixes, then iOS story catalog, monorepo, LFS and Pods, iOS UX/Dev/Review/QA roles and ios_build.
  4. V5, M15–M16. Figma PKCE or token in Keychain, REST replacing Figma MCP, per-story worktrees and composite Gradle, Settings Setup, and Android JDK/SDK handling. The captured branch was closing iOS workspace and plan-v5 gaps.

Docs under docs/ include plan.md (v1 and design decisions D1–D4), plan-v2.md and handoff-v2.md (real agents and source launch), plan-v3.md (Setup), plan-v4.md (iOS), plan-v5.md (Figma and workspaces), and install.md (builds, first launch, OAuth config and upgrades).

The UA-Mobile-AgenticSuite M15–M16 PR is shown open against a development branch, with 13 commits, 58 changed files, zero checks in the tab count and a Ready to merge banner. The visible description adds iOS role prompts and required outcomes. The developer works phase by phase, commits locally, checkpoints through report_phase, uses ios_build, and writes tests for separate execution. The reviewer follows read-only Swift/iOS rules, categorizes findings, runs build verification through ios_build and writes code-review.md. The Android change documents <root>/gradlew for the story workspace. The photo cuts off the rest of the description.

First-week reading path. Start at app.py, then di.py, the stage table and domain models, engine/workflow.py, supervisor/runner/router, one SDK task and role prompt, ToolGate, a Stories view and ViewModel, and the workflow tests. Use scratch sample data, run a story to Gate 1 and through Done, trigger a signed-out fault, and inspect a single approval in the debugger.

DevTeam coding course

Work through the modules in order at roughly two per day. The captured estimates for M1–M12 are 45, 60, 40, 50, 50, 70, 50, 80, 60, 90 and 60 minutes, then half a day for the capstone. Familiarize yourself with the concepts, trace the named file in the current checkout, and try the small lab against scratch data. Begin with uv sync and a passing uv run pytest -q. The code below illustrates the photographed behavior and trimmed excerpts. Use the current code for exact signatures.

M1. Python idioms used in the codebase

Reading path. domain/models.py, engine/runner.py, engine/supervisor.py, ui/screens/stories/viewmodel.py. ConfigDict(frozen=True) protects Pydantic values. Lighter events and UI states use @dataclass(frozen=True) and tuples. Copy with model_copy(update=...) for Pydantic or dataclasses.replace for dataclasses. Typed enums catch misspelled stage/status names in static analysis. StrEnum can also carry a display or database value and implement behavior such as StoryFilter.matches; compare the enum members by identity.

running = story.model_copy(update={"status": StoryStatus.RUNNING})
RunEvent = Said | ToolCalled | ToolDenied | PhaseDone | Usage | Finished
StoriesState = Loading | LoadFailed | StoriesLoaded

match event:
    case Said(text=text):
        line = text
    case ToolCalled(tool=tool, summary=summary):
        line = f"{tool}: {summary}"
    case PhaseDone(phase=phase):
        line = f"Phase {phase.phase} checkpointed"
    case Usage(input_tokens=used_in, output_tokens=used_out):
        progress = replace(progress, tokens=used_in + used_out)

Unions encode one state shape at a time, and match both recognizes the case and extracts its fields. Protocol expresses a behavioral interface without mandatory inheritance. An async generator yields incremental events and awaits between them.

Lab 1 and self-check

Open uv run python, inspect Story.model_fields, construct a Project using the current schema, and compare rejected direct assignment with model_copy. A frozen attribute containing a list would still have mutable contents, so use a tuple. When adding a new event, review each consumer, especially any fallback case that would otherwise silently ignore it.

M2. Architecture, manual dependency injection and strategy

AppContainer.create(config, in_memory=...) builds database → wrapped repositories → simulated and SDK runners → StageRouter → WorkflowEngine → RunSupervisor. Tests use the same graph with in-memory SQLite. The router itself satisfies AgentRunner, dispatching run_stage(StageRequest) to the real or fake strategy and providing design inspection and export methods. The engine depends on this contract, so bringing real agents online did not require a fresh UI architecture.

# Teaching excerpt from the runner boundary
class AgentRunner(Protocol):
    def run_stage(self, request: StageRequest) -> AsyncGenerator[RunEvent]: ...
    def inspect_design(self, story: Story) -> DesignInspection: ...
    def export_all(self, story, exports, stopped=None) -> tuple[ExportResult, ...]: ...

workspaces.bind(engine.record_workspace) registers a callback after creating the engine, and the supervisor registers its start callback through engine.attach. Late binding breaks the construction cycle. The composition function is longer, but Pyright can check each constructor and tests can replace dependencies passed into it.

Lab 2 and self-check

Draw the four boxes for engine, supervisor, stages and workspaces, including callbacks. Run simulated stages and inspect the router's selection with a breakpoint or temporary print, then remove it. A Protocol lets either runner provide the same methods. Removing the workspace callback disconnects workspace evidence from the engine. Verify the callback's actual effects in the current code.

M3. Repositories, decorators and fault injection

StoryRepository offers list/get/add/update methods. ArtifactRepository reads a body, inserts an artifact and body, and updates revision metadata. There is no general body-update API. data/repositories/sqlite.py implements the storage side. This supports decision D1's local-first architecture and the possibility of a later shared repository.

# Interface excerpt. update_artifact applies revision metadata.
class StoryRepository(Protocol):
    def list_stories(self, project_id: str) -> list[Story]: ...
    def get_story(self, story_id: str) -> Story | None: ...
    def add_story(self, story: Story) -> None: ...
    def update_story(self, story: Story) -> None: ...

class ArtifactRepository(Protocol):
    def read_body(self, artifact_id: str) -> str: ...
    def add_artifact(self, artifact: Artifact, body: str) -> None: ...
    def update_artifact(self, artifact: Artifact) -> None: ...

FaultyStoryRepository wraps a real repository and checks the process-wide FaultInjector before selected delegates. F01 WORKSPACE_LOAD_FAILED can turn a stories read into a designed error while the shell still renders. F11 STORY_NOT_CREATED rejects a write so the creator's transaction rolls back. The injector is observable, changes its frozenset by reassignment and clears armed faults on restart. The wrapper matches the existing Protocol and delegates normally when no fault is active.

Lab 3 and self-check

Run the sample scenario against scratch data, arm F01 in the Dev menu, and inspect Overview and its Retry action. Follow LoadFailed to WorkspaceFailedScreen in the Stories view. Arm F11 and verify that a failed story creation leaves no story record. The wrappers make fault paths testable in the same object graph as regular behavior.

M4. Transactions and the single writer

data/db.py uses a re-entrant lock because one connection is shared across threads and Flet can run sync handlers on workers. Nested transaction() calls increase depth and reuse the outer connection. Only the outer block issues BEGIN and COMMIT or ROLLBACK. Catching BaseException also handles cancellation. Cleanup resets the depth.

# Teaching sketch of the ordering in WorkflowEngine.perform()
form = {name: value.strip() for name, value in inputs.items()}
with db.transaction():
    result = dispatch(action, form)  # validation and all durable writes
for ticket in queued_runs:
    launch(ticket)                  # happens only after commit
if result.decided:
    read_back_saved_decision(result.decided)
return result.link

_dispatch matches ActionKind to approval, correction, Resume and other handlers. A direct ViewModel repository update would skip engine validation. A failed decision save maps to F04. If the write has an uncertain read-back outcome, F05 communicates the uncertainty. Opening network calls or builds inside the transaction would hold the write lock.

Lab 4 and self-check

Read test_a_changed_scope_is_rejected_and_nothing_is_written in tests/test_workflow_engine.py and run uv run pytest tests/test_workflow_engine.py -k changed_scope -v. In a scratch checkout, simulate a failing write at the end of approval and verify the stage, scope and decision remain consistent. Read the test diff before reverting your lab change. Launching a run before commit could leave an agent working against a state that rolled back.

M5. Immutable evidence, optimistic concurrency and state machines

STAGES is a Stage → StageInfo table with order, names and gate metadata; _next_stage walks it and skips omitted stages. Task tables and platform routing follow the same idea. An architecture plan might have r1/r2 superseded, r3 active and r4 in review. The request scopes the exact artifact revision IDs. _check_current can reject stale actions with ScopeMismatchError, leaving the decision log and story untouched. This is optimistic concurrency, like an ETag or version column.

Selection, approval and validity describe different facts about a revision. StageRun stores config_revision and model. Paused attempts reuse the pinned revision, while ToolGate still observes stricter current grants. Settings changes use revision checks such as base_revision in the pattern notes.

Lab 5 and self-check

Open a sample story with multiple architecture revisions, such as AND-024 in the pictured seed. Use Request changes with both required fields, Resume with the fake architect, and inspect the new revision and superseded candidates. Try to explain which revision ID the open gate asks you to approve and how that differs from a merely selected input.

M6. Async event streams, safe cancellation and cleanup

engine/simulated_runner.py yields one RunEvent at a time and may raise a typed stop. Implementation iterates phases, skips request.completed_phases, and yields a PhaseDone(PhaseResult(...)) after a phase. RunSupervisor runs one task per story and uses Semaphore(3) app-wide. An extra run waits for a slot and can be cancelled there.

# Teaching sketch of one attempt
async with aclosing(runner.run_stage(ticket.request)) as events:
    async for event in events:
        if isinstance(event, Finished):
            output = event.output
            break
        if isinstance(event, PhaseDone):
            engine.record_phase(ticket, event.phase)
        elif isinstance(event, Usage):
            engine.record_usage(ticket, event)
        record_live_progress(ticket.story_id, event)
# Handle a missing Finished as an unexpected runner error.
# Adopt output after generator closure; finish_run can return the next ticket.

Each checkpoint callback commits independently. Expected source errors map to fail_run, typed agent stops to stop_run, and unexpected exceptions to crash_run. Live progress can remain in memory. Cancel calls task.cancel(), lands at the next await, closes the generator and exits the subprocess before the pause callback marks the run. Adopting output after closure keeps cancellation from half-adopting it. loop.call_soon_threadsafe bridges Flet worker threads to the event loop captured by bind, along with the app's context variables.

services/tools.py uses asyncio.create_subprocess_exec, closed stdin and captured stdout/stderr, with asyncio.wait_for around communication. On POSIX, a new process group lets cleanup kill helpers that still hold pipes. The caller chooses the timeout. Move blocking Figma work to asyncio.to_thread; keep it and workspace prep outside the DB transaction.

Lab 6 and self-check

Set DEVTEAM_RUN_STEP=2 with a simulated implementation. Cancel after Phase 2 checkpoints. Verify the attempt is Paused and Resume reaches Phase 3. Read test_resume_never_repeats_a_completed_phase. Try quitting mid-run in the scratch instance, then confirm the startup Interrupt path. The semaphore limits simultaneous work, while aclosing handles resource lifetime.

M7. Observable ViewModels, component state and navigation

A Stories ViewModel takes repository and clock dependencies as private fields and exposes one public state. Assigning a fresh snapshot notifies observers. refresh is a supervisor listener and reloads the last displayed project after a run commit. A fixed clock gives deterministic “5 minutes ago” labels. The view calls ft.use_effect with project.id and revision dependencies, then matches load failure, loaded with zero matching results, and ordinary loaded states.

# Simplified view shape
@ft.component
def StoriesScreen(vm, project, revision):
    ft.use_effect(lambda: vm.load(project.id), [project.id, revision])
    match vm.state:
        case Loading():
            return Spinner()
        case LoadFailed(detail=detail):
            return failure_screen(detail, retry=lambda: vm.load(project.id))
        case StoriesLoaded() as state if state.no_results:
            return empty_results_screen(state)
        case StoriesLoaded() as state:
            return stories_screen_content(state)

Navigator starts at Overview. It ignores a repeated identical current destination, uses sorted route params and replaces the tuple when navigating. Route.param("story") reads a detail parameter. Plain Python navigation allows tests in tests/test_navigation.py without a desktop window.

Lab 7 and self-check

Add a temporary Running filter to StoryFilter and the view chips. Verify the seed filter with tests/test_screen_view_models.py, then type-check and run tests. A revision argument can force use_effect to reload when the selected project ID stays the same but its data needs a fresh load.

M8. Claude Agent SDK and structured output

SdkSession.query wraps the only direct call to claude_agent_sdk.query. The session options include system_prompt, model, cwd, add_dirs, tools, can_use_tool, hooks, per-stage schema and limits, env and app-owned MCP tools. The depicted configuration uses default permission mode, setting_sources=[] and strict MCP config. Model family comes from the pinned role config and maps to a MARS model ID. Claude user settings, memory, personal instructions and extra MCP servers are isolated from the stage.

# Selected options from the photographed construction
ClaudeAgentOptions(
    system_prompt=spec.system_prompt,
    model=spec.model,
    cwd=spec.cwd,
    add_dirs=list(spec.add_dirs),
    tools=list(spec.tools),
    can_use_tool=spec.can_use_tool,
    hooks={"PreToolUse": [HookMatcher(hooks=[_gate_hook(spec.can_use_tool)])]},
    output_format={"type": "json_schema", "schema": dict(spec.output_schema)},
    max_turns=spec.max_turns,
    max_budget_usd=spec.max_budget_usd,
    env=dict(spec.env),
    settings=spec.settings,
    setting_sources=[],
    strict_mcp_config=True,
    mcp_servers=dict(spec.mcp_servers or {}),
)

The PreToolUse interceptor calls the app's permission function before every call, including reads and sub-agent calls. It returns allow, allow with updatedInput, or deny with a reason. The discovery schema includes checklist, escalation and question fields. Its checklist is validated against the stage's spec checklist. task_for(stage, platform) chooses overrides for iOS design, implementation, code review and QA, keeping preparation and parsing shared.

Lab 8 and self-check

For an approved real-stage exercise, first pass the MARS connection check. Enable only PRODUCT_DISCOVERY, use scratch data, and create a story from an idea. Watch live events, inspect the Stage folder's templates and spec.md, and compare cost, tokens, turns and pinned config in attempt evidence. With no MARS access, trace the same contract using FakeSession in tests/test_sdk_runner.py. The hook matters because the SDK can auto-approve some calls outside the ordinary permission callback.

M9. ToolGate tests and command rewriting

tools() begins with the read and stage-native tools and adds operation-mapped SDK tools only where role grants and stage operations overlap. It de-duplicates while preserving order. check(...) dispatches the call to one of its read, write, command or sub-agent handlers. Resolve absolute paths and symlinks before checking containment, including the fixed prefix of a Glob pattern. Return a reason on refusal so the agent can correct course.

After accepting an Android build task, the gate reconstructs the invocation with an explicit -p story composite root and --init-script app script. The course illustrates using shlex.quote when reconstructing that string, preferring argv for subprocess APIs, and passing secrets to the Keychain CLI via stdin. Protected branches are checked in both GitService.add_worktree and the tool policy. Use the approved build and repository methods when inspecting a denied action.

Lab 9 and self-check

Find the ToolGate tests. Compare an allowed scoped Git status and Gradle task with fixtures representing an out-of-scope path, non-approved command composition, a protected write, and a Glob that leaves the working folder. Assert the returned denial reason. An allow-list limits what must be reviewed to a small, explicit set of commands and options.

M10. External APIs and CLIs

Each service maps a lower-level HTTP or subprocess failure to a typed XxxError(Problem.KIND, detail). The display layer chooses a screen and corrective action. Inject httpx transport for HTTP tests, a run callable for CLI tests, and a fake token store or local repo for system boundaries. MARS is asynchronous. Figma inspection/export and synchronous credential refresh can run in a worker under a per-story lock; async consumers use asyncio.to_thread.

The Figma teaching excerpt uses base64url(SHA256(verifier)) without padding for the S256 challenge, sends response_type=code and code_challenge_method=S256, and verifies state on the callback. The code exchange uses grant_type=authorization_code with code, verifier and redirect URI. The frozen credential models form FigmaCredential = Personal | OAuth; the OAuth shape also stores expiry in epoch milliseconds.

Lab 10 and self-check
  1. Use the MARS test-connection screen if authorized and read mocked problem cases in tests/test_mars.py.
  2. Compare recorded acli issue JSON before and after issue_summary. Look at how rich text is reduced to the acceptance context the model needs.
  3. Trace Figma's /v1/me connection check with a mock transport and compare PAT and OAuth header construction.
  4. In a scratch repo, create and list a branch worktree. Compare it to GitService.add_worktree's guard, lock, LFS handling and idempotent reuse.

field(repr=False) keeps credentials out of a dataclass's normal representation. Keep sensitive fields out of explicit log messages too.

M11. Task failures, fixtures and behavior tests

Engine actions
WorkflowError, ValidationError, RequestNotOpenError, ScopeMismatchError, DecisionSaveFailedError (F04), DecisionOutcomeUnknownError (F05). Some carry an EvidencePage.
Run attempts
SourceUnavailableError gives Blocked/Recheck source, AgentStoppedError gives Blocked/Recheck agent, and unexpected errors use crash_run and Ready/Resume.
Service and startup exceptions
MarsError, FigmaError, JiraError and GitError hold a problem enum and detail. DatabaseTooNewError maps to the startup screen. Catch known errors where their specific fix is actionable.

tests/conftest.py creates a migrated memory database per test. seeded_db loads Scenario.SAMPLE, and container calls production composition with in_memory=True. FakeSession records the session spec and gate answers, yields scripted SDK messages, can raise a scripted error or ask the permission function, and records whether it closed. Test the actual engine, repository SQL, migrations and wiring while faking network/process/model boundaries.

# Fixture lifecycle in the coding lesson
@pytest.fixture
def db():
    database = Database(MEMORY)
    database.migrate()
    yield database
    database.close()

@pytest.fixture
def seeded_db(db):
    SeedLoader(db).load(Scenario.SAMPLE)
    return db

@pytest.fixture
def container(config):
    app = AppContainer.create(config, in_memory=True)
    yield app
    app.db.close()

Workflow behavior tests cover approving exact revisions, refusing a superseded request, capping review rounds before QA, skipping completed phases on Resume, and requiring appropriate reconciliation for an interrupted attempt. Async tests use pytest asyncio configuration and can await supervisor idle() to synchronize. Live model tests are opt-in.

Lab 11 and self-check

Read the existing test for both Request changes fields. Add a scratch case with a field containing only whitespace. Because perform strips inputs, expect the same validation result as a missing value. Assert no unexpected state or decision writes, then run the targeted case, full suite and Pyright.

M12. Change recipes and capstone labs

  1. New screen. Add a private-dependency ViewModel with a state union and a Flet component that loads and matches the state. Add Destination and _NAV_PARENT where applicable, wire the ViewModel in ui/shell/screen_models.py and render through the shell content function. Use strings and theme tokens. Test with a seed and fixed clock.
  2. New Setup check. Add CheckId and a check returning CheckResult in services/setup/checks.py. Use a timed tool call, handle missing tools, add OS-specific fixes in setup/fixes.py, register for the correct platforms, and test in tests/test_setup.py.
  3. Approved role capability change. Review the stage operations, default role policy, SDK tool mapping, per-call validation and role prompt as one change. Test allowed scope and denied out-of-scope calls. Preserve default-deny behavior.
  4. New integration. Define a typed problem enum and error under services/. Inject transport or CLI runner, add explicit timeouts and OS certificate validation, and wire in di.py. Keep credentials out of logs and argv. Fetch agent inputs in the app and stage them in the work folder. Add a Setup check if configuration is required.
Capstones and code-reading checks
  1. Simulated journey. Use an empty real-stage list and a scratch data directory. Create an Android story, approve Gates 1–3, request changes at Gate 4, then Resume. During implementation cancel after the first checkpoint and Resume. Use the signed-out fault to cause Blocked, clear it and Recheck. Finish at Gate 5 and map Activity events to engine handlers.
  2. Real architecture run. With approved MARS and repo access, enable only ARCHITECTURE, use a scratch story, and reach architecture after the relevant gates. Watch workspace prep where applicable. Compare the emitted plan.md with the architect prompt and plan template and explain any ToolDenials. The setup text describes preparing real code workspaces; verify which stage actually triggers preparation in the branch you run.
  3. Read before running. Find the review loop via REVIEW_ROUNDS, platform role selection via domain/routing.py, clean-only removal in workspace/Git services, and the dev-only Setup flag in config.py and the gate. Trace the relevant test for the distinction between a new iOS role selection and an already-pinned attempt.

The capstone answer panel was closed in the photo. These code-reading pointers follow the visible symptoms and file map.

Pattern cheat sheet

PatternWherePractical use
Layered MVVM and composition rootui/, engine, data, di.pyObservable state and inward dependencies with one manual wiring graph. Compose/ViewModel and Hilt analogies.
Repository, decorator and strategyRepository Protocols, dev/faulty_*.py, AgentRunner, StageRouterHide SQL, inject designed faults, and switch between fake and real agents. Room DAO and interceptor analogies.
Unit of work and single writerdb.transaction, WorkflowEngine.performKeep writes atomic and rules in one engine. Similar to a use-case boundary and withTransaction.
Value objects and tagged unionsdomain/models.py, RunEvent, screen statesShare snapshots safely and match each state/event explicitly. Kotlin data classes and sealed interface analogy.
Append-only revisions and optimistic concurrencyArtifacts, decisions, Activity, decision scope and base_revisionAudit what happened and reject stale approvals or edits. ETag/version analogy.
Table-driven configuration and async supervisionSTAGES, TASKS, routing, runner and supervisorKeep stage behavior data-driven and consume background work with cancellation. Flow/WorkManager analogy.
Interceptor and typed failurePreToolUse, ToolGate, service problem enumsEnforce call scope and show a precise repair action. Permission and sealed-result analogies.
Test seam and data-driven UITransport, run callable, FakeSession, clock, EvidencePageDeterministic tests and reusable rendering for pages with typed actions. MockWebServer and server-driven UI analogies.

Glossary and coverage

Story / stage / status
A story is a unit of feature work. Its stage identifies the current step and its status describes readiness, activity or completion.
Stage run / checkpoint
One agent attempt with a pinned model and configuration. A checkpoint records a finished phase and supports Resume.
Artifact / decision request
An output revision, such as a spec or review. A request is the open item for a person to resolve, often tied to exact revisions.
Worktree / reference checkout
A separate Git working directory for a story branch. A reference checkout gives the run code context with read-only scope.
MVVM / dependency injection
Views display ViewModel state and forward actions. The composition root provides the collaborators each layer needs.
ToolGate / MARS
ToolGate checks stage, role and call permissions. MARS is the organization gateway used to reach the model.
Scope / SIS / ASC
Scope is the exact revision and any selection ID under decision. SIS identifies an input selection set. ASC identifies an approval proposal.
Correction / WorkState
A correction records Request changes feedback. WorkState is the story's working JSON for selections, design exports, conflicts and stops.
Runner / StageRouter / RunSupervisor
A runner produces the work and events. The router selects the strategy and prepares workspaces when needed. The supervisor schedules, streams and cancels tasks.
ToolDenial / EvidencePage
A ToolDenial records a refused operation and reason. An EvidencePage stores cards, blocks and typed buttons for a shared renderer.
Composite build / prototype mode / Reconcile
A composite builds selected Gradle repos together. Prototype mode enables sample data and dev controls. Reconcile resolves an interrupted attempt when its state needs a decision.

Confirm with the project owner

  • Which repo, branch and app build should you use for current work? Has the photographed iOS PR landed?
  • Which Android and iOS stages are enabled for real runs, and what local credentials and fixture repos are approved for practice?
  • What are the current Gate 5, QA, and interrupted-run Reconcile expectations? Which checks are mandatory before handing back a story?

Material covered

The DevTeam content is based on 79 captures on November 25, 2026: 37 onboarding photos, 41 coding-course photos and one iOS PR photo. The technical reference and coding course include the readable diagrams, tables, code concepts, labs and review details in text. Some panels were collapsed and some lines were cropped. Verify exact signatures and current behavior in the checkout.