Chapter 3 — Sorting the Work

Separate computation, judgment, house rules and proof before writing instructions.

Felix Reyes · The Skills Pack · First edition, 2026 · CC BY 4.0 · Router

Step 3 of the method, Sort every step, takes the work map of Chapter 2 and asks one question of each row: what kind of work is this? There are four answers, and each has its place in a skill folder.

Chapter 1 made this split for the revenue bridge as it went. This chapter writes it down for budget-vs-actual, the skill Part I is building, on a worksheet called the sort sheet, and Chapters 4 to 6 build what the sheet says.

Four kinds of work

Every step a preparer takes is compute, judgment, house rules or proof. Figure 3.1 draws the four, with the question that identifies each and its home.

Figure — text equivalent.

Kind Question Home
Compute Makes a number? skills/<leaf>/scripts/*.py
Judgment Chooses or phrases? skills/<leaf>/SKILL.md
House rules Same in every deliverable? _shared/*/ or skills/<leaf>/SKILL.md; a script may implement the rule
Proof Could a program check it? tests/checks.py

The compute boundary separates arithmetic from model judgment.

The four kinds of work. Each box asks the question that identifies its kind; the arrow points to its home in a pack. A house rule is stated in _shared/, or in the leaf when only that leaf needs it; a script may implement the rule (dashed arrow).

Compute is a step that makes a number. Totalling both years of the revenue bridge, placing a customer in one movement (the rule compares two numbers) and adding up the two sides of the bridge identity are all compute. So is formatting: the script stores Ember Analytics’ upsell as 135644.00 and prints it as $136K.

A step that chooses or phrases is judgment: which movers to name and in what order, and what to say when two movements pull against each other. The FY2025 bridge shows an upsell of $1,211K, a loss of ($1,288K) and a change for the year of ($5K), and how to put that in one sentence is judged again each time the note is written.

Negative amounts in parentheses, sentences under 25 words, customers called by name, and no cause given that the data does not show: these are house rules, the rules that stay the same in every deliverable. A team decides a house rule once. A preparer who decides it again each month has turned it into judgment, and two preparers will decide it two ways.

Proof is the work a program could check: that the identity holds, that every figure in the note is one the script printed, that the note has its four sections. A preparer does these by eye when there is time, and a program does them on every run.

The four kinds of work: how to recognize each, where it lives in a pack, and who checks it.

Kind Question that identifies it Where it lives Who checks it
compute Does it make a number? a script in the leaf, skills/<leaf>/scripts/*.py the script, on its identity before it exits 0; then the tests, from the raw input and against the golden file
judgment Does it choose or phrase? the leaf’s instructions, skills/<leaf>/SKILL.md a person who reads the deliverable
house rules Is it the same in every deliverable? the shared layer, _shared/*/SKILL.md, or the leaf when only it needs the rule the contract and provenance checks where the pack has a check for the rule; a reader for the rest
proof Could a program check it? tests/checks.py; a column or identity check may also run in the script it is the check; a reviewer reads its result in the run folder

The last column of Table 3.1 is the reason to sort at all: judgment is checked only by a person, and a house rule by a program only where the pack has a check for it. Parentheses turn a positive figure into a negative one, and the provenance check fails it unless the script printed that negative somewhere (Section 6.5). Sentence length has no check in this pack.

How much room a step leaves the model is its degree of freedom, and the sort sets it. A step that must run the same way every time, because a mistake is costly or the order matters, gets low freedom: one exact command, run as written. Medium freedom is a template with slots, for a step with a preferred shape and room inside it. High freedom, a direction and a reason, is for the step where several answers are right and context decides. On that scale (Figure 3.2) compute, house rules and proof sit low, the output contract medium, and the choices it leaves high.

Figure — text equivalent.

Component Home What is fixed or chosen Freedom
Compute scripts/*.py A script runs as written Low
House rules _shared/*/SKILL.md A rule holds in every deliverable Low
Proof tests/checks.py A program runs the check Low
Output contract SKILL.md contract Sections, rows and counts fixed, with slots inside Medium
Judgment SKILL.md step 5 Which movers, in what order, in what words High

Low freedom uses one exact command with nothing to add; medium uses a template with slots; high uses a direction and a reason. The compute boundary sits after computation.

The four kinds of work and the output contract on one scale of freedom, each with its usual file.

The boundary: if it makes a number, it is compute

Most disagreements in a sort are about one line, the line between compute and judgment. Figure 3.1 draws it dashed. One rule settles nearly every case:

A step that produces a number is compute, however small the arithmetic.

A choice made by a rule the preparer can state in full, a decision rule in Chapter 2’s sense, is compute as well, because a script can follow it. Judgment is the choice that no stated rule decides.

Rounding and the choice of unit produce a number too: fmt_k does both, once, for every amount (Chapter 5).

Ranking is compute: it orders numbers by a rule the preparer stated. One line of the script’s build function keeps the three largest customers in each movement, by absolute amount:

File: packs/variance-bridge/skills/revenue-bridge/scripts/bridge.py (lines 156–156).

    top = {k: sorted(v, key=lambda e: abs(e["amount"]), reverse=True)[:3] for k, v in movers.items()}

For FY2025 the losses come out as Fenwick Legal at ($686K), Birchway Foods at ($503K) and Quill Publishing at ($50K). Which of the three the note names, and whether it leads with a loss at all, is judgment. The leaf hands that choice to the model in the last bullet but one of its output contract:

File: packs/variance-bridge/skills/revenue-bridge/SKILL.md (lines 63–64).

- You choose which customers and movements to name and in what order. Do not
  name a cause the data does not show.

Compute ends when the script writes the display block, and judgment starts when the model reads it. The router’s first rule says so for every skill in the pack.

Exercise 3-1. Write the work map for price-volume-mix in eight to twelve rows, from data/interstationary/products_fy24_fy25.csv and the problem screen of Exercise 2-1. Sort it.

Exercise 3-2. The Chapter 1 pack states the rule that negative amounts print in parentheses in one file and implements it in another (examples/ch01/variance-bridge/). Name both files, say which kind of work each is, and say what step 6 of the leaf adds.

The sort sheet for the revenue bridge

The sort sheet is the worksheet for step 3: one row for each step of the work map, with its kind, where it lives in the skill folder and the file that contains it. A step that mixes two kinds of work splits into lettered rows, one kind each, and rows the work map lacks come last, marked added. Appendix C prints the sheet blank. Sorted this way, the six steps of the revenue bridge as Section 1.2 described them give fourteen rows: three steps split, and two rows are added, the provenance check and the contract check. The preparer ticked every figure and kept the page’s shape but never listed either as a step. Sorting adds them, because it finds the proof a work map leaves out. The filled sheet is in the companion files, answers/ch03.md.

Exercise 3-3. Find a step in examples/ch01/revenue-bridge-1/SKILL.md that mixes compute and judgment. Show how stage 2, examples/ch01/revenue-bridge-2/, separated the two.

Sorting budget-vs-actual

Table 3.2 sorts the budget-vs-actual work map of Table 2.3 and keeps its row numbers. The File column lists files of the leaf in packs/variance-bridge/skills/budget-vs-actual/.

The sort sheet for budget-vs-actual. Rows marked added have no step in the work map.

No. Step Kind Lives in File
1a open the file: check its five columns proof script, leaf bva.py, read_pnl; step 1
1b open the file: count its rows, hash it compute script bva.py, build
2 take the last period compute script bva.py, build
3 variance by line, month and year to date compute script bva.py, scope
4a sign by category compute script bva.py, variance
4b sign by category: the words for it house rules leaf Reading the display block
5 six subtotals compute script bva.py, scope
6 rank movers by size compute script bva.py, build
7 format figures compute script bva.py, fmt_k and three more
8 which movers to lead with judgment leaf Output contract
9a timing: each line’s peak and its month; revenue by month compute script bva.py, peaks, build
9b when a reversal across months is timing judgment leaf Reading the display block; Output contract
10 what to ask the line owner judgment leaf Output contract
11 headline house rules script bva.py, note
12 results table house rules script bva.py, note
13 a sentence on the month house rules script bva.py, note
14 one bullet per chosen line judgment leaf Output contract
15 data notes house rules script, shared bva.py, note, rounding; source-trace
16 operating income ties to its lines proof script, tests bva.py, build; bva_from_result, bva_from_source
17 line variances sum to the operating-income variance proof script, tests bva.py, build; bva_from_result
18 months sum to the year to date proof script, tests bva.py, build; bva_from_result
19 tick every figure proof tests provenance, binding
20 voice of row 14 (added) house rules shared executive-voice
21 the note keeps its contract (added) proof tests contract, rendered_ sections_ match

Eight rows are compute. Most need no argument: a variance, a subtotal and a formatted figure are numbers. Row 2, take the last period, makes no number, but the preparer stated its rule (“The month is the last one in it”), so it is compute. The script takes the last period in the file unless the user names another with --period.

Row 6, rank movers by size, is the decision rule the preparer followed by eye in Chapter 2: the cost lines, ranked by the size of their year-to-date variance, up to three each way. Revenue is one line, so row 9a lists its variance month by month instead. In the golden file display.movers lists the six, each with its variance and percentage. Salaries and wages heads the unfavourable list at ($38K), or (2.5%). Marketing is second on the favourable list at $38K, or 28.5%. The two lines print the same amount with opposite signs. Which of them the note leads with is row 8, and row 8 is judgment.

Row 9 splits in two, and its second half still hides a threshold. The measuring is compute: peaks in bva.py runs each line’s year-to-date variance through the months and reports the largest, with the month it was reached. Professional fees reached ($31K) in 2025-03 and closed the year at ($1K). The script stops there. Deciding that a line reversed is left to the model, under a sentence in the leaf with no number in it: “A line whose year-to-date variance is now much smaller than its peak reversed during the year.” Calling the reversal timing, and deciding whether it earns a bullet, is judgment, bounded by the leaf: “Call a variance timing only when display.monthly_revenue or display.peaks shows the reversal.” “Much smaller” compares two numbers by a rule nobody has stated, the case Section 3.5 returns to.

Row 4 splits into compute and house rules. The sign of a variance is compute: variance in bva.py subtracts actual from budget on a cost line and budget from actual on a revenue line, so a positive variance is favourable on every line. The words for the sign are a house rule. Only this leaf needs them, so they live in its skill file: “Use only the words favourable and unfavourable for the sign.” Row 1 splits into the check of the columns, which is proof, and the count and the hash, which are compute.

The write rows sort by how much the output contract fixes. For rows 11, 12, 13 and 15 it fixes the content down to display strings already rounded and signed, such as revenue’s variance of ($362K), or (3.1%). Words set that tightly are a house rule, which the leaf’s contract states and its script implements (Section 5.2). The bullets of row 14 are judgment, the one section the model writes.

Exercise 3-4. Sort the account reconciliation review of the Close and Reconciliation pack, packs/close-reconciliation/skills/account-rec-review/, which reads three files for December (step 2 of its skill file names them). Which of the planted exceptions does a threshold filter find, and which tag does its script, rec_review.py, set for each? Which parts of the sign-off note need a reader? Use the leaf’s output contract and its references/rec-policy.md.

Exercise 3-5. A budget-vs-actual bullet reads “Marketing ran over because the campaign moved into November.” Sort each clause. Then check the bullet against packs/variance-bridge/tests/golden/budget-vs-actual.json: which display field would have to show a reversal before the word timing is allowed, and does it?

Steps that resist sorting

Three phrases from shadowing notes resist the sort, and each sounds like one step.

“Explain the variance” is three steps in one: compute the figure, judge the reading the data supports, and phrase it by the house rules. Split it before you sort it:

before  explain the variance               three kinds in one row
after   a  compute      variance, sign, peak            bva.py
        b  judgment     which reading the data shows    leaf SKILL.md
        c  house rules  sign words, parentheses         leaf, _shared/

After the split each part has one owner. Part b keeps one bound that no program checks: “Do not name a cause the data does not show.” A reader checks it.

“Check that it looks right” is proof dressed as judgment. Ask the preparer what “right” means and the answer is a list: the subtotals tie, the months add up to the year, every figure in the note is in the source. Each item on the list is a check, and for budget-vs-actual each is already written, as rows 16 to 19 of Table 3.2. Write the checks, then ask again what “looks right” still covers. What is left belongs to the person who signs the note off, and Section 9.1 says what that reader looks for and no check sees.

“Use the usual threshold” is a house rule nobody wrote down. Write it as a script flag with a default that the skill file states. The flux-analysis leaf of the Close and Reconciliation pack does this. Its script flags an account when the movement is above --amount 50000 and above --pct 0.10 of the comparison balance, strictly above on both, and step 2 of its skill file states both defaults. The display block prints the thresholds a run used, as 10.0% and $50K, and the contract puts them in the review’s headline, so every review says which threshold produced it.

When a threshold needs explaining as well as stating, keep the explanation in a reference beside the flags. The account-rec-review leaf sets its three thresholds as flags in step 2. Its script applies five rules, three of them with one of those thresholds, and what each of the five protects against is kept, in order of severity, in references/rec-policy.md.

The budget-vs-actual leaf still has one unwritten threshold, in row 9b. Exercise 3-6 moves it into the script the way the flux leaf does.

Exercise 3-6. Move the reversal threshold of budget-vs-actual into the script. In a copy of the pack, give peaks in bva.py two flags with stated defaults, mark each entry of display.peaks as reversed or not, and print the thresholds the run used in the display block. Rule P04 in data/interstationary/README.md is one choice: a peak of at least 20,000, and a year-to-date variance at the end within 10 percent of it. Which lines come back marked? Which sentence of the leaf changes, and which file of the test kit has to change with the script?

Exercise 3-7. Split “review the note before sending” into its proof parts and its judgment part. Write one proof part as a check in the form of those in packs/variance-bridge/tests/checks.py: a function that takes the run folder and the case and returns (passed, detail).

All chaptersDownload & licenseBook text CC BY 4.0