oliver-zehentleitner / maity
cli + runner: one placement-id pattern with fullmatch everywhere; docs/api.md MAITY_PLACEMENT note
tsk-gk6vqf99mgbn Done An agent
Follow-ups found while doing tsk-rasfq0wt751a (S226, bu49):
- cli/src/maity/runner/scratchop.py keeps its own copy of the placement-id pattern; use the one in clonecheck.
- supervisor, operate and serve match hub- or operator-given ids with re.match, which accepts a trailing newline; use fullmatch.
- docs/api.md (around :20231) says something about MAITY_PLACEMENT in local mode that looks stale; check it against the code and fix the text.
Tests for the newline case. Start after #S226's PR merges.
Notes
Lotse · Nov 20, 2026, 19:18 UTC
Scope from the #2044 reviews (h385, kduz, d4kb, suqj): the PLACEMENT_ID / SCRATCH_ID users that still use .match with a $ anchor are supervisor.py:178 and :391, serve.py:282, operate.py:52/61/386 and workspace.py:136. Switch them to fullmatch in one go; a hub-sent 'plc-1\n' passes there today (a denial downstream, never a widening). Also fix d4kb's P3: the history sentence in cli/context/runner.md:2843 should say that an empty value was unplaced and a malformed one counted as placed.
An agent · Nov 20, 2026, 19:54 UTC
Follow-up list from bu49's work on this card:
.matchcalls with a$-anchored pattern outside the placement-id class. These were not converted here, because they cover other inputs (operator config, hub responses, the CLI's own parsing). Line numbers are on main 1270be8d.- cli/src/maity/config.py: 358
SLUG, 364FULL_NAME, 493 and 602REPOSITORY(operator config) - cli/src/maity/hub.py: 83
_STAMP, 307/358/359_TOKEN, 337_HANDLE, 339_GLOBAL(hub responses) - cli/src/maity/cli.py: 1422
_WHY_REF, 1457_PR_URL, 1510_SHA - cli/src/maity/sign.py: 49 and 57
CREDENTIAL_RE - cli/src/maity/onboarding.py: 151 and 176
_GLOBAL_NAME - cli/src/maity/runner/installers.py: 183, 188, 249, 254
_VERSION - cli/src/maity/runner/tools.py:62
_VERSION; targets.py:181REMOTE_PATH; asuser.py:451REMOTE_HOME; gitfacts.py:203_HEAD_REF
With
$,.matchaccepts a trailing newline. Each site needs a look at whether that can matter, and should be switched to.fullmatchwhere it is an id or path that is used further.- cli/src/maity/config.py: 358