Repository navigation
refactor(semantics): fold consumer_report mapping-read accessors into the field_use owner - #8831
Closed
psychologister wants to merge 1 commit into
Closed
psychologister wants to merge 1 commit into
psychologister wants to merge 1 commit into
Conversation
… 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: psychologister <230141834+psychologister@users.noreply.github.com>
psychologister
requested review from
huangruiteng,
loopx-agent and
songoow
as code owners
November 15, 2026 14:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal And Delivered Outcome
loopx/semantics/field_use.pyownsMAPPING_READ_CALLS, the closed set of unambiguous mapping-read accessors (get,pop) its scan recognizes.loopx/semantics/consumer_report.pyrestated 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.consumer_report.pyimports 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 theunitandregression_parityrows).main.Author Declaration
Implemented against
field_use.MAPPING_READ_CALLS;consumer_report._MAPPING_READSaliastests/architecture/test_semantics_mapping_reads_owner.pyPROBE_CLI_FILESintests/architecture/test_semantic_development_probe.pytests/architecture/test_semantic_development_probe.pytests/architecturesuite 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; updatedPROBE_CLI_FILESwithfield_use.pyandproduction.pyand re-ran all 18 probe tests. Deliberately kept the alias module-private: the semantic inventory counts only module-level public uppercase assignments, andconsumer_report's module comment documents that its tree must not add a closed-set carrier — an import binding preserves that. Did not foldMAPPING_WRITE_CALLS(already single-owner).Scope And Continuation
Validation
unitpassedpython -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 throughfield_use.python_module_scanand the consumer-report scan with read/write/stranger accessor and computed-key controls.unitpassedpython -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_paritypassedtests/architecturebase 2 failed / 1842 passed, head 2 failed / 1854 passed; failure sets byte-identical (pre-existingtest_content_digest_single_ownerandtest_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); addingfield_use.pyandproduction.pytoPROBE_CLI_FILESin 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 (addssetdefault) → value pin + both wiring faces. Dependency-lock and top-level-module-budget invariants pass on head (7/7).staticpassedpython -m ruff checkclean on both changed files.real_entrypointpassedloopx check --scan-path <changed files>reportspublic boundary scan clean: 3 files; the unrelated registry-goal error reproduces identically on the pristine base.integrationpassedpython examples/semantic-vocabulary-drift-smoke.pyreportsokwith 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.staticnot_runmypyis 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.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 fulltests/tree was not run locally — scope wastests/architecture(complete), which contains the semantics suite; the pre-existing failures reproduce on the pristine base. No UI impact.Frontend / Visual Evidence
Type of Change
LoopX Area
Technical Direction
Shared-authority RFC fixture impact
Boundary Checklist
none.Signed-off-bytrailer (git commit -s).