Skip to content

feat(accounting): export tool execution reports - #503

Merged
uniqueg merged 5 commits into
devfrom
feat/502-execution-reports
Nov 18, 2026
Merged

uniqueg merged 5 commits into
devfrom
feat/502-execution-reports

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Admins can export the usage records (#490) as execution reports of the ELIXIR Compute Tool Execution Report format, version 0.0.2 (GET /ga4gh/tes/v1/usage/reports?since=…&until=…, new rule admins-get-usage-reports). The response is a JSON array with one report per attempt of a task at its TES instance (task log).

  • Records (pro_tes/accounting/record.py, tool.py) now also hold the tool (from the image of the first executor: name, repository, tag as version, BioContainers <version>--<build> split into version and package version; identifiers from the tags biotools_id and rrid plus docker://<repository>), per attempt the start, end and total output size, and the proTES version. Commands, env, inputs/outputs, URLs, paths and other tags are not stored.
  • Reports (pro_tes/accounting/reports.py): tool_*, infra (configured providers, the TES instance, proTES), location (configured), cpu_cores_assigned (requested, an allocation), start_time/end_time, and final_outputs_size (total, rounded to two significant digits). Fields TES can't fill are left out and documented (affiliation, input_size, cpu_identifier, cpu_mods, memory_used, cpu_cores_used, gpu_cores_used, duration).
  • Privacy: no user identifiers, task IDs or names, commands, arguments, env vars, URLs or file names. Image names and tags can name users in personal namespaces, so only images in trusted namespaces are reported (custom.accounting.reports.images, default: Docker Hub official images and BioContainers on Docker Hub and Quay; compared in canonical form; a bare registry is rejected). Only COMPLETE tasks are reported, so that the image existed and no made-up names or tags (e.g. ubuntu:<user name>) get through. Sizes are totals per attempt, rounded.
  • Config custom.accounting.reports: infra, location, backends (by normalized URL), images, and max_records (default 10000; more records in a range give 400).
  • Schema vendored unchanged in tests/accounting/data/ from compute_wp5@76b2a13 with a REUSE .license sidecar (MIT) and LICENSES/MIT.txt. The tests validate every report against it, with iri and date-time format checks.
  • Docs: docs/api.md (Execution reports: field mapping, unfilled fields, privacy), docs/configuration.md (Execution reports settings), docs/operations.md (how to export and hand reports over), docs/access-control.md, docs/upgrading.md (0.7.0).

Decisions made here:

  • tool_identifier is required by the schema. The issue said to leave it out when the task carries none, so instead the image repository (docker://…) is always added.
  • No memory field: the format only has memory_used, a measured peak, and the requested RAM is an allocation, so it's left out rather than adding a non-standard field.
  • Multi-executor tasks are credited to the first executor's image.
  • Only COMPLETE tasks are reported (privacy over completeness); failed attempts within a completed task still get their own reports.

Closes #502

Verification

Local, in the clone (Python 3.13, uv sync --locked --extra dev --extra docs):

  • coverage run -m pytest --deselect tests/test_chart.py --deselect tests/test_config_examples.py::test_chart_examples_valid: 1895 passed, 11 skipped. The changed modules (pro_tes/accounting/*) are 100% covered; the tests validate every report against the vendored schema.
  • Not run locally: tests/test_chart.py and the two chart example tests in tests/test_config_examples.py, because the Helm library chart isn't built locally (helm dependency build deployment). The chart is unchanged; CI runs them.
  • pre-commit run --all-files: all hooks passed (ruff, ruff-format, mypy, semgrep and its rule tests, ast-grep and its rule tests, yaml/whitespace checks). gitleaks and actionlint were skipped locally (their Go toolchain download failed in the sandbox); CI runs both.
  • mkdocs build --strict: passed.

After the Sourcery fixes (9364f5e): pytest tests/accounting 182 passed, the changed modules 100% covered, pre-commit and mkdocs build --strict passed.

CI: all checks passed again on 9364f5e (incl. Test on MongoDB 7.0, Codecov patch/project, Sourcery review); earlier also on 457a95f (CI passed; Test on mongomock and on MongoDB 7.0, Chart, Docs, Lint incl. gitleaks and actionlint, Smoke test, Integration, Scan image, CodeQL, Codecov patch/project, Read the Docs).

Declined review findings

  • Split tests/accounting/test_reports.py into config/endpoint files (quality, low): the module tests, config and endpoint of one feature stay together; tests/accounting/test_usage_endpoint.py does the same for /usage.

  • Use an independent IRI checker such as rfc3987 in the tests (quality, low): it's not a dependency; the test checker is an explicit approximation of RFC 3987, and the schema's other constraints are checked by jsonschema.

  • Cache version("pro-tes") at import (quality, low): gateway.py calls it the same way, and the adversarial review confirmed it adds no new failure mode.

  • Split the review-fix commit into four (quality round 2, low): the commit body lists the parts; the PR is squash-merged.

  • Hoist the default image namespaces into a constant / test config.yaml against the model (quality round 2): test_config_of_app already compares the base config's custom.accounting.reports with ExecutionReports(), images included.

  • Drop non-version-like tags (adversarial round 2, optional): with trusted namespaces and COMPLETE only, tags are those of published images.

  • Sourcery: verify biotools_id against bio.tools: no network calls from the export; the tag is a dedicated tool ID tag, and its handling is documented.

  • Sourcery: merge records when a redelivered BASIC-view poll replaces a FULL-view record: the replacement logic is unchanged from feat: account resource usage per user #490, and only the optional output sizes can be lost, in a rare worker-loss case.

  • Sourcery: omit tool_identifier / add requested memory as the issue says: the schema requires tool_identifier (minItems: 1) and has no field for allocated memory (see Decisions).

  • Sourcery: apply the trusted namespaces before max_records: the limit bounds the records one request reads; documented.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 4 commits November 18, 2026 05:04
Usage records now also hold what execution reports need: the tool of
the task (name, version and identifiers from the image of its first
executor and its tags `biotools_id` and `rrid`), the start, end and
total output size of each attempt (task log), and the proTES version.
No commands, environment variables, URLs, paths or other tags are
stored.

Refs #502

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Admins get the usage records of a time range as execution reports of
the Tool Execution Report format of ELIXIR Compute, version 0.0.2
(`GET /usage/reports`, rule `admins-get-usage-reports`): one report per
attempt of a task, with the tool, the providers (configured ones, the
TES instance and proTES), the configured location, the requested CPU
cores, the times and the rounded total output size. Reports hold no
user identifiers or other details of tasks.

`custom.accounting.reports` names the providers and locations, and
limits the records per request (`max_records`). The tests validate the
reports against the vendored schema (MIT, REUSE sidecar file).

Closes #502

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Image names and tags in personal namespaces (e.g., ghcr.io/<user>) may
name users, so only tasks of images in trusted namespaces are reported
(`custom.accounting.reports.images`; by default Docker Hub's official
images and BioContainers). Output sizes beyond 64-bit integers no
longer drop the whole usage record. The time range filter is shared
with the usage totals, and the docs link the vendored schema commit.

Refs #502

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Report only tasks that completed, whose images exist, so that names and
tags of images that don't exist (e.g., ubuntu:<user name>) are never
reported. Image repositories and trusted namespaces are compared in
canonical form (registry included, Docker Hub aliases and `library`),
so that Docker Hub paths can't pass as other registries and namespaces
given with `docker.io/` match; a registry alone is rejected.

Refs #502

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Schema and migrations

Extend usage records with tool metadata, attempt timing and output totals, and the recording proTES version needed to build reports.

  • pro_tes/accounting/record.py L69-107, L123-164, L182-193 (+5 small edits)

Data structures

Define the report configuration and its validated provider, location, backend, URL and trusted-image namespace structures.

  • pro_tes/accounting/config.py L3-243, L255-260, L266

Specify the stored tool representation and extract image and task-tag identifiers without retaining other task details.

  • pro_tes/accounting/tool.py L1-115

API

Expose the admin-only usage-reports endpoint and define its query parameters, responses and report shape in the OpenAPI additions.

  • pro_tes/api/additions.openapi.yaml L143-199, L261-322

Uses of the API

Connect the reports endpoint to accounting, time parsing and the configured report settings, translating record-limit errors into an API error.

  • pro_tes/ga4gh/tes/server.py L20-22, L155-187

Share finished-time range filtering between usage totals and report queries.

  • pro_tes/accounting/report.py L31-51, L75, L78 (removed lines)

Export eligible usage records as one report per attempt, applying trusted-image and completion filters, configured infrastructure details, formatting and record limits.

  • pro_tes/accounting/reports.py L1-263

Implementation

Publish the new accounting configuration and report-export functions and update the module contract to describe the record and controller responsibilities.

  • pro_tes/accounting/__init__.py L21-53

Configuration

Add the admin policy for report exports and provide default report settings in the base configuration.

  • pro_tes/config.yaml L93-94, L417-427

Map oversized report requests to a Bad Request problem response.

  • pro_tes/exceptions.py L165-171, L242-249

Documentation

Document the execution-report endpoint, report fields and privacy constraints for API users.

  • docs/api.md L210-295

Describe report configuration, provider and location settings, image trust boundaries and request limits.

  • docs/configuration.md L810-815, L821-903

Explain how operators export time-bounded reports, handle record limits and preserve reports before deleting usage records.

  • docs/operations.md L210-239

Update role permissions and rule-name documentation for administrator report access.

  • docs/access-control.md L46, L61-62

Describe the accounting upgrade, new report endpoint and required access-control rule for deployments.

  • docs/upgrading.md L43-60

Tests

Check stored tool and attempt data, including time fallbacks, output-size validation and task projection.

  • tests/accounting/test_record.py L4-5, L80-223, L348-381

Validate report generation, privacy filtering, configuration, ordering, limits and endpoint access against the vendored format schema.

  • tests/accounting/test_reports.py L1-681

Check image-reference parsing and the inclusion of only valid tool identifiers from task tags.

  • tests/accounting/test_tool.py L1-146

Lock files and vendored code

Vendor the Tool Execution Report schema and its MIT licensing metadata for report validation.

  • LICENSES/MIT.txt L1-21
  • tests/accounting/data/execution_report.schema.json L1-172
  • tests/accounting/data/execution_report.schema.json.license L1-8

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

read-the-docs-community Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35975495 | 📁 Comparing 9364f5e against latest (536af5e)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (536af5e) to head (9364f5e).

Additional details and impacted files
@@            Coverage Diff             @@
##               dev      #503    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           35        37     +2     
  Lines         3239      3475   +236     
==========================================
+ Hits          3239      3475   +236     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 18, 2026 05:23
@sourcery-ai

sourcery-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 9364f5e

#502 feat: export tool execution reports · 4 of 6 met

# Requirement Status Notes
1 Map tool name, version, and tool_identifier from the task 🟡 Partly met Tool name/version and tag identifiers are recorded, but an image-repository identifier is always added even when the task has no bio.tools or RRID tag.
2 Map attempt times, requested CPU and memory, aggregate output sizes, and infrastructure/location 🟡 Partly met Attempt times, requested CPU cores, aggregate output sizes, and infrastructure/location are mapped; requested memory is omitted.
3 Keep personal identifiers and task details out of reports ✅ Met Reports contain no user or task identifiers, commands, arguments, environment variables, input/output URLs, or file names.
4 Provide an admin-only time-range JSON export validated against schema version 0.0.2 ✅ Met The admin-only endpoint filters by since/until, and tests validate reports against the vendored schema.
5 Pin the schema version and document the supported version ✅ Met The report format version is fixed at 0.0.2 and documented.
6 Document the export, handover, configuration, and fields that cannot be filled from TES ✅ Met The API, operations, and configuration docs cover these topics.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 11 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="pro_tes/accounting/tool.py" line_range="33" />
<code_context>
+MAX_REPOSITORY_LENGTH = 255
+# Identifiers of tools in tags of tasks: patterns of the values, and the
+# IRIs they give
+BIOTOOLS_ID = re.compile(r"[A-Za-z0-9_~-][A-Za-z0-9._~-]{0,99}", re.ASCII)
+RRID = re.compile(r"(?:RRID:)?(?P<id>SCR_[0-9]{1,12})", re.ASCII)
+BIOTOOLS_IRI = "https://bio.tools/{}"
</code_context>
<issue_to_address>
**Personal identifiers appear in reports**

When a task supplies a syntactically valid `biotools_id` containing a person’s name or other personal information, `_tag_identifiers` accepts the arbitrary tag value and `task_tool` publishes it as a bio.tools URL, so personal information appears in exported reports.

Only publish a bio.tools identifier after verifying that the value identifies a real tool.

Also at `pro_tes/accounting/reports.py:177`, `pro_tes/accounting/tool.py:85-86`.
</issue_to_address>

### Comment 2
<location path="pro_tes/accounting/record.py" line_range="191" />
<code_context>
         record[name] = amount
         record[field] = product
+    # for execution reports (cf. :py:mod:`pro_tes.accounting.reports`)
+    record["tool"] = task_tool(task)
+    record["attempts"] = [_attempt(log) for log in logs]
+    record["protes_version"] = version("pro-tes")
</code_context>
<issue_to_address>
**Retries discard fuller usage records**

When a full usage record has been written and a redelivered response contains fewer logs or output details, including when its logs lack a complete time span, `record_usage` treats an incomplete retry as authoritative or preserves only records marked `timed`, replacing the fuller record; reports then omit attempts or output sizes.

Retain or merge the fuller existing usage record instead of replacing it with an incomplete retry.

Also at `pro_tes/accounting/record.py:192`.
</issue_to_address>

### Comment 3
<location path="pro_tes/accounting/record.py" line_range="121" />
<code_context>
+        Its start and end (`None` if either is unknown, cf. :py:func:`_span`)
+        and the total size of its outputs (`outputs_bytes`), if logged.
+    """
+    start, end = _span(log) or (None, None)
+    return {"start_time": start, "end_time": end, "outputs_bytes": _outputs_bytes(log)}
+
</code_context>
<issue_to_address>
**Known attempt times disappear**

When a task or executor log provides only a start time or only an end time, `_span` returns `None` when either endpoint is missing, so `_attempt` stores both endpoints as `None` and reports omit the known timestamp.

Read and store each endpoint independently so a missing start or end does not erase the other.
</issue_to_address>

### Comment 4
<location path="pro_tes/accounting/record.py" line_range="106-109" />
<code_context>
+                return None
+            size = int(size)
+        if isinstance(size, int) and not isinstance(size, bool) and size >= 0:
+            sizes.append(size)
+    total = sum(sizes)
+    return total if sizes and total <= MAX_SIZE else None
+
+
+def _attempt(log: Any) -> dict[str, Any]:
</code_context>
<issue_to_address>
**Output totals undercount attempts**

When an attempt has at least one output with a valid size and another with a missing or invalid size, `_outputs_bytes` sums valid sizes while silently skipping outputs with missing or invalid sizes, so reports present a partial sum as `final_outputs_size`. Consumers see an incorrect total for the attempt.

Leave the total unknown if any output size is unknown or invalid, unless the report contract explicitly defines totals as sums of only known sizes.
</issue_to_address>

### Comment 5
<location path="pro_tes/accounting/reports.py" line_range="239-253" />
<code_context>
+        TooManyRecords: More than `config.max_records` records are in the
+            time range.
+    """
+    match: dict[str, Any] = {
+        "tool": {"$type": "object"},
+        "attempts.0": {"$exists": True},
+        # tasks that completed ran their image, which therefore exists (in
+        # the trusted namespace): names and tags of images that don't exist
+        # (e.g., `ubuntu:<name of a user>`) are not reported
+        "state": COMPLETE,
+        **finished_range(since, until),
+    }
+    records = list(
+        usage.find(
+            match,
+            projection={"_id": False, **dict.fromkeys(FIELDS, True)},
+            sort=[("finished_at", 1), ("_id", 1)],
+            limit=config.max_records + 1,
+        )
+    )
</code_context>
<issue_to_address>
**Untrusted tasks trigger export limit**

When more than `max_records` completed records have a tool and attempts, but at most `max_records` have trusted images, `execution_reports` counts these records before `_reports` applies `trusted_image`, so it raises `TooManyRecords` and admins get `400` even though the reportable tasks fit in one request.

Apply the trusted-image eligibility check before enforcing the report-count limit, or explicitly define and document the limit as applying to candidate records before image filtering.
</issue_to_address>

### Comment 6
<location path="pro_tes/accounting/reports.py" line_range="252" />
<code_context>
+        usage.find(
+            match,
+            projection={"_id": False, **dict.fromkeys(FIELDS, True)},
+            sort=[("finished_at", 1), ("_id", 1)],
+            limit=config.max_records + 1,
+        )
</code_context>
<issue_to_address>
**Exports require blocking sorts**

When the usage collection grows large and an export covers a broad time range, mongoDB has an index on `finished_at` but not the requested `(finished_at, _id)` sort; for large time ranges it scans matching records and performs a blocking sort before applying the limit, making even requests that return at most `max_records` expensive.

Add a compound index on `finished_at` and `_id` for the report query, and verify MongoDB uses it for the filter and sort.
</issue_to_address>

### Comment 7
<location path="pro_tes/accounting/tool.py" line_range="68" />
<code_context>
+        "repository": match["repository"],
+        "version": version,
+        "package_version": package_version,
+        "identifiers": [f"docker://{match['repository']}"],
+    }
+
</code_context>
<issue_to_address>
**Always adding image identifier**

The issue asks to omit tool_identifier when the task carries no identifier. The change always adds the image repository identifier, even when neither task tag supplies one.
</issue_to_address>

### Comment 8
<location path="pro_tes/accounting/reports.py" line_range="194-195" />
<code_context>
+    if location:
+        common["location"] = location
+    cores = _cores(record.get("cpu_cores"))
+    if cores is not None:
+        common["cpu_cores_assigned"] = cores
+    reports = []
+    for attempt in record["attempts"]:
</code_context>
<issue_to_address>
**Requested memory omitted**

The issue asks for requested memory as well as CPU cores, and says these are allocations rather than measurements. The report includes requested CPU cores but omits requested memory.
</issue_to_address>

### Comment 9
<location path="tests/accounting/test_record.py" line_range="129-147" />
<code_context>
+        ],
+        document=document,
+    )
+    assert usage["tool"] == {
+        "name": "bwa",
+        "repository": "quay.io/biocontainers/bwa",
+        "version": "0.7.18",
+        "package_version": "0.7.18--he4a0461_1",
+        "identifiers": [
+            "https://bio.tools/bwa",
+            "docker://quay.io/biocontainers/bwa",
+        ],
+    }
+    assert usage["attempts"] == [
+        {"start_time": None, "end_time": None, "outputs_bytes": None},
+        {
+            "start_time": START + timedelta(hours=1),
+            "end_time": START + timedelta(hours=2),
+            "outputs_bytes": 123,
+        },
+    ]
+
+
[email protected](
</code_context>
<issue_to_address>
**Sensitive fields can persist unnoticed**

When the record-writing code starts persisting task details that are present in the test document, `test_record_for_reports` checks only the tool and attempts at lines 129 and 139, so it still passes if commands, environment variables, inputs, or other task details are copied into the stored record. The report-privacy test checks exported reports, not the stored record.

Assert that the returned record omits the command, env, input/output URLs and paths, and unrelated tags.
</issue_to_address>

### Comment 10
<location path="tests/accounting/test_reports.py" line_range="400-404" />
<code_context>
+    for day in (2, 0, 1):
+        add(usage, task_id=f"T{day}", day=day)
+    reports = execution_reports(usage, ExecutionReports())
+    assert [report["start_time"][:10] for report in reports] == [
+        "2026-11-01",
+        "2026-11-02",
+        "2026-11-03",
+    ]
+    reports = execution_reports(
+        usage,
</code_context>
<issue_to_address>
**Incorrect report ordering passes**

When tasks have different runtimes and finish in an order different from their start order, `test_reports_in_time_range` checks only the reports' start-date order at line 400. Its helper gives every task a one-hour attempt, so sorting by start time instead of finish time still passes even when tasks with different runtimes would finish in a different order.

Give the test tasks different attempt durations and assert that their reports follow finish order.
</issue_to_address>

### Comment 11
<location path="tests/accounting/test_reports.py" line_range="416-420" />
<code_context>
+
+def test_too_many_records(usage: Collection[dict[str, Any]]) -> None:
+    """Requests for more records than `max_records` are rejected."""
+    for day in range(3):
+        add(usage, task_id=f"T{day}", day=day)
+    config = ExecutionReports(max_records=2)
+    with pytest.raises(TooManyRecords):
+        execution_reports(usage, config)
+    assert len(execution_reports(usage, config, since=START + timedelta(days=1))) == 2
+
</code_context>
<issue_to_address>
**Attempt count can trigger record limit**

When a task within the record limit has multiple attempts, `test_too_many_records` (lines 416–420) and `test_get_reports_too_many` (lines 621–629) use default one-attempt tasks, so a limit mistakenly applied to flattened reports still passes both tests. It would reject one task with two attempts at `max_records=1`, although the request covers only one record.

Add a max-records case with one task and multiple attempts that must succeed when `max_records` is one.

Also at `tests/accounting/test_reports.py:621-629`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 11 findings to address first, and the new admin-only endpoint exposes tool identifiers, image names and tags, attempt times, and output sizes; an overly broad access rule or faulty report filtering could disclose operational data. Reverting removes the endpoint and stops future capture, but data already exposed cannot be taken back.

Blocking findings: pro_tes/accounting/tool.py:33, pro_tes/accounting/record.py:191, pro_tes/accounting/record.py:121, pro_tes/accounting/record.py:109, pro_tes/accounting/reports.py:253, and 6 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread pro_tes/accounting/tool.py Resolved
Comment thread pro_tes/accounting/record.py Resolved
Comment thread pro_tes/accounting/record.py Resolved
Comment thread pro_tes/accounting/record.py Resolved
Comment thread pro_tes/accounting/reports.py Resolved
Comment thread pro_tes/accounting/tool.py Resolved
Comment thread pro_tes/accounting/reports.py Resolved
Comment thread tests/accounting/test_record.py Resolved
Comment thread tests/accounting/test_reports.py Resolved
Comment thread tests/accounting/test_reports.py Resolved
Keep a known start or end of an attempt without the other, leave the
output total unknown when any output size is missing or invalid, sort
reports by the indexed `finished_at` only (no blocking sort), and say
what `max_records` counts. Tests now check that records hold no task
details, that reports follow the finish order, and that the limit
counts tasks, not attempts.

Refs #502

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New gaps against the linked issues

Comment thread pro_tes/accounting/reports.py Resolved
@uniqueg
uniqueg merged commit fa54993 into dev Nov 18, 2026
53 checks passed
@uniqueg
uniqueg deleted the feat/502-execution-reports branch November 18, 2026 06:03
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.

feat: export tool execution reports

1 participant