DEV Community

Quinn Zhu
Quinn Zhu

Posted on

Interview One Red Test Before You Touch the Code

You do not need a first-day pull request.
You need one failing test explained in plain language.
Interview that test and write zero patches today.

Why hour one usually fails

You clone a brownfield repository and then freeze.
The source tree looks endless and slightly hostile.
So you dump whole folders into an assistant.

The model fills gaps with invented architecture claims.
The patch may compile on your laptop by luck.
Continuous integration still fails, and you cannot explain why.

Cheap generation makes that failure look cheap too.
It does not make the review cheaper for you.
You still defend every line during morning standup.

The hour-one rule

Hour one stays a read-only interview on purpose.
You may run git, tests, and a glossary drill.
You may not emit a diff until citations hold.

This workflow fits juniors joining a messy codebase.
It does not replace a human onboarding buddy nearby.
Keep one teammate in the loop after the hour.

What this interview is not

This is not a license to skip reading the test.
The model only restates symbols you already opened.
If you skip the read, the glossary will be fake.

This is not an agent loop over the whole repository.
Agent workflows assume context you do not have yet.
Your job on day one is to stop that assumption.

This is not a performance benchmark of any vendor.
The win is a glossary you can defend tomorrow.
Speed does not matter if you cannot name the assertion.

What you will actually produce

You leave hour one holding four small artifacts.
None of those artifacts is a pull request yet.

  1. A join tape captured from five local commands.
  2. One pinned test file, red or densely representative.
  3. A twelve-term glossary with explicit file citations.
  4. A question log the assistant is required to obey.

Step 1: Record a join tape

Open a clean shell inside an empty working directory.
Do not start a chat window before facts exist.

mkdir -p "$HOME/join-tape"
cd "$HOME/join-tape"
git clone "$REPO_URL" repo
cd repo
git rev-parse --short HEAD | tee "$HOME/join-tape/head.txt"
git log --oneline -15 | tee "$HOME/join-tape/recent.log"
Enter fullscreen mode Exit fullscreen mode

Run the smallest test command your documents name.
Prefer the command CI runs, not a random local subset.

# labeled example: swap in the gate your repo documents
if [ -f Makefile ] && grep -q '^test:' Makefile; then
  make test 2>&1 | tee "$HOME/join-tape/gate.log"
elif [ -f package.json ]; then
  npm test --silent 2>&1 | tee "$HOME/join-tape/gate.log"
elif [ -f pyproject.toml ]; then
  python -m pytest -q 2>&1 | tee "$HOME/join-tape/gate.log"
else
  echo "NO_GATE" | tee "$HOME/join-tape/gate.log"
fi
Enter fullscreen mode Exit fullscreen mode

Copy the CODEOWNERS file when that path actually exists.
Write NO_OWNERS into the tape when it does not.

if [ -f CODEOWNERS ] || [ -f .github/CODEOWNERS ]; then
  find . -name CODEOWNERS -exec cat {} \; | tee "$HOME/join-tape/owners.txt"
else
  echo "NO_OWNERS" | tee "$HOME/join-tape/owners.txt"
fi
Enter fullscreen mode Exit fullscreen mode

You now hold a tape instead of a guess.
Paste only that tape when the interview starts.

Step 2: Pin one test, not the repository

Open the gate log and pick one failing name.
If the suite is green, pin one dense test instead.

# labeled example: skim likely failures only
rg -n "FAIL|ERROR|failed" "$HOME/join-tape/gate.log" | head
Enter fullscreen mode Exit fullscreen mode

Copy that test file into the tape directory.
Leave the production module out of the paste for now.

# replace the path with the test you actually pinned
cp tests/test_billing_invoice.py "$HOME/join-tape/pinned_test.py"
wc -l "$HOME/join-tape/pinned_test.py"
Enter fullscreen mode Exit fullscreen mode

Read the pinned test once without any assistant.
Mark setup, act, and assert with your own comments.

You are stealing a public contract from the test.
You are not asking a model to rewrite that contract.

Step 3: Cap the questions at seven

Write seven questions before any model sees files.
Each question must cite the pinned test path.
Throw away questions that request a patch or refactor.

Use this checklist as a hard filter.

  1. Does this written question name pinned_test.py as a path?
  2. Does it ask what a symbol means, never how to rewrite it?
  3. Can the join tape plus that test answer it?
  4. Would a teammate recognize the term during standup?
  5. Is the expected answer one paragraph, never a diff?

Here is a labeled question set for adaptation.
Change every name to match your pinned file.

Q1. In pinned_test.py, what does make_invoice() require?
Q2. Which assertion defines "paid" for this fixture?
Q3. What collaborator does the test fake, and where?
Q4. Which error path is missing from the tape log?
Q5. What term should I use for the setup helper?
Q6. Which CODEOWNERS line, if any, covers this file?
Q7. What would break if I renamed the fixture only?
Enter fullscreen mode Exit fullscreen mode

If a question fails the filter, delete that question.
Do not let the model invent extra follow-up questions.

Step 4: Run the interview in ask mode

Paste the join tape files and the pinned test only.
State the rules inside one short instruction block.

You are in ask mode. Write zero patches.
Use only the join-tape files I paste.
If the tape is silent, reply "not in tape".
Answer each numbered question in one paragraph.
End every answer with the file path you used.
Do not suggest a pull request.
Enter fullscreen mode Exit fullscreen mode

A local chat window is enough for this interview.
You do not need a paid cloud burst for onboarding chatter.

Disclosure: This article was prepared as part of MonkeyCode's product outreach.
MonkeyCode provides free model access and a free server option.
Use them only if your laptop has no local model.
Skip both when your team already hosts one.

Keep secrets out of every paste you make.
The join tape must never include .env files or credentials.

Step 5: Type the glossary yourself

Do not treat the model's terms as canon yet.
Copy each accepted answer into a file you type.

# day-one-glossary.md
- make_invoice: builds an unpaid draft (pinned_test.py:14)
- paid: status after capture_charge() returns (pinned_test.py:31)
- gateway_stub: collaborator faked in setup (pinned_test.py:8)
Enter fullscreen mode Exit fullscreen mode

Every glossary term needs a path and line number.
Delete terms that arrive without a citation path.

Read the finished glossary out loud one time.
If you stumble on a term, the interview continues.

Step 6: Decide whether a PR exists

Use this table and do not negotiate rows.

| Signal | Next action |
| You have not read the pinned test | Stay inside hour one |
| Glossary has fewer than eight cited terms | Ask two more filtered questions |
| Gate log equals NO_GATE | Find a human; do not generate tests |
| You cannot explain one assertion aloud | Ship no pull request today |
| Glossary holds and the CI command is known | Tiny change tomorrow, not tonight |

Tomorrow's change should touch one assertion or name.
It should not refactor the module you just met.

Labeled example: a billing test

Treat this billing module as fiction for practice.
Do not copy it into a real payment service.
The point is the interview shape, not the domain.

Suppose pinned_test.py stubs a charge gateway.
The test builds an unpaid invoice, then captures payment.
The last assertion checks status == "paid" after capture.

Your seven questions stay inside that file's symbols.
You never ask the model to add retry logic.
Retry logic is a later PR, not an hour-one gift.

If the model answers with a new class name, reject it.
That name was not in the tape you pasted.
Write not in tape into the glossary gap instead.

A validator for the question log

Save this script as filter_questions.py beside the tape.
It rejects prompts that forget the pin or beg for patches.

#!/usr/bin/env python3
"""Reject day-one questions that skip the pinned test."""
from pathlib import Path
import sys

PIN = "pinned_test.py"
BANNED = ("patch", "refactor", "implement", "pull request", "diff")

def main(path: str) -> int:
    raw = Path(path).read_text().lower()
    lines = [ln.strip() for ln in raw.splitlines() if ln.strip()]
    bad = []
    for ln in lines:
        if PIN not in ln:
            bad.append(("missing-pin", ln))
        if any(word in ln for word in BANNED):
            bad.append(("banned-word", ln))
    for kind, ln in bad:
        print(f"{kind}: {ln}")
    print(f"checked {len(lines)} lines, {len(bad)} rejected")
    return 1 if bad else 0

if __name__ == "__main__":
    raise SystemExit(main(sys.argv[1]))
Enter fullscreen mode Exit fullscreen mode

Run it on your question file before the interview starts.

python3 filter_questions.py "$HOME/join-tape/questions.txt"
Enter fullscreen mode Exit fullscreen mode

If it rejects a line, rewrite that line.
Do not weaken the script so your prompt passes.

Limitations

This drill assumes at least one test file exists.
Repos without tests need a human walkthrough first.
Do not invent a test so the assistant has context.

The join tape is a snapshot, not permanent truth.
Default branches move and owner files go stale.
Re-run the tape when the default branch moves.

Ask-mode models can still hallucinate nearby symbol names.
Your citation rule is the brake, not the model.
Drop any answer that lacks a file path.

A free remote server remains a network server.
Do not paste customer data, keys, or database dumps.
Stay on paper notes when the module is secret.

Who should skip this drill

Skip this path if you already own the module.
Skip it during an active production incident window.
Skip it when legal review forbids external models.

Staff engineers may still steal the join tape idea.
They should not rebuild a glossary they already wrote.
Juniors should not skip the glossary to look fast.

After the hour

Send the glossary to your buddy in one message.
Ask which term is wrong and expect one correction.
Fix that term before you open an editor for a patch.

Your first pull request can wait until morning two.
Reviewers would rather see one correct rename land.
They do not want a generated architecture essay tonight.

Top comments (0)