Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "What does this path check print?" on CodeWiki (https://codewiki.com/practice/predict/ai-era/agent-instructions-and-mcp/predict-normalized-tool-paths/).
Context (verbatim from the page):
"""
import { posix } from "node:path";
function verdict(raw) {
const path = posix.normalize(raw);
return path.startsWith("src/") && path.endsWith(".ts")
? `ALLOW ${path}`
: `DENY ${path}`;
}
console.log(verdict("src/config.ts"));
console.log(verdict("src/../secrets/token.txt"));
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in javascript. Where you are unsure, say so.