Repository navigation
Closed
Labels
source: nanopynixConcerns the nanopynix source
Description
Names that work are in no __all__, the two __all__ lists disagree in both
directions, and one exception class sits outside the taxonomy.
Evidence
- 20 names are importable from
nanopynixand absent from its__all__.
Among them:EvalError,EvalSessionClosedError,ForeignValueError,
InfiniteRecursionError,MissingArgumentError,LogCapture,
LogCollector,LogEvent,Derivation,BuildResult,EvalState,
DEFAULT_EXPERIMENTAL_FEATURES. - 3 exception classes defined in
exceptions.pyare absent from its
__all__:ListIndexError,MissingAttributeError,SettingNotLiveError.
The first two are innanopynix.__all__, so the two lists disagree in both
directions. WorkerDiedError(rpc/client/_pool.py:94) is a bareRuntimeError. It is
not aNixError, not anObjectMisuseError, and not in
nanopynix.__all__. A caller who writesexcept nanopynix.NixErroraround
an rpc call is not protected against the failure mode that the engine exists
to produce.Session.subscribe(self, callback: Any) -> Any
(rpc/client/session.py:345) is untyped, and the inproc engine's own
subscribereturnsBusSubscription(inproc/_impl.py:547). The two
engines disagree on the return type of a method that the parity ledger
treats as shared.Nix = Session(rpc/client/session.py:467), labelled "Backward-compatible
alias", is exported and used by one test.ROADMAP.mdsays backwards
compatibility is not a priority.inproc.Store.call(method, *args, **kwargs) -> Any(inproc/_impl.py:908)
is an untyped escape hatch with one caller, a test.
EvalError is the base of half the exception tree, and
except nanopynix.EvalError is what a caller reaches for first. It is
importable, it works, and it appears in no __all__ and in no generated
document. A name in that state is neither supported nor removable.
Scope
- Adopt one rule:
__all__is the public surface, and every entry has a
documented home. Add the names that belong. Make the rest private by a
rename or by removal. - Add an
EngineError(RuntimeError)base tonanopynix.exceptions, and put
WorkerDiedError(EngineError)under it. Export both fromnanopynix. Keep
nanopynix.rpc.WorkerDiedErroras an alias. State in the class docstring
that the inproc engine cannot raise it, and why. - Make
exceptions.__all__complete. - Type
Session.subscribeasWorkerClient.subscribealready is. - Delete
Nix, and update the one test. - Delete
inproc.Store.calland its test, or document it as unsupported. It
duplicates a surface thatAGENTS.mdsays was already retired on
CoreStore.
Acceptance criteria
A new tests/nanopynix/test_public_surface.py asserts, and passes:
- every name in
nanopynix.__all__resolves; - every public name importable from
nanopynixis in__all__; - every exception class in
nanopynix.exceptionsis in its__all__; - every name in
__all__appears indocs/nanopynix/api/.
That test is a few lines and it preve 8BD0 nts this class of drift entirely.
Compatibility
One deliberate break: deleting Nix = Session. Everything else adds a name or
adds a type.
Findings F6 and F9 of CODE_IMPROVEMENT_PLAN.md.
Metadata
Metadata
Assignees
Labels
source: nanopynixConcerns the nanopynix source
Activity
Lillecarl commentedon Jul 30, 2026
One more, found while building #57's allowlist from the class objects.
WrongNixTypeErroris exported and raised by nothing.nanopynix.__all__andexceptions.__all__both hold it, and no module innanopynix/srcraises it. Measured withrg -n "raise WrongNixTypeError" nanopynix/src/-- no hits. The only mentionsare two docstrings in
rpc/client/_session.pythat describe it as something aprevious design raised.
It also has the only constructor in the hierarchy that a message alone cannot
rebuild --
__init__(self, *, expected, actual), keyword-only. That made itthe single exclusion from #57's wire allowlist
(
exceptions._NOT_ON_THE_WIRE), which is a real cost paid for a class nobodyraises.
So it is the mirror image of the
EvalErrorcase above: that one works and isundeclared, this one is declared and is unreachable. Whichever way #44 settles
the two
__all__lists, this class needs a separate decision -- delete it, orraise it where the code currently raises a bare
TypeErrorfor the samesituation.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Lillecarl commentedon Aug 1, 2026
Measured against the current tree. Every claim still holds, and two of the
counts have grown.
Re-measured
nanopynix.__all__annotationsartifact, so 19 real namesexceptions.__all__WorkerDiedErroris a bareRuntimeErrorRuntimeError, Exception, BaseExceptionSession.subscribeuntypedNix = Sessionused by one testinproc.Store.callhas one callerThe nineteen:
Nothing in
__all__fails to resolve, so that half is purely additive.The drift is current, not historical
Two of the five missing exception classes were added this week:
EvaluatorAbandonedErrorby #66, andSettingOutOfScopeErrorby #56. The rateis about one name per feature.
SettingOutOfScopeErrorwas caught immediately by the wire allowlist intest_exceptions_classify.py, in the same commit that added it, because thatlist is restated as a literal. The same class of name went into
exceptions.__all__unnoticed. One had a guard and the other did not.Two notes for the implementation
Session.subscribeis a one-line change. It forwards toWorkerClient.subscribe, which is already typedCallable[..., None] -> BusSubscriptionatrpc/client/_pool.py:443. Copyingthat signature closes the parity gap with inproc exactly.
Deleting
Store.callremoves a parity-ledger row attests/nanopynix/test_engine_parity.py:195, where it is recorded as anaccepted inproc-only asymmetry. That touches #65.
Acceptance criterion 4 does not belong here
The fourth criterion says every name in
__all__appears indocs/nanopynix/api/, and calls the whole test "a few lines". Three of thefour are. The fourth is not:
automodule :members:, so a name is documented without appearing as text. A substringtest reports 78 missing; resolving the directives gives 46, and most of
the 78 are false.
nanopynix_bindings.*and have no page at all.Moved out, so this issue stays landable:
fourteen names that only need a missing
automoduleline.Three questions this issue owns
#71 found public names whose status is a decision, not a documentation gap:
set_manager_titleis public and lives innanopynix._process_title, aprivate module.
strip_ansiis re-exported from a third-party package of the same name. Does__all__promise a function this project does not own?init_libexpr,process_connectionandregister_store_implementationarelifecycle and extension points that
Sessionalready calls. Docs: the nanopynix_bindings surface has no reference page #72 is blockedon whether each gets a page or leaves
__all__.Related
#70 turns the conventions that are prose only into tests, and adds
tests/meta/. This issue keeps criteria 1 to 3; #70 does not touch__all__.Lillecarl commentedon Aug 1, 2026
Measurement from #70, recorded here because it is evidence for this issue and out of scope there.
tests/imports six names from thenanopynixtop level that are absent fromnanopynix.__all__:Each is reachable as
from nanopynix import <name>and each is missing fromthe export list, so this is a gap in
__all__rather than a gap in the module.The consumer side is already clean, and #70 now guards it:
tests/meta/test_consumer_surface.py::test_every_public_name_a_consumer_imports_is_exportedasserts that every name
pynix,ekn,nanopynix-helpersanddocsimportfrom the top level is exported. That test is green today. Extending the same
check to
tests/would fail on exactly the six names above, so it is one wayto close this part of the issue and keep it closed.
#70 also leaves a ledger for this issue to empty:
CONSUMER_PRIVATE_IMPORTSholdsnanopynix._typechecking.BEARTYPINGandnanopynix._typechecking.no_runtime_type_check. Promoting them here deletesboth entries, and the ledger test fails until they are deleted, so the two
cannot drift apart.
test(meta): give every self-check one home, and a map to find it
Lillecarl commentedon Aug 2, 2026
Corrections and decisions, before the commit
The counts moved. The issue said 20 names absent from
nanopynix.__all__and 3 exception classes absent from
exceptions.__all__. Measured on thistree: 19 real names plus
annotations, and 5 exception classes(
EvaluatorAbandonedError,ListIndexError,MissingAttributeError,SettingNotLiveError,SettingOutOfScopeError).annotationsis the bindingthat
from __future__ import annotationsleaves behind. It is a__future__._Feature, not an export, and the test excludes it by name withthat reason next to the filter.
The test lives in
tests/meta/, nottests/nanopynix/.tests/AGENTS.mdnow states the rule: a meta test reads the repository, it does not run it.
This one walks module objects and touches no store.
Criterion 4 belongs to #71. "Every name in
__all__appears indocs/nanopynix/api/" is exactly #71's subject, and #71 already records why atext search reports the wrong number: the docs use Sphinx autodoc, so the
check must resolve the directives. Doing it twice would give two answers.
The other three criteria are in
tests/meta/test_public_surface.py.Two extras the work turned up.
Session.subscribewas typed as part of a larger defect, not on its own.The two engines delivered different types through it: inproc emitted
models.LogEvent, rpc emitted the bare proto that class subclasses. Everysubscriber began by converting, and
eknreached intonanopynix_protofor a class to narrow against, because nanopynix exports the subclass and
not the base.
CallbackBus.emitnormalises now, so the type the signaturestates is the type a subscriber gets.
log_streamhad drifted into two different methods with one name. rpcbounded its buffer, discarded the oldest event and stopped on the teardown
marker; inproc used
math.inf, reported nothing and never stopped at all,because it never sent the marker. Both are now
nanopynix.logging.bus_log_stream. rpc also sent its marker after theteardown rather than inside the
finally, so a teardown that raised leftevery iterator waiting for an event that would not arrive.
feat(api): make the public surface say what it is, and both engines a…
Lillecarl commentedon Aug 2, 2026
039d772 lands everything in Scope and three of the four acceptance
criteria.
Refs, notCloses, because criterion 4 is not met here.Done:
nanopynix.__all__gained 19 names;nanopynix.exceptions.__all__gained 7.EngineError(RuntimeError)added,WorkerDiedError(EngineError)moved intonanopynix.exceptions, both exported.nanopynix.rpc.WorkerDiedErrorstillresolves and is the same class. The docstring states that inproc cannot
raise it, and why that is correct rather than a gap.
Session.subscribetyped on both engines, and the reason it was untypedfixed underneath it.
Nix = Sessiondeleted; the one test rewritten.inproc.Store.calldeleted, with its test and itsStore.call:inproc-onlyline in the engine parity ledger.
tests/meta/test_public_surface.py, six checks, each proven red beforegreen.
What is left: criterion 4 only, and #71 owns it. "Every name in
__all__appears in
docs/nanopynix/api/" is #71's whole subject, and #71 alreadyrecords the part that makes it non-trivial: the docs use Sphinx autodoc, so
the check must resolve the directives rather than search for text. Writing it
twice would produce two answers to one question. Close this issue when #71
lands, or now if you would rather #71 carry the criterion outright.
Gates:
check-lint,check-lint-strict,check-formatandcheck-typesallbuild. Full suite 1907 passed, 0 failed, 3 skipped.
feat(protocols): give Session the protocol it never had
refactor(api): let the consumers name the protocol, not rpc's classes
test(meta): give every public name a page, or an entry saying why not
Lillecarl commentedon Aug 2, 2026
Status, and what is left. Measured on
developat 253b0fc.Done, with a gate behind each one
EngineError(RuntimeError)andWorkerDiedError(EngineError)live innanopynix.exceptions, both exported.nanopynix.rpc.WorkerDiedErrorstill resolves.
exceptions.__all__is complete, andtests/meta/test_public_surface.pykeeps it so. That test caught thisexact omission once while it was being written.
Session.subscribereturnsBusSubscriptionon both engines. Theengines disagreed because
CallbackBus.emitpassed the model on one andthe bare proto on the other; the fix is at that one choke point.
Nix = Sessionis deleted.inproc.Store.callis deleted.Criterion 4 is now measured, and it is a ledger rather than a pass
#71 landed the check. It resolves the autodoc directives rather than
searching the Markdown, and 22 of the 44 undocumented names only needed a
directive, which they now have. 32 remain, and 23 of those are the
compiled bindings that #72 owns.
That leaves 9 names, and each is a question this issue owns
Each one is a public name that cannot get a page until somebody decides
whether it should be public, because writing the page settles it by
accident. The reasons are recorded in
UNDOCUMENTEDintests/meta/test_docs_coverage.py.strip_ansi__all__promise a function this project does not own?set_manager_titlenanopynix._process_titleDISPATCHABLE_METHODS__module__rpcinit_libstorenanopynixpackage itselfautomodulereaches itLogLevelnanopynix_protonormalize_log_levelandLogLevelInputare the documented way inResultTypenanopynix_protoBuildResultValueHandlenanopynix_protoGcRootnanopynix_protoThe other seven proto-derived models --
BuildResult,DerivationOutput,DerivationOutputs,FlakeRef,Input,LockedFlake,LockedInput--raised no question and joined
models.md, besideDerivationandPathInfowhich were already there.One correction to this issue's evidence
The parity ledger could not have caught it, and still could not.
_compare_memberintests/nanopynix/test_engine_parity.pycomparesparameter names and async-ness, and not return annotations. The same blind
spot hid a second case:
to_pythonreturnedJsonValueon rpc andAnyon inproc while both engines satisfied
AsyncValue. That one is fixed, andthe blind spot is now written down in that file's docstring. A gate over
return types needs to resolve
SelfandValueTagainst each engine's ownclass first -- 17 of the 18 members whose return annotations differ are
correct specialisations, so a naive check would report 17 false differences.
Lillecarl commentedon Aug 2, 2026
#72 is done, and it did not need a decision from here
#72 was marked "blocked by #44, for the names where the answer is removal
rather than a page". It removed no name, so the block did not bind. Each of
the 23 compiled-binding names was already in
nanopynix.__all__, and writing apage for a name that
__all__already lists adds no promise.That leaves this issue with exactly 9 names to rule on. They are the whole
of what is left in the
UNDOCUMENTEDledger intests/meta/test_docs_coverage.py, which is down from 32 entries to 9:DISPATCHABLE_METHODS__module__. No page owns it.GcRootLogLevelnormalize_log_levelandLogLevelInputare the documented way in.ResultTypeBuildResult, already reachable through that documented class.ValueHandleinit_libstoreautomodulereaches it.rpcset_manager_titlenanopynix._process_title, is private.strip_ansiEach one is either "document it, and the page says where" or "take it out of
__all__". The ledger entry carries the reason, and the gate asserts bothdirections, so an answer either way shortens the list.
docs(api): give the compiled bindings a reference page
Lillecarl commentedon Aug 2, 2026
e029277 rules on the last nine names and empties the
UNDOCUMENTEDledger, so all four acceptance criteria are now met.The nine
Seven get a page, because each is already in a public signature and the only
open question was where the page goes:
LogLevelsession.mdget_verbosityandset_verbosityreturn, on both engines and onAsyncVerbosityControllerGcRootmodels.mdAsyncStore.find_rootsResultTypemodels.mdBuildResult.result_typereturnsinit_libstoreprocess.md(new)pynix/config.pycalls it three timesset_manager_titleprocess.md(new)pynix/__init__.pyimports it from the top levelDISPATCHABLE_METHODSstores.mdStoreImplextension contract, whichstore_impl.pyalready cross-referenced with:data:rpcworker.mdinprocalready had anautomoduledirective andrpcdid notprocess.mdis new becauseinit_libstoreandset_manager_titleshare ascope no existing page has: they act on the operating-system process, and a
host calls each once before it opens anything. Neither belongs to an engine.
DISPATCHABLE_METHODSneeded one code change to be worth a page. The commentabove it becomes a docstring, so autodoc renders the reason the list is derived
from
PyStoreImplrather than restated.Two leave
__all__:ValueHandleappears in no client-side signature. Measured:rpc/worker/and the proto use it, and a caller of
Sessionreceives aValueProxy. Itstays in
nanopynix.models, besideCallArg,DeepValue,RemoteCallArgand
ScalarValue-- the other wire types that also stop one import deeper.strip_ansiis the third-party function of the same name. The packageimported it and never called it, so
__all__promised a function thisproject does not own.
One correction to the evidence
The issue says
strip_ansihas no consumer. Two test modules reached for itthrough
nanopynix, andpyrightfound the second one after the first wasfixed -- a multi-line
from nanopynix import (...)that a single-line grepdoes not match. Both now import it directly, as four other test modules
already did.
session.mdalso loses a stale sentence: it saidNixis abackward-compatible alias for
Session, and 039d772 deletedNix.Gates
ruff check,ruff check --config ruff-strict.toml,ruff format --checkandpyrightall clean.nanopynix-docsbuilds with-W, and the seven namesrender on the pages above. Full suite 2044 passed, 0 failed, 4 skipped, which
is the pre-change baseline.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
refactor(rpc): hide the four names that were transport bookkeeping
fix(nix): patch Nix to use gmtime_r, which does not share one buffer
test(meta): give every self-check one home, and a map to find it
feat(api): make the public surface say what it is, and both engines a…
feat(protocols): give Session the protocol it never had
refactor(api): let the consumers name the protocol, not rpc's classes
test(meta): give every public name a page, or an entry saying why not
docs(api): give the compiled bindings a reference page
docs(api): rule on the last nine public names, and empty the ledger
refactor(rpc): hide the four names that were transport bookkeeping
fix(nix): patch Nix to use gmtime_r, which does not share one buffer