Repository navigation
Feat: Core contract (Models, Protocols, exceptions) issue #16 - #27
Draft
Alexander-Auer wants to merge 29 commits into
Draft
Alexander-Auer wants to merge 29 commits into
Alexander-Auer wants to merge 29 commits into
Conversation
added 29 commits
October 2, 2026 16:54
… have them link to each other
…ede into feat/core-contract
…a consumer should choose to use it or not
Alexander-Auer
marked this pull request as draft
October 9, 2026 11:33
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: core contract (protocols, data types, typed errors)
Closes #16. Implements the Tier-A contract from IC-ADR-001 (the Aug 31 revision in #4): protocols, data types and exceptions, plus an in-memory
FakeBackendand a unit conformance suite. No real backends and no registry.What's included
Public API (
intercede, exported via__all__)@runtime_checkable):Submitter,StatusReporter→JobBackend(with async context-manager lifecycle)OutputRetriever,Killable,Purgeable,Diagnosableextra="forbid"):SubmissionSpec,CopyVars,FileRef,OutputSpec,OutputMember,ContainerSpec,Resources,Submission,JobHandle,JobID,JobStatus,StatusMap,JobOutput,Diagnostics,OpOutcomeInterCEdeError→ConfigurationError,AuthenticationError,ResourceUnavailableError,SpecificationRejectedErrorInternal (
intercede._backends)batch/protocols.py: shapes ofTransportandScheduler(no implementations)fake.py:FakeBackendimplementing every capability, with test hooks; conformance is checked by mypyPackage hygiene
py.typed, strict mypy with the pydantic plugin (runs in CI through pre-commit)pydantic>=2as the only runtime dependencypixi run -e docs docsContract rules enforced
submit()reads local inputs before returning and never keeps caller paths.OpOutcome(ok=False, reason=...), and unknown jobs areUNKNOWN, never dropped.SpecificationRejectedError.dest.CopyVars.secretsusesSecretBytes, so it never appears inrepr, logs or JSON.Deviations from the ADR (feedback welcome)
JobHandle, notJobID. IDs are only unique within one resource; keying by ID let two clusters' job1234overwrite each other.JobHandleis hashable, includingrouting.Submission.handlesis aMapping[int, JobHandle]keyed by copy index. With a list, a refused copy shifted every later handle; nowhandles[i]always belongs tocopies[i].OpOutcome[T]is generic, with avalue. This letsget_output/get_diagnosticsreport per-job failures;kill/purgeuseOpOutcome[None]. A validator keepsok/value/reasonconsistent.Schedulergainsparse_submit(raw),parse_status(raw, ids)andworkdir, which the composed backend needs.Transportgets the lifecycle methods.If these are accepted, IC-ADR-001 should be updated to match.
Deliberately left out
LoadReporter/JobCountsand thedestructiveretrieval flag: issue [Feature]: Core contract (protocols, data types, typed errors) #16 lists them, but the current ADR drops them. Adding public API later is non-breaking; removing it is not.Tests
tests/unit/test_models.py: validation rules (hashing, secrets, name checks,OpOutcome/Submissioninvariants)tests/unit/test_protocols.py:isinstancenarrowing per capabilitytests/unit/test_conformance.py: contract tests using only the public API, run through abackendfixture (honoursbackend_only/xfail_backend); meant to be reused against real backendstests/unit/test_fake_backend.py: partial failure, refusal, path containment, repeatable outputAll tests run against
FakeBackendonly; no real scheduler or CE is involved.Relation to other PRs
tests/unit/(no clash with itstests/conftest.py), and the API reference sits underdocs/user/. mkdocs reports links to files outsidedocs/(such asrenovate.json) as info instead of failing.main.How to check
pixi run -e py313 pytest
pixi run -e pre-commit pre-commit run --all-files
pixi run -e docs docs