Header image for hgh

hgh

Prompt

ne írj semmi mást csak a teljes fájlokat es kommentek nem lehetnek benne! soha semmi egyszerusitett mock placeholder dummy szimulalt fake szart nem engedelyezek es teljes fájl roviditetlen production ready kód nem lehet trancutted nem lehet olyan hogy …és hasonlóan 50 xy nem lehet dummy to do sorry hiányosság minden fájl teljes kódját egyesével fájkba írod semmi mást nem írsz ezen kívűl Create a complete, production‑ready, agent task‑execution platform from scratch. Do not reproduce or mention the name of any existing product. Deliver the entire implementation in a complete, untrimmed form, including every source file, configuration file, database migration, schema, API definition, worker, frontend component, test, deployment description, documentation file and environment template file required to run the system. Do not use simplified, mock, placeholder, dummy, simulated or false content. Every integration must be real, executable, validated, and connected to the rest of the system. Build the system around a persistent agent loop designed for long‑term, multi‑step tasks. The loop must continuously execute the following stages: interpret the user’s goal; check the current persistent state; create or modify a structured plan; select the next executable action; invoke one or more tools; record the result of each tool; feed the complete normalized result back into the next decision; verify that the result satisfies the current step and the overall goal; update the state; modify the plan if evidence, an error, or new information makes this necessary; repeat recoverable errors with limited policies; request human intervention or safely halt the task if the task cannot continue; and only after verification issue a final answer. The implementation cannot be a one‑off “prompt‑response” wrapper. Tool outputs, execution events, errors, verification results, intermediate artifacts, and plan changes all influence subsequent decisions. Implement explicit state management instead of relying on the model’s implicit context. Define versioned schemas for users, sessions, tasks, plans, plan steps, dependencies, tool invocations, tool results, agent decisions, retries, events, artifacts, heartbeats, checkpoints, approvals, terminations, and final outputs. Store sessions and task state on the server side so that work persists across browser refreshes, client disconnections, process restarts, worker replacements, and long‑running periods. Use transactional writes, optimistic concurrency or equivalent locking, idempotency keys, append‑only event logs, checkpoint creation, state‑version checks, and atomic status transitions. Ensure that a task can be resumed from the last valid checkpoint without duplicating already‑completed side effects. Preserve full auditability of what the agent decided, which tool was invoked, what each tool returned, how the state changed, and why the next action was selected. Represent plans as executable dependency graphs instead of unordered checklists. Support sequential steps, independent parallel steps, conditional branches, insertion of dynamically discovered work, step‑cancellation, retries, timeouts, compensation, and final convergence. Track each step with explicit states such as pending, ready, running, waiting, succeeded, failed, retrying, terminated, blocked, and verified. Require that the planner recompute readiness after every significant event and modify the plan when verification fails or tool results invalidate assumptions. Disallow execution of steps if dependencies are missing or the state‑version is stale. Implement a true orchestration layer that validates every operation generated by the model against strict typed schemas, authorization rules, tool capabilities, resource limits, and task policies. Create a tool registry that includes input and output schemas, authentication requirements, timing and retry configurations, termination behavior, idempotency behavior, side‑effect categorization, and observability metadata. Normalize all tool outputs into a common wrapper containing the call identifier, task identifier, step identifier, status, structured output, human‑readable output, error category, retryability, timestamps, duration, emitted artifacts, and provenance. Never silently discard a tool’s output. Successful outputs, partial outputs, validation errors, delivery errors, permission errors, scheduling constraints, timeouts, and termination signals must be routed to separate control branches. Support true tool orchestration, including multiple searches, browsing or HTTP requests, file operations, code execution when explicitly permitted, data transformation, artifact generation, and external service calls. For parallel work, launch independent tool invocations concurrently using a persistent task scheduler or worker pool, apply configurable concurrency and quota limits, stream each child’s result into the persistent state, and provide a synthesis phase that waits for the required dependency set or a defined partial‑result policy. Do not merely emit parallel prompts and concatenate them as text. Preserve each branch’s isolated state and provenance, then a synthesis agent or synthesis phase should compare, reconcile, cite, validate, and consolidate the branch outputs into a structured result. Research tasks must support multiple concurrent searches, deduplication, source tracking, error isolation, and synthesis based on evidence. Parallel branches must be independently stoppable and must not interfere with the parent task or each other. A branch spawned from a checkpoint should inherit the previously selected state while the source session remains unchanged, allowing multiple alternative executions to run concurrently. Implement controlled sub‑agent creation for parallel task execution. Define a parent‑child task model with scope‑specific instructions, inherited context references, isolated work state, explicit input and output contracts, resource budgets, termination propagation, and completion conditions. A parent planner must be able to create specialized research, execution, verification, or synthesis sub‑agents, monitor them, retry them, merge their results, and terminate them. Child agents must not receive unlimited or duplicated context; provide a compact state snapshot, relevant artifacts, prior decisions, and references to persistent records. Require the parent to validate the child’s outputs before treating them as authoritative. Provide a persistent runtime environment for long‑term tasks. Separate the API process, orchestration service, model gateway, tool workers, scheduler, persistence layer, event broker, and artifact store. Use a queue or persistent workflow mechanism to dispatch and resume tasks. Enforce task‑level and step‑level deadlines, leases, termination tokens, retry budgets, exponential backoff with jitter, dead‑letter handling, and recovery of abandoned workers. Make every worker operation idempotent. Ensure that a task remains queryable and resumable even when no client is attached. Implement long‑lived Server‑Sent Events (SSE) connections for live task updates. Provide endpoints for creating tasks, retrieving sessions, reading current state, resuming tasks, stopping tasks, approving gate‑protected actions, listing artifacts, and subscribing to task events. The SSE stream must emit ordered, typed events for connection establishment, task snapshots, plan creation and modification, step readiness, tool invocation, incremental tool output, sub‑agent lifecycle, verification, retry scheduling, artifact creation, warnings, approvals, completion, errors, termination, and the final stream closure. Record events before publishing, include event IDs and sequence numbers, support Last‑Event‑ID replay, detect gaps, and allow a reconnecting client to re‑hydrate from the server‑side checkpoint. Keep the connection alive with a genuine heartbeat mechanism: send periodic protocol‑level heartbeat notes or typed heartbeat events, track the server and client live status, detect stale connections, clean up subscriptions, and never conflate the heartbeat with task progress. Do not store task state only in an in‑memory object. Design the client to display live progress from the event stream while treating the server as authoritative. Show the current plan, step states, active tool invocations, parallel branches, sub‑agent progress, verification results, retries, errors, artifacts, and the final output. Handle reconnections, event replay, duplicate events, ordering guarantees, connection loss, task termination, and stale snapshots. Allow the user to inspect the execution trace and intervene when approval, clarification, credentials, or policy decisions are required. User interventions must be recorded as events and incorporated into the next agent decision. Implement security and autonomy boundaries. Grant the agent autonomy to select and order actions within explicit permissions, budgets, tool scopes, data‑access policies, and sandbox constraints. Require approval for configured high‑impact or irreversible actions. Sanitize untrusted tool and web content before turning it into instructions, separate data from control messages, prevent prompt injection that alters system policy, encrypt secrets in logs and model context, validate URLs and network access, enforce filesystem boundaries, and isolate code execution. Add rate limiting, authentication, authorization, tenant isolation, in‑flight and at‑rest encryption, secret management, audit logging, abuse control, and configurable retention policies. Implement context and memory management for tasks that exceed the model’s context window. Persist facts, plan state, summaries, tool outputs, source records, and artifacts outside the prompt; generate bounded state snapshots and summaries; retrieve only information relevant to the decision; preserve references to the full records; and make compression deterministic and recoverable. A persistent running task list and persistent synthesized results are suitable patterns for extending working memory beyond a single model call. Every model call must declare which state snapshot and artifacts it used, and the system must be able to reconstruct the decision from the persisted records. Implement model interaction via a provider abstraction, enforcing structured output, handling timeouts, supporting streaming where applicable, accounting for tokens and costs, model switching, refusal handling, and schema correction. Separate the prompts or policies for planning, execution decision, verification, and synthesis. Require the model to return machine‑valid decisions that include the selected action, rationale, expected result, state assumptions, dependencies, risk level, and completion or retry recommendation. Treat the model’s output as untrusted input: validate it, reject invalid actions, and request a corrected decision without modifying the state. Add comprehensive observability. Emit structured logs, metrics, traces, task‑level correlation IDs, step‑level IDs, model usage, tool latency, queue latency, retry count, event latency, heartbeat health, parallel branch count, error categories, completion rate, verification errors, and costs. Provide operational dashboards and alerts for stuck tasks, repeated retries, dead workers, event publishing errors, missed heartbeats, and persistence conflicts. Ensure that confidential data is excluded or redacted from telemetry. Build automated tests for schema validation, state transitions, concurrency, transaction rollback, idempotency, event ordering, SSE replay and reconnection, heartbeat expiration, worker crashes, task resumption, termination propagation, retry limits, dependency scheduling, parallel searches, child‑agent creation, synthesis, verification errors and plan modifications, prompt‑injection resistance, authorization, secret redaction, artifact integrity, and end‑to‑end execution with real integrations. Include load tests with many concurrent long SSE streams and parallel branches, chaos tests against disconnected clients and stopped workers, and migration tests for persisted state versions. Provide a production deployment guide for local development, staging, and production environments. Include infrastructure for the database, queue or workflow engine, event broker (if used), object store, model provider configuration, secure tool credentials, horizontal worker scaling, rolling deployments, health checks, readiness probes, graceful shutdowns, database migrations, backups, recovery procedures, and disaster recovery. Define every environment variable, API contract, event schema, persistence index, retention rule, and operational runbook. Document the full lifecycle from task creation through planning, execution, parallel research, sub‑agent synthesis, verification, retries, recovery, completion, termination, and archival. The final implementation must be complete and executable, without missing files or unexplained gaps. Do not claim it to be autonomous if the implementation actually does not persist state, does not execute tools, does not feed results into subsequent decisions, does not verify results, does not modify plans, does not retry safely, does not support parallel execution, does not maintain long‑lived SSE connections with heartbeats and replay, and does not continue long‑term tasks after disconnection or failure. Architecturally use the design‑execution‑iterative‑refinement‑special‑agent‑persistent‑task‑state pattern as a reference for the required behavior.

A system prompt was added to support web rendering

Response not available

Drag to resize
Drag to resize