Skip to content

Gate NVX commands on selected-harness observations - #11093

Merged
lpcox merged 7 commits into
mainfrom
copilot/implement-nvx-observations
Nov 4, 2026
Merged

lpcox merged 7 commits into
mainfrom
copilot/implement-nvx-observations

Conversation

Copilot AI commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

NVX’s one-shot lifecycle lacked selected-harness evidence, leaving applicable requirements unverified. This change probes the directly selected executable inside the same guest before releasing the user command.

  • Observation and admission

    • Start one guest; probe with matching UID/GID, environment, PATH, cwd, and non-login shell.
    • Bound probes to 10 seconds and 4096 bytes; publish sanitized, environment-bound evidence before host eligibility checks and release.
    • Separate read-write probe and read-only release shares. Preserve unconstrained legacy admission and existing immutable proxy pins.
  • Lifecycle and coverage

    • Handle early startup failures without readiness deadlocks; retain exit collection, cancellation, timeout, and cleanup.
    • Terminate probe descendants on timeout and successful completion.
    • Add deterministic context, admission, binding, bounds, and lifecycle regressions.
  • Live acceptance boundary

    • Add provider-free acceptance mode to the existing NVX evidence runner.
    • Record live acceptance as blocked by missing signed runtime artifacts, distro layer, and host tooling—not established by fixtures.
    • Keep bundled constraints empty and feed constraints rejected; no enclave or opaque-session coverage is claimed.

Copilot AI changed the title [WIP] Implement and validate selected-harness observations for NVX commands Gate NVX commands on selected-harness observations Nov 4, 2026
Copilot AI requested a review from lpcox November 4, 2026 15:05
@lpcox
lpcox marked this pull request as ready for review November 4, 2026 15:09
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The probe transport allows unbounded guest writes to host storage, and failure cleanup with --keep-containers can leave launched guests running.

8 open issues
What changed in this PR

Adds selected-harness observations to NVX’s one-shot runtime, connecting guest version probes to AWF’s shared eligibility checks before the user command runs.

Changes:

  • Introduces same-guest probing and host-controlled command release through private shares.
  • Adds deterministic observation, admission and lifecycle coverage, plus a provider-free live-evidence mode.
  • Documents the design and explicitly records live acceptance as blocked by missing prerequisites.
File Description
src/​nvx/​runtime-backend.ts Integrates probing and release into a single NVX execution.
src/​nvx/​runtime-backend.test.ts Adds shell fixtures for context, bounds, admission and lifecycle behavior.
src/​nvx/​harness-observation.ts Implements bounded probes and private probe/release shares.
src/​harness-observation.ts Initializes NVX observations as pending.
src/​harness-observation.test.ts Extends shared evidence and eligibility coverage to NVX.
src/​external-runtime-backend.ts Adds an optional release hook and clarifies probe lifecycle.
src/​commands/​validators/​api-proxy-validator.ts Defers NVX harness eligibility checks to runtime evidence.
src/​commands/​main-action.ts Wires external-runtime release into the workflow.
src/​cli-workflow.ts Generalizes the release-hook comment beyond Docker; no behavior change.
scripts/​ci/​nvx-manager-live-evidence.ts Adds provider-free harness acceptance mode and evidence recording.
docs/​INTEGRATION-TESTS.md Documents fixture coverage, live invocation and acceptance blockers.
docs/​adr/​0004-model-information-management.md Describes NVX observation transport and remaining coverage limits.

Review effort: Max (auto)

Comment thread src/nvx/harness-observation.ts Outdated
Comment on lines +42 to +43
{ tag: 'harness-probe', hostPath: this.directory, guestTarget: GUEST_PROBE, mode: 'rw',
deniedPaths: [], allowedPaths: [], writablePaths: [] },
Comment thread src/nvx/runtime-backend.ts Outdated
Comment on lines 400 to 401
await this.oneShotExecution?.catch(() => undefined);
}
Comment thread src/nvx/harness-observation.ts Outdated
constructor(private readonly context: HarnessContext) {}

async stage(uid: number, gid: number): Promise<readonly NvxLiveMount[]> {
this.root = await fs.mkdtemp(path.join(os.tmpdir(), 'awf-nvx-harness-'));
Comment thread src/nvx/harness-observation.ts Outdated
Comment on lines +54 to +55
const deadline = Date.now() + READY_TIMEOUT_MS;
while (!this.closed && Date.now() < deadline) {
Comment thread src/nvx/harness-observation.ts Outdated
Comment on lines +138 to +141
kill -TERM -- "-$probe" 2>/dev/null || :
if kill -0 -- "-$probe" 2>/dev/null; then
/bin/sleep 1
kill -KILL -- "-$probe" 2>/dev/null || :
Comment thread src/nvx/harness-observation.ts Outdated
if /bin/bash --noprofile --norc -p -c ${quote(bounded)} >${GUEST_PROBE}/stdout 2>/dev/null; then
if [ -f ${GUEST_PROBE}/status ]; then IFS= read -r status <${GUEST_PROBE}/status; else status=126; fi
else
status=$?
Comment thread src/nvx/runtime-backend.test.ts Outdated
child = execa('/bin/sh', ['-c', script], {
env: {}, extendEnv: false, reject: false, detached: true,
});
const abort = () => { if (child?.pid) process.kill(-child.pid, 'SIGTERM'); };
Comment thread src/nvx/runtime-backend.ts Outdated
Comment on lines +147 to +150
this.harnessObservation = new NvxHarnessObservation(harnessContext(this.config));
// Start exactly one guest now, not a second version-only VM. Its command
// remains gated while the workflow publishes evidence and checks eligibility.
this.oneShotExecution = this.executeOnce(this.config.agentTimeout);
@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Reverted the NVX producer, transport, and admission changes to keep this within the current scope, restored the pre-existing manager/test paths, and documented the unsupported observation/live-acceptance boundary. Commit: bfd0b766.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11093 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit af2e887

@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

…-observations

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main and resolved with no conflicts. The two-parent merge commit is 86cb8c6.

lpcox and others added 2 commits November 4, 2026 12:17
Preserve daily security refreshes and local build-tools availability while caching PR image builds across hosted runners. Repair Grype database cache ownership before saving.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reuse daily GitHub Actions build layers across hosted runners while retaining exact local test images, security refreshes, failure reporting and cleanup. Stop selecting Azure mirrors based only on DNS in the agent image.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.74% 93.74% ➡️ +0.00%
Statements 92.29% 92.29% ➡️ +0.00%
Functions 91.66% 93.06% 📈 +1.40%
Branches 86.50% 86.50% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/host-executor-server.ts 91.2% → 91.2% (+0.00%) 89.8% → 90.1% (+0.29%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox merged commit 79a28a8 into main Nov 4, 2026
45 of 46 checks passed
@lpcox
lpcox deleted the copilot/implement-nvx-observations branch November 4, 2026 21:21
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.

Validate current NVX harness execution without changing invocation

3 participants