# Artifact QA: deterministic checks and mixed-attachment soak
Scope: Artifact service, Agent attachment reads and Runner outputs ([#3063](https://github.com/langbot-app/LangBot/issues/3063), phases 1–3 of [#3051](https://github.com/langbot-app/LangBot/issues/3051)). Skill, knowledge-base and other phase 4+ consumers are not covered by this runbook. A matrix entry is a test obligation, not a claim that it has passed. Record candidate-specific evidence before calling it verified.
## Gates and scenario matrix
| Scenario | What must prove it | Lane |
| --- | --- | --- |
| Mixed PNG/JPEG, text and image-only PDF; several files per message; concurrent sessions; later reads in the same session | Valid decodable fixtures; exact digest and bytes; text extraction with the expected body marker; marker appears neither in the prompt nor metadata; no cross-session marker | Deterministic attachment contracts and TCP acceptance |
| Same filename, different bytes; same bytes from different principals | Exact per-file digest and denial of borrowed references, both between users in a Workspace and across Workspaces; reference and authorization checked before accepting cache/dedup hits | Deterministic TCP acceptance and storage isolation contracts |
| History compression, reconnect and Core replacement | Verify old authorized references, exact content after replacement and no complete media or large base64 in ordinary retained history/logs; a new HTTP client alone is not a WebSocket reconnect | LocalAgent compaction and TCP Core replacement; WebSocket reconnection must be proved separately |
| Read/commit/release/expiry/GC race; cancellation vs another session’s active reference | Barrier or observed overlap; A’s cancellation does not alter B’s legal reference; expired or revoked access cannot be satisfied through prior cache state | Deterministic lifecycle plus repeated soak; no inference from sequential calls |
| Bad/truncated PDFs, MIME spoofing, page/size bounds, timeout, cancel and backend failure | Identify the expected specific error, verify no leak of a live or partially committed reference, and prove healthy neighbors still work | Reader limits, fault/lifecycle checks and disposable object-store retry |
| PDF native, text extraction or unsupported | Check representation sent downstream, semantic content separately, and an explicit unsupported result instead of blank or fabricated output | Deterministic checks and separate real-provider sample |
| Accelerated TTL and cleanup under pressure | Age test-owned rows, prove autonomous cleanup on several rotations during concurrent activity, preserve guards, and drain the backlog after load | Separate four-hour accelerated lane |
Keep deterministic and real-provider evidence separate:
* The GitHub `Artifact QA` workflow checks scoped PRs without model credentials. It uses a locked Core checkout and verifies the imported SDK is the in-tree copy. It runs reader/HTTP/MCP checks for the SQLite/database case and the TCP suite against separately started Core and Runtime with the host Box fixture. The installed LocalAgent compaction test uses a deterministic provider and checks a later bounded read of old PDF text after an actual compaction checkpoint. The CI gate rejects missing JUnit output, skipped cases, expected failures and test failures. It does not prove Docker/nsjail/E2B compatibility, multi-host deployment, real model interpretation or long-term behavior.
* For a local run on Linux, run `uv sync --dev --frozen` and the same three pytest commands as the workflow. Mirror the workflow environment for all three runs. In particular, disable the startup release check, Space Models and telemetry, and use loopback Space URLs so deterministic tests never contact Space. Set `LANGBOT_ARTIFACT_MIXED_E2E=1`, `LANGBOT_NETWORK_PLUGIN_E2E=1` and `LANGBOT_CORE_NETWORK_BACKEND=host` for the TCP run. This lane uses owned services and fixtures, not production resources.
* For object-storage acceptance use the repository's [cross-component testing guide](CROSS_COMPONENT_TESTING.md) to provision disposable PostgreSQL/MinIO. Execute the same relevant byte/ownership/lifecycle assertions with DB content and named S3 content identified separately. Report these results separately from SQLite. Never reuse a production database, bucket or account. If a process-level scenario cannot be run against both stores, record that gap rather than counting an integration-client test as the same boundary.
* Real provider validation is a separate opt-in, bounded sample with a documented model, requester, capabilities and approved test credentials. Use synthetic PNG, JPEG, text PDF and a visually encoded scan; first verify the bytes reached the provider request, then compare the response to the body-only marker. A text-only provider rejecting a scan explicitly is a valid unsupported outcome, not a visual-understanding pass. Count throttling (e.g. 429), outbound timeout and provider outages separately from product results. Never expose secret values or upload raw provider requests.
### Optional live-provider sample
After approval for the model, endpoint and bounded sample cost, inject
Run long-lived jobs on disposable Linux hosts with sufficient storage and capacity. Use a different output directory for each run and let teardown finish before archiving evidence. Start with short and staircase runs to check correctness and sustainable throughput, then use the four-hour accelerated profile for repeated expiry and autonomous cleanup under load. Production TTL settings remain unchanged.
Set an explicit cap on offered files/bytes and actual stored objects/bytes, and a minimum disk-free floor. Include many short sessions, some long sessions with old references, and upload bursts. Stop on correctness or authorization failures, resource-budget exhaustion, or inability to keep collecting required evidence. After load stops, verify GC catches up and still-referenced objects remain usable. Record steady-state resource samples across equivalent load and data age. SQLite file size (or PostgreSQL allocated size) alone does not indicate a leak: look at active data, remaining/free pages or reuse and backlog as well.
* Candidate checkout SHA (not merely branch name); Core, in-tree or published SDK, LocalAgent/other Runner version or digest; OS, CPU/memory and storage type; Runtime and Box backend; separation of Core and Runtime local roots; database and object-store versions. Record observed TTL/maintenance settings.
* Command/config, seed, predeclared thresholds, actual wall time, warmup/load/drain phases, session/request/file counts and byte totals; attempted and completed outcomes by media and scenario, including p50/p95/p99, errors and timeouts. Identify which interaction counts include retries.
* Core/Runtime/Box CPU, RSS, FD and process/task samples; database active/allocated bytes and observable waits; object count/bytes and storage request totals; GC rounds, eligible backlog, oldest age and collection rate. Include evidence that the post-load drain did what the run expected. Document counters that cannot be collected rather than substituting guesses.
* Link the CI attempt and scoped fixtures/results, then list tests passed, failed, unsupported, skipped and unrun separately. Retain sanitized failure logs from owned services and journals. Do not attach database files, real messages, auth headers, credentials or complete Base64 payloads.