A small TypeScript library with a bug. Part 1: make the failing tests pass without touching tests/. Parts 2 to 4 unlock in order as each part's public tests pass. In a mock interview the product owner asks for a plan before each part, and the grader reads your answer.
1Fix path normalization for repeated slashes and the root
2Direct impact
3Deleted subtree
4Propagation
Part 1: Fix path normalization for repeated slashes and the root
01Ownership lookups miss files whose paths arrive with doubled slashes, so changes under them are attributed to nobody.
02Registering a service at the repository root makes every later ownership lookup blow up instead of falling back to it.
03Paths with .. are supposed to be rejected, and that part works; keep it that way.
What the hidden tests check in Part 1
A path that is nothing but slashes normalizes to the root.
Dot segments disappear wherever they appear.
Containment is by whole segments: /ab does not contain /abc.
Paths with .. still throw a RangeError.
Hints for Parts 2 to 4 appear in the workspace as each part unlocks.