Cursor review practice with three small bugs
Original Maitz exercise | October 2026

This project is intentionally broken. It is an educational task-list fixture,
not production code, Cursor-generated output or evidence of a hands-on Cursor
test. The fixture's checks were validated locally with Node.js 24.19.0.
No Cursor execution was used to create or validate this ZIP.

Files
- project/src/tasks.mjs: three functions with three intentional defects
- checks/acceptance.test.mjs: independent, fixed acceptance checks
- README-he.txt: Hebrew reader instructions
There are no dependencies, account details, network calls or install scripts.
Use an existing Node.js installation with node:test (Node.js 20 or later).
No npm install is needed. From the extracted cursor-three-bug-practice folder:

node --test checks/acceptance.test.mjs

The untouched baseline should report four test groups: OPEN, SORT and EMPTY
fail; COMMON passes. A nonzero exit is intentional. These checks cover the
bounded contract below, not every possible input.

Required behavior
Inputs are arrays of task objects with unique string IDs, boolean done values
and finite numeric priorities. Invalid inputs are outside this exercise.
1. filterOpen returns only done === false tasks in their original order,
   without changing the input array or task objects.
2. sortedByPriority returns a new array in ascending numeric priority order.
   Lower numbers come first; ties keep their original order. The original
   array and task objects stay unchanged, including for an empty input.
3. completionPercent returns (completed tasks / total tasks) * 100 without
   rounding, or 0 for an empty list. Inputs stay unchanged.

Concrete example
ID       a       b       c       d
Done     false   true    false   true
Priority 3       1       2       1
Open IDs: a, c
Priority order: b, d, c, a; original order must remain a, b, c, d
Completion percentage: 50; an empty list returns 0 rather than NaN

How to practice
1. Keep an untouched copy of this ZIP or the original source. Open only the
   project folder in the editor. Keep checks outside its editable workspace.
   Do not change the acceptance suite to make a bad fix pass.
2. Start from a fresh original copy for each of the three independent cases.
   Ask for an explanation in read-only mode before requesting an edit. Keep
   the same model, settings and prompt language across the cases.
3. Request a change only to the selected function and a new regression test.
   Exclude dependency changes, network access and unrelated refactoring.
4. Review every edited or added file before running it. Save the original,
   corrected source and diff. A diff screen may appear after edits are saved.
5. Run the unchanged acceptance suite yourself, outside the editor's agent.
   Save actual output, retries and manual corrections. In a one-function
   case, its group and COMMON should pass while the two untouched deliberate
   bugs still fail. Combining all three correct fixes should pass all groups.

Example first prompt
Read only src/tasks.mjs. Explain what filterOpen returns and why. Its contract
is to return open tasks (done === false) without changing the input or order.
Point to the relevant line. Do not edit files or run commands.

Then request
Fix only filterOpen in src/tasks.mjs and add a regression test. Keep other
functions and the independent acceptance checks unchanged. Do not run commands,
install dependencies, use the network or read outside this project. Explain
the change and say which checks still need to be run.

For the other cases, substitute sortedByPriority or completionPercent and
state its contract above. Start again from the original source each time.

Use only an editor installation, account and allowance you may already use.
No Cloud Agent or private repository is needed. Stop before unexpected costs,
new access or an installation. A toy exercise cannot establish general speed,
reliability or Hebrew prompt quality. Record only what you actually observe.
The review's documentation-only disclosure still applies.

Reuse
You may copy, modify and share this original fixture and its checks for
practice. They are provided as-is without a warranty.
