@@ -177,16 +177,22 @@ def _get_allowed_write_folders(render_context: RenderContext) -> list[str]:
177177def _get_allowed_read_folders (render_context : RenderContext ) -> list [str ]:
178178 """Return normalized absolute paths of folders the agent can read from.
179179
180- This is the write set plus the module's memory folder. Agents may browse and read
181- persisted memory notes (via read_file/grep/ls_files) on demand, but may only add to
182- them through the dedicated write_memory tool — so the memory folder is intentionally
183- readable here while staying out of the write set.
180+ This is the write set, plus the module's memory folder, plus the whole
181+ conformance-tests root. Agents may browse and read persisted memory notes (via
182+ read_file/grep/ls_files) on demand, but may only add to them through the dedicated
183+ write_memory tool — so the memory folder is intentionally readable here while staying
184+ out of the write set. The conformance-tests root is readable (read-only) so agents can
185+ consult sibling modules' conformance tests as reference examples of how a conformance
186+ test project for this project is laid out, built, and wired to run in isolation.
184187 """
185188 folders = list (_get_allowed_write_folders (render_context ))
186189 memory_manager = getattr (render_context , "memory_manager" , None )
187190 memory_folder = getattr (memory_manager , "memory_folder" , None ) if memory_manager else None
188191 if memory_folder :
189192 folders .append (os .path .normpath (os .path .abspath (memory_folder )))
193+ conformance_root = getattr (render_context , "conformance_tests_folder" , None )
194+ if conformance_root :
195+ folders .append (os .path .normpath (os .path .abspath (conformance_root )))
190196 return folders
191197
192198
@@ -229,6 +235,8 @@ def build_sandbox_contract(render_context: RenderContext) -> str:
229235 if script
230236 ]
231237 modules_root = _get_modules_root (render_context )
238+ conformance_root = getattr (render_context , "conformance_tests_folder" , None )
239+ conformance_root = os .path .normpath (os .path .abspath (conformance_root )) if conformance_root else None
232240
233241 lines = ["You can WRITE (create/edit/delete files) ONLY inside these folders:" ]
234242 lines .extend (f"- { folder } " for folder in write_folders )
@@ -241,10 +249,17 @@ def build_sandbox_contract(render_context: RenderContext) -> str:
241249 lines .append ("- The test/setup scripts (read-only harness files):" )
242250 lines .extend (f" - { script } " for script in scripts )
243251 lines .append ("- Temporary files under /tmp and /var/folders (e.g. saved test output)." )
252+ if conformance_root :
253+ lines .append (
254+ f"- Every module's conformance tests under the conformance-tests root ({ conformance_root } ) "
255+ "(read-only). Sibling modules' conformance tests can be a good source of information — they "
256+ "already build and pass in this project's test harness. Explore them with ls_files/grep to "
257+ "find a relevant one rather than reading them all."
258+ )
244259 lines .append ("- Any file outside the modules root (project files, libraries, dependencies)." )
245260 lines .append (
246- f"- NOT other modules' folders under the modules root ({ modules_root } ): your build folder "
247- "already contains the merged code of the modules it builds on — read that copy instead."
261+ f"- NOT other modules' implementation/build folders under the modules root ({ modules_root } ): your "
262+ "build folder already contains the merged code of the modules it builds on — read that copy instead."
248263 )
249264 lines .append ("" )
250265 lines .append ("Rules:" )
@@ -258,6 +273,13 @@ def build_sandbox_contract(render_context: RenderContext) -> str:
258273 "- Do NOT run the full test suite via run_command — it runs automatically when you submit. "
259274 "Run single targeted tests instead."
260275 )
276+ lines .append (
277+ "- Other modules' conformance tests can be used as references of tests that build and pass "
278+ "see how they are structured and made to build and run in isolation — project layout, build "
279+ "and packaging configuration, dependency declarations, and test bootstrapping/fixtures. Do NOT "
280+ "copy their test assertions or the behavior they verify: each module covers different "
281+ "functionality."
282+ )
261283 return "\n " .join (lines )
262284
263285
0 commit comments