Skip to the lesson
CivOps AI Academy · F13Your First Workflow, End to End: Paper to Screen, Record, Review and Chart
0%

F13 · Foundation Session 13

Paper to glass

Everything so far comes together in one workflow: a paper form on the floor becomes a screen, a record, a review and a chart. The agent builds it from your briefs. You check every step, and the plant only lets go of the paper when the screen has proved itself.

8 min5 chapters≈ 1¾ hours3 hands-on exercises12-question assessment · 80% passes

By the end of this chapter you can

  • Describe the end-to-end path a record takes, from operator to manager.
  • Describe how this element is scored.
  • Know what you will deliver: one paper form replaced, proved end to end.

One workflow, all the way through

Sessions 3 to 12 each built one part: the schema, the names, the matrix, the access rules, sign-in, the clamps, three surfaces and the skill of directing an agent. Session 13 joins them into one working loop for one real form, so a record entered on the operator screen reaches the manager view through the review queue. That is also the end-to-end criterion of Homework 4 and an item on the certification practical.

A record's journeyFive stops left to right: operator screen, first_off_checks table, review queue, first_off_reviews table, manager board. End to end: one record, five stops, every one checked by a testOperator screenenters the checkfirst_off_checksone row, id from deviceReview queuesupervisor decidesfirst_off_reviewsone row per decisionManager boardyield and trendScreen (what people see) and data (what the database holds) must both be right at each stop.
A record's journey. Five stops. A test checks what people see and what the database holds at every one.

The course example stays with Acme's first-off check sheet on Line 3 (Acme is an illustrative plant). Use the paper form your own intent named: a start-up checklist, a downtime log, a torque record, a sanitation sign-off. The method is the same.

How it is scored

5chapters, each opened at least once
3exercises on your own platform
12assessment questions
80%to pass (10 of 12)

The element is complete when you have opened every chapter and taken the assessment, and passed at 80% or more.

Knowledge check

What proves a workflow works end to end?

Chapter 1 · Read the form like a specification

From paper to fields

A paper form is a specification someone wrote years ago. Read every box, ask who fills it, when and why, and decide for each one: captured for the operator, typed by the operator, decided by the server, or dropped.

25 min1 form4 kinds of field0 boxes copied blindly

By the end of this chapter you can

  • Turn each box on a paper form into a field with a name, type, unit, limits and source.
  • Capture automatically what paper asked people to write: time, place, person.
  • Decide on the server what paper asked people to judge, and drop what no decision uses.

Go and see the form in use

Before you design anything, watch the form being filled in, on the floor, on a real shift. Lean practice calls this going to the gemba, the place where the work is done [1]. You will see what no document says: the box nobody fills, the column people use for something else, the note scribbled in the margin because there was no box for it. Bring three filled-in sheets back with you; they are your first test data.

Paper forms in quality work are often check sheets: simple, structured forms for collecting data where it happens [2]. Their strength is that anyone can fill them in; their weakness is everything after: copying, adding up and finding them. The screen keeps the strength and removes the weakness.

From paper to fieldsA paper first-off sheet with eight boxes on the left; on the right its fields grouped into captured automatically, typed by the operator, and decided by the server. FIRST-OFF CHECK · LINE 3Date / timePressPart no.Hole positionFlange heightBurr (Y/N)Pass / FailInitialsCaptured for the operatorentered_at: the server's clockpress: scanned QR labelentered_by: who is signed inTyped by the operatorhole_mm, flange_mm: decimal keypadburr_mm: was Y/N, now a numberDecided by the serverresult: pass or fail from the limitspart: from the press's current job
From paper to fields. Eight boxes become three kinds of field. Nobody types the date, the press or their initials again.

Four questions for every box

QuestionIf the answer isThen
Does anyone use it to decide something?NoDrop it, and write down why in the intent
Can the platform know it without asking?Yes: time, person, place, jobCapture it: the server's clock, the signed-in user, the scanned QR label, the press's current job
Is it a judgement from other values?Yes: pass or fail, in or out of limitsDecide it on the server from the limits; never let the browser send it
OtherwiseIt is a measurement or an observationThe operator types it, with the right keypad, unit and limits shown

Write the field list

For each field that survives, write one row: the name in your naming standard from Session 5, its type, its unit, its limits, where it comes from and which roles in the matrix may read or write it. This list is the input to Brief 1; with it, the agent has almost nothing to guess.

FieldTypeUnit / limitsSourceWrite / read
iduuid–Operator's device (outbox)Operator / all plant roles
entered_attimestamptz–Server clockServer / all plant roles
presstextISA-95 name, such as L3-P02Scanned QR labelOperator / all plant roles
parttextDrawing numberPress's current jobServer / all plant roles
hole_mmnumeric(6,3)11.900 to 12.100TypedOperator / all plant roles
flange_mmnumeric(6,3)24.800 to 25.200TypedOperator / all plant roles
burr_mmnumeric(5,3)0 to 0.100TypedOperator / all plant roles
resulttextpass or failServer, from the limitsServer / all plant roles
entered_byuuid–Signed-in userServer / supervisor, quality
corrects_iduuid, nullable–Set when re-measuring after a rejectOperator / all plant roles

Paper rules still apply

If your plant works under a quality system such as ISO 9001, the form is a controlled record: it must be identifiable, protected from loss and kept for a defined time [3]. If it is a record FDA rules require, moving it to a screen brings it under the electronic records rule, with its audit trail and access requirements [4]. The design from Sessions 7 to 11 (append-only records, attributable entries, role-based access, an audit trail of every review) is built to meet that kind of requirement; check the specific rules that apply to your plant with your quality lead before you retire the paper.

Knowledge check

The paper form has a box for the operator's initials. What does the screen do?

Knowledge check

Where is pass or fail decided?

Knowledge check

A box on the form has been blank on every sheet for a year. What should you do?

Exercise · Field list from the floor30 minutes

You need: Your plant's paper form; three filled-in sheets; a text editor

Turn your own paper form into the field list Brief 1 will need.

Outcome: A field list every box on the form is accounted for in, checked by the person who uses the form.

References

  1. Lean Enterprise Institute: Gemba (Lean Lexicon). https://www.lean.org/lexicon-terms/gemba/
  2. ASQ: What is a check sheet?. https://asq.org/quality-resources/check-sheet
  3. ISO 9001:2015 Quality management systems: Requirements. https://www.iso.org/standard/62085.html
  4. eCFR: 21 CFR Part 11, Electronic records; electronic signatures. https://www.ecfr.gov/current/title-21/chapter-I/subchapter-A/part-11

Chapter 2 · Built by the agent, in order

Four briefs, one workflow

One workflow is too big for one brief. Split it into four, each one pull request with its own checks, in the order the layers depend on each other: schema first, then the three surfaces.

30 min4 briefs4 pull requests1 end-to-end test

By the end of this chapter you can

  • Split a workflow into briefs that each make one reviewable pull request.
  • Order them so each stands on finished, tested work.
  • Write the end-to-end acceptance test that the last brief must pass.

Split by layer, in order

Each layer stands on the one below. The surfaces cannot be built well until the table, its access rules and some realistic data exist, and the board cannot count approved checks until reviews exist. So the briefs run in order, each merged before the next starts. Anthropic's guidance for its agent recommends exactly this kind of decomposition into well-defined steps with checks between them [1].

Four briefs, one workflowBrief 1 schema and access rules, then brief 2 operator screen, brief 3 review queue and brief 4 board, each with its acceptance check. Brief 1Schema, RLS, synthetic datacheck: RLS test per roleBrief 2Operator screen + outboxcheck: offline test at 360 pxBrief 3Review queuecheck: reject, self-review refusedBrief 4Board tile and trendcheck: approved checks countedEach brief is one pull request through the ten clamps. Brief 1 first: everything else stands on the schema.
Four briefs, one workflow. Each is a pull request through the ten clamps, with the acceptance check written first.
BriefBuildsAcceptance checks you write firstBuilt on
1 SchemaThe migration for the field list, row-level security from the matrix, and synthetic data from your three real sheetsEach role reads and writes exactly what the matrix says; another plant's user sees nothingSessions 3, 4, 6, 7
2 Operator screenThe screen from Session 10 for this form, with the outboxAt 360 px: a good entry is saved with a server result; offline entries arrive onceSession 10
3 Review queueThe queue and reviews table from Session 11Reject needs a reason; self-review refused; corrected check links to the rejected oneSession 11
4 BoardThe tile and trend from Session 11, counting approved checksAn approved check changes the count; a rejected one is counted as a first-time failSession 11

The end-to-end test

The four briefs each have their own checks. One more test proves they work together: it signs in as an operator and a supervisor in two browser contexts, sends a record through the whole path, and reads the database at every stop. Write it before Brief 2 starts; it fails until Brief 4 is merged, and then it guards the workflow on every pull request after that. Playwright supports several independent browser contexts in one test, which is how one test can play two people [2].

test/workflow-1.spec.ts (Playwright)
test("a first-off check travels from operator to board, including a rejection", async ({ browser }) => {
  const operator = await signedInPage(browser, "operator-line3");
  const supervisor = await signedInPage(browser, "supervisor-shift-b");

  // 1. The operator enters a check with flange height above its limit.
  const first = await submitFirstOff(operator, { press: "L3-P02", hole: "12.02", flange: "25.31", burr: "0.03" });
  expect(await row("first_off_checks", first)).toMatchObject({ result: "fail", entered_by: ids.operator });

  // 2. The supervisor sees the difference and rejects it with a reason.
  await supervisor.goto("/review");
  await expect(supervisor.getByText("+0.11 above limit")).toBeVisible();
  await reject(supervisor, first, "Flange high: adjust die and re-measure");
  expect(await reviews(first)).toEqual([expect.objectContaining({ decision: "rejected", reviewer: ids.supervisor })]);

  // 3. The operator re-measures; the new check corrects the first.
  const second = await submitFirstOff(operator, { press: "L3-P02", hole: "12.01", flange: "25.04", burr: "0.02", corrects: first });
  await approve(supervisor, second);

  // 4. The board counts both: one first-time fail, one approved release.
  await supervisor.goto("/board");
  await expect(supervisor.getByTestId("first-pass-yield")).toContainText("0 of 1 first time");
  await expect(supervisor.getByTestId("checks-approved")).toContainText("1");
});
The rejected pathCheck A is rejected, check B corrects it and is approved; first-pass yield counts A as a fail and the batch record uses B. Check Aflange 25.31Rejected'adjust die'Check Bflange 25.04corrects AApprovedbatch may runWhat each view countsFirst-pass yield: A counts as a first-time fail. Batch record: B is the check that released the batch.Review history: both checks and both decisions stay, linked, with who and when.
The rejected path. The exemplary level of Homework 4 asks that a rejected record is handled correctly; this is what correctly means.

Keep the evidence

Homework 4 asks for your briefs, the changes the agent made, and your acceptance checks with their results. Keep each brief in docs/briefs/, link each pull request to its brief, and note in the pull request any problem you found while reading it and how it was fixed. If you rewrite a brief, keep both versions and one line on why. Record what the agent's work cost if your plan shows it: that is the exemplary level.

Knowledge check

Why must Brief 1 (schema and access rules) be merged before the others start?

Knowledge check

When is the end-to-end test written, and when does it first pass?

Knowledge check

Why run these four briefs with one agent, one after another?

Exercise · Build the workflow with four briefs60 minutes, across the session and after it

You need: Your AI coding agent; github.com; your field list

Direct the agent through the four briefs, reading each change in the order from Session 12 before it merges.

Outcome: One workflow built by the agent in four reviewed pull requests, with a passing end-to-end test on main.

References

  1. Anthropic: Claude Code best practices. https://www.anthropic.com/engineering/claude-code-best-practices
  2. Playwright documentation: Isolation and browser contexts. https://playwright.dev/docs/browser-contexts

Chapter 3 · The data trail and the parallel week

Checking it end to end

A green test proves the workflow works in a test. The floor proves it works. Follow the data trail, put it in front of the people who will use it, and run it beside the paper until the two agree.

27 min5 steps on the data trail1 parallel week1 signed go/no-go

By the end of this chapter you can

  • Follow the data trail: check the database, not just the screen, after each step.
  • Pilot the workflow on one line and run it in parallel with paper.
  • Make and record a go or no-go decision before retiring the paper.

Follow the data trail

A screen can say Saved while the database holds nothing, or two rows, or the right row with the wrong person. So the end-to-end test reads the database after every step, and so should you the first time you run the workflow by hand. Open the table in Supabase's table editor beside the screen and watch each row arrive [1].

The data trailFive steps on the left, each with the database facts the test asserts on the right. After each step the test reads the database, not just the screenOperator submits1 row in first_off_checks · result decided by server · entered_by = operatorNetwork drops, retrystill 1 row (same id)Supervisor rejects1 row in first_off_reviews · reason not empty · reviewer ≠ operatorOperator correctsnew check row with corrects_id = first checkSupervisor approvessecond review row · board count +1 · first-pass yield counts the first fail
The data trail. Each step leaves exact facts in the database. The test asserts them; you can see them in the table editor.

Put it in front of the floor

Tests find what you thought of. Operators find the rest: the label that reads differently on a dirty screen, the field order that does not match how they measure, the glove that does not register on one button. Ask one operator and one supervisor to use it on a real shift on one line, with you watching and not helping. Homework 3's exemplary level asks for exactly this: tested by an operator on the floor.

Run it beside the paper

Do not retire the paper on day one. For a week, on the pilot line, the operator fills in both. At the end of each shift, compare: the same number of checks, the same values, the same pass or fail. Every mismatch has a cause, and the cause is either a bug, a training gap or a paper error the screen has just caught. Medical-device software guidance makes the same point in general terms: confirm a system works for its intended use, in its real environment, before relying on it [2].

Parallel runBars for five days comparing paper and screen counts; they match except on Tuesday, when the screen has one fewer. First-off checks recorded per day during the parallel week: paper (grey) and screen (cyan)99Mon1110Tue88Wed1010Thu99Fri
A parallel week. Counts match on four days. On Tuesday the screen has one fewer: find out why before going live.
MismatchLikely causeFix
Screen has fewer than paperAn entry made offline never sent, or an operator skipped the screenCheck the outbox on that device; check the shift's training
Screen has more than paperA duplicate from a retry, or paper not filled inCheck ids: a duplicate means the idempotent insert is broken
Same count, different valueA typing error on one of themThe review card shows which; the paper is not automatically right
Different pass or failLimits differ between the drawing, the paper and the platformFix the limits at their source and record the change
Cutting over from paperFive steps: pilot, parallel week, compare, go or no-go, retire paper; a mismatch sends you back to another parallel week. Pilotone line, one shiftParallel weekpaper and screen bothComparecounts and values matchGo / no-gotwo people signRetire paperon that line onlya mismatch: find out why, fix, run another parallel week
Cutting over from paper. One line at a time, with a signed decision, and a way back if the week does not match.

Decide, and write it down

At the end of the parallel week, the supervisor and the quality lead decide: go, or another week. Write the decision as a short record in the repository (docs/go-live/workflow-1.md): the week's counts, every mismatch and its cause, who decided and when. Then, and only then, retire the paper on that line. The other lines follow one at a time. Session 21 does the same for the whole platform.

Knowledge check

The screen says Saved. Why does the end-to-end test still read the database?

Knowledge check

During the parallel week the screen shows one more check than the paper. What do you check first?

Knowledge check

When is the paper form retired?

Exercise · Pilot, compare, decideOne week on the floor; 20 minutes a day

You need: The deployed workflow; the paper form; Supabase's table editor

Prove the workflow on one line before the paper goes.

Outcome: A workflow proved on the floor, with a recorded go decision before any paper is retired.

References

  1. Supabase Docs: Tables and data (Table Editor). https://supabase.com/docs/guides/database/tables
  2. U.S. FDA: General Principles of Software Validation (guidance for industry and FDA staff). https://www.fda.gov/regulatory-information/search-fda-guidance-documents/general-principles-software-validation

Chapter 4 · 12 questions · 80% passes

Final assessment

Twelve questions across the element. Score 80% (10 of 12) to pass. Your LMS records your score and each answer; you can review the chapters and try again.

15 min12 questions≈ 15 minutesRetake allowed

Choose one answer for each question, then submit. You will see the right answer and why for every question.

1. What is the first thing to do before designing the screen for a paper form?
2. The paper form asks for the date and time. On the screen this is:
3. Paper says 'Burr Y/N', but the quality engineer needs to see burr growing. What do you record?
4. Why is pass or fail not a button the operator presses?
5. In what order do the four briefs run?
6. When is the end-to-end test written?
7. How does one Playwright test play both the operator and the supervisor?
8. A check is rejected and then corrected. What does first-pass yield count?
9. Why does the end-to-end test read the database after each step?
10. During the parallel week, the screen and paper disagree on one day's count. What happens?
11. Who decides to retire the paper form, and how?
12. Why run the four briefs with one agent in order, rather than four agents in parallel?