Hidden Truncation Cases for a Structured-Output Hiring Packet
A structured-output hiring packet should pass only when a deterministic checker accepts valid tool calls and rejects truncated or over-broad payloads. Model confidence, a successful local demo, and a polished explanation are not evidence that the boundary holds under hidden cases. Graders freeze fixtures before any model runs, then execute those cases on a shared runtime that candidates cannot…
A structured-output hiring packet must pass inspection only when a deterministic checker validates valid tool calls while rejecting truncated or overly broad payloads. Confidence in the model's ability, a successful local demo, or a polished explanation does not guarantee the boundary holds under hidden cases. Graders isolate fixtures before execution, with those cases run on a shared runtime inaccessible to candidates.
Optional drafting help may propose additional cases, but the score belongs to the checker and the frozen fixture contract. The packet's purpose is to measure whether a candidate can distinguish unsafe model text from a safe tool request. It does not assess taste, prompt speed, or the ability to provide a debugging narrative after the fact.
Passing submissions must reject incomplete JSON, unknown tool names, unexpected keys, and paths that break the assigned workspace. A failing submission may still appear impressive if a reviewer focuses on the prose rather than the hidden fixture results. Three boundaries shape the design, each requiring visibility in both the candidate prompt and the rubric.
The checker determines acceptance, the fixture file specifies expected reasons, and the shared runtime governs the execution environment. A model can submit a payload but cannot alter the schema, label failure reasons, or omit cases. This division maintains hiring stability even when model output varies across cohorts. The candidate prompt should be concise and strict enough to ensure grading without additional meetings.
It must specify allowed tools, the exact key set, and the rule that extra keys result in failure rather than providing hints. The prompt also clarifies that no tool executes until the checker returns an accept decision for that single payload. Hidden fixtures accompany the grader and cover truncation, repeated call identifiers, and paths that exit the workspace.
Provide the public fixture file in the same archive, and state which command must successfully execute before a reviewer reviews the accompanying written explanation. Exclude hidden rows from the archive to prevent memorization of the transcript. Implement the acceptToolCall(raw) function in Node.js. The input is a string representing a purported tool call from the model.
Accept only objects with keys precisely matching name, call_id, and args. The allowed names are read_file, list_dir, and search_text. The call_id must adhere to the regular expression ^[a-z0-9]{8,32}$. For read_file, args.path must be a non-empty relative string without dot-dot segments or a leading slash. Reject invalid JSON, extra keys, unknown tools, and empty input.
Do not execute the tool. Return an object containing the ok and reason properties. Public fixtures should encompass at least one accept case and three reject cases, enabling candidates to comprehend the contract. Hidden fixtures should modify values without altering the contract, preventing reliance on a hardcoded map of sample strings.
Each line represents a JSON object containing the raw payload, a stable identifier, and the expected reason code. The grader compares reason codes, not pretty-printed objects, making incidental whitespace irrelevant to a wrong decision. Construct the cut-off case programmatically rather than manually editing braces, ensuring the truncation is evident and reproducible.
The example snippet below is part of the reference packet and has not been executed while this article was written. Readers should run it on a laptop or the pinned runtime before considering the snippet as verified. The same approach should appear in the hidden file, using different identifiers and relative paths.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to