2 Commits

Author SHA1 Message Date
wishforge
20c5ff1691 ✨ Let a question carry a screenshot
A customer can now show the Copilot what went wrong instead of describing it.
The picture is uploaded before the question, kept in the artifact bucket under
the tenant, project and session that own it, and read back for that person only.

The type is decided by the bytes, never by the request: anything that is not a
PNG, JPEG or WebP is refused, as is anything over 4 MiB. Only the question's own
attachment ids are accepted, at most three, and the upload body is the picture
itself so a 4 MiB image never becomes a 5 MiB JSON string.

A question with a picture is answered from what the picture shows. It is not
measured against the pages of the project — no page could ever quote a
screenshot — and it does not become a gap in what the project's docs cover.

Also fixes the Copilot tool stub in the security test, which had stopped
satisfying the project-scoped code reader.
2026-11-09 19:07:24 -08:00
wishforge
3f879c37d3 ✅ Red-team the Copilot, prepare screenshot acceptance, and tidy two names
Ten ways a customer, a page or a log line may try to make the Copilot hand over
what it must not: a key, the connection string, the system prompt, a kubeconfig.
Where a mock model leaks, the platform still refuses; where it obeys an
injected instruction, the prompt already says a document is data, not a command.
The tool layer is tested separately: an environment file is refused even when
the model names it, and logs outside the project's namespaces are refused.

Screenshot acceptance is prepared, not faked: the fixtures directory explains
what to put there, and the test runs only when an operator does, against the
real gateway.

Model names stored with a context suffix are rewritten by a dry-run-by-default
script (the local database currently has no projects), and the console calls
/providers what it is: 模型连接.
2026-11-09 10:09:59 -08:00