Skip to content

feat(content-ops): add item lifecycle walkthrough smoke for GH-C78 - #3119

Closed
rootkiller6788 wants to merge 1 commit into
huangruiteng:mainfrom
rootkiller6788:feat/gh-c78-content-ops-walkthrough
Closed

feat(content-ops): add item lifecycle walkthrough smoke for GH-C78#3119
rootkiller6788 wants to merge 1 commit into
huangruiteng:mainfrom
rootkiller6788:feat/gh-c78-content-ops-walkthrough

Conversation

@rootkiller6788

Copy link
Copy Markdown
Contributor

15 scenarios covering stable identity, packet projection, full lifecycle through readback, revision-bound approval invalidation, delivery/readback receipts, supersession, fail-closed approval mismatch, event idempotency, forged-state validation, queue projection, queue status, markdown rendering, skip/revoke paths, and CLI create/transition.

Summary

Issue Or Task

  • Closes #
  • Contributor task ID:

Validation

  • python3 -m py_compile loopx/*.py
  • loopx check --scan-root .
  • Other:

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

Boundary Checklist

  • I did not commit .loopx/, .codex/goals/, live ACTIVE_GOAL_STATE.md, credentials, private benchmark traces, verifier output, raw agent sessions, internal document links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • I kept the change scoped to the linked issue/task.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Review PR #3119 — exact head 9f2ddd2ba34ecf8904c3dbd8a8965c19f6e01ae9

详细中文评审

动机

该 PR 为 GH-C78 补充 Content Ops item lifecycle walkthrough smoke,证明从 stable item identity 到 readback_verified 的完整状态机、revision-bound approval、delivery/readback receipt、supersession、fail-closed 校验、幂等、queue projection、markdown 渲染与 CLI 路径都是已实现且可回归验证的契约。Content Ops 的发布流程涉及外部发布 authority 与隐私边界,此前缺少一条统一的可执行示例路径;本 PR 用 15 个场景覆盖,且全部走真实 loopx.capabilities.content_ops.item_lifecycle API。

改动思路

新增单文件 examples/content-ops-item-lifecycle-walkthrough-smoke.py(+699),不触碰产品代码。示例直接调用真实模块:build_content_ops_itembuild_content_ops_item_packetapply_content_ops_item_eventproject_content_ops_itemvalidate_content_ops_itembuild_content_ops_queue_projectionbuild_content_ops_queue_status_packet 与两个 markdown renderer;场景 15 通过 sys.executable -m loopx.cli content-ops item-create/item-transition 走真实 CLI 路径。15 个场景按身份 → 状态机 → receipt → 失败路径 → 幂等 → 校验 → queue → 渲染 → CLI 的顺序组织;每个载荷都经过 _assert_public_safe

具体改动

关键内容讲解

  • 场景 1/2(身份与 packet):item 携带 item_id/revision/content_digest/content_ref/source_refs/created_at/updated_atapproval/delivery_intent/delivery_receipt/readback_receipt 初始为空,autopublish_allowed == False;packet 声明 external_reads/writes_performed == Falsetruth_contract.external_effect_authority == "none"
  • 场景 3(完整生命周期):captured → review_ready → approved → delivery_ready → published → readback_verified,terminal 后 next_actions == []
  • 场景 4(revision-bound approval):revise 递增 revision 并清空 approval/delivery_intent/delivery_receipt/readback_receipt——审批严格绑定 revision 与 content_digest。
  • 场景 5/6(delivery/readback receipt):record_delivery 绑定 provider/effect_kind/content_digest/public_url/receipt_ref/recorded_at;verify_readback 要求 public_url 与 content_digest 与 delivery receipt 完全一致。
  • 场景 7/14(supersession/skip/revoke):supersede 链接 superseded_by 并设 terminal_reason,terminal item 拒绝后续事件;skip 同样 terminal;revoke_approval 回到 review_ready 并清空 approval/receipt。
  • 场景 8/9/10(fail-closed 与幂等):approve 在 revision/content_digest 不匹配时 ValueError;同一 event_id 重放返回 already_applied、改 body 被拒;validate_content_ops_item 拒绝伪造 state(published 无 approval)与嵌入 draft body(unsupported fields)。
  • 场景 11/12/13(queue 与渲染):queue projection 按 priority 排序、按 state 计数、给出 next_action,projection_is_writable == False;queue status packet 只读、无外部写;item/queue markdown 均 public-safe。
  • 场景 15(CLI 路径):真实 item-createitem-transition 子命令返回 external_writes_performed == False 的 packet——示例用 sys.executable,具备可移植性。

对主干的风险

  • 无产品代码改动,git diff --check 干净;本地 exact head 运行 15/15 全部通过。
  • CI dependency-review SUCCESS、pytest 仍在 IN_PROGRESS——该示例不在 pytest 覆盖内,但本地已独立验证完整 walkthrough;合入前建议确认 CI 变绿。
  • 不新增抽象或调用方:content_ops.item_lifecycle 为已上线 capability 模块,示例全部复用其真实 API,scope-fit 成立。
  • 隐私边界严格:发布 URL 为合成 fixture,draft body 只出现在“必须被拒绝”的校验场景;所有断言覆盖序列化载荷,无凭据/本地路径/外部 sink。

我的整体评价

同意合并(APPROVE)。699 行的 walkthrough smoke 与 Content Ops 状态机的复杂度匹配:它把 revision-bound approval、receipt 一致性、supersession、fail-closed、幂等与 CLI 路径全部落到可执行断言,15/15 场景在 exact head 9f2ddd2ba34ecf8904c3dbd8a8965c19f6e01ae9 本地独立运行通过。无阻塞项;合入前确认 CI pytest 变绿即可。

English Verdict

APPROVE — exact head 9f2ddd2ba34ecf8904c3dbd8a8965c19f6e01ae9.

Key finding: the walkthrough smoke exercises the real content_ops.item_lifecycle surface across 15 scenarios (stable identity, full captured→readback_verified lifecycle, revision-bound approval invalidation, delivery/readback receipt consistency, supersession, fail-closed validation, idempotency, queue projection, markdown rendering, and the real loopx content-ops CLI path with sys.executable); all 15 passed in an independent local run at the exact head, and git diff --check is clean. No production code changes and no new abstractions; no blockers found.

Validation: local run of examples/content-ops-item-lifecycle-walkthrough-smoke.py (15/15 ok); CI dependency-review SUCCESS, pytest pending.

15 scenarios covering stable identity, packet projection, full lifecycle
through readback, revision-bound approval invalidation, delivery/readback
receipts, supersession, fail-closed approval mismatch, event idempotency,
forged-state validation, queue projection, queue status, markdown
rendering, skip/revoke paths, and CLI create/transition.
@rootkiller6788
rootkiller6788 force-pushed the feat/gh-c78-content-ops-walkthrough branch from 9f2ddd2 to 0fcd03c Compare August 12, 2026 08:09

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Re-verification — PR #3119 — exact head 0fcd03ce02e6a9fef63959f3cd2dab0217f66c50

复审结论(中文)

新 head 0fcd03ce 是对更新后 main 的 rebase:examples/content-ops-item-lifecycle-walkthrough-smoke.py 与已批准 head 9f2ddd2b 逐字节一致(空 diff)。在 exact head 本地运行 15/15 场景全部通过,git diff --check 干净。上一轮 APPROVE(review 4914219209)结论继续成立;无新增阻断项。

Re-verification Verdict (English)

Approval stands — exact head 0fcd03ce02e6a9fef63959f3cd2dab0217f66c50.

The new head is a rebase onto updated main; the PR file is byte-identical to the previously approved 9f2ddd2b (empty diff for the touched file). The walkthrough passes 15/15 locally at the exact head and git diff --check is clean. No new findings; prior APPROVE (4914219209) remains valid.

Validation: local run of examples/content-ops-item-lifecycle-walkthrough-smoke.py 15/15 ok at 0fcd03ce; PR-file diff vs approved head empty.

@huangruiteng huangruiteng left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

详细中文评审(durable_smoke_value 门槛)

精确评审头: 3119@0fcd03ce02e6a9fef63959f3cd2dab0217f66c50

动机

本 PR 是单文件 examples/content-ops-item-lifecycle-walkthrough-smoke.py(+699 行),演示 content-ops item lifecycle。按 durable_smoke_value 门槛,例程类 PR 必须证明对仓库/产品的真实、持久价值;本 PR 不满足。

改动思路

15 个 scenario 覆盖 item 创建/transition/skip/revoke 与 CLI 路径。作为演示自洽,但 content-ops lifecycle 已有专门测试与 smoke 覆盖。

具体改动(关键内容讲解)

  • existing_coverage_scantests/test_content_ops_item_lifecycle.pytests/test_content_ops_queue_status.pyexamples/content-ops-surface-fixture-smoke.py 已覆盖 lifecycle 关键路径;本 walkthrough 高度重叠。
  • same_author_batch_scan#3113#3120 为同一作者 8 个同构 walkthrough 系列。
  • real_product_or_repo_value_verdict:正确做法是收敛为 thin focused pytest;699 行 example 是重复脚手架。

对主干的风险

代码本身无运行时风险。风险在模式:同作者以同形状 walkthrough 系列重复覆盖已有测试主题,占满评审队列。

我的整体评价

REQUEST_CHANGES。 修复建议(择一):(1) 收敛为 thin focused pytest;(2) 与 #3113#3120 系列合并为一个有差异化价值的 walkthrough。贡献行为警告:按 PR #3134 政策,若同一作者在警告后再提交此类低价值同形状 PR,将禁止该账号继续向本仓库提交 PR(owner 执行屏蔽)。


English Verdict

REQUEST_CHANGES — exact head 0fcd03ce02e6a9fef63959f3cd2dab0217f66c50.

Under the durable_smoke_value gate, this 699-line example-only walkthrough duplicates existing content-ops lifecycle coverage (test_content_ops_item_lifecycle.py, test_content_ops_queue_status.py) and is part of the same author's 8-PR walkthrough series. Consolidate into thin focused tests or one differentiated walkthrough. Contribution warning: further low-value same-shape PRs will lead to the account being blocked from submitting PRs.

@rootkiller6788
rootkiller6788 deleted the feat/gh-c78-content-ops-walkthrough branch August 12, 2026 12:23
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.

2 participants