Repository navigation
refactor: share the cross-surface reads in the kernel, add the project progress route, tighten the import contracts - #908
Merged
Conversation
…ress route, tighten the import contracts
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.
What
Moves logic that three surfaces each wrote for themselves into the kernel, closes the last reverse gap, and puts the thin packages under the import contracts.
_promoted(CLI, MCP and three REST routes) become oneDatasetService.promoted_asset_ids.ProjectService.resolve,InferenceConnectionService.resolveandReleaseService.resolvereplace the CLI and MCP resolvers. Each surface keeps only what is its own: the MCP malformed-id refusal, the CLI option types.wire,formatsandpreprocessingmay not import a delivery package or a web/CLI/MCP framework, norsqlalchemydirectly;jobsandinferencealso may not import the externalmcppackage. Six contracts now.GET /projects/{id}/progressreturns the same counts as MCP'sget_projectprogress.init,token,ingest,export) are recorded as having no REST route that takes a path, by design;backfill-thumbnailsis recorded as a gap that takes no path.Addresses finding 12 and the reverse gaps of #884; the tracker is left for a person to close.
Notes for review
Raises:lines addPROJECT_NOT_FOUNDto the publishedapprove_batchandcommit_video_importdocs, soopenapi.jsonand the generated client change.cli/projects.pyandmcp/batches.py. The kernel cannot importvisionset.inference, the two copies differ in progress output and error handling, and each is about ten lines. REST enqueues a job instead, andjobs/prelabel.pyis the worker handler, so neither is a third copy.cli/inference.py::_resolvereturns an id without reading the connection; routing it through the kernel would add a read.Verification
tests/examplesexcluded).lint-imports(6 contracts kept) and theui-coretype check are clean; the docs link and sidebar gates and the MCP tool-reference check pass.scripts/check.shwere not run locally.