Log inBook a Demo
BuildMidBackendAuto-graded

Fix a JSON Pointer that mangles escaped tokens

Fiddly escaping rules and clear error reporting decide this one, rather than anything conceptually hard.Paths into JSON documents appear all over the codebase — webhook routing rules, config overrides, event selectors — written as /payload/items/0/sku. That syntax is RFC 6901, JSON Pointer. The resolve() here is close but violates the spec in three subtle ways, and a missing path escapes as a raw KeyError or IndexError straight to the client. Make it match the RFC, and fail cleanly with a ResolveError.
30 min
python

You're done when

  • The RFC's own reference cases all resolve to the values the specification says.
  • Numeric tokens index into arrays rather than being treated as object keys.
  • Escaped tokens decode correctly, and in the order the spec mandates — the tilde and slash escapes are not interchangeable.
  • A path that does not exist raises ResolveError instead of leaking a raw lookup error.
  • Behaviour matches a reference implementation across a broad set of generated inputs.

What it measures

Data structures and algorithmsWalking a document by path across both object and array nodes, decoding tokens correctly at each step.
Test case designTesting against the specification's own cases and a differential oracle rather than a handful of hand-picked paths.
Specification fidelityHonouring details like escape decoding order, where an implementation that looks right is wrong on exactly the inputs an attacker picks.

Your environment

Terminal + editorA full shell in the browser
Claude CodePre-authenticated, no key setup
Isolated microVMYours alone, wiped afterwards

Start this lab

30 min
Start labYou'll sign in to Anthropos to start. The lab opens in a private cloud workspace with Claude Code ready to use.
AI Labs is part of Anthropos Workforce. Not on your plan yet? Book a demo