Skip to content

Record the execution context declared by the computation library - #4

Merged
PierreRaybaut merged 1 commit into
developfrom
feat/library-execution-context
Oct 25, 2026
Merged

PierreRaybaut merged 1 commit into
developfrom
feat/library-execution-context

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Closes #3

Summary

The recorder now keeps, in the execution context of an activity, the entries of the optional context mapping returned by the computation library's describe_call (rules the computation depends on, as plain data). A replay already passes the whole recorded context back to prepare_execution, so the library can refuse an activity recorded without a rule it requires, or with an unknown one (unsupported_context).

  • recorder._build_call: declared entries first (deep copy), then the options and metadata digests computed by the recorder.
  • No effect with current Sigima releases (no context in their descriptions); no ledger schema change (context is a free object).
  • Docs: doc/rules.md (execution context), doc/api.md (recorder), CHANGELOG.md.

Prerequisite of the Sigima change recording the image ROI pixel convention (Sigima 1.4 selects ROI pixels by their centers): activities recorded with Sigima 1.3 will be refused explicitly instead of being reported as different.

Tests

New test_context_declared_by_the_library (fails on develop): the declared rule is recorded, passed back to prepare_execution for a replay, the verification is exact, and a description without context records nothing more. Full suite: 370 passed.

The recorder kept only the global options and the metadata read from the
description of a call given by the computation library (describe_call).
Other rules a computation depends on could not be recorded, so that a
replay could not check them.

The entries of the optional "context" mapping of the description are now
recorded, as plain data, in the execution context of the activity, before
the options and metadata digests computed by the recorder. A replay already
passes the whole recorded context back to the library (prepare_execution),
which checks it. Descriptions without such a mapping (current Sigima
releases) record nothing more; the ledger schema is unchanged.

Sigima uses it to record the convention selecting image pixels in regions
of interest, so that activities recorded with an earlier convention are
refused explicitly (unsupported_context) instead of being reported as
different.

Closes #3

Assisted-by: Claude Opus 5.5
@PierreRaybaut
PierreRaybaut merged commit 3fd6fbf into develop Oct 25, 2026
5 checks passed
@PierreRaybaut
PierreRaybaut deleted the feat/library-execution-context branch October 25, 2026 06:51
PierreRaybaut added a commit to DataLab-Platform/web that referenced this pull request Oct 25, 2026
The Sigima snapshot declares the ROI pixel convention in the execution
context of image computations: pin DataLab-Capsule to the development
commit recording it (DataLab-Platform/DataLab-Capsule#4), since 0.1.0
does not and refuses such replays. The e2e families test now expects
activities recorded with an older contract version to be refused.

Refs #68

Assisted-by: Claude Opus 5.5
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