From 09fff13dd9871f8bc9ca8a76c62a8ae55526b656 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 16 Apr 2026 16:27:27 +0800 Subject: [PATCH] bugfix --- __init__.py | 1 + build.sh | 19 ++++ crud.json | 39 -------- database.json | 24 ----- init/data.json | 4 + json/harnessed_reasoning_config_view.json | 11 +++ json/harnessed_reasoning_session_detail.json | 26 +++++ json/harnessed_reasoning_sessions_crud.json | 27 ++++++ models/harnessed_reasoning_sessions.json | 99 ++++++++++++++++++++ 9 files changed, 187 insertions(+), 63 deletions(-) create mode 100644 __init__.py create mode 100644 build.sh delete mode 100644 crud.json delete mode 100644 database.json create mode 100644 init/data.json create mode 100644 json/harnessed_reasoning_config_view.json create mode 100644 json/harnessed_reasoning_session_detail.json create mode 100644 json/harnessed_reasoning_sessions_crud.json create mode 100644 models/harnessed_reasoning_sessions.json diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..f72e243 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +# harnessed_reasoning module \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..e90f3aa --- /dev/null +++ b/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# harnessed_reasoning build script + +set -e + +echo "Building harnessed_reasoning module..." + +# Get the main application wwwroot directory +MAIN_WWWROOT="/path/to/main/wwwroot" + +# Create symbolic links for wwwroot files +for file in wwwroot/*; do + if [ -f "$file" ]; then + filename=$(basename "$file") + ln -sf "$file" "$MAIN_WWWROOT/harnessed_reasoning_$filename" + fi +done + +echo "harnessed_reasoning module build completed!" \ No newline at end of file diff --git a/crud.json b/crud.json deleted file mode 100644 index 1c27cc4..0000000 --- a/crud.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "harnessed_reasoning_sessions_crud": { - "summary": "CRUD operations for reasoning sessions management", - "create": { - "description": "Create and optionally execute a reasoning session", - "parameters": { - "request": {"type": "string", "required": true, "description": "User's natural language request"}, - "execute_immediately": {"type": "boolean", "required": false, "default": true, "description": "Whether to execute the plan immediately"} - }, - "function": "hermes_reason_and_execute" - }, - "read": { - "description": "List reasoning sessions for current user", - "parameters": { - "limit": {"type": "integer", "required": false, "default": 50, "description": "Maximum number of sessions to return"}, - "offset": {"type": "integer", "required": false, "default": 0, "description": "Pagination offset"} - }, - "function": "hermes_list_reasoning_sessions" - } - }, - "harnessed_reasoning_session_detail": { - "summary": "Detailed view of individual reasoning session", - "read": { - "description": "Get detailed reasoning session information", - "parameters": { - "session_id": {"type": "string", "required": true, "description": "Reasoning session ID"} - }, - "function": "hermes_get_reasoning_session" - } - }, - "harnessed_reasoning_config_view": { - "summary": "View and manage reasoning configuration", - "read": { - "description": "Get current reasoning configuration", - "parameters": {}, - "function": "hermes_get_reasoning_config" - } - } -} \ No newline at end of file diff --git a/database.json b/database.json deleted file mode 100644 index 3858e03..0000000 --- a/database.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "harnessed_reasoning_sessions": { - "summary": "Reasoning sessions with execution plans and context awareness", - "fields": { - "id": {"type": "string", "primary_key": true, "description": "Unique reasoning session identifier"}, - "user_id": {"type": "string", "required": true, "description": "User ID for multi-user isolation"}, - "initial_request": {"type": "text", "required": true, "description": "Original user request"}, - "context_summary": {"type": "text", "nullable": true, "description": "Summary of gathered context"}, - "execution_plan_json": {"type": "text", "required": true, "description": "JSON-encoded execution plan"}, - "reasoning_steps_json": {"type": "text", "nullable": true, "description": "JSON-encoded detailed reasoning steps"}, - "safety_violations_json": {"type": "text", "nullable": true, "description": "JSON-encoded safety violations detected"}, - "final_decision_json": {"type": "text", "nullable": true, "description": "JSON-encoded final decision metadata"}, - "status": {"type": "string", "default": "pending", "description": "Session status: pending, executing, completed, failed, blocked, cancelled"}, - "created_at": {"type": "datetime", "required": true, "description": "Creation timestamp"}, - "updated_at": {"type": "datetime", "required": true, "description": "Last update timestamp"} - }, - "indexes": [ - ["user_id", "status"], - ["user_id", "created_at"], - ["status", "created_at"] - ], - "codes": {} - } -} \ No newline at end of file diff --git a/init/data.json b/init/data.json new file mode 100644 index 0000000..c7e5d63 --- /dev/null +++ b/init/data.json @@ -0,0 +1,4 @@ +{ + "harnessed_reasoning_sessions": [], + "harnessed_reasoning_config": [] +} \ No newline at end of file diff --git a/json/harnessed_reasoning_config_view.json b/json/harnessed_reasoning_config_view.json new file mode 100644 index 0000000..6649ccd --- /dev/null +++ b/json/harnessed_reasoning_config_view.json @@ -0,0 +1,11 @@ +{ + "tblname": "harnessed_reasoning_config", + "alias": "harnessed_reasoning_config_view", + "title": "Reasoning Configuration", + "params": { + "logined_userid": "user_id", + "confidential_fields": [], + "browserfields": {}, + "editexclouded": ["id", "user_id", "created_at"] + } +} \ No newline at end of file diff --git a/json/harnessed_reasoning_session_detail.json b/json/harnessed_reasoning_session_detail.json new file mode 100644 index 0000000..0f37c2c --- /dev/null +++ b/json/harnessed_reasoning_session_detail.json @@ -0,0 +1,26 @@ +{ + "tblname": "harnessed_reasoning_sessions", + "alias": "harnessed_reasoning_session_detail", + "title": "Reasoning Session Detail", + "params": { + "sortby": ["created_at desc"], + "logined_userid": "user_id", + "confidential_fields": [], + "browserfields": { + "alters": { + "status": { + "uitype": "code", + "data": [ + {"value": "pending", "text": "Pending"}, + {"value": "executing", "text": "Executing"}, + {"value": "completed", "text": "Completed"}, + {"value": "failed", "text": "Failed"}, + {"value": "blocked", "text": "Blocked"}, + {"value": "cancelled", "text": "Cancelled"} + ] + } + } + }, + "editexclouded": ["id", "user_id", "created_at", "updated_at"] + } +} \ No newline at end of file diff --git a/json/harnessed_reasoning_sessions_crud.json b/json/harnessed_reasoning_sessions_crud.json new file mode 100644 index 0000000..a2c0405 --- /dev/null +++ b/json/harnessed_reasoning_sessions_crud.json @@ -0,0 +1,27 @@ +{ + "tblname": "harnessed_reasoning_sessions", + "alias": "harnessed_reasoning_sessions_crud", + "title": "Reasoning Sessions Management", + "params": { + "sortby": ["created_at desc"], + "logined_userid": "user_id", + "confidential_fields": [], + "browserfields": { + "exclouded": ["execution_plan_json", "reasoning_steps_json", "safety_violations_json", "final_decision_json"], + "alters": { + "status": { + "uitype": "code", + "data": [ + {"value": "pending", "text": "Pending"}, + {"value": "executing", "text": "Executing"}, + {"value": "completed", "text": "Completed"}, + {"value": "failed", "text": "Failed"}, + {"value": "blocked", "text": "Blocked"}, + {"value": "cancelled", "text": "Cancelled"} + ] + } + } + }, + "subtables": [] + } +} \ No newline at end of file diff --git a/models/harnessed_reasoning_sessions.json b/models/harnessed_reasoning_sessions.json new file mode 100644 index 0000000..1c1734b --- /dev/null +++ b/models/harnessed_reasoning_sessions.json @@ -0,0 +1,99 @@ +{ + "summary": [ + { + "name": "harnessed_reasoning_sessions", + "title": "Reasoning sessions with execution plans and context awareness", + "primary": "id" + } + ], + "fields": [ + { + "name": "id", + "title": "Unique reasoning session identifier", + "type": "str", + "length": 32, + "nullable": "no" + }, + { + "name": "user_id", + "title": "User ID for multi-user isolation", + "type": "str", + "length": 32, + "nullable": "no" + }, + { + "name": "initial_request", + "title": "Original user request", + "type": "text", + "nullable": "no" + }, + { + "name": "context_summary", + "title": "Summary of gathered context", + "type": "text", + "nullable": "yes" + }, + { + "name": "execution_plan_json", + "title": "JSON-encoded execution plan", + "type": "text", + "nullable": "no" + }, + { + "name": "reasoning_steps_json", + "title": "JSON-encoded detailed reasoning steps", + "type": "text", + "nullable": "yes" + }, + { + "name": "safety_violations_json", + "title": "JSON-encoded safety violations detected", + "type": "text", + "nullable": "yes" + }, + { + "name": "final_decision_json", + "title": "JSON-encoded final decision metadata", + "type": "text", + "nullable": "yes" + }, + { + "name": "status", + "title": "Session status: pending, executing, completed, failed, blocked, cancelled", + "type": "str", + "length": 20, + "nullable": "no", + "default": "pending" + }, + { + "name": "created_at", + "title": "Creation timestamp", + "type": "timestamp", + "nullable": "no" + }, + { + "name": "updated_at", + "title": "Last update timestamp", + "type": "timestamp", + "nullable": "no" + } + ], + "indexes": [ + { + "name": "idx_user_status", + "idxtype": "index", + "idxfields": ["user_id", "status"] + }, + { + "name": "idx_user_created", + "idxtype": "index", + "idxfields": ["user_id", "created_at"] + }, + { + "name": "idx_status_created", + "idxtype": "index", + "idxfields": ["status", "created_at"] + } + ], + "codes": [] +} \ No newline at end of file