MetaCyberGuru: make retries safe by contract

Requirements: Node.js 20 or later. No packages, accounts, network or server needed.

1. Extract every file into one directory and open a terminal there.
2. Run: node --test contract.test.mjs
   The starter deliberately fails seven checks. A failing exit code is expected.
3. Run: node exercise.mjs
   This writes result.json with every input, expected response and decision trace.
4. Edit config.json and rerun the tests. Fix one failure group at a time.
5. Compare fixture.json and expected.json to understand each criterion.

Configuration schema (this is not OpenAPI):
  validateBody: boolean
  idempotency: "off", "key-only" or "fingerprint"
  authorizeBeforeReplay: boolean
  maxTitle: integer 1 to 120 (target contract: 80)

Target behavior:
  POST /notes accepts exactly {"title":"..."}.
  Trim title and allow length 1 through 80 UTF-16 code units.
  Malformed JSON: 400; invalid fields: 422.
  No identity: 401; permission revoked: 403; wrong method: 405 with Allow: POST.
  Commit then lose the response: clientStatus null, server status 201, one note.
  Same key and normalized title: return original 201/id with no second write.
  Same key and different normalized title: 409 with no second write.
  Authorize on every attempt before any cached response is returned.
  Rejected validation does not reserve a key.

One solution: validateBody true, idempotency "fingerprint",
authorizeBeforeReplay true, maxTitle 80. Try explaining each failed check
before applying all four values.

The engine is identical to the browser workbench's bounded teaching model.
Each suite case starts a new in-memory session and executes its requests in order.
At most 100 notes can be created per session. No requests are sent anywhere.
fixture.json lists the exact request sequences and expectations.
expected.json is generated with the solution configuration.
starter-result.json is generated with the deliberately broken configuration.

Limits: one route, one fixed identity whose permission can change, sequential
requests, no durable writes or concurrency, no key expiry or multi-tenant key
namespacing, no duplicate-JSON-key detection. Fingerprints cover only the
normalized title, not arbitrary objects. A production design needs identity-
scoped keys, atomic persistence, retention rules and concurrency tests.

References:
https://www.metacyber.guru/articles/backend-api-contract-guide
https://www.rfc-editor.org/rfc/rfc9110.html#name-idempotent-methods
https://www.metacyber.guru/dev-lab/#contract-lab
