Repository navigation
control_plane/projects: single-source the safe project-id grammar - #8666
Open
psychologister wants to merge 1 commit into
Open
psychologister wants to merge 1 commit into
psychologister wants to merge 1 commit into
Conversation
repository_identity._SAFE_PROJECT_ID is the canonical stable-identifier grammar
(^[A-Za-z0-9][A-Za-z0-9._:-]{0,255}$); resolve_project_identity uses it to validate
the loopx:<id> fallback when a checkout has no origin remote. The projects registry
restated the identical pattern as its own _SAFE_ID and used it in _identifier to
reject unsafe project/goal ids. The registry already imports
normalize_repository_identity from repository_identity, so borrowing one more
owner object adds no import edge and cannot cycle. _SAFE_ID is retired and
_identifier now fullmatches against the owner; the sole remaining use of the re
module in this file was that definition, so its import is dropped too.
presentation/static_site.py keeps a same-named _SAFE_ID with a genuinely different
grammar (no colon, 63-character cap) and is left untouched -- it is a neighbour,
not a copy.
The by-name semantic inventory cannot see this: both bindings are private
_-names it does not catalogue, and they carried different names, so a name-keyed
match would not pair them even if it looked. The new guard keys on the compiled
pattern value -- a whole-tree census of re.compile sites, identity for the
consumer, retirement, the distinct static-site neighbour, and behavioural parity
through registry._identifier over the owner's grammar (including the 256/257
length boundary) plus the resolve_project_identity fallback.
Refs loopx-project#4447.
Signed-off-by: psychologister <230141834+psychologister@users.noreply.github.com>
psychologister
requested review from
huangruiteng,
loopx-agent and
songoow
as code owners
November 13, 2026 03:18
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.
repository_identity.SAFE_PROJECT_ID is the canonical stable-identifier grammar
(^[A-Za-z0-9][A-Za-z0-9.:-]{0,255}$); resolve_project_identity uses it to validate
the loopx: fallback when a checkout has no origin remote. The projects registry
restated the identical pattern as its own _SAFE_ID and used it in _identifier to
reject unsafe project/goal ids. The registry already imports
normalize_repository_identity from repository_identity, so borrowing one more
owner object adds no import edge and cannot cycle. _SAFE_ID is retired and
_identifier now fullmatches against the owner; the sole remaining use of the re
module in this file was that definition, so its import is dropped too.
presentation/static_site.py keeps a same-named _SAFE_ID with a genuinely different
grammar (no colon, 63-character cap) and is left untouched -- it is a neighbour,
not a copy.
The by-name semantic inventory cannot see this: both bindings are private
_-names it does not catalogue, and they carried different names, so a name-keyed
match would not pair them even if it looked. The new guard keys on the compiled
pattern value -- a whole-tree census of re.compile sites, identity for the
consumer, retirement, the distinct static-site neighbour, and behavioural parity
through registry._identifier over the owner's grammar (including the 256/257
length boundary) plus the resolve_project_identity fallback.
Refs #4447.
Signed-off-by: psychologister 230141834+psychologister@users.noreply.github.com