Skip to content

Package preview: tests Codex may also need (hint only) - #30

Merged
razbenaharon merged 3 commits into
mainfrom
feature/package-test-hint
Nov 21, 2026
Merged

razbenaharon merged 3 commits into
mainfrom
feature/package-test-hint

Conversation

@razbenaharon

@razbenaharon razbenaharon commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Draft for the owner's approval. Do not merge before that.

What changes

  • may_also_need hint (review.package, review.package_lines): for each sent source file, up to 3 existing test files the package does not include, found by name only — Python src/pkg/foo.py → tests/test_foo.py, then tests/test_foo_*.py; JS/TS dir/foo.ts → dir/foo.test.*, dir/foo.spec.*, then dir/__tests__/foo.*. Exact matches first, then the others one per source file in turn.

    • Folder listings only (os.scandir / lstat); no file is opened. Links, junctions and folders reached through them are not listed.
    • Every candidate passes file_rules.screen, and noshell._secret_reference drops secret-shaped names. A file already named is not offered again.
    • Nothing is added; the package id does not change. The preview prints Codex may also need (not added): ….
    • delegate replies carry it too (_VISIBLE, _review_lines); it is removed before the package is written to the review ledger.
    • A retry_package from Say when a file's name stopped a review, and offer the package without it #29 is built by package(), so it carries its own hint.
  • Server instructions within 2,048 characters (Claude Code's cut before 2.1.296), with MAX_INSTRUCTION_CHARS = 2048 in server_instructions.py:

    Variant Characters (= bytes, ASCII)
    proactive on 1,995
    proactive off 2,008
    standing grant (on or off) 2,014
    • First paragraph is the retry_package rule: show the user what was left out, why, and what that package sends; use its package_id only after the user explicitly agrees, even with a standing grant.
    • Repeated sentences merged: the two "verify" paragraphs became one; parts the tool descriptions already state (round count, package_id hand-off, "before your final message") were dropped.
    • Kept: "in files (paths relative to the working directory, at most 32)", showing the larger package and asking before calling again after a completion_request, and the new sentence — include the tests covering the change, one caller of each changed public function and the config it reads; Codex can ask only for files the sent code names.
  • Length test (tests/test_r10_checkpoint_instructions.py): SIZE_CEILING_BYTES back to 2,400 for every shipped text; the same test holds every server-instruction variant (proactive on, off, standing grant with proactive on and off) to 2,048 characters. A new test checks the retry rule comes first in every variant. tests/test_adapters.py and the server check now assert ≤ 2,048 instead of < 4,096.

  • CHANGELOG (Unreleased) and one README sentence.

Tests

tests/test_review_flow.py: hint found with noshell._read_file recording only app.py; excluded (.modelquadignore) and secret-named candidates never offered; a named test not offered again; package id unchanged; cap of 3 with exact matches first; JS/TS conventions; a junctioned tests folder is not listed; the hint reaches the review reply but not the ledger manifest.

Locally: python scripts/check.py review PASS (1,613 passed); python scripts/check.py python PASS (3,261 passed, 39 skipped, 2 xfailed).

Demo on this repository

  • review.may_also_need(repo, ["src/modelquad/review.py", "src/modelquad/execution/noshell.py"], same) → tests/test_review_flow.py, tests/test_noshell_workers.py, tests/test_review_ledger.py.
  • The preview of that pair is refused (supplied_file_secret): noshell.py holds credential-shaped example text. Its retry_package (review.py alone) shows tests/test_review_flow.py, tests/test_review_ledger.py, tests/test_review_reminder.py.

🤖 Generated with Claude Code

razbenaharon and others added 3 commits November 21, 2026 22:06
… a sufficient package holds

For each source file in a package, the preview lists up to three existing
test files the package does not include, found by naming convention from
folder listings only (no file is opened). Each candidate passes
file_rules.screen and the secret-name screen; a named file is never offered
again. Exact matches come first, then the others one per source file in
turn. Nothing is added by itself, the package id does not change, and the
hint (`may_also_need`) stays out of the review ledger.

The server instructions now ask Claude to include the covering tests, a
caller of each changed public function and the config it reads, since
Codex can ask only for files the sent code names.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both sides: the secret-name refusal and retry package from #29, and
the may_also_need hint. The server instructions now carry both new
sentences; at 2,520 bytes they pass the suite's size ceiling, which moves
from 2,400 to 2,600 (Claude Code's cut is 4,096). The tests sentence sits
after the exclusion sentence, so "one" there still means a named file.
The junction test spawns with no_window_kwargs, as the suite requires.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude Code before 2.1.296 keeps only the first 2,048 characters of an
MCP server's instructions. Every variant ModelQuad sends now fits: proactive
on 1,995, proactive off 2,008, standing grant 2,014 (ASCII, so the same in
bytes). Repeated sentences are merged (the two "verify" paragraphs; parts
the tool descriptions already state), and the pinned wording is kept:
paths relative to the working directory, showing the larger package and
asking before a completion round, and the tests / one caller / config
sentence.

The retry_package rule is now the first paragraph: show what was left
out, why and what that package sends, and use its package_id only after
the user explicitly agrees, even with a standing grant.

The template size ceiling is back at 2,400 bytes; the same test now also
holds every server-instruction variant, the standing grant with proactive
off included, to MAX_INSTRUCTION_CHARS = 2048.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@razbenaharon
razbenaharon marked this pull request as ready for review November 21, 2026 20:54
@razbenaharon
razbenaharon merged commit 9ae16eb into main Nov 21, 2026
7 checks passed
@razbenaharon razbenaharon mentioned this pull request Nov 21, 2026
@razbenaharon
razbenaharon deleted the feature/package-test-hint branch November 22, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant