async def test_prompt_structure_integrity(self, tool, temp_repo, mock_redis):
        """Test that the prompt structure is well-formed and doesn't have content duplication"""
        temp_dir, config_path = temp_repo

        request = PrecommitRequest(
            path=temp_dir,
            files=[config_path],
            original_request="Validate prompt structure",
            review_type="full",
            severity_filter="high",
        )

        prompt = await tool.prepare_prompt(request)

        # Split prompt into sections
        sections = {
            "original_request": "## Original Request",
            "review_parameters": "## Review Parameters",
            "repo_summary": "## Repository Changes Summary",
            "context_files_summary": "## Context Files Summary",
            "git_diffs": "## Git Diffs",
            "additional_context": "## Additional Context Files",
            "review_instructions": "## Review Instructions",
        }

        section_indices = {}
        for name, header in sections.items():
            index = prompt.find(header)
            if index != -1:
                section_indices[name] = index

        # Verify sections appear in logical order
        assert section_indices["original_request"] < section_indices["review_parameters"]
        assert section_indices["review_parameters"] < section_indices["repo_summary"]
        assert section_indices["git_diffs"] < section_indices["additional_context"]
        assert section_indices["additional_context"] < section_indices["review_instructions"]

        # Test that file content only appears in Additional Context section
        file_content_start = section_indices["additional_context"]
        file_content_end = section_indices["review_instructions"]

        file_section = prompt[file_content_start:file_content_end]
        prompt[:file_content_start]
        after_file_section = prompt[file_content_end:]

        # File content should appear in the file section
        assert "MAX_CONTENT_TOKENS = 800_000" in file_section
        # Check that configuration content appears in the file section
        assert "# Configuration" in file_section
        # The complete file content should not appear in the review instructions
        assert '__version__ = "1.0.0"' in file_section
        assert '__version__ = "1.0.0"' not in after_file_section
Test that the prompt structure is well-formed and doesn't have content duplication
tests/test_precommit_with_mock_store.py