Skip to content

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-78 bind cả port + devicePort khi khác nhau). Bản dưới đây là mô tả đúng code hiện tại.

  • Worker bind 1 URL khi devicePort == 0 || devicePort == port, ngược lại bind cả hai (UseUrls(port, devicePort) trong RuAgent.Runtime.Worker/Program.cs:75-78) để tương thích ngược LoopbackWorkerClient (device v1); --device-port là compat flag, không phải dead flag.
  • WorkerV2Server chấp nhận /worker, /worker/v1, /worker/v2 (IsWorkerPath); /worker/v1 giữ cho device traffic, token v1/v2 riêng vẫn enforce ở từng server.
  • Test Phase1WorkerIntegrationTests bỏ 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/SqliteHarnessEventStore và 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 khi RU_MEDIA_SURFACES khác "0" (VoiceStreamEndpoint + Voice/Observation/Stt/VtsEndpoints). Headless coding agent chạy RU_MEDIA_SURFACES=0 phục vụ subset rút gọn (media routes unmapped); check_aspnetcore_route_matrix.py kiể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.prepared legacy khỏi AgentMessageTypes (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: AgentConnection chỉ còn 1 _toolHandler (ToolRequest + ApprovalResponse cùng đi qua BrokerHost.ExecuteToolAsync, rẽ trong service); xóa _approvalHandler/ExecuteApprovalAsync riêng lẻ.

Pi Phase 1: 13 tools → read/write/edit/bash + standalone web_search/web_fetch (2026-09-09)

  • Protocol catalog is 6 definitions (read with op=list|glob|search|read|help, write with op=write|delete|restore, edit, bash with mode=run|shell, standalone web_search with query (+ max_results 1–10) and standalone web_fetch with url). AgentModelToolContractCatalog.WebToolIds={web_search,web_fetch}.
  • Broker core migrated: ToolCatalog (6 manifests; read carries WorkspaceRead+SystemRead only, web tools carry their own Web scopes with External risk), PolicyContextFactory (tool-id routing, target-free help/web tools), PolicySnapshotEvaluator.IsWebTool (web_search/web_fetch tool IDs), PolicyRuleMatcher.LegacyToolIdMatches (old IDs in snapshots still match), BrokerSession.WorkspaceScopesFor (6 tools), AgentActivityProjector (tool-id kinds), TerminalAdapter approval binding (bash), consolidated ExecuteReadOp/WriteOp/Bash executors plus standalone web executors.
  • V1 execution path is scope-checked per tool: file ops check WorkspaceRead/SystemRead, web tools require their own Web scope, help allows with file scopes, write/bash require WorkspaceWrite/TerminalExecute. Whole-manifest scope gate stays as the baseline.
  • RuBackend gateway migrated: BrokerToolGateway.AccessKindForTool (standalone web → terminal-class approval UX), AgentWebToolExecutor (standalone web_search/web_fetch), AgentV1Service.Approvals.BuildApprovalBindingAsync (standalone web + legacy fallback), AgentToolRuntimeProjection (6 tools). docs/operations/agent-tools.md rewritten for the 6-tool matrix (embedded help docs rebuilt).
  • Conformance (ToolGatewayConformance) migrated to Pi IDs: 23/23 pass through BrokerToolGateway.
  • Pre-existing failures (confirmed identical on clean HEAD via git stash isolate, not caused by this phase): 2 v1 terminal approval (Approved_full_terminal_run, Nonzero_terminal_exit), 5 V2 terminal/shell wiring (tool.result vs tool_result naming + 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 is scripts/check_aspnetcore_route_matrix.py, pinned by tests/test_ci_contract.py.
  • BrokerToolGateway.ReceiveReplyAsync now loops fragmented WebSocket frames to EndOfMessage with a 64 KiB cap, strict UTF-8 decoding, and explicit broker_frame_too_large / broker_invalid_utf8 / broker_unexpected_frame transport errors.
  • WebSocket bearer travels via the Authorization header only: DesktopTokenMiddleware and VoiceStreamEndpoint.ExtractAuthToken no longer accept ?token=; VoiceStreamEndpointTests now connect with the header and assert a query-string bearer is rejected with 4401.
  • BrokerHost.IsAuthorized compares the expected bearer with SHA-256 + FixedTimeEquals, matching DesktopTokenMiddleware.
  • SSE GET /agent/v1/runs/{runId}/events sets text/event-stream only after the run lookup succeeds, so a missing run still returns plain JSON 404.
  • POST /host/shutdown stops the host on the next thread-pool yield instead of a wall-clock delay, after the response is flushed.
  • WorkerBrokerProcessManager deletes only an owned <logRoot>/agent/session root (leaf session under agent, non-reparse) instead of any configured sessionRoot.
  • GUI: App releases/disposes the single-instance mutex on close; SettingsView detaches named autosave handlers before re-init/dispose; VoiceView stops the stale debounce timer before re-init.
  • Docs/hygiene: fixed the agent-tools.md checkpoint (20 /agent/v1/* HTTP, not 19), added skills/README.md clarifying the runnable research.and_note vs the unwired calendar.* example, and removed redundant .gitignore entries shadowed by artifacts/ + *.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.