Skip to content

RA-related updates#2491

Draft
onmyraedar wants to merge 4 commits into
mainfrom
remote_job_results_description
Draft

RA-related updates#2491
onmyraedar wants to merge 4 commits into
mainfrom
remote_job_results_description

Conversation

@onmyraedar

Copy link
Copy Markdown
Collaborator

No description provided.

@onmyraedar

Copy link
Copy Markdown
Collaborator Author

@greptileai

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds object-sharing and metadata-only update APIs to the Coop client and exposes them as class methods on PersistenceMixin. It also plumbs a results_description parameter through the remote-inference pipeline so callers can label the initial results object at job-creation time.

  • coop.py: fixes DELETE requests to carry a JSON body, introduces _resolve_to_uuid (resolves alias-style URLs to a UUID before calling the sharing endpoints), and adds patch_metadata, get_object_shared_users, share_object, unshare_object, and list_human_surveys.
  • base_class.py: surfaces get_metadata, patch_metadata, get_shared_users, share, and unshare as class methods on PersistenceMixin, each guarded with a Jobs-subclass check.
  • data_structures.py / jobs.py / remote_inference.py: adds the optional results_description field and threads it through to coop.remote_inference_create on the new-format path.

Confidence Score: 4/5

Mostly safe — the core Coop changes are well-structured, but the integration test for sharing hard-codes an email address that may not be registered in the test environment, which would cause the test to fail on every CI run.

The sharing test asserts that a shared email appears in shared_with, but the server moves unrecognised emails into temp_shared_with instead. If b@b.b is not a pre-seeded registered account in the test environment, the assertion fails deterministically. All production code changes look correct.

tests/coop/test_coop_objects.py — the sharing assertions assume b@b.b is a registered account; verify this holds in CI.

Important Files Changed

Filename Overview
edsl/coop/coop.py Splits GET/DELETE HTTP dispatch, adds _resolve_to_uuid helper (fixes alias-URL breakage in sharing methods), and adds list_human_surveys, patch_metadata, get_object_shared_users, share_object, unshare_object. Logic looks correct.
edsl/base/base_class.py Adds get_metadata, patch_metadata, get_shared_users, share, and unshare class-methods to PersistenceMixin, all delegating to Coop with a Jobs guard. Straightforward proxies with no logic issues.
edsl/jobs/data_structures.py Adds optional results_description field to RunParameters with correct docstring annotation. Minimal, safe change.
edsl/jobs/jobs.py Threads results_description through _create_job_info_for_offloaded_execution; docstring updated. Correct plumbing, no issues.
edsl/jobs/remote_inference.py Adds results_description parameter and passes it as initial_results_description to coop.remote_inference_create only on the new-format path. Old-format path silently ignores it, which is documented.
tests/coop/test_coop_objects.py Adds integration tests for metadata and sharing workflows; sharing assertion may fail if b@b.b is not a registered user in the test environment, as that email would land in temp_shared_with instead of shared_with.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant PersistenceMixin
    participant Coop
    participant Server

    Caller->>PersistenceMixin: Survey.share(url_or_uuid, username)
    PersistenceMixin->>Coop: share_object(url_or_uuid, username)
    Coop->>Coop: _resolve_to_uuid(url_or_uuid)
    alt plain UUID or content/uuid URL
        Coop-->>Coop: return uuid directly
    else alias URL (content/owner/alias)
        Coop->>Server: GET api/v0/object/alias/info
        Server-->>Coop: "{uuid}"
    end
    Coop->>Server: POST api/v0/object/share
    Server-->>Coop: "{message, username, email}"
    Coop-->>Caller: dict

    Caller->>PersistenceMixin: Survey.patch_metadata(url_or_uuid, visibility)
    PersistenceMixin->>Coop: patch_metadata(url_or_uuid, visibility)
    Coop->>Coop: _resolve_uuid_or_alias(url_or_uuid)
    alt UUID path
        Coop->>Server: "PATCH api/v0/object?uuid=..."
    else alias path
        Coop->>Server: "PATCH api/v0/object/alias?owner_username=...&alias=..."
    end
    Server-->>Coop: updated metadata
    Coop-->>Caller: dict
Loading

Reviews (2): Last reviewed commit: "Fix for aliases when sharing" | Re-trigger Greptile

Comment thread edsl/coop/coop.py Outdated
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.

1 participant