Repository navigation
refactor(periodic_report): fold document schema and visibility vocabularies into one owner - #8829
Closed
psychologister wants to merge 1 commit into
Conversation
…laries into one owner adapters.py and audience.py each restated the document schema tag and the primary/supporting visibility pair that field_shapes.py owns. Import both decisions from the owner (adapters keeps DOCUMENT_SCHEMA importable for its four external readers), and extend the existing owner guard with census-by-value, identity, wiring and retired-local-name checks for the two new decisions. 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/capabilities/periodic_report/field_shapes.pyis the declared owner of the capability's closed field vocabularies. Two decisions were still restated by consumers:adapters.pydefinedDOCUMENT_SCHEMAand_ITEM_VISIBILITIES, andaudience.pydefined_DOCUMENT_SCHEMAand_VISIBILITIES. One decision had three owners, so a renamed or value-drifted copy would let the validators disagree about the same payload fields undetected.field_shapes.py(DOCUMENT_SCHEMA,ITEM_VISIBILITIES), the consumers import the owner objects, and the extended owner guard fails if any second definition reappears anywhere in the package (see theunitandregression_parityrows).main.Author Declaration
Implemented against
field_shapes.DOCUMENT_SCHEMA;adapters/audienceimports;adaptersre-exporttests/architecture/test_periodic_report_field_shapes_owner.pyfield_shapes.ITEM_VISIBILITIES;adapters/audienceimportstests/architecture/test_periodic_report_field_shapes_owner.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. Deliberately keptadapters.DOCUMENT_SCHEMAimportable as a plain re-export (four external readers: bindings, archive, and the HTML/Markdown renderers) and did not touch schema tags owned by other capabilities.Scope And Continuation
field_shapes.pyalready owned are unchanged.Validation
unitpassedpython -m pytest tests/architecture/test_periodic_report_field_shapes_owner.py— 34/34 passed; census-by-value for the schema string and the visibility set (including reordered copies), identity, wiring through the adapters and audience faces, re-export identity for the four external readers, retired local names, with positive and negative controls.regression_paritypassedtests/architecturebase 2 failed / 1842 passed, head 2 failed / 1851 passed; the 25-file periodic_report capability/presentation/extensions subset base 9 failed / 491 passed, head 9 failed / 491 passed. Failure sets byte-identical (pre-existingtest_content_digest_single_ownerandtest_posix_flag_portability, plus 9 pre-existing pending-intent / turn-replan / goal-channel-delivery cases); the +9 are exactly the new guard tests. Three mutations each caught: restored schema literal copy in audience → census + retired-names; reordered visibility copy in adapters → set census + retired-names; divergent visibility copy in audience (dropssupporting) → policy and document wiring + use-beyond-import + retired-names. Dependency-lock and top-level-module-budget invariants pass on head (7/7).staticpassedpython -m ruff checkclean on all four changed files.real_entrypointpassedloopx check --scan-path <changed files>reportspublic boundary scan clean: 4 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 schema tag stays a single definition (moved) and the visibility pair is a new single-definition name, so no ratcheted collision budget moves.staticnot_runmypyis not installed in the local environment; no 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.adaptersitem normalization,audiencedocument and policy faces); the guard exercises both faces with in-set and out-of-set values and pins the four external re-export readers by identity. The fulltests/tree was not run locally — scope wastests/architecture(complete) plus the 25-file periodic_report capability/presentation/extensions subset; 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).