Repository navigation
Ship Pi and OpenCode plugins that list NodeSpace's skills in the session, and an instructions block for harnesses without one - #3650
Conversation
|
Review Type: Initial Review (no prior reviews or comments on the PR) Checked at 1786446. Ran Requirements CheckPi
OpenCode
Both plugins
Instructions block
Installer
Code Review Findings🟡 Important: a session is refused over its own write when two writes overlap📁
This is reachable wherever the harness runs one step's tool calls concurrently (OpenCode does), for example a model ticking two checklist items in one step, or one bash line that writes and then runs something long ( Recommendation: count own writes in flight. Increment when a may-write line passes Principle: a check-then-act sequence split across two hooks is not atomic; the module's own comment names "stop the session over its own change" as the worse error, and this path produces it. 🟡 Important: a context path name can close the graph-data marker📁 Every other piece of graph text goes through so text after the forged close reads as shipped text. Path names come from the type's context paths (schema data anyone with write access can edit) and from Recommendation: Principle: ADR-093 §1 and §7 rest on the agent always being able to tell graph text from shipped text; escaping has to be applied at the one place text enters the marker, not per field. 🟡 Important: the instructions file is rewritten through a UTF-8 decode, and non-atomically📁
Recommendation: before writing, check Principle: an installer that edits a file it does not own should fail closed on anything it cannot round-trip. 🟡 Important: with no record, plugin files are owned by name alone, in folders the user shares📁
Recommendation: when there is no record, remove a plugin file only if its bytes equal what Principle: the file's own rule, "uninstall must not delete more than it installed", needs evidence of ownership; a file name in a shared folder is not evidence. 🟡 Important: a timed-out command keeps running in OpenCode📁 On timeout the race resolves to code 124 and the shell promise is dropped, not stopped. If the daemon accepts connections and never answers, every prompt and every checked tool call leaves one more Recommendation: where Principle: a timeout that returns without releasing the resource moves the leak instead of bounding it. 🟢 Suggestion: smaller items
RecommendationREQUEST CHANGES, narrowly: the first two findings are reproduced and each is a few lines, and one acceptance criterion (the live skill-fetch test covering the block) is not met as written and should be either done or struck from the issue. The installer structure, the handling of recorded paths, and the test suite are sound. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressedFixed
Not changed, and why
Still open from the requirements check
Tests: skill package 220 passed; Claude Code plugin 34 passed; plugin type-check clean. |
|
Review Type: Re-Review Checked Previous Review Summary13 recommendations (5 Important, 8 Suggestions), plus the atomic-write half of one Important.
Upgrade paths through Code Review Findings🟡 Important: a write goes through over someone else's change when two writes are dispatched together📁 The second half of Reproduced: read context for The first check sets Recommendation: record what the test is trying to infer. Bump a counter in Principle: equality of state is not evidence of who produced it; the guard exists for exactly this case. 🟡 Important: a write the harness never reports back turns the item watch off until the user next speaks📁
Reproduced: one write passes The same happens when the unreported write came before any item was watched (line 843). In OpenCode this is a bash call that mentions In Recommendation: give an in-flight write a lifetime. Keep start times instead of a count and ignore any older than a few minutes; a write lands early in its line, and the checks made inside that window have already taken its change as the baseline. In Principle: a counter released only on the success path fails open; a safety check should not be disabled by an error elsewhere. 🟢 Suggestion: smaller items
RecommendationREQUEST CHANGES, narrowly: both Important findings sit in the same few lines of |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): REQUEST CHANGES (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressedFixed
Tests. Two added to the shared-module suite (both writes refused; an unreported write expires); both fail with the fix reverted. One added to the Claude Code plugin suite for the two-writes case. That one passes with the fix reverted too: the plugin's test engine runs the two calls' checks one after the other, so the interleaving cannot be produced there. The logic is the same as the shared module's, where it is pinned. Suites: skill package 222 passed; Claude Code plugin 35 passed; plugin type-check clean. |
|
Review Type: Re-Review Checked Previous Review SummarySecond pass: 2 Important, 2 Suggestions.
State reset is right: Code Review Findings🟡 Important: one unreported write still turns the watch off for as long as the session keeps writing📁
Reproduced: one write passes The same line causes a false refusal in the other direction. A write let through before any item is watched is not counted, but its The exposure is much smaller than at the last pass: it ends at the first two-minute gap between writes or at the next prompt, and needs a harness-failed call first. It is still the stated property ("ignored after two minutes") not holding, and Recommendation: remove the entry that belongs to the reporting write. Keep Principle: release what you acquired, not whatever is at the head of the queue. Not blocking: the commit is a clear improvement on 🟢 Suggestion: the new Claude Code plugin test does not pin the fix📁 The author's statement is accurate: the test passes with the fix reverted, because the second call is refused by 🟢 Suggestion: the uninstall warning has no test📁 The installer suite covers the byte-comparison removal but not the new warning. One assertion on stderr in the existing no-record test would pin it. Inherent limits, acceptable
RecommendationAPPROVE. All four second-pass items are addressed and no blocking defect remains. Fix the |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review 2): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Third pass addressed
Suites: skill package 223 passed; Claude Code plugin 35 passed; plugin type-check clean. Re-review: not needed. The change is the one-line release the reviewer specified, with its test, plus a comment and an assertion. |
|
Merged current |
|
Merge queue: #3650 was taken out of the queue — it conflicts with main in: packages/skill/plugins/claude-code/hooks/register.ts. Merge or rebase origin/main, resolve the conflicts, push, and re-run |
…ion, and an instructions block for harnesses without one
bd8ae02 to
29a843e
Compare
Closes #3546. Implements ADR-093 §5 and §6.
What this does
plugins/pi/index.ts) and OpenCode plugin (plugins/opencode/nodespace.ts). Both are hooks around one shared module,plugins/shared/nodespace-session.ts, which does what the Claude Code plugin does: checks the CLI and daemon, resolves the project, builds the system prompt section, names skill-list changes, and watches the item being worked on. It imports nothing and takes three things from the harness (run a command, read the environment, a clock).$CODEX_HOME/AGENTS.md) and Antigravity (~/.gemini/config/AGENTS.md): one block between HTML-comment markers. Reinstall replaces it in place; uninstall removes it and leaves every other byte.~/.config/opencode(XDG_CONFIG_HOMEmoves it). Each plugin installs where its harness loads code from. The install record gainsplugin_filesandinstructions_file.statussays per harness whether the plugin or the block is installed, andnodespace skill statusprints it.scripts/uninstall.shdrops its hand-kept folder list and callsnodespace skill uninstall.nodespace uninstallremoved its bin directory before looking there for the skill installer, so it never removed the skill; the order is fixed.Things a reviewer should know
plugins/as a plugin, so the shared module installs one folder down. In the repository each plugin reaches it through a one-line re-export at the same relative path; the installer puts the module itself there. Tests check that every relative import of an installed plugin file is answered by an installed file.src/shipped-text.tsis the one source for the orientation and consent rules. Two copies exist beside it (the Claude Code plugin, and the shared module the other two install);shipped-text.test.tsfails when either differs.~/.gemini/config/AGENTS.mdas a global rules file) and from the docs embedded in the 1.1.27 binary (~/.gemini/config/is the global customization root).packages/skill, for the type-check only:@earendil-works/pi-coding-agentand@opencode-ai/plugin. Pi's pulls about 115 packages into the lockfile.Verification
bun run --cwd packages/skill test: 213 passed. Both plugins are driven through their hooks over a fakenodespacecommand.bun run --cwd packages/skill quality:check: each plugin type-checks against its harness's published types.nodespace-cliunit tests: 179 passed.bun run quality:fixclean.bun run test:changed: frontend, scripts, skill, browser and generated-types tiers passed. It stopped atnode-types:check, which reads the docs working tree and fails there on an unrelated uncommitted edit (checkout_pathonproject); the Rust tier after it did not run.nodespace. In both: the plugin loaded with no flag or config, the section was in the system prompt of every request, a skill-list change reached the model, and a tool call was refused with the reason once the watched item changed. In OpenCode, with the skill in both its own and the Claude skills folder, it was listed once.Docs:
architecture/agent-session.mdin nodespace-docs has the delivery table.🤖 Generated with Claude Code