fix(agent): land create_folder (S9) on main - #264
Merged
Conversation
Let the agent create a nested sub-board and populate it in one turn (create
folder in the working folder -> navigate in -> author -> navigate up), building
on S8's working folder + headless writes.
- BoardMutator.createFolder(label): builds a folder node (type folder, folder
default size, label + working-folder parentId), auto-placed. StoreMutator
renders it when the working folder is the visible layer; HeadlessMutator makes
it off-scene (a subfolder inside a navigated-into folder).
- create_folder(label) tool: returns { folder_id }, enforces the same nesting
depth cap as the folder tool (MAX_BOARD_DEPTH).
- navigate resolves its target across the working + visible stores, not just the
pre-turn snapshot, so the agent can enter a folder create_folder just returned.
- Prompt teaches the create-and-populate workflow.
Deferred (per plan 6c, working-folder model is primary): per-call parent_id
overrides on write_note/link_notes.
Code review found several guards reasoned about nodes via the pre-turn
boardNotes snapshot, so folders/notes created earlier in the same turn were
invisible to them.
- Add ctx.liveNodes: an id -> {parentId, type} index the tools update on every
create. create_folder depth, navigate 'up' parent resolution, and write_note's
cross-folder guard now consult it, so same-turn nesting is capped, 'up' from a
just-created folder finds its real parent, and a this-turn id in another layer
is refused instead of duplicated.
- create_folder also enforces the universal per-level folder count cap (10),
matching the manual folder tool.
- Cache off-scene sessions per layer on ctx (disposed at turn end) so navigating
among folders reuses seeded stores instead of re-reading the whole board each
hop.
Tests: same-turn nesting cap, navigate 'up' to true parent, dup-id refusal,
folder-count cap.
Both tools fell back to the default note icon in the chat's tool-step list. Map create_folder to the folder-plus icon and navigate to the folder icon (both Phosphor, via @/components/icons) so the folder-authoring steps read at a glance.
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
Lands S9 (
create_folder) onmain. S9's PR (#263) was stacked on the S8 branch and, after #262 squash-merged S8 intomain, merging #263 folded its commits into the stale S8 branch instead ofmain— socreate_folder, the same-turn folder guards, the session cache, and the folder icons never reachedmain.This branch cherry-picks the three S9 commits cleanly onto
main:feat(agent): create_folder tool — author subfoldersfix(agent): make folder guards see this-turn creations + cache sessions(the feat(agent): create_folder tool — author subfolders #263 code-review fixes)feat(agent): folder icons for navigate + create_folder tool stepsWhy a new PR
#263 is already marked MERGED (into
feat/agent-navigate-working-folder), so it can't be re-targeted. A fresh PR frommainis the clean way to get the changes ontomain.Verification
main).npm run check-allpasses.Content is identical to the already-reviewed #263 (which had
/code-review highrun + findings addressed); this is purely a base-branch recovery.