← Agentic engineering

Module 11 · Capstone

One real change in a stack that is not yours, from ticket to release, with an agent doing the typing: brief it, build it against a check written first, review it with the stack's owner, run a security pass, and write its release record.

Facts checked

This module is the brief for one piece of work: a real change in a stack that is not yours, taken from ticket to release with an agent doing the typing. By the end you will have briefed it, built it, proved it, reviewed it with the stack's owner, checked its security and written its release record.

Each stage uses a method from an earlier module, and the links take you back to it if a stage goes wrong. This time you use all of those methods on one change, in order, so a weak brief can come back two stages later as a failed review.

Before you read
1.

You build the iOS app. The change you have picked up is on the server: a new endpoint and a background job. What do you do first?

2.

In one sentence: when is a change finished?

3.

The brief named four files. The agent's diff comes back with eleven, and the tests pass. What do you do?

Choose the change

A capstone change passes five tests. If a change fails any of them, do not take it as it is, however much you want to build it.

  1. It is outside your specialty. A frontend engineer takes a migration. A backend engineer takes a screen with a form. A mobile engineer takes a server endpoint.
  2. One sentence states the outcome, and the work fits in one to three pull requests.
  3. It carries a risk that belongs to that stack: data that could be lost, a permission rule, money, accessibility, a deploy. A change with no such risk teaches you nothing about the stack.
  4. The stack has an owner who agrees to review it. Outside your specialty explains why their read cannot be skipped.
  5. It can be undone. Additive, behind a flag, with nothing destroyed. Leave removing a column for your second change or later.

Keeping the change small is the hardest part. If your list of what the change will not do is shorter than the list of what it will, the change is too big.

flowchart TD
  A[A candidate change] --> B{Outside your specialty?}
  B -- no --> X[Pick another]
  B -- yes --> C{Outcome in one sentence,<br/>one to three pull requests?}
  C -- no --> S[Cut it down]
  S --> C
  C -- yes --> D{Carries a risk that<br/>belongs to that stack?}
  D -- no --> X
  D -- yes --> E{An owner of that stack<br/>will review it?}
  E -- no --> X
  E -- yes --> F{Can it be undone?}
  F -- no --> S
  F -- yes --> G[Write the brief]

The six stages

The work runs in this order. At each stage you leave something in the repository for the next one to use.

StageWhat you leave behindThe method
1. BriefThe four-part brief, the agent's restatement with its assumptions, and the steps as one pull request eachBrief the agent
2. BuildAn acceptance check written first and seen to fail, then the agent's commits in its own checkoutMake the agent prove it, Guardrails
3. ChecksThe full run with its counts, and the product working in the state a user hasMake the agent prove it
4. ReviewThe evidence, the AI reviewer's findings each marked fix or dismiss, your explanation back, the owner's readReview at volume, Outside your specialty
5. Security passNotes against the short list belowSecurity of the code and the agent
6. Release recordOne page, with the undoOwning it, Ship it and run it

Two stages are skipped more often than the others. The first is running the acceptance check before anything is built. If the check passes before there is any code, it is not testing your change. The second is opening the running product. Claude Code's guide says that "All tests pass" from an agent "on its own tells you very little". Open the screen or call the endpoint yourself, as the user with no data and as the user with a lot.

The security pass has two halves. For the code:

  • can one user reach another's record by changing an id?
  • is every new table or endpoint covered by the same access rule as its neighbours?
  • has a secret reached the browser, the repository or a log?

For the agent:

  • which credentials were in its environment while it worked, and was any of them for production?
  • did it read text from outside the team, such as an issue or a web page, in a session that could also run commands?

If the change touches a schema, follow the order in Data and migrations during stage 2, and put the restore that proves the backup on the release record.

When a stage goes wrong

Each stage tends to fail in a particular way, and you already know what to do about each one.

  • The agent's restatement surprises you. That is useful. Fix the brief now, while the fix is only a paragraph of text.
  • The diff spreads past the brief. Keep what was asked for, discard the rest, and ask again with the boundary restated.
  • The acceptance check looks wrong. The builder disputes it in writing and stops. Nobody edits the check to make it pass.
  • The session circles. After two failed corrections, clear it and write a smaller brief. Many agents and what they cost has the signs.
  • You cannot explain the change back. Ask the agent for a walk-through, or cut the change down until you can. Do not approve it as it is.
  • The owner disagrees with the approach. Follow their rule, because it is their stack. Write the ruling into the decisions file so the next session reads it.

Shipping one change in a stack, with its owner's review, shows that you can work there safely. It does not make you an owner of that stack. The second change in the same stack goes faster, and it still needs the owner's read.

A mobile engineer ships a server change

A company makes a class-booking app for gyms. You build its iOS app. This sprint's ticket is on the server: members must be able to download everything the product holds about them. The server is a Python service on Postgres, owned by two backend engineers. Decide what you would do at each stage before reading the step.

  1. 1 · Choose: the five tests

    The server is outside your specialty. The outcome fits one sentence: a signed-in member can request an export of their own data and download it as a file. The risks are the server's own, personal data and a query over a large table. One of the backend engineers agrees to review. The change is additive and sits behind a flag. The change passes all five.

  2. 2 · Stage 1: the brief

    The brief has its four parts: the outcome, the scope, a do-not-touch list that names the sign-in code and the existing tables, and the tests that must pass. The agent restates it and lists five assumptions. One is wrong. It assumed the export could be built while the request waits. The backend owner says the longest-standing members have years of bookings, so it has to be a background job. You change the brief, and the work becomes three pull requests: the job and a table that tracks exports, the endpoints to request and download one, then expiry and clean-up.

  3. 3 · Stage 2: the check first, then the build

    A separate session writes the acceptance check from the brief. Member A requests an export and the file holds A's bookings and none of B's. Member B asks for A's export and gets a 404. You run it and it fails, because the endpoint does not exist yet. Then the builder starts in its own worktree, with the check file closed to edits. The second pull request comes back with eleven files where the brief named four. Among the extra seven is the sign-in code, which the agent had tidied. You keep the four, discard the rest and ask again with the do-not-touch list repeated.

  4. 4 · Stage 3: the checks, and the running product

    The full run shows 1,853 tests and none skipped: the main branch's 1,847 and six new ones. Then you open the test environment and request an export as a member who joined today and has no bookings. The job fails. The acceptance check had only used members with a history. The check's writer adds the empty case, it fails, the builder fixes the job, and it passes.

  5. 5 · Stage 4: review

    The AI reviewer returns three findings. The download link never expires: fix. The job loads every row into memory before writing: you ask the backend owner, who confirms it would exhaust a worker on a large account, so fix, reading in batches. A naming point: dismiss, with the reason that it follows the folder's existing style. Then you close the agent and explain the change to the owner: what it adds, what could go wrong, how you would know, how to undo it. The owner asks what happens to an export that is running during a deploy. You do not know the answer. You find out that the job restarts from the beginning and writes nothing until the file is complete, and you add that to the pull request.

  6. 6 · Stage 5: the security pass

    Changing the export id in the address returns a 404, and the acceptance check proves it. The file sits in private storage, the link is signed and lasts fifteen minutes, and a test shows the file is deleted after seven days. One finding is new: on failure the job logged the member's email address. It now logs the member's id. On the agent's side, it worked against a local database with seeded data, and no production credential was in its environment.

  7. 7 · Stage 6: the release record

    The record is one page. It lists the brief and its three pull requests. You briefed and sign as owner, the backend engineer reviewed, and you are on call for the first week. The evidence from stage 3. Not read: nothing; every change was read before it merged. One additive table, and this week's restore. A new row on the data map for export files: private storage, seven days, readable by the member alone. No new dependencies. The undo is the flag, with a note that a file already downloaded cannot be recalled. Built with names the agent tool and the model, with their versions. The law line gives counsel's answer on what an export of a member's own data must contain, and the date it was given. The measure is export requests completed, against a baseline of none. The cost note shows five sessions and $3.40, one of them cleared after two failed corrections during the rewrite to batches. The flag goes on for staff first.

Try it

Fill the gaps in this capstone brief. Each gap is one of the five tests or a part of the brief.

# Capstone brief

My specialty:        <frontend, backend, mobile, data, infrastructure, QA>
The change is in:    <a stack that is ______ my specialty>
Outcome:             <one ______>
Size:                <one to three ______>
The stack's risk:    <data, permissions, money, accessibility or a deploy>
Owner who reviews:   <name>
Undo:                <the flag or revert, and what it will ______ undo>

Scope:               <files and behaviour the agent may change>
Do not touch:        <files and ______ the agent must leave alone>
Tests that must pass: <the acceptance check, written first and seen to ______>
The misconception

The capstone should be in the stack I know best, so that it shows my strongest work.

Why it’s wrong

In your own stack you catch faults from experience before any check runs. You would spot the missing index or the unlabelled button on sight, so you never find out whether your brief, acceptance check and review work. You only show that you are good at your specialty, which you already knew.

The job asks you to work outside your specialty. The job now sets out what engineers are being handed beyond their specialty. There you cannot rely on what you already know, so each stage has to work.

The correct model

Pick a change whose code you cannot judge by eye. You then have to rely on the method and an owner's review, as you will in the job.

Check yourself
  • What are the five tests for a capstone change?

  • Name the six stages in order.

  • What must be true of the acceptance check before the agent builds anything?

  • What are the two halves of the security pass?

  • The owner of the stack disagrees with the agent's approach, and the tests pass. What happens?

Before the check

The capstone is one change, outside your specialty, carried through six stages: brief, build, checks, review, security pass, release record. Passing every lab and this capstone earns the certificate.

Check yourself, without scrolling up:

  • Which change on your team's board this month passes all five tests?
  • Who owns the stack it is in, and have you asked them to review?
  • What is the risk in that stack that you would not have thought to check?
  • What would the undo line on its release record say?
Sources
1 lab

Labs

Lab 1

Practise this: Capstone: one change in a stack that is not yours

Clone the starter: https://github.com/codeprepdev/agentic-engineering-lab-11-capstone. It is the member service of Fernrow, which runs plot letting for allotment societies in England, in Node, with nothing to install. Its README holds this sprint's two tickets. FR-61 is server work: plot holders add co-workers who can then see the plot. FR-64 is a screen: a waiting-list form people can fill in. Take the one outside your specialty. If you are a backend engineer, that is FR-64; a frontend engineer, FR-61; anyone else, either. The README also names each stack's owner and the two questions they ask in every review.

Take the change through the module's six stages, in order, with an agent doing the typing. At each stage you leave a file behind. capstone/README.md in the starter lists the files too:

StageWhat you leave in the repository
1. Briefcapstone/BRIEF.md, filled in: the ticket you took and why it is outside your specialty, the four parts of the brief, the agent's restatement of it with the assumptions it listed, and the steps, one pull request each
2. Buildtest/acceptance.test.js, written from the brief by a separate session before anything is built, and capstone/CHECK-FIRST.txt, the output of running it then, failing. Then the agent's build, in its own checkout, with the acceptance file closed to it
3. Checkscapstone/RUN.txt, the output of your final full node --test, and capstone/PRODUCT.md: what you saw in the running app (node server.js) as a user with nothing and as a user with a lot
4. Reviewcapstone/REVIEW.md: the AI reviewer's findings, each marked fix or dismiss with the reason; your explanation back (what it adds, what could go wrong, how you would know, how to undo it); and the owner's read
5. Security passcapstone/SECURITY.md, in two halves. The code: changing an id, the access rule on anything new, secrets in the browser, the repository or a log. The agent: which credentials it could reach and whether any was for production, and what outside text it read in a session that could run commands
6. Release recordRELEASE-RECORD.md, with the eleven lines from the release record in Owning it: Change, People, Evidence, Not read, Data, Personal data, Dependencies, Undo, Built with, Law, Measure

It is best to get the owner's read from a real person. If an engineer who works in that stack will read your change as its owner, ask them, and write down what they asked and what changed. If nobody can, answer the owner's two questions from the README in their section of REVIEW.md as if they had asked them, and say that is what you did.

On your own team, the change to take is one that passes the module's five tests. Here the tickets are set for you so the hidden tests can mark your work. The one you take passes the five tests too: it is outside your specialty, it fits one sentence and one to three pull requests, it carries a risk that belongs to its stack, it has an owner, and a flag undoes it.

Get node --test passing with none skipped, with the output in front of you, and keep that output as capstone/RUN.txt. Then upload the repository folder. The upload leaves out the .git folder, so the hidden tests see your files and no commit history. They read your ticket from the brief and run that ticket's behaviour on societies, members and plots of their own, with the flag off and on. They check that lib/session.js and lib/rent.js are as the starter had them, that the starter's tests are all still there and none is skipped, and that nothing was added to package.json. They read each stage's file for its shape: every field and line filled, the owner named, the flag in the undo, the acceptance check failing in its first run, and the release record's Evidence line giving the same pass count as RUN.txt. Beyond those checks, the tests cannot tell whether what the files say is true; as the change's owner, you answer for that.

Open the lab · needs a free Tarmac account to have your work marked