prizmkit 1.1.187 → 1.1.188
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundled/VERSION.json
CHANGED
|
@@ -43,9 +43,14 @@ ARTIFACT_PATH_RE = re.compile(
|
|
|
43
43
|
)
|
|
44
44
|
ABSOLUTE_PATH_RE = re.compile(
|
|
45
45
|
r"(^|[^A-Za-z0-9_./:-])"
|
|
46
|
-
r"(/Users/|/home/|/tmp/|/private/tmp/|/var/folders
|
|
46
|
+
r"(/Users/|/home/|/tmp/|/private/tmp/|/var/folders/|"
|
|
47
47
|
r"/opt/|/srv/|/root/|/var/tmp/|/Volumes/|/mnt/[A-Za-z]/|[A-Za-z]:/)"
|
|
48
48
|
)
|
|
49
|
+
WORKSPACE_ABSOLUTE_PATH_RE = re.compile(
|
|
50
|
+
r"(^|[ \t])(/workspaces?/)",
|
|
51
|
+
re.MULTILINE,
|
|
52
|
+
)
|
|
53
|
+
BARE_DETAILS_SLUG_RE = re.compile(r"(?i)^(session|run|pipeline|workflow)$")
|
|
49
54
|
BRANCH_EXACT_FIELD_RE = re.compile(
|
|
50
55
|
r"^[ \t]*[-*]?[ \t]*(BRANCH|BRANCH_NAME|CURRENT_BRANCH|SOURCE_BRANCH|BASE_BRANCH|"
|
|
51
56
|
r"HEAD_BRANCH|GIT_BRANCH|TARGET_BRANCH)[ \t_-]*(:|=|[ \t])",
|
|
@@ -296,6 +301,16 @@ def parse_document(file_path: str, raw: bytes) -> tuple[Document, list[str]]:
|
|
|
296
301
|
return Document(file_path, raw, text, document_level(file_path), frozen_sections, fields), errors
|
|
297
302
|
|
|
298
303
|
|
|
304
|
+
def _workflow_field_scan_text(text: str) -> str:
|
|
305
|
+
kept: list[str] = []
|
|
306
|
+
for line in text.splitlines(keepends=True):
|
|
307
|
+
match = DETAILS_ENTRY_RE.match(line.rstrip("\r\n"))
|
|
308
|
+
if match and BARE_DETAILS_SLUG_RE.fullmatch(match.group(1).strip()):
|
|
309
|
+
continue
|
|
310
|
+
kept.append(line)
|
|
311
|
+
return "".join(kept)
|
|
312
|
+
|
|
313
|
+
|
|
299
314
|
def _metadata_errors(document: Document) -> list[str]:
|
|
300
315
|
text = document.text
|
|
301
316
|
errors: list[str] = []
|
|
@@ -310,12 +325,17 @@ def _metadata_errors(document: Document) -> list[str]:
|
|
|
310
325
|
errors.append("is auxiliary history")
|
|
311
326
|
if AUXILIARY_METADATA_RE.search(text):
|
|
312
327
|
errors.append("contains auxiliary history metadata")
|
|
313
|
-
|
|
328
|
+
workflow_text = _workflow_field_scan_text(text)
|
|
329
|
+
if (
|
|
330
|
+
WORKFLOW_ID_RE.search(text)
|
|
331
|
+
or WORKFLOW_FIELD_RE.search(workflow_text)
|
|
332
|
+
or WORKFLOW_COMPOUND_FIELD_RE.search(text)
|
|
333
|
+
):
|
|
314
334
|
errors.append("contains workflow metadata")
|
|
315
335
|
normalized = text.replace("\\", "/")
|
|
316
336
|
if ARTIFACT_PATH_RE.search(normalized):
|
|
317
337
|
errors.append("contains PrizmKit artifact paths")
|
|
318
|
-
if ABSOLUTE_PATH_RE.search(normalized):
|
|
338
|
+
if ABSOLUTE_PATH_RE.search(normalized) or WORKSPACE_ABSOLUTE_PATH_RE.search(normalized):
|
|
319
339
|
errors.append("contains absolute worktree paths")
|
|
320
340
|
if (
|
|
321
341
|
BRANCH_EXACT_FIELD_RE.search(text)
|