Repository navigation
feat(repl): repository commands %repo, %projects, %load and %publish over the SysML v2 API - #1005
Merged
Merged
Conversation
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
force-pushed
the
feat/repl-repository-commands
branch
from
October 9, 2026 01:32
cbbf0b1 to
cecbfc6
Compare
devin-ai-integration
Bot
changed the base branch from
develop
to
feat/load-notebook
October 9, 2026 01:32
Contributor
Author
|
Rebased onto
|
HuiJun
force-pushed
the
feat/repl-repository-commands
branch
3 times, most recently
from
October 9, 2026 03:53
2d9bace to
2d57f48
Compare
…over the SysML v2 API Split the standard SysML v2 API client (projects, branches, commits with change payloads, elements, roots, Link-paged collections, optional bearer token) into internal/translate/interop/sysmlapi; flexo keeps Layer 1 Turtle, organizations and ETag pushes over it. modelsync holds what sysml -sync and the REPL share: rooted cuts, provenance scope, notation, derived-property filtering and diff/apply over reposync. The REPL and the Jupyter kernel gain the OMG pilot kernel's four repository commands through a replext repository extension, with usage errors as *repl.UsageError, completion of flags and project names, and an httptest fake of the standard API exercising all four and a publish/load round trip. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… absent A session that loaded a project at a branch other than the default published its edits to the default branch; the loaded branch is now the one a publish without --branch addresses. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ge links, refuse repeated options and plaintext redirects %publish deletes only under the root it publishes, only on a branch the session loaded or published from the same server, and reports what it left in place; a repository state carries the server it came from. A failed first commit names the project it created. Elements paging follows a Link rel=next as given instead of rebuilding it as a cursor. A %load or %publish option given twice is a usage error. A redirect with a bearer token is held to the plaintext rule of the first request. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… refuse a repeated -d and redirects off the server's host confine looks the root up among the branch's subjects by effective id, so a branch that qualifies its ids still has removed descendants deleted. -d given twice is a usage error like any repeated option. With a bearer token, a redirect to another host is refused as well as one to plaintext. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…port Co-Authored-By: jason.han <hanhuijun@gmail.com>
…k included Co-Authored-By: jason.han <hanhuijun@gmail.com>
…s --cells beside the repository options Co-Authored-By: jason.han <hanhuijun@gmail.com>
…to %load Co-Authored-By: jason.han <hanhuijun@gmail.com>
HuiJun
force-pushed
the
feat/repl-repository-commands
branch
from
October 9, 2026 10:53
2d57f48 to
8427187
Compare
5 of 6 tasks
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 and why
The
sysmlREPL and the Jupyter kernel gain the four repository commands of the OMG pilot's Jupyter kernel, with its grammar:They work against any server speaking the standard SysML v2 API (
/projects,/branches,/commitswithchangepayloads,/elements,/roots) — the pilot'sSysML-v2-API-Services, which wants no token — and against Flexo MMS, whose extras (bearer token, organization, Layer 1 Turtle, ETag pushes) stay optional.internal/translate/interop/sysmlapi(projects, branches, commits, elements, roots, optional bearer token, typedStatusError/UnreachableError);internal/translate/interop/flexowraps it and keeps Layer 1, orgs and ETag semantics. Paging follows a server'sLink: rel="next"to the end even when a page is short, which the pilot server does.sysml -syncis unchanged and its tests pass as they were.internal/translate/interop/modelsyncholds whatsysml -syncand the REPL share: baseline/apply overreposync.Diff/reposync.Apply, provenance scope (ProjectRef), the rooted cut of a model, notation writing, and the derived-property filter. There is no second sync implementation.%reposhows or sets the session's base URL (seeded fromFLEXO_SYSMLV2_URL, plain-HTTP guard honoured, token read only fromFLEXO_INTEROP_TOKENand never printed or persisted).%projectslists<name> (<id>)over every page.%loadresolves the project by name/--id/--nameand the branch by name or id (default branch when absent), reads the head's elements, writes them as notation and submits them as a document, recording project/branch/commit so a later%publishwithout--branchcommits on that branch; a name two projects share is refused naming both ids. A lone argument that is a path on disk still loads files.%publishcuts the elements rooted in a session-resolved qualified name, creates the project when none has that name, otherwise commits the diff against the branch head, reporting the commit id and created/updated/deleted counts;-dsends every derived property the exporter computes, without it the ones the reader recomputes are left out. The REPL reaches the transport through areplext.Repositoryextension and does not importcmd/sysml.*repl.UsageError, which the kernel now answers asUsageErrorfor every meta command; server failures carry the HTTP status and the server's message.%help, and a changelog fragment.How it was verified
go build ./...,go vet ./...,gofmt -l .(empty).go test ./internal/translate/interop/... ./internal/frontend/... ./cmd/sysml/...— pass. New tests: anhttptestfake of the standard API (projects, branches, commits withchange, elements, roots,Linkpaging, 404, 409) driving all four commands throughSession.RunMeta, including a%publish→%loadround trip into a fresh session that compares the models, a%load --branch=<non-default>followed by a%publishthat must commit on that branch, usage errors, completion of flags and project names,%help; a Jupyter engine test over%repo/%projects/UsageError/CommandError;modelsynctests pinning the derived-property set against every example model.make test-short— pass apart fromTestFormattingDiffIsCheaperThanFormatting(an LSP timing test unrelated to this change) under the full-suite load; it passes with-count=3on its own.make man-check,make docs-check,python3 scripts/changelog.py check— pass.tests/hygienelayering passes with the new packages.flexo-mms-sysmlv2compose files), driven through the builtbin/sysml:%reposhow/set, the plain-HTTP guard,%projectsempty and populated,%publishcreating a project (9 created) then committing an edit (2 created, 1 updated, no second project),--project/--branchto another project and branch,-dconfirmed by API readback (owningClassifierpresent only after a derived publish, a repeat is a no-op),%loadby name,--id,--nameand--branchinto fresh sessions with the notation preserved, publish after load committing on the loaded branch (default and non-default), clean errors for a missing project, missing branch, unresolved root and unreachable server,%helpand Tab completion of flags and live project names;sysml -syncdiff/apply then no-op against the same stack. No token appeared in any transcript.TestFlexoInteropexpectation gate was run against that stack and fails three comparisons (74 → 76 subjects, 240 → 268 identity triples,sysx:sourceLine/sourceColumn/sourceEndLine/sourceEndColumnnow among the uncarried properties); it fails identically onorigin/develop, so the drift predates this branch and the expectation is left for its own change.SysML-v2-API-Servicesserver.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/5c4ff33730224c458b08de0632279da1
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/5c4ff33730224c458b08de0632279da1?variant=devin
Requested by: @HuiJun