diff --git a/docs/hexascript/config.json b/docs/hexascript/config.json new file mode 100644 index 0000000..8aa8616 --- /dev/null +++ b/docs/hexascript/config.json @@ -0,0 +1,49 @@ +[ + { + "html": "algorithm", + "label": "Algorithm" + }, + { + "html": "hierarchy", + "label": "Hierarchy" + }, + { + "label": "UML", + "submenu": [ + { + "frame": "/core/index.html", + "label": "Compiler" + }, + { + "label": "Frontend", + "submenu": [ + { + "mermaid": "diagrams/frontend_logic.html", + "label": "Frontend Logic" + }, + { + "mermaid": "diagrams/frontend_classes.html", + "label": "Classes" + } + ] + }, + { + "label": "Backend", + "submenu": [ + { + "mermaid": "/diagrams/backend_api.html", + "label": "Api" + }, + { + "mermaid": "/diagrams/backend_db.html", + "label": "Database" + } + ] + } + ] + }, + { + "html": "testing_plans", + "label": "Testing Plans" + } +] diff --git a/docs/hexascript/css/styles.css b/docs/hexascript/css/styles.css new file mode 100644 index 0000000..bc425d8 --- /dev/null +++ b/docs/hexascript/css/styles.css @@ -0,0 +1,99 @@ +body { + background-color: #111111; + color: #cccccc; + font-family: Consolas, "Courier New", monospace; + line-height: 1.5; + padding: 2rem; + max-width: 1200px; + margin: 0 auto; +} + +h1, +h2, +h3, +h4, +h5 { + font-family: Arial, Helvetica, sans-serif; + font-weight: bold; + text-transform: uppercase; + letter-spacing: 0.05em; + margin-top: 1.5em; + margin-bottom: 0.5em; +} + +h1 { + color: #ffffff; + border-bottom: 2px solid #ffffff; + padding-bottom: 5px; +} + +h2 { + color: #ffaa00; + border-bottom: 1px solid #333333; + padding-bottom: 5px; + margin-top: 0; +} + +h3 { + color: #00aaff; +} +h4 { + color: #00ffaa; +} +h5 { + color: #aaaaaa; +} + +b { + color: #ffffff; +} +small { + color: #777777; + font-style: normal; +} + +ul, +ol { + margin: 0; + padding: 0 0 0 2em; +} + +/* Strip formatting from the absolute top level lists */ +main > ul, +main > h1 + ul { + padding-left: 0; + list-style: none; +} + +/* Box styling for top level items */ +main > ul > li { + background: #1a1a1a; + border: 1px solid #333333; + padding: 2em; + margin-bottom: 2em; +} + +/* Tree structure lines */ +li > ul, +li > ol { + border-left: 1px solid #444444; + margin-left: -1em; + padding-left: 2em; + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +/* Hover tracking for the tree lines */ +li:hover > ul, +li:hover > ol { + border-left: 1px solid #ffaa00; +} + +li { + margin-bottom: 0.5em; +} + +/* Dim the bullet points and numbers */ +li::marker { + color: #555555; +} diff --git a/docs/hexascript/diagrams/backend_api.mmd b/docs/hexascript/diagrams/backend_api.mmd new file mode 100644 index 0000000..dfab446 --- /dev/null +++ b/docs/hexascript/diagrams/backend_api.mmd @@ -0,0 +1,256 @@ +classDiagram + direction TB + str <|-- TokenMode + str <|-- AddressProtocol + str <|-- LogLevel + str <|-- ExitStatus + BaseResource <|-- VMStateSchema + BaseResource <|-- IntegritySchema + Base <|-- CompilerJobAuditLog + Base <|-- PersistentUIState + PromptSchema <|-- PromptSchema + PromptCreateSchema <|-- PromptCreateSchema + PromptORM <|-- PromptORM + PromptController <|-- PromptController + BaseResource <|-- PromptSchema + AuditMixin <|-- PromptSchema + PromptSchema : +flatten_models() + PromptSchema : +flatten_tiers() + BaseModel <|-- PromptCreateSchema + Base <|-- Prompt + BaseMixin <|-- Prompt + PromptConfigSchema <|-- Prompt_configSchema + PromptConfigCreateSchema <|-- Prompt_configCreateSchema + PromptConfigORM <|-- Prompt_configORM + PromptConfigController <|-- Prompt_configController + Prompt_configController : +get_all() + Prompt_configController : +get_by_id() + Prompt_configController : +create() + Prompt_configController : +update() + BaseResource <|-- Prompt_configSchema + AuditMixin <|-- Prompt_configSchema + Prompt_configSchema *-- ResearchTierSchema + Prompt_configSchema *-- PromptSchema + Prompt_configSchema *-- ModelSchema + BaseModel <|-- Prompt_configCreateSchema + Base <|-- PromptConfig + BaseMixin <|-- PromptConfig + PromptPairSchema <|-- Prompt_pairSchema + PromptPairCreateSchema <|-- Prompt_pairCreateSchema + PromptPairORM <|-- Prompt_pairORM + PromptPairController <|-- Prompt_pairController + BaseResource <|-- Prompt_pairSchema + AuditMixin <|-- Prompt_pairSchema + Prompt_pairSchema *-- ConfigSchema + Prompt_pairSchema *-- ConfigSchema + BaseModel <|-- Prompt_pairCreateSchema + Base <|-- PromptPair + BaseMixin <|-- PromptPair + LLMModelSchema <|-- Llm_modelSchema + LLMModelCreateSchema <|-- Llm_modelCreateSchema + LLMModelORM <|-- Llm_modelORM + LLMModelController <|-- Llm_modelController + BaseResource <|-- Llm_modelSchema + AuditMixin <|-- Llm_modelSchema + Llm_modelSchema : +validate_tiers() + Llm_modelSchema : +validate_servers() + BaseModel <|-- Llm_modelCreateSchema + Base <|-- LLMModelData + BaseMixin <|-- LLMModelData + BaseRouter : +_setup_routes() + BaseModel <|-- BaseResource + BaseResource : +transform_to_id_list() + BaseResource : +transform_to_name_list() + BaseModel <|-- AuditMixin + BaseController : +get_all() + BaseController : +get_by_id() + BaseController : +create() + BaseController : +update() + BaseController : +delete() + ResearchTierSchema <|-- Research_tierSchema + ResearchTierCreateSchema <|-- Research_tierCreateSchema + ResearchTierORM <|-- Research_tierORM + ResearchTierController <|-- Research_tierController + BaseResource <|-- Research_tierSchema + AuditMixin <|-- Research_tierSchema + BaseModel <|-- Research_tierCreateSchema + Base <|-- ResearchTier + BaseMixin <|-- ResearchTier + ManifestController : +create_from_cpp() + Llm_serverController : +get_all() + Llm_serverController : +get_by_id() + Llm_serverController : +_poll_server() + Llm_serverController : +_trigger_pull() + BaseResource <|-- Llm_serverSchema + Llm_serverSchema : +validate_models() + BaseModel <|-- Llm_serverCreateSchema + Base <|-- LLMServer + BaseMixin <|-- LLMServer + Wbs_taskController : +get_ready_tasks() + BaseResource <|-- WBSTaskSchema + AuditMixin <|-- WBSTaskSchema + BaseModel <|-- CreateWBSTaskSchema + BaseResource <|-- UpdateWBSTaskSchema + Base <|-- WBSTask + BaseMixin <|-- WBSTask + WBSPhaseController : +get_ready_tasks() + BaseResource <|-- WBSPhaseSchema + AuditMixin <|-- WBSPhaseSchema + BaseModel <|-- CreateWBSPhaseSchema + Base <|-- WBSPhase + BaseMixin <|-- WBSPhase + ASTSchema <|-- AstSchema + ASTCreateSchema <|-- AstCreateSchema + ASTORM <|-- AstORM + ASTController <|-- AstController + Base <|-- AST + BaseMixin <|-- AST + AST : +ast_json() + AST : +create_from_code() + BaseResource <|-- AstSchema + AuditMixin <|-- AstSchema + BaseModel <|-- AstCreateSchema + Compiler_configController : +get_capabilities() + Base <|-- CompilerConfig + BaseMixin <|-- CompilerConfig + CompilerConfig : +inject_columns() + Base <|-- CompilationTask + BaseResource <|-- DispatchContext + BaseResource <|-- CommandPayload + CommandPayload *-- DispatchContext + BaseResource <|-- DispatchPayload + Base <|-- BuildRegistry + BuildRegistry : +from_payload() + BaseResource <|-- CommandPayload + BaseResource <|-- DispatchPayload + BaseResource <|-- WeightsConfig + BaseResource <|-- LogicConfig + BaseResource <|-- ArchConfig + BaseResource <|-- ControlFlowConfig + BaseResource <|-- BatchConfig + AuditMixin <|-- BatchConfig + BatchConfig *-- WeightsConfig + BatchConfig *-- LogicConfig + BatchConfig *-- ArchConfig + BatchConfig *-- ControlFlowConfig + BatchConfig *-- TokenMode + BatchConfig *-- AddressProtocol + BaseResource <|-- VMStateSchema + BaseResource <|-- IntegritySchema + BaseResource <|-- MinerResponse + MinerResponse *-- List + str <|-- TokenMode + str <|-- AddressProtocol + str <|-- LogLevel + str <|-- ExitStatus + Compile_jobController : +dispatch() + Base <|-- CompileJob + BaseMixin <|-- CompileJob + str <|-- JobStatus + BaseModel <|-- Compile_jobCreateSchema + BaseResource <|-- Compile_jobSchema + AuditMixin <|-- Compile_jobSchema + Compile_jobSchema *-- JobStatus + ProjectMap : +verify() + ProjectMap : +get() + NeuralRequest : +to_ollama_payload() + HexaNeuralProvider : +dispatch() + ModelManager : +_pull_worker() + ModelManager : +get_system_status() + ChaosEngine : +evaluate_pressure() + ChaosEngine : +inject() + BatchGenerator : +generate() + BatchGenerator : +_emit() + BatchGenerator : +_gen_block() + BatchGenerator : +_gen_expr() + BatchGenerator : +_gen_math_block() + BatchGenerator : +_gen_branch_block() + BatchGenerator : +_gen_loop_block() + BatchGenerator : +_gen_cond() + TypeMapper : +to_sql() + TypeMapper : +get_pydantic_field() + TypeMapper : +to_pydantic_from_str() + TypeMapper : +to_pydantic() + TypeMapper : +get_base_py_type() + HexaVerifier : +decompile_to_list() + HexaVerifier : +verify_address_stability() + HexaVerifier : +autonomous_verify() + HexaCore : +compile_and_run() + HexaCore : +get_prompt_from_db() + HexaCore : +ollama() + HexaCore : +run_saved_job() + HexaCore : +get_compiler_capabilities() + HexaCore : +create_job() + HexaASTSerializer : +serialize() + HexaASTDeSerializer : +deserialize() + HexaASTDeSerializer : +to_code() + MinerSample : +to_jsonl() + BaseHexaMiner : +_execute_cpp_batch() + BaseHexaMiner : +generate_single_mission() + BaseHexaMiner : +format_sample() + BaseHexaMiner : +run_parallel() + BaseHexaMiner : +_worker_loop() + BaseHexaMiner <|-- SyntaxMiner + SyntaxMiner : +generate_single_mission() + SyntaxMiner : +format_sample() + BaseHexaMiner <|-- MutationMiner + MutationMiner : +generate_single_mission() + MutationMiner : +_worker_loop() + MutationMiner : +format_sample() + MutationMiner <|-- NegativeMiner + NegativeMiner : +format_sample() + BaseHexaMiner <|-- MutationMiner + MutationMiner : +generate_single_mission() + MutationMiner : +_worker_loop() + MutationMiner : +format_sample() + MutationMiner <|-- NegativeMiner + NegativeMiner : +format_sample() + BaseHexaMiner <|-- SyntaxMiner + SyntaxMiner : +generate_single_mission() + SyntaxMiner : +format_sample() + Batch : +serialize() + Batch : +to_object() + Batch : +generate() + Batch : +to_mission() + Batch : +gen_block() + Batch : +gen_expr() + Batch : +gen_cond() + Batch : +_gen_math_block() + Batch : +_gen_branch_block() + Batch : +_gen_loop_block() + Batch *-- BatchConfig + TextbookArtifact : +persist() + TextbookArtifact : +write_py() + TextbookArtifact *-- Batch + HexaDatasetBuilder : +_run_compiler_batch() + HexaDatasetBuilder : +generate_batch() + HexaDatasetBuilder : +_worker_entry() + HexaDatasetBuilder : +build_parallel() + HexaDatasetBuilder : +build_batch() + HexaAgent : +get_vm_state() + HexaAgent : +run_correction_loop() + HexaAgent : +save_training_sample() + HexaAgent : +build_feedback_prompt() + HexaCLI : +run_tdd() + HexaCLI : +run_roundtrip() + HexaCLI : +build_dataset() + HexaCLI : +execute_logic() + HexaCLI : +run_verify() + HexaCLI : +run_batch_gen() + HexaROIBenchmark : +_estimate_tokens() + HexaROIBenchmark : +_get_token_count() + HexaROIBenchmark : +_get_source_metrics() + HexaROIBenchmark : +_compile_to_hex() + HexaROIBenchmark : +calculate_reduction() + HexaROIBenchmark : +benchmark_hex() + HexaROIBenchmark : +benchmark_b64() + HexaROIBenchmark : +get_pure_logic() + HexaROIBenchmark : +benchmark_logic_density() + Server : +get_uri() + Server <|-- OllamaServer + OllamaModel *-- OllamaServer + BackendExtractor : +get_bases() + BackendExtractor : +get_methods() + BackendExtractor : +get_compositions() + ContextResolver : +resolve_name() + BackendFormatter : +format_class() diff --git a/docs/hexascript/diagrams/backend_db.mmd b/docs/hexascript/diagrams/backend_db.mmd new file mode 100644 index 0000000..52073bc --- /dev/null +++ b/docs/hexascript/diagrams/backend_db.mmd @@ -0,0 +1,145 @@ +erDiagram + prompts { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + VARCHAR system_prompt + } + prompt_config { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + INTEGER prompt_id FK + INTEGER model_id FK + INTEGER research_tier_id FK + VARCHAR research_tier + } + prompt_pair { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + INTEGER prompt_a_id FK + INTEGER prompt_b_id FK + } + llm_models { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + VARCHAR nickname + VARCHAR description + VARCHAR prompts + } + research_tiers { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + VARCHAR prompts + } + llm_servers { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + VARCHAR address + INTEGER port + VARCHAR proto + } + wbs_tasks { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR component + VARCHAR name + VARCHAR status + BOOLEAN is_breaking + INTEGER estimated_hours + VARCHAR started_at + VARCHAR completed_at + INTEGER phase_id FK + INTEGER dependency_id FK + } + wbs_phases { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + INTEGER sequence + } + ast { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR name + VARCHAR file_path + VARCHAR file_hash + } + compiler_config { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + INTEGER id PK + VARCHAR name + BOOLEAN is_active + } + compilation_queue { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + INTEGER id PK + TEXT code_content + VARCHAR status + TEXT result_log + BLOB bytecode_output + DATETIME created_at + } + build_history { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + INTEGER id PK + VARCHAR label + DATETIME created_at + INTEGER compiler_config_id FK + INTEGER ast_id FK + } + compile_jobs { + INTEGER id PK + DATETIME created_at + DATETIME updated_at + DATETIME deleted_at + VARCHAR description + VARCHAR status + INTEGER ast_id FK + INTEGER config_id FK + INTEGER manifest_id FK + VARCHAR ast + } + prompt_config ||--o{ prompts : references + prompt_config ||--o{ llm_models : references + prompt_config ||--o{ research_tiers : references + prompt_pair ||--o{ prompt_config : references + prompt_pair ||--o{ prompt_config : references + wbs_tasks ||--o{ wbs_phases : references + wbs_tasks ||--o{ wbs_tasks : references + build_history ||--o{ compiler_config : references + build_history ||--o{ ast : references + compile_jobs ||--o{ ast : references + compile_jobs ||--o{ compiler_config : references + compile_jobs ||--o{ manifests : references diff --git a/docs/hexascript/diagrams/frontend_api.mmd b/docs/hexascript/diagrams/frontend_api.mmd new file mode 100644 index 0000000..31bec99 --- /dev/null +++ b/docs/hexascript/diagrams/frontend_api.mmd @@ -0,0 +1,154 @@ +sequenceDiagram + participant FE as Frontend (TerminalController) + participant API as FastAPI Backend + autonumber + FE->>+API: POST /api/analyze (api_analyze_api_analyze_post) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/capabilities (get_capabilities_api_capabilities_get) + API-->>-FE: Zod Validated Response + FE->>+API: POST /api/compile (api_compile_api_compile_post) + API-->>-FE: Zod Validated Response + FE->>+API: POST /api/dataset/start (start_dataset_api_dataset_start_post) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/dataset/status (get_dataset_status_api_dataset_status_get) + API-->>-FE: Zod Validated Response + FE->>+API: POST /api/dataset/stop (stop_dataset_api_dataset_stop_post) + API-->>-FE: Zod Validated Response + FE->>+API: POST /api/dispatch (dispatch_command_api_dispatch_post) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/logs (get_system_logs_api_logs_get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/metadata (get_metadata_api_metadata_get) + API-->>-FE: Zod Validated Response + FE->>+API: POST /api/mutate (mutate_logic_api_mutate_post) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/script/:name (get_script_content_api_script__name__get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/scripts (get_scripts_api_scripts_get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/servers (get_servers_api_servers_get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/state (get_master_state_api_state_get) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /api/state/patch (patch_state_api_state_patch_patch) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/status (get_system_status_api_status_get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /api/task/:task_id (get_task_status_api_task__task_id__get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /capabilities (get_capabilities_capabilities_get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /dev (dev_root_dev_get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /dev/:path (proxy_frontend_dev__path__get) + API-->>-FE: Zod Validated Response + FE->>+API: GET /llm-models/ (getLLMModelDatas) + API-->>-FE: Zod Validated Response + FE->>+API: POST /llm-models/ (createLLMModelData) + API-->>-FE: Zod Validated Response + FE->>+API: GET /llm-models/:record_id (getLLMModelData) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /llm-models/:record_id (deleteLLMModelData) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /llm-models/:record_id (updateLLMModelData) + API-->>-FE: Zod Validated Response + FE->>+API: GET /llm-models/typescript-schema (getLLMModelDataSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /llm-servers/ (getLLMServers) + API-->>-FE: Zod Validated Response + FE->>+API: POST /llm-servers/ (createLLMServer) + API-->>-FE: Zod Validated Response + FE->>+API: GET /llm-servers/:record_id (getLLMServer) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /llm-servers/:record_id (deleteLLMServer) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /llm-servers/:record_id (updateLLMServer) + API-->>-FE: Zod Validated Response + FE->>+API: GET /llm-servers/typescript-schema (getLLMServerSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /manifests/ (getManifests) + API-->>-FE: Zod Validated Response + FE->>+API: POST /manifests/ (createManifest) + API-->>-FE: Zod Validated Response + FE->>+API: GET /manifests/:record_id (getManifest) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /manifests/:record_id (deleteManifest) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /manifests/:record_id (updateManifest) + API-->>-FE: Zod Validated Response + FE->>+API: POST /manifests/run (run_compiler_manifests_run_post) + API-->>-FE: Zod Validated Response + FE->>+API: GET /manifests/typescript-schema (getManifestSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompt-config/ (getPromptConfigs) + API-->>-FE: Zod Validated Response + FE->>+API: POST /prompt-config/ (createPromptConfig) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompt-config/:record_id (getPromptConfig) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /prompt-config/:record_id (deletePromptConfig) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /prompt-config/:record_id (updatePromptConfig) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompt-config/typescript-schema (getPromptConfigSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompt-pairs/ (getPromptPairs) + API-->>-FE: Zod Validated Response + FE->>+API: POST /prompt-pairs/ (createPromptPair) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompt-pairs/:record_id (getPromptPair) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /prompt-pairs/:record_id (deletePromptPair) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /prompt-pairs/:record_id (updatePromptPair) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompt-pairs/typescript-schema (getPromptPairSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompts/ (getPrompts) + API-->>-FE: Zod Validated Response + FE->>+API: POST /prompts/ (createPrompt) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompts/:record_id (getPrompt) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /prompts/:record_id (deletePrompt) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /prompts/:record_id (updatePrompt) + API-->>-FE: Zod Validated Response + FE->>+API: GET /prompts/typescript-schema (getPromptSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /research-tiers/ (getResearchTiers) + API-->>-FE: Zod Validated Response + FE->>+API: POST /research-tiers/ (createResearchTier) + API-->>-FE: Zod Validated Response + FE->>+API: GET /research-tiers/:record_id (getResearchTier) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /research-tiers/:record_id (deleteResearchTier) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /research-tiers/:record_id (updateResearchTier) + API-->>-FE: Zod Validated Response + FE->>+API: GET /research-tiers/typescript-schema (getResearchTierSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /wbs-phases/ (getWBSPhases) + API-->>-FE: Zod Validated Response + FE->>+API: POST /wbs-phases/ (createWBSPhase) + API-->>-FE: Zod Validated Response + FE->>+API: GET /wbs-phases/:record_id (getWBSPhase) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /wbs-phases/:record_id (deleteWBSPhase) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /wbs-phases/:record_id (updateWBSPhase) + API-->>-FE: Zod Validated Response + FE->>+API: GET /wbs-phases/typescript-schema (getWBSPhaseSchema) + API-->>-FE: Zod Validated Response + FE->>+API: GET /wbs-tasks/ (getWBSTasks) + API-->>-FE: Zod Validated Response + FE->>+API: POST /wbs-tasks/ (createWBSTask) + API-->>-FE: Zod Validated Response + FE->>+API: GET /wbs-tasks/:record_id (getWBSTask) + API-->>-FE: Zod Validated Response + FE->>+API: DELETE /wbs-tasks/:record_id (deleteWBSTask) + API-->>-FE: Zod Validated Response + FE->>+API: PATCH /wbs-tasks/:record_id (updateWBSTask) + API-->>-FE: Zod Validated Response + FE->>+API: GET /wbs-tasks/typescript-schema (getWBSTaskSchema) + API-->>-FE: Zod Validated Response diff --git a/docs/hexascript/diagrams/frontend_classes.mmd b/docs/hexascript/diagrams/frontend_classes.mmd new file mode 100644 index 0000000..cb50d91 --- /dev/null +++ b/docs/hexascript/diagrams/frontend_classes.mmd @@ -0,0 +1,302 @@ +classDiagram + direction TB + ICompilerPayload <|-- CompilerPayload + CompilerPayload : +command + CompilerPayload : +selections + CompilerPayload : +code + CompilerPayload : +context + CompilerPayload : +toJSON() + CompilerPayload *-- IDispatchContext + InferenceResults : +id + InferenceResults : +prompt_id + InferenceResults : +payload_send + InferenceResults : +response_received + InferenceResults : +telemetry + InferenceResults : +timestamp + ResultsCollection : +_collections + ResultsCollection : +_get() + ResultsCollection *-- InferenceResults + BaseState <|-- ResearchResult + ResearchResult : +id + ResearchResult : +status + ResearchResult : +roi_gain + ResearchResult : +execution_time_ms + ResearchResult : +error_message + BaseState <|-- ResearchLibrary + ResearchLibrary : +_collection + ResearchLibrary : +runTrial() + ResearchLibrary : +_refresh() + Notification <|-- ApiError + ApiError : +name + ApiError : +fromResponse() + ApiError <|-- ValidationError + ValidationError : +name + ValidationError : +details + ValidationError : +summmary + ApiError <|-- NetworkError + NetworkError : +name + BaseCRUD <|-- LLMServer + LLMServer : +_directives + LLMServer : +name + LLMServer : +address + LLMServer : +port + LLMServer : +proto + LLMServer : +service_online + LLMServer : +models + LLMServer : +pull_status + LLMServer : +hydrate() + BaseLibrary <|-- LLMServerLibrary + LLMServerLibrary : +ItemClass + Error <|-- Notification + Notification : +isNotification + Notification : +id + Notification : +type + Notification : +timeout + Notification : +sticky + Notification *-- MessageType + Notification <|-- Sticky + Notifications : +#queue + Notifications : +message() + Notifications : +push() + Notifications : +dismiss() + BaseCRUD <|-- ResearchTier + ResearchTier : +_directives + ResearchTier : +name + BaseLibrary <|-- ResearchTierLibrary + ResearchTierLibrary : +ItemClass + ResearchTierLibrary : +getTier() + BaseState <|-- Server + Server : +name + Server : +proto + Server : +address + Server : +port + Server : +models + Server : +_systemStatus + Server : +_pullProgress + Server : +_apiClient + Server : +_refresh() + Server : +getPullProgress() + Server *-- LLMServerStatusLibrary + Server *-- ServerStatus + Server *-- ReturnType | null + Server ..> LLMServerStatusLibrary : creates + Server ..> Compiler : creates + BaseState <|-- ServerList + ServerList : +_servers + ServerList : +getServer() + ServerList : +getServerList() + ServerList *-- Server[] + Dataset : +status + Dataset : +#polling + Dataset : +#getUri + Dataset : +apiUri + Dataset : +startBuild() + Dataset : +stopBuild() + Dataset : +pollDataset() + TerminalController : +isProcessing + TerminalController : +isSyncing + TerminalController : +terminalInput + TerminalController : +masterSeed + TerminalController : +scripts + TerminalController : +selectedScriptName + TerminalController : +pullProgress + TerminalController : +servers + TerminalController : +systemStatus + TerminalController : +selectedServer + TerminalController : +selectedModel + TerminalController : +baselineData + TerminalController : +trainedData + TerminalController : +selectedCategory + TerminalController : +selectedTemplate + TerminalController : +selectedTrialId + TerminalController : +selectionType + TerminalController : +activeSelectionId + TerminalController : +categories + TerminalController : +systemLogs + TerminalController : +apiUri + TerminalController : +ui + TerminalController : +researchMode + TerminalController : +handleMainAction() + TerminalController : +startDatasetBuild() + TerminalController : +syncSystemLogs() + TerminalController : +stopDatasetBuild() + TerminalController : +pollDataset() + TerminalController : +fetchInitialData() + TerminalController : +executeCommand() + TerminalController : +pollForResult() + TerminalController : +migrateToNewServer() + TerminalController : +getModelLabel() + TerminalController : +#calculateStats() + TerminalController : +loadScript() + TerminalController : +refreshStatus() + TerminalController : +handleReset() + TerminalController : +handleMutation() + TerminalController : +addLog() + TerminalController : +getBaselineMarkdown() + TerminalController : +getTrainedMarkdown() + TerminalController : +loadState() + TerminalController : +sendPatch + TerminalController : +updatePaneHeight() + TerminalController ..> Dataset : creates + TerminalController ..> CompilerConfig : creates + BaseState <|-- BaseCRUD + BaseCRUD : +id + BaseCRUD : +isSaving + BaseCRUD : +#memento + BaseCRUD : +_schema + BaseCRUD : +_createSchema + BaseCRUD : +_directives + BaseCRUD : +_parentLibrary + BaseCRUD : +ensureDirectives() + BaseCRUD : +commitMemento() + BaseCRUD : +isNew() + BaseCRUD : +hydrate() + BaseCRUD : +getValidPayload() + BaseCRUD : +save() + BaseCRUD : +delete() + BaseCRUD : +inferTag() + BaseCRUD : +inferOptions() + BaseCRUD : +inferAttributes() + BaseState <|-- BaseLibrary + BaseLibrary : +#_collection + BaseLibrary : +activeItem + BaseLibrary : +searchFilter + BaseLibrary : +isModalOpen + BaseLibrary : +_endpoint + BaseLibrary : +ItemClass + BaseLibrary : +list() + BaseLibrary : +get() + BaseLibrary : +select() + BaseLibrary : +sync() + BaseLibrary : +_refresh() + BaseLibrary : +hydrate() + BaseLibrary : +createNew() + BaseLibrary : +handlePurge() + BaseLibrary *-- new ( + data: S, + ) => T + BaseState : +_dependencies + BaseState : +server + BaseState : +notifications + BaseState : +isFetching + BaseState : +created_at + BaseState : +updated_at + BaseState : +last_sync + BaseState : +inherit() + BaseState : +get_deps() + BaseState : +_sync_threshold_ms + BaseState : +updateServer() + BaseState : +ensureServer() + BaseState : +dep() + BaseState : +apiUri() + BaseState : +apiFetch() + BaseState : +setThreshold() + BaseState : +setThresholdSeconds() + BaseState : +setThresholdMinutes() + BaseState : +isStale() + BaseState : +updateSyncTimestamp() + BaseState : +refresh() + BaseState : +debugNetwork() + BaseState : +error() + BaseState : +notify() + BaseState : +sticky() + BaseState : +info() + BaseState *-- IServerContext + BaseState *-- Notifications + BaseState <|-- CompilerConfig + CompilerConfig : +capabilities + CompilerConfig : +selections + CompilerConfig : +masterSeed + CompilerConfig : +hydrateDefaults() + CompilerConfig : +fetchCapabilities() + BaseCRUD <|-- LLMModelData + LLMModelData : +name + LLMModelData : +nickname + LLMModelData : +description + LLMModelData : +servers + LLMModelData : +research_tiers + LLMModelData : +init_directives() + LLMModelData : +hydrate() + BaseLLMModel : +getName() + BaseLibrary <|-- LLMModelDataLibrary + LLMModelDataLibrary : +ItemClass + LLMServerStatus : +id + LLMServerStatus : +name + LLMServerStatus : +service_online + LLMServerStatus : +models + LLMServerStatus : +pull_status + LLMServerStatus : +hydrate() + LLMServerStatus : +isReady() + BaseState <|-- LLMServerStatusLibrary + LLMServerStatusLibrary : +entries + LLMServerStatusLibrary : +_refresh() + LLMServerStatusLibrary : +list() + BaseCRUD <|-- Prompt + Prompt : +_directives + Prompt : +name + Prompt : +system_prompt + Prompt : +models + Prompt : +research_tiers + Prompt : +isEditing + Prompt : +isPending + BaseLibrary <|-- PromptLibrary + PromptLibrary : +ItemClass + PromptLibrary : +getByResearchTier() + BaseCRUD <|-- PromptConfig + PromptConfig : +_directives + PromptConfig : +name + PromptConfig : +research_tier + PromptConfig : +prompt + PromptConfig : +model + PromptConfig : +prompt_id + PromptConfig : +model_id + PromptConfig : +research_tier_id + PromptConfig : +init_directives() + PromptConfig : +hydrate() + BaseLibrary <|-- PromptConfigLibrary + PromptConfigLibrary : +ItemClass + BaseCRUD <|-- PromptPair + PromptPair : +name + PromptPair : +prompt_a_id + PromptPair : +prompt_b_id + PromptPair : +prompt_a + PromptPair : +prompt_b + PromptPair : +init_directives() + PromptPair : +hydrate() + PromptPair *-- PromptConfig + PromptPair *-- PromptConfig + BaseLibrary <|-- PromptPairLibrary + PromptPairLibrary : +ItemClass + PromptPairLibrary : +init_directives() + BaseCRUD <|-- WBSTask + WBSTask : +component + WBSTask : +name + WBSTask : +phase + WBSTask : +status + WBSTask : +is_breaking + WBSTask : +dependency_id + BaseLibrary <|-- WBSTaskLibrary + WBSTaskLibrary : +ItemClass + WBSTaskLibrary : +getByComponent() + BaseCRUD <|-- WBSPhase + WBSPhase : +_directives + WBSPhase : +name + WBSPhase : +sequence + BaseLibrary <|-- WBSPhaseLibrary + WBSPhaseLibrary : +ItemClass + BaseCRUD <|-- WBSTask + WBSTask : +_directives + WBSTask : +component + WBSTask : +name + WBSTask : +description + WBSTask : +phase_id + WBSTask : +status + WBSTask : +is_breaking + WBSTask : +dependency_id + WBSTask : +start_date + WBSTask : +end_date + WBSTask : +estimated_hours + WBSTask : +init_directives() + BaseLibrary <|-- WBSTaskLibrary + WBSTaskLibrary : +ItemClass + WBSTaskLibrary : +getByComponent() diff --git a/docs/hexascript/diagrams/frontend_logic.mmd b/docs/hexascript/diagrams/frontend_logic.mmd new file mode 100644 index 0000000..f232041 --- /dev/null +++ b/docs/hexascript/diagrams/frontend_logic.mmd @@ -0,0 +1,19 @@ +sequenceDiagram + autonumber + ResearchLibrary->>_collection: clear() + ResearchLibrary->>_collection: set() + Server->>models: hydrate() + ServerList->>_servers: find() + TerminalController->>dataset: startBuild() + TerminalController->>dataset: stopBuild() + TerminalController->>dataset: pollDataset() + TerminalController->>systemLogs: push() + TerminalController->>systemLogs: shift() + TerminalController->>terminal: apply() + TerminalController->>ui: applyLayout() + BaseLibrary->>activeItem: isNew() + BaseLibrary->>+activeItem: delete() + activeItem-->>-BaseLibrary: result + LLMServerStatusLibrary->>entries: find() + WBSTaskLibrary->>entries: filter() + WBSTaskLibrary->>entries: filter() diff --git a/docs/hexascript/html/algorithm.html b/docs/hexascript/html/algorithm.html new file mode 100644 index 0000000..0c914a0 --- /dev/null +++ b/docs/hexascript/html/algorithm.html @@ -0,0 +1,234 @@ +

Pipeline Algorithm

+ diff --git a/docs/hexascript/html/app.html b/docs/hexascript/html/app.html new file mode 100644 index 0000000..8ad86ac --- /dev/null +++ b/docs/hexascript/html/app.html @@ -0,0 +1,47 @@ + + + + + + + + %sveltekit.head% + + +
+

Hexascript Design Documents

+
+ +
%sveltekit.body%
+ + diff --git a/docs/hexascript/html/hierarchy.html b/docs/hexascript/html/hierarchy.html new file mode 100644 index 0000000..18b8437 --- /dev/null +++ b/docs/hexascript/html/hierarchy.html @@ -0,0 +1,242 @@ +

Hierarchy

+ diff --git a/docs/hexascript/html/testing_plans.html b/docs/hexascript/html/testing_plans.html new file mode 100644 index 0000000..3e920bf --- /dev/null +++ b/docs/hexascript/html/testing_plans.html @@ -0,0 +1,181 @@ +

Testing Plan

+ diff --git a/docs/hexascript/index.html b/docs/hexascript/index.html new file mode 100644 index 0000000..57ecbd9 --- /dev/null +++ b/docs/hexascript/index.html @@ -0,0 +1,977 @@ + + + + + Hexascript Design Documents + + +
+

Hexascript Design Documents

+
+ +
+ +

UML

+ +

Pipeline Algorithm

+ +

Testing Plan

+ +
+ + + + diff --git a/docs/hexascript/src/script.js b/docs/hexascript/src/script.js new file mode 100644 index 0000000..c7812cd --- /dev/null +++ b/docs/hexascript/src/script.js @@ -0,0 +1,75 @@ + +const navLinks = require("./navLinks.json"); +const fs = require('node:fs'); +const express = require("express") +const router = express.Router() + +export function htmlController(req, res) {} +export function mermaidController(req, res) {} +export function frameController(req, res) {} + +export function getContext(type, path) { + let filePath = null; + let controllor; + let route; + switch (type) { + case "html": + /** + * Injects html directly into the content area + *
+ */ + filePath = path.join("html", path + ".html"); + controllor = htmlController; + route = `${path}` + break; + case: "mermaid": + /** + * Injects a mermaid file directly into the content area + *

+       */
+      filePath= path.join("diagrams", path + ".mmd");
+      controllor = mermaidController;
+    case "frame":
+      /**
+       * Injects an iframe into the content area
+       * 
+       */
+      controllor = frameController;
+      break;
+    default:
+      throw new Error(`Invalid option: ${type}`)
+  }
+  if ( filePath != null) {
+   fileContent = await fs.readFile(filePath, 'utf8');
+  }
+  return {
+    path, controller
+    ,route: `diagram/${path}`,
+    content: fileContent
+
+  }
+}
+function router() {
+navLinks.forEach((navLink) => {
+  const keys = Object.keys(navLink);
+  keys.forEach( key => {
+
+  // -- Html Injection
+  if (keys.indexOf("html") != -1) {
+    context = getContext("html", path)
+  }
+  // -- Mermaid Diagram Injection
+  if (keys.indexOf("mermaid") != -1) {
+    context = getContext("mermaid", path)
+    const fileContent
+  }
+  // -- Frame Injection
+  if (keys.indexOf("frame") != -1) {
+    context = getContext("frame", path)
+  }
+    router.get(context.path, context.controller)
+
+  })
+  return router
+});
+}