Skip to content

fix(content-ops): generate runtime report and aggregate timestamps at call time - #8600

Merged
huangruiteng merged 2 commits into
loopx-project:mainfrom
xiaobaifly7:fix/content-ops-default-generated-at
Nov 11, 2026
Merged

huangruiteng merged 2 commits into
loopx-project:mainfrom
xiaobaifly7:fix/content-ops-default-generated-at

Conversation

@xiaobaifly7

@xiaobaifly7 xiaobaifly7 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Complete the stale default timestamp fix across the existing content-ops owner.
  • Goal/source and gap: aggregate-packets, project-chatview-report, walkthrough-artifact, and their direct builders returned 2026-06-23T00:00:00Z when generated_at was omitted. The original aggregation fix left the latter two command paths unchanged.
  • Observable before → after: Omitted timestamps now use current UTC at each call through the existing now_utc_iso() helper. Explicit timestamps remain unchanged. The regression-parity row below records the failing-before and passing-after results.
  • Issue/task and intended base: No public issue; target main, baseline 23bc2e0ed8dc8233620b3e349d686a55941dfc41.

Author Declaration

  • Written by: model_agent — OpenAI Codex (GPT-6).

Implemented against

  • Specification and revision: No written specification; the request in this PR is the basis. Reviewed existing Python owners at baseline 23bc2e0ed8dc8233620b3e349d686a55941dfc41.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
All three runtime CLI paths use current UTC on omission implemented cli.py: aggregate-packets, project-chatview-report, walkthrough-artifact test_content_ops_cli_timestamp, omitted cases
Direct runtime builders resolve omitted/None timestamps per call implemented surface.py: both aggregation builders, ChatView report and walkthrough test_aggregation_timestamp_resolves_at_call_time, test_report_timestamp_resolves_at_call_time, injected clock advanced between calls
Explicit timestamps remain supported without normalization implemented CLI and direct builders Explicit timestamp cases, including a non-UTC offset in the report regression
Walkthrough shares one generated timestamp across its nested report and aggregate implemented build_content_ops_walkthrough_artifact_packet Per-call clock count in test_report_timestamp_resolves_at_call_time
Reuse the existing UTC helper and retain source/publication guards implemented now_utc_iso(); existing validation and gates remain in place Focused content-ops tests and real CLI assertions
  • Self-check before submission: Read the root instructions, PR template, relevant development guidance, affected callers, and shared UTC helper. Added tests and ran them against unchanged production code before applying the fix. Inspected the final diff and public/private boundary. No unrelated refactor was necessary at this owner boundary.

Scope And Continuation

  • Completed scope and remaining work: The original aggregation fix is retained. The follow-up fixes both remaining runtime command paths and direct builders. Omitted/None values resolve at call time; explicit strings are preserved. No new configuration, dependency, protocol vocabulary, migration, or persistent state was introduced.
  • Files changed across the branch: loopx/capabilities/content_ops/cli.py, loopx/capabilities/content_ops/surface.py, tests/test_content_ops_packet_aggregation.py.
  • All nine remaining literal-default occurrences in the content-ops owner were classified:
Occurrence (line at audit start) Disposition Reason
cli.py:166, preview --generated-at intentional, retained Help explicitly names the synthetic preview fixture; it delegates only to the fixture builder.
cli.py:184, exploration-plan --generated-at intentional, retained The command and builder explicitly produce a fixture-only plan with static source-lane candidates.
cli.py:367, project-chatview-report --generated-at fixed It stamps caller-supplied counts from an approved metadata trial; omission must use current UTC.
cli.py:437, walkthrough-artifact --generated-at fixed It stamps the operator artifact built from caller-supplied metadata and observations.
surface.py:370, build_content_ops_surface_fixture intentional, retained The docstring and hard-coded demo records define a synthetic public-safe fixture.
surface.py:918, build_content_ops_preview_packet intentional, retained It exclusively wraps build_content_ops_surface_fixture.
surface.py:951, build_content_ops_exploration_plan_packet intentional, retained Its docstring defines a fixture-only plan, not a capture of live connector observations.
surface.py:1465, build_content_ops_chatview_report_packet fixed Runtime report metadata is derived from caller-supplied counts; None resolves using now_utc_iso().
surface.py:1798, build_content_ops_walkthrough_artifact_packet fixed Resolve once and pass the value to the nested ChatView report and aggregation.
  • Adjacent finding outside this owner: a repository literal search also found 11 defaults under the separate loopx/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), and acceptance_loop.py (3). In particular, issue-fix-metadata-preview --fetch-metadata can 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

  • Tested revision: New signed commit 975b39fc149f31813e26d270d918e0d6e8536650, directly after the unchanged original signed commit 731a8a55d0d2755e48be4ce5115426f82af59181. The green run validated the identical source/test content before commit. The follow-up red run used unchanged production code from 731a8a5 plus the new regressions.
  • Run state: finished.
  • Input classes: synthetic.

Follow-up commands used PYTHONUTF8=1, LOOPX_USAGE_PING=0, and UV_PROJECT_ENVIRONMENT explicitly selecting this worktree's .venv. HOME, USERPROFILE, LOOPX_HOME, TEMP, TMP and TMPDIR were set under .local/. uv sync --extra test completed successfully. Interpreter and package provenance both point into this checkout; no installed runtime or live state was used.

Check kind Result Public-safe evidence / limitation
regression_parity (follow-up) passed Red: uv 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) passed Green: uv 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_entrypoint passed The regression tests invoke sys.executable -m loopx.cli --format json content-ops for aggregate-packets, project-chatview-report and walkthrough-artifact with synthetic metadata; omission falls within the UTC interval around the command, and explicit timestamps are unchanged. No network fetch or publication occurs.
static passed uv 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.
static failed Checking all three changed files with Ruff reports two existing E731 lambda assignments in cli.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.
integration not_run Full repository suites, packaged/installed runtime, and remote CI were outside this focused local fix.
  • Follow-up static evidence: uv 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 concise reports only the same two pre-existing E731 diagnostics (current lines 567 and 583). Running Ruff on git show HEAD:loopx/capabilities/content_ops/cli.py before the new commit independently reports the same two errors at lines 569 and 585. git diff --check passes.
  • Additional follow-up checks: uv run --extra test python -m ruff check loopx/capabilities/content_ops/surface.py tests/test_content_ops_packet_aggregation.py and uv run --extra test python scripts/check_rfc_bilingual.py --base origin/main --staged passed; git diff --cached --check passed before commit. The new commit has a Signed-off-by trailer and the original is its direct parent. Only the three explicit code/test paths were staged; generated rtk/, uv.lock and ignored .local/ artifacts remain uncommitted. No push or PR operation was performed.
  • Coverage and gaps: Injected clocks cover fresh per-call resolution, omission, explicit None, explicit offset preservation, and one clock read for the whole walkthrough. Real CLI cases cover parsing, JSON input/output, validation, and serialization for all three runtime paths. Existing tests cover lifecycle, queue and preview consumers. The two baseline CLI lint diagnostics remain. Full repository suites, remote CI, installed runtime and external connectors were not exercised.

Frontend / Visual Evidence

  • UI impact: none; generated metadata and CLI help only, without layout changes.
  • Before: N/A.
  • After: N/A.
  • First viewport and preview: N/A; no presentation change.
  • States and viewports shown: N/A.
  • Source data: synthetic.
  • Attention review: N/A; no frontend changes.
  • Craft review: N/A; no frontend changes.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference, when applicable: Correct default metadata in the existing content-ops Python owner; no cross-cutting architecture claim.

Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A.
  • Semantic dimensions changed, or reviewed no-impact rationale: N/A; no control-plane migration or shared Goal Authority behavior changed.
  • Provider conformance arms run: N/A.
  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A.

Boundary Checklist

  • Neither the diff nor this body discloses private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • No maintainer-owned benchmark work was duplicated.
  • The change covers runtime default timestamps in the content-ops owner and preserves intentional deterministic fixture defaults.
  • No paired RFC changed.
  • UI impact is marked none.
  • The original commit remains unchanged; the follow-up uses a new DCO Signed-off-by commit on the same branch. No push or PR operation is part of this delivery.

🤖 Generated with Claude Code

Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>
@xiaobaifly7 xiaobaifly7 changed the title fix(content-ops): generate aggregate timestamps at call time fix(content-ops): generate runtime report and aggregate timestamps at call time Nov 11, 2026

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@huangruiteng
huangruiteng merged commit b092c70 into loopx-project:main Nov 11, 2026
29 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants