Conversation
…DeepSchema refs through DeepSchema-generated reviews previously only referenced their examples, references, and json_schema_path by path, forcing reviewer agents to make a Read tool call for each external file at review time. Make reference-file inlining a generic feature of the review pipeline: - Add `reference_files: list[ReferenceFile]` to both ReviewRule and ReviewTask (src/deepwork/review/config.py). - `.deepreview` rules gain an optional `review.reference_files` field (src/deepwork/schemas/deepreview_schema.json), parsed with paths resolved against the rule's source dir. - `build_instruction_file` emits a new `## Reference Materials` section with fenced contents of each referenced file, honoring MAX_INLINE_FILES (20) and MAX_INLINE_TOTAL_BYTES (256KB) caps, with graceful markers for missing/unreadable files (src/deepwork/review/instructions.py). - Matcher propagates `reference_files` from ReviewRule to ReviewTask for all strategies (src/deepwork/review/matcher.py). - DeepSchema bridge now populates reference_files from examples, references, and json_schema_path, resolved relative to the schema file's directory. URL-style entries (http/https) are skipped. Missing-file errors are surfaced via the existing errors channel of generate_review_rules (src/deepwork/deepschema/review_bridge.py). - Fix a pre-existing broken relative path in the job_yml standard schema (`../../../doc/...` → `../../../../doc/...`) that the new error-surfacing flagged (src/deepwork/standard_schemas/job_yml/deepschema.yml). Tests cover inlining, count/byte caps, missing files, .deepreview parsing, and DeepSchema bridge population + error surfacing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Follow-up to the review pipeline reference_files work: - DeepSchema bridge now lists `examples` (path + description) inside the generated review instructions instead of inlining their contents, keeping the prompt lean. `references` and `json_schema_path` are still inlined. - Add REVIEW-REQ-001.10 (Reference Files config), REVIEW-REQ-005.8 (Reference Materials section + caps), and DW-REQ-011.11 (Review Bridge Reference Files) covering the new end-user-observable behavior. - Add traceability comments on the new tests referencing the new REQ IDs. - Add test coverage for the new listing behavior and URL-reference skipping. - Document reference_files in README_REVIEWS.md and the deepreviews skill, including the 20-file / 256 KB caps and the examples-listed-vs-references- inlined split for DeepSchema-generated reviews. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DeepSchema-generated reviews only pointed reviewers at their
examples,references, andjson_schema_pathby path. Running just thejob_yml DeepSchema Compliancereview for a singlejob.ymlforced the reviewer to Readjob.schema.json, several templates, anddoc/job_yml_guidance.mdat runtime — the main source of tool-call overhead.Approach
Make reference-file inlining a generic feature of the review pipeline rather than a DeepSchema-only fix.
ReviewRuleandReviewTasknow carryreference_files: list[ReferenceFile]..deepreviewrules get an optionalreview.reference_filesfield (schema + parser).build_instruction_fileemits a new## Reference Materialssection with fenced contents, honoringMAX_INLINE_FILES = 20andMAX_INLINE_TOTAL_BYTES = 256 * 1024, with graceful markers for missing files.reference_filesfrom rules to tasks across all strategies.reference_filesfromexamples,references, andjson_schema_path, resolved relative to the schema file's directory. URL-style entries are skipped. Missing files surface via the existing errors channel fromgenerate_review_rules.Also fixes a pre-existing broken relative path in
src/deepwork/standard_schemas/job_yml/deepschema.ymlthat the new error-surfacing flagged.Before / After
Generated instruction file for
job_yml DeepSchema Complianceonsrc/deepwork/standard_jobs/deepwork_jobs/job.yml:## Review Instructions(summary + requirements) +## Files to Review. Reviewer had to Readjob.schema.json,templates/job.yml.example,templates/job.yml.template,templates/step_instruction.md.template,research_report_job_best_practices.md, anddoc/job_yml_guidance.md.## Reference Materialssection containing all of those files inlined. Reviewer makes zero extra Read calls for the schema's referenced material.Verification
uv run pytest— 1263 passed, 1 skipped, 1 xfailed.uv run ruff check src tests— clean.uv run mypy src/deepwork/review/instructions.py src/deepwork/review/config.py src/deepwork/deepschema/review_bridge.py— clean.job_yml DeepSchema Complianceinstruction file and confirmed the new section contains the six reference files.New tests cover: inlining with description + fenced blocks, count cap, byte cap, missing file, empty list,
.deepreviewparsing, and DeepSchema bridge population + error surfacing.Files
src/deepwork/review/config.py— newReferenceFile; field onReviewRule/ReviewTask;.deepreviewparser.src/deepwork/review/instructions.py— caps,_build_reference_files_section, wired intobuild_instruction_file.src/deepwork/review/matcher.py— propagatereference_filestoReviewTask.src/deepwork/schemas/deepreview_schema.json— optionalreference_filesfield.src/deepwork/deepschema/review_bridge.py—_collect_reference_fileshelper.src/deepwork/standard_schemas/job_yml/deepschema.yml— fix broken../../../doc/...path.tests/unit/review/test_instructions.py,tests/unit/review/test_config.py,tests/unit/deepschema/test_review_bridge.py— new tests.🤖 Generated with Claude Code