Skip to content

feat(example): Notebook composite demonstrating advanced composite-child#118

Merged
astrojerms merged 1 commit into
mainfrom
feat/example-advanced-kind
Jul 8, 2026
Merged

feat(example): Notebook composite demonstrating advanced composite-child#118
astrojerms merged 1 commit into
mainfrom
feat/example-advanced-kind

Conversation

@astrojerms

Copy link
Copy Markdown
Owner

Why

Follow-on to #117. That PR added the ownerKind / advancedNote handshake field so external plugins can flag composite-children — but no plugin actually exercised it, so there was no copy-paste reference for plugin authors.

What

Make plugins/example a reference for a plugin composite:

  • New Notebook kind — a Planner composite. Plan expands a Notebook into one Note child per spec.pages[], stamping the documented owner labels (openctl.io/owner-kind / owner-name) on each child. Notebook is file-backed (a .notebook marker lists its children), so its Apply/Get/List/Delete are complete CRUD. The plugin creates its child Notes directly in Apply — there is no controller-side auto-expansion for external composites (ChildDispatcherFrom is k3s-only), so Plan here feeds the UI children-graph while Apply does the real work.
  • Note declared a composite-child of Notebook in the handshake (OwnerKind: "Notebook" + AdvancedNote). The UI flags it "advanced" and nudges toward creating a Notebook — entirely from the backend signal, no client-side list. Note stays directly authorable.
  • e2e coverage: the external subprocess e2e test now asserts the advanced declaration survives the real wire round-trip into AdvancedKindDescriber (Note → Notebook).
  • Docs: docs/plugin-protocol.md documents OwnerKind/AdvancedNote and points at the Notebook→Note composite.

No production code changes — this is example/plugin + test + docs only.

Local CI

gofmt / go vet / staticcheck / golangci-lint / modernize (generated-filtered) / go test ./... / go test -race (example + external) all green.

…e-child

The pluginproto ownerKind/advancedNote handshake field (from #117) had no
plugin exercising it. Make plugins/example a reference for it.

- New Notebook kind: a Planner composite that expands (via Plan) into one
  Note child per spec.page, stamping owner labels on each child. Notebook
  itself is file-backed (a .notebook marker lists its children) so its
  Apply/Get/List/Delete are complete CRUD; the plugin creates its child
  Notes directly (there's no controller-side auto-expansion for external
  composites — Plan feeds the UI children graph).
- Note is declared a composite-child of Notebook in the handshake
  (OwnerKind + AdvancedNote), so the UI flags it "advanced" and nudges
  toward creating a Notebook — driven entirely by the backend signal, no
  client-side list. Note stays directly authorable.
- The external e2e test now asserts the advanced declaration survives the
  real subprocess wire round-trip into AdvancedKindDescriber.
- docs/plugin-protocol.md documents OwnerKind/AdvancedNote and points at
  the Notebook->Note composite.
@astrojerms astrojerms merged commit 799e2ac into main Jul 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant