AI-assisted engineering/AI-collaboration build

Fix owners_of so reviews reach the right team

AI-collaboration buildHard40 min

A review bot reads an OWNERS file to pick who reviews each changed file. Since its lookup was rewritten, some teams miss reviews of their code and others get pinged for files they gave up.

Your task

Fix owners_of so it honors its contract. The assistant may help, and it may be wrong more than once.

  • the last rule that matches a path wins, and a rule with no owners takes them away
  • * and ? never match a slash, **/ matches zero or more directories, and any other character matches only itself
  • a pattern that ends in / matches every file under that directory, at any depth
  • only a slash at the start or in the middle anchors a pattern at the root; any other pattern matches at any depth
  • leave parse and run_case alone; the tests call run_case

Hidden tests run at submit. Your prompts, runs and edits are the trace the critique reads.