Skip to content

feat(resilience): IResilientExecutor + fold into ProviderFactory (step 1) - #238

Draft
IanFrelinger wants to merge 14 commits into
feat/ide-vscode-bridgefrom
cursor/resilient-executor-afa8
Draft

feat(resilience): IResilientExecutor + fold into ProviderFactory (step 1)#238
IanFrelinger wants to merge 14 commits into
feat/ide-vscode-bridgefrom
cursor/resilient-executor-afa8

Conversation

@IanFrelinger

@IanFrelinger IanFrelinger commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

Refactor Nexo’s generative path toward a Cursor/Claude-Code-style one generic agent + plugins. Fixed engine is domain-neutral; C++ remains a profile, and a SQL profile plugin proves zero core edits to add a language.

Landed (THINK→ACT→TEST per step)

1) IResilientExecutor

  • Ports: RetryPolicy, TransientClassifiers.Network (BCL transport only)
  • ResilientExecutor; folded into ProviderFactory (replaced Polly HTTP retry)
  • Tests: 13 passed

2) ISandboxedCommandRunner + SandboxSpec

  • Mount / NetworkAccess / ResourceLimits; ProcessCommandResult moved to Application ports
  • DockerSandboxedCommandRunner over stubbable IProcessCommandRunner
  • Tests: 6 passed

3) GenerationRepairLoop<T>

  • Draft → IPostValidator chain → feed reasons → redraft → bound
  • Tests: 5 passed

4) GenerativeProvenance + GenerativeBrick

  • Strategy {Deterministic,Templated,Model}; honor AuditMode; route review via IApprovalGate (moved to Application Trust ports)
  • Killed scaffold sentinel (scaffold — no model call) in DepExtract + GUI
  • Tests: 7 passed

5) AgentProfile + GenerativeArtifactBrick

  • Profile ports in Contracts; IAgentProfileRegistry; AddNexoAgentProfile<T>
  • Fixed brick resolves by target — never edited to add a language
  • Tests: 3 passed

6) CppEvtxProfileFactory (reference stub)

  • Registers cpp-evtx with AdapterScaffold as deterministic drafter
  • Full compile/sandbox/deploy migration of CppParserAdapterBrick still follow-on

7) SQL profile plugin (acceptance)

  • New project Nexo.Bricks.SqlProfile: SqlParseValidator, deterministic + repair drafters
  • Register with AddNexoSqlAgentProfile()zero edits to GenerativeArtifactBrick
  • Acceptance tests: deterministic SELECT * FROM events; + empty→repair→SELECT 1;

8) Scratch / path / single-flight (partial)

  • Ports: IScratchSpace, IWorkspacePathPolicy, IManagedFileSet, ISingleFlightGuard
  • Impls: FileScratchSpace, WorkspacePathPolicy (explicit no-op when WORKSPACE_ROOT unset), SingleFlightGuard
  • Still open: IManagedFileSet impl, RequiresNetworkRequiresEgress+RequiresLocalServices split, Nexo.Analyzers Roslyn rule

Neutrality

Contracts/Ports contain no C++/Docker/Ollama/Poco/Qt names. Docker lives only in DockerSandboxedCommandRunner; SQL/C++ names live only in their plugins.

Test status

dotnet test … --filter ResilientExecutor|Sandboxed|GenerationRepair|GenerativeProvenance|GenerativeArtifact|SqlAgentProfile
Passed!  Failed: 0, Passed: 36

(Later re-runs hit intermittent Windows Application Control 0x800711C7 blocking the test DLL after rebuild; builds remain green.)

Follow-ups

  • Finish DepExtract → full CppEvtxProfile (GxxCompileValidator, DockerSandboxProvider, PocoInstallTarget + IManagedFileSet)
  • RequiresEgress / RequiresLocalServices split + Roslyn analyzer for BrickInput/Output keys
Open in Web Open in Cursor 

PlzTouchGrass and others added 14 commits July 27, 2026 18:03
Fail fast unless OLLAMA_BASE_URL is loopback or on NEXO_OLLAMA_ALLOWLIST (default includes compose host ollama). Override only with NEXO_ALLOW_REMOTE_MODEL=1. Log the resolved endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
Apply --network=none plus memory/cpus/pids limits to compile-gate runs and --network=none to InstallExecutor docker build (BuildKit). Enforce wall-clock timeouts on build, compile-gate, and compose recreate/health. Compose service recreate cannot use --network=none (needs /health); documented in code.

Co-authored-by: Cursor <cursoragent@cursor.com>
Default min events is 5 (NEXO_ORACLE_MIN_EVENTS). Require multi-sample agreement and timestamp/row-band field sanity. Model drafts no longer auto-ConfirmModelReview from samples alone; OracleAutoInstall still needs ALL oracle checks to pass for Ok.

Co-authored-by: Cursor <cursoragent@cursor.com>
Prepend NEXO_ADAPTER_PROVENANCE_* block with strategy, model tag/digest, compile-gate, oracle, and reviewed-by on every adapted_reader.hpp install.
Block system/exec/popen/fork/socket/connect, absolute path I/O, and non-allowlisted includes before install. Override only with NEXO_ALLOW_UNSAFE_ADAPTER=1 plus a logged NEXO_UNSAFE_ADAPTER_REASON.
Stage adapted_reader.hpp via temp path, snapshot prior hpp + retag evtx:custom-prev before rebuild, and roll back file/image/compose recreate on build, health, smoke, or post-install oracle failure. Content scan + provenance header applied on the install path.
Resolve tag@sha256 or OLLAMA_MODEL_DIGEST (and local /api/tags) into provenance. Document that the deterministic scaffold path is the reproducible offline path; model drafts still require content scan before install.
These files were already referenced by the committed DepExtract Gui/onboarding path; add them so a clean checkout builds.
Extract domain-neutral retry into Application Resilience ports with TransientClassifiers.Network as the default, implement ResilientExecutor, and replace Polly HTTP retry in ProviderFactory with the shared executor.
Introduce domain-neutral SandboxSpec/Mount/NetworkAccess/ResourceLimits, move ProcessCommandResult to Application ports, and ship DockerSandboxedCommandRunner over IProcessCommandRunner.
Draft → validate → feed reason strings → redraft to a bound, with structured GenerationRepairResult. No toolchain vocabulary.
…ld sentinel

Emit typed provenance from GenerativeBrick, honor AuditMode, route RequiresHumanReview through IApprovalGate (moved to Application Trust ports), and stop using the scaffold magic-string sentinel.
Add domain-neutral profile ports, IAgentProfileRegistry, AddNexoAgentProfile, and the fixed GenerativeArtifactBrick that resolves profiles by target.
Add Nexo.Bricks.SqlProfile as a pure plugin (acceptance), CppEvtxProfileFactory reference surface, and IScratchSpace/IWorkspacePathPolicy/ISingleFlightGuard with default impls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants