Restore deterministic PlUnit aggregate runner #152
Closed
lost-rob0t wants to merge 15 commits from
fix/151-plunit-main-ownership into main
pull from: fix/151-plunit-main-ownership
merge into: nsaspy:main
nsaspy:main
nsaspy:feat/prolog-rlm-language
nsaspy:codex/claude-api-provider
nsaspy:codex/symbolic-experts
nsaspy:codex/openai-api-provider
nsaspy:feat/zai-provider-protocols
nsaspy:hardening/project-semantic-20260911
nsaspy:hardening/ws7-nix-ci-pinning
nsaspy:chore/track-prolog
nsaspy:rage/98-semantic-project-knowledge
nsaspy:fix/339-agent-zero-skill-graph
nsaspy:ci/tree-sitter-runner-labels
nsaspy:issue-293
nsaspy:research/text-streaming
nsaspy:docs/agent-editor-handoff
nsaspy:icon-add
nsaspy:hydra/fleet-jobs-20260904
nsaspy:rage/355-d6-11-plan-native-dispatch
nsaspy:cd/nix-installer-action-url
nsaspy:issue-355
nsaspy:rage/97-query-capture-apis
nsaspy:research/expert-direct-tool-projection
nsaspy:rage/96-versioned-syntax-facts
nsaspy:fix/direct-deadline-typing
nsaspy:dogfood/auto-dig-native-tools
nsaspy:feature/rage-feature-freeze
nsaspy:fix/323-native-batch-cardinality
nsaspy:fix/328-direct-user-namespace-text-string
nsaspy:fix/transient-provider-retry-2026-09-01
nsaspy:fix/openrouter-dotted-tool-result-name
nsaspy:rage/325-native-call-isolation
nsaspy:fix/316-original-batch-effect-isolation
nsaspy:fix/313-per-call-preflight
nsaspy:fix/312-peek-schema-contract
nsaspy:docs/agents-worktree-rule
nsaspy:fix/child-native-capability-narrowing
nsaspy:test/paid-lane-glm-53-flash
nsaspy:docs/spec-seeded-symbolic-plans
nsaspy:rage/290-spec-plan-authority
nsaspy:fix/304-context-peek-selector-contract
nsaspy:fix/298-native-any-json-schema
nsaspy:rage/288-spec-plan-graph-executor
nsaspy:feat/spec-plan-flow-api
nsaspy:prolog-rlm-v1
nsaspy:gpt-5-6-sol-high/questions-for-rlm-prolog-and-lambda-rlm
nsaspy:rage/277-planner-protocol-context
nsaspy:research-approval/rlm-research-026-task-deadlines-20260827135838
nsaspy:research-approval/rlm-research-025-lem-ui-20260827135751
nsaspy:rage/183-live-operator-behavior
nsaspy:agent/127-agentprolog-config
nsaspy:recovery/132-agentprolog-monorepo
nsaspy:rage/223-durable-context-mount-recovery
nsaspy:rage/223-constraint-benchmark-recovery
nsaspy:research-approval/rlm-research-011-managed-context-tool-discovery-20260827054019
nsaspy:feat/research-approval-schema
nsaspy:agent/rrlm-control-plane-research
nsaspy:docs/219-adrrd-review
nsaspy:salvage/231-runtime-status
nsaspy:salvage/231-runtime-status-run
nsaspy:tmp
nsaspy:tmp2
nsaspy:tmp3
nsaspy:rage/245-planner-structural-retry
nsaspy:rage/168-skill-selection-eval
nsaspy:rage/250-skill-catalog-graph
nsaspy:rage/56-result-acceptance
nsaspy:rage/172-parent-resume-replan
nsaspy:rage/175-deadline-policy-recovery
nsaspy:rage/257-provider-tool-choice-normalization
nsaspy:agent/tool-result-projection-presets
nsaspy:fix/234-numeric-schema-bounds
nsaspy:feature/231-rlm-cli-reference-harness
nsaspy:feature/223-durable-context-mounts
nsaspy:feature/223-real-constraint-benchmark
nsaspy:feature/223-real-constraint-benchmark-clean
nsaspy:feature/223-real-constraint-benchmark-final
nsaspy:feature/223-real-constraint-benchmark-impl
nsaspy:feature/223-real-constraint-benchmark-now
nsaspy:feature/223-real-constraint-benchmark-tdd
nsaspy:feature/223-real-constraint-benchmark-work
nsaspy:rage/176-root-planner-tool-projection
nsaspy:rage/172-typed-delegation-policy
nsaspy:rage/175-subagent-deadline-policy
nsaspy:rage/206-prompt-command-runtime
nsaspy:rage/203-subagent-skill-role-provenance
nsaspy:rage/200-permanent-rlm-context
nsaspy:fix/190-cli-help-success
nsaspy:archive/pr-132-agentprolog-config-20260827
nsaspy:feature/117-prolog-skill-activation-linear
nsaspy:feature/117-prolog-skill-activation
nsaspy:fix/194-completion-budget-usage
nsaspy:fix/191-capability-filtered-tool-schemas
nsaspy:fix/185-reasoning-effort
nsaspy:ci/report-workflow-failures-20260825
nsaspy:cleanup/186-remove-legacy-harnesses
nsaspy:fix/185-reasoning-routing
nsaspy:agent/evolution-async-evaluator
nsaspy:rage/181-binding-replay-race
nsaspy:agent/124-deepseek-harness-prolog
nsaspy:rage/144-fallback-closure
nsaspy:rage/164-conversation-metadata
nsaspy:agent/subagent-supervised-call-conformance
nsaspy:fix/160-context-adapter-closed-data
nsaspy:codex/move-agent-zero-adaptor
nsaspy:codex/sol-high-integration
nsaspy:fix/151-plunit-gate
nsaspy:fix/165-evolution-closed-data
nsaspy:fix/162-async-control-exceptions
nsaspy:fix/158-prompt-compiler-closed-dicts
nsaspy:fix/156-registry-destroy-hooks
nsaspy:fix/154-anonymous-dict-canonicalization
nsaspy:fix/flake-lock-reproducibility
nsaspy:agent/issue-142-evolution-kernel
nsaspy:agent/141-flake-runtime-package
nsaspy:agent/rlm-subagent-runtime
nsaspy:agent/144-subagent-fallback-a
nsaspy:agent/107-bound-adapter-metadata
nsaspy:validation/clean-pack-install
nsaspy:fix/45-authoritative-nested-model-events
nsaspy:fix/46-router-safe-live-streaming
nsaspy:agent/prompt-context-compiler
nsaspy:agent/42-canonical-recursive-fingerprints
nsaspy:agent/136-static-load-errors-fail-ci
nsaspy:agent/44-completion-error-usage
nsaspy:fix/67-loader-registry-cleanup
nsaspy:agent/opentui-solid-reference-client-current
nsaspy:agent/95-project-source-registry
nsaspy:feature/issue-117-prolog-skill-compiler
nsaspy:backlog/roadmap-86-merged
nsaspy:agent/opentui-solid-reference-client
nsaspy:79-tool-effect-boundary
nsaspy:agent/prolog-agent-ui-research
nsaspy:agent/conversation-cold-context
nsaspy:agent/94-tree-sitter-ffi
nsaspy:agent/conversation-warm-context
nsaspy:111-opentui-solid-reference-client
nsaspy:109-prolog-agent-ui-v1
nsaspy:agent/conversation-runtime
nsaspy:agent/spec-mode-language
nsaspy:agent/spec-verify-foundation
nsaspy:agent/prompt-compiler-research
nsaspy:reconcile-backlog-postmerge
nsaspy:reconcile-backlog-issues
nsaspy:agent/prolog-agent-roadmap
nsaspy:feature/issue-84-effect-store-migration
nsaspy:fix/issue-80-effect-substrate-adversarial-hardening
nsaspy:feature/issue-57-effect-identity
nsaspy:agent/mcp-declaration-security
nsaspy:agent/external-tool-category-boundary
nsaspy:feature/issue-53-authority-pending-async
nsaspy:feature/issue-54-agent-graph-canonical-async
nsaspy:feature/issue-54-tools-mcp-canonical-async
nsaspy:feature/issue-54-async-canonical-runtime
nsaspy:agent/dual-sync-async-runtime
nsaspy:agent/reconcile-todo-status
nsaspy:feature/issue-20-deep-recursion-experiments
nsaspy:feature/issue-19-cli-demo-trace
nsaspy:feature/issue-18-benchmark-conformance
nsaspy:feature/issue-17-adaptive-recursion
nsaspy:feature/issue-16-durable-artifacts
nsaspy:feature/issue-15-mcp-2026-dual-version
nsaspy:feature/issue-14-mcp-2025-11-25
nsaspy:hotfix/live-tool-native-openrouter
nsaspy:feature/issue-13-chain-runtime
nsaspy:fix/stable-live-repair-gate
nsaspy:fix/live-repair-strategy-parser
nsaspy:feature/issue-12-durable-graph
nsaspy:feature/issue-11-agent-supervision
nsaspy:feature/issue-10-structured-outcomes-repair
nsaspy:feature/issue-9-rlm-completion
nsaspy:feature/issue-8-capability-tools
nsaspy:feature/issue-7-typed-plan-runtime
nsaspy:feature/issue-6-context-store
nsaspy:fix/openrouter-reasoning-response
nsaspy:fix/live-openrouter-smoke-stability
nsaspy:feature/issue-5-openrouter-provider
nsaspy:feature/issue-4-swi-bootstrap
nsaspy:agent/agentic-harness-research
nsaspy:agent/prolog-rlm-foundation
No reviewers
Labels
Clear labels
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
question
Further information is requested
wontfix
This will not be worked on
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm!152
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/151-plunit-main-ownership"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #151.
This is intentionally isolated from active #149 and touches only the focused async runner.
Root cause
test/run_tests.plowns the aggregateinitialization(main, main), but it consultstest/run_tool_mcp_async_tests.pl, which unconditionally registered a laterinitialization(focused_main, main). SWI-Prolog executes the last registeredmain, so CI ran only the focused async cases and false-greened the advertised deterministic PlUnit gate.Fix
Use SWI's load-context
scriptflag sorun_tool_mcp_async_tests.plregistersfocused_mainonly when that file itself is loaded with-s. When consulted byrun_tests.pl, it contributes its reusable predicates/tests but cannot replace aggregate main ownership.This preserves the standalone command:
while restoring:
to the aggregate runner.
Coordination
Do not fold unrelated #144 runtime code into this PR. #149 is actively owned by another worker and remains the place for the supervised subagent implementation/test oracle. Once this lands, #149 should rebase and its test-only state should become genuinely red as intended.
Keep draft until exact-head CI confirms the deterministic job now executes the full PlUnit corpus and the standalone focused runner remains green.
Handoff note: Issue #151 false-green gate repair (continuing work)
Passing this to the next agent. Current state lives on local branch
fix/151-plunit-gate(commit490194b+ uncommitted changes) in the main checkout at/home/unseen/Documents/Projects/prolog-rlm. This branch supersedes the earlierf0b0486approach on this PR; do not treatfix/151-plunit-main-ownershipas current.Done (uncommitted, verified locally)
test/run_tool_mcp_async_tests.pl:initialization(focused_main, main)guarded byprolog_load_context(script, true); standaloneswipl -q -s test/run_tool_mcp_async_tests.plstill green (26 cases).test/deterministic_corpus.pl(new): sole manifest inventory.term_expansionhook (scoped to the corpus-loading window) rejects anyinitialization(_, main)inside aggregate inputs before SWI registers it.message_hookledger converts load-time errors (incl.initialization(..., now)exceptions) into gate failure. Candidate scan requires everytest/**/*_test.plto be include/exclude-classified (live-provider, native/FFI, restart-phase, standalone-runner policies explicit).test/deterministic_runner.pl(new): bounded execution — per-testtimeout(20), whole-runcall_with_time_limit(45), discovery/planned/completed/passed/failed/timeout/blocked/fixme accounting, machine-readable JSON report viaPLUNIT_GATE_REPORT,report_is_valid/1.test/run_tests.pl: thin entrypoint (corpus load → validate → run). Old 211-line runner deleted; no duplicate inventories.test/run_runner_integrity_tests.pl+test/support/*: 19/19 fresh-process adversarial regressions green (hostile main with spoofed sentinels, unstrict-vs-strict load error, missing file, unregistered candidate, empty/subset selection, early/late/multi failures, blocked, condition-skipped, setup failure, duplicates, per-test timeout, SIGTERM, run-budget abort inside and between tests, valid-report happy path)..github/workflows/ci.yml: 50s hard process bound; jq cross-validates the single JSON report (semantic consistency, not three independent regexes); integrity suite wired as a CI step.Key diagnostic finding (pre-existing production bug, NOT a runner regression)
The famous hang
rlm_authority_lifecycle:cancel_queued_approved_execution_never_mutates_after_workers_releasereproduces at commit88b64db(the commit that introduced the test), verified via a temporary git worktree (since removed). Root cause chain:rlm_tool:tool_invoke/7→tool_invoke_async/6→rlm_async_submit(tool_invoke_execute/6)— the entire invocation, including the authority preflight that must decideapproval_required, is queued to the shared bounded scheduler.approval_requiredto be decidable without any worker (that's the documented no-starvation contract; seerlm_authority_test.pl:pending_human_approvals_use_no_shared_workers_and_do_not_starve_work, which passes only because itstool_invoke_asyncfutures happen to get workers).rlm_future_await(Future, infinite)intool_invoke/7blocks forever. Checkpoint bisect confirmed the block is insideinvoke_lifecycle_pending(i.e. insidetool_invoke), beforerlm_approveis even reached.Intended fix direction (design decision left to next agent): make the authority-preflight/admission phase of tool invocation worker-independent (host-side decision), so only the post-approval effectful execution uses the shared scheduler — consistent with the "pending approvals use no shared workers" invariant and the canonical async invariants in AGENTS.md. Do NOT fix by weakening tests or bumping timeouts. Second latent hang:
rlm_effect:parallel_same_effect_has_one_execution_owner(times out at 20s under the watchdog; standalone it passes — order/state dependent). A full-corpus stall was also observed around test ~569 (rlm_conformance) — needs investigation; likely another starvation instance of the same class.Out of scope (do not fix in this slice)
73 pre-existing test failures now exposed (full list in the local session log; includes all of
rlm_effect*,rlm_prompt_compiler,rlm_spec_*,rlm_mcp_declaration_security, etc.). Issue #151 scope is the gate itself; the failures are pre-existing/newly-exposed product bugs. Note many share the "Arguments are not sufficiently instantiated" signature and may have a common root.Remaining work
rlm_effect:parallel_same_effect...and the conformance stall after the fix.timeout 5m swipl -q -s test/run_tests.pl, benchmark deterministic + deep-experiment, CLI demo,git diff --check..env(contains OPENROUTER_API_KEY),.envrc,build.log,proxmox-jobs.sqlite3*,agentProlog/deepseek-harness/must NOT be committed — stage explicitly, and consider .gitignore additions.Constraints from AGENTS.md apply: no gate weakening, no test deletion/renaming-away, TDD, one coherent slice, no merge without explicit authorization.
Superseded by the stronger aggregate runner now on main via #177. Verified current main
7c3561bcc3: runner-integrity 19/19 passed; ownership probe emitted aggregate_main_owner=probe; full gate discovered and completed 74 suites / 762 tests with 762 passed and zero failed, timeout, blocked, or fixme. This stale draft would duplicate and partially weaken current coverage, so it is closed rather than merged.WIP: Restore deterministic PlUnit aggregate runnerto Restore deterministic PlUnit aggregate runnerPull request closed