mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-01 18:52:21 +01:00
merge: reconcile Wave 1.1 with post-PR40 lab
Merge canonical lab 9557b8d5909eb4a885c3bf49e19a65dd904f8c1d exactly once. Retain invocation journal ownership and lineage, provider terminal ordering, teacher handoff, framed DONE handling, and canonical authority/Ajax routing. Combine dynamic dispatch receipts with lab policy forwarding. Adapt native shell/patch evidence, explicit TUI verifiers, and artifact recovery presentation. Refresh generated configuration source links and strengthen adapter regressions. Validation: focused 2118 passed; Wave 1.1 script 2291 passed; broad runtime 5649 passed; full pytest 11581 passed, 53 skipped, 2 xfailed, 6 subtests passed. Compileall 1689 Python files; syntax 279 JS and 82 MJS files; diff and conflict-marker checks passed.
This commit is contained in:
@@ -11,6 +11,17 @@ import stat
|
||||
from .path_policy import _is_sensitive_path
|
||||
|
||||
|
||||
TUI_PYTHON_RUNNER_SETUP = (
|
||||
"runner=''; "
|
||||
"if [ -x .venv/bin/python ]; then runner=.venv/bin/python; "
|
||||
"elif [ -x venv/bin/python ]; then runner=venv/bin/python; "
|
||||
"elif git_common=$(git rev-parse --path-format=absolute --git-common-dir 2>/dev/null) "
|
||||
"&& [ -x \"$(dirname \"$git_common\")/.venv/bin/python\" ]; then "
|
||||
"runner=\"$(dirname \"$git_common\")/.venv/bin/python\"; "
|
||||
"else runner=python; fi; "
|
||||
)
|
||||
|
||||
|
||||
def digest(value: object) -> str:
|
||||
return hashlib.sha256(json.dumps(value, sort_keys=True, ensure_ascii=False,
|
||||
separators=(",", ":"), default=str).encode()).hexdigest()
|
||||
@@ -85,13 +96,23 @@ def artifact_identity(value: str, workspace: str = "") -> str:
|
||||
|
||||
|
||||
def executable_words(command: str) -> tuple[str, ...]:
|
||||
"""Recognize one foreground command, optionally after safe cd/set prefixes.
|
||||
"""Recognize one foreground command after exact interpreter or cd/set prefixes.
|
||||
|
||||
This is deliberately conservative evidence parsing, not shell authorization.
|
||||
Pipelines, control flow, substitutions and status-masking tails are not proof
|
||||
Other control flow, substitutions, pipelines and status-masking tails are not proof
|
||||
that a verifier returned the recorded shell status.
|
||||
"""
|
||||
text = str(command or '').strip()
|
||||
if text.startswith(TUI_PYTHON_RUNNER_SETUP):
|
||||
remainder = text[len(TUI_PYTHON_RUNNER_SETUP):]
|
||||
# This exact server-owned prelude only selects the interpreter. The
|
||||
# trailing command must still be a single foreground invocation whose
|
||||
# status is returned unchanged; the generic discovery fallback is not.
|
||||
if remainder.startswith('"$runner" '):
|
||||
arguments = remainder[len('"$runner" '):]
|
||||
if '$' in arguments:
|
||||
return ()
|
||||
text = 'python ' + arguments
|
||||
if any(marker in text for marker in ('`', '$(', '${', '\n', '\r')):
|
||||
return ()
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user