Add single Symbolics native/RLM runtime mode #51

Open
lost-rob0t wants to merge 91 commits from feature/symbolics-runtime-mode into main
lost-rob0t commented 2026-08-24 09:52:04 +00:00 (Migrated from github.com)

Part of #1 and #8.

Goal

Make native Agent Zero and the paired Prolog-RLM runtime mutually exclusive behind one explicit Symbolics runtime mode, without moving symbolic policy into Python.

Current slice

  • add always-on _symbolics coordinator with native|rlm mode resolution;
  • support A0_SYMBOLICS_MODE as an explicit deployment override;
  • ship _prolog_rlm and _prolog_context_compiler disabled at the bundled root so raw/source native mode is clean before prompt work;
  • synchronize both plugins together at startup;
  • make the context compiler internally active whenever the coordinator activates RLM mode;
  • fail closed on conflicting project/profile activation overrides instead of allowing a mixed control plane;
  • make mode transitions fail closed and rollback to the full original plugin-state snapshot even if a toggle fails after writing state;
  • make the Nix app/dev shell default to RLM only while no Symbolics mode has been saved, so the settings UI can persistently switch back to Native;
  • keep an explicitly supplied A0_SYMBOLICS_MODE authoritative over the saved setting;
  • consume the current merged Prolog-RLM integration pin 2e1264d80d02fecfb9f946e1328caaf1053e7a3b and retain its reconciled flake.lock;
  • preserve the bounded production/deployment runtime and current main API-health/stateless-OpenRouter/launcher fixes while layering the single runtime-mode coordinator on current main;
  • add an exact-head Symbolics RLM workflow covering mode/plugin/bridge tests and nix flake check;
  • fail CI when flake.lock is stale instead of silently mutating the CI workspace;
  • keep the Nix Python environment on canonical nixpkgs dependency derivations instead of rebuilding heavyweight dependency cones merely to change upstream test policy.

Defaults

  • raw/source checkout: native unless explicitly configured;
  • packaged Nix app/dev shell: rlm until a mode is saved;
  • saved _symbolics mode: authoritative on later starts unless the host explicitly supplies A0_SYMBOLICS_MODE.

Invariants

  • Agent Zero remains host/UI/tool implementation.
  • Prolog-RLM owns symbolic selection/budgeting/planning/authority/effects/verification.
  • no dual native/RLM control plane in one mode;
  • activation is not authority;
  • no arbitrary Prolog escape hatch;
  • committed flake input and lock must describe the same Prolog-RLM revision;
  • runtime toggle state must live under writable usr/, never the read-only Nix store.

Gate status

Draft until the exact candidate head passes lock consistency, the focused Symbolics/context/runtime bridge suite, and nix flake check, including installed Prolog library loading and writable packaged-runtime mode transitions. The prior dependency-cone override design is retired after exact-head CI proved it rebuilt torchaudio and OOM-killed before Symbolics pytest; the current candidate restores canonical dependency derivations and must prove the real integration path at its own exact head.

Part of #1 and #8. ## Goal Make native Agent Zero and the paired Prolog-RLM runtime mutually exclusive behind one explicit Symbolics runtime mode, without moving symbolic policy into Python. ## Current slice - add always-on `_symbolics` coordinator with `native|rlm` mode resolution; - support `A0_SYMBOLICS_MODE` as an explicit deployment override; - ship `_prolog_rlm` and `_prolog_context_compiler` disabled at the bundled root so raw/source native mode is clean before prompt work; - synchronize both plugins together at startup; - make the context compiler internally active whenever the coordinator activates RLM mode; - fail closed on conflicting project/profile activation overrides instead of allowing a mixed control plane; - make mode transitions fail closed and rollback to the full original plugin-state snapshot even if a toggle fails after writing state; - make the Nix app/dev shell default to RLM only while no Symbolics mode has been saved, so the settings UI can persistently switch back to Native; - keep an explicitly supplied `A0_SYMBOLICS_MODE` authoritative over the saved setting; - consume the current merged Prolog-RLM integration pin `2e1264d80d02fecfb9f946e1328caaf1053e7a3b` and retain its reconciled `flake.lock`; - preserve the bounded production/deployment runtime and current main API-health/stateless-OpenRouter/launcher fixes while layering the single runtime-mode coordinator on current `main`; - add an exact-head Symbolics RLM workflow covering mode/plugin/bridge tests and `nix flake check`; - fail CI when `flake.lock` is stale instead of silently mutating the CI workspace; - keep the Nix Python environment on canonical nixpkgs dependency derivations instead of rebuilding heavyweight dependency cones merely to change upstream test policy. ## Defaults - raw/source checkout: `native` unless explicitly configured; - packaged Nix app/dev shell: `rlm` until a mode is saved; - saved `_symbolics` mode: authoritative on later starts unless the host explicitly supplies `A0_SYMBOLICS_MODE`. ## Invariants - Agent Zero remains host/UI/tool implementation. - Prolog-RLM owns symbolic selection/budgeting/planning/authority/effects/verification. - no dual native/RLM control plane in one mode; - activation is not authority; - no arbitrary Prolog escape hatch; - committed flake input and lock must describe the same Prolog-RLM revision; - runtime toggle state must live under writable `usr/`, never the read-only Nix store. ## Gate status Draft until the exact candidate head passes lock consistency, the focused Symbolics/context/runtime bridge suite, and `nix flake check`, including installed Prolog library loading and writable packaged-runtime mode transitions. The prior dependency-cone override design is retired after exact-head CI proved it rebuilt torchaudio and OOM-killed before Symbolics pytest; the current candidate restores canonical dependency derivations and must prove the real integration path at its own exact head.
nsaspy changed title from WIP: Add single Symbolics native/RLM runtime mode to Add single Symbolics native/RLM runtime mode 2026-08-27 19:43:10 +00:00
ci(symbolics): fetch install-nix-action by full URL
Some checks failed
Symbolics RLM / focused (push) Has been cancelled
Symbolics RLM / nix-integration (push) Has been cancelled
Symbolics RLM / focused (pull_request) Failing after 1m29s
Symbolics RLM / nix-integration (pull_request) Has been skipped
d5e229e734
cachix/install-nix-action is not mirrored on data.forgejo.org, so the
runner fails action resolution before any step runs. Reference the
action by its fully-qualified URL instead.
ci(symbolics): drop forgejo token from nix github fetches
Some checks failed
Symbolics RLM / focused (push) Has been cancelled
Symbolics RLM / nix-integration (push) Has been cancelled
Symbolics RLM / focused (pull_request) Failing after 56s
Symbolics RLM / nix-integration (pull_request) Has been skipped
2b4e3d5605
secrets.GITHUB_TOKEN on Forgejo is an instance token, not a GitHub one;
nix tarball fetches with it get HTTP 401 from api.github.com. Fetch the
public flake inputs anonymously.
ci(symbolics): treat artifact export as best-effort
Some checks failed
Symbolics RLM / focused (push) Has been cancelled
Symbolics RLM / nix-integration (push) Has been cancelled
Symbolics RLM / focused (pull_request) Has been cancelled
Symbolics RLM / nix-integration (pull_request) Has been skipped
5a2c976944
This Forgejo instance does not implement the upload-artifact@v4
artifact service, so evidence uploads always fail after the gates ran.
Keep the lock-diff, focused pytest and nix flake check gates
authoritative and make artifact export non-blocking.
ci(symbolics): make the /a0 runtime-layout symlink best-effort
Some checks failed
Symbolics RLM / focused (push) Has been cancelled
Symbolics RLM / nix-integration (push) Has been cancelled
Symbolics RLM / focused (pull_request) Failing after 17m50s
Symbolics RLM / nix-integration (pull_request) Has been skipped
09fcbf546f
/a0 is a display-path abstraction resolved against the runtime base dir
(helpers/files.get_base_dir); only components bypassing that
abstraction need it on disk. Docker executors run as root and still
create and verify the symlink; host executors without privileges now
warn and continue instead of failing.
fix(nix): build nixpkgs mcp without its upstream test suite
Some checks failed
Symbolics RLM / focused (push) Has been cancelled
Symbolics RLM / nix-integration (push) Has been cancelled
Symbolics RLM / nix-integration (pull_request) Has been cancelled
Symbolics RLM / focused (pull_request) Has been cancelled
44ced9c370
mcp's permission tests assume an unprivileged builder and fail when the
docker CI runner builds with root single-user nix (observed in CI:
TestFileResource::test_permission_error DID NOT RAISE ValueError).
Skip the upstream checks via overrideScope so dependants (fastmcp,
litellm) build against the same derivation; project tests still cover
the integration surface.
Merge branch 'main' into feature/symbolics-runtime-mode
Some checks failed
Symbolics RLM / focused (push) Has been cancelled
Symbolics RLM / nix-integration (push) Has been cancelled
Android APK / build (pull_request) Has been cancelled
Symbolics RLM / focused (pull_request) Has been cancelled
Symbolics RLM / nix-integration (pull_request) Has been skipped
8f6a44b373
ci(symbolics): share the heavy-ci queue across workflows
Some checks failed
Symbolics RLM / focused (push) Failing after 19m31s
Symbolics RLM / nix-integration (push) Has been skipped
Symbolics RLM / focused (pull_request) Failing after 16m2s
Symbolics RLM / nix-integration (pull_request) Has been skipped
98e0072153
Parallel nix builds overload the self-hosted runner and get all jobs
cancelled; queue behind the repository-wide heavy-ci group.
fix(nix): sandbox derivation builds on the CI runner
Some checks failed
Symbolics RLM / focused (push) Failing after 7m43s
Symbolics RLM / nix-integration (push) Has been skipped
Symbolics RLM / focused (pull_request) Failing after 20m6s
Symbolics RLM / nix-integration (pull_request) Has been skipped
123079d22d
Without sandboxing the rust/cargo bootstrap chain creates
/homeless-shelter during the build and every later derivation fails its
purity check ('home directory exists'). Sandboxed builds isolate each
derivation's HOME.
ci(symbolics): run nix jobs on the host nix runner
Some checks failed
Symbolics RLM / focused (push) Failing after 1m2s
Symbolics RLM / nix-integration (push) Has been skipped
Symbolics RLM / focused (pull_request) Failing after 1m8s
Symbolics RLM / nix-integration (pull_request) Has been skipped
790e0597b4
The docker runner container cannot sandbox nix builds: unsandboxed
root builds fail the /homeless-shelter purity check mid-chain and
upstream tests assume environments the container lacks. The registered
host runner (nix) has multi-user sandboxed nix with non-root build
users and a warm store; run the nix jobs there and drop the redundant
installer step.
ci(symbolics): use the nix-ci lane
Some checks failed
Symbolics RLM / focused (push) Failing after 1m31s
Symbolics RLM / nix-integration (push) Has been skipped
Symbolics RLM / focused (pull_request) Failing after 1m11s
Symbolics RLM / nix-integration (pull_request) Has been skipped
7d1d50307e
Merge branch 'main' into feature/symbolics-runtime-mode
All checks were successful
Symbolics RLM / focused (pull_request) Successful in 1m24s
Symbolics RLM / nix-integration (pull_request) Successful in 59s
Android APK / build (pull_request) Successful in 24m46s
3d7c227542
All checks were successful
Symbolics RLM / focused (pull_request) Successful in 1m24s
Symbolics RLM / nix-integration (pull_request) Successful in 59s
Android APK / build (pull_request) Successful in 24m46s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/symbolics-runtime-mode:feature/symbolics-runtime-mode
git switch feature/symbolics-runtime-mode

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feature/symbolics-runtime-mode
git switch feature/symbolics-runtime-mode
git rebase main
git switch main
git merge --ff-only feature/symbolics-runtime-mode
git switch feature/symbolics-runtime-mode
git rebase main
git switch main
git merge --no-ff feature/symbolics-runtime-mode
git switch main
git merge --squash feature/symbolics-runtime-mode
git switch main
git merge --ff-only feature/symbolics-runtime-mode
git switch main
git merge feature/symbolics-runtime-mode
git push origin main
Sign in to join this conversation.
No description provided.