feat(resilience): IResilientExecutor + fold into ProviderFactory (step 1) - #238
Draft
IanFrelinger wants to merge 14 commits into
Draft
feat(resilience): IResilientExecutor + fold into ProviderFactory (step 1)#238IanFrelinger wants to merge 14 commits into
IanFrelinger wants to merge 14 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)
IResilientExecutorRetryPolicy,TransientClassifiers.Network(BCL transport only)ResilientExecutor; folded intoProviderFactory(replaced Polly HTTP retry)2)
ISandboxedCommandRunner+SandboxSpecMount/NetworkAccess/ResourceLimits;ProcessCommandResultmoved to Application portsDockerSandboxedCommandRunnerover stubbableIProcessCommandRunner3)
GenerationRepairLoop<T>IPostValidatorchain → feed reasons → redraft → bound4)
GenerativeProvenance+GenerativeBrick{Deterministic,Templated,Model}; honorAuditMode; route review viaIApprovalGate(moved to Application Trust ports)(scaffold — no model call)in DepExtract + GUI5)
AgentProfile+GenerativeArtifactBrickIAgentProfileRegistry;AddNexoAgentProfile<T>target— never edited to add a language6)
CppEvtxProfileFactory(reference stub)cpp-evtxwithAdapterScaffoldas deterministic drafterCppParserAdapterBrickstill follow-on7) SQL profile plugin (acceptance)
Nexo.Bricks.SqlProfile:SqlParseValidator, deterministic + repair draftersAddNexoSqlAgentProfile()— zero edits toGenerativeArtifactBrickSELECT * FROM events;+ empty→repair→SELECT 1;8) Scratch / path / single-flight (partial)
IScratchSpace,IWorkspacePathPolicy,IManagedFileSet,ISingleFlightGuardFileScratchSpace,WorkspacePathPolicy(explicit no-op whenWORKSPACE_ROOTunset),SingleFlightGuardIManagedFileSetimpl,RequiresNetwork→RequiresEgress+RequiresLocalServicessplit,Nexo.AnalyzersRoslyn ruleNeutrality
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
(Later re-runs hit intermittent Windows Application Control
0x800711C7blocking the test DLL after rebuild; builds remain green.)Follow-ups
CppEvtxProfile(GxxCompileValidator, DockerSandboxProvider, PocoInstallTarget +IManagedFileSet)RequiresEgress/RequiresLocalServicessplit + Roslyn analyzer for BrickInput/Output keys