Conversation
Seven modules compiled the same slug shape themselves. This converts the three that no other open branch is editing: the periodic-report request core, the issue-fix report source and the hand-off review batch. Two of them also dropped a now-unused import re. The canonical private-text module is the owner because the shapes a public-safe field may hold already live there, and control_plane plus two capability packages can reach it without crossing the import-boundary guard. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
The scan folds a pattern through same-file string constants and normalizes anchors, so a half-anchored or assembled restatement is reported the same as a literal copy. A construction whose value cannot be folded must be declared with its file and count. Four periodic_report files keep their own copy, declared by file and count: their import blocks are being rewritten by an open branch, so converting them here would only create a conflict between two pending pull requests. Both directions of each count are checked, so converting one without retiring its entry fails. Signed-off-by: karenchuu <25980598+karenchuu@users.noreply.github.com>
This branch has not been deployed
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
Outcome basis / anchor: no pre-existing issue. The anchor is a measurement on the intended base
a9ee074de: the shape^[a-z][a-z0-9_.-]{0,127}$-- "is this identifier a lowercase public-safe slug" -- was compiled by seven modules themselves:capabilities/periodic_report/core.py:17,capabilities/issue_fix/periodic_report.py:20,control_plane/handoff/review_batch.py:15,capabilities/periodic_report/adapters.py:28,capabilities/periodic_report/archive.py:27,capabilities/periodic_report/audience.py:17andcapabilities/periodic_report/bindings.py:27. Consequence: tightening or loosening the slug rule was a seven-file change, and four of the seven lived in one package where the others could not see them.Observable before → after:
loopx/public_safe_text.pystates the shape once asPUBLIC_SAFE_SLUG_PATTERN, and the three modules no open branch is editing ask it for the answer -- the other four are declared by file and count in the guard, not silently skipped. Product side is 4 files, +14 / -8: three compiled copies and two now-unusedimport relines leave, one owner line and four imports come in. Every accepted and rejected value stays the same, which the guard's accept/reject corpus and 48 pre-existing test files confirm.Why this owner and not a new module: the shapes a public-safe field may hold already live in
public_safe_text.py(the module docstring calls it the canonical private-text owner, and refactor(public-safety): centralize compact identifier shapes #5351'sPUBLIC_SAFE_REFERENCE_PATTERNset the precedent of putting an allowlist shape there), it is reachable fromcontrol_plane/handoffand both capability packages without crossingtest_control_plane_import_boundaries.py, and it holds zero census rows. A new top-level module was not available at all:tests/architecture/top_level_module_budget.jsonallows 147 andloopx/*.pyis at exactly 147.Intended base:
a9ee074de.Scope And Continuation
adapters.py,archive.py,audience.py,bindings.py. Converting them in this slice would have created a conflict between two pending pull requests of the same author for no semantic gain.DECLARED_INDIVIDUAL_SITESpins one site per file, and the guard fails in both directions: a second copy appearing there, and a site converted without its entry retired. Successor: delete four entries when refactor(digest): one owner builds the stored SHA-256 envelope #5337 lands._IDENTITY_RE = ^[a-z][a-z0-9_.:-]{2,127}$(periodic_report/request_action.py:34,pending_intent.py:72) differs in bound and in allowing:-- a different decision with a different rejection, kept where it is.{0,199}reference shape with/:#-belongs to refactor(public-safety): centralize compact identifier shapes #5351's owner._token-style helper and its own error text, because those describe the owning surface, not the shared rule -- the same splitpublic_safe_text.pydocuments for the four text validators.Validation
c804d5c9f(2 commits, 5 files, +484 -8).unitpytest tests/architecture/test_public_safe_slug_owner.py-> 41 passed in 6.4s: value scan overloopx/with anchor normalization and same-file constant folding, declared-site counts in both directions, per-consumer identity plus a real reference, 7 accept / 14 reject cases including the 128/129 boundary, 9 spelling probes (6 that must be reported, 3 that must not) and the unfoldable-declaration probe.integrationpytest tests/architecture tests/canaryin full at this head -> 1112 passed, 0 failed in 2m04s. This branch adds a module-level constant to a file that several architecture guards read by name, so the whole pair was run rather than a slice.regression_paritypytestover the 48 test files that mentionperiodic_report,review_batchorpublic_safe_text-> 1204 passed, 1 failed in 2m51s. The one failure istests/control_plane/test_quota_settlement_cli.py::test_read_only_settlement_omits_non_causal_delivery_workspace. Attribution, run under identical conditions on an unmodifieda9ee074deworktree and on this head, alternating: the unmodified base failed that same file in round 1 (1 failed, 78 passed) while head passed both rounds (79 passed, 79 passed), and the node id alone passed 3/3 on each tree. It is a quota/heartbeat subprocess case that reads shared local state, so it flips with order and load; this branch adds nothing it depends on.staticpython -m ruff checkon all five changed paths: clean (it is also what caught the twoimport relines left unused after the migration).python -m mypy(no arguments, as CI runs it):Success: no issues found in 19 source files.git diff --check: clean.staticloopx check --scan-pathfor each of the five changed paths through this tree's own entrypoint:ok: true, "public boundary scan clean: 5 files"; both warnings concern the absent local.loopx/registry.json. One non-literal credential reference was downgraded, as it is on the unmodified base.semantics budgetexamples/semantic-vocabulary-drift-smoke.pyon the unmodified base worktree and on this head, same venv, same Node 22.23.2, samenode_modules: output byte-identical,conflicting_definitions=55/55,conflicting_values=16/16. As in the benchmark slice, are.compilevalue is not one of the inventory's counted kinds, so the new constant name enters no budget and no anchor needed editing; the name itself is unique in the tree (0 prior hits).canaryloopx canary premergewith the five changed files passed explicitly:selected 18 / executed 18 / failures 0 / warnings 0,status: passed, no manual holds.mutation^[a-z][a-z0-9_.-]{0,127}(M2, 3 cases -- the scan normalizes anchors because they are redundant underfullmatch); a shape assembled from two same-file constants (M3); an inlinere.fullmatchinside a function (M4); the owner's bound tightened by one character (M5); the owner's class allowing one more character (M6); a consumer keeping the import while deciding with a weaker local check (M7); a declared site gaining a second copy without retiring its count (M8, 3 cases); an unfoldable construction in a module that mentions the class (M9); a validator helper restating the shape inside a converted module (M10, 3 cases). Disclosure: M9 and M10 first reported survived, and the cause was my driver, not the guard -- twoedit()calls on one file each rewrote from the pristine copy, so the second silently discarded the first. Fixed by making each mutation one edit, then both were caught. Survived, and why it is equivalent: M11 addstoken.islower()alongside the owner check; for every value the pattern accepts that predicate already holds, and the periodic-report suite stayed green, so it is not a second owner.frontendType Of Change
LoopX Area
loopx/public_safe_text.py,loopx/capabilities/periodic_report/core.py,loopx/capabilities/issue_fix/periodic_report.py,loopx/control_plane/handoff/review_batch.py,tests/architecture/.Technical Direction
fullmatchmakes them redundant, which is exactly the case a text-diff review would wave through.Boundary Checklist
none.