ossie icon indicating copy to clipboard operation
ossie copied to clipboard

feat(cli): add plugin invocation protocol

Open QMalcolm opened this issue 5 months ago • 2 comments

Stacked on #154

Summary

  • Adds Request, Response, and Issue JSON envelope types for the plugin stdin/stdout protocol
  • Adds Invoke(ctx, pluginDir, invoke, req, pluginStderr) — runs a plugin subprocess, pipes the request JSON to stdin, captures stdout as the response, and enforces a context timeout
  • A non-empty Issues slice in the response is not a Go error; the caller (defined in a later segment of work) will decide whether error-severity issues produce a non-zero exit code

QMalcolm avatar Jun 15 '26 17:06 QMalcolm

This is a stacked PR

  • https://github.com/open-semantic-interchange/OSI/pull/151
    • https://github.com/open-semantic-interchange/OSI/pull/154
      • https://github.com/open-semantic-interchange/OSI/pull/155 (👈🏻 you are here)
        • https://github.com/open-semantic-interchange/OSI/pull/156
          • https://github.com/open-semantic-interchange/OSI/pull/158

QMalcolm avatar Jun 16 '26 20:06 QMalcolm

LGTM, but some good follow ups for future for anyone interested:

  1. It will be great to support plugins directly reading the semantic model files.
  2. The execution contract for these plugins is something we should continue to evolve as support for query API lands.

Should be we track these as Issues ?

khush-bhatia avatar Jul 22 '26 22:07 khush-bhatia

LGTM, but some good follow ups for future for anyone interested:

1. It will be great to support plugins directly reading the semantic model files.

2. The execution contract for these plugins is something we should continue to evolve as support for query API lands.

Should be we track these as Issues ?

I definitely think we should track (1) as an issue. I'm not sure exactly how we want to do this long term. Having the CLI handle read/write means that each plugin doesn't need to implement handing that with the OS, and ensures that glob based file lookup is always handled the same regardless of plugin used. However for sufficiently large semantic layers, it will probably be meaningfully impactful if the plugins handle file system read/write themselves.

For item (2), if we have specific areas (like protocol spec for query API), those would probably be good to create issues to track 🙂

QMalcolm avatar Jul 23 '26 22:07 QMalcolm