Repository navigation
feat(dashboard): show passive artifact processing status - #2725
Conversation
| operationId: get_artifact_processing_status | ||
| x-powercontext-access: | ||
| resolver: path_scope_read_access | ||
| x-powercontext-scope-mode: current |
There was a problem hiding this comment.
[P2] 新增的 current 操作没有登记进 Codex 插件的当前 Scope 集合
openapi/powercontext.yaml 把这个操作标成 x-powercontext-scope-mode: current,但 integrations/codex/plugins/powercontext/hooks/bind_tools.py::_CURRENT_OPERATIONS 里没有 get_artifact_processing_status(该文件未在本 PR 改动;git rev-parse 在 head 与 master 上同为 7c82e0ea)。同一集合里已有 get_artifact、get_topic_memory_processing_status 等同类操作。
后果(实测,不是源码推断):PreToolUse 钩子在 operation not in _CURRENT_OPERATIONS and tool_input.get('scope_id') is None 时直接 return 0,不注入会话绑定的 Scope。用本 PR 版本的钩子跑三种调用,输出分别是:
get_artifact→{'artifact_id': 'a', 'scope_id': 'bound-scope'}get_topic_memory_processing_status→{'family': 'topic_memory', 'scope_id': 'bound-scope'}get_artifact_processing_status→ 无 decision(调用按 Agent 原样执行)
scope_id 是本操作的必填 path 参数,所以 Agent 省略 scope_id 时这次调用会缺路径参数而失败;在 Codex 宿主里这个新能力要么得由模型自己填 Scope,要么直接报错,与其它 current 操作的行为不一致。
CI 抓不到的原因:tests/codex_plugin/test_scope_binding.py::test_pre_tool_hook_binds_every_current_scope_operation 对每个 current 操作都传了 {'scope_id': 'agent-selected'}。缺少 _CURRENT_OPERATIONS 登记的项仍会走到 resolve_scope_id,并把 scope_id 覆盖成绑定值,因此照样通过。该用例只覆盖「Agent 已经写了 Scope」的分支,没有覆盖 current 语义本身(省略 Scope 由钩子补)这个分支。
建议:把 get_artifact_processing_status 加入 _CURRENT_OPERATIONS;并给该参数化用例补一个 tool_input 不带 scope_id 的变体,让集合缺失能被测出来。复现探针:D:/test/github/review/_state/r109/probe_bind_tools_2725.py(隔离目录,未执行网络请求)。
There was a problem hiding this comment.
Confirmed. With the previous hook, omitting scope_id for get_artifact_processing_status produced no binding decision. Fixed in 88bddd5 by registering the operation in _CURRENT_OPERATIONS. The parameterized regression now exercises every current operation with scope_id omitted and with a caller-supplied value. Both paths set the session-bound Scope. The new omitted-Scope case failed before the fix and passes now.
There was a problem hiding this comment.
[P2 已解除 · 复核确认]
按 head 7ecda1f0c4 复核,本线程提出的两点都已消解:
integrations/codex/plugins/powercontext/hooks/bind_tools.py:89已把get_artifact_processing_status加入_CURRENT_OPERATIONS,与openapi/powercontext.yaml:3001的x-powercontext-scope-mode: current对齐。tests/codex_plugin/test_scope_binding.py:85的参数化取值是sorted(CURRENT_OPERATIONS),不是硬编码清单 —— 该集合后续新增成员会自动进入用例,不会像原缺陷那样只在新操作落地后才暴露。:84的tool_input两条分支({}省略 /{"scope_id": "agent-selected"}调用方给值)都断言updatedInput["scope_id"] == "bound-scope",因此「省略scope_id时钩子不注入」这一原症状有直接回归保护,而不是只靠既有操作的通过结果推断。
复核依据:同一 head 的 12 个 tests (...) 分片(3.11–3.14 × unit/e2e)全部 success;desktop-validation、release-schema、gateway-validation 等剩余 check 仍为 queued,本轮不对它们下结论。
本线程无新增 Finding。
| }); | ||
| document.addEventListener('htmx:afterRequest', event => { | ||
| for (const [root, state] of instances) { | ||
| if (!root.isConnected || !state.suspended || state.navigation !== event.detail.xhr || !event.detail.failed) continue; |
There was a problem hiding this comment.
[P2] Resume status reads after navigation transport failures
When navigation to another Scope or family encounters a network error, HTMX emits htmx:afterRequest without detail.failed, so this guard leaves the retained component suspended. Resume it on transport failures too; otherwise even a successful manual refresh is discarded and its button stays disabled.
There was a problem hiding this comment.
Reproduced in Chromium by aborting the HTMX request while switching from Experience to Skill. The original page stayed visible, but its next manual status refresh remained busy. Fixed in f99775e: the matching navigation now resumes the retained component when the XHR ends with status 0 or HTMX reports an HTTP failure. The browser regression verifies that refreshing shows the original Scope and Experience family, then that switching to Skill succeeds.
hireview001
left a comment
There was a problem hiding this comment.
- Resolve merge conflicts with the target branch.
|
Which issue or RFC does this PR close?
Closes #2130.
Implements the Scope-level artifact processing visibility design tracked by #2130 for the Dashboard collection pages on the merged master baseline
246f70bebbabf59b028f961d892e05a7731f7e8d.Rationale for this change
Master shows Source consumption on Memory, Profile and Experience pages and Source-window details on the Topic Memory page. The collection pages still lack a consistent way to inspect Scope-wide processing and Dream records across all seven artifact families. Users need to inspect that evidence without starting processing or confusing consumption with publication.
What changes are included in this PR?
GET /v1/scopes/{scope_id}/processing-status?family=...and a typed Python client method. Reuse the existing passive inspector, bounded Dream history and independent pending query. Return safe evidence provenance, per-dimension availability, local-observation freshness andCache-Control: no-store, including for encoded Scope IDs and error responses.desktop/VALIDATION.md.Are there any user-facing changes?
Artifact collection pages now expose Scope-wide processing evidence, including empty collections. Search, record selection, generation forms and historical Profile views retain their existing behavior. Details link to existing processing records, exact Dream runs, candidate review and whole-service runtime status.
The new endpoint requires
scope.read; an artifact-only grant does not grant a Scope overview. Reads do not create processing intents, acquire worker leases, retry work or call models. The existing statistics endpoint also stops attributing binding-wide scan deadlines to individual Scopes. No tables or migrations are added. The endpoint is additive; MCP and CLI command surfaces are unchanged.How was this change tested?
make check,make contract-test, and the Dashboard, inspector, client, access-control, scheduler diagnostics, service-flow and Codex binding regressions. The encoded-Scope tests check successful and denied reads, early authentication failure and unhandled errors under a mounted base path.scripts/dashboard_processing_browser.cjsin Chromium with two real Scopes. The script covers all seven families, English and Chinese, both themes, narrow screens, keyboard focus, expiry, Scope switches and recovery when navigation fails during a drawer transition.2672c76ac9bd25635e49a567f6963da614036b73. Its contract digest matches the current transport manifest. Seedesktop/VALIDATION.mdand the native qualification run.AI usage statement
Implemented and validated with OpenAI Codex. Changes were reviewed against the RFC, exercised through public HTTP boundaries and checked in Chromium. Native qualification evidence is bound to the exact tested wheel and checked-in compatibility profile.