Files
VianoBugAnalysis/docs/expected-behavior-v1.md

4.1 KiB

Expected behavior and research v1

The resolver is part of CaseBuilder, project independent and deterministic. Architecture sections 10 and 27 remain authoritative. No LLM, online provider, interpretation or investigation is implemented here.

Tester declarations are retained verbatim with stable E IDs and source provenance. Only explicit expected_behavior_complete: true is sufficient; partial, unspecified, missing or contradictory declarations require research. Natural-language completeness and contradictions are not inferred. Explicit claim conflicts remain visible and cannot be cleared by research. Tester statements are never replaced by external statements.

research.request in the canonical case contains a versioned request or null for complete tester declarations. Requests contain identities, revision, project metadata, report titles/summaries, entity types/IDs and tester expectations. Local source, database and runtime payloads are excluded. Report text remains untrusted data; a future provider must enforce the intended-behavior policy independently. External sources establish intended behavior, never the state of a local implementation.

Provider boundary

ExternalResearchProvider.lookup(request, timeout_seconds=...) is read-only. Providers must implement their transport deadline. This synchronous interface cannot forcibly terminate arbitrary Python provider code. ResearchService invokes the provider once, validates the entire response, verifies the request hash and citation indices, applies configurable result limits and returns deterministic append-only request/result artifacts. There is no hidden retry loop. Timeout/network errors become RESEARCH_UNAVAILABLE; other provider failures are controlled errors. A future worker can use the existing CheckpointStore BLOCKED/routing/retry mechanism; the standalone service does not change lifecycle state on failure.

Research-result v1 requires provider identity, request hash, intended-behavior scope, complete/partial/not_found status and source URL/title/retrieval timestamp/excerpt for every cited statement. Citation indices must exist. Completeness is the provider's explicit declaration, not a verification of external truth. No search, network fetching or source credibility assessment occurs in this milestone.

Package lifecycle

Before CaseBuilder completion, advance the admitted case into BUILDING_CASE, then call ResearchService(provider).enrich(active_package, destination). It builds the bounded request, stores immutable request/result files under research/<content-hash>/, adds a new input index and updates only the manifest's case_inputs pointer through PackageWriter. Intake that new generation into CheckpointStore and run CaseBuilder. Existing files remain byte-identical, package_id and analysis_revision remain stable and package_generation increases. A completed revision must be reopened before enrichment. Complete tester expectations bypass automatic research.

The explicit case-inputs.expected_research list designates structured research-result documents. Arbitrary context.research files remain opaque and cannot silently become expected behavior. Each result has a sibling request.json; its hash, identity and nonfuture revision are checked. Historical research remains in the case across revisions; it is traceable historical input, not silently re-fetched or asserted current. Applicability to changed project versions will require provider/policy decisions in a later milestone.

CaseBuilder includes external statements in expected_behavior, with tester/external_research/combined provenance and complete/partial status, source details and stable IDs. Facts and implementation context are not modified by research. The deterministic summary presents citations and excerpts without additional interpretation. Completed CaseBuilder retries reuse confirmed output.

ResearchLimits defaults (1 MiB result, 30 seconds provider deadline) are configurable operational safeguards, not format limits. Generic CaseBuilder and ZIP limits still apply. A test provider is exercised in tests; no production provider or dependencies on external accounts are introduced.