Skip to content

docs: adopt Jupyter notebooks for all cookbooks - #94

Merged
alexey-temnikov merged 6 commits into
mainfrom
contributing-notebook-convention
Oct 5, 2026
Merged

alexey-temnikov merged 6 commits into
mainfrom
contributing-notebook-convention

Conversation

@MatthiasHowellYopp

@MatthiasHowellYopp MatthiasHowellYopp commented Aug 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This makes Jupyter notebooks (.ipynb) the format for all cookbooks, in every language. Prose and runnable code live in one file, so a reader runs the cells as they read and CI runs the same code the reader runs. Jupyter has kernels for every language this repo uses (Python is built in; Go, TypeScript/JavaScript, and Java come from community kernels), so there's no need for a different format per language.

What changed in CONTRIBUTING.md

  • Cookbook Format — new section: cookbooks are notebook series in any language. A short kernel table maps each language to its Jupyter kernel (ipykernel, gophernotes, tslab, IJava).
  • Cookbook Content Requirements — the authoring rules (required files, chapter structure, mandatory elements, security callout, Valkey startup, How It Works, config reference) are now stated once and framed as notebook cells, so they apply to every chapter.
  • Cookbook Structure — one language-agnostic layout: notebook chapters plus the support files a notebook can't carry (dependency manifest, docker-compose.yml, optional shared helper, .gitignore) in the same directory, with no separate sample/ subtree. Adds notebook content rules (cleared/reproducible outputs, no secrets in outputs, .ipynb nav links).
  • CI Validation — cookbooks are validated by running every notebook end-to-end; a cell that raises fails the build.
  • Sample guidelines reconciled with Vendor Neutrality — the default path must run for free (no paid account, credentials, or special hardware). Paid or specialized capabilities (e.g. a GPU or paid API) are optional, clearly-labeled extensions, never the only path.

Notes

  • No cookbook content changes here. This is the policy and structure update only; cookbook PRs follow this convention.
  • markdownlint passes on the changed content. The pre-existing MD060 table-style findings elsewhere in the file are unrelated and left untouched.

Establish notebooks (.ipynb) as the format for Python cookbooks, with
markdown chapters + sample/ retained for other languages. Add shared
Cookbook Content Requirements so authoring rules apply across both
formats, describe the notebook directory layout (notebooks plus
requirements.txt/docker-compose.yml sidecars, no separate sample/), and
require CI to execute every notebook end-to-end. Reconcile the sample
guidelines with vendor neutrality: the default path must run for free;
paid or specialized capabilities are optional, clearly-labeled
extensions.

Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
Jupyter has kernels for every language this repo uses (Python, plus Go,
TypeScript/JavaScript, Java via community kernels), so drop the
per-language notebook-vs-markdown split. All cookbooks are now notebook
series regardless of language. Collapse the two structure sections into a
single language-agnostic Cookbook Structure (with a per-language kernel
table), make the content requirements notebook-only, and rework the
Sample Code section into a notebook-native Runnable Code & CI section.

Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
@MatthiasHowellYopp MatthiasHowellYopp changed the title docs: adopt Jupyter notebooks for Python cookbooks docs: adopt Jupyter notebooks for all cookbooks Aug 26, 2026

@Jonathan-Improving Jonathan-Improving left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review — docs: adopt Jupyter notebooks for all cookbooks

Scope: single-file docs/policy change to CONTRIBUTING.md (+151/-72). No .ipynb, source, or GLIDE API code is added by this PR, so there is no notebook cell code to validate against the GLIDE SDK. The change is well-organized and the security posture is actually strengthened (explicit no-auth/TLS-localhost-only callout; "never commit secrets/tokens/machine paths in notebook outputs").

Verified independently:

  • All 8 internal anchor links (#cookbook-structure, #cookbook-content-requirements, #notebook-content-structure, #vendor-neutrality, …) resolve to real header slugs — no broken cross-links introduced.
  • All .ipynb/.md link references in the diff are illustrative relative examples, not real targets.

A few consistency gaps are worth resolving before merge (see inline comments). None are blocking.

Findings: 1 Medium, 1 Low–Medium, 1 Low, 1 Tidy.


Process note (transparency): the CAO orchestration server was unreachable during this run (port 9889 refused), so the specialized reviewer sub-agents, the independent Haiku nitpick-filter pass, and the independent spot-check audit could NOT be spawned. This review was conducted directly across all reviewer lenses (docs/domain, DRY, anti-pattern, link integrity, security) with grep-confirmed line numbers, but it lacks the independent multi-agent cross-check the full pipeline provides. Jira could not be searched (no Jira CLI/MCP access in this environment) and the PR links no GitHub issue, so upstream acceptance criteria were taken from the PR description only.

Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md
Comment thread CONTRIBUTING.md Outdated
Comment thread CONTRIBUTING.md
└── ...
```

### Directory Naming

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Tidy — optional] New ### Directory Naming heading creates a duplicate slug.

This section adds a third ### Directory Naming heading (also under Demo Structure and Sample App Structure). GitHub auto-suffixes duplicate slugs (#directory-naming-1, -2), so no cross-link is broken today and nothing here targets these anchors. Purely a note: if a future doc links to a specific "Directory Naming" section, the suffixed slugs are brittle. No action required — recorded for awareness only.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, thanks. I'm leaving it as-is: nothing links to those anchors today, and renaming the heading would be churn for no current benefit. Recording it here so we catch it if a future doc needs to deep-link a specific Directory Naming section.

Address Jonathan's QA review on the notebook-convention rewrite:

- Promote the dependency manifest and docker-compose.yml into the
  'Every cookbook must have' table; they were treated as required
  everywhere else but listed only as prose, so the self-check table
  read as if they were optional.
- Make Compose the canonical Valkey startup for cookbooks: Step 1 and
  the Valkey Startup section now use 'docker compose up -d --wait'
  (matching the required compose file) instead of a conflicting bare
  'docker run', and note that --wait needs a healthcheck to block.
- Reduce the .gitignore table row to a pointer to the dedicated
  subsection so the guidance has a single source of truth.

Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
Make a single self-contained notebook the default cookbook (no separate
README; the opening cell is the index), drop the mandatory Step N headings and
numbered-series assumptions in favor of topical headings, and reserve the
numbered series + README index for genuinely large multi-part cookbooks.
Codify the operational patterns the LMCache cookbook proved out: an optional
config-reference file and test file, a fail-early preflight cell, and per-run
nonces for reproducible cache demos.

Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
Python cookbooks manage dependencies with uv: a committed pyproject.toml and
uv.lock rather than a bare requirements.txt, with requires-python pinned so the
interpreter is reproduced alongside the packages, uv listed in the cookbook's
Prerequisites, and uv sync / uv run for setup. Scope the dependency-manifest
references so the Python example is pyproject.toml + uv.lock while the other
languages (go.mod, package.json, pom.xml) are unchanged.

Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
Applies #100 on top of the uv requirement:

- CI starts Valkey as a service container on 127.0.0.1:6379 (VALKEY_HOST/PORT),
  not the cookbook's docker-compose.yml — the wording now says so.
- Adds the heavy-runtime exception: a cookbook whose stack can't run on a
  hosted runner commits .ci-structural-only; CI runs lint and the structural
  tier only, the default path must still run locally free, and authors still
  run the notebook end-to-end before submitting.
- Review checklist now asks for the concept/prereqs/how-to-run in the README
  for demos and sample apps, and the notebook's opening cells for cookbooks.

Applied cleanly over the uv acceptance criterion (different sections).

Signed-off-by: MatthiasHowellYopp <matthias.howell@improving.com>
@alexey-temnikov
alexey-temnikov merged commit 649e48e into main Oct 5, 2026
3 checks passed
@alexey-temnikov
alexey-temnikov deleted the contributing-notebook-convention branch October 5, 2026 12:27
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.

3 participants