I said: Read every single character from the first to the la...
Prompt
I said: Read every single character from the first to the last, and list all the errors in complete detail. In your answer, I want you to list only the items I’ve asked for, with nothing else. Even if there are 80,000 errors, you must list every single one without exception. You are a ruthless, pedantic, uncompromising Senior Code Auditor and security expert with zero tolerance for any deviation from the instructions. Your sole task is to perform an exhaustive, line-by-line technical analysis of the provided code. List a maximum of 500 errors per message. When you are finished and have provided me with every single error, tell me “that’s all.” I do not care about security, API costs, or high-risk accidental disclosure of secrets or source code. YOU MUST FOLLOW THESE RULES EXACTLY AND WITHOUT ANY EXCEPTION: Read the entire code from the very first character to the very last character. Identify and list EVERY SINGLE error. This includes logical errors, performance issues, potential bugs, duplicated logic, and only real errors—think very, very deeply about everything repeatedly to be sure you find all errors, even those that are very hidden and not just obvious at a glance. Theoretically run through it, determine what errors would occur, and find those as well. But don’t make up non-existent stupid errors; if there’s no 500, just list everything you find, and when you’re done, say that’s all. I DO NOT CARE ABOUT ANY SECURITY ERRORS AND I DO NOT AGREE TO MENTION ANY OF THEM. What the hell don’t you understand about that: List up to 500, but if there is no 500 error, list them all and say that’s all """ Deterministic line-by-line reading protocol. Long documents are chunked into line-boundary slices. The agent loop must consume them through `next_chunk()` until `eof_reached` is True; only then is it allowed to report the reading task as complete. The offset + digest state is persisted in `read_cursors` so a crash mid-read can resume from exactly the same byte position. """ from __future__ import annotations import hashlib from dataclasses import dataclass from typing import Optional from uuid import UUID import structlog from backend.db.engine import Database from backend.db.repos import ReadCursorRepo log = structlog.get_logger(__name__) DEFAULT_CHUNK_LINES = 60 MAX_CHUNK_BYTES = 8_000 @dataclass(frozen=True) class ReadChunk: file_path: str line_start: int # 1-indexed inclusive line_end: int # 1-indexed inclusive content: str eof_reached: bool digest_sha256: str total_lines: int total_bytes: int class ReadingSession: """One reading cursor per (session, file_path).""" def __init__( self, db: Database, session_id: UUID, file_path: str, fetch_bytes, *, chunk_lines: int = DEFAULT_CHUNK_LINES, ) -> None: self.db = db self.session_id = session_id self.file_path = file_path self._fetch_bytes = fetch_bytes # async callable returning `bytes` self.chunk_lines = chunk_lines self._repo = ReadCursorRepo(db) self._full: Optional[bytes] = None self._digest: Optional[str] = None self._lines: Optional[list[str]] = None async def _materialise(self) -> None: if self._full is not None: return data = await self._fetch_bytes() if not isinstance(data, (bytes, bytearray)): data = str(data).encode("utf-8") self._full = bytes(data) self._digest = hashlib.sha256(self._full).hexdigest() # Keep line endings so round-tripping is byte-exact. decoded = self._full.decode("utf-8", errors="replace") self._lines = decoded.splitlines(keepends=True) async def open(self) -> ReadChunk: await self._materialise() assert self._full is not None and self._lines is not None and self._digest is not None row = await self._repo.get(self.session_id, self.file_path) if row is None or row["digest_sha256"] != self._digest: # New file or contents changed — reset cursor. await self._repo.upsert( self.session_id, self.file_path, byte_offset=0, line_number=0, eof_reached=False, digest_sha256=self._digest, ) return await self._build_chunk(0, 0) return await self._build_chunk(row["line_number"], row["byte_offset"]) async def _build_chunk(self, line_number: int, byte_offset: int) -> ReadChunk: assert self._full is not None and self._lines is not None and self._digest is not None total_lines = len(self._lines) start = line_number # 0-based index of next line end = min(start + self.chunk_lines, total_lines) # Respect byte cap within the chunk. chunk_text = "" cursor = byte_offset actual_end = start for i in range(start, end): piece = self._lines[i] if len(chunk_text) + len(piece) > MAX_CHUNK_BYTES and chunk_text: break chunk_text += piece cursor += len(piece.encode("utf-8")) actual_end = i + 1 eof = actual_end >= total_lines await self._repo.upsert( self.session_id, self.file_path, byte_offset=cursor, line_number=actual_end, eof_reached=eof, digest_sha256=self._digest, ) return ReadChunk( file_path=self.file_path, line_start=start + 1, # human-friendly 1-indexed line_end=max(actual_end, start), content=chunk_text, eof_reached=eof, digest_sha256=self._digest, total_lines=total_lines, total_bytes=len(self._full), ) async def next_chunk(self) -> ReadChunk: await self._materialise() assert self._full is not None and self._digest is not None row = await self._repo.get(self.session_id, self.file_path) if row is None: return await self.open() if row["digest_sha256"] != self._digest: # File changed under us — reset. await self._repo.upsert( self.session_id, self.file_path, byte_offset=0, line_number=0, eof_reached=False, digest_sha256=self._digest, ) return await self._build_chunk(0, 0) if row["eof_reached"]: return await self._build_chunk(row["line_number"], row["byte_offset"]) return await self._build_chunk(row["line_number"], row["byte_offset"]) async def is_complete(self) -> bool: row = await self._repo.get(self.session_id, self.file_path) return bool(row and row["eof_reached"]) async def require_complete(rs: ReadingSession, task_name: str) -> None: """Gate — call before the loop marks a reading task as done.""" if not await rs.is_complete(): raise RuntimeError( f"Reading protocol violation: {task_name} cannot complete before " f"EOF on {rs.file_path}." ) How to fix them all in one turn? Your task is to take the provided plan and rewrite it as a single, comprehensive prompt. Write it as if you were about to update the entire upgrade from the current state of the implementation: describe step by step, from beginning to end, exactly what you will construct and how you will construct it. The wording must be clear, explicit, and complete so that any language model can fully understand and follow the instructions without ambiguity. Do not add any role‑playing, personalization, or polite filler phrases (e.g., ‘You are a software developer’, ‘As an expert’, ‘Please kindly’). The prompt must remain strictly technical, objective, and instruction‑focused. Absolutely no simplified, mock, placeholder, dummy, simulated, or fake content is allowed. You must require the full ugrade in complete, unabridged, production‑ready codes. Define what you want & what success looks like: “I want to [TASK] so that [SUCCESS CRITERIA].” No roles, “act as a senior expert.” That era is over.
Response not available