Verification evidence — 2026-09-09¶
Historical snapshot only. Counts, commands and limitations describe that snapshot and do not establish current acceptance. Use current verification.
Pi Phase 3: worker dual-port compat + /worker alias (2026-09-09, cập nhật 2026-09-10)¶
Ghi chú 2026-09-10: section này từng ghi "bind 1 port duy nhất" — đã sai sau
fix(worker)trong CHANGELOG (RuAgent.Runtime.Worker/Program.cs:75-78bind cảport+devicePortkhi khác nhau). Bản dưới đây là mô tả đúng code hiện tại.
Workerbind 1 URL khidevicePort == 0 || devicePort == port, ngược lại bind cả hai (UseUrls(port, devicePort)trongRuAgent.Runtime.Worker/Program.cs:75-78) để tương thích ngượcLoopbackWorkerClient(device v1);--device-portlà compat flag, không phải dead flag.WorkerV2Serverchấp nhận/worker,/worker/v1,/worker/v2(IsWorkerPath);/worker/v1giữ cho device traffic, token v1/v2 riêng vẫn enforce ở từng server.- Test
Phase1WorkerIntegrationTestsbỏ assert GET/worker/v1→ 404 (giờ là alias hợp lệ); Worker 64/64 xanh (snapshot 2026-09-09, re-run trước release).
Pi Phase 4: persistence — giữ SQLite, không làm JSONL (2026-09-09)¶
- Quyết định KHÔNG thay
agent_harness.db+ AES-GCM payloads bằng JSONL: 103 Persistence tests +SqlitePolicyRuleStore/PolicySnapshotLoader/HarnessPayloadStore/HarnessOutboxStore/SqliteHarnessEventStorevà toàn bộRuBackend(HarnessPolicySnapshotService,HarnessApprovalService,AgentV1Service.Policies, recovery scanner, outbox dispatcher) đều dựng trên transaction/SQLite. Thay = viết lại durability layer + audit + migration, rủi ro cao, lợi ích Pi-style thấp (Pi JSONL vì single-user TUI, Ru cần multi-session + idempotent outbox + concurrent lease). - Gọn đã làm thay thế: Phase 1+2 đã gọn tool surface (13→4) và policy gate (xóa prepare, gộp approval handler) — đúng trọng số "làm gọn" mà không đụng durability.
Pi Phase 5: media endpoints optional (2026-09-09)¶
Program.cs: voice/STT/VTube/observation chỉ map khiRU_MEDIA_SURFACESkhác"0"(VoiceStreamEndpoint+Voice/Observation/Stt/VtsEndpoints). Headless coding agent chạyRU_MEDIA_SURFACES=0phục vụ subset rút gọn (media routes unmapped);check_aspnetcore_route_matrix.pykiểm tra full contract 64 HTTP + 1 WS khi media bật.-
RuBackend build 0 warning; media + gateway tests 56/56 xanh.
-
Xóa
tool.prepare/tool.preparedlegacy khỏiAgentMessageTypes(cảKnown+V2Only): gate giờ là 1 evaluate + 1 execute đúng kiểu Pi, không còn prepare trung gian. - Gộp v1 approval path:
AgentConnectionchỉ còn 1_toolHandler(ToolRequest+ApprovalResponsecùng đi quaBrokerHost.ExecuteToolAsync, rẽ trong service); xóa_approvalHandler/ExecuteApprovalAsyncriêng lẻ.
Pi Phase 1: 13 tools → read/write/edit/bash + standalone web_search/web_fetch (2026-09-09)¶
- Protocol catalog is 6 definitions (
readwithop=list|glob|search|read|help,writewithop=write|delete|restore,edit,bashwithmode=run|shell, standaloneweb_searchwithquery(+max_results1–10) and standaloneweb_fetchwithurl).AgentModelToolContractCatalog.WebToolIds={web_search,web_fetch}. - Broker core migrated:
ToolCatalog(6 manifests;readcarries WorkspaceRead+SystemRead only, web tools carry their own Web scopes withExternalrisk),PolicyContextFactory(tool-id routing, target-free help/web tools),PolicySnapshotEvaluator.IsWebTool(web_search/web_fetchtool IDs),PolicyRuleMatcher.LegacyToolIdMatches(old IDs in snapshots still match),BrokerSession.WorkspaceScopesFor(6 tools),AgentActivityProjector(tool-id kinds),TerminalAdapterapproval binding (bash), consolidatedExecuteReadOp/WriteOp/Bashexecutors plus standalone web executors. - V1 execution path is scope-checked per tool: file ops check WorkspaceRead/SystemRead,
web tools require their own Web scope,
helpallows with file scopes,write/bashrequire WorkspaceWrite/TerminalExecute. Whole-manifest scope gate stays as the baseline. RuBackendgateway migrated:BrokerToolGateway.AccessKindForTool(standalone web → terminal-class approval UX),AgentWebToolExecutor(standaloneweb_search/web_fetch),AgentV1Service.Approvals.BuildApprovalBindingAsync(standalone web + legacy fallback),AgentToolRuntimeProjection(6 tools).docs/operations/agent-tools.mdrewritten for the 6-tool matrix (embedded help docs rebuilt).- Conformance (
ToolGatewayConformance) migrated to Pi IDs: 23/23 pass throughBrokerToolGateway. - Pre-existing failures (confirmed identical on clean HEAD via
git stashisolate, not caused by this phase): 2 v1 terminal approval (Approved_full_terminal_run,Nonzero_terminal_exit), 5 V2 terminal/shell wiring (tool.resultvstool_resultnaming + shell approval execute), 3 skill-connection sequencing (session_open/tool_result ordering), 4 Core (golden parity hash + activity lifecycle), ~9 RuBackend prompt/worker projection (13→4 count). RuBackend approval/headless slowness (30s+ per terminal test) is also pre-existing.
P0/P1 review remediation (2026-09-09)¶
- Removed the dangling CI step invoking the retired
ASP.NET Core route compatibility harness script (deleted in
fd700244); the route-contract gate isscripts/check_aspnetcore_route_matrix.py, pinned bytests/test_ci_contract.py. BrokerToolGateway.ReceiveReplyAsyncnow loops fragmented WebSocket frames toEndOfMessagewith a 64 KiB cap, strict UTF-8 decoding, and explicitbroker_frame_too_large/broker_invalid_utf8/broker_unexpected_frametransport errors.- WebSocket bearer travels via the
Authorizationheader only:DesktopTokenMiddlewareandVoiceStreamEndpoint.ExtractAuthTokenno longer accept?token=;VoiceStreamEndpointTestsnow connect with the header and assert a query-string bearer is rejected with 4401. BrokerHost.IsAuthorizedcompares the expected bearer with SHA-256 +FixedTimeEquals, matchingDesktopTokenMiddleware.- SSE
GET /agent/v1/runs/{runId}/eventssetstext/event-streamonly after the run lookup succeeds, so a missing run still returns plain JSON 404. POST /host/shutdownstops the host on the next thread-pool yield instead of a wall-clock delay, after the response is flushed.WorkerBrokerProcessManagerdeletes only an owned<logRoot>/agent/sessionroot (leafsessionunderagent, non-reparse) instead of any configuredsessionRoot.- GUI:
Appreleases/disposes the single-instance mutex on close;SettingsViewdetaches named autosave handlers before re-init/dispose;VoiceViewstops the stale debounce timer before re-init. - Docs/hygiene: fixed the
agent-tools.mdcheckpoint (20/agent/v1/*HTTP, not 19), addedskills/README.mdclarifying the runnableresearch.and_notevs the unwiredcalendar.*example, and removed redundant.gitignoreentries shadowed byartifacts/+*.db.
Focused gates: voice/auth 19/19, Agent SSE/status 126/126, Hosting worker-broker 7/7, Broker auth 31/31, Python contract/docs 11/11.
Run heavyweight gates sequentially on Windows. Restore each .NET test project
before using --no-restore; concurrent Python, frontend, and .NET builds can
exhaust the page file on this workspace.