Repository navigation
fix(content-ops): generate runtime report and aggregate timestamps at call time - #8600
Conversation
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max
本次评审对应提交 975b39fc149f31813e26d270d918e0d6e8536650。
动机 / Motivation
使用 CLI 合并 connector 元数据、复核 ChatView 操作卡或生成 walkthrough 的操作员看到同一历史日期,难以辨别本次产物。三个运行时命令在省略时间时输出 2026-06-23T00:00:00Z,后续运行仍带同一历史日期。独立调用现有 CLI 的三个入口,输出时间都在实际调用 UTC 区间。walkthrough 的报告、聚合和外层只取一次时间。独立调用现有 CLI 的三个入口,输出时间都在实际调用 UTC 区间。walkthrough 的报告、聚合和外层只取一次时间。本地源代码验证使用合成元数据。生成时间表示构造时刻。外部连接器、已安装版本与托管 CI 未纳入本次验证。
改动思路 / Approach
时间默认值由构造器统一处理,因此同一规则覆盖 CLI 与 Python 直接调用。保留已有 TypeScript/Python 放置边界。这里使用 Python capability 和共享时钟。 三个入口都把省略值交给构造器。真实调用按开始与结束的 UTC 秒级时间窗口验证。合成 walkthrough 在跨秒时钟下读取下游真正的返回包,三处写同一个时间。
具体改动 / Changes
关键代码讲解
- 三个 CLI 参数的默认语义归属构造器。省略字段时的实际 generated_at 落在各命令的调用区间。传入带 +02:00 的字符串时,命令逐字输出该值。 CLI 入口
- 聚合 surface 与 ChatView report 使用同一个共享 UTC helper。walkthrough 先读取一次时间,再将该值传给两个嵌套构造器。我在两次时钟值跨秒的条件下读取了外层、报告和聚合三个结果。 构造链
- 三条命令的隐式输出只归一化 generated_at 后逐字段比较。两版显式输出、负计数及错误 schema 的拒绝结果、preview 与 exploration-plan 的完整 JSON 均相同。 回归测试
适用协议 docs/reference/protocols/content-ops-surface-v0.md,按基线 23bc2e0 核对。对应检查为 utc_at_invocation、caller_timestamp_roundtrip 和 connector_gate_parity。 协议
对主干的风险 / Risks
有些调用方会把省略时间的 JSON 当作固定快照。需要可重复时间的调用可以传入显式参数。聚合和报告的生成时刻可供操作员识别产物,来源的新鲜度仍由原有字段表达。私有来源读取和自动发布受原有 gate 约束。Ruff 0.15.22 在基线和提交的相同两处 renderer lambda 报 E731。两处路径、代码上下文和诊断一致,新测试文件单独通过 Ruff。
语义与 CI 对齐
68 项相关测试通过,另外比对了两版三条真实 JSON 命令、时间戳透传、嵌套时钟、错误输入和 fixture。DCO、RFC 双语差异和 git diff --check 通过。托管 CI 和已安装版本的状态本次未查验。
我的整体评价 / Verdict
同一范围内的三个运行时调用都产生可信的本次生成时间。显式回放、演示 fixture 与私有来源和发布的权限约束经前后对照确认。改动复用了共享时钟和原有构造路径,可以通过评审。本次评审覆盖现有宿主与 CLI 行为。本地源代码验证使用合成元数据。生成时间表示构造时刻。外部连接器、已安装版本与托管 CI 未纳入本次验证。
English verdict: APPROVE. All three live CLI paths now stamp the invocation in UTC. Verified explicit timestamp passthrough, one shared walkthrough timestamp, and connector boundary parity. The two matched pre-existing Ruff E731 diagnostics remain.
Goal And Delivered Outcome
aggregate-packets,project-chatview-report,walkthrough-artifact, and their direct builders returned2026-06-23T00:00:00Zwhengenerated_atwas omitted. The original aggregation fix left the latter two command paths unchanged.now_utc_iso()helper. Explicit timestamps remain unchanged. The regression-parity row below records the failing-before and passing-after results.main, baseline23bc2e0ed8dc8233620b3e349d686a55941dfc41.Author Declaration
Implemented against
23bc2e0ed8dc8233620b3e349d686a55941dfc41.cli.py:aggregate-packets,project-chatview-report,walkthrough-artifacttest_content_ops_cli_timestamp, omitted casessurface.py: both aggregation builders, ChatView report and walkthroughtest_aggregation_timestamp_resolves_at_call_time,test_report_timestamp_resolves_at_call_time, injected clock advanced between callsbuild_content_ops_walkthrough_artifact_packettest_report_timestamp_resolves_at_call_timenow_utc_iso(); existing validation and gates remain in placeScope And Continuation
loopx/capabilities/content_ops/cli.py,loopx/capabilities/content_ops/surface.py,tests/test_content_ops_packet_aggregation.py.cli.py:166,preview --generated-atcli.py:184,exploration-plan --generated-atcli.py:367,project-chatview-report --generated-atcli.py:437,walkthrough-artifact --generated-atsurface.py:370,build_content_ops_surface_fixturesurface.py:918,build_content_ops_preview_packetbuild_content_ops_surface_fixture.surface.py:951,build_content_ops_exploration_plan_packetsurface.py:1465,build_content_ops_chatview_report_packetNoneresolves usingnow_utc_iso().surface.py:1798,build_content_ops_walkthrough_artifact_packetloopx/capabilities/issue_fix/capability:content_ops_cli.py(2),intake_surface.py(2),workflow_plan.py(1),pr_lifecycle.py(1),repository_context.py(1),feasibility.py(1), andacceptance_loop.py(3). In particular,issue-fix-metadata-preview --fetch-metadatacan process live metadata despite its preview name. These sites are unchanged and need a separate owner-level audit; this PR does not claim to eliminate fixed timestamp defaults across the entire repository.Validation
975b39fc149f31813e26d270d918e0d6e8536650, directly after the unchanged original signed commit731a8a55d0d2755e48be4ce5115426f82af59181. The green run validated the identical source/test content before commit. The follow-up red run used unchanged production code from731a8a5plus the new regressions.Follow-up commands used
PYTHONUTF8=1,LOOPX_USAGE_PING=0, andUV_PROJECT_ENVIRONMENTexplicitly selecting this worktree's.venv. HOME, USERPROFILE, LOOPX_HOME, TEMP, TMP and TMPDIR were set under.local/.uv sync --extra testcompleted successfully. Interpreter and package provenance both point into this checkout; no installed runtime or live state was used.regression_parity(follow-up)passeduv run --extra test python -m pytest -q tests/test_content_ops_packet_aggregation.py --basetemp=.local/pytest-timestamp-red --tb=short: 6 failed, 12 passed. Failures cover omitted/None direct report and walkthrough timestamps plus CLI omission for both commands. Explicit values and original aggregation cases passed.unit(follow-up)passeduv run --extra test python -m pytest -q tests/test_content_ops_packet_aggregation.py tests/test_content_ops_queue_status.py tests/test_content_ops_item_lifecycle.py tests/test_content_ops_lifecycle.py tests/capabilities/test_value_connector_social_profile.py --basetemp=.local/pytest-timestamp-green --tb=short: 68 passed. Includes all 18 timestamp regression cases, real CLI subprocesses and the unchanged preview caller.real_entrypointpassedsys.executable -m loopx.cli --format json content-opsforaggregate-packets,project-chatview-reportandwalkthrough-artifactwith synthetic metadata; omission falls within the UTC interval around the command, and explicit timestamps are unchanged. No network fetch or publication occurs.staticpasseduv run --extra test python -m ruff check loopx/capabilities/content_ops/surface.py tests/test_content_ops_packet_aggregation.py;git diff --check;git diff --cached --check.staticfailedE731lambda assignments incli.py. The follow-up independently verified the same two diagnostics on its parent commit; see the exact command and lines below. No new Ruff diagnostics were introduced.integrationnot_runuv run --extra test python -m ruff check loopx/capabilities/content_ops/cli.py loopx/capabilities/content_ops/surface.py tests/test_content_ops_packet_aggregation.py --output-format concisereports only the same two pre-existingE731diagnostics (current lines 567 and 583). Running Ruff ongit show HEAD:loopx/capabilities/content_ops/cli.pybefore the new commit independently reports the same two errors at lines 569 and 585.git diff --checkpasses.uv run --extra test python -m ruff check loopx/capabilities/content_ops/surface.py tests/test_content_ops_packet_aggregation.pyanduv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --stagedpassed;git diff --cached --checkpassed before commit. The new commit has aSigned-off-bytrailer and the original is its direct parent. Only the three explicit code/test paths were staged; generatedrtk/,uv.lockand ignored.local/artifacts remain uncommitted. No push or PR operation was performed.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
none.Signed-off-bycommit on the same branch. No push or PR operation is part of this delivery.🤖 Generated with Claude Code