- 新增 `sample-apps/order-service` Java 样板应用及 Win/Linux 构建、启停、状态脚本 - 新增 `LocalSampleAppService`,在 `software-a` 中支持 `order-service test` 本地桥接部署 - 增加桥接开关配置:`ENABLE_SAMPLE_APP_BRIDGE`、`SAMPLE_APP_ROOT` - 修正后端配置读取方式,环境变量可在运行时生效(`Settings` 改为 `default_factory`) - 更新应用元数据默认验证目标:`127.0.0.1:18080`、本地日志路径 - 新增桥接测试 `test_sample_app_bridge.py`,后端基线更新至 `24 passed` - 更新 `.gitignore`,忽略样板应用 `build/runtime` 产物 - 更新 README 与《当前进度总结》:记录本轮“真实样板应用 + 桥接能力”进展,MVP 进度约 `97%`
Smart Deploy Agent Demo Backend
Setup
python -m venv .venv
.venv\\Scripts\\python -m pip install -e backend
Run
.venv\\Scripts\\python -m uvicorn app.main:app --reload --app-dir backend
Demo UI
After startup, open:
http://127.0.0.1:8000/demo/chat
Test
The lightweight API verification can run with in-memory SQLite:
set PYTHONPATH=backend
set DATABASE_URL=sqlite:///:memory:
.venv\\Scripts\\python -m pytest backend/tests -q -p no:cacheprovider
Runtime Notes
This repo currently defaults to:
- database:
sqlite:///./data/agent_demo.db - demo cache / queue: no Redis dependency
- edge defaults:
edge_id=edge-shanghai-001tool_name=http_health_check - demo operator defaults:
alice(u1001)for task executionbob(u2001)for approval - optional sample app bridge:
ENABLE_SAMPLE_APP_BRIDGE=trueSAMPLE_APP_ROOT=sample-apps/order-service
In the current sandbox, file-based SQLite may fail with disk I/O error.
For tests and local verification here, use:
set DATABASE_URL=sqlite:///:memory:
Implemented API Scope
Current backend includes:
- agent task
POST /api/agent/tasksPOST /api/agent/tasks/{task_id}/confirmPOST /api/agent/tasks/{task_id}/cancelGET /api/agent/tasks/{task_id}GET /api/agent/tasks/{task_id}/report - demo chat
POST /api/demo/chat/sessionsGET /api/demo/chat/sessions/{session_id}POST /api/demo/chat/sessions/{session_id}/messagesPOST /api/demo/chat/sessions/{session_id}/tasks/{task_id}/confirm - demo web
GET /GET /demo/chat - demo identity
POST /api/demo/identity/loginGET /api/demo/identity/meGET /api/demo/identity/users/{user_id}/permissionsPOST /api/demo/identity/token/introspect - demo approval
POST /api/demo/approval/requestsGET /api/demo/approval/requests/{approval_id}POST /api/demo/approval/requests/{approval_id}/decisionGET /api/demo/approval/requests - software-a minimal implementation
POST /api/demo/software-a/deploy-tasksGET /api/demo/software-a/deploy-tasks/{software_a_task_id}POST /api/demo/software-a/permissions/check - edge
POST /api/agent/edge/heartbeatPOST /api/agent/edge/tasks/pullPOST /api/agent/edge/tasks/reportPOST /api/agent/edge/events
Current execution flow:
- create chat session or open web demo
- send one natural-language message
- create task
- confirm task
- high-risk task enters approval flow
- check
software-aminimal implementation permission - create
software-aminimal implementation deploy task - build metadata-driven multi-step edge verification plan:
check_processcheck_porttcp_probehttp_health_checkgrep_log - edge pulls and reports verification results
- task reaches
SUCCEEDED/FAILED/CANCELLED - task detail/report returns software-a status, approval trace, tool trace, verification trace and audit trace
Real Java Sample App
The repo now includes a real Java sample app:
sample-apps/order-service
When ENABLE_SAMPLE_APP_BRIDGE=true, software-a minimal implementation can bridge the order-service test deploy action to the local sample app startup flow.
Current execution metrics:
tool_call.duration_msis persisted fromstarted_at/finished_atverification_trace.duration_msis persisted for edge task reportstask_report.task_metricsreturns task-level aggregate durations and counts- current aggregate metrics include:
total_duration_msconfirm_wait_duration_msapproval_duration_msexecution_duration_mssoftware_a_duration_ms_totaltool_call_duration_ms_totalverification_duration_ms_totalverification_queue_wait_duration_ms_totalverification_end_to_end_duration_ms_total task_report.audit_summaryreturns audit result counts, action types and operator summary
Current result summary capabilities:
- task detail/report returns
result_summary_detail - summary includes final status, final reason, software-a result, approval result and verification result
- demo chat API returns assistant-style parse/confirm messages
- demo web page provides a visual conversation -> confirm -> execute -> report flow
Demo failure semantics currently include:
- if
app_codeorversioncontainsfail, thesoftware-aminimal implementation returns a failed deploy task - approval rejection moves task to
CANCELLED - failed edge report moves task to
FAILED
Current Verification Baseline
Automated tests currently cover:
- create / confirm / get task
- high-risk approval path
- identity and software-a minimal implementation APIs
- edge heartbeat / pull / report
- edge event report
- task report trace aggregation
- cancel running task
Current baseline: 24 passed
Current baseline: 23 passed
Next Focus
Recommended next implementation steps:
- continue enriching app-metadata-driven verification templates
- continue polishing the demo UI and session flow
- validate native Linux packaging in a real bash/Linux environment
- then continue with second-batch OpenAPI