Repository navigation
Parse a single block given to node create as an import would - #4401
Merged
Merged
Conversation
A single block with no front matter now goes through the importer's parser: --type text takes the parsed node type, content and properties (a heading is a header, a checklist line a checkbox, and likewise quote, code block, ordered list, table, horizontal rule; a bullet line is text without its marker). Any other document type keeps its type and takes the line as its title (a leading # marker dropped); a block that cannot be a title is refused. The CLI notes on stderr when the created type differs from --type. The --content help, the CLI reference and the skill guidance describe the new behaviour, and the by-hand example uses typed header and checkbox nodes. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Update the agent create_node comment to the single-block behaviour, add tests for a caller property on a single text block and for non-object properties, and put the create-note CLI test above the comment that belongs to the next one. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4395-single-line-create
branch
from
November 27, 2026 07:42
7c42d06 to
1970387
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.
What changed
nodespace node createnow runs a single block (no front matter) through the importer's parser, the same one used for a document of several blocks.--type text: the node takes the type, content and properties an import of that block gives it (heading ->header,- [ ] x->checkbox, and likewise quote, code fence, ordered list item, table, horizontal rule;- item->textwithout its marker; a plain line staystext).task,issue,project,decision, ...): the type is kept, the line is the title, a leading#marker is dropped (--type task --content '# Title'storesTitle); a block that cannot be a title (list item, quote, rule, checklist line, ...) is refused with nothing created, as the first line of a longer document is.type:/ JSONtype); the CLI also prints a note on stderr when it differs from--type.--contenthelp text,packages/skill/references/cli.md(option text, generated help line, output note, the "by hand" example now uses typedheader/checkboxnodes and no heading in a text node) and the agent skill seeds (node-creation-steps,section-create,task-create-whole) are updated.Not a schema/shape change (shape:check and node-types:check green).
Note: the local agent's
create_nodetool also callscreate_document_node, so it gets the same single-block behaviour (the issue lists the agent tools as a non-goal, assuming they did not go through it). In particularcreate_node(task|issue, "- x")is now refused (a list item cannot be a title), andcreate_node(text, "## x")creates aheader.Tests
New in
markdown_document_create_test.rs: text single blocks match an import (9 cases); plain line stays text; other document types keep type and strip#; non-title blocks refused for a named record; non-document types stored as given. One CLI unit test for the stderr note, and two tests for a caller property on a single text block (reaches the write; mutation: dropping the merge fails it) and for non-object properties being refused (mutation: dropping the refusal fails it). Replaced the old "single block is stored as given" test, which asserted the previous behaviour.Mutation checks (each reverted): skip type adoption, drop the refusal, drop heading strip, drop the document-type gate, alter adopted content; each makes the guarding test fail.
Checks:
bun run test:changedpassed; push check passed.🤖 Generated with Claude Code