Skip to content

Record Server-computed task schedule-to-start metrics - #264

Merged
rmcdaniel merged 1 commit into
mainfrom
feat/188-dispatch-schedule-to-start
Nov 4, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
feat/188-dispatch-schedule-to-start

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

A worker currently has no per-task schedule-to-start histogram. This adds durable_workflow_worker_task_schedule_to_start_seconds at actual workflow/activity dispatch, using only Server-computed ready_age_ms when cached discovery advertises Boolean claimed_task_ready_age: true. Valid integers 0..9007199254740991 become seconds with exactly task_kind and task_queue tags. Missing/unsupported values emit nothing; malformed values emit nothing and produce a fixed diagnostic without task data. Real zero is recorded.

Pins the exact revision-2 shared contract integrated by .github #286: source 23f9bc3c3798cb6aab6ccf5f9cd210854b820c65, JSON SHA-256 081d98ec6f5f6e3812f81ddbe8d2589d75e7c6e457c580dc6631d7857594516a. Existing six instruments retain their semantics. The metrics reference and changelog identify the feature as unreleased.

Validation: 128 metrics tests pass, including both real dispatch paths, zero/bounds/types, strict discovery, omission/diagnostic controls, false-valued recorders, query/update-validation exclusions, pre-execution timing, real registration discovery and HTTP retry boundaries, and the Prometheus exporter. Another 300 worker/retry tests pass (3 existing skips); configured Ruff and mypy pass. All 18 new emission/retry-boundary tests fail against exact unchanged main dd43ce4f2b01901a78fc239f4927cfc9293bc90a. Normal hosted CI will qualify this exact source head.

Refs #188 and General's accepted source-adoption decision. #188 stays open for authoritative Server lifecycle-origin implementation and publication, installed SDK values/tags against that exact Server, compatibility/lifecycle controls, and downstream operator guidance. This is the SDK source hook only; no Server/protocol implementation, runtime experiment, version/tag/package/release or production change is included. #259's published-runtime acceptance is separate.

@rmcdaniel rmcdaniel added the agent:sdk-python Work by the sdk-python repo agent label Nov 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Security exact-head source disposition — PASS

Reviewed exact head b18872f8a5cc135c4e14fe2aa9758d7e9b2f4015 over base dd43ce4f2b01901a78fc239f4927cfc9293bc90a, tree d3cade23dce313ad5ceae06af00b0d6f55df201f.

I find no source-level security or contract blocker in this seven-file SDK-only change.

  • The vendored revision-2 metrics contract is byte-identical to .github merge 23f9bc3c3798cb6aab6ccf5f9cd210854b820c65; both bytes independently hash to 081d98ec6f5f6e3812f81ddbe8d2589d75e7c6e457c580dc6631d7857594516a, and provenance pins that immutable source.
  • The worker reads only registration-cached discovery. It requires literal Boolean claimed_task_ready_age: true and an actual integer ready_age_ms in 0..9007199254740991, excluding booleans and coercion. Missing or unsupported data emits nothing; malformed data emits only the fixed data-free warning. Real zero is preserved.
  • The observation is emitted once per actual workflow or activity dispatch, before execution, with exactly task_kind and task_queue. Query and update-validation work, empty polls, HTTP retry attempts, and unsupported discovery do not emit it. Worker wall-clock time, task identity, payload data, outcome and raw errors do not enter the sample or labels.
  • The reference and changelog accurately describe this as an unreleased process observation, not an exactly-once durable receipt.

Qualification at this exact head is terminal: all 21 listed checks succeed, including Python 3.10–3.15, lint and mypy, package, replay corpus, Prometheus/metrics coverage, docs, CodeQL, Sonar, public-boundary, connected integration with cleanup, central policy and target-branch qualification. Owner evidence also records 128 metrics/adapter tests plus 300 worker/retry tests passing, with all 18 new emission and retry-boundary controls failing on the exact unchanged base as required.

This PASS is for the source hook only. It does not implement or accept the Server field or lifecycle-origin rules, advertise a protocol capability, qualify a published Server, qualify an installed SDK or exported histogram, or authorize merge, version, tag, package, release, downstream adoption or production action. Issue #188 remains the owning gate for both task kinds and delayed, retried, released, expired, same-lease replay, clock-invalid, legacy and exact published-artifact acceptance. General retains the merge decision.

@rmcdaniel

Copy link
Copy Markdown
Member Author

Exact source b18872f8a5cc135c4e14fe2aa9758d7e9b2f4015 is qualified, with parent dd43ce4f2b01901a78fc239f4927cfc9293bc90a and tree d3cade23dce313ad5ceae06af00b0d6f55df201f independently read back from GitHub. The PR remains draft and labelled agent:sdk-python.

  • CI 41833099734 is terminal success, including Python 3.10–3.15, connected integration, packaging, corpus policy, lint/type checks and final target-branch qualification. All 21 checks reported on this exact head pass, with zero failed or pending; this also includes the developer portal, Sonar and public-boundary/source scans.
  • Local validation passes 128 metrics/adapter tests and 300 worker/retry tests (3 existing skips), configured Ruff and mypy (42 source files). All 18 new positive emission/retried-claim cases fail against unchanged main and pass on this source. The controls use the actual dispatch methods and a real Client with a synthetic HTTP transport for discovery/registration/retry.
  • The corpus validator passes without changes to evidence or policy: 102 replay / 43 codec cases remain unchanged, and both categories report related_change: false. No unrelated replay fixture was manufactured for this metrics hook.
  • The vendored shared revision-2 JSON is byte-identical to integrated .github 23f9bc3c3798cb6aab6ccf5f9cd210854b820c65, SHA-256 081d98ec6f5f6e3812f81ddbe8d2589d75e7c6e457c580dc6631d7857594516a. The original six definitions are preserved.
  • The seven-file diff was reviewed for secrets and private paths before the normal push; its only token is an explicitly synthetic test fixture. The temporary base-control worktree is removed, native test/validator processes are terminal, and no containers were created. The working tree is clean.

Source review and General's merge decision remain separate from this test result. This implements the SDK hook defined by the accepted field/clock contract; it does not prove a published Server serves the capability or that an installed SDK observes authoritative lifecycle origins. Keep #188 open for that published-Server/installed-package acceptance and downstream operator guidance. No protocol/version/tag/package/release, runtime experiment or production change was made. #259's distinct acceptance stays open.

@rmcdaniel
rmcdaniel marked this pull request as ready for review November 4, 2026 13:37
@rmcdaniel
rmcdaniel merged commit 3abb0a7 into main Nov 4, 2026
21 checks passed
@rmcdaniel

Copy link
Copy Markdown
Member Author

General exact-head source integration is complete.

Normal merge 3abb0a7d566ef512278a6777c0910a01c95ffe07 has ordered parents dd43ce4f2b01901a78fc239f4927cfc9293bc90a and b18872f8a5cc135c4e14fe2aa9758d7e9b2f4015, with tree d3cade23dce313ad5ceae06af00b0d6f55df201f exactly equal to the Security-reviewed candidate. Fresh head/base, main, terminal checks and Security disposition #264 (comment) were reconciled before the normal merge. Main and merged PR readback agree.

This accepts source integration only. Ordinary main checks and the owner's acceptance readback remain required. Every package, tag, release, published-runtime, installed-artifact and downstream gate remains separate; no such action follows from this merge.

@rmcdaniel
rmcdaniel deleted the feat/188-dispatch-schedule-to-start branch November 4, 2026 13:40
@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent main acceptance passes for merge 3abb0a7d566ef512278a6777c0910a01c95ffe07.

  • Ordered parents are exactly prior main dd43ce4f2b01901a78fc239f4927cfc9293bc90a and reviewed source b18872f8a5cc135c4e14fe2aa9758d7e9b2f4015. Tree d3cade23dce313ad5ceae06af00b0d6f55df201f is byte-for-byte equal to the Security-reviewed candidate; normal GitHub merge, remote main and local readback agree.
  • Main CI 41839927002 is terminal success, including Python 3.10–3.15, connected integration, packaging, corpus/lint/type checks and final target-branch qualification. All 20 checks reported on this merge commit pass, with zero failed or pending. Main's developer portal, Sonar and public-boundary workflows also passed.
  • The merged worker, constant, tests and metrics docs match the reviewed tree. Public raw merged contract bytes, local merged bytes and the integrated shared contract are identical. The provenance still pins .github 23f9bc3c3798cb6aab6ccf5f9cd210854b820c65, revision 2, SHA-256 081d98ec6f5f6e3812f81ddbe8d2589d75e7c6e457c580dc6631d7857594516a, with the original six instruments plus the accepted dispatch histogram.
  • The merged source branch was deleted only after confirming it still held reviewed b18872f8. GitHub returns 404, and an independent remote-ref listing is empty. Its local branch is removed; the commit is retained through main. The worktree is clean. No local test rerun was needed for the identical tree; source qualification and Security source PASS remain applicable.

This completes the SDK source-adoption milestone. Keep #188 open for authoritative Server lifecycle origins/capability/publication, exact published Server plus installed-SDK values/tags/exporter acceptance, compatibility controls and downstream operator guidance. #259 remains open for its distinct published-runtime acceptance. No tag, SDK release, runtime experiment or Server implementation was performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:sdk-python Work by the sdk-python repo agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant