Skip to content

Implement planned topic: 0019-activity-info-defaults#239

Open
skill-temporal-developer-updater[bot] wants to merge 1 commit into
mainfrom
draft/0019-activity-info-defaults
Open

Implement planned topic: 0019-activity-info-defaults#239
skill-temporal-developer-updater[bot] wants to merge 1 commit into
mainfrom
draft/0019-activity-info-defaults

Conversation

@skill-temporal-developer-updater
Copy link
Copy Markdown
Contributor

Skill Validation Report — activity info defaults

Scope of validation: the unstaged change on branch draft/0019-activity-info-defaults against main. The branch has no commits; the diff is a single addition: a new ### Customize Activity Info section appended to references/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 cited python.temporal.io API pages and the raw sdk-python source. Did not read hidden-from-validator/AUTHORING_LOG.md or any authoring plan.

Topic classification:

  • Not an integration topic — Check 5 skipped.
  • Not a cross-language feature (only Python is touched) — Check 7 skipped.

Go / no-go

Check Verdict
1. Citation audit PASS
2. Reverse-grep audit PASS (with note)
3. Regression on known bugs PASS
4. Independent re-verification (sampling) PASS (100% match)
5. Integration-layout audit N/A
6. Tone and scope audit PASS
7. Cross-language structure audit N/A

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 against https://raw.githubusercontent.com/temporalio/sdk-python/main/temporalio/testing/_activity.py: default_info is decorated @staticmethod, takes no arguments, and returns a temporalio.activity.Info with 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, signature def default_info() -> temporalio.activity.Info, and that the constructor populates info to that default.
  • api: https://python.temporal.io/temporalio.activity.Info.html — confirms activity_run_id typed str | None with the documented description "Run ID of this activity. None for workflow activities.", and confirms workflow_id, workflow_run_id, workflow_type, workflow_namespace are all str | 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 to standalone-activities.md is 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/:

Token In user docs? Explanation
default_info No Tagged at section level as sourced from sdk-python: temporalio/testing/_activity.py and api: ActivityEnvironment.html. Verified directly.
env.info No Composition of ActivityEnvironment.info attribute (verified via API docs).
activity_run_id No Tagged at section level as sourced from api: Info.html. Verified directly ("Run ID of this activity. None for workflow activities.").
dataclasses.replace Yes (sandbox, data-handling docs) Established pattern.
ActivityEnvironment Yes (testing-suite.mdx) Documented.
Sentinel literal values ("test", "test-run", "default", timedelta(seconds=1), etc.) No (in this combination) Tagged at section level as sourced from sdk-python: _activity.py. Verified directly.

Zero unexplained grep-misses — every absent token is grounded in a section-level source tag (sdk-python: or api:) 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.

  • Universal patterns (--profile, TEMPORAL_TLS_CLIENT_*_PATH, tcld service-account, --output text|jsonl, port 7233 on saas-api.tmprl.cloud): not applicable here (Python testing helper, no CLI/Cloud surface) and none appear.
  • Topic-specific anti-patterns I screened for:
    • default_info as instance method or kwargs-accepting — not present; the section explicitly calls these out as wrong in "Common mistakes."
    • activity_run_id typed as required str — not present; the section correctly states it is None for Workflow-orchestrated Activities and Optional[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.

# Claim sampled Independent source Verdict
1 ActivityEnvironment() populates env.info on construction API: ActivityEnvironment.html "info: The info that is returned from temporalio.activity.info function." match
2 default_info() is @staticmethod API + raw source match
3 default_info() takes no arguments Signature def default_info() -> Info match
4 Sentinel activity_id="test" _activity.py raw source match
5 Sentinel workflow_run_id="test-run" _activity.py raw source match
6 Sentinel attempt=1 _activity.py raw source match
7 Sentinel start_to_close_timeout=timedelta(seconds=1) _activity.py raw source match
8 Default activity_run_id=None _activity.py raw source match
9 activity_run_id is None for Workflow-orchestrated activities API: Info.html "Run ID of this activity. None for workflow activities." match
10 Customize via dataclasses.replace, assign to env.info before env.run API: ActivityEnvironment.html "modified using dataclasses.replace before assigning to the info attribute" match
11 Each of workflow_id, workflow_run_id, workflow_type, workflow_namespace is Optional[str] API: Info.html typings str | None for all four match

Subtle nuances observed (not Check 4 failures, raised as polish):

  • The API doc marks workflow_namespace as deprecated. The skill correctly lists its default value ("default") and treats it as Optional[str] for the Standalone case, but does not note the deprecation. An AI agent asserting on workflow_namespace based 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 include activity_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.replace pattern (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.md rather than re-teaching the preview feature).

Pattern 15 (ambiguous "context"): one minor borderline. The third "Common mistakes" bullet — "Mutating env.info after env.run has 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 of env.info at call time." Stylistic nudge only.


Statistics

  • Citation count: 5 (1 docs-path-with-line, 1 docs-path, 1 sdk-python source path, 2 API URLs)
  • Citations resolved: 5 / 5 (100%)
  • Reverse-grep tokens checked: 6 classes (default_info, env.info, activity_run_id, dataclasses.replace, ActivityEnvironment, sentinel values)
  • Unexplained grep-misses: 0
  • Check 3 regression hits: 0
  • Check 4 sample size: 11 claims; match rate 11/11 = 100%
  • Check 6 mandatory (Pattern 1) hits: 0
  • Check 6 minor findings: 1 (Pattern 15 — "the context")

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 raw sdk-python source. Every claim about Info field types and activity_run_id semantics checks out against the official python.temporal.io API docs. The new section's worked example (dataclasses.replace then assign to env.info before env.run) mirrors the API's own documented usage. No regression patterns, no fabricated tokens, no workaround disclosures.

Polish-only items (none blocking):

  1. Note that workflow_namespace is deprecated, or drop it from the enumerated defaults and the Standalone example.
  2. Consider tightening "the context" in the third Common-mistakes bullet to name env.info / Info explicitly.
  3. (Optional) Migrate the section-level <!-- Sources: ... --> block to per-claim inline <!-- docs/... --> / <!-- undocumented: source = ... --> tags to match the template convention used elsewhere in the skill.

Verdict: GO.

@skill-temporal-developer-updater skill-temporal-developer-updater Bot requested a review from a team as a code owner June 2, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants