Header image for Hibakfi

Hibakfi

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 from __future__ import annotations import uuid from datetime import datetime from typing import TYPE_CHECKING, Any, List, Optional from sqlalchemy import ( Boolean, DateTime, Float, ForeignKey, Index, Integer, String, Text, func, ) from sqlalchemy.dialects.postgresql import ARRAY, JSONB, UUID from sqlalchemy.orm import Mapped, mapped_column, relationship from core.database import Base from core.state_machine import TaskStatus if TYPE_CHECKING: from models.artifact import Artifact from models.event import TaskEvent from models.plan import TaskPlan from models.subtask import Subtask from models.user import User, Workspace class Task(Base): __tablename__ = "tasks" __table_args__ = ( Index("ix_tasks_user_id_created_at", "user_id", "created_at"), Index("ix_tasks_workspace_id_status", "workspace_id", "status"), ) id: Mapped[uuid.UUID] = mapped_column( UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, ) short_id: Mapped[str] = mapped_column( String(26), nullable=False, unique=True, index=True, ) user_id: Mapped[Optional[uuid.UUID]] = mapped_column( UUID(as_uuid=True), ForeignKey("users.id", ondelete="SET NULL"), nullable=True, index=True, ) workspace_id: Mapped[uuid.UUID] = mapped_column( UUID(as_uuid=True), ForeignKey("workspaces.id", ondelete="CASCADE"), nullable=False, index=True, ) title: Mapped[str] = mapped_column(String(500), nullable=False) description: Mapped[Optional[str]] = mapped_column(Text, nullable=True) status: Mapped[str] = mapped_column( String(30), nullable=False, default=TaskStatus.CREATED.value, index=True, ) task_category: Mapped[Optional[str]] = mapped_column( String(60), nullable=True, ) confidence_score: Mapped[Optional[float]] = mapped_column( Float, nullable=True, ) risk_level: Mapped[Optional[str]] = mapped_column( String(20), nullable=True, ) required_capabilities: Mapped[Optional[list[str]]] = mapped_column( ARRAY(String()), nullable=True, ) estimated_cost_usd: Mapped[Optional[float]] = mapped_column( Float, nullable=True, ) estimated_latency_seconds: Mapped[Optional[int]] = mapped_column( Integer, nullable=True, ) execution_tier: Mapped[Optional[str]] = mapped_column( String(30), nullable=True, ) input_references: Mapped[Optional[dict[str, Any]]] = mapped_column( JSONB, nullable=True, ) preferred_output_formats: Mapped[Optional[list[str]]] = mapped_column( ARRAY(String()), nullable=True, ) max_cost_usd: Mapped[Optional[float]] = mapped_column( Float, nullable=True, ) max_latency_seconds: Mapped[Optional[int]] = mapped_column( Integer, nullable=True, ) max_retries: Mapped[Optional[int]] = mapped_column( Integer, nullable=True, ) max_repair_attempts: Mapped[Optional[int]] = mapped_column( Integer, nullable=True, ) requires_approval: Mapped[bool] = mapped_column( Boolean, nullable=False, default=False, ) approval_reason: Mapped[Optional[str]] = mapped_column( Text, nullable=True, ) approved_at: Mapped[Optional[datetime]] = mapped_column( DateTime(timezone=True), nullable=True, ) approved_by_id: Mapped[Optional[uuid.UUID]] = mapped_column( UUID(as_uuid=True), ForeignKey("users.id", ondelete="SET NULL"), nullable=True, ) actual_cost_usd: Mapped[Optional[float]] = mapped_column( Float, nullable=True, ) total_tokens_used: Mapped[Optional[int]] = mapped_column( Integer, nullable=True, ) execution_context: Mapped[Optional[dict[str, Any]]] = mapped_column( JSONB, nullable=True, ) final_output_summary: Mapped[Optional[str]] = mapped_column( Text, nullable=True, ) final_manifest: Mapped[Optional[dict[str, Any]]] = mapped_column( JSONB, nullable=True, ) known_limitations: Mapped[Optional[list[Any]]] = mapped_column( JSONB, nullable=True, ) correlation_id: Mapped[Optional[str]] = mapped_column( String(64), nullable=True, ) retry_count: Mapped[int] = mapped_column( Integer, nullable=False, default=0, ) repair_count: Mapped[int] = mapped_column( Integer, nullable=False, default=0, ) created_at: Mapped[datetime] = mapped_column( DateTime(timezone=True), nullable=False, server_default=func.now(), ) updated_at: Mapped[datetime] = mapped_column( DateTime(timezone=True), nullable=False, server_default=func.now(), onupdate=func.now(), ) queued_at: Mapped[Optional[datetime]] = mapped_column( DateTime(timezone=True), nullable=True, ) started_at: Mapped[Optional[datetime]] = mapped_column( DateTime(timezone=True), nullable=True, ) completed_at: Mapped[Optional[datetime]] = mapped_column( DateTime(timezone=True), nullable=True, ) failed_at: Mapped[Optional[datetime]] = mapped_column( DateTime(timezone=True), nullable=True, ) error_code: Mapped[Optional[str]] = mapped_column( String(60), nullable=True, ) error_message: Mapped[Optional[str]] = mapped_column( Text, nullable=True, ) error_details: Mapped[Optional[dict[str, Any]]] = mapped_column( JSONB, nullable=True, ) user: Mapped[Optional["User"]] = relationship( "User", back_populates="tasks", foreign_keys=[user_id], lazy="select", ) approved_by: Mapped[Optional["User"]] = relationship( "User", foreign_keys=[approved_by_id], lazy="select", ) workspace: Mapped["Workspace"] = relationship( "Workspace", back_populates="tasks", foreign_keys=[workspace_id], lazy="select", ) subtasks: Mapped[List["Subtask"]] = relationship( "Subtask", back_populates="task", cascade="all, delete-orphan", order_by="Subtask.created_at", lazy="select", ) events: Mapped[List["TaskEvent"]] = relationship( "TaskEvent", back_populates="task", cascade="all, delete-orphan", order_by="TaskEvent.occurred_at", lazy="select", ) artifacts: Mapped[List["Artifact"]] = relationship( "Artifact", back_populates="task", cascade="all, delete-orphan", order_by="Artifact.created_at", lazy="select", ) plan: Mapped[Optional["TaskPlan"]] = relationship( "TaskPlan", back_populates="task", uselist=False, cascade="all, delete-orphan", single_parent=True, lazy="select", ) def __repr__(self) -> str: return ( f"<Task id={self.id} short_id={self.short_id!r} " f"status={self.status!r}>" )

Drag to resize