You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Docs: documentation code is never executed, and two published examples do not run #52
Extract every runnable Markdown block into docs/examples/, and include it by
literal reference. That reuses the mechanism which already exists and which
already has a test.
Correct the two broken snippets.
Depends on
#35. The settings example becomes correct only after that item lands.
Acceptance criteria
The suite fails when a published snippet stops working.
Scope boundary, recorded after measuring the documentation surface for #44.
This issue is about the code in the documentation: its criterion is "The
suite fails when a published snippet stops working". A separate finding is
about coverage of the documentation: 46 names in nanopynix.__all__ have
no page, and 22 of those are the nanopynix_bindings surface.
Those are not the same job, and they are not merged:
This issue stays as it is. It waited on #35, which is now closed, so it is a
harness plus the two broken snippets. Folding the coverage work in would hold
that behind a reference-writing task and would give this issue two acceptance
criteria that cannot be met together.
Done, with a different mechanism and a different count
Three snippets were broken, not two, and one of them in four ways
README.md is worse than the issue says. Measured against the live API:
what it published
why it fails
Session(config={"max-jobs": "4"})
no engine has ever had a config parameter
async with at module level
SyntaxError; the block is not valid Python
store.get_store_dir(GetStoreDirRequest())
no such method. It is await store.store_dir()
await root.force(), then attrs["name"]
AsyncValue has neither force nor __getitem__
A third broken snippet, not listed here:docs/nanopynix/index.md:19
called await hello.force_json(). No such method; it is to_python(). That
was the quick start on the documentation index.
And one listed snippet is no longer broken. NixSettings(max_jobs=4, trusted=True, pure_eval=True) constructs fine now -- #35 fixed it, and this issue's dependency on #35 is satisfied rather than
outstanding.
The published quick start taught a shape that crashes
Writing the index snippet as a real program surfaced this. asyncio.run(main())
at module level raises:
RuntimeError: An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
The rpc engine starts its worker with the multiprocessing forkserver, and
multiprocessing refuses to start a child while the main module is still
importing. So if __name__ == "__main__": is required here, not a
convention -- and the index published the form without it. Both the example
and the page now say why.
Mechanism: a mirror, not literalinclude
The issue suggests including each block by literal reference. That cannot
cover README.md, which is one of the two snippets this issue is about:
GitHub renders the README and does not process Sphinx directives.
So every runnable block is a view of a region of an example that runs:
an example marks a region with # region: <name> / # endregion: <name>;
a page puts <!-- example: <file>#<region> --> directly above the fence --
invisible in both renderers;
tests/meta/test_doc_snippets.py asserts the block equals that region,
dedented, and tests/nanopynix/test_examples.py runs the example.
Both halves are needed. Execution alone lets a page drift from the code it
claims to show. Equality alone proves two copies of something broken agree.
Dedenting is what keeps the pages readable: a four-line snippet can come from
the middle of an async def main() instead of being padded into a whole
program.
Coverage
Seven Python blocks exist across the README and docs/. Five now mirror a
running example: the README quick start, the index quick start, both settings.md blocks, and the stores.md model block. Two are in a ledger with
a reason -- namespace.md needs an unprivileged user namespace and writes to
the host daemon store, and store.md is two lines that need a built tofu
binary in a relocated store.
The ledger asserts both directions, so an entry whose block is gone fails and
gets deleted.
New files
docs/examples/quickstart_example.py, hello_example.py, stores_example.py,
plus two regions in the existing settings_example.py.
Red-before-green: changing one word of the README block fails test_every_published_snippet_matches_the_code_that_runs.
Activity
Lillecarl commentedon Aug 1, 2026
Scope boundary, recorded after measuring the documentation surface for #44.
This issue is about the code in the documentation: its criterion is "The
suite fails when a published snippet stops working". A separate finding is
about coverage of the documentation: 46 names in
nanopynix.__all__haveno page, and 22 of those are the
nanopynix_bindingssurface.Those are not the same job, and they are not merged:
than searching for text, and corrects fourteen one-line cases.
This issue stays as it is. It waited on #35, which is now closed, so it is a
harness plus the two broken snippets. Folding the coverage work in would hold
that behind a reference-writing task and would give this issue two acceptance
criteria that cannot be met together.
Lillecarl commentedon Aug 2, 2026
Done, with a different mechanism and a different count
Three snippets were broken, not two, and one of them in four ways
README.mdis worse than the issue says. Measured against the live API:Session(config={"max-jobs": "4"})configparameterasync withat module levelSyntaxError; the block is not valid Pythonstore.get_store_dir(GetStoreDirRequest())await store.store_dir()await root.force(), thenattrs["name"]AsyncValuehas neitherforcenor__getitem__A third broken snippet, not listed here:
docs/nanopynix/index.md:19called
await hello.force_json(). No such method; it isto_python(). Thatwas the quick start on the documentation index.
And one listed snippet is no longer broken.
NixSettings(max_jobs=4, trusted=True, pure_eval=True)constructs fine now --#35 fixed it, and this issue's dependency on #35 is satisfied rather than
outstanding.
The published quick start taught a shape that crashes
Writing the index snippet as a real program surfaced this.
asyncio.run(main())at module level raises:
The rpc engine starts its worker with the multiprocessing forkserver, and
multiprocessing refuses to start a child while the main module is still
importing. So
if __name__ == "__main__":is required here, not aconvention -- and the index published the form without it. Both the example
and the page now say why.
Mechanism: a mirror, not
literalincludeThe issue suggests including each block by literal reference. That cannot
cover
README.md, which is one of the two snippets this issue is about:GitHub renders the README and does not process Sphinx directives.
So every runnable block is a view of a region of an example that runs:
# region: <name>/# endregion: <name>;<!-- example: <file>#<region> -->directly above the fence --invisible in both renderers;
tests/meta/test_doc_snippets.pyasserts the block equals that region,dedented, and
tests/nanopynix/test_examples.pyruns the example.Both halves are needed. Execution alone lets a page drift from the code it
claims to show. Equality alone proves two copies of something broken agree.
Dedenting is what keeps the pages readable: a four-line snippet can come from
the middle of an
async def main()instead of being padded into a wholeprogram.
Coverage
Seven Python blocks exist across the README and
docs/. Five now mirror arunning example: the README quick start, the index quick start, both
settings.mdblocks, and thestores.mdmodel block. Two are in a ledger witha reason --
namespace.mdneeds an unprivileged user namespace and writes tothe host
daemonstore, andstore.mdis two lines that need a builttofubinary in a relocated store.
The ledger asserts both directions, so an entry whose block is gone fails and
gets deleted.
New files
docs/examples/quickstart_example.py,hello_example.py,stores_example.py,plus two regions in the existing
settings_example.py.Red-before-green: changing one word of the README block fails
test_every_published_snippet_matches_the_code_that_runs.perf(ci): give the ASAN job the tests that ASAN can report on
perf(ci): give the ASAN job the tests that ASAN can report on
docs: make every published snippet a view of code that runs
perf(ci): give the ASAN job the tests that ASAN can report on