[Feature]: Core contract (protocols, data types, typed errors)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- backend-api-design, documentation, testing
Research direction
Start with IC-ADR-001 §§1–2, 4, and 7, then inspect the src/intercede/ package requirements. Run the strict mypy checks and the unit conformance suite around FakeBackend to identify the contract surface. Done means the Tier-A exports, typed protocols and data, exceptions, lifecycle rules, API docs stub, and conformance behavior all meet the listed Definition of Done.
Written by the indexing model from the issue text.
Description
User Story
As an interCEde contributor (and as DiracX, the first consumer),
I want the contract implemented as typed, async, capability-segmented Protocols with their
data types and exception hierarchy,
So that backends, fakes and consumers can all be written against one enforced contract instead of
DIRAC's abstract-by-convention base class.
Feature Description
Implement IC-ADR-001 §1–§2, §4 (types only), §7 — the whole Tier-A surface, no real backends:
- Protocols (
@runtime_checkable, async, bulk): essentialSubmitter,Monitor→
JobBackend; optionalOutputRetriever(withdestructive: bool),Cancellable,Purgeable,
LoadReporter,SupportsLiveDiagnostics; collaborator protocolsTransport,Scheduler
(shapes only — implementations come in issues 10–12). - Data types:
SubmissionSpec(with the reserved optionaltagfield),Submission
(.handles+.failures),JobHandle/JobID(serialisable, routing-carrying),JobStatus
(incl.UNKNOWN),StatusMap,JobOutput(manifest:.stdout/.stderr/.files/.log),
OpOutcome,JobCounts,Diagnostics,Resources,FileRef,OutputSpec. - Exceptions: rootable
InterCEdeErrorhierarchy (whole-operation failures only; per-item
failures ride the outcome maps). - Package hygiene:
src/intercede/with explicit__all__per public module,py.typed,
strict mypy in CI; Tier-C modules_-prefixed. - Unit conformance suite + in-memory
FakeBackend: proves the contract is trivially
implementable/mockable; becomes the template for the Phase-2 integration contract suite. - Implement the three contract rules added to the ADR after the review pass (all now decided
in IC-ADR-001): (a) backend/transport lifecycle — async context managers, cheap side-effect-free
construction, idempotent close (§2); (b)JobCountsstays counts-only — verified sufficient for
the remote family (Open Issues); (c) file ownership —submit()never retains caller-owned
paths after return (§4; kills DIRAC'sExecutableToKeep).
Definition of Done
- Tier-A protocols + data types + exceptions importable from
intercede,__all__-exported - mypy strict green;
isinstancenarrowing works against all@runtime_checkableprotocols -
FakeBackendpasses the unit conformance suite (submit/status/fetch/kill, partial-failure
maps,UNKNOWNfor unknown ids) - Lifecycle (async context manager), counts-only
JobCounts, and submit-time file-ownership
rules implemented as specified in the amended IC-ADR-001 - API reference docs stub builds
Alternatives Considered
Covered by IC-ADR-001 Rejected Ideas (fat base, god-interface, sync API, ObjectLoader, reuse of
PSI/J/SAGA/blahp/Harvester/JAliEn).
- Dominant language
- Python
- Stars
- 3
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DIRACGrid/intercede
-
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 28/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in DIRACGrid/intercede
Similar issues
-
New InternshipOpennew_internship
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
[BUG] Reports tab: "Unban" button tooltip shows raw `{{ip}}` placeholder instead of the IP addressOpenbug javascript ui
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bunkerity/bunkerweb#4001 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/differential-privacy#516 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
adobe-fonts/source-serif#153 ·