Repository navigation
Plan the field insert command: chooser, placement, editor handoff - #153
Conversation
Adding an insert today is a hand edit with three edges the tool already knows how to file down: the inventory knows the real plugin names, the pinner knows the identity fields, and chain order is audible. The plan adds one command that writes a fully pinned insert through the existing comment-preserving YAML machinery, with an interactive search chooser over the scanned inventory when no plugin is named, an order chooser when the chain already has inserts, and the flow ending in the plugin's own editor by handing off to chunk 3's field open once it exists — there is no way to open a plugin UI today, so that step composes with plugin-hosting.md chunk 3 rather than duplicating it, and the command is useful before it lands. Draft: the open questions (command spelling, the interactive dependency as a stack decision, whether built-ins join the chooser) stay open until the PR that flips it Active.
|
Starting review of a78c76a. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a78c76a2e9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
minjudd
left a comment
There was a problem hiding this comment.
Reviewed a78c76a — docs-only, add-insert.md plus the next.md line.
The open questions do not gate this, and the reason is the frontmatter. status: Draft is one of the five keywords that claim no readiness, so §7's four — command spelling and track addressing, the interactive-picker dependency as a stack decision, whether built-ins join the chooser, and chooser ergonomics — withhold nothing here, owned by this PR though all four are. Naming them anyway, because the claim they would otherwise gate does not vanish: it moves to whichever PR flips this plan to Active, and that PR answers for every one of them still open at that moment. Your description already says exactly this, which is the right place for it to be said.
The finding below is not one of those. It is a claim §2 makes about behaviour that the code it cites contradicts, and the Draft exemption covers open questions rather than errors.
I re-grepped the citations independently rather than taking the description's word that they were checked, and they hold up. Decision 2 carries you-write-the-name-the-tool-writes-the-id, the name/id disagreement warning and AU-on-macOS resolution; decision 5 says a fresh insert never grows a state: line, which is exactly §6's non-goal; decision 6 defines <track>/<handle> with field open lead-vocal/1176 as the worked example; decision 7 carries the gesture write-back and the owner-attached window rule; §4 shows latency: 512 # tool-written, like version; absent when zero and closes with the two discriminants coexisting in one chain; chunk 3 is field open <track>/<handle>, designed and unbuilt. project-core.md §5 is the Stack section. The --allow-mismatch precedent is real and is the shape you describe — cli.ts:278 pairs the flag with an interactive confirm at cli.ts:285, which is also the only interactivity in the repo, so "a readline y/N" is accurate. Section numbering matches every citation into this plan (§2 command, §3 chooser, §4 order, §5 handoff, §7 questions).
One citation took tracing to confirm and I am recording it so nobody re-does the work: field choose has no commands/choose.ts, so the emit-machinery claim looks wrong at first grep — it is implemented as chooseVariant in commands/generate.ts, which does import yaml/emit.js, and the comment at generate.ts:248 says outright that the Document exists "so choose can edit it without discarding comments". The claim is correct.
Two notes that change nothing. §3 leans on #152's inventory cache in the present tense; #152 is still open with my own changes requested against it, so the stat-not-a-75-MB-parse cost holds only once it lands — the plan attributes it to the PR, which is honest, and Draft is the right status for a plan resting on unmerged work. And the description's Testing section places the field plugins scan refusal string in src/audio/plugins.ts; it is in src/commands/plugins.ts, at lines 38 and 217. The plan itself cites no file for it and describes the behaviour correctly — worth a fix only because this body becomes the commit message.
Five findings from Codex and one from minjudd, all against claims the cited code contradicts. Placement gets a scriptable spelling: --at <position|end>, with a named plugin on a populated chain defaulting to the end without a TTY, so no path hangs a script. The duplicate-id promise now covers the half it was silent on — the duplicate check quantifies over the whole identity group, so the command prompts for both handles and discloses the incumbent edit, and refuses that case without a TTY. The chooser filters entries that report no version (the pinner's refusal, shown on the row before a write), shows identifiers where name+format+version still collide, and names #152 as an in-review dependency instead of citing its cache in the present tense.
|
Starting review of f8aaf9c. |
minjudd
left a comment
There was a problem hiding this comment.
Approving f8aaf9c.
My P2 is answered properly rather than papered over. §2 now says decision 6 requires an id: on every instance, names the quantifier as the reason, and picks one of the three exits — prompt for both handles, disclose the incumbent's edit in the confirmation, refuse the duplicate case without a TTY. That the second write touches a line the user did not name is now stated as a cost rather than left to be discovered, which is the part that matters; and refusing rather than backfilling a handle nobody chose is the right call for a script.
I re-checked the new claims against the code rather than only the ones from the first round. The duplicate check does quantify over the whole identity group (project.ts:896-908, grouping on insert.au ?? insert.vst3 ?? name:${plugin} and firing on group.some(id === undefined)). The pinner does report format and identifier on an ambiguous name, so "the identifier joins the row" matches what the non-interactive path already prints. And the empty-version refusal is exactly right on both halves: pluginInsertSchema has version: z.string().min(1).optional(), so version: "" really is a file the schema rejects, and pinProject already refuses those entries for that stated reason. Section numbering is unchanged at 1–7, so the §-citations into this plan still land, and next.md is untouched this round.
The #152 rewording is more honest than what it replaced — ergonomics rather than correctness is the right characterisation, and it means this plan does not quietly depend on a PR that could still change. (It has since been approved, for what it is worth.)
The open questions still do not gate this, and it is still the frontmatter's doing. status: Draft claims no readiness, so §7's four — spelling and track addressing, the picker dependency as a stack decision against project-core.md §5, whether built-ins join the chooser, chooser ergonomics — withhold nothing, and all four are unchanged this round. The readiness claim they would otherwise gate belongs to whichever PR flips this to Active, which answers for every one of them still open then.
One thing worth a line in §4 or §7 rather than a round of review, so recording it here where it binds nothing: --at <position|end> arrives as a decided spelling, but <position> has no grammar. §4 names positions in prose — "before 1176", "between 1176 and Altiverb 8" — and by the time the chain holds two instances of one plugin, §2's own rule has given them handles precisely because the plain name stops identifying an instance. So the flag most likely wants handles too, and saying so would cost a clause. §7's last bullet already reserves ergonomic details for implementation; this may simply belong there.
Three of the plan's open questions closed on answers from Justin: the command is field insert add <track> (the subcommand keeps the family open for remove and reorder), recently-used plugins sort first with search matching format tokens, and the picker is a hand-rolled raw-mode loop kept deliberately disposable — a full TUI is eventually wanted, and that is its own stack decision that a prompts library adopted now would quietly pre-answer. Built-ins grew from a bullet into the real discussion: actual AU/VST3 wrappers versus special-cased chooser rows, with the byte-identity golden and analytic latency arithmetic named as what wrapping would demote.
|
Starting review of 5a2cbd9. |
minjudd
left a comment
There was a problem hiding this comment.
Re-approving at 5a2cbd9 — the push dismissed the approval on f8aaf9c, as it should have, so this is a fresh pass over the new head rather than the old verdict carried forward.
Three of §7's four questions are now settled and the fourth is reframed, and the settlements follow the house convention rather than just asserting an answer: each (DECIDED, 2026-08-12) names the alternative that lost and why — the bare verb burned on one operation, a prompts library that would pre-answer a TUI stack decision with whatever the library grew into. That is what AGENTS.md asks a decision record to do, and it is the difference between a plan that has decided something and one that has merely stopped mentioning it.
I checked the claims the built-ins framing rests on, since they are the load-bearing part of the argument for (b). Byte-identity really is a built-ins contract — plugin-hosting.md §5 chunk 2 says byte-identity offline-vs-live "is explicitly not claimed for hosted inserts in general (the golden stays a built-ins contract; the freeze handoff leans on the warmup bound instead)". And decision 11 really does split the two: latency and tails are compiler arithmetic, with "the analytic requirement was realtime.md's, for effects we author; hosted plugins get the measured version." So "wrapping them demotes both to the weaker hosted guarantees" is accurate, and the lean toward (b) is earned rather than asserted. Nothing dangles from §7 shrinking either — the two places that read "spelling open (§7)" are gone, and the remaining §-citations still resolve.
Still exempt, still because of the frontmatter. status: Draft claims no readiness, so the two questions left — track addressing shared with field open, and built-ins pending discussion — withhold nothing. Whichever PR flips this to Active answers for both.
Two notes, neither blocking, both in the body deliberately.
The --at <position> grammar is still undefined at lines 45 and 117, and the reason I flagged it as non-blocking last time has quietly gone: §7's "cheap to decide at implementation" bullet was the catch-all covering it, and this commit answered and deleted that bullet. Nothing about the gap got worse and nothing in the plan is false, so I am not turning a note I explicitly said was not worth a review round into a blocking one. But it is now uncovered, and §4 naming positions by plugin name is exactly what §2's duplicate rule shows stops identifying an instance once a chain repeats one. The flip to Active is the natural moment to settle it.
And "Recently used sorts first" delivers slightly less than it says: pinned-in-track-YAML is a usage set, not a recency order — YAML carries no timestamps, and the bullet does not say what orders plugins within that set. The plan already hedges this with the picked-history fallback, so it is a wording gap rather than a design one, but "already used in this project sorts first" is what the mechanism actually provides.
Adding an insert today is a hand edit with three edges the tool already knows how to file down: the inventory knows the real plugin names (the hand edit guesses at them), the pinner knows the identity fields (the hand edit leaves an unpinned window for
field checkto close), and chain order is audible (serial chains are not commutative, so placement deserves a deliberate answer rather than a cursor position). The plan adds one command —field insert add <track> [plugin]— that writes a fully pinned insert through the existing comment-preserving YAML machinery, with an interactive search chooser over the scanned inventory when no plugin is named on the command line, and an order chooser when the chain already has inserts.The flow ends in the plugin's own editor, which answers a question worth recording: there is no way to open a plugin UI today. That is plugin-hosting.md chunk 3 (
field open <track>/<handle>, decision 7's gesture write-back), designed and not yet built — so the plan composes with it (hand off tofield openon the insert just added; until chunk 3 lands, print the line it would have run) rather than duplicating any of its design. Nothing here blocks on chunk 3 except that final step.Status is
Draft, so the open questions do not block this PR; the PR that flips itActiveanswers them. Three closed on Justin's answers mid-review: theaddsubcommand spelling, recents-first rows with format-token search, and a hand-rolled disposable picker — a full TUI is eventually wanted and stays its own stack decision against project-core.md §5, which a prompts library adopted now would quietly pre-answer. Two remain: track addressing when names collide across songs (shared withfield open), and built-ins — deliberately framed as a discussion in §7, actual AU/VST3 wrappers versus special-cased chooser rows, with the byte-identity golden and analytic latency arithmetic named as what wrapping would demote. Thenext.mdline rides the same diff, replacing "Nothing committed yet."Testing
Docs-only — nothing builds or runs. What to check instead:
docs/projects/all/add-insert.mdrenders with itsstatus: Draftfrontmatter and the section numbering the citations rely on (§2 command, §3 plugin chooser, §4 order chooser, §5 editor handoff, §7 open questions); the next list links it and no longer reads "Nothing committed yet."; and every doc citation in the plan was grepped against its source before writing (decision 2/6/7 and §4 in plugin-hosting.md,yaml/emit.ts, thefield plugins scanrefusal string insrc/commands/plugins.ts(lines 38 and 217), the #152 inventory cache — named in the plan as an in-review dependency).Note
Cursor Bugbot is generating a summary for commit 5a2cbd9. Configure here.