diff --git a/docs/validation/declaration-selected-376.rst b/docs/validation/declaration-selected-376.rst new file mode 100644 index 0000000000..96fa283dbe --- /dev/null +++ b/docs/validation/declaration-selected-376.rst @@ -0,0 +1,268 @@ +Issue376 production follow-through +================================== + +Owner: Schrodinger. Own WT openhcs-knowledge-declaration-source-376-20261001. +Normal merge of main e66500e7a and original diagnostic cabc6f1; existing PR377. +Singer's current #404 WT remains untouched. #379 stays Dewey's explicit claim +5940290078 on fix/canonical-custom-source-379-20261001, not a complete fix here. +No startup, runtime, external394 metadata, native package, provider or live changes. +Source-only oneCPU/512MiB/no swap/60s. Parent owns installed10s acceptance. + +Original diagnostics and archive remain byte-exact, including both installed +timeouts and #379's separate red. This receipt is a product source checkpoint, +not replacement predecessor evidence. No persisted format changes. + +Owner and mechanism +-------------------- + +OpenHCSFunctionCatalogDeclaration owns batched source eligibility and exact +registered-declaration reuse. CellProfilerModule supplies its original normalized +module-name/alias and function/variant projections; source_bindings_for_modules +admits all enabled input module names once. LazyDiscoveryDict owns admission +under its existing lock, delegating to the original discover_registry_classes +loop. Paired metaclass-registry PR2 productionf27ff1ce18ddeaaa6f9dff6ff10778d3f40bb94b. +Exact published gitlink22837a912da2fba0cf2f562c31e0aeaab21ef29a adds only the +dependency receipt after that audited production checkpoint. + +No KnowledgeBaseService change, second importer, roster, registry, catalogue, +cache or environment mutation. Source literals are eligibility only; original +AutoRegisterMeta plus CellProfilerModule validation remain membership authority. +Nonliteral expressions select import rather than inventing their evaluated value. +Selected import/registration failures propagate. Partial admission never publishes +the original complete-discovery flag or cache. Later explicit full discovery +uses the same importer and registry. Selected custom/recursive discovery is +explicitly unsupported in this generic API; CellProfiler's owner is flat. + +The native Python AST visitor prunes function bodies, which cannot assign +enclosing declaration fields; declaration bodies and nested classes retain native +traversal. This replaces full AST walking, not another AST/cache authority. +Source declaration fields remain eligibility projections, not runtime proofs. + +IMPL-3/4: existing CellProfiler declaration hooks select behavior, no consumer +library/type switch. IMPL-12/13: original import and registration loop reused. +MEMB-1/2: no parallel family or selected-member roster. BOUND-2: actual class +identities come from the original registry, never source records. TIME-1/3: +replaced eager selected-lookup path removed, no compatibility entrypoint. +New case: one independently imported declaration at an arbitrary filename, +with canonical name/alias/function lookup through unchanged consumers. A genuine +independent __init_subclass__ capability composes before AND after CellProfiler +in real C3 order, and matching super executes its before/after behavior once. + +Retained source evidence +------------------------- + +selected-discovery-evidence holds all logs with exact commands/resources: + +* first-source: original #376 witness passed; two new test aliases used a spelling + not equivalent under the original normalizer,2failed/1passed. Repeated scans + cost31.67s/335272KiB. That prototype is not the delivery candidate. +* second-source: normalized fixture corrected and registered-owner reuse added, + 3passed/1deselected,13.31s/337492KiB. Still too much repeated missing-key work. +* batched-source: original source-binding owner batches keys;14passed/1failed, + 5.75s/328604KiB. Generic test root lacked the existing authoritative + __registry_config__ declaration; correction uses the original API. +* owner-source:50passed/1deselected,5.60s/327192KiB before AST function pruning. + #379 is deliberately deselected, not waived or declared fixed. +* selected-cold-profile: original retained diagnostic script, byte-identical, + actual10174-character selected source returned. Full source process8.96s / + 335140KiB with cProfile;69 module eligibility reads, one discovery batch, + nine selected import-owner calls. Profile showed AST walking cost, motivating + native function-body pruning. This is not installed timing evidence. + +Final paired source checkpoints +------------------------------- + +OpenHCS production49b46d59e4eca9e5ea5c042c921f681bcf5ff732. Function-name lookup +belongs on existing OpenHCSFunctionCatalogDeclaration; CellProfiler keeps its +small primary/variant projection hook, original fields and validation. Original +R0 rejects 5fd (+1 GodClassExcess) and24a (+1 per-file ForeignAbsenceProbe); +both JSON/resource receipts remain. Final5176 projections have zero positive +deltas,16.89s/87444KiB. CellProfiler GodClassExcess decreases22; StringSubscript +decreases1. No guard allowance, detector copy or hidden rejected head. + +Dependency69b6 first R0 rejected duplicated configuration admission (+1 foreign +probe). LazyDiscoveryDict now owns one _has_discovery_configuration admission +used by both full and selected discovery, deleting repeated checks. Finalf27ff1c +has31 projections,zero positive,1.68s/45356KiB. Original R0 is unchanged pinned +3b03785f45df2ef5dc62ba6aed99294192ecbb01, Python3.14, read-only backing path; +debt_ratchet.py SHA256e323c94d49c2b72d9524a5169f123e64b4a6e46a41035ca9fb4497e49b6ca562. + +Final focused53pass/1deselected (Dewey379),7.18s/343340KiB. Strengthened real +callable new-case5pass,12.06s/328900KiB with observed53percent CPU; its body +raises if executed, yet original require_callable resolves the exact object. +Final retrieval-admission/new-case5pass,5.93s/329736KiB; ExampleHuman denies +both RegistryService preparation entrypoints and whole-family discovery. +These five cases overlap the53, not58 independent tests. + +Final original diagnostic script returns10174chars with no errors, one admission +batch and nine selected imports. cProfile get_document3.589s; total process6.43s/ +340944KiB. Eligibility69source reads0.842s rather than the previous prototype's +full AST-walk2.156s. Those are bounded source observations across evolving heads, +not a controlled installed benchmark or proof of the original10s timeout closure. + +Preserved broader limits and operational correction +--------------------------------------------------- + +Adding original official30 capability tests hit collection error in the old +read-only pyqt-reactive dependency: WindowSnapshotFrameCondition lacks +RENDER_COMPLETE. That run5.49s/260792KiB,exit2. No package source was patched. +Broader backend-public checks72pass/4fail/1deselected,16.59s/406772KiB; four +fresh subprocess controls cannot import source-tree _tabular_native. Their logs +remain, not classified as successful fresh-process acceptance. + +An EXTRA unpublished public-source roundtrip assertion crossed source376 scope: +PipelineDocumentAuthority.from_source -> get_function -> RegistryService started +one --prepare-capabilities child. Its direct owned wait returned1 at the missing +_tabular_native import; exact PID/incarnation was not persisted. Launcher flag +returns before the serving branch, so this was a preparation-only source child, +not a native endpoint/readiness attempt. No terminal timeout/replay or worker +kill occurred. 1fail/4pass,7.38s/368108KiB transcript is retained. Process check +afterward found no preparation child; no installed environment was modified. +This assertion is NOT installed/public-source roundtrip qualification. Removed +only that out-of-scope extra assertion and kept the actual retrieval/new-case +tests; added explicit preparation rejection to the retrieval check. The original +official30 roundtrip test stays untouched and its live acceptance remains parent +owned. No fresh retry of that preparation/roundtrip route. + +No complete +NRA/global R1 claim: original full-context failure remains separately retained; +no detector copy, context pruning, timeout increase or full R1 retry. +Cleanup completed: removed ONLY +/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001 (104KiB) +after final source workers exited, process check found no preparation/test/profile +worker, canonical-path/no-symlink check and lsof showed no open scratch handle. +Absence verified afterward. Disposable fixtures/cache can be regenerated from +retained recipes. Lossless R0 gzip recoveries match every uncompressed digest; +source, original failures, diagnostics, durable PR history and scientific outputs +remain retained. No foreign worktree/cache or environment removal. + +Current ordinary main and paired dependency delivery +---------------------------------------------------- + +Source checkpoint bbf2b7843b8add1d25aa1f30017c6a7efc413b89 normally merges +current main33701725f5b53874c1a18c0837d2c2bb2bb3b99e (including408/411/412). +The two issue376 production files and tests are unchanged from f1a713d19. +Original dependency PR2 normally merges main34c3097ba449ba9501a5adb8d1e37a660652abaf +at dc65ebe41459c2a85f2c80d84d7e238500e613d1. Its src/tests are byte-identical +to22837a9. Published paired gitlink b27722bc71282ddd1ca1c5847208a72c800fe0b6 +adds the dependency integration receipt to that tested source checkpoint. + +53 focused checks pass,1deselected issue379,7.22s/344260KiB. New independent +declaration/callable plus cooperative before/after-C3 behavior remains included. +Original R0 unchanged tool3b03785f, Python3.14, source checksum recorded above: + +* OpenHCS main33701725 -> bbf2b784:5177projections,zero positive, + exit0,13.76s/86896KiB; only the two376production files differ. +* Dependency main34c3097 -> dc65ebe:31projections,zero positive, + exit0,1.31s/44376KiB. + +Exact serial commands, logs, resource receipts and lossless JSON are retained +as selected-discovery-evidence/integration-*. Each command uses original +read-only interpreter/dependency environment, CPU0/512MiB/no swap/60s. +Resource helper reports RAM13.1GiB, home7.2GiB, root7.7GiB, swap10.2GiB +(critical warning). No fleet or environment was created; tests remain serial. + +PR409 was still OPEN at integration, not silently treated as merged. Dewey's +canonical lookup owner remains separate; ordinary merge after409 is the remaining +shared-file integration boundary. No379implementation or duplicate lookup added. +NRA review IMPL-3/4/12/13, MEMB-1/2 retains ancestor shared implementation, +minimal leaf hooks, original discovery/registration and meaningful C3 new cases. +Original failed controls and broader ABI limits above remain unchanged. + +Cleanup: removed only verified task scratch +/home/ts/.cache/agent-scratch/knowledge-selected-integration-376-20261001, +356KiB, after all three workers exited, no matching preparation/source-test +process, no open lsof handles and canonical no-symlink path check. Durable +source/evidence remain. No package install or live runtime/science changes. + +Final released409 seam integration +---------------------------------- + +Normal merge of released main d0b4f5b5e6947c8f9ed5d99f73064145ad678b71 +produces production checkpoint63e25ee7e6099ec20bceb1c29fe1a29716531339. +No conflict or manual production edits. OpenHCSRegistry retains the original +CustomFunctionCanonicalLookup import and declared MRO before LibraryRegistryBase; +matching super owns the remainder of canonical claims. Issue376 remains on +OpenHCSFunctionCatalogDeclaration / CellProfiler declaration hooks, unchanged. +The old pending409 boundary above is now closed by this ordinary merge. +No379takeover, new lookup roster, importer or compatibility mechanism. + +Public dependency https://github.com/OpenHCSDev/metaclass-registry/pull/2 +head/gitlink b27722bc71282ddd1ca1c5847208a72c800fe0b6 (branch +fix/declaration-selected-discovery-376-20261001). Its src/tests are byte-identical +to R0-tested dc65ebe; final original dependency31projection zero-positive +evidence remains integration-dependency-r0.json.gz. No dependency source changed +during released409 integration. Parent's379source controls remain its own +reviewed predecessor, not a repeated or claimed local run here. + +Final53focused source tests pass,7.10s/344084KiB;1canonical-custom witness +deselected, no replay of uncertain custom registration/input. Tests include +real imported callable identity, fail-closed discovery and cooperative independent +capabilities before/after the ancestor in real C3 order, with no consumer edits. +Original pinned R0 tool3b03785f/checksum above unchanged, Python3.14 owner: +main d0b4f5b5 -> production63e25ee7,5179projections,zero positive,exit0, +13.48s/86916KiB. Only two376production files differ against released main. +IMPL-3/4/12/13 and MEMB-1/2 review preserves both independent owner mechanisms. + +Exact commands reuse integration-376-commands.sh: mode tests, then +r0-openhcs d0b4f5b5e6947c8f9ed5d99f73064145ad678b71, each under the declared +systemd512MiB/no-swap/oneCPU scope, tasksetCPU0 and timeout60s. Interpreter and +ABI environment remain read-only. post409-* logs, resources, lossless JSON and +POST409-SHA256SUMS retain this checkpoint separately from all original failures. +No installs/native/science/provider operations. Full NRA/R1 remains unqualified. + +Regenerated the same owned disposable integration scratch for these two checks, +then removed only that exact path after terminal workers/no-open-handles/process +and canonical-path checks;356KiB released again. No source, failure evidence, +foreign worktree, private environment or parent live process changed. + +Source installation and public publication boundary +--------------------------------------------------- + +Verified dependency b27722bc still declares __version__="0.2.1"; OpenHCS +pyproject.toml still requires "metaclass-registry>=0.2.1,<0.3". Therefore an +ordinary package-index installation can select old0.2.1 without discover_matching. +The published gitlink and PR2 do not update package-index artifacts or enforce +this new API minimum. Public normal-install delivery is not qualified here. + +The parent-approved paired source/private-wheel route must explicitly build and +install the original dependency source b27722bc71282ddd1ca1c5847208a72c800fe0b6 +alongside this OpenHCS checkpoint and retain wheel/import provenance. It must +not treat installing OpenHCS alone as selecting that dependency source. This +receipt does not execute that route or mutate the current live private environment. + +Coordinated public-release followup: choose and commit a new dependency version +for this API; update the OpenHCS minimum to that actual version; publish the +dependency through the authorized registry release owner, then qualify a fresh +normal-resolver OpenHCS installation and affected user entrypoint. Publication +and installation remain parent integration/explicit authorization boundaries. +No version bump, package upload, registry publication or compatibility shim was +performed. Existing PR2 source/tests and its own WT remain preserved unchanged. + +Actual merged dependency main +----------------------------- + +Public metaclass-registry PR2 is MERGED; remote and local main are +3294a69dabc9f99dd646c32571b8f97cc139d378. Normally fast-forwarded the owned +dependency WT from b27722bc to that merge head, preserving all source/history. +Final OpenHCS gitlink now records3294a69dabc9f99dd646c32571b8f97cc139d378, +not an unmerged/private dependency revision. Parent's source/private-wheel route +above can use this actual merged head; its source is identical to b27722bc. + +Verified exact Git tree identities after integration: + +* OpenHCS production63e25ee7 and final openhcs tree: + 81db5d4fb926a8e53b0dfcae52cd09f21b715b1e. +* OpenHCS production63e25ee7 and final tests tree: + 73f6a1b329b33d1a4fa79d8659f9dc6d11896c2b. +* Dependency original R0-tested dc65ebe and actual merged3294a69 src tree: + 70fed7cd3e231d211fe01b01d65d9c430c0d46cb. +* Dependency dc65ebe and3294a69 tests tree: + b7db15a49f719ea053da31a39dcb62eaa313fb43. + +Thus the scoped53source controls and final OpenHCS5179/dependency31 original +R0 zero-positive evidence remain exact for the merged production source; only +gitlink/provenance changed, no repeated tests or uncertain registration replay. +Released409cooperative MI/import remains intact. Public version still0.2.1 and +OpenHCS minimum>=0.2.1: coordinated publication/minimum followup remains open. +No private install, registry upload, native process or scientific run. diff --git a/docs/validation/diagnose-knowledge-376.py b/docs/validation/diagnose-knowledge-376.py new file mode 100644 index 0000000000..653aeb25fb --- /dev/null +++ b/docs/validation/diagnose-knowledge-376.py @@ -0,0 +1,60 @@ +"""Source-only diagnostic: deny catalogue preparation and native execution.""" + +import importlib.util +import cProfile +import pstats +import sys +import time +import traceback +from pathlib import Path + +# Reuse only the parent's existing ABI substrate, without source/install writes. +import openhcs + +# The executable may resolve to a shared Python; the supplied readonly root is +# explicit so it never guesses an installed incarnation from that executable. +installed_package = Path(sys.argv[1]) +for module_name, relative in ( + ("openhcs.core._tabular_native", "core/_tabular_native.abi3.so"), + ( + "openhcs.processing.backends.cellprofiler._granularity_native", + "processing/backends/cellprofiler/_granularity_native.abi3.so", + ), +): + spec = importlib.util.spec_from_file_location(module_name, installed_package / relative) + module = importlib.util.module_from_spec(spec) + sys.modules[module_name] = module + spec.loader.exec_module(module) + +started = time.monotonic() +from openhcs.processing.backends.lib_registry.registry_service import RegistryService + + +def denied_preparation(*args, **kwargs): + traceback.print_stack() + raise AssertionError("source retrieval attempted unrelated catalog preparation") + + +RegistryService.prepare_persistent_catalog = denied_preparation +RegistryService.prepare_in_current_process = denied_preparation + +print("registry imported", time.monotonic() - started, flush=True) +from openhcs.agent.dto.knowledge import KnowledgeBaseDocumentRequest +from openhcs.agent.services.knowledge_base_service import KnowledgeBaseService + +print("knowledge imported", time.monotonic() - started, flush=True) +profile = cProfile.Profile() +profile.enable() +document = KnowledgeBaseService().get_document( + KnowledgeBaseDocumentRequest.from_fields( + document_id="openhcs_official30_benchmark_recipes", + section_id="cp-tutorial-pixel-based-classification-openhcs-python", + max_chars=50000, + ) +) +profile.disable() +print("completed", time.monotonic() - started, flush=True) +print("errors", document.errors, flush=True) +print("content_chars", len(document.content), flush=True) +pstats.Stats(profile).sort_stats("cumulative").print_stats(35) +assert not document.errors diff --git a/docs/validation/issue376-source-diagnosis-20261001.tar.gz b/docs/validation/issue376-source-diagnosis-20261001.tar.gz new file mode 100644 index 0000000000..3144f9bfe0 Binary files /dev/null and b/docs/validation/issue376-source-diagnosis-20261001.tar.gz differ diff --git a/docs/validation/knowledge-lazy-conversion-376.rst b/docs/validation/knowledge-lazy-conversion-376.rst new file mode 100644 index 0000000000..90de971cf1 --- /dev/null +++ b/docs/validation/knowledge-lazy-conversion-376.rst @@ -0,0 +1,217 @@ +Selected knowledge conversion deadline: issue376 +================================================ + +Status: bounded source diagnosis published in draftPR377; no repair or installed +acceptance claim. Related canonical lookup defect is independently issue379. +Owner: managed-viewer sidecar, now distinct knowledge lazy-conversion owner. +Base: main6ace57656 in /home/ts/wt/openhcs-knowledge-lazy-conversion-20261001. + +Original installed failure +-------------------------- + +The read-only openhcs_get_knowledge_document request selects document +openhcs_official30_benchmark_recipes, section +cp-tutorial-pixel-based-classification-openhcs-python, max_chars50000. +The original10s transport observation returns mcp_transport_failed/TimeoutError. +Parent reports the same MCP PID1658909 remains healthy. No retry, restart, +larger deadline or changed max_chars is authorized. + +Original evidence remains parent-owned in +/home/ts/wt/openhcs-issue-batch-20260929/calibration371-classification372-installed-20261001: +launch.sh, mcp.stdin line20 and mcp.stdout lines1429..1452. +Private wheel SHA256: +95123985e863847e7366f195194845f1b7ef9d661d04b254f11c49ea8e3eee33; +parentff52f0e includes371/372. +These references identify retained evidence, not a fresh execution. + +Required relation and ownership +------------------------------- + +Selected source retrieval must use the existing importer and canonical public +PipelineDocument renderer without initiating unrelated catalogue/runtime work. +Trace KnowledgeBaseService._official30_source_section_lines -> +_official30_public_source -> import_cellprofiler_pipeline -> +PipelineDocumentAuthority. Do not replace that mechanism with another converter, +raw cppipe fallback, generated-source cache or larger deadline. + +Applicable patterns: IMPL-12/13 (reuse the original translation/serialization +owners), MEMB-1/2 (derive discovery from declarations and the existing registry), +IMPL-3 (no generic consumer concrete-type dispatch). Shared algorithms stay on +their owning ancestor; leaves supply only independent nominal hooks. + +Checked all open PR titles and matching knowledge issues. No matching owner +found. Schrodinger PR358 owns cold runtime startup/readiness, not this boundary: +ZMQClientService, ZMQExecutionClient and paired ZMQRuntime are excluded. +If diagnosis reaches that seam, coordinate before edits. Parent371 calibration +and372 classification source and frozen blind/runtime boundaries are excluded. +Snapshot observation/writer and Qt binding hooks remain unchanged. + +Validation and disposition +--------------------------- + +Source-only: one CPU,512MiB combined RSS,60s per shard, no providers/plugins, +native/MCP/UI/Fiji/download/install or heavy lock. Parent occupies the native +slot and owns subsequent original installed10s entrypoint acceptance. +Resource helper reports RAM20.0GiB, home7.6GiB and swap10.7GiB: no parallel fleet +or large tests; only serial bounded source checks and small durable receipts. +Owned scratch: /home/ts/.cache/agent-scratch/knowledge-lazy-conversion-376-20261001, +for isolated cache/pytest fixtures and archive extraction verification only. +Cleanup completed after every bounded source worker exited and fresh archive +extraction matched: removed only that80KiB scratch directory and36KiB loose +unversioned raw evidence copies. The byte-exact archived logs remain retained; +parent evidence, source/worktrees, installed files and shared caches are intact. +No complete global NRA/R1 claim. + +Done when the original selected request has focused behavioral evidence, +an independent declaration/hooks case needs no consumer edits, missing and +unsupported conversion remain typed, original failures are retained, original +pinned R0 covers all changed production files, and parent installed acceptance +has passed. Current checkpoint does not satisfy those conditions. + +Source diagnosis:376 +------------------- + +Actual original typed request ran on unchanged main production source. The +diagnostic denied both RegistryService preparation entrypoints; neither was +called. The first check returned10174 content characters without errors, +9.99s total wall including source/ABI imports,394160KiB peak. A separately +profiled cold process completed7.36s total /418172KiB; get_document itself +took4.464s and selected source conversion3.992s. These successful source runs +do not reproduce the parent's installed transport TimeoutError. + +The profile locates eager work at import_cellprofiler_pipeline -> +CellProfilerModule.source_bindings_for_modules -> require_module -> for_module +-> LazyDiscoveryDict.values/_discover -> discover_registry_classes. Full-family +discovery took3.283s, including imports of unrelated alignment declarations. +This is a proven cold-cost boundary, not proof that it alone caused the +installed10s timeout. The converter already limits numerical translation to +the selected manifest case; the generic global catalogue-preparation hypothesis +was not observed and is not asserted here. + +The source regression forbids full backend discovery and invokes the original +KnowledgeBaseService with the actual requested section and cached cppipe source. +It fails with official30_conversion_failed, exposing the eager declaration +lookup. No native application or scientific callable was invoked. The check +does not substitute a converter or invent an alternative source document. + +Required owning seam: CellProfilerModule owns nominal module lookup; +LazyDiscoveryDict owns discovery. Any selected-discovery repair must extend +that owner, derive candidates from declarations, preserve normalized aliases +and duplicate/unknown rejection, and retain one importer and public renderer. +Do not put a module-name/filename roster, class switch or copied discovery +procedure into KnowledgeBaseService. IMPL-13 and MEMB-1/2 apply. No production +seam was changed in this diagnostic checkpoint, and no independent new-case +success or global NRA completion is claimed. + +Related precise boundary:379 +--------------------------- + +Parent remote registration succeeded once on owned5993 with canonical ID +openhcs:engineering_calibration_classification_fixture and stable import +openhcs.processing.custom_functions.engineering_calibration_classification_fixture. +Persisted engineering source SHA256: +3157e246de9348b0522f8e4d2712b84df06db71185d8c09ce868b6f74c7349ce. +describe_function returned the required pixel_size and output contracts. +inspect_pipeline_source_artifact_plan then returned pipeline_source_invalid_document +with Unknown canonical function ID, before compilation. Original stdin29/31/36 +and stdout4640..4670 retain that failure. Parent's later stable-import spelling +is a distinct source version, not evidence that the original canonical route +passed. Original70502 handle and installed process remain parent-owned. + +The endpoint catalogue's get/reference methods use the remote incarnation and +revision. In-process inspection calls PipelineDocumentAuthority.from_source; +source get_function directly reads local RegistryService._metadata_cache via +get_all_functions_with_metadata. Persisted registration intentionally does not +publish ephemeral source locally. The original stable-import loader instead +loads the persisted source through CustomFunctionManager and publishes through +CustomFunctionRuntimeRegistry. An already cached local catalogue also fails +to include a subsequently published custom declaration. + +The independent source witness declares its own @numpy function, projects and +publishes it through the existing custom runtime owner, and never executes its +body. With an existing empty local catalogue, get_function(metadata.composite_key) +still raises Unknown canonical function ID. Cleanup removes only that +process-local test declaration. This proves a custom declaration/cached lookup +gap without remote registration or replay; it does not prove a remote-to-local +transport repair. The unknown-ID assertion is presently unreachable after the +first failure and is not counted as passing acceptance. + +BOUND-2: canonical lookup must not bypass CustomFunctionRuntimeRegistry's +source-owned projection. MEMB-1/2: do not mirror endpoint membership into a new +local cache. The next repair must decide source-versus-endpoint authority at +the original lookup boundary, preserve revisions/ambiguity and exact namespace, +and use the existing registry-family hooks rather than a consumer library switch. +This is related ownership analysis, not a proven common timing cause for376. + +Retained checks and next boundary +-------------------------------- + +Original source regression result:2 failed,2 pytest configuration warnings, +2.91s wall /177516KiB peak, exit1. Both failures are retained unchanged and are +intentional failing behavioral witnesses; neither is marked xfail or waived. +All three source shards used one CPU, kernel512MiB/no swap and timeout60s, +provider/plugin-free. Shared dependencies and ABI binaries were read-only; +the diagnostic explicitly loaded the two ABI modules from the existing +generated-inputs-installed-parent environment without copying or installing. +Actual metaclass dependency import paths are visible in the original profile. + +Byte-exact source logs, selected original installed stdin/stdout excerpts, +diagnostic recipe and red test source are archived in +docs/validation/issue376-source-diagnosis-20261001.tar.gz, SHA256: +f9cbf53216cf89ce0ddd0c6ea80b5d44c35b4aa5d40f968c127215df37409321. +Fresh extraction compared identical to every loose raw evidence file. Excerpts +preserve original CRLF and whitespace; they are not a complete/final live +session archive. Parent's original full logs remain unchanged. Raw whitespace +is evidence, not rewritten to manufacture diff success. + +Changed paths are this receipt, the diagnostic source, the two red regression +tests in one file, and the evidence archive. No production, dependency gitlink, +startup/connect,371/372, snapshot, native runtime or installed source changed. +There is no production R0 delta to measure yet. A future product repair requires +original pinned R0 over every actual changed production file, not a copied +detector or positive-delta waiver. Parent owns original installed10s acceptance. +Current next work is selected declaration discovery/lookup ownership; the +timeout's exact installed timing remains unqualified, not silently fixed. + +Additional installed witness +----------------------------- + +Parent engineering evidence now records a second exact generated-source section +timing out: knowledge-document openhcs_official30_benchmark_recipes, +section examplehuman-openhcs-python, max_chars50000. It remains issue376 under +this same PR377 owner, not a second feature or a case-name-specific workaround. + +Retained root: +/home/ts/wt/openhcs-issue-batch-20260929/neurite-development-skill383-20261001/output. +mcp.stdin line29 is the exact request; mcp.stdout2704..2726 contains the +mcp_transport_failed/TimeoutError reply. author-record.rst's Example retrieval +section explicitly keeps the timed-out read pending disposition, not replayed +and not proof that conversion did no work. No retrieval parity is claimed. + +SHA256 of the byte-exact stdin line29, including its original line ending: +20cdfc6bb9aec372d469ce527ab2aca32428ffdf5f1f62f8bf0df8e0f2d20cf4. +SHA256 of the byte-exact stdout2704..2726 slice, including original CRLF: +f1028363754d76ff325376032d79d22544276179b599c2131751d6912676018b. +These hashes identify the original slices, not a complete/final session archive. +No redundant snapshot, copied corpus or new archive was created for this update. + +The distinct subsequent corpus-map request at stdin30 succeeded: +document openhcs_example_corpus_map, section +openhcs-processing-presets-pipelines-loose-operaphenix-neurite-outgrowth-py, +max_chars50000. stdout2727..2734 records the exact selection, installed Python +source path and Lines included487; the parent's author record reports no +truncation. It is a mechanism reference, not case-specific biological/parity +acceptance, and does not dispose of or repair the failed ExampleHuman read. + +The timeout's captured stderr tail also includes earlier Inspect plate path +progress and a BigStitcher jar message. That mixed tail is retained evidence, +not a demonstrated causal stack for knowledge conversion. Do not attribute +this timeout to Fiji startup, catalogue discovery or the content-size bound +without further source evidence. Both official30 selections use the existing +manifest-case conversion owner; MEMB-1/2 still prohibit a case roster, parallel +registry or selective deadline widening. No new production diagnosis is claimed. + +This receipt-only follow-up used the existing WT; no tests, native launches, +installation, download, timeout change, restart or pending-read replay. Parent +logs, original failure archives, scientific output and frozen paired installation +remain untouched. No new disposable build/test/cache directory was created. diff --git a/docs/validation/knowledge-selected-source-tests.py b/docs/validation/knowledge-selected-source-tests.py new file mode 100644 index 0000000000..80e42cf144 --- /dev/null +++ b/docs/validation/knowledge-selected-source-tests.py @@ -0,0 +1,34 @@ +"""Bounded source checks using the existing read-only ABI environment.""" + +import importlib.util +import sys +from pathlib import Path + +root = Path(__file__).resolve().parents[2] +sys.path[:0] = [ + str(root), + "/home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src", +] +installed = Path( + "/home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/lib/python3.12/site-packages/openhcs" +) +for name, relative in ( + ("openhcs.core._tabular_native", "core/_tabular_native.abi3.so"), + ("openhcs.processing.backends.cellprofiler._granularity_native", + "processing/backends/cellprofiler/_granularity_native.abi3.so"), +): + spec = importlib.util.spec_from_file_location(name, installed / relative) + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + spec.loader.exec_module(module) + +import pytest +import metaclass_registry + +print("Interpreter:", sys.executable, sys.version, flush=True) +print("Discovery owner:", metaclass_registry.__file__, flush=True) +raise SystemExit(pytest.main([ + "--noconftest", "-o", "addopts=", "-p", "no:cacheprovider", + "--basetemp=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/pytest", + *sys.argv[1:], +])) diff --git a/docs/validation/selected-discovery-evidence/INTEGRATION-R0-UNCOMPRESSED-SHA256SUMS b/docs/validation/selected-discovery-evidence/INTEGRATION-R0-UNCOMPRESSED-SHA256SUMS new file mode 100644 index 0000000000..60ab702ea6 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/INTEGRATION-R0-UNCOMPRESSED-SHA256SUMS @@ -0,0 +1,2 @@ +f5b3dd93c31a327f42927e3988663f934684560ba6e273df3231a94de0899166 integration-openhcs-r0.json +6713edd45509cf5e862ed9b778c3fb73f589f4d6197774e6332a1b984bc43c51 integration-dependency-r0.json diff --git a/docs/validation/selected-discovery-evidence/INTEGRATION-SHA256SUMS b/docs/validation/selected-discovery-evidence/INTEGRATION-SHA256SUMS new file mode 100644 index 0000000000..a82e500d50 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/INTEGRATION-SHA256SUMS @@ -0,0 +1,7 @@ +fbece378e58ffa81e784c832eb49e12768a21c1cc4ebac11696ee413a36c417b integration-376-commands.sh +b56a1f6e7357a8ae759227fb2b305128207d28815c771d3e507fb8337f4efec5 integration-focused-source.log +a17fb99918637752df40c9c13ed3a9d0e1063066e431b3278d6996b9a3ec603c integration-openhcs-r0.json.gz +d5ea604cdfb2c7a7aa0146c29643680fb8aae512a8ddcd75dc956687cc7ad13a integration-openhcs-r0.resources.txt +1d2724497115a55f624731a4a1dd7fcfb9a8c597420d13a48451ed2a6ac0ebb0 integration-dependency-r0.json.gz +e5a4e30cf0f41b3b37551048679565e31e376ea495c6efa07bd0dc284094f964 integration-dependency-r0.resources.txt +be70dafdd273ed3451c0fb856232944ce1c2913d14d637477896115c6bc902d2 INTEGRATION-R0-UNCOMPRESSED-SHA256SUMS diff --git a/docs/validation/selected-discovery-evidence/POST409-R0-UNCOMPRESSED-SHA256SUMS b/docs/validation/selected-discovery-evidence/POST409-R0-UNCOMPRESSED-SHA256SUMS new file mode 100644 index 0000000000..a2982775f4 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/POST409-R0-UNCOMPRESSED-SHA256SUMS @@ -0,0 +1 @@ +c18765b6459437eee54c2d4e6652e449a321888e7e15fc782f80a3f4676f7b48 post409-openhcs-r0.json diff --git a/docs/validation/selected-discovery-evidence/POST409-SHA256SUMS b/docs/validation/selected-discovery-evidence/POST409-SHA256SUMS new file mode 100644 index 0000000000..6f7204ea78 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/POST409-SHA256SUMS @@ -0,0 +1,3 @@ +1882553f43e2c9c9c317da989f0a01e2bc5926fdfc0cc071af21193a33b3f9f3 post409-focused-source.log +8b6fb413e437868d7d3a8f57d6c95357a82a24513bc08a47ef8aae14751a83aa post409-openhcs-r0.json.gz +26f81936ae1fa819759de8fa36ffe8b85b12171dad403e903a7a176333a7c54e post409-openhcs-r0.resources.txt diff --git a/docs/validation/selected-discovery-evidence/R0-UNCOMPRESSED-SHA256SUMS b/docs/validation/selected-discovery-evidence/R0-UNCOMPRESSED-SHA256SUMS new file mode 100644 index 0000000000..53874490e7 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/R0-UNCOMPRESSED-SHA256SUMS @@ -0,0 +1,5 @@ +5844cdbb7fb97ab9716c705dd78ec84ccff77c1dc8ea3fd4db1576218f946e80 docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.json +c981ca087763a298ab6c3c8ea229ce96c488b8835889142d6fcac9823ca28b0c docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.json +4a81ded6871975c8b4fc3e2a336f86b7a82c6755d5f8cf8235b0047af52804d3 docs/validation/selected-discovery-evidence/openhcs-r0-final.json +d3754f1b852191a1ad33065c018e9bae3b2f46c6fbf9f1ec35d15d9ac243e030 docs/validation/selected-discovery-evidence/dependency-r0.json +e61b1b6c9b45acf99412c2da06f314230d75cbcb9a416b6cb995ceb372d02175 docs/validation/selected-discovery-evidence/dependency-r0-final.json diff --git a/docs/validation/selected-discovery-evidence/SHA256SUMS b/docs/validation/selected-discovery-evidence/SHA256SUMS new file mode 100644 index 0000000000..9c09ab29b9 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/SHA256SUMS @@ -0,0 +1,23 @@ +dd9a7176dca9cf7fe8469b22e84bd9d18d6ea6d2403889ceb35070d964c6d722 docs/validation/selected-discovery-evidence/batched-source.log +966738b1d54475af8832eba82a43e5af5a469cfc012f0c51473defd0d4d70357 docs/validation/selected-discovery-evidence/final-cold-profile.log +47d54fd3d8273cfd817175999c00b2371e1b78f5f76d705adbac33b620b3f63a docs/validation/selected-discovery-evidence/final-focused-source.log +add8d502e1c43e9539d3c23b867b3324c179157af274061ae33c8647ab767781 docs/validation/selected-discovery-evidence/final-owner-source.log +9e95a6eb3ee8b6dd7486cc119eec33881e67af196f027b263caf419e85f05298 docs/validation/selected-discovery-evidence/final-source.log +2a9664210c327d1c1bf04666378e94a3f5d97595d833d30cbaefb26d9f208142 docs/validation/selected-discovery-evidence/first-source.log +42e82c8604c2acbadbc9ae357b3637ef60d10cdedb158a1f662a9b067b5dddc0 docs/validation/selected-discovery-evidence/owner-source.log +a6009050c70e67e3fbbeb7ab539bb945b3ea2d90ba91b0ac2845093b5b2c5bdb docs/validation/selected-discovery-evidence/real-callable-newcase.log +6be237db318800db8743aa4b1704cdbf869ae618e8d104d1f0bc8c07b786c26b docs/validation/selected-discovery-evidence/retrieval-admission-newcase.log +fc3bfdccd74bab0fa2ee1c419977b10a012b635ff23cea398436c83de0dbbee9 docs/validation/selected-discovery-evidence/second-source.log +da7dee38615dcea87f5f32107b43d508ae2c9a023d71343717e64098127ea7de docs/validation/selected-discovery-evidence/selected-cold-profile.log +b6c618c01b13edeb60951cb832d16a55591117eeb64233a960dc745e0df9f504 docs/validation/selected-discovery-evidence/source-roundtrip-newcase.log +6f7f002a149e1e1f6ef637ab5a21fe91ca916be6460a9ea09ac587ae994c230c docs/validation/selected-discovery-evidence/dependency-r0-final.resources.txt +8807884bd3219966fbf8298f44fc8016e61fb75b4863202a93dea4bf1c456000 docs/validation/selected-discovery-evidence/dependency-r0.resources.txt +c8220ad8608fd00d673e7ee21320bff5fcdaa5c1cd4dcfd60fcf5e7256fcb6d3 docs/validation/selected-discovery-evidence/openhcs-r0-final.resources.txt +7d35370cb80f8cdcd3844ce440538f7dd3f2a2e6d48c734b4df748ac0b131e54 docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.resources.txt +3bbf9700b0fe8e4909d85f742c03e873e1f942aca57ed817979e21a338c9eaff docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.resources.txt +2e78680aee46bd87337a6daba134a4581eba3faecaa98098b6db2cc0c4667fd5 docs/validation/selected-discovery-evidence/dependency-r0-final.json.gz +6384b08273e512617fe093e93afc3075b763018bde0c4763b15910d96eed549f docs/validation/selected-discovery-evidence/dependency-r0.json.gz +22a5b2681b463f6bd703945b215ac3771a976a73f40798fe2c1d346df35365d4 docs/validation/selected-discovery-evidence/openhcs-r0-final.json.gz +e0a038a85c8ccb738b5a83ea6407f645fce077e0659504aab4207f87de6ab8b1 docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.json.gz +9d1aa365b7f5fe9f0df1fa32838cc02d5a76263e43e92a4db4d3d58100ff93a5 docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.json.gz +1904920c804514e02e5724f668a9cf7a366d17802f6216fbeb3a451f2ee2f845 docs/validation/selected-discovery-evidence/R0-UNCOMPRESSED-SHA256SUMS diff --git a/docs/validation/selected-discovery-evidence/batched-source.log b/docs/validation/selected-discovery-evidence/batched-source.log new file mode 100644 index 0000000000..49ea4edb76 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/batched-source.log @@ -0,0 +1,93 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 16 items / 1 deselected / 15 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 6%] +tests/unit/agent/test_declaration_selected_discovery.py .. [ 20%] +. F........... [100%] + +=================================== FAILURES =================================== +__ test_selected_discovery_then_full_discovery_has_one_registration_authority __ + +tmp_path = PosixPath('/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/pytest/test_selected_discovery_then_f0') +monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f4e66d57c80> + + def test_selected_discovery_then_full_discovery_has_one_registration_authority( + tmp_path, monkeypatch + ): + registry = LazyDiscoveryDict(enable_cache=False) + + class Root( + metaclass=AutoRegisterMeta, + registry_config=RegistryConfig( + registry_dict=registry, key_attribute="key", skip_if_no_key=True, + discovery_package="selected_plugins", registry_name="selected plugins", + ), + ): + key = None + + support = type(sys)("selected_plugins_support") + support.Root = Root + monkeypatch.setitem(sys.modules, support.__name__, support) + package = tmp_path / "selected_plugins" + package.mkdir() + (package / "__init__.py").write_text("") + for name in ("one", "two"): + (package / f"{name}.py").write_text( + "from selected_plugins_support import Root\n" + f"class Plugin(Root):\n key = '{name}'\n" + ) + monkeypatch.syspath_prepend(str(tmp_path)) + try: + registry.discover_matching(lambda name: name == "selected_plugins.one") + selected = importlib.import_module("selected_plugins.one").Plugin +> assert tuple(dict.values(registry)) == (selected,) +E AssertionError: assert () == (,) +E +E Right contains one more item: +E Use -v to get more diff + +../metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py:40: AssertionError +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +=========================== short test summary info ============================ +FAILED ::test_selected_discovery_then_full_discovery_has_one_registration_authority +============ 1 failed, 14 passed, 1 deselected, 2 warnings in 5.01s ============ +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true OPENHCS_SUBPROCESS_NO_GPU=1 POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 JAX_PLATFORMS=cpu XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py -k not canonical_custom" + User time (seconds): 5.19 + System time (seconds): 0.29 + Percent of CPU this job got: 95% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.75 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 328604 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 146 + Minor (reclaiming a frame) page faults: 61791 + Voluntary context switches: 174 + Involuntary context switches: 877 + Swaps: 0 + File system inputs: 17992 + File system outputs: 248 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/docs/validation/selected-discovery-evidence/dependency-r0-final.json.gz b/docs/validation/selected-discovery-evidence/dependency-r0-final.json.gz new file mode 100644 index 0000000000..a9ec6a671e Binary files /dev/null and b/docs/validation/selected-discovery-evidence/dependency-r0-final.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/dependency-r0-final.resources.txt b/docs/validation/selected-discovery-evidence/dependency-r0-final.resources.txt new file mode 100644 index 0000000000..0c3c98ac15 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/dependency-r0-final.resources.txt @@ -0,0 +1,23 @@ + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001 OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","src/metaclass_registry","--base","448cdf07e0a0b513a9c9a8f67e896f601da11771","--head","HEAD"];sys.exit(main())" + User time (seconds): 1.41 + System time (seconds): 0.16 + Percent of CPU this job got: 94% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.68 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 45356 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 26270 + Voluntary context switches: 678 + Involuntary context switches: 536 + Swaps: 0 + File system inputs: 0 + File system outputs: 16 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/dependency-r0.json.gz b/docs/validation/selected-discovery-evidence/dependency-r0.json.gz new file mode 100644 index 0000000000..e272aac8d8 Binary files /dev/null and b/docs/validation/selected-discovery-evidence/dependency-r0.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/dependency-r0.resources.txt b/docs/validation/selected-discovery-evidence/dependency-r0.resources.txt new file mode 100644 index 0000000000..793a1a8fe6 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/dependency-r0.resources.txt @@ -0,0 +1,24 @@ +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001 OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","src/metaclass_registry","--base","448cdf07e0a0b513a9c9a8f67e896f601da11771","--head","HEAD"];sys.exit(main())" + User time (seconds): 1.60 + System time (seconds): 0.18 + Percent of CPU this job got: 83% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:02.13 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 45344 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 4 + Minor (reclaiming a frame) page faults: 26279 + Voluntary context switches: 651 + Involuntary context switches: 637 + Swaps: 0 + File system inputs: 40 + File system outputs: 16 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/docs/validation/selected-discovery-evidence/final-cold-profile.log b/docs/validation/selected-discovery-evidence/final-cold-profile.log new file mode 100644 index 0000000000..8290ce24ed --- /dev/null +++ b/docs/validation/selected-discovery-evidence/final-cold-profile.log @@ -0,0 +1,71 @@ +registry imported 1.2322945650084876 +knowledge imported 2.026297816017177 +completed 5.668373255990446 +errors () +content_chars 10174 + 2940675 function calls (2755320 primitive calls) in 3.589 seconds + + Ordered by: cumulative time + List reduced from 6322 to 35 due to restriction <35> + + ncalls tottime percall cumtime percall filename:lineno(function) + 1 0.000 0.000 3.639 3.639 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:547(get_document) + 1 0.000 0.000 3.092 3.092 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:633(_selected_section_content_lines) + 1 0.000 0.000 3.092 3.092 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:883(_official30_source_section_lines) + 1 0.000 0.000 3.092 3.092 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1374(_official30_public_source) + 1 0.000 0.000 2.867 2.867 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/pipeline_import.py:121(import_cellprofiler_pipeline) + 25 0.000 0.000 2.219 0.089 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/openhcs_registry.py:102(discover_source_declarations) + 1 0.000 0.000 2.218 2.218 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/module_declarations.py:400(source_bindings_for_modules) + 1 0.000 0.000 2.211 2.211 /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/core.py:292(discover_matching) + 1 0.062 0.062 2.210 2.210 /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/discovery.py:66(discover_registry_classes) + 775/231 0.004 0.000 1.735 0.008 :1349(_find_and_load) + 548/14 0.003 0.000 1.733 0.124 :1304(_find_and_load_unlocked) + 535/15 0.002 0.000 1.732 0.115 :911(_load_unlocked) + 514/15 0.001 0.000 1.731 0.115 :989(exec_module) + 1428/94 0.001 0.000 1.731 0.018 :480(_call_with_frames_removed) + 2480/15 0.210 0.000 1.665 0.111 {built-in method builtins.exec} + 236/225 0.000 0.000 1.263 0.006 /home/ts/.pyenv/versions/3.12.3/lib/python3.12/importlib/__init__.py:73(import_module) + 9 0.000 0.000 1.262 0.140 /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/discovery.py:26(import_module_preserving_root_logging) + 236/225 0.000 0.000 1.262 0.006 :1375(_gcd_import) + 1870 1.133 0.001 1.133 0.001 {built-in method builtins.compile} + 212/80 0.001 0.000 0.986 0.012 {built-in method builtins.__import__} + 69 0.001 0.000 0.842 0.012 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/openhcs_registry.py:126(eligible) + 1 0.000 0.000 0.646 0.646 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/pipeline_import.py:200(_public_pipeline) + 514 0.004 0.000 0.632 0.001 :1062(get_code) + 74 0.051 0.001 0.611 0.008 /home/ts/.pyenv/versions/3.12.3/lib/python3.12/ast.py:34(parse) + 126 0.000 0.000 0.548 0.004 :1054(source_to_code) + 1 0.000 0.000 0.546 0.546 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1245(_parse_document) + 1 0.000 0.000 0.542 0.542 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:751(_official30_recipe_projection) + 1 0.000 0.000 0.540 0.540 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1047(_official30_module_inventories) + 1 0.001 0.001 0.540 0.540 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1397(_official30_module_inventories_cached) + 953/601 0.001 0.000 0.497 0.001 :1390(_handle_fromlist) + 1 0.000 0.000 0.488 0.488 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/cellprofiler/primary_objects.py:1() + 1 0.000 0.000 0.428 0.428 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/__init__.py:1() + 1 0.000 0.000 0.417 0.417 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/cellprofiler/outlines.py:1() + 1 0.000 0.000 0.386 0.386 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/measurement_dialect.py:1() + 1 0.000 0.000 0.380 0.380 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/pipeline_import.py:293(_parsed_pipeline_declaration) + + + Command being timed: "timeout 60s taskset -c 0 env PYTHONPATH=/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001:/home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src PYTHONDONTWRITECODE=1 PYTHONDONTWRITEBYTECODE=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/diagnose-knowledge-376.py /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/lib/python3.12/site-packages/openhcs" + User time (seconds): 6.15 + System time (seconds): 0.23 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:06.43 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 340944 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 60570 + Voluntary context switches: 5 + Involuntary context switches: 44 + Swaps: 0 + File system inputs: 80 + File system outputs: 16 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/final-focused-source.log b/docs/validation/selected-discovery-evidence/final-focused-source.log new file mode 100644 index 0000000000..18a634a74c --- /dev/null +++ b/docs/validation/selected-discovery-evidence/final-focused-source.log @@ -0,0 +1,48 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 54 items / 1 deselected / 53 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 1%] +tests/unit/agent/test_declaration_selected_discovery.py ..... [ 11%] +. ............................................... [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================= 53 passed, 1 deselected, 2 warnings in 6.44s ================= + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py -k not canonical_custom" + User time (seconds): 6.85 + System time (seconds): 0.27 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.18 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 343340 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 66494 + Voluntary context switches: 4 + Involuntary context switches: 54 + Swaps: 0 + File system inputs: 0 + File system outputs: 312 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/final-owner-source.log b/docs/validation/selected-discovery-evidence/final-owner-source.log new file mode 100644 index 0000000000..2fc3df39ad --- /dev/null +++ b/docs/validation/selected-discovery-evidence/final-owner-source.log @@ -0,0 +1,303 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 77 items / 1 deselected / 76 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 1%] +tests/unit/agent/test_declaration_selected_discovery.py ..... [ 7%] +tests/unit/test_cellprofiler_backend_public_api.py .FFFF................ [ 35%] +.. [ 38%] +. ............................................... [100%] + +=================================== FAILURES =================================== +___ test_raw_callable_reference_construction_does_not_discover_other_modules ___ + + def test_raw_callable_reference_construction_does_not_discover_other_modules() -> None: + script = textwrap.dedent(""" + import importlib + import sys + + implementation_name = "openhcs.processing.backends.cellprofiler.crop" + implementation = importlib.import_module(implementation_name) + raw_crop = vars(implementation)["crop"] + prefix = "openhcs.processing.backends.cellprofiler." + before = { + module_name + for module_name in sys.modules + if module_name.startswith(prefix) + } + + from openhcs.core.function_reference import ( + FunctionReferenceTransportAuthority, + ) + + reference = FunctionReferenceTransportAuthority.function_reference(raw_crop) + after = { + module_name + for module_name in sys.modules + if module_name.startswith(prefix) + } + unrelated = sorted(after - before) + + assert unrelated == [], unrelated + assert reference.import_identity.module_name == implementation_name + assert reference.import_identity.function_name == "crop" + assert reference.composite_key == "openhcs:cellprofiler_crop" + """) + + completed = subprocess.run( + [sys.executable, "-c", script], + check=False, + capture_output=True, + text=True, + ) + +> assert completed.returncode == 0, completed.stderr or completed.stdout +E AssertionError: Traceback (most recent call last): +E File "", line 6, in +E File "/home/ts/.pyenv/versions/3.12.3/lib/python3.12/importlib/__init__.py", line 90, in import_module +E return _bootstrap._gcd_import(name[level:], package, level) +E ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +E File "", line 1387, in _gcd_import +E File "", line 1360, in _find_and_load +E File "", line 1310, in _find_and_load_unlocked +E File "", line 488, in _call_with_frames_removed +E File "", line 1387, in _gcd_import +E File "", line 1360, in _find_and_load +E File "", line 1331, in _find_and_load_unlocked +E File "", line 935, in _load_unlocked +E File "", line 995, in exec_module +E File "", line 488, in _call_with_frames_removed +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/cellprofiler/__init__.py", line 14, in +E from openhcs.processing.backends.lib_registry.openhcs_registry import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/openhcs_registry.py", line 33, in +E from openhcs.processing.backends.lib_registry.unified_registry import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/unified_registry.py", line 66, in +E from openhcs.core.measurement_row_materialization import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/measurement_row_materialization.py", line 23, in +E from openhcs.core._tabular_native import ( +E ModuleNotFoundError: No module named 'openhcs.core._tabular_native' +E +E assert 1 == 0 +E + where 1 = CompletedProcess(args=['/home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python', '-c', '\nimp... from openhcs.core._tabular_native import (\nModuleNotFoundError: No module named \'openhcs.core._tabular_native\'\n').returncode + +tests/unit/test_cellprofiler_backend_public_api.py:80: AssertionError +_____ test_exact_callable_contract_and_preparation_keep_other_modules_lazy _____ + + def test_exact_callable_contract_and_preparation_keep_other_modules_lazy() -> None: + script = textwrap.dedent(""" + import importlib + import sys + + from openhcs.core.callable_contract import ( + CallableImportIdentity, + prepare_processing_callable, + ) + from openhcs.interop.cellprofiler.module_declarations import CellProfilerModule + + module_name = "openhcs.processing.backends.cellprofiler.crop" + raw_crop = vars(importlib.import_module(module_name))["crop"] + prefix = "openhcs.processing.backends.cellprofiler." + before = { + name for name in sys.modules if name.startswith(prefix) + } + + identity = CallableImportIdentity.from_callable(raw_crop) + owner = CellProfilerModule.for_callable_import_identity(identity) + assert owner is not None + assert owner.require_module_name() == "Crop" + prepare_processing_callable(raw_crop) + + after = { + name for name in sys.modules if name.startswith(prefix) + } + assert after == before, sorted(after - before) + assert not CellProfilerModule.__registry__._discovered + """) + + completed = subprocess.run( + [sys.executable, "-c", script], + check=False, + capture_output=True, + text=True, + ) + +> assert completed.returncode == 0, completed.stderr or completed.stdout +E AssertionError: Traceback (most recent call last): +E File "", line 9, in +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/__init__.py", line 9, in +E from openhcs.interop.cellprofiler.measurement_dialect import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/measurement_dialect.py", line 10, in +E from openhcs.core.equivalence import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/equivalence/__init__.py", line 39, in +E from openhcs.core.equivalence.outputs import RuntimeOutputSnapshot +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/equivalence/outputs.py", line 16, in +E from openhcs.core.equivalence.tables import RuntimeTableSnapshot +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/equivalence/tables.py", line 23, in +E from openhcs.core.measurement_row_materialization import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/measurement_row_materialization.py", line 23, in +E from openhcs.core._tabular_native import ( +E ModuleNotFoundError: No module named 'openhcs.core._tabular_native' +E +E assert 1 == 0 +E + where 1 = CompletedProcess(args=['/home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python', '-c', '\nimp... from openhcs.core._tabular_native import (\nModuleNotFoundError: No module named \'openhcs.core._tabular_native\'\n').returncode + +tests/unit/test_cellprofiler_backend_public_api.py:121: AssertionError +__ test_experiment_measurements_use_recorded_owner_without_catalog_discovery ___ + + def test_experiment_measurements_use_recorded_owner_without_catalog_discovery() -> None: + script = textwrap.dedent(""" + import sys + + from openhcs.core.measurement_row_materialization import MeasurementProjectedColumnarRows + from openhcs.core.runtime_measurements import MeasurementScope, MeasurementSubject, MeasurementTable + from openhcs.core.runtime_tabular_values import FieldSpec + from openhcs.interop.cellprofiler.module_declarations import CellProfilerModule + from openhcs.processing.backends.cellprofiler.image_quality import MeasureImageQualityModule + + feature = "ImageQuality_ThresholdOtsu_OrigHoechst_2W" + table = MeasurementTable( + name="MeasureImageQuality_measurements", + rows=MeasurementProjectedColumnarRows( + {feature: (0.2, 0.4)}, + fields=(FieldSpec(feature, float, required=False),), + ), + subject=MeasurementSubject(MeasurementScope.IMAGE, "Image"), + measurement_feature_owner=MeasureImageQualityModule, + ) + prefix = "openhcs.processing.backends.cellprofiler." + before = {name for name in sys.modules if name.startswith(prefix)} + (experiment_table,) = CellProfilerModule.derive_experiment_measurement_tables((table,)) + after = {name for name in sys.modules if name.startswith(prefix)} + + assert experiment_table.name == "MeasureImageQuality_experiment_measurements" + assert before == after, sorted(after - before) + assert not CellProfilerModule.__registry__._discovered + """) + + completed = subprocess.run( + [sys.executable, "-c", script], + check=False, + capture_output=True, + text=True, + ) + +> assert completed.returncode == 0, completed.stderr or completed.stdout +E AssertionError: Traceback (most recent call last): +E File "", line 4, in +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/measurement_row_materialization.py", line 23, in +E from openhcs.core._tabular_native import ( +E ModuleNotFoundError: No module named 'openhcs.core._tabular_native' +E +E assert 1 == 0 +E + where 1 = CompletedProcess(args=['/home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python', '-c', '\nimp... from openhcs.core._tabular_native import (\nModuleNotFoundError: No module named \'openhcs.core._tabular_native\'\n').returncode + +tests/unit/test_cellprofiler_backend_public_api.py:161: AssertionError +_______ test_recorded_measurement_owner_lookup_keeps_other_modules_lazy ________ + + def test_recorded_measurement_owner_lookup_keeps_other_modules_lazy() -> None: + script = textwrap.dedent(""" + import sys + + from openhcs.interop.cellprofiler.measurement_dialect import ( + CELLPROFILER_MEASUREMENT_LOOKUP_DIALECT, + cellprofiler_lookup_dialect_for_measurement_owner, + ) + from openhcs.interop.cellprofiler.module_declarations import CellProfilerModule + from openhcs.processing.backends.cellprofiler.intensity import MeasureObjectIntensityModule + + prefix = "openhcs.processing.backends.cellprofiler." + before = {name for name in sys.modules if name.startswith(prefix)} + scoped = cellprofiler_lookup_dialect_for_measurement_owner( + MeasureObjectIntensityModule + ) + lookup = scoped.feature_lookup("Intensity_MeanIntensity_DNA") + assert "mean_intensity_dna" in lookup.field_aliases + assert lookup.source_aliases == ("dna",) + assert cellprofiler_lookup_dialect_for_measurement_owner(None) is ( + CELLPROFILER_MEASUREMENT_LOOKUP_DIALECT + ) + after = {name for name in sys.modules if name.startswith(prefix)} + assert after == before, sorted(after - before) + assert not CellProfilerModule.__registry__._discovered + + global_lookup = CELLPROFILER_MEASUREMENT_LOOKUP_DIALECT.feature_lookup( + "Intensity_MeanIntensity_DNA" + ) + assert lookup.field_aliases == global_lookup.field_aliases + assert lookup.source_aliases == global_lookup.source_aliases + """) + + completed = subprocess.run( + [sys.executable, "-c", script], + check=False, + capture_output=True, + text=True, + ) + +> assert completed.returncode == 0, completed.stderr or completed.stdout +E AssertionError: Traceback (most recent call last): +E File "", line 4, in +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/__init__.py", line 9, in +E from openhcs.interop.cellprofiler.measurement_dialect import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/measurement_dialect.py", line 10, in +E from openhcs.core.equivalence import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/equivalence/__init__.py", line 39, in +E from openhcs.core.equivalence.outputs import RuntimeOutputSnapshot +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/equivalence/outputs.py", line 16, in +E from openhcs.core.equivalence.tables import RuntimeTableSnapshot +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/equivalence/tables.py", line 23, in +E from openhcs.core.measurement_row_materialization import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/measurement_row_materialization.py", line 23, in +E from openhcs.core._tabular_native import ( +E ModuleNotFoundError: No module named 'openhcs.core._tabular_native' +E +E assert 1 == 0 +E + where 1 = CompletedProcess(args=['/home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python', '-c', '\nimp... from openhcs.core._tabular_native import (\nModuleNotFoundError: No module named \'openhcs.core._tabular_native\'\n').returncode + +tests/unit/test_cellprofiler_backend_public_api.py:204: AssertionError +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +=========================== short test summary info ============================ +FAILED tests/unit/test_cellprofiler_backend_public_api.py::test_raw_callable_reference_construction_does_not_discover_other_modules +FAILED tests/unit/test_cellprofiler_backend_public_api.py::test_exact_callable_contract_and_preparation_keep_other_modules_lazy +FAILED tests/unit/test_cellprofiler_backend_public_api.py::test_experiment_measurements_use_recorded_owner_without_catalog_discovery +FAILED tests/unit/test_cellprofiler_backend_public_api.py::test_recorded_measurement_owner_lookup_keeps_other_modules_lazy +=========== 4 failed, 72 passed, 1 deselected, 2 warnings in 14.85s ============ +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py tests/unit/test_cellprofiler_backend_public_api.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py -k not canonical_custom" + User time (seconds): 15.74 + System time (seconds): 0.70 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:16.59 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 406772 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 1 + Minor (reclaiming a frame) page faults: 124676 + Voluntary context switches: 115 + Involuntary context switches: 140 + Swaps: 0 + File system inputs: 1112 + File system outputs: 344 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/docs/validation/selected-discovery-evidence/final-source.log b/docs/validation/selected-discovery-evidence/final-source.log new file mode 100644 index 0000000000..3113156d57 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/final-source.log @@ -0,0 +1,59 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 52 items / 1 error / 1 deselected / 51 selected + +==================================== ERRORS ==================================== +___ ERROR collecting tests/unit/agent/test_official30_knowledge_examples.py ____ +tests/unit/agent/test_official30_knowledge_examples.py:13: in + from openhcs.agent.capabilities import ( +openhcs/agent/capabilities.py:174: in + from openhcs.agent.dto.viewer import ( +openhcs/agent/dto/viewer.py:180: in + class ViewerWindowSnapshotRequest( +openhcs/agent/dto/viewer.py:184: in ViewerWindowSnapshotRequest + WindowSnapshotFrameCondition.RENDER_COMPLETE +E AttributeError: type object 'WindowSnapshotFrameCondition' has no attribute 'RENDER_COMPLETE' +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +=========================== short test summary info ============================ +ERROR tests/unit/agent/test_official30_knowledge_examples.py - AttributeError... +!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!! +================== 1 deselected, 2 warnings, 1 error in 4.73s ================== +Command exited with non-zero status 2 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py tests/unit/agent/test_official30_knowledge_examples.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py -k not canonical_custom" + User time (seconds): 5.13 + System time (seconds): 0.29 + Percent of CPU this job got: 98% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.49 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 260792 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 51727 + Voluntary context switches: 54 + Involuntary context switches: 40 + Swaps: 0 + File system inputs: 2160 + File system outputs: 8 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 2 diff --git a/docs/validation/selected-discovery-evidence/first-source.log b/docs/validation/selected-discovery-evidence/first-source.log new file mode 100644 index 0000000000..0bfd077db4 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/first-source.log @@ -0,0 +1,200 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 4 items / 1 deselected / 3 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 33%] +tests/unit/agent/test_declaration_selected_discovery.py FF [100%] + +=================================== FAILURES =================================== +__ test_independent_declaration_is_selected_with_cooperative_capability[True] __ + +tmp_path = PosixPath('/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/pytest/test_independent_declaration_i0') +monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6d444c4770> +audit_first = True + + @pytest.mark.parametrize("audit_first", [True, False]) + def test_independent_declaration_is_selected_with_cooperative_capability( + tmp_path, monkeypatch, audit_first + ): + events = [] + + class DeclarationAudit: + def __init_subclass__(cls, **kwargs): + events.append(("before", cls.__name__)) + super().__init_subclass__(**kwargs) + events.append(("after", cls.__name__)) + + class AuditBefore(DeclarationAudit, CellProfilerModule): + pass + + class AuditAfter(CellProfilerModule, DeclarationAudit): + pass + + root = AuditBefore if audit_first else AuditAfter + support = ModuleType("selected_declaration_support") + support.Root = root + monkeypatch.setitem(sys.modules, support.__name__, support) + package_name = f"selected_declarations_{audit_first}" + package = tmp_path / package_name + package.mkdir() + (package / "__init__.py").write_text("") + (package / "arbitrary_location.py").write_text( + "from selected_declaration_support import Root\n" + "class IndependentDeclaration(Root):\n" + f" module_name = 'IndependentSelection{audit_first}'\n" + f" aliases = ('IndependentAlias{audit_first}',)\n" + f" function_name = 'independent_selected_function_{audit_first}'\n" + ) + (package / "unrelated.py").write_text( + "raise AssertionError('unrelated module was imported')\n" + ) + monkeypatch.syspath_prepend(str(tmp_path)) + registry = CellProfilerModule.__registry__ + monkeypatch.setattr(registry, "_discovered", False) + monkeypatch.setattr( + registry, "_config", replace(registry._config, discovery_package=package_name) + ) + + def forbid_full_discovery(): + raise AssertionError("selected lookup attempted full discovery") + + monkeypatch.setattr(registry, "_discover", forbid_full_discovery) + events.clear() + try: +> declaration = root.require_module(f"Independent Alias {audit_first}") + +tests/unit/agent/test_declaration_selected_discovery.py:62: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +cls = .AuditBefore'> +module_name = 'Independent Alias True' + + @classmethod + def require_module(cls, module_name: str) -> type["CellProfilerModule"]: + """Return the registered declaration for ``module_name`` or fail.""" + module_type = cls.for_module(module_name) + if module_type is None: +> raise KeyError( + f"No CellProfiler module declaration is registered for {module_name!r}." + ) +E KeyError: "No CellProfiler module declaration is registered for 'Independent Alias True'." + +openhcs/interop/cellprofiler/module_declarations.py:543: KeyError +_ test_independent_declaration_is_selected_with_cooperative_capability[False] __ + +tmp_path = PosixPath('/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/pytest/test_independent_declaration_i1') +monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f6d554b57f0> +audit_first = False + + @pytest.mark.parametrize("audit_first", [True, False]) + def test_independent_declaration_is_selected_with_cooperative_capability( + tmp_path, monkeypatch, audit_first + ): + events = [] + + class DeclarationAudit: + def __init_subclass__(cls, **kwargs): + events.append(("before", cls.__name__)) + super().__init_subclass__(**kwargs) + events.append(("after", cls.__name__)) + + class AuditBefore(DeclarationAudit, CellProfilerModule): + pass + + class AuditAfter(CellProfilerModule, DeclarationAudit): + pass + + root = AuditBefore if audit_first else AuditAfter + support = ModuleType("selected_declaration_support") + support.Root = root + monkeypatch.setitem(sys.modules, support.__name__, support) + package_name = f"selected_declarations_{audit_first}" + package = tmp_path / package_name + package.mkdir() + (package / "__init__.py").write_text("") + (package / "arbitrary_location.py").write_text( + "from selected_declaration_support import Root\n" + "class IndependentDeclaration(Root):\n" + f" module_name = 'IndependentSelection{audit_first}'\n" + f" aliases = ('IndependentAlias{audit_first}',)\n" + f" function_name = 'independent_selected_function_{audit_first}'\n" + ) + (package / "unrelated.py").write_text( + "raise AssertionError('unrelated module was imported')\n" + ) + monkeypatch.syspath_prepend(str(tmp_path)) + registry = CellProfilerModule.__registry__ + monkeypatch.setattr(registry, "_discovered", False) + monkeypatch.setattr( + registry, "_config", replace(registry._config, discovery_package=package_name) + ) + + def forbid_full_discovery(): + raise AssertionError("selected lookup attempted full discovery") + + monkeypatch.setattr(registry, "_discover", forbid_full_discovery) + events.clear() + try: +> declaration = root.require_module(f"Independent Alias {audit_first}") + +tests/unit/agent/test_declaration_selected_discovery.py:62: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +cls = .AuditAfter'> +module_name = 'Independent Alias False' + + @classmethod + def require_module(cls, module_name: str) -> type["CellProfilerModule"]: + """Return the registered declaration for ``module_name`` or fail.""" + module_type = cls.for_module(module_name) + if module_type is None: +> raise KeyError( + f"No CellProfiler module declaration is registered for {module_name!r}." + ) +E KeyError: "No CellProfiler module declaration is registered for 'Independent Alias False'." + +openhcs/interop/cellprofiler/module_declarations.py:543: KeyError +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +=========================== short test summary info ============================ +FAILED tests/unit/agent/test_declaration_selected_discovery.py::test_independent_declaration_is_selected_with_cooperative_capability[True] +FAILED tests/unit/agent/test_declaration_selected_discovery.py::test_independent_declaration_is_selected_with_cooperative_capability[False] +============ 2 failed, 1 passed, 1 deselected, 2 warnings in 30.98s ============ +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true OPENHCS_SUBPROCESS_NO_GPU=1 POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 JAX_PLATFORMS=cpu XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py -k not canonical_custom" + User time (seconds): 29.81 + System time (seconds): 0.60 + Percent of CPU this job got: 96% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:31.67 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 335272 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 173849 + Voluntary context switches: 7 + Involuntary context switches: 5352 + Swaps: 0 + File system inputs: 528 + File system outputs: 64 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/docs/validation/selected-discovery-evidence/integration-376-commands.sh b/docs/validation/selected-discovery-evidence/integration-376-commands.sh new file mode 100644 index 0000000000..c2477afd71 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/integration-376-commands.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Source-only receipt commands, run individually and serially. No installs. +set -eu +export PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 +export OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false +export OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 +export XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-integration-376-20261001/cache +case "$1" in + tests) + cd /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 + exec /usr/bin/time -v timeout 60s taskset -c 0 \ + /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B \ + docs/validation/knowledge-selected-source-tests.py \ + tests/unit/agent/test_knowledge_lazy_conversion_boundary.py \ + tests/unit/agent/test_declaration_selected_discovery.py \ + /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py \ + /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py \ + /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py \ + --basetemp=/home/ts/.cache/agent-scratch/knowledge-selected-integration-376-20261001/pytest \ + -k 'not canonical_custom' + ;; + r0-openhcs) + cd /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 + exec /usr/bin/time -v timeout 60s taskset -c 0 \ + /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c \ + 'import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","openhcs","--base",sys.argv[1],"--head","HEAD"];sys.exit(main())' "$2" + ;; + r0-dependency) + cd /home/ts/wt/metaclass-registry-selected-discovery-376-20261001 + exec /usr/bin/time -v timeout 60s taskset -c 0 \ + /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c \ + 'import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","src/metaclass_registry","--base",sys.argv[1],"--head","HEAD"];sys.exit(main())' "$2" + ;; + *) exit 2 ;; +esac +# Outer caller uses systemd-run --user --scope -p MemoryMax=512M +# -p MemorySwapMax=0 -p CPUQuota=100% -- sh [base]. diff --git a/docs/validation/selected-discovery-evidence/integration-dependency-r0.json.gz b/docs/validation/selected-discovery-evidence/integration-dependency-r0.json.gz new file mode 100644 index 0000000000..32cc0253c8 Binary files /dev/null and b/docs/validation/selected-discovery-evidence/integration-dependency-r0.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/integration-dependency-r0.resources.txt b/docs/validation/selected-discovery-evidence/integration-dependency-r0.resources.txt new file mode 100644 index 0000000000..a4009ff8c0 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/integration-dependency-r0.resources.txt @@ -0,0 +1,24 @@ +Running as unit: run-p2610828-i15189609.scope; invocation ID: eeb5d7781e21453eafa798560a2aafe8 + Command being timed: "timeout 60s taskset -c 0 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","src/metaclass_registry","--base",sys.argv[1],"--head","HEAD"];sys.exit(main()) 34c3097ba449ba9501a5adb8d1e37a660652abaf" + User time (seconds): 1.07 + System time (seconds): 0.16 + Percent of CPU this job got: 93% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.31 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 44376 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 32185 + Voluntary context switches: 696 + Involuntary context switches: 718 + Swaps: 0 + File system inputs: 0 + File system outputs: 16 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/integration-focused-source.log b/docs/validation/selected-discovery-evidence/integration-focused-source.log new file mode 100644 index 0000000000..5ac12e4509 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/integration-focused-source.log @@ -0,0 +1,49 @@ +Running as unit: run-p2607860-i15197535.scope; invocation ID: c6fd3556f1314b52888472f968b3c925 +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 54 items / 1 deselected / 53 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 1%] +tests/unit/agent/test_declaration_selected_discovery.py ..... [ 11%] +. ............................................... [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================= 53 passed, 1 deselected, 2 warnings in 6.49s ================= + Command being timed: "timeout 60s taskset -c 0 /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py --basetemp=/home/ts/.cache/agent-scratch/knowledge-selected-integration-376-20261001/pytest -k not canonical_custom" + User time (seconds): 6.80 + System time (seconds): 0.30 + Percent of CPU this job got: 98% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.22 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 344260 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 69496 + Voluntary context switches: 27 + Involuntary context switches: 1170 + Swaps: 0 + File system inputs: 0 + File system outputs: 304 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/integration-openhcs-r0.json.gz b/docs/validation/selected-discovery-evidence/integration-openhcs-r0.json.gz new file mode 100644 index 0000000000..5a0bfb4d8d Binary files /dev/null and b/docs/validation/selected-discovery-evidence/integration-openhcs-r0.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/integration-openhcs-r0.resources.txt b/docs/validation/selected-discovery-evidence/integration-openhcs-r0.resources.txt new file mode 100644 index 0000000000..b6636aee03 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/integration-openhcs-r0.resources.txt @@ -0,0 +1,24 @@ +Running as unit: run-p2608516-i15158872.scope; invocation ID: 9fe8dc4aa8684d7097db02e9cbe4814d + Command being timed: "timeout 60s taskset -c 0 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","openhcs","--base",sys.argv[1],"--head","HEAD"];sys.exit(main()) 33701725f5b53874c1a18c0837d2c2bb2bb3b99e" + User time (seconds): 9.32 + System time (seconds): 2.64 + Percent of CPU this job got: 86% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:13.76 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 86896 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 481361 + Voluntary context switches: 13110 + Involuntary context switches: 11885 + Swaps: 0 + File system inputs: 0 + File system outputs: 2992 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/openhcs-r0-final.json.gz b/docs/validation/selected-discovery-evidence/openhcs-r0-final.json.gz new file mode 100644 index 0000000000..f0c8ef0b51 Binary files /dev/null and b/docs/validation/selected-discovery-evidence/openhcs-r0-final.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/openhcs-r0-final.resources.txt b/docs/validation/selected-discovery-evidence/openhcs-r0-final.resources.txt new file mode 100644 index 0000000000..d8426f591c --- /dev/null +++ b/docs/validation/selected-discovery-evidence/openhcs-r0-final.resources.txt @@ -0,0 +1,23 @@ + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001 OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","openhcs","--base","e66500e7a","--head","HEAD"];sys.exit(main())" + User time (seconds): 11.78 + System time (seconds): 3.33 + Percent of CPU this job got: 89% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:16.89 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 87444 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 484748 + Voluntary context switches: 12999 + Involuntary context switches: 10365 + Swaps: 0 + File system inputs: 0 + File system outputs: 2992 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.json.gz b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.json.gz new file mode 100644 index 0000000000..1b82713482 Binary files /dev/null and b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.resources.txt b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.resources.txt new file mode 100644 index 0000000000..954f53d05b --- /dev/null +++ b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-24a.resources.txt @@ -0,0 +1,24 @@ +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001 OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","openhcs","--base","e66500e7a","--head","HEAD"];sys.exit(main())" + User time (seconds): 11.62 + System time (seconds): 3.33 + Percent of CPU this job got: 89% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:16.68 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 87464 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 505001 + Voluntary context switches: 13058 + Involuntary context switches: 10434 + Swaps: 0 + File system inputs: 0 + File system outputs: 2992 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.json.gz b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.json.gz new file mode 100644 index 0000000000..c2efbf879d Binary files /dev/null and b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.resources.txt b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.resources.txt new file mode 100644 index 0000000000..e0de745d20 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/openhcs-r0-rejected-5fd.resources.txt @@ -0,0 +1,24 @@ +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001 OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","openhcs","--base","e66500e7a","--head","HEAD"];sys.exit(main())" + User time (seconds): 11.60 + System time (seconds): 3.48 + Percent of CPU this job got: 89% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:16.84 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 87448 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 608960 + Voluntary context switches: 13066 + Involuntary context switches: 10469 + Swaps: 0 + File system inputs: 0 + File system outputs: 2992 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/docs/validation/selected-discovery-evidence/owner-source.log b/docs/validation/selected-discovery-evidence/owner-source.log new file mode 100644 index 0000000000..9eacde3135 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/owner-source.log @@ -0,0 +1,48 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 51 items / 1 deselected / 50 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 2%] +tests/unit/agent/test_declaration_selected_discovery.py .. [ 6%] +. ............................................... [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================= 50 passed, 1 deselected, 2 warnings in 4.93s ================= + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py -k not canonical_custom" + User time (seconds): 5.24 + System time (seconds): 0.26 + Percent of CPU this job got: 98% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.60 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 327192 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 62777 + Voluntary context switches: 4 + Involuntary context switches: 907 + Swaps: 0 + File system inputs: 0 + File system outputs: 248 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/post409-focused-source.log b/docs/validation/selected-discovery-evidence/post409-focused-source.log new file mode 100644 index 0000000000..ed8f481e21 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/post409-focused-source.log @@ -0,0 +1,49 @@ +Running as unit: run-p2625667-i15198593.scope; invocation ID: 96f72fde624d42898c6c36185ede093a +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 54 items / 1 deselected / 53 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 1%] +tests/unit/agent/test_declaration_selected_discovery.py ..... [ 11%] +. ............................................... [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================= 53 passed, 1 deselected, 2 warnings in 6.34s ================= + Command being timed: "timeout 60s taskset -c 0 /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_selected_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_discovery.py /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/tests/test_core.py --basetemp=/home/ts/.cache/agent-scratch/knowledge-selected-integration-376-20261001/pytest -k not canonical_custom" + User time (seconds): 6.73 + System time (seconds): 0.27 + Percent of CPU this job got: 98% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.10 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 344084 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 70441 + Voluntary context switches: 28 + Involuntary context switches: 1171 + Swaps: 0 + File system inputs: 0 + File system outputs: 304 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/post409-openhcs-r0.json.gz b/docs/validation/selected-discovery-evidence/post409-openhcs-r0.json.gz new file mode 100644 index 0000000000..28282d6933 Binary files /dev/null and b/docs/validation/selected-discovery-evidence/post409-openhcs-r0.json.gz differ diff --git a/docs/validation/selected-discovery-evidence/post409-openhcs-r0.resources.txt b/docs/validation/selected-discovery-evidence/post409-openhcs-r0.resources.txt new file mode 100644 index 0000000000..b6b29f817c --- /dev/null +++ b/docs/validation/selected-discovery-evidence/post409-openhcs-r0.resources.txt @@ -0,0 +1,24 @@ +Running as unit: run-p2626163-i15178780.scope; invocation ID: 0affbc31738d42f990ba8d5337933471 + Command being timed: "timeout 60s taskset -c 0 /home/ts/.local/share/uv/python/cpython-3.14-linux-x86_64-gnu/bin/python3.14 -I -B -c import sys;sys.path[:0]=["/home/ts/wt/comms-ratchet-pinned-ui348-20261001/src","/home/ts/wt/basicpy-live-candidate-20260930/.venv/lib/python3.12/site-packages"];from agent_comms.debt_ratchet import main;sys.argv=["agent-comms-ratchet","--root","openhcs","--base",sys.argv[1],"--head","HEAD"];sys.exit(main()) d0b4f5b5e6947c8f9ed5d99f73064145ad678b71" + User time (seconds): 9.11 + System time (seconds): 2.60 + Percent of CPU this job got: 86% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:13.48 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 86916 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 481580 + Voluntary context switches: 13080 + Involuntary context switches: 11852 + Swaps: 0 + File system inputs: 0 + File system outputs: 2992 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/real-callable-newcase.log b/docs/validation/selected-discovery-evidence/real-callable-newcase.log new file mode 100644 index 0000000000..b8242db498 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/real-callable-newcase.log @@ -0,0 +1,46 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 5 items + +tests/unit/agent/test_declaration_selected_discovery.py ..... [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +======================== 5 passed, 2 warnings in 10.52s ======================== + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_declaration_selected_discovery.py" + User time (seconds): 6.13 + System time (seconds): 0.31 + Percent of CPU this job got: 53% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:12.06 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 328900 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 63956 + Voluntary context switches: 46 + Involuntary context switches: 2086 + Swaps: 0 + File system inputs: 8 + File system outputs: 104 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/retrieval-admission-newcase.log b/docs/validation/selected-discovery-evidence/retrieval-admission-newcase.log new file mode 100644 index 0000000000..c3fd2c3424 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/retrieval-admission-newcase.log @@ -0,0 +1,46 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 5 items + +tests/unit/agent/test_declaration_selected_discovery.py ..... [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +======================== 5 passed, 2 warnings in 5.19s ========================= + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_declaration_selected_discovery.py" + User time (seconds): 5.60 + System time (seconds): 0.29 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:05.93 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 329736 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 64015 + Voluntary context switches: 4 + Involuntary context switches: 53 + Swaps: 0 + File system inputs: 0 + File system outputs: 104 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/second-source.log b/docs/validation/selected-discovery-evidence/second-source.log new file mode 100644 index 0000000000..1e857c7fe4 --- /dev/null +++ b/docs/validation/selected-discovery-evidence/second-source.log @@ -0,0 +1,47 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 4 items / 1 deselected / 3 selected + +tests/unit/agent/test_knowledge_lazy_conversion_boundary.py . [ 33%] +tests/unit/agent/test_declaration_selected_discovery.py .. [100%] + +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +================= 3 passed, 1 deselected, 2 warnings in 12.60s ================= + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true OPENHCS_SUBPROCESS_NO_GPU=1 POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 JAX_PLATFORMS=cpu XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_knowledge_lazy_conversion_boundary.py tests/unit/agent/test_declaration_selected_discovery.py -k not canonical_custom" + User time (seconds): 12.72 + System time (seconds): 0.34 + Percent of CPU this job got: 98% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:13.31 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 337492 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 105416 + Voluntary context switches: 4 + Involuntary context switches: 2206 + Swaps: 0 + File system inputs: 0 + File system outputs: 40 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/selected-cold-profile.log b/docs/validation/selected-discovery-evidence/selected-cold-profile.log new file mode 100644 index 0000000000..5ad0bba48e --- /dev/null +++ b/docs/validation/selected-discovery-evidence/selected-cold-profile.log @@ -0,0 +1,71 @@ +registry imported 1.1964867770439014 +knowledge imported 1.9429323250078596 +completed 7.344517178018577 +errors () +content_chars 10174 + 6885369 function calls (6805027 primitive calls) in 5.332 seconds + + Ordered by: cumulative time + List reduced from 6316 to 35 due to restriction <35> + + ncalls tottime percall cumtime percall filename:lineno(function) + 1 0.000 0.000 5.400 5.400 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:547(get_document) + 1 0.000 0.000 4.874 4.874 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:633(_selected_section_content_lines) + 1 0.000 0.000 4.874 4.874 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:883(_official30_source_section_lines) + 1 0.000 0.000 4.870 4.870 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1374(_official30_public_source) + 1 0.000 0.000 4.407 4.407 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/pipeline_import.py:121(import_cellprofiler_pipeline) + 25 0.000 0.000 3.611 0.144 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/openhcs_registry.py:57(discover_source_declarations) + 1 0.000 0.000 3.609 3.609 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/module_declarations.py:400(source_bindings_for_modules) + 1 0.000 0.000 3.602 3.602 /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/core.py:286(discover_matching) + 1 0.082 0.082 3.601 3.601 /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/discovery.py:66(discover_registry_classes) + 69 0.123 0.002 2.156 0.031 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/openhcs_registry.py:81(eligible) + 775/231 0.004 0.000 1.820 0.008 :1349(_find_and_load) + 548/14 0.003 0.000 1.819 0.130 :1304(_find_and_load_unlocked) + 535/15 0.002 0.000 1.817 0.121 :911(_load_unlocked) + 514/15 0.001 0.000 1.816 0.121 :989(exec_module) + 1428/94 0.002 0.000 1.816 0.019 :480(_call_with_frames_removed) + 2480/15 0.217 0.000 1.742 0.116 {built-in method builtins.exec} + 236/225 0.000 0.000 1.321 0.006 /home/ts/.pyenv/versions/3.12.3/lib/python3.12/importlib/__init__.py:73(import_module) + 9 0.000 0.000 1.321 0.147 /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/discovery.py:26(import_module_preserving_root_logging) + 236/225 0.000 0.000 1.321 0.006 :1375(_gcd_import) + 353291 0.250 0.000 1.299 0.000 /home/ts/.pyenv/versions/3.12.3/lib/python3.12/ast.py:369(walk) + 1870 1.182 0.001 1.182 0.001 {built-in method builtins.compile} + 212/80 0.001 0.000 1.034 0.013 {built-in method builtins.__import__} + 353234 0.164 0.000 0.981 0.000 {method 'extend' of 'collections.deque' objects} + 708790 0.374 0.000 0.817 0.000 /home/ts/.pyenv/versions/3.12.3/lib/python3.12/ast.py:269(iter_child_nodes) + 1 0.000 0.000 0.795 0.795 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/interop/cellprofiler/pipeline_import.py:200(_public_pipeline) + 514 0.004 0.000 0.657 0.001 :1062(get_code) + 74 0.061 0.001 0.642 0.009 /home/ts/.pyenv/versions/3.12.3/lib/python3.12/ast.py:34(parse) + 126 0.000 0.000 0.565 0.004 :1054(source_to_code) + 1022/670 0.002 0.000 0.538 0.001 :1390(_handle_fromlist) + 1 0.000 0.000 0.525 0.525 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1245(_parse_document) + 1 0.000 0.000 0.521 0.521 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:751(_official30_recipe_projection) + 1 0.000 0.000 0.519 0.519 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1047(_official30_module_inventories) + 1 0.001 0.001 0.519 0.519 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/agent/services/knowledge_base_service.py:1397(_official30_module_inventories_cached) + 1 0.000 0.000 0.483 0.483 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/cellprofiler/primary_objects.py:1() + 1 0.000 0.000 0.461 0.461 /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/cellprofiler/outlines.py:1() + + + Command being timed: "timeout 60s taskset -c 0 env PYTHONPATH=/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001:/home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src PYTHONDONTWRITEBYTECODE=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/diagnose-knowledge-376.py /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/lib/python3.12/site-packages/openhcs" + User time (seconds): 7.43 + System time (seconds): 0.25 + Percent of CPU this job got: 85% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:08.96 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 335140 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 4 + Minor (reclaiming a frame) page faults: 60075 + Voluntary context switches: 7 + Involuntary context switches: 1649 + Swaps: 0 + File system inputs: 392 + File system outputs: 16 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 0 diff --git a/docs/validation/selected-discovery-evidence/source-roundtrip-newcase.log b/docs/validation/selected-discovery-evidence/source-roundtrip-newcase.log new file mode 100644 index 0000000000..055310a63f --- /dev/null +++ b/docs/validation/selected-discovery-evidence/source-roundtrip-newcase.log @@ -0,0 +1,156 @@ +Interpreter: /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python 3.12.3 (main, May 22 2025, 14:39:13) [GCC 14.2.1 20250207] +Discovery owner: /home/ts/wt/metaclass-registry-selected-discovery-376-20261001/src/metaclass_registry/__init__.py +============================= test session starts ============================== +platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0 +rootdir: /home/ts/wt/openhcs-knowledge-declaration-source-376-20261001 +configfile: pytest.ini +collected 5 items + +tests/unit/agent/test_declaration_selected_discovery.py ....F [100%] + +=================================== FAILURES =================================== +________ test_examplehuman_selected_source_uses_same_declaration_owner _________ + +monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fe58d27cec0> + + def test_examplehuman_selected_source_uses_same_declaration_owner(monkeypatch): + def forbid_full_discovery(): + raise AssertionError("selected example requested whole-family discovery") + + monkeypatch.setattr(CellProfilerModule.__registry__, "_discover", forbid_full_discovery) + document = KnowledgeBaseService().get_document( + KnowledgeBaseDocumentRequest.from_fields( + document_id="openhcs_official30_benchmark_recipes", + section_id="examplehuman-openhcs-python", + max_chars=50000, + ) + ) + assert not document.errors, document.errors + assert "pipeline_steps" in document.content + source = dedent(document.content.split(".. code-block:: python\n\n", 1)[1]) +> assert PipelineDocumentAuthority.from_source(source).pipeline_steps + +tests/unit/agent/test_declaration_selected_discovery.py:124: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ +openhcs/core/pipeline_document.py:80: in from_source + exec(code, namespace) +:159: in + ??? +openhcs/processing/func_registry.py:312: in get_function + metadata = RegistryService.get_all_functions_with_metadata().get(function_id) +openhcs/processing/backends/lib_registry/registry_service.py:79: in get_all_functions_with_metadata + cls.prepare_persistent_catalog( +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +cls = + + @classmethod + def prepare_persistent_catalog( + cls, + *, + status_callback: RegistryPreparationCallback | None = None, + cancellation: OperationCancellation | None = None, + ) -> None: + """Prepare catalog metadata in a dedicated interpreter main thread.""" + + if cancellation is not None and cancellation.requested(): + raise CancelledError + status_callback = status_callback or logger.debug + status_callback("Preparing function catalog metadata") + + policy = BackgroundProcessLaunchPolicy.current(detached=False) + command = ( + policy.python_executable(sys.executable), + *OpenHCSRuntimeImportAuthority.current().module_process_arguments( + "openhcs.runtime.zmq_execution_server_launcher" + ), + "--prepare-capabilities", + "--log-level", + "WARNING", + ) + with tempfile.TemporaryFile(mode="w+", encoding="utf-8") as output: + process = subprocess.Popen( + command, + stdout=output, + stderr=subprocess.STDOUT, + text=True, + env=MemoryType.subprocess_environment(), + **policy.popen_arguments(), + ) + owned_process = endpoint_process(process) + try: + process_exit = owned_process.wait_for_exit(0.1) + while process_exit is None: + if cancellation is not None and cancellation.requested(): + raise CancelledError + process_exit = owned_process.wait_for_exit(0.1) + except BaseException: + if owned_process.is_alive(): + owned_process.stop() + raise + output.seek(0) + detail = output.read().strip() + if process_exit.returncode != 0: +> raise RuntimeError( + "Function registry preparation process failed" + + (f": {detail[-4000:]}" if detail else ".") + ) +E RuntimeError: Function registry preparation process failed: Traceback (most recent call last): +E File "", line 1, in +E File "", line 226, in run_module +E File "", line 98, in _run_module_code +E File "", line 88, in _run_code +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/runtime/zmq_execution_server_launcher.py", line 232, in +E main() +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/runtime/zmq_execution_server_launcher.py", line 152, in main +E capability_preparer() +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/runtime/function_catalog_preparation.py", line 36, in prepare_persistent_catalog +E from openhcs.processing.backends.lib_registry.registry_service import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/registry_service.py", line 27, in +E from .unified_registry import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/processing/backends/lib_registry/unified_registry.py", line 66, in +E from openhcs.core.measurement_row_materialization import ( +E File "/home/ts/wt/openhcs-knowledge-declaration-source-376-20261001/openhcs/core/measurement_row_materialization.py", line 23, in +E from openhcs.core._tabular_native import ( +E ModuleNotFoundError: No module named 'openhcs.core._tabular_native' + +openhcs/processing/backends/lib_registry/registry_service.py:253: RuntimeError +=============================== warnings summary =============================== +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_default_fixture_loop_scope + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +../../code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441 + /home/ts/code/projects/openhcs/.venv/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode + + self._warn_or_fail_if_strict(f"Unknown config option: {key}\n") + +-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html +=========================== short test summary info ============================ +FAILED tests/unit/agent/test_declaration_selected_discovery.py::test_examplehuman_selected_source_uses_same_declaration_owner +=================== 1 failed, 4 passed, 2 warnings in 6.60s ==================== +Command exited with non-zero status 1 + Command being timed: "timeout 60s taskset -c 0 env PYTHONDONTWRITEBYTECODE=1 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 OPENHCS_CPU_ONLY=true POLYSTORE_IMAGEJ_ALLOW_DOWNLOAD=false OMP_NUM_THREADS=1 OPENBLAS_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMBA_NUM_THREADS=1 XDG_CACHE_HOME=/home/ts/.cache/agent-scratch/knowledge-selected-source-376-20261001/cache /home/ts/wt/openhcs-generated-inputs-installed-parent-20261001/.venv/bin/python -B docs/validation/knowledge-selected-source-tests.py tests/unit/agent/test_declaration_selected_discovery.py" + User time (seconds): 6.80 + System time (seconds): 0.52 + Percent of CPU this job got: 99% + Elapsed (wall clock) time (h:mm:ss or m:ss): 0:07.38 + Average shared text size (kbytes): 0 + Average unshared data size (kbytes): 0 + Average stack size (kbytes): 0 + Average total size (kbytes): 0 + Maximum resident set size (kbytes): 368108 + Average resident set size (kbytes): 0 + Major (requiring I/O) page faults: 0 + Minor (reclaiming a frame) page faults: 92814 + Voluntary context switches: 33 + Involuntary context switches: 64 + Swaps: 0 + File system inputs: 384 + File system outputs: 120 + Socket messages sent: 0 + Socket messages received: 0 + Signals delivered: 0 + Page size (bytes): 4096 + Exit status: 1 diff --git a/external/metaclass-registry b/external/metaclass-registry index 448cdf07e0..3294a69dab 160000 --- a/external/metaclass-registry +++ b/external/metaclass-registry @@ -1 +1 @@ -Subproject commit 448cdf07e0a0b513a9c9a8f67e896f601da11771 +Subproject commit 3294a69dabc9f99dd646c32571b8f97cc139d378 diff --git a/openhcs/interop/cellprofiler/module_declarations.py b/openhcs/interop/cellprofiler/module_declarations.py index 0957ca9340..196f030113 100644 --- a/openhcs/interop/cellprofiler/module_declarations.py +++ b/openhcs/interop/cellprofiler/module_declarations.py @@ -382,7 +382,7 @@ def __init_subclass__(cls, **kwargs: object) -> None: @classmethod def declared_function_names(cls) -> tuple[str, ...]: - """Return the primary and variant function names declared by this module.""" + """Project this module's primary/variant declaration into catalog names.""" if cls.function_name is None: return () return (str(cls.function_name), *cls.function_variants) @@ -411,6 +411,11 @@ def source_bindings_for_modules( "CellProfiler source binding import requires SourceBindingsConfig, " f"got {type(config).__name__}." ) + modules = tuple(modules) + cls.discover_source_declarations( + frozenset(_module_lookup_key(module.name) for module in modules if module.enabled), + ("module_name", "aliases"), _module_lookup_key, _declared_lookup_keys, + ) for module in modules: if not module.enabled: continue @@ -437,30 +442,6 @@ def uses_cellprofiler_runtime_adapter(cls) -> bool: return True - @classmethod - def for_backend_function_name( - cls, - function_name: str, - ) -> type["CellProfilerModule"] | None: - """Resolve a function exposed inside the CellProfiler backend namespace.""" - normalized_name = _required_string( - function_name, - "function_name", - cls.__name__, - ) - matches = tuple( - module_type - for module_type in cls.__registry__.values() - if normalized_name in module_type.declared_function_names() - ) - if len(matches) > 1: - raise ValueError( - f"CellProfiler function {normalized_name!r} is owned by multiple " - "module declarations: " - f"{tuple(item.require_module_name() for item in matches)!r}." - ) - return matches[0] if matches else None - @classmethod def for_callable_import_identity( cls, @@ -626,14 +607,11 @@ def _install_callable_parameter_help( def for_module(cls, module_name: str) -> type["CellProfilerModule"] | None: """Return the registered module class for a canonical name or alias.""" lookup_key = _module_lookup_key(module_name) - for module_type in cls.__registry__.values(): - if _module_lookup_key(module_type.require_module_name()) == lookup_key: - return module_type - if lookup_key in { - _module_lookup_key(alias) for alias in module_type.aliases - }: - return module_type - return None + matches = cls.discover_source_declarations( + frozenset((lookup_key,)), ("module_name", "aliases"), _module_lookup_key, + _declared_lookup_keys, + ) + return matches[0] if matches else None @classmethod def invocation_module_blocks( diff --git a/openhcs/processing/backends/lib_registry/openhcs_registry.py b/openhcs/processing/backends/lib_registry/openhcs_registry.py index e686a590f7..fdd566aa74 100644 --- a/openhcs/processing/backends/lib_registry/openhcs_registry.py +++ b/openhcs/processing/backends/lib_registry/openhcs_registry.py @@ -21,7 +21,7 @@ from weakref import WeakKeyDictionary import numpy as np -from metaclass_registry import import_module_preserving_root_logging +from metaclass_registry import LazyDiscoveryDict, import_module_preserving_root_logging from openhcs.constants import VALID_MEMORY_TYPES, MemoryType from openhcs.core.callable_contract import ( @@ -49,16 +49,120 @@ def openhcs_registry_functions(self) -> tuple[Callable[..., Any], ...]: """Return processing functions owned by this module's catalog.""" +class _CatalogDeclarationSourceSelection(ast.NodeVisitor): + """Read declaration eligibility through Python's native AST traversal owner.""" + + def __init__( + self, keys: frozenset[str], attributes: tuple[str, ...], + normalize: Callable[[str], str], + ) -> None: + self.keys = keys + self.attributes = attributes + self.normalize = normalize + self.selected = False + + def visit_FunctionDef(self, node: ast.FunctionDef) -> None: + """Function bodies cannot supply enclosing class declaration fields.""" + + def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef) -> None: + """Async function bodies are likewise outside class-field ownership.""" + + def visit_ClassDef(self, node: ast.ClassDef) -> None: + for statement in node.body: + if isinstance(statement, ast.Assign): + targets = statement.targets + elif isinstance(statement, ast.AnnAssign): + targets = (statement.target,) + else: + continue + if not any( + isinstance(target, ast.Name) and target.id in self.attributes + for target in targets + ): + continue + try: + value = ast.literal_eval(statement.value) + except (ValueError, TypeError): + self.selected = True + return + if value is None: + continue + values = (value,) if isinstance(value, str) else value + if any(self.normalize(item) in self.keys for item in values): + self.selected = True + return + self.generic_visit(node) + + class OpenHCSFunctionCatalogDeclaration(ABC): """Nominal declaration that assigns local callables to one catalog module.""" registry_catalog_module: ClassVar[str | None] = None + __registry__: ClassVar[LazyDiscoveryDict] + + @classmethod + def discover_source_declarations( + cls, + lookup_keys: frozenset[str], + attributes: tuple[str, ...], + normalize: Callable[[str], str], + declared_keys: Callable[[type], frozenset[str]], + ) -> tuple[type, ...]: + """Select declaration sources, then read the original registered owners. + + Source literals are eligibility only, never registered membership or + callable metadata. Nonliteral declarations must be imported to resolve + their value; failures remain authoritative. No projection is cached. + """ + missing = lookup_keys.difference( + key for declaration in dict.values(cls.__registry__) + for key in declared_keys(declaration) + ) + if not missing: + return tuple( + declaration for declaration in dict.values(cls.__registry__) + if lookup_keys.intersection(declared_keys(declaration)) + ) + + def eligible(module_name: str) -> bool: + spec = importlib.util.find_spec(module_name) + if spec is None or not isinstance(spec.loader, importlib.abc.InspectLoader): + raise ImportError(f"No declaration source loader for {module_name!r}") + source = spec.loader.get_source(module_name) + if source is None: + raise ImportError(f"No declaration source for {module_name!r}") + module_ast = ast.parse(source, filename=spec.origin or module_name) + selection = _CatalogDeclarationSourceSelection(missing, attributes, normalize) + selection.visit(module_ast) + return selection.selected + + cls.__registry__.discover_matching(eligible) + return tuple( + declaration for declaration in dict.values(cls.__registry__) + if lookup_keys.intersection(declared_keys(declaration)) + ) @classmethod @abstractmethod def declared_function_names(cls) -> tuple[str, ...]: """Return the local callable names owned by this declaration.""" + @classmethod + def for_backend_function_name(cls, function_name: str) -> type | None: + """Resolve one function through this nominal catalog's declarations.""" + if not isinstance(function_name, str) or not function_name.strip(): + raise ValueError(f"{cls.__name__}.function_name must be a non-empty string.") + matches = cls.discover_source_declarations( + frozenset((function_name,)), ("function_name", "function_variants"), str, + lambda declaration: frozenset(declaration.declared_function_names()), + ) + if len(matches) > 1: + raise ValueError( + f"Function {function_name!r} is owned by multiple catalog " + f"declarations: {tuple(owner.__name__ for owner in matches)!r}." + ) + return matches[0] if matches else None + @classmethod def require_registry_catalog_module(cls) -> str: """Return the non-empty catalog module declared by this owner.""" diff --git a/tests/unit/agent/test_declaration_selected_discovery.py b/tests/unit/agent/test_declaration_selected_discovery.py new file mode 100644 index 0000000000..9d971b50b8 --- /dev/null +++ b/tests/unit/agent/test_declaration_selected_discovery.py @@ -0,0 +1,127 @@ +"""Declaration-only extension through real imports and cooperative class hooks.""" + +import importlib +import sys +from dataclasses import replace +from types import ModuleType + +import pytest + +from openhcs.interop.cellprofiler.module_declarations import CellProfilerModule +from openhcs.agent.dto.knowledge import KnowledgeBaseDocumentRequest +from openhcs.agent.services.knowledge_base_service import KnowledgeBaseService +from openhcs.processing.backends.lib_registry.registry_service import RegistryService + + +@pytest.mark.parametrize("audit_first", [True, False]) +@pytest.mark.parametrize("computed_name", [False, True]) +def test_independent_declaration_is_selected_with_cooperative_capability( + tmp_path, monkeypatch, audit_first, computed_name +): + events = [] + + class DeclarationAudit: + def __init_subclass__(cls, **kwargs): + events.append(("before", cls.__name__)) + super().__init_subclass__(**kwargs) + events.append(("after", cls.__name__)) + + class AuditBefore(DeclarationAudit, CellProfilerModule): + pass + + class AuditAfter(CellProfilerModule, DeclarationAudit): + pass + + root = AuditBefore if audit_first else AuditAfter + support = ModuleType("selected_declaration_support") + support.Root = root + monkeypatch.setitem(sys.modules, support.__name__, support) + package_name = f"selected_declarations_{audit_first}_{computed_name}" + package = tmp_path / package_name + package.mkdir() + (package / "__init__.py").write_text("") + (package / "arbitrary_location.py").write_text( + "from selected_declaration_support import Root\n" + "from openhcs.core.memory import numpy\n" + "@numpy\n" + f"def independent_selected_function_{audit_first}(image):\n" + " raise AssertionError('lookup must not execute processing')\n" + "class IndependentDeclaration(Root):\n" + + (f" module_name = 'IndependentSelection' + str({audit_first})\n" + if computed_name else f" module_name = 'IndependentSelection{audit_first}'\n") + + f" aliases = ('IndependentAlias{audit_first}',)\n" + f" function_name = 'independent_selected_function_{audit_first}'\n" + ) + (package / "unrelated.py").write_text( + "raise AssertionError('unrelated module was imported')\n" + ) + monkeypatch.syspath_prepend(str(tmp_path)) + registry = CellProfilerModule.__registry__ + monkeypatch.setattr(registry, "_discovered", False) + monkeypatch.setattr( + registry, "_config", replace(registry._config, discovery_package=package_name) + ) + + def forbid_full_discovery(): + raise AssertionError("selected lookup attempted full discovery") + + monkeypatch.setattr(registry, "_discover", forbid_full_discovery) + events.clear() + try: + declaration = root.require_module(f"INDEPENDENTALIAS{audit_first}".upper()) + assert declaration.__module__ == f"{package_name}.arbitrary_location" + assert declaration is root.for_module(f"IndependentSelection{audit_first}") + assert declaration is root.for_backend_function_name( + f"independent_selected_function_{audit_first}" + ) + implementation = declaration.require_callable() + assert implementation is vars(sys.modules[declaration.__module__])[ + f"independent_selected_function_{audit_first}" + ] + assert events == [ + ("before", "IndependentDeclaration"), + ("after", "IndependentDeclaration"), + ] + assert not registry._discovered + assert f"{package_name}.unrelated" not in sys.modules + assert root.for_module("MissingIndependentDeclaration") is None + with pytest.raises(KeyError): + root.require_module("MissingIndependentDeclaration") + (package / "collision.py").write_text( + "from selected_declaration_support import Root\n" + "class ConflictingDeclaration(Root):\n" + f" module_name = 'IndependentSelection{audit_first}'\n" + " aliases = ('ForcedCollisionSelection',)\n" + ) + importlib.invalidate_caches() + with pytest.raises(ValueError, match="duplicates CellProfiler module names"): + root.for_module("ForcedCollisionSelection") + assert dict.get(registry, f"IndependentSelection{audit_first}") is declaration + finally: + dict.pop(registry, f"IndependentSelection{audit_first}", None) + for name in tuple(sys.modules): + if name == package_name or name.startswith(f"{package_name}."): + monkeypatch.delitem(sys.modules, name) + importlib.invalidate_caches() + + +def test_examplehuman_selected_source_uses_same_declaration_owner(monkeypatch): + def forbid_full_discovery(): + raise AssertionError("selected example requested whole-family discovery") + + monkeypatch.setattr(CellProfilerModule.__registry__, "_discover", forbid_full_discovery) + + def forbid_runtime_preparation(*args, **kwargs): + raise AssertionError("source retrieval attempted runtime preparation") + + monkeypatch.setattr(RegistryService, "prepare_persistent_catalog", forbid_runtime_preparation) + monkeypatch.setattr(RegistryService, "prepare_in_current_process", forbid_runtime_preparation) + document = KnowledgeBaseService().get_document( + KnowledgeBaseDocumentRequest.from_fields( + document_id="openhcs_official30_benchmark_recipes", + section_id="examplehuman-openhcs-python", + max_chars=50000, + ) + ) + assert not document.errors, document.errors + assert "pipeline_steps" in document.content diff --git a/tests/unit/agent/test_knowledge_lazy_conversion_boundary.py b/tests/unit/agent/test_knowledge_lazy_conversion_boundary.py new file mode 100644 index 0000000000..7a22b4c4ca --- /dev/null +++ b/tests/unit/agent/test_knowledge_lazy_conversion_boundary.py @@ -0,0 +1,53 @@ +"""Original source-owner regressions; no remote/runtime/scientific execution.""" + +import pytest + +from openhcs.agent.dto.knowledge import KnowledgeBaseDocumentRequest +from openhcs.agent.services.knowledge_base_service import KnowledgeBaseService +from openhcs.core.memory import numpy +from openhcs.interop.cellprofiler.module_declarations import CellProfilerModule +from openhcs.processing.backends.lib_registry.registry_service import RegistryService +from openhcs.processing.custom_functions.runtime_registry import ( + CustomFunctionLifetime, + CustomFunctionRuntimeRegistry, + project_custom_function, +) +from openhcs.processing.func_registry import get_function + + +def test_selected_source_lookup_does_not_discover_unrelated_declarations(monkeypatch): + registry = CellProfilerModule.__registry__ + original_discover = registry._discover + + def forbid_unrelated_discovery(): + if not registry._discovered: + raise AssertionError("Selected source requested complete backend discovery") + return original_discover() + + monkeypatch.setattr(registry, "_discover", forbid_unrelated_discovery) + document = KnowledgeBaseService().get_document( + KnowledgeBaseDocumentRequest.from_fields( + document_id="openhcs_official30_benchmark_recipes", + section_id="cp-tutorial-pixel-based-classification-openhcs-python", + max_chars=50000, + ) + ) + assert not document.errors, document.errors + assert "pipeline_steps" in document.content + + +def test_canonical_custom_lookup_uses_published_source_owner(monkeypatch): + # An independent custom declaration: no fixture or scientific callable runs. + @numpy + def independent_knowledge_source_probe(image): + raise AssertionError("lookup must never execute scientific work") + + monkeypatch.setattr(RegistryService, "_metadata_cache", {}) + metadata = project_custom_function(independent_knowledge_source_probe) + CustomFunctionRuntimeRegistry.publish(metadata, CustomFunctionLifetime.EPHEMERAL) + try: + assert get_function(metadata.composite_key) is metadata.func + with pytest.raises(KeyError, match="Unknown canonical function ID"): + get_function("openhcs:unknown_knowledge_probe") + finally: + CustomFunctionRuntimeRegistry.remove(metadata.original_name)