feat(autonomy): host composition + honest session-scope docs (P0+P1) - #291
Merged
Conversation
…pe docs Phase 0 (honesty): AutonomousIterationHarness and SessionEnvironmentInputs now state precisely what a sandbox session does today - started, attested (image digest, engine version, effective caps, refused if weaker than requested), recorded onto the certificate, torn down with the iteration - and what it does NOT do: the harness never calls ISandboxedSession.ExecAsync, so the candidate's compile, witness, and mutation runs happen in the harness process. Those certificate inputs are provisioning evidence, not a containment guarantee; the write surface is confined separately and genuinely by ProposerConfinement. docs/certification-evidence.md records this as a known v0 limitation alongside a second one: the loop has never run against a live container engine or a real proposer. Phase 1 (composition): AddNexoAutonomy registers the swap host with its quarantine/watch/cadence surfaces, the iteration harness, ClusterBudget, the Docker session runner and reaper, and provenance sinks for both swap and session events (R2.1 - no unlogged path). Options bind from Nexo:Autonomy, default Enabled=false, and ValidateOnStart refuses an enabled-but-incoherent configuration (sessions without an image cannot be attested; retention below 1 leaves no rollback target, violating I-3). Deliberately NO air-gapped refusal, unlike the MCP/A2A protocol surfaces: R6.3 requires autonomy controls to work fully offline, so refusing an air-gapped host would enforce the reverse of the invariant. The reaper ships as a separate opt-in hosted service so one-shot CLI processes are not forced to run a sweeper. The DI resolution test walks every edge rather than resolving the harness alone, because this codebase has already produced a factory-laundered cycle that passed ValidateOnBuild and then recursed at resolution time. It also surfaced a pre-existing defect: AddCertificationInfrastructure alone registers ICompositionCertificationGate without the IBrickRegistry it needs, so it fails ValidateOnBuild - tests compose via AddCertificationGate, and the defect is tracked separately rather than changed here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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 freeto 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
Phases 0 and 1 of the post-merge plan: make the certificate's session semantics honest, then give hosts a way to compose the autonomy loop. No Docker is touched by this PR — the first flight is deliberately the next, separate step.
Phase 0 — what a session actually proves
AutonomousIterationHarnessandSessionEnvironmentInputsnow state it plainly: when aSandboxSpecis supplied the session is started, attested (image digest, engine version, effective caps — refused if weaker than requested), recorded onto the certificate, and torn down with the iteration — but the harness never callsISandboxedSession.ExecAsync, so the candidate's compile, witness, and mutation runs happen in the harness process.Those inputs are therefore provisioning evidence, not a containment guarantee. The write surface is confined separately and genuinely by
ProposerConfinement.docs/certification-evidence.mdrecords this under known v0 limitations, alongside a second honest entry: the loop has never run against a live container engine or a real proposer.Phase 1 —
AddNexoAutonomyRegisters the swap host with its quarantine/watch/cadence surfaces, the iteration harness,
ClusterBudget, the Docker session runner and reaper, and provenance sinks for both swap and session events (R2.1 — no unlogged path from objective to runtime).TryAddthroughout, so a host substitutes any piece by registering it first.Options bind from
Nexo:Autonomy, defaultEnabled=false, andValidateOnStartrefuses an enabled-but-incoherent configuration: sessions without an image cannot be attested, and a retention window below 1 leaves no rollback target — which would violate I-3 outright.Deliberately no air-gapped refusal, unlike the MCP/A2A protocol surfaces. R6.3 requires autonomy controls to work fully offline, so an air-gapped host running a local model is legitimate and refusing it would enforce the reverse of the invariant. A test pins that reasoning.
The reaper is a separate opt-in (
AddNexoAutonomySessionReaper) so a one-shot CLI process isn't forced to run a background sweeper.A latent defect this surfaced
The DI test walks every edge rather than resolving the harness alone — this codebase has already produced a factory-laundered cycle that passed
ValidateOnBuildand then recursed at resolution time. Doing that immediately exposed a pre-existing problem:AddCertificationInfrastructurealone registersICompositionCertificationGatewithout theIBrickRegistryit requires, so it cannot satisfyValidateOnBuild. These tests compose viaAddCertificationGate(what real hosts call); the underlying fix is tracked separately rather than changed inside an autonomy PR.Testing
10 composition facts: full-graph resolution with
ValidateOnBuild/ValidateScopes, shared-singleton authority surfaces, quarantine visibility across paths, fail-closed defaults, the misconfiguration matrix, the air-gapped pin, host substitution, and configuration binding. All green.Verified in a container, and worth recording why. On the Windows host, the CLI end-to-end suites (
FullPipelineE2ETests) failed on this branch and passed onmaster— which looks exactly like a regression. It isn't one. Windows Smart App Control blocks freshly built unsigned assemblies (0x800711C7loadingNexo.Core.Domain.dll), and those tests spawn the CLI, so the child process dies on load and the test reports only "exit 1, expected 0".masterpassed solely because its binaries were already built and allow-listed; any clean rebuild reproduces the failure on either branch.Re-run through
scripts/test-in-container.ps1, where Smart App Control does not apply: 12/12 pass — the 10 composition facts plus both E2E tests. No regression. Thekernel-coveragefloor is still CI's call, since Phase 1 added code to the assembly floored at 80%.make kernel-coverage-gate— runs in CI (Infrastructure paths touched)— n/a (no hosting/API/routing changes)make test-prod-style🤖 Generated with Claude Code