Implement planned topic: 0019-activity-info-defaults#239
Open
skill-temporal-developer-updater[bot] wants to merge 1 commit into
Open
Implement planned topic: 0019-activity-info-defaults#239skill-temporal-developer-updater[bot] wants to merge 1 commit into
skill-temporal-developer-updater[bot] wants to merge 1 commit into
Conversation
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.
Skill Validation Report —
activity info defaultsScope of validation: the unstaged change on branch
draft/0019-activity-info-defaultsagainstmain. The branch has no commits; the diff is a single addition: a new### Customize Activity Infosection appended toreferences/python/testing.md(lines 157–202), plus its trailing<!-- Sources: ... -->block.Independence: validated from the authored file and the docs clone at
../documentation/, plus the citedpython.temporal.ioAPI pages and the rawsdk-pythonsource. Did not readhidden-from-validator/AUTHORING_LOG.mdor any authoring plan.Topic classification:
Go / no-go
Overall verdict: GO. All applicable checks meet their thresholds. A handful of minor observations are noted below as polish-only suggestions; none block merge.
Check 1 findings — citation audit
All citations resolve cleanly.
docs/develop/python/best-practices/testing-suite.mdx:48— exists. Line content:To run an Activity in a test, use the [ActivityEnvironment](https://python.temporal.io/temporalio.testing.ActivityEnvironment.html) class.Supports the "ActivityEnvironment intro" attribution.docs/develop/python/activities/standalone-activities.mdx— exists (470 lines). Supports the "Python Standalone Activity APIs" attribution and the local cross-link target.sdk-python: temporalio/testing/_activity.py— verified againsthttps://raw.githubusercontent.com/temporalio/sdk-python/main/temporalio/testing/_activity.py:default_infois decorated@staticmethod, takes no arguments, and returns atemporalio.activity.Infowith the exact literal values claimed in the bullet (activity_id="test", task_queue="test", workflow_id="test", workflow_run_id="test-run", workflow_type="test", namespace="default", workflow_namespace="default", attempt=1, start_to_close_timeout=timedelta(seconds=1), schedule_to_close_timeout=timedelta(seconds=1), activity_run_id=None, retry_policy=None, heartbeat_timeout=None).api: https://python.temporal.io/temporalio.testing.ActivityEnvironment.html— confirms@staticmethod, signaturedef default_info() -> temporalio.activity.Info, and that the constructor populatesinfoto that default.api: https://python.temporal.io/temporalio.activity.Info.html— confirmsactivity_run_idtypedstr | Nonewith the documented description "Run ID of this activity. None for workflow activities.", and confirmsworkflow_id,workflow_run_id,workflow_type,workflow_namespaceare allstr | None.No root-relative
/develop/...user-facing links; the two user-visible https URLs in the section (the cross-link and code-fence references) are absolute. Markdown link tostandalone-activities.mdis a correct repo-relative target.Format note (non-blocking): the section uses a single trailing
<!-- Sources: ... -->block enumerating five sources, rather than the per-claim inline<!-- docs/path:line -->comments the validation template describes. Substance is equivalent and verifiable; format diverges from the template's expectation.Citation count: 5 (1 docs path with line, 1 docs path without line, 1 sdk-python source path, 2 API doc URLs). Resolve rate: 100%.
Check 2 findings — reverse-grep audit
Reverse-grep across
../documentation/docs/:default_infosdk-python: temporalio/testing/_activity.pyandapi: ActivityEnvironment.html. Verified directly.env.infoActivityEnvironment.infoattribute (verified via API docs).activity_run_idapi: Info.html. Verified directly ("Run ID of this activity. None for workflow activities.").dataclasses.replaceActivityEnvironment"test","test-run","default",timedelta(seconds=1), etc.)sdk-python: _activity.py. Verified directly.Zero unexplained grep-misses — every absent token is grounded in a section-level source tag (
sdk-python:orapi:) and the source was verified.Convention note (non-blocking): the template's literal expectation is per-claim
<!-- undocumented: source = ... -->inline tags. This file uses a single section-trailing<!-- Sources: ... -->block listing all five sources. Per-claim attribution would let a future validator map a specific sentinel value or claim to its specific source rather than the whole-section bundle.Check 3 findings — regression patterns
Zero hits.
--profile,TEMPORAL_TLS_CLIENT_*_PATH,tcld service-account,--output text|jsonl, port7233onsaas-api.tmprl.cloud): not applicable here (Python testing helper, no CLI/Cloud surface) and none appear.default_infoas instance method or kwargs-accepting — not present; the section explicitly calls these out as wrong in "Common mistakes."activity_run_idtyped as requiredstr— not present; the section correctly states it isNonefor Workflow-orchestrated Activities andOptional[str].Check 4 findings — independent re-verification
Sampled 11 distinct claims from the section. Re-verified each by reading the cited source independently (API docs + raw SDK source). Result: 11/11 (100%) match.
ActivityEnvironment()populatesenv.infoon constructionActivityEnvironment.html"info: The info that is returned from temporalio.activity.info function."default_info()is@staticmethoddefault_info()takes no argumentsdef default_info() -> Infoactivity_id="test"_activity.pyraw sourceworkflow_run_id="test-run"_activity.pyraw sourceattempt=1_activity.pyraw sourcestart_to_close_timeout=timedelta(seconds=1)_activity.pyraw sourceactivity_run_id=None_activity.pyraw sourceactivity_run_idisNonefor Workflow-orchestrated activitiesInfo.html"Run ID of this activity. None for workflow activities."dataclasses.replace, assign toenv.infobeforeenv.runActivityEnvironment.html"modified using dataclasses.replace before assigning to the info attribute"workflow_id,workflow_run_id,workflow_type,workflow_namespaceisOptional[str]Info.htmltypingsstr | Nonefor all fourSubtle nuances observed (not Check 4 failures, raised as polish):
workflow_namespaceas deprecated. The skill correctly lists its default value ("default") and treats it asOptional[str]for the Standalone case, but does not note the deprecation. An AI agent asserting onworkflow_namespacebased on this section will succeed today but is using a deprecated field. Consider noting (or omitting the field from the example list).default_info()actually populates ~21 fields; the bullet enumerates 13. Omitted fields includeactivity_type,current_attempt_scheduled_time,heartbeat_details,is_local,scheduled_time,started_time,task_token,priority. The bullet doesn't claim exhaustivity, so this is a coverage trade-off rather than an inaccuracy. An agent asserting on, say,info.task_token == b"test"will succeed but had no signal from the skill that the field had a default.Sample size: 11 of ~21 distinct factual claims in the new section (≈52%). Match rate well above 95% threshold.
Sampled-citation record: claims 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 above.
Check 6 findings — tone and scope
Pattern 1 (workaround disclosure): zero hits. Mandatory criterion met. The section does not show the agent how to circumvent a stated constraint. The Standalone-Activities paragraph teaches the supported
dataclasses.replacepattern (also documented in the API docs verbatim), not a hacky route.Patterns 2–14: clean. Sentences are short and outcome-oriented; the three "Common mistakes" bullets are grounded in real API shape, not speculative typos; imports are at module scope; no DIY rebuild of a supported integration; no Public-Preview chatter (the section cross-links to
standalone-activities.mdrather than re-teaching the preview feature).Pattern 15 (ambiguous "context"): one minor borderline. The third "Common mistakes" bullet — "Mutating
env.infoafterenv.runhas started — the activity has already captured the context" — uses "the context" without naming the SDK type. The antecedent is clear from the surrounding sentences (env.info/Info), but a more precise phrasing would be "the activity invocation captures the value ofenv.infoat call time." Stylistic nudge only.Statistics
Summary
The change is small (~45 lines added to one Python reference file) and factually solid. Every claim about
default_info's signature, return value, and sentinel defaults checks out against the rawsdk-pythonsource. Every claim aboutInfofield types andactivity_run_idsemantics checks out against the officialpython.temporal.ioAPI docs. The new section's worked example (dataclasses.replacethen assign toenv.infobeforeenv.run) mirrors the API's own documented usage. No regression patterns, no fabricated tokens, no workaround disclosures.Polish-only items (none blocking):
workflow_namespaceis deprecated, or drop it from the enumerated defaults and the Standalone example.env.info/Infoexplicitly.<!-- Sources: ... -->block to per-claim inline<!-- docs/... -->/<!-- undocumented: source = ... -->tags to match the template convention used elsewhere in the skill.Verdict: GO.