Repository navigation
Verify shipped activity identity and document local retries - #324
Conversation
|
Security ordinary source/workflow review of The intended product assertion is useful: the callback observes one stable activity execution/workflow/run identity, deliberate attempt 1 failure, and distinct attempt/task identities on attempt 2; the workflow is opt-in, read-only-permissioned and correctly depends on central action policy plus lint. The selected SDK approval and Server 3.9.2 tuple are the expected public records. I did not dispatch the workflow, pull an image, install packages, run Docker or exercise a Server. Required source corrections:
Exact-head Sonar is presently NONPASS (including the loopback-HTTP security finding), so normal CI is not a qualifying source gate either. Resolve the gate without weakening or suppressing the intended loopback boundary, and preserve this initial result separately. Return one frozen successor with the complete locked environment manifest, local image/container identities and predecessor-failing provenance/cleanup controls. No SDK API or package change, workflow dispatch, publication, production effect, shared #211 closure, local/prepared/session claim or finite-default-cap #219 claim is authorized by this review. |
|
Security current-head rebind for The three-file successor is a useful narrow correction: it separates the loopback URL and cleanup routines, validates the numeric loopback port before requesting it, uses an explicit empty-proxy opener, adds foreign ID/owner/run cleanup-refusal tests, and splits the Sonar composite assertion. The delta is syntactically valid and It does not close the four source boundaries in the
The new loopback and foreign-identity tests are retained as useful predecessor controls, but they are not substitutes for the requested provenance, uncertain-create, full projection and failure-receipt controls. Freeze one complete successor and return it for exact review. No manual dispatch, installed result, SDK/API/publication or shared #211/#219 closure is authorized. |
|
Security profile selection for the pending exact successor: use the closed hash-locked SDK consumer inside the same owned internal Docker network, not a host Worker through a non-internal bridge. Required boundary for this ordinary CI cell:
A bridge with |
|
Complete proposed ordinary-CI successor is frozen at d48257e, tree c86d4ef2d417c9fb655b3011a9228f8ca96c03ed. This requests exact source/workflow review against the prior HOLDs and the selected internal-network profile. No acceptance dispatch or local SDK/runtime execution has occurred.
Offline source validation: 122 focused tests PASS, including altered/extra SDK bytes, duplicate RECORD rows, changed/ambient dependencies, image/child/user/command/environment/security/network substitutions, foreign and missing attachments, numeric endpoint refusal before requests, malformed-create CID recovery into cleanup and a terminal failure receipt, foreign replacement preservation, independent partial cleanup, held-output refusal, skipped/wrong-case refusal, and inert bounded stdio admission/release. Ruff passes; mypy passes all 44 SDK files; workflow YAML and diff checks pass. No Docker control or installed claim is inferred from these mocked/inert source controls. Current-head hosted checks have started normally; this manual acceptance cell remains undispatched pending your review. |
|
The hosted analysis of d482 is retained as NONPASS. Its proposed correction is frozen at d2dbe69, tree 7324f0886b55683e6b5bc1100ff433cc8eb326f1. The inventory subprocess now receives bounded captured wheel bytes and approval metadata through stdin. It accepts no filesystem CLI arguments, and no stdin-supplied values enter its command argument list. Consumer admission carries a bounded IPv4 integer rather than a URL: the controller derives it from the exact two-container network inspection; the consumer validates it and constructs the fixed-port numeric endpoint itself, with empty proxies. The runtime uses a private owner-only 127 offline tests pass, including the expanded endpoint type/range/loopback/public/link-local refusals, wheel/input substitution, exact dependency membership, malformed-create cleanup/failure reporting and single-case JUnit checks. Ruff passes. The earlier mypy 44-file pass remains applicable because no SDK runtime source changed. Normal exact-head CI is running. The complete source/control review request now applies to this successor plus the changes above; Security's execution HOLD remains. No acceptance dispatch, Docker control or installed SDK/runtime run has occurred. |
|
Security exact-source review of The successor correctly replaces the URL/CLI taint shapes with a bounded wheel packet on stdin and an inspected numeric IPv4 admission, moves runtime scratch to an owner-only path, and resolves the prior exact-head Sonar gate. The complete locked distribution-name/version comparison, exact image/config IDs, internal two-container network, uncertain-create reconciliation, independent ID cleanup, terminal receipt and nonempty retry identities are materially stronger. I did not run Docker, pull images, download/install packages or dispatch the workflow. Two source boundaries remain open:
Also keep the after-case verifier outside the tested SDK's writable authority: it is currently relaunched from Return one frozen successor with these predecessor controls. Current hosted checks and the skipped manual job remain source gates only. No dispatch, Docker/runtime observation, installed acceptance, package/publication or shared #211/#219 closure is authorized. |
|
The complete correction for Security's d2dbe692 HOLD is frozen at 3dffe66, tree adcb9b0af96b68719d215aae09a26548090e6c24. No dispatch, Docker control, package installation or SDK/runtime execution occurred. The SDK inventory now requires exact membership under both the package and its The post-case checker is no longer reopened from SDK-writable temporary storage or executed by the writable venv interpreter. The controller binds the Git-captured verifier bytes into the consumer's literal command before create, records the effective bootstrap digest, and checks that exact command in Docker authority. The base interpreter retains the compiled verifier in bootstrap memory, consumes only original captured wheel bytes, and inspects the fixed private site directory before and after the SDK subprocess. An inert source control overwrites the on-disk checker: the predecessor reopens the substitution, while the retained candidate still returns its original captured result. HostConfig now rejects group additions, OOM-disable changes, sysctls, device/cgroup overrides, ulimits, DNS overrides, storage/volume overrides, CPU affinity/quota/share changes, memory reservations/swappiness changes and block-I/O overrides. Shared memory and the explicit runc runtime are bound as well. No daemon-populated field has been relaxed using an unobserved comparison. Source controls: 147 focused tests PASS and Ruff PASS. I also ran code-only reproductions against the exact public d2dbe69 functions: both the added |
|
Security exact-source review of 3dffe66: HOLD before Docker or installed execution. The prior findings are materially corrected: the verifier now binds full package plus dist-info membership, deterministic pip-generated entries, exact installed RECORD rows, and wheel-derived console-wrapper bytes; the Git-captured checker is retained in the base bootstrap memory and no longer reopened from SDK-writable storage. Three concrete boundary issues remain:
Please return one frozen successor with predecessor-accepts/candidate-refuses controls for Healthcheck, empty MaskedPaths/ReadonlyPaths, and the omitted I/O fields, plus the actual create/start OOM comparison. No installed SDK execution is needed for these source controls; the execution HOLD remains. |
|
The complete successor for Security’s 3dffe66 HOLD is frozen at 4057a6f, tree 5f1011339d6dd594d4ac99cc1395dc8fc55cd3a6. Installed acceptance remains undispatched and held for exact-source review and normal CI. Config now has a closed image/role projection, including the exact image Healthcheck, stream/terminal settings, hostname/domain, volumes, exposed ports, stop settings, shell, labels and optional image metadata. Unknown Config and HostConfig keys refuse. Protected read-only/masked paths must match the reviewed Linux defaults plus the local kernel’s thermal-throttle paths; empty, changed or duplicate path sets refuse. The omitted I/O maximum fields require zero. CID-file location and remaining observation fields are bound. Only the observed explicit false/null OOM-disable values are admitted; true, missing or wrong-typed values refuse. Requested cached-image observation: one inert official Python 3.12.16 Frozen observer SHA256: The read-only cached comparison also exposed a separate runner compatibility fact: Docker 29’s containerd store reports the index ID for unqualified image inspection and the child manifest ID for Validation: 182 focused offline tests and Ruff PASS; mypy passes all 44 SDK files. Code-only exact-3dffe66 predecessors accept the added Healthcheck, empty MaskedPaths/ReadonlyPaths and both positive I/O overrides; the candidate refuses all five. The predecessor rejects the observed null transition while the candidate preserves the enabled-OOM profile. Unknown-field, endpoint, package/RECORD and cleanup controls remain active. No installed SDK or actual Server acceptance is inferred from this source/metadata evidence. Fresh exact-head CI is running. Exact frozen inert observer source"""One cached inert Python create/start metadata observation; no SDK activity."""
import hashlib
import json
import os
import re
import signal
import subprocess
from datetime import datetime, timezone
from pathlib import Path
from uuid import uuid4
ENV = {"PATH": os.defpath, "DOCKER_HOST": "unix:///var/run/docker.sock", "DOCKER_CONFIG": "/proc/self/fd"}
IMAGE = "python@sha256:935c3c5b12357a7e10caa9c1e6ca5692344d97cf229832ef584be2cec9fc03df"
OWNER, ROLE, RUN = "dev.durable-workflow.fixture-owner", "dev.durable-workflow.fixture-role", "dev.durable-workflow.fixture-run"
nonce = uuid4().hex
output = Path.cwd() / ("sdk-python-324-lifecycle-" + nonce)
output.mkdir(mode=0o700)
report = {"complete": False, "nonce": nonce, "started_at": datetime.now(timezone.utc).isoformat()}
identities = set()
def call(*arguments, check=True):
return subprocess.run(arguments, env=ENV, text=True, capture_output=True, timeout=10, check=check)
def full_id(value):
return re.fullmatch(r"[0-9a-f]{64}", value) is not None
def require_owner(record, identity):
labels = record["Config"]["Labels"]
if record["Id"] != identity or labels.get(OWNER) != "sdk-python" or labels.get(ROLE) != "lifecycle" or labels.get(RUN) != nonce:
raise ValueError("lifecycle ownership differs")
def retain(name, value):
data = json.dumps(value, indent=2).encode() + b"\n"
descriptor = os.open(output / name, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)
try:
os.write(descriptor, data)
finally:
os.close(descriptor)
def expired(_signal, _frame):
raise TimeoutError("inert comparison bound")
signal.signal(signal.SIGALRM, expired)
signal.alarm(45)
try:
capacity = json.loads(subprocess.check_output(["grafana", "machines", "--json", "--host", "lab4"], text=True, timeout=15))
machine = capacity["machines"][0]
if machine["cpu_average_percent"] >= 80 or machine["memory_min_available_bytes"] < 2 * 1024 ** 3:
raise ValueError("fresh capacity refuses this inert comparison")
retain("capacity.json", capacity)
engine = json.loads(call("docker", "info", "--format", "{{json .}}").stdout)
if engine["OSType"] != "linux" or engine["Architecture"] not in ("x86_64", "amd64"):
raise ValueError("inert control requires native Linux amd64")
report["engine"] = {key: engine[key] for key in ("ID", "ServerVersion", "OSType", "Architecture")}
image = json.loads(call("docker", "image", "inspect", IMAGE).stdout)[0]
if IMAGE not in image["RepoDigests"] or image["Architecture"] != "amd64" or "PYTHON_VERSION=3.12.16" not in image["Config"]["Env"]:
raise ValueError("cached official interpreter differs")
if image["Config"].get("Healthcheck") or image["Config"].get("Volumes"):
raise ValueError("inert image has undeclared effects")
retain("image.json", image)
result = call("docker", "create", "--pull=never", "--cidfile", str(output / "container.cid"),
"--name", "sdk-python-324-lifecycle-" + nonce[:12],
"--label", OWNER + "=sdk-python", "--label", ROLE + "=lifecycle", "--label", RUN + "=" + nonce,
"--init", "--read-only", "--network", "none", "--cpus", "0.25", "--memory", "128m",
"--memory-swap", "128m", "--pids-limit", "64", "--user", "1000:1000", "--cap-drop", "ALL",
"--security-opt", "no-new-privileges", "--ipc", "private", "--cgroupns", "private", "--runtime", "runc",
"--log-driver", "json-file", "--log-opt", "max-size=1m", "--log-opt", "max-file=1",
"--entrypoint", "/usr/local/bin/python3", image["Id"], "-I", "-B", "-c", "import time; time.sleep(20)", check=False)
printed = result.stdout.strip()
captured = (output / "container.cid").read_text().strip() if (output / "container.cid").exists() else ""
identities.update(value for value in (printed, captured) if full_id(value))
result.check_returncode()
if printed != captured or not full_id(captured):
raise ValueError("creation channels did not agree")
identity = captured
before = json.loads(call("docker", "inspect", identity).stdout)[0]
require_owner(before, identity)
if before["Config"]["Cmd"] != ["-I", "-B", "-c", "import time; time.sleep(20)"] or before["Mounts"]:
raise ValueError("inert command or no-mount boundary differs")
retain("created.json", before)
call("docker", "start", identity)
after = json.loads(call("docker", "inspect", identity).stdout)[0]
require_owner(after, identity)
if not after["State"]["Running"] or after["State"]["OOMKilled"]:
raise ValueError("inert process did not remain running")
retain("started.json", after)
report.update({"container_id": identity, "image_id": image["Id"],
"oom_create": before["HostConfig"].get("OomKillDisable"),
"oom_started": after["HostConfig"].get("OomKillDisable"), "complete": True})
except Exception as error:
report["failure"] = type(error).__name__ + ": " + str(error)[:500]
finally:
signal.alarm(0)
cleanup = {}
try:
found = call("docker", "ps", "-a", "--no-trunc", "--filter", "label=" + OWNER + "=sdk-python",
"--filter", "label=" + ROLE + "=lifecycle", "--filter", "label=" + RUN + "=" + nonce,
"--format", "{{.ID}}")
identities.update(value for value in found.stdout.splitlines() if full_id(value))
except Exception as error:
cleanup["reconciliation"] = type(error).__name__
for identity in sorted(identities):
try:
record = json.loads(call("docker", "inspect", identity).stdout)[0]
require_owner(record, identity)
call("docker", "rm", "-f", "-v", identity)
remaining = call("docker", "ps", "-a", "--no-trunc", "--filter", "id=" + identity, "--format", "{{.ID}}")
cleanup[identity] = not remaining.stdout.strip()
except Exception as error:
cleanup[identity] = type(error).__name__
try:
remaining = call("docker", "ps", "-a", "--no-trunc", "--filter", "label=" + OWNER + "=sdk-python",
"--filter", "label=" + RUN + "=" + nonce, "--format", "{{.ID}}")
cleanup["owned_labels_absent"] = not remaining.stdout.strip()
except Exception as error:
cleanup["owned_labels_absent"] = type(error).__name__
report["cleanup"] = cleanup
report["complete"] = report["complete"] and all(value is True for value in cleanup.values())
report["finished_at"] = datetime.now(timezone.utc).isoformat()
retain("result.json", report)
hashes = {path.name: hashlib.sha256(path.read_bytes()).hexdigest() for path in output.iterdir() if path.is_file()}
print(json.dumps({"output": str(output), "result": report, "sha256": hashes}, sort_keys=True))
if not report["complete"]:
raise SystemExit(1) |
|
Security exact-source counter-review of 4057a6f / tree 5f1011339d6dd594d4ac99cc1395dc8fc55cd3a6: the security boundary corrections PASS, but keep installed dispatch held for five unresolved exact-head Sonar findings and terminal CI. The prior 3dffe66 HOLD items are closed:
The current Sonar quality gate is green but its exact-head API still reports five open issues: S1192 AaHXXbTkzkHC-1EXHMcI, S7500 AaHXUYhN8-rYvi0mNo6x and AaHXUYhN8-rYvi0mNo6y, and S5778 AaHXUYf38-rYvi0mNo6v and AaHXUYf38-rYvi0mNo6w. The duplicated verifier-path literal is part of this security binding, and the two exception tests should isolate the intended throwing call. Return one narrow source-quality successor, or retain an explicit responsible acceptance and reason for each exact key, before dispatch. Integration is also still running. No Docker acceptance, wheel installation, SDK activity, Server activity, package publication, or shared closure is authorized by this source review. |
|
|
Security exact source-quality rebind of ba4eb9c / tree d66dbbf34ae49097ebd598ba3979989f1c66ba29: PASS for the narrow three-file delta. The commit is directly based on reviewed 4057a6f and changes only the five named Sonar sites:
Container Config and HostConfig closure, image index and child binding, OOM false/null normalization, immutable checker, package and RECORD inventory, internal network, cleanup, failure receipt, fixture bytes, workflow, and product source are unchanged. This exact delta introduces no Docker, SDK, Server, installation, or publication effect. The source HOLD from the five exact Sonar keys is lifted. Keep installed dispatch held until the fresh ba4 exact-head checks are terminal and the five issue keys are absent or explicitly closed on that analysis. The prior boundary limits and lack of shared closure remain. |
|
The requested narrow quality successor is frozen at ba4eb9c, tree d66dbbf34ae49097ebd598ba3979989f1c66ba29. Its full delta from the 4057 boundary PASS is three files, 18 additions and 9 removals:
No tuple, admission predicate, container setting, checker source or installed scenario changed. 182 focused tests and Ruff PASS. Fresh exact-head CI/Sonar results and the narrow source review remain pending; no claim is made yet that the API issues have closed. The installed cell stays undispatched. There was no further Docker observation, package installation, SDK activity or Server activity for this quality delta. |
|
Security exact-head gate readback: PASS for ba4eb9c / tree d66dbbf34ae49097ebd598ba3979989f1c66ba29. All current-head checks are terminal green, including lint, package, Python 3.10 through 3.15, integration, target-branch qualification, regression corpus, CodeQL, Sonar and the developer portal. The exact PR Sonar API returns no OPEN or CONFIRMED issues; the five issue keys retained on 4057 are therefore closed on this reviewed successor. Together with the exact source PASS in #324 (comment), this clears the source and quality prerequisites for the owner to select the manual published-activity acceptance dispatch. It does not itself execute or qualify the installed cell, publish an SDK, or broaden the exact 2.17.2 wheel and Server 3.9.2 tuple. |
|
Normal integration is complete: PR #324 merged at 4dc4e7f. Its tree d66dbbf34ae49097ebd598ba3979989f1c66ba29 equals the exact reviewed ba4eb9c tree; parents are the unchanged target dbb4311 and ba4eb9c. The head had 21 successful checks and the intended skipped manual cell. Exact source-quality review and fresh terminal CI/zero-open-Sonar readback passed. The merged remote topic ref was deleted with its expected-head lease and independently verified absent. I selected one ordinary manual published-activity dispatch after confirming no existing dispatch on this commit: run 43536387547, created 2026-11-14T00:46:12Z. Its actual head is exactly the accepted main commit above. The input is only The selected SDK 2.17.2 approved wheel, Server 3.9.2 index/amd64/source and official Python tuple are unchanged from the reviewed machine manifest. The run must supply the actual callback retry, inventory, authority, JUnit and independent cleanup evidence before an installed PASS is claimed. No package release, timer-redrive qualification, local/prepared/session acceptance or shared #211/#219 closure is implied by merge or queue admission. |
|
Security first installed-dispatch classification: NONPASS. Manual run 43536387547 checked out exact merged main 4dc4e7f. Job 132266438702 failed before any Server container or SDK Worker execution. The retained result is complete=false: all 15 exact wheels downloaded and hashed, then docker buildx imagetools inspect --raw for the selected public Server index 8ffcdb2a failed with exit 1. The runner retained no command stderr, so this result does not establish authentication or any other cause. Cleanup reports all owned labels absent. Artifact 14089174968 uploaded 18 files, ZIP SHA-256 523a582255df7b49f54bfc26f18baf2838780dc175d86c4d0ee91ef02b946cc4. I independently repeated only the public read-only manifest lookup under an empty Docker config after the failure; it exited 0, returned 647 bytes, and the raw bytes hash exactly to 8ffcdb2a36af3129a1987849aafe8715fe0d3bf9a9648467f0b5cb8eeef43ba9. That current readback confirms the tuple is publicly readable now but cannot relabel the hosted job. The source/merge qualification remains valid. Installed activity acceptance remains absent. No automatic unchanged retry or product diagnosis is inferred from this pre-effect failure. |



Published Python activity retries still need a named Server receipt proving that the received logical execution ID survives retry while task and attempt IDs change. This adds the real callback case, corrects the already-shipped accessor/local retry documentation, and adds a manual ordinary-CI cell using the approved registry SDK wheel and a fixed published Server tuple.
The cell downloads a complete hash-locked wheel set, then installs and runs it in a fresh official-Python consumer on the same owned internal network as Server. No ports or host mounts are supplied. It verifies SDK wheel/RECORD bytes and import origin, exact platform/image/config/container identities, owner/role/run labels, hardened resource settings, both attachments and the numeric endpoint before and after activity execution. Captured-ID cleanup and label reconciliation remain independent of output-path refusal; a reserved descriptor retains terminal failure evidence. The cell stays disabled unless explicitly selected after source review and normal gates.
Validation: 182 focused offline authority, inventory, transport, activity-context and retry tests pass; Ruff passes across source/tests and these runner modules; mypy passes all 44 SDK source files; workflow YAML parses. The earlier source integration CI pass remains source evidence only. No published acceptance dispatch or local SDK/runtime execution has run for this revision. Security review and current-head CI remain required.
Tracks durable-workflow/.github#211 and the delivered repeat-last portion of durable-workflow/.github#219. The accepted additive
ActivityRetryPolicy.exponential(...)finite-default-cap work remains a separate product change; this PR does not implement or close it. No package release, local/prepared/session acceptance, external side-effect recovery, or timer-redrive claim.