Skip to content

Release 4.2.0 - #314

Merged
admin-sbneto merged 22 commits into
masterfrom
develop
Jul 23, 2026
Merged

Release 4.2.0#314
admin-sbneto merged 22 commits into
masterfrom
develop

Conversation

@admin-sbneto

@admin-sbneto admin-sbneto commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
  • exists() now returns True only for an HTTP 200 (present) and False for 204/404 (absent), fixing a 4.0 regression where any 2xx — including the server's 204 "no match" — was reported as existing.
  • Streaming file downloads now raise NoResultsException on a 204 ("no matching artifact") instead of silently writing an empty file.
  • llm_report_download() now reads the report's url field, fixing an AttributeError from the previously-referenced non-existent download_url.
  • create_llm_report() now sends the client's community when creating the report.
  • Updated the known-good feed source names to match the server's renamed feeds (docstrings, tests, and recorded cassettes).
  • Fixed a flaky test_sample e2e race by waiting on the sandbox and LLM-report postconditions directly rather than using the report status as a proxy.
  • Parametrized the GitLab CI template include via a $CI_TEMPLATE variable instead of a hardcoded project path.
  • Bumped the package version to 4.2.0.

mjbradford89 and others added 22 commits May 26, 2026 08:15
fix - send community when creating report
ci: parametrize CI template include via $CI_TEMPLATE
… race

test_sample (sync + async) polled the aggregated sample until the LLM
report left its pre-trigger states, then asserted the sandbox tasks read
COMPLETED. The report auto-triggers on any one completed dependency, and
the sample's per-task requested_status fields don't update atomically, so
the report could read triggered in the same response where sandbox_cape
still projected NOT_TRIGGERED — an intermittent AssertionError against a
live stack.

Poll on the exact postconditions asserted instead: break once both sandbox
deps read COMPLETED and the report is triggered. The test already drives
both sandboxes to SUCCEEDED, so this only closes the projection-lag window;
the committed cassettes replay unchanged.
…-race

test: fix intermittent test_sample e2e race (poll on sandbox+report postconditions)
…nloads

The 4.0 client widened two status-code checks and, in doing so, broke the
handling of HTTP 204 — a successful response meaning "the request worked,
but there was no matching data, so nothing was returned".

- exists() checked `int(result) // 100 == 2` (any 2xx is "present"), so a
  HEAD /search/hash returning 204 for an absent artifact was reported as
  existing. The endpoint returns 200 when the artifact is present and 204
  when it is absent, so only a 200 means it exists. Restore the pre-4.0
  `== 200` check (matches the reference client's `str(result) == '200'`);
  204 and 404 both map to False.

- The streaming download path (_execute_download) only branched on non-2xx,
  so a 204 fell through, opened the destination, streamed the empty body and
  returned a successful *empty* artifact. Pre-4.0, a 204 on a parser-backed
  request raised NoResultsException via the shared parse path. Restore that:
  a 204 download now raises NoResultsException instead of silently writing an
  empty file.

Both fixes edit the canonical async sources (aio/api.py, aio/session.py); the
sync mirrors (api.py, session.py) are regenerated via scripts/regenerate_sync.py.

Adds regression tests — exists() 200->True / 204->False / 404->False, a
HEAD-204 parse-layer guard, and a 204 download raising NoResultsException —
and pins the 200-only present / 204-absent contract in the specs.
fix: restore pre-4.0 204 ("no results") handling for exists() and downloads
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review — PR #314 (Release 4.2.0)

Reviewed against AGENTS.md and specs/ (01/02/03/99). This is the develop → master release PR — an aggregate of already-merged work (#302, #310, #311, #312, #313) plus the version bump.

Verdict: clean. No action items.

Spot-checks that passed:

  • Gitflow / version bump — base is master, head is develop; the 4.1.0 → 4.2.0 bump lives in this step, exactly as AGENTS.md prescribes ("version bumps belong to the develop → master step"). pyproject.toml, [tool.bumpversion], and __init__.__version__ are all in sync.
  • 204 download fix (_execute_download, both transports) — the == 204 branch sits after the // 100 != 2 non-2xx check (204 is 2xx, so it falls through correctly) and before open_destination, so no empty file is created before the raise. NoResultsException(request, msg) matches the shared parse_response signature. Sync mirror is logic-identical.
  • exists()== 200 — HEAD short-circuits in parse_response (result = raw status), so 200→True, 204→False, 404→False. Matches the reference client and the updated spec 03 contract. Regression tests cover all three codes plus the parse-layer HEAD-204 guard.
  • llm_report_create sends community_params('POST', …) routes community into the JSON body (correct for this endpoint); None-omission preserved.
  • Specs — 01/02/03/99 updated in-band with the code (204 rule, exists contract, kgb feed rename nsrl/microsoft/commercial). Tests updated to match the feed rename and use order-insensitive sorted() assertions.

Minor (non-blocking, formatter-level): a trailing blank line was added at the end of test/client_scan_test.py.

@admin-sbneto
admin-sbneto merged commit adfd163 into master Jul 23, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants