Skip to content

REQ 118

sergio velderrain edited this page Nov 11, 2026 · 2 revisions

REQ-118: Approved CPU-only model execution options

Requirement

The engine shall construct each local model-review request with the CPU-only execution options explicitly approved for that model before computing its request identity.

Rationale

The canonical review builder did not emit the CPU/thread options required by a newly approved live validation, even though a separate synthetic transport smoke had requested them. Issue #244 addresses that gap without inferring resource safety from prior service configuration, modifying transport payloads after hashing, or reopening the completed scope of epic #229.

Fit Criterion

Actual assisted-benchmark and source-config review requires an explicit projectbuddy/ollama-execution@1 policy with exactly schema, modelDigest, mode, and threads. The digest equals the caller-approved full lowercase model digest; mode is cpu-only, and threads is an integer from 1 through 8 (not a Boolean). Missing/unknown/substituted controls are refused before inference, without defaulting to server settings. The canonical payload contains num_gpu: 0 and num_thread equal to the approved count before budget/request hashing and submission. Source-config records the approved policy with evidence; assisted-run authorization/provenance and checkpoint binding include it, so changing controls refuses checkpoint reuse without replacing old state. Retried requests preserve identical approved options. Loopback-only transport, model identity, context/completion budgets, disclosure/retention, lifecycle deadlines, and no-unowned-unload rules remain intact. Evidence distinguishes requested options and any explicitly observed residency from OS-level enforcement or exclusive service ownership; no GPU/CPU hard cap or absence of other clients is inferred. Supporting a new execution mode, downloading models, or reconfiguring a service is not authorized by this policy.

Verification

Execution-policy cases supporting TEST-119 integrated through PR #245, implementation 2e0698e2e3e57ebf31e1138d1d8b8cb66f1ab63c, merge 04bef2c92fd58a44619ee306f1422591778ca4c7. The canonical policy reproducer failed before implementation; full local suites passed 2,153 Python and 100 .NET tests, with focused slices of 191 Python and 89 generation cases. All seven upstream checks passed, including Ubuntu/Windows source-config jobs. Both adapters' actual HTTP-body tests verify CPU/thread values and request hashes; missing/invalid/Boolean/unknown/mismatched policy is rejected before inference, and changed execution refuses checkpoint reuse. A separately authorized metadata-only live invocation then completed the approved read-only MCP calls and capture/public-PPL integrity checks but was refused with ReviewDeadlineError; no model assessment or successful final receipt was produced, no retry occurred, and server completion remains unconfirmed. This is verified policy construction/integration and a fail-closed live outcome, not a passing benchmark, OS resource attestation, or native-build proof.

Source

SYS-REQ-029; complements REQ-109, REQ-111, REQ-114, and REQ-115

Priority

High

TestID

TEST-119

TestArtifact

scripts/tests/test_assisted_benchmark_review.py (test_cpu_execution_options_are_canonical_before_request_hashing, test_unsupported_execution_policy_prevents_inference, test_actual_wire_payload_and_receipt_hash_include_cpu_controls, execution-policy case in test_changed_checkpoint_identity_is_rejected_without_overwrite); scripts/tests/test_assisted_benchmark_run.py (execution provenance); tools/source-config/ProjectBuddy.SourceConfig.Tests/GenerationTests.cs (ApprovedCpuOptionsAreHashedBeforeActualSubmission, UnsupportedExecutionPolicyNeverContactsTheModel, UnknownOrBooleanExecutionControlsAreRefused); .github/workflows/ci-assurance.yml. Full commands are .venv/bin/python -m pytest scripts/tests/ -q --tb=short and locked source-config restore plus dotnet test ProjectBuddy.SourceConfig.Tests --no-restore. Detailed live authorization and refusal observation remain private; issue #244 holds only minimized public outcomes/hashes.

CodeRef

scripts/assisted_benchmark_contract.py (validate_review_execution, validate_authorization); scripts/assisted_benchmark_review.py (select_evidence, build_review_request, review_evidence, collect_review_inputs, LocalOllama.chat: required policy, canonical options, transport guard and checkpoint binding); scripts/assisted_benchmark_run.py (orchestrate: reviewExecution provenance); tools/source-config/ProjectBuddy.SourceConfig/OllamaReview.cs (ReviewExecutionPolicy.Read, Validate, OllamaReview.ValidateModelIdentity, RunAsync), Generation.cs (settings/evidence), and Program.cs (required --review-execution), under tools/source-config/ProjectBuddy.SourceConfig/.

Status

Implemented in develop; canonical wire/hash/policy regressions and CI verified, scoped live review refused at deadline with no successful assessment or native-build proof

Clone this wiki locally