GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — [contributor setup 2] Fold the contributing guides into CONTRIBUTING.md and remove AGENTS.md and STYLE_GUIDE.md by edwinyyyu · Pull Request #1867 · MemMachine/MemMachine Conversation
|
| PR | Change |
|---|---|
| #1869 (merged) | Paid-API integration tests read test-only variables |
| #1867 (this PR) | Fold the contributing guides into CONTRIBUTING.md; remove AGENTS.md and STYLE_GUIDE.md |
This PR's eleven commits, bfa1bab..d7afd15, are on main after #1869's merge (377510d).
CONTRIBUTING.md says once what the three contributing guides each repeated: the issue-first workflow, uv setup, the checks CI runs (Ruff, ty, and pytest), and the pull request steps. It links to docs/README.md for previewing the documentation site, to maintainers/running-unit-tests.md for selecting tests, and to the TypeScript client's README for its commands.
The checks are CI's commands. From the repository root, pytest stops at a collection error, because integrations/strands-memmachine needs strands and no extra installs it. ty check packages reports two unresolved spacy imports from the optional multihop group. So the guide gives pytest the package test directories and type checks each package with --project, and the whole-suite and keyword commands in maintainers/running-unit-tests.md name the same directories. The keyword example's create_memory matched no test, so it now uses add_memory.
Integration tests with a server of your own: most integration tests start their databases in Docker. The Checks section lists the rest and when each skips. The NebulaGraph tests (NEBULA_HOST, NEBULA_USER, NEBULA_PASSWORD) and the Python client's tests (MEMORY_BACKEND_URL) skip when their server can't be reached. The tests on an OpenAI-compatible server such as Ollama skip only when OLLAMA_HOST is unset, and expect a base URL such as http://localhost:11434/v1, not Ollama's own host:port form.
Paid-API tests: the Checks section carries [contributor setup 1] Read paid-API test credentials from test-only variables #1869's text from CONTRIBUTING-CORE.md. It lists the MEMMACHINE_TEST_* variables and warns that the tests call the real APIs, billed to those keys.
Dropped as stale or unverified: three steps from CONTRIBUTING-DOCS.md:
mint.json: the repository has docs/docs.json instead.mintlify install: the current CLI's README lists no such command.docs/README.md links to Mintlify's installation guide for the current steps. Also dropped: the claim that unsigned commits fail GitHub Actions, since no workflow checks signatures. The signing requirement itself stays.
Style: a Style section in CONTRIBUTING.md gives the rules Ruff and ty don't check: names, types, suppression comments, library use, comments and docstrings, factoring and caching, and test markers. It says existing code may not match them, which doesn't exempt new code.
docs/README.md: Handoff files for Mintlify and Site skills #1706 added it so that anyone can get up to speed with documentation work. Most of it copied Mintlify's setup steps, and its Node requirement had drifted: it said 18 or higher, but the mint CLI refuses to start below 20.17 or on Node 25. It now links to Mintlify's installation guide, which states the current requirement and covers installing Node, and keeps only what this repository decides: run mint dev from docs/, and the checks docs CI runs there.
STYLE_GUIDE.md: its Ruff and ty guidance is in the Checks section, and its Markdown rules named markdownlint, which nothing runs. The PR template's style checkbox now points at CONTRIBUTING.md, whose Style section replaces the file's principles, and the docs community page and .dockerignore drop their entries for the file.
AGENTS.md: its commands repeat CONTRIBUTING.md and the TypeScript client's README. Of its conventions, Ruff and ty enforce the formatting, import, naming, and annotation rules. Its other preferences, such as pydantic models for structured data, small functions, pytest fixtures, and catching broad exceptions only at API boundaries, are not carried over.
Part of #1652. Two items stay open:
USAGE.md: [Docs]: Too many top-level repo files #1652's fix for it is a recommended usage path simple enough to fit in the README, which is a product change (related: memmachine-configure installs a JDK and Neo4j from downloaded archives #1866).alembic.ini: [Docs]: Too many top-level repo files #1652 defers it to Schema provisioning runs from every process's boot path: create_all races on cold boot and never evolves a table, Alembic runs destructive migrations on first use #1570, and [schema migration 1/2] Add memmachine-server migrate, which creates every configured store's schema before servers start #1825 gives it one section per store lineage.Manual verification
At d7afd15, after the second review: the two new commits change only the integration-test bullets in CONTRIBUTING.md and the commands in maintainers/running-unit-tests.md, which now all use uv run pytest. Two of them, the test_chunk_text and -k add_memory commands, pass as written (1 and 11 passed).
At 4695aff: the new commit changes only docs/README.md and one line of CONTRIBUTING.md. The README's three links return 200, and its commands are the ones docs-checks.yml runs in docs/. The Node bounds come from the CLI's own startup check (@mintlify/cli 4.0.1789, bin/helpers.js), and Mintlify's installation guide states v20.17.0 or newer.
At 29c2d40, rebased onto main after [contributor setup 1] Read paid-API test credentials from test-only variables #1869 merged: the PR's diff is identical to the previous head's (git diff 862a08309 774946d01 equals git diff 377510d43 29c2d4001), because main has changed none of the files this PR touches. git grep still finds no reference to the removed files.
At 774946d, after review: the five new commits change only CONTRIBUTING.md and maintainers/running-unit-tests.md. uv run pytest -k add_memory packages/server/server_tests packages/client/client_tests passes (11 passed). The integration-test variables, defaults, and skip conditions match the NebulaGraph, Ollama, and client test fixtures.
At 797dce5, rebased onto [contributor setup 1] Read paid-API test credentials from test-only variables #1869: the code is identical to [contributor setup 1] Read paid-API test credentials from test-only variables #1869's (git diff 862a08309 797dce5f9 -- packages .github/workflows is empty), so [contributor setup 1] Read paid-API test credentials from test-only variables #1869's checks cover it. Its documentation differs from the previous head, 4a95f4a, only in the integration-test paragraph.
At d5a39a8, the previous base, after uv sync --all-extras: ruff format --check, ruff check, and the three ty check --project commands pass, and uv run pytest packages/server/server_tests packages/client/client_tests passes (2386 passed, 3 skipped).
Every relative link and anchor in CONTRIBUTING.md resolves, and its external links return 200.
git grep finds no reference to the removed files.
Test Results: as listed above.
Adding testpaths to pytest's configuration would make a plain uv run pytest work from the root again. That is a configuration change, so it is not in this PR.
🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
4a95f4a to
797dce5
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approving at 797dce5, this PR's own three commits (1231881..797dce5). #1869's commit is covered in my review on #1869.
This reads well, and the commands now match what CI runs. One non-blocking nit:
maintainers/running-unit-tests.md, "Running Tests with a Keyword": pytest -k "create_memory" still runs from the root with no path, so it hits the same collection error in integrations/strands-memmachine/tests/test_tool.py (it imports strands at module level) that this PR fixes in "Running All Tests". -k only filters after collection, so the import error still stops the run. Giving it the same two directories, e.g. pytest -k "create_memory" packages/server/server_tests packages/client/client_tests, keeps every command in that file runnable from the root.Verified: the Checks section's Ruff, ty (--project per package) and pytest commands are the ones lint.yml and pytest.yml run, and those jobs skip drafts and re-run on ready_for_review as the guide says; -m integration overrides the addopts default; every relative link resolves (including the ts-client README's Development heading); nothing at head still references the removed files; and the dropped steps really are stale (no signature check in any workflow, no pre-commit or markdownlint config, docs/README.md has the current mint steps).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| All contributions, regardless of type, should follow this general workflow: | ||
| Integration tests are marked `integration` and start their databases in |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not every integration test gets its database from Docker. The NebulaGraph tests connect to an external server at NEBULA_HOST (default 127.0.0.1:9669, NebulaGraph Enterprise 5.0 or later) and skip when they can't reach it, and the Ollama-backed tests skip unless OLLAMA_HOST is set. A contributor who runs -m integration from this guide will see those skip and won't know why. Could you mention both variables here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added in 783e3fc. The paragraph now says most integration tests start their databases in Docker and lists the ones that connect to a server you run, which skip when they can't reach it:
NEBULA_HOST, with NEBULA_USER and NEBULA_PASSWORDOLLAMA_HOST, which has no defaultMEMORY_BACKEND_URL, for the Python client's tests🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| - [ ] I have signed the commit(s) within this pull request | ||
| - [ ] My code follows the style guidelines of this project (See STYLE_GUIDE.md) | ||
| - [ ] My code follows the style guidelines of this project (See CONTRIBUTING.md) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
CONTRIBUTING.md has no style guidelines now, only the Ruff, ty and pytest commands under Checks. The principles from STYLE_GUIDE.md and AGENTS.md (meaningful names, documenting public APIs, raise ... from err, catching broad exceptions only at API boundaries, the slow/integration markers) weren't moved anywhere. If Ruff and ty are meant to be the whole style guide, this checkbox could say so. Otherwise a short style section in CONTRIBUTING.md would give it something to point at.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Added a Style section to CONTRIBUTING.md, so the checkbox has something to point at. It gives the rules Ruff and ty don't check, including spelled-out names, what docstrings hold, and the slow and integration markers. raise ... from err stays with Ruff, whose B904 rule requires it inside except blocks. The broad-exception rule from AGENTS.md is left out, because broad catches have legitimate uses away from API boundaries, such as cleanup that logs a secondary failure while the original error propagates. The section also says existing code may not match the rules, which doesn't exempt new code from them.
🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fixed the 🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
CONTRIBUTING-CORE.md and CONTRIBUTING-DOCS.md each repeated the fork, branch, sign, and pull request steps of CONTRIBUTING.md. What remains of them fits in one file: the issue-first workflow, uv setup, the checks CI runs (with the test-only variables for the tests that call paid APIs), and links to docs/README.md for previewing the documentation site and to maintainers/running-unit-tests.md for selecting tests. The checks are the commands CI runs. From the repository root, `pytest` stops at a collection error in integrations/strands-memmachine, whose `strands` dependency no extra installs, and `ty check packages` reports the optional multihop group's spacy imports as unresolved. So the guide gives pytest the package test directories and type checks each package, and running-unit-tests.md's whole-suite command names the same directories. CONTRIBUTING-DOCS.md's Mintlify steps pointed at mint.json, which the repository doesn't have (it has docs/docs.json), and ran `mintlify install`, which the current CLI's README doesn't list. Its pre-commit hooks have no configuration in the repository. docs/README.md has the current `mint` steps. The claim that unsigned commits fail GitHub Actions is dropped: no workflow checks signatures. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
Its commands and conventions repeat CONTRIBUTING.md, the Ruff and ty configuration, and the TypeScript client's README. It has gone without updates since March 2026, and its `uv run pytest` and `ty check packages` commands fail from the repository root. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
Its tool guidance, Ruff and ty, is in CONTRIBUTING.md's Checks section. Its principles are generic, and its Markdown rules name a linter, markdownlint, that nothing runs. The pull request template's style checkbox points at CONTRIBUTING.md, and the documentation site's community page and .dockerignore drop their entries for the file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
Most integration tests start their databases in Docker. The NebulaGraph tests connect to NEBULA_HOST and skip when it is unreachable, the tests on an OpenAI-compatible server skip unless OLLAMA_HOST is set, and the Python client's tests skip without a MemMachine server at MEMORY_BACKEND_URL. The Checks section now names each one and its variables. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
From the repository root, `pytest -k` with no path still collects integrations/strands-memmachine and stops at its import error, since -k filters only after collection. The example now names the server and client test directories, like the whole-suite command. Its keyword, create_memory, matched no test; add_memory matches eleven. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
The pull request template's style checkbox points at CONTRIBUTING.md, which held only the Ruff, ty, and pytest commands. The Style section gives the rules those tools don't check: spelled-out names and consistent function prefixes; no Any, cast, or object types and no suppression comments except where a third-party library forces them; public library APIs, async clients, and declared dependencies; broad exception handling at API boundaries, carried over from AGENTS.md; what comments and docstrings hold; when to factor out duplicated code or add a cache; and the integration and slow test markers. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
Some existing code breaks the Style section's rules, and following the surrounding code would carry that into new code. The section now says the rules apply to new code regardless. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
Removed as too specific or not valid everywhere: the is_*/validate_* naming pair (functions that share a prefix still behave alike), no docstrings on @OverRide methods, comments that skip their callers, catching broad exceptions only at API boundaries, and no one-line helpers. The comments rule now keeps out references that can go out of date rather than every issue or pull request reference. Standard abbreviations such as id and url are allowed in names, and the Any, cast, object, and suppression exceptions cover Python's own API, such as `other: object` in __eq__, as well as third-party libraries'. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
774946d to
29c2d40
Compare
MemMachine#1706 added the README so that anyone can get up to speed with documentation work. Most of it copied Mintlify's own setup steps, and one of them had already drifted: it asked for Node 18 or higher, while the mint CLI refuses to start below 20.17 or on Node 25. Mintlify's installation guide states the current requirement and covers installing Node and the CLI, so the README links to it instead of copying it, which still serves the same readers. What stays is what only this repository decides: run `mint dev` from docs/, which the old wording called "the project root directory", and the checks docs CI runs there. Cloning is in CONTRIBUTING.md, and the CLI's other commands and options are in its own help. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
| a server you run, and skip when they can't reach it: | ||
|
|
||
| - **For Core Code Contributions**: If you'd like to contribute code, fix a bug, | ||
| or propose a new feature, please read our | ||
| [**Core Contribution Guide**](CONTRIBUTING-CORE.md). | ||
| - **For Documentation Contributions**: If you want to improve a typo, correct a | ||
| broken link, or add a new guide, please read our | ||
| [**Documentation Contribution Guide**](CONTRIBUTING-DOCS.md). | ||
| - NebulaGraph Enterprise 5.0 or later, at `NEBULA_HOST` (default | ||
| `127.0.0.1:9669`), with `NEBULA_USER` and `NEBULA_PASSWORD` | ||
| - An OpenAI-compatible server serving `qwen3:8b`, such as Ollama, at the | ||
| base URL in `OLLAMA_HOST`, which has no default |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The Ollama tests don't skip when the server is unreachable. They skip only when OLLAMA_HOST is unset (packages/server/server_tests/memmachine_server/conftest.py:147-149), and the value goes straight to AsyncOpenAI as the base URL.
Ollama itself reads OLLAMA_HOST in host:port form (for example 127.0.0.1:11434, with no scheme and no /v1), so many Ollama users already have it set. For them, -m integration fails with connection or URL errors in the openai_chat_completions params of test_memmachine_integration.py and test_semantic_llm_integration.py instead of skipping. The same happens when the variable is set and the server is down.
Could this say the tests skip only when OLLAMA_HOST is unset, and give the expected format, e.g. http://localhost:11434/v1?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d4d37d4. Each bullet now says when its tests skip. The Ollama one gives the base URL form, http://localhost:11434/v1, and says these tests skip only when OLLAMA_HOST is unset, so a server that is down, or Ollama's own host:port form, fails them.
🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ```bash | ||
| pytest | ||
| pytest packages/server/server_tests packages/client/client_tests |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These commands use a bare pytest, but the Setup section linked above now only runs uv sync --all-extras. Since this PR removed the source .venv/bin/activate step, nothing puts the project's pytest on PATH. Someone following the guide gets command not found, or a system pytest without the workspace packages.
CONTRIBUTING.md uses uv run pytest. Could the commands here use it too, including the -k example further down?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d7afd15: all seven commands, the -k one included, now use uv run pytest.
🤖 Written by Claude Code (Claude Opus 5.5) on behalf of @edwinyyyu.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Re-reviewed at 4695aff. The keyword example from my first round is fixed, thanks. I checked Leo's two new threads against the code and agree with both, so I'll hold my re-approval until they're in:
CONTRIBUTING.md, Ollama bullet (Leo's thread on line 71): openai_chat_completions_llm_config in packages/server/server_tests/memmachine_server/conftest.py skips only when OLLAMA_HOST is empty, so this bullet doesn't belong under "skip when they can't reach it". One more data point for the format line: where the value goes through the server's own config (the openai_chat_completions case of language_model_config in main/conftest.py), the base_url validator in language_model_conf.py rejects anything without a scheme, so Ollama's 127.0.0.1:11434 form fails at fixture setup with "Invalid base URL" rather than skipping. The repo's own DEFAULT_OLLAMA_BASE_URL already has the http://<host>:11434/v1 shape, so Leo's example matches it.
maintainers/running-unit-tests.md, bare pytest (Leo's thread on line 18): the Prerequisites link used to point at CONTRIBUTING-CORE.md, which offered a plain venv with source .venv/bin/activate; it now points at CONTRIBUTING.md#setup, where uv sync --all-extras is the only setup and nothing activates the venv. uv run pytest on all seven commands, the -k one included, makes the file match CONTRIBUTING.md.
Everything else from my last read still holds at this head: NebulaGraph skips on any connect failure, the client suite skips unless /api/v2/health answers at MEMORY_BACKEND_URL, leaving raise ... from err to Ruff holds (B selected, B904 not ignored), slow and integration are registered markers, and the docs/README.md commands are the ones docs-checks.yml runs. CI is green at head. Happy to approve once these two are in.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The NebulaGraph and client tests skip when their server can't be reached, but the tests on an OpenAI-compatible server skip only when OLLAMA_HOST is unset. The variable goes to the client and the server config as a base URL with a scheme, while Ollama reads its own OLLAMA_HOST as host:port. So a server that is down, or Ollama's form of the variable, fails these tests instead of skipping them. Each bullet now says when its tests skip, and the Ollama bullet gives the expected URL form. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
The guide's prerequisites link to CONTRIBUTING.md's Setup section, whose only step is `uv sync --all-extras`. Nothing there activates the project's virtual environment, so a bare `pytest` is either missing or a system pytest without the workspace packages. Every command now uses `uv run pytest`, as CONTRIBUTING.md does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Edwin Yu <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approving at d7afd15. Both things I held for are in: the Ollama bullet now says those tests skip only when OLLAMA_HOST is unset and fail on a down server or the host:port form, and its http://localhost:11434/v1 example has the scheme the server's base_url validator needs. Every command in running-unit-tests.md now goes through uv run, the -k one included, so the file matches CONTRIBUTING.md.
The NebulaGraph and client-server skip lines match the fixtures as I read them last round, and nothing else moved. CI is green at head.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
At least 2 approving reviews are required to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.