# First code-repair receiving session

Prepare Node.js 24 and the [complete coding-workflow kit](/templates/fde-foundation-coding-workflow-kit.zip)
before this seventy-five-minute paired practice. [Preview the prepared agenda](/training/guides?starter=first-repair-receiving#guide-session-title)
before explicitly choosing whether to use it. The agenda creates no assignment,
attendance or training entitlement. Setup, reading and breaks are outside its
planning estimate; leave unfinished observations unrun rather than rushing them.

Each person extracts a separate folder and uses the existing
[quantity regression worksheet](/templates/fde-quantity-regression.md) and
[intentionally failing fixture](/templates/fde-quantity-regression.test.mjs).
The stated commands use the built-in test runner, without packages, an AI
account, network or edits to an existing project. Keep prior reading and any
person, tool or AI help in your own record. Combined roles and solo work are
declared self-review, not independent observation. When Node is unavailable,
record reading or paired observation as the actual mode and leave execution unrun.

## Minutes 0–30: keep your own original and repair

Follow sections 1–3 of the existing worksheet; the receiving rounds below
replace its section 4. Agree Q1 before editing: a supplied
nonnegative integer stays present, including zero; only null and undefined mean
missing. Keep `fde-quantity-regression.test.mjs` unchanged. The separate
`quantity-repaired.test.mjs` changes only `||` to `??` or an equivalent explicit
null/undefined check. All four original assertions stay fixed.

Each person retains a prediction and their own first original/repaired reports,
including actual commands and exit status. The original's zero assertion should
fail with exit 1; the repaired copy should pass all four with exit 0. A missing
runtime, file or import is a setup failure, not that observed zero regression.
Retain the worksheet's misleading weak-assertion example separately; it is not
the candidate you hand over as a repair.

## Minutes 30–45: receive a green result with missing coverage

A builds and B receives. A supplies Q1, unchanged original, repaired copy and
exact commands. B predicts what the following commands will actually exercise,
then runs them before reading A's explanation:

```sh
node --test --test-reporter=tap --test-name-pattern="positive" fde-quantity-regression.test.mjs
node --test --test-reporter=tap fde-quantity-regression.test.mjs
```

The first command is green but selects the positive case. It supplies no
execution of the zero assertion. Locate the selected test names rather than
inferring execution from a skip count. The full original still fails zero.
Keep each actual result and exit separately; a supplied report is not B's run.

B names the missing observation, then locates the changed implementation line
and unchanged zero expectation. A observes without taking over. Neither a green
process nor an unchanged test name establishes that the required question ran.

## Minutes 45–60: swap roles and change the requirement

B now builds and A receives. The requirement owner agrees a fictional Q2:
negative integer quantities may represent backorders. This is a teaching
decision, not permission to change a real inventory system. Both partners predict
whether the new example alone will distinguish the original from the repair.

Preserve every earlier file. B supplies the unchanged original and actual repair.
In an editor, A creates separate copies named
`quantity-original-q2.test.mjs` and `quantity-repaired-q2.test.mjs` from the
unchanged original and actual repaired copy. A appends this same independent
assertion to both; leave the function and four earlier assertions unchanged:

```javascript
test("Q2 negative quantity stays unchanged", () => {
  assert.equal(displayQuantity(-3), -3);
});
```

A checks the two copies' original/repaired difference and predicts
the selected names and zero observation before running. Run each command
separately so the expected failing original does not prevent the repair's run:

```sh
node --test --test-reporter=tap --test-name-pattern="Q2 negative" quantity-original-q2.test.mjs
node --test --test-reporter=tap quantity-original-q2.test.mjs
node --test --test-reporter=tap quantity-repaired-q2.test.mjs
```

The new example alone passes the broken original with exit 0. The full original
Q2 copy still fails zero: four pass, one fails, exit 1. The full repaired Q2 copy
passes all five, exit 0. Keep the actual TAP output and `Observed zero result`
line alongside your prediction. The expected reports here are teaching notes,
not evidence that a participant ran them.

The new case and the earlier regression answer different questions. Keep both.
Do not weaken zero, drop positive/missing examples or change an expectation merely
to make a process green. These published changes are practice, not held-out
evidence of unaided transfer or general correctness.

## Minutes 60–75: return the remaining receiving work

Each receiver explains their own observation and assistance before the team
agrees a limited receiving decision. The four Q1 examples and one Q2 example do
not validate strings, fractions, NaN, oversized integers or arbitrary input.
Neither `||` nor `??` is an input-validation policy.

| Receiving role | Work to retain or request |
| --- | --- |
| Requirement owner | Confirm Q1/Q2 and decide any remaining type, range or missing-input policy before implementation. |
| Builder and test owner | Preserve original assertions, review the implementation difference and keep misleading green candidates separate. |
| Receiving engineer | Predict and run the changed condition, locate the relevant assertion and retain their own output and assistance. |
| Pod lead | Assign the unresolved requirement and next bounded test to an accountable role before committing delivery. |

One copy per participant:

```text
Alias / actual role / prior reading and help:
Requirement and independent expected behavior:
My first prediction / exact file and command:
Actual selected test names / output reference / exit:
Original-versus-repaired change / unchanged assertions:
Receiving action I performed / help or takeover:
What I revised after the observation, keeping my first account:
Remaining input-policy question / responsible role / next test and update:
```

Assign actual people later. These local examples establish no deployed
integration, model quality, production permission, qualification, independence
or client placement. Preserve unrun work and the original individual accounts.
