Repository navigation
feat: bound and summarize get node output - #75
Merged
Merged
Conversation
sergej-koscejev
force-pushed
the
issue-48-get-node-depth
branch
3 times, most recently
from
October 22, 2026 09:41
848fdd9 to
e51074a
Compare
sergej-koscejev
enabled auto-merge (squash)
October 22, 2026 11:32
…hint once Also name the Node Stub in the glossary and spell Containment Role consistently in the new protocol comments.
sergej-koscejev
force-pushed
the
issue-48-get-node-depth
branch
from
October 22, 2026 15:17
5f37a85 to
4938b3c
Compare
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.
Closes #48
Summary
get nodegains bounded views and readable output. The full Node Subtree stays the default.Export shape with
--depth 1:Daemon side:
ModelGetNodeRequest.depthflows intoJsonNodeExporter, which recurses with a remaining depth (0 dropschildren, 1 emits stubs);--summaryis its own request pair (model-get-node-summary) built on thenodeSummarythat
findandcheckalready use. Both node commands get acustomSynopsisso--helpshows one line per positionalform.
Evidence
get nodeprinted one ~43 KB line;get node --helpshowedNODE_REFERENCE | MODEL_TARGET NODE_ID [NODE_REFERENCE | MODEL_TARGET NODE_ID].After:
GetNodeSemanticsTest(stubs at depth 1 and 2,truncatedAt, depth 0, summary counts and ancestry),ModelGetNodeCommandTest(pretty default,--compactbyte-identical to the old output, option validation, stderrhint present/absent),
DaemonProtocolJsonTest(round-trips, compact encoding unchanged),CommandHelpTest(synopsis).:protocol:test :daemon:test :cli:testgreen;integrationTestMps2026.1.1forCliSmokeTestandBundledExamplesIntegrationTestgreen;:cli:updateExamplesleaves the tree clean.Decisions
MpsNodeJsoninstances with onlyrole,concept,conceptValid,name,reference, andchildCountset; no separate stub type, so thechildrenlist stays homogeneous and data-class equality keeps working in tests.reference(not the spec'sref), matchingparent.reference,findoutput, andlist --json, which all spell the serialized node reference asreference.role, like every other child entry, so a consumer knows which containment role the stub sits in.--depth Nmeans N levels below the target are exported in full and the nodes at level N are stubs;--depth 0exports the target with nochildrenkey at all andtruncatedAt: 0.truncatedAtis placed beforeparentin field order soheadshows it; default output is unaffected because the field is omitted when null.--summaryreuses thefind/checksummary vocabulary (MpsNodeSummaryJson:type,name,concept,reference,parent) and addschildren: {role: count}; it is a separate request/response pair (model-get-node-summary) rather than anMpsNodeJsonwhosechildrenchanges shape. It is therefore not literally--depth 0sugar: it lacksmodel,id,properties,references, andtruncatedAt.--summaryand--depthare mutually exclusive (same rule aslist);--ancestrycombines with both.mops: this node is N KB of compact JSON; pass --depth N or --summary for a bounded view; the compact form is encoded for the measurement even when the pretty form is printed, because the threshold is defined on it.test-projects/base-language-sandboxthe largest export (theCalculatorclass) is 8 KB compact, so no fixture reaches the threshold and there is no fixture-based threshold test (the spec's premise about that project does not hold).get node/render nodesynopsis is fixed with picoclicustomSynopsisasmops get node [OPTIONS] NODE_REFERENCE/... MODEL_TARGET NODE_ID(the full option list would wrap at 80 columns), plushideParamSyntaxso the positional row in the parameter list is readable; the help-layout rework in Show subcommands near the top of help output #52 is left alone.--depthis validated as non-negative with no upper bound, unlikelist, since a large depth simply degrades to the full export.GLOSSARY.mdgains Node Stub;skills/mops/SKILL.mdrecommends--summary/--depthfirst on nodes that may be large.Merge Danger
Door: two-way
Revert restores the previous single-line output; no persisted data changes.
Blast Radius: output-format
get nodestdout is now multi-line by default. Scripts that parsed it as one line need--compact, which isbyte-identical to the previous output.
MpsNodeSummaryJsongains an optionalchildrenfield thatfindandchecknever populate, so their output is unchanged.