GGMES 1D Agent UI contract v2 Load order: engine, markdown, remote-v3, agent-ui-v2, workbench-v6, tasks-v2. Workbench v6 and tasks v2 use this helper. Previous helper v1 is preserved. Use exact attribute equality, never label text or substring matching: [data-agent-action="file-open"][data-agent-path="ggmes.md"] [data-agent-action="tab-open"][data-agent-path="ggmes.md"] [data-agent-action="tab-close"][data-agent-path="ggmes.md"] [data-agent-action="search-open"][data-agent-path="ggmes.md"][data-agent-line="2"] [data-agent-action="outline-open"][data-agent-path="ggmes.md"][data-agent-line="1"] [data-agent-action="history-select"][data-agent-path="ggmes.md"][data-agent-revision="1"] [data-agent-action="task-select"][data-agent-task-id="example-task"] [data-agent-action="task-claim"][data-agent-task-id="example-task"] Escape selector values with CSS.escape when constructing selectors. Identity values are the original local path/task ID, never transformed slugs or visible labels. Static controls with IDs use that ID as data-agent-action. Panel/view actions are panel-files, panel-history, panel-tasks, view-edit and their existing static peers. document.documentElement exposes data-agent-state (loading/ready/error), data-agent-pending-count and aria-busy. Loading persists while any tracked operation is pending. A failure remains error after all overlapping operations settle, even when a later overlapping operation succeeds. Starting a new idle operation clears the previous batch error. This describes UI operations, not direct external API calls or network connectivity. Poll final readiness only after pendingCount reaches zero. window.GGMESAgentUI.snapshot() returns version, state, pendingCount, pending, recent. Each operation contains numeric id, bounded static action, state and allowlisted code and static recovery guide (unknown errors become UI_ERROR). Pending and recent arrays have at most 32 entries each. pendingCount includes all pending operations, including nested ones. It never includes document text, paths, task IDs, exception messages, access keys, form input, server URL, or command arguments. Snapshots are detached copies. Nested operation counts are diagnostic counts, not user action counts. begin(action) returns fail(error)/end(); end is idempotent. This helper does not authenticate or grant authority; existing APIs continue to enforce permissions. mark(element,action,identity) assigns UI attributes without changing object identity. ERROR RECOVERY v2 GGMESAgentUI.recover(code) returns a frozen static record: {code, category, action, automaticRetry:false, guidance, mutationSafety}. No server error message, input, document content or credential enters this record. AUTH_INVALID remains AUTH_INVALID in snapshot; authentication failures point to private identity checks. QUEUE_LIMIT suggests waiting and reassessing; TASK_LEASE suggests rereading ownership. Conflict requires rereading the current revision. NETWORK_ERROR means the operation outcome may be unknown, not proof of failure. The guide never sends requests. For an uncertain mutation, reread first; retry only with the original body and original idempotencyKey within the replay window. A new UI click may generate a new key, so repeating the click is not equivalent to replay. Snapshot operation IDs identify local UI tracking, not server idempotency keys. Pending/recent arrays remain capped at 32 and pendingCount covers nested operations.