Attribute Devii AI spend to its invoking action, fix quiz question-at-a-time review, DB API/isslop result routes, workspace docs, and drop redundant docstrings

- Route Devii-driven AI gateway cost to the action/tool that triggered
  it instead of a blanket "internal" bucket, so per-feature AI spend
  is attributable.
- Fix the quiz attempt review to show one previously-answered question
  at a time instead of all of them at once, and stop a quiz endpoint
  linked from the quiz flow from responding with raw JSON.
- Add DB API async query result route and AI Usage Analyzer annotated
  source/media routes, with traversal-safe uid/path handling and
  matching tests.
- Add Code Farm action audit logging (plant/harvest/buy-plot/upgrade/
  fertilize) and related admin workspace/services/trash/gateway route
  and doc touch-ups.
- Drop redundant docstrings from access_tokens.py per the no-comments
  convention.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VL9Xn57W5UR3HZbbuuzxdK
This commit is contained in:
2026-09-03 08:47:57 +02:00
co-authored by Claude Sonnet 5
parent 9d7b3db314
commit 57087536e5
76 changed files with 805 additions and 338 deletions
+3 -3
View File
@@ -77,7 +77,7 @@ def test_formdata_list_field_mixed_empty_and_real():
def test_formdata_literal_fields_are_scalar():
"""Literal-typed fields (e.g. target_type in CommentForm) are treated as
scalars the origin check must not crash on typing.Literal."""
scalars - the origin check must not crash on typing.Literal."""
fd = FormData([
("content", "Great comment here!"),
("target_type", "post"),
@@ -108,14 +108,14 @@ def test_formdata_literal_form_from_browser():
def test_formdata_vote_form():
"""value: int field with form data string '1' is kept for Pydantic coerce."""
"""value: int field with form data - string '1' is kept for Pydantic coerce."""
fd = FormData([("value", "1")])
body = _formdata_to_dict(fd, VoteForm)
assert body["value"] == "1" # Pydantic coerces str→int
def test_formdata_issue_status_literal():
"""IssueStatusForm has Literal['open','closed'] must not crash."""
"""IssueStatusForm has Literal['open','closed'] - must not crash."""
fd = FormData([("status", "open")])
body = _formdata_to_dict(fd, IssueStatusForm)
assert body["status"] == "open"