Skip to content

refactor(semantics): fold consumer_report mapping-read accessors into the field_use owner - #8833

Merged
loopx-agent merged 1 commit into
loopx-project:mainfrom
2430468136:codex/semantics-mapping-reads-owner
Nov 15, 2026
Merged

loopx-agent merged 1 commit into
loopx-project:mainfrom
2430468136:codex/semantics-mapping-reads-owner

Conversation

@2430468136

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Self-contained ordinary maintenance contribution (single-owner convergence); no issue or roadmap id invented.
  • Goal/source and gap: loopx/semantics/field_use.py owns MAPPING_READ_CALLS, the closed set of unambiguous mapping-read accessors (get, pop) its scan recognizes. loopx/semantics/consumer_report.py restated the same set as a private literal _MAPPING_READS, so one accessor decision had two owners and a drift would let the two scan faces disagree about which calls read a slot.
  • Observable before → after, with the validation row that proves it: Before — two modules each stated the same frozenset, so a renamed or value-drifted copy was undetected. After — consumer_report.py imports the owner object as a module-private alias, and a new architecture guard pins the value, single ownership, identity, and wiring through both scan faces (see the unit and regression_parity rows).
  • Issue/task and intended base: Related to the single-owner convergence direction; base main.

Author Declaration

  • Written by: model_agent

Implemented against

  • Specification and revision: no written specification; the request in this PR is the basis.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
The mapping-read accessor set is stated only by the owner and read by identity in the consumer report implemented field_use.MAPPING_READ_CALLS; consumer_report._MAPPING_READS alias tests/architecture/test_semantics_mapping_reads_owner.py
The isolated probe-CLI fixture carries the consumer's transitive dependencies implemented PROBE_CLI_FILES in tests/architecture/test_semantic_development_probe.py tests/architecture/test_semantic_development_probe.py
  • Self-check before submission: ran the new guard and the full tests/architecture suite on both a pristine base worktree and the head worktree and compared failure sets; ran three mutations against the guard; ran ruff, the public-boundary scan, and the semantic-vocabulary drift smoke. The parity comparison caught the probe-CLI fixture missing the consumer's new dependencies; updated PROBE_CLI_FILES with field_use.py and production.py and re-ran all 18 probe tests. Deliberately kept the alias module-private: the semantic inventory counts only module-level public uppercase assignments, and consumer_report's module comment documents that its tree must not add a closed-set carrier — an import binding preserves that. Did not fold MAPPING_WRITE_CALLS (already single-owner).

Scope And Continuation

  • Completed scope and remaining work: complete within this scope. The fold removes the duplicate definition and adds a guard that pins the decision by value, by census, by identity, and by wiring through both public scan faces, including the computed-key unresolved parity.
  • Slice boundary / successor: N/A — the maintenance outcome is complete. The write-side accessor set was already single-owner and is unchanged.

Validation

  • Tested revision: 3ab4c70
  • Run state: finished
  • Input classes: synthetic, public_fixture
Check kind Result Public-safe evidence / limitation
unit passed python -m pytest tests/architecture/test_semantics_mapping_reads_owner.py — 12/12 passed; owner value pin, census-by-value, identity, import-not-assign, and wiring through field_use.python_module_scan and the consumer-report scan with read/write/stranger accessor and computed-key controls.
unit passed python -m pytest tests/architecture/test_semantic_development_probe.py — 18/18 passed; the disposable-repository probe CLI imports the consumer with the owner module and its production dependency present.
regression_parity passed Pristine base vs head on identical selections: tests/architecture base 2 failed / 1842 passed, head 2 failed / 1854 passed; failure sets byte-identical (pre-existing test_content_digest_single_owner and test_posix_flag_portability); the +12 are exactly the new guard tests. The comparison caught one real head-only break: the isolated probe-CLI fixture copied the consumer without its new transitive dependencies (3 probe tests failed); adding field_use.py and production.py to PROBE_CLI_FILES in this diff repairs it, and all 18 probe tests then pass. Three mutations each caught: restored pre-fold local definition → census + identity + import-not-assign; renamed copy under a new binding → census; divergent owner value (adds setdefault) → value pin + both wiring faces. Dependency-lock and top-level-module-budget invariants pass on head (7/7).
static passed python -m ruff check clean on both changed files.
real_entrypoint passed loopx check --scan-path <changed files> reports public boundary scan clean: 3 files; the unrelated registry-goal error reproduces identically on the pristine base.
integration passed python examples/semantic-vocabulary-drift-smoke.py reports ok with byte-identical budget lines between base and head; the alias is import-bound and module-private, so the inventory sees no new carrier and no ratcheted collision budget moves.
static not_run mypy is not installed in the local environment; neither changed file is in the pinned mypy scope (pyproject.toml [tool.mypy] files) or the Todo CLI adapter gate, so the CI type gates are unaffected.
  • Coverage and gaps: the changed paths are the consumer binding, its two use sites, and the probe-CLI fixture list; the guard exercises both scan faces across get/pop/setdefault/unknown accessors and computed keys, pins that the consumer adds no module-level assignment, and the probe suite exercises the real CLI entrypoint in a disposable repository. The full tests/ tree was not run locally — scope was tests/architecture (complete), which contains the semantics suite; the pre-existing failures reproduce on the pristine base. No UI impact.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • First viewport and preview: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A
  • Craft review: N/A

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: N/A (single-owner maintainability convergence).

Shared-authority RFC fixture impact

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

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal 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.
  • Existing English/Chinese RFC pairs both have a diff and the local premerge check passes, or no paired RFC changed. (no paired RFC changed)
  • I completed the visual evidence section for UI changes, or marked UI impact none.
  • Every commit includes a DCO Signed-off-by trailer (git commit -s).

… the field_use owner

consumer_report.py restated the unambiguous mapping-read accessor set
{get, pop} that field_use.py already owns as MAPPING_READ_CALLS. Import it
as a module-private alias so the semantic inventory keeps seeing no new
public carrier, and add an architecture guard pinning the value, single
ownership, identity and wiring through both scan faces. The isolated
probe-CLI fixture now copies field_use.py and production.py as well, since
the consumer is no longer self-contained.

Signed-off-by: 2430468136 <130272264+2430468136@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T15:03:17.323721Z 3ab4c70 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 / reasoning effort max

动机

影响使用语义 inventory、消费者证据和开发探针的维护者。同一语料的字面键、动态键、写入及普通方法进入字段扫描与消费者扫描。八组输入的完整分类一致,真实 CLI 的 936 个分类行一致。本次验收覆盖扫描器、开发探针以及源码和隔离 wheel 的消费行为。两个 Python 扫描器分别定义 get/pop,维护者每次调整都要同步两处。

改动思路

把 mapping-read 的值域留在 field_use,在 consumer_report 接入现有私有入口。本次验收覆盖扫描器、开发探针以及源码和隔离 wheel 的消费行为。沿用既有 schema、成员资格与消费顺序。对照真实入口和已经发布的格式,并用隔离安装核对导入依赖。现有值域的 owner

具体改动

  • one-accessor-set 已实现。field_use 的 frozenset 由 consumer_report 私下导入,inventory 保持原定义范围。对应代码
  • scan-parity 已实现。936 个实际分类行保留,字面/动态键和误识别控制另有独立对照。对应代码
  • probe-install 已实现。补齐探针的 field_use/production 依赖;完整 wheel 从 site-packages 导入并重跑同一语料。对应代码

关键代码讲解

MAPPING_READ_CALLS 定义当前 Python mapping-read 方法集合。scan_python_consumers 实际消费该集合判定字面槽位读取。scan_dynamic_reads 以同一个规则将计算键归为 dynamic_key。实际消费路径

语义与 CI 对齐

架构基线 1842 通过、候选 1854 通过。两边同两项失败,新增 12 项均通过。失败是 content digest 归属和 POSIX 标志检查,测试标识与诊断一致。词汇 drift 输出逐字一致。Ruff 与完整差异检查通过。实际比较基线 8ade78cddeb6bdcd947c0a81507393c4599c7652,对应 docs/architecture/rfcs/semantic-vocabulary-convergence-v0.md。基线规范

对主干的风险

真实报告的输出仍为语法 advisory。计算键及超出既有扫描根的数据流仍以不确定状态呈现。基线和候选都标记 get/pop 的计算键为 unresolved。setdefault 保持 write 限定,普通方法和注释不被划成 slot_read。这里验证 Python 证据扫描和隔离安装输入,未推出跨运行时的数据流证明。基线与当前主干的合并树均已核对。现有输出、历史入口与失败情况在源码和独立安装路径分别读回。

我的整体评价

当前提交 3ab4c70eb4cd5c1e2d792e4b27c781240cc6bc99 通过独立代码评审。复用既有 frozenset 与私有 alias,保留真实 CLI 在脱离完整源码树时所需的两个模块。八组输入的完整分类一致,真实 CLI 的 936 个分类行一致。局部闭集由一处维护,实际消费者的兼容与边界经过同条件对照。

English verdict: APPROVE | Exact head 3ab4c70eb4cd5c1e2d792e4b27c781240cc6bc99. The accessor owner is shared. Literal and computed-key behavior and production report output match the baseline. The isolated wheel and probe pass.

@loopx-agent
loopx-agent merged commit cca9683 into loopx-project:main Nov 15, 2026
3 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.

2 participants