Skip to content

REQ 109

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

REQ-109: Caller-approved Ollama model identity

Requirement

The engine shall accept an Ollama review only when the model observed before and after inference matches the model identity approved by the caller before evidence submission.

Rationale

A stable tag during a request does not establish that its contents were approved. Before PR #237, source-config discovered a digest rather than requiring the caller's expected digest. Issue #230, under epic #229, is now implemented in develop without duplicating base-model selection in issue #217 or configuration generation in issue #219.

Fit Criterion

Both source-config and assisted-benchmark review entry points require an explicit model tag and full SHA-256 digest from caller-approved configuration or per-run authorization; a digest learned from the endpoint cannot supply missing approval. Preflight resolves exactly one approved local model entry and compares its full digest before submitting source-derived text, images, or review prompts. Missing, malformed, ambiguous, or mismatching identity produces zero inference requests. Completion rechecks identity; a substituted tag, changed digest, or failed postflight invalidates the assessment even when its JSON is otherwise valid, without producing configuration validity or a successful review receipt. The receipt binds expected and observed identity, evidence identity, and outcome. Discovery cannot update approval automatically or trigger download/create/delete operations. Literal-loopback transport, disabled redirect/proxy traversal, and deterministic validation retain their restrictions. Identity equality is a point-in-time check, not authenticated attestation of an untrusted daemon; local administrators and the configured local daemon remain within the stated trust boundary.

Verification

Identity regressions supporting TEST-111 pass locally: the full source-config suite has 59 passing .NET tests and the full offline Python suite has 2,024 passing tests; focused identity/generation and review/run slices have 48 and 49 passing tests respectively. All seven upstream PR checks passed, including source-config tests on Ubuntu and Windows. Implementation commit 0e86f6527982fb778a1df7d3055f8204443dcf51 integrated through PR #237 as merge commit a8edbb5257782f7d825e46d48fbcd896787b0d4d. Fake HTTP handlers/transports verify zero-inference preflight rejection, exact approval, postflight substitution/unavailability, and receipt binding; the malformed-inventory Python case first failed against the earlier verifier. No live model attestation, native LabVIEW build, or stable release is claimed. Broader content-privacy/canary qualification remains allocated to REQ-113 rather than inferred from these identity tests.

Source

SYS-REQ-029; related configuration contract REQ-108

Priority

High

TestID

TEST-111

TestArtifact

tools/source-config/ProjectBuddy.SourceConfig.Tests/GenerationTests.cs (InventoryErrorsSendNoEvidence, ApprovedHttpReviewBindsExpectedAndObservedIdentity, InvalidPostflightLeavesNoConfiguration, UnavailablePostflightLeavesNoConfiguration, MalformedInventoryJsonSendsNoEvidence, UnavailablePreflightSendsNoEvidence, UnapprovedReviewIdentityLeavesNoConfiguration); scripts/tests/test_assisted_benchmark_review.py (test_malformed_inventory_entry_prevents_inference, test_invalid_or_duplicate_inventory_prevents_inference, test_missing_or_invalid_model_approval_never_contacts_ollama, test_invalid_postflight_cannot_produce_an_assessment, test_duplicate_json_inventory_fields_are_rejected_before_chat); scripts/tests/test_assisted_benchmark_run.py (approved/verified receipt identity); .github/workflows/ci-assurance.yml source-config and regression checks. Reproduce with locked restore plus dotnet test ProjectBuddy.SourceConfig.Tests --no-restore from tools/source-config, and python3 -m pytest scripts/tests/ -q --tb=short from the engine root.

CodeRef

tools/source-config/ProjectBuddy.SourceConfig/OllamaReview.cs (ValidateModelIdentity, RunAsync, Parse: approval and pre/postflight identity); tools/source-config/ProjectBuddy.SourceConfig/Program.cs (required --model-digest); tools/source-config/ProjectBuddy.SourceConfig/Generation.cs (RunAsync: approved verdict and approvedOllama evidence); scripts/assisted_benchmark_review.py (LocalOllama._request, _verify_model, review_evidence: duplicate JSON rejection, inventory validation, approved/verified identity); scripts/assisted_benchmark_run.py (orchestrate: approvedReviewModel / reviewModel receipt binding).

Status

Implemented in develop; identity regression suites and Ubuntu/Windows CI verified, not a stable-release or live-build qualification

Clone this wiki locally