TASK PACKET AUDIT — WORKED SAMPLE

See what the audit actually returns.

One vague referral ticket arrives looking like a feature. The audit exposes five ordered packets, ten repository fills, three runnable checks, and the rollback that must exist before the first line ships.

SyntheticNo client workNo real repositoryComplete format
Good Love Mind · Task Packet Audit

Referral credits without invented money logic.

The ticket asks for a referral feature. The hardened packet spots stored value, ownership, erasure, an undefined trust score, and an audit trail that cannot prove itself.

The ticket as received

One paragraph. Five systems.

Add a referral program to the app.

When a user refers a friend, both of them get 500 credits. Credits work like our normal balance so people can spend them on anything. Show a trust score on the referrer's dashboard so we can spot abuse—people making fake accounts to farm credits. If the trust score is low, hold the credits.

Users can erase their account at any time, and referral history has to stay intact for the audit trail so we can prove what happened if someone challenges a payout. Log everything.

Credits should only be released once the friend actually pays for something, so we do not get farmed.

Acceptance: referral program works, abuse checks are in place, audit trail exists. Need it this week.

142 words. Reads like one task. It is five.

0 · Exposure

Read this before anything runs.

CROWN. This ticket reaches stored value. Credits spend like currency, which makes them a liability on the books. It also reaches ownership and erasure.

No packet below auto-runs. The agent writes nothing until the owner approves the split. Money-adjacent packets carry a Money Truth assertion: the ledger must reconcile against the balance the user sees.

1 · Size

A PROGRAM WEARING A TASK'S CLOTHING

Two new stores, one scoring surface, one audit log, one dashboard surface, one release rule, and one erasure path cannot share one red test. Split the work before an agent silently chooses the order.

#PacketExposureNeedsWhy here
AAppend-only credit ledgerCrown · moneyNoneNothing else is safe on a mutable balance column.
BReferral record + ownershipCrown · ownershipANeeds a ledger to point at.
CRelease after first cleared paymentCrown · moneyA, BResolves grant versus release.
DTrust scoreNoneBAdvisory only after money is already held.
EErasure against retentionCrown · ownershipA, BSeparates identity from retained events.

This packet covers A only. B through E follow one at a time, in that order.

2 · Numbered fills

Facts the agent is not allowed to invent.

#Fill from live filesWhy it matters
01ORM / query layerSets the real implementation shape.
02Migration tool + exact commandStops an invented production command.
03Test runner + exact commandThe red test needs a command that runs.
04Existing balance table and columnNames today's source of truth.
05Every current balance writerA second writer breaks the invariant.
06Auth middleware pathIdentity comes from the session.
07Ownership helper path and signatureBlocks client-supplied ownership.
08Credit precision and unitMoney math never rests on a float guess.
09Runtime database role and grantsAppend-only must hold at the database.
10CI configuration pathThe named test must run on every push.

Ten fills. Every one marks a place where an agent would otherwise invent something plausible and move on.

3 · Failure-class hunt

Four failures that survive a normal read.

3.1 · Self-contradiction — two found

“Both users get 500 credits” conflicts with “release credits only after payment.” Resolve it as two events: grant held credits at referral, release them only after a cleared payment. Held and spendable remain separate facts.

“Erase the account” conflicts with “keep referral history.” Store a pseudonymous account reference in the ledger and keep identity in a separate map. Erasure severs the map while events remain provable.

3.2 · Undefined number — found

“Trust score” has no inputs, range, threshold, formula, or zero case. Packet D must return the full formula or show the underlying signals with no invented score. A number without a formula is an agent's opinion wearing a decimal point.

3.3 · Unfalsifiable criteria — three found

OriginalNamed testGoes red when
Audit trail existsledger.append_only.specThe runtime role can update or remove a ledger row.
Referral program worksledger.reconciles.specEvent sum differs from the balance shown.
Abuse checks are in placereferral.hold_release.specHeld credit becomes spendable without a cleared payment.

3.4 · Self-reported control — found

An ordinary audit table is not proof. If the application can write it, the application can rewrite it. Make the ledger append-only at the database level. Grant INSERT and SELECT to the runtime role; revoke UPDATE and DELETE. Hash-chain each event to its predecessor so a removed row leaves a visible break.

4 · Recurring smells

The sweep catches what the ticket never names.

SmellPresentResolution
Client-supplied identityYesThe referrer comes from the authenticated session, never the request body.
Mutable audit logYesDatabase grants and a hash chain enforce append-only history.
Free-string ownerLikelyUse a foreign key to the pseudonymous account reference.
Constant copied per rowPossibleKeep program-wide constants outside event rows.
Orphan interfaceYesShip the dashboard score with packet D, never before its truth exists.
5 · Packet A

The work, stated without the hidden program.

Every change to an account's spendable amount becomes an immutable event. Compute the balance from events. Never store it as the only mutable truth.

Event types: GRANT_HELD · RELEASE · SPEND · REVERSE · ADJUST

Each row carries a pseudonymous account reference, signed amount in the approved unit, event type, cause reference, timestamp, and previous-event hash.

Out of scope: referral records, release rules, trust score, and dashboard work. Mixing them back in turns the packet into a program again.
6 · Red test

ledger.append_only.spec

GIVEN  a ledger row written by the runtime role
WHEN   that role attempts UPDATE on the row
THEN   the database refuses the statement
AND    when that role attempts DELETE
THEN   the database refuses the statement
AND    when a stored previous-hash changes out of band
THEN   chain verification reports the first broken row

Money Truth assertion

GIVEN  an account with at least one ledger event
WHEN   signed event amounts are summed
THEN   the sum equals the spendable balance shown to that account
AND    held value remains separate from spendable value

The loop cannot go green while those facts drift. If either test passes before the work exists, the test is wrong—fix the test first.

7 · Rollback

Written before work starts.

  1. Turn ledger.enabled off. Reads return to the existing balance source named by fill 04.
  2. Keep the ledger table. A rollback never destroys evidence.
  3. Reverse the new runtime grants with the reviewed migration.
  4. Stop dual-write at the flag so the prior balance remains authoritative.
  5. Trigger: any production reconciliation mismatch. One row is enough.
8 · Readiness

READINESS — 6 / 10

Structure is complete. Repository truth is not.
Ten named fills remain for the owner to answer from live files.
6 / 10
SectionScoreEvidence
Exposure classified1 / 1Crown—money and ownership.
Size and order1 / 1Five packets with prerequisites.
Fills named1 / 1Ten, each addressed to the owner.
Fills answered0 / 2Live repository pass still required.
Failure classes resolved1 / 2Two resolutions rest on live fills.
Smells swept1 / 1Five present, each routed.
Red test runnable0 / 1Needs fill 03's real command.
Rollback written1 / 1Trigger included.
NOT READY Ten out of ten is a score, never permission. The owner reads the filled packet and flips it.
One ticket · one packet · $250

Harden the ticket before the agent ships the guess.

Send a summary up to 200 words. The full ticket follows after payment confirmation.

Start your audit — $250