mcp-gee-sweet 0.9.2.dev364__tar.gz → 0.9.2.dev370__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/CLAUDE.md +4 -3
  2. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/PKG-INFO +1 -1
  3. mcp_gee_sweet-0.9.2.dev370/docs/design/image-share-lifecycle.md +60 -0
  4. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/index.md +1 -0
  5. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/docs_content.md +125 -3
  6. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/roadmap.md +4 -2
  7. mcp_gee_sweet-0.9.2.dev370/scripts/qa_cancel_insert_local_images.py +187 -0
  8. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/auth.py +1 -0
  9. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/http_transport.py +66 -2
  10. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/content.py +225 -238
  11. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/images.py +247 -188
  12. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_content.py +243 -2
  13. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_images.py +168 -4
  14. mcp_gee_sweet-0.9.2.dev370/tests/test_http_transport.py +126 -0
  15. mcp_gee_sweet-0.9.2.dev364/scripts/qa_cancel_insert_local_images.py +0 -126
  16. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/cleanup-worktrees.md +0 -0
  17. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/merge-pr.md +0 -0
  18. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/notify-kai.md +0 -0
  19. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/notify-partner.md +0 -0
  20. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/orchestrator.md +0 -0
  21. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/prep-for-pr.md +0 -0
  22. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/qa-kickoff.md +0 -0
  23. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/release.md +0 -0
  24. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/retro.md +0 -0
  25. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/roadmap-status.md +0 -0
  26. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/security-advisory.md +0 -0
  27. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/start-worktree.md +0 -0
  28. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/team-member.md +0 -0
  29. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/commands/verify-pr.md +0 -0
  30. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/settings.json +0 -0
  31. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/amy.md +0 -0
  32. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/aziz.md +0 -0
  33. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/bob.md +0 -0
  34. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/dev.md +0 -0
  35. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/joy.md +0 -0
  36. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/kai.md +0 -0
  37. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.claude/team-roles/qa.md +0 -0
  38. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.dockerignore +0 -0
  39. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  40. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  41. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  42. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/dependabot.yml +0 -0
  43. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/workflows/ci.yml +0 -0
  44. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/workflows/docs.yml +0 -0
  45. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/workflows/publish-dev.yml +0 -0
  46. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.github/workflows/release.yml +0 -0
  47. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.gitignore +0 -0
  48. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.pre-commit-config.yaml +0 -0
  49. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/.python-version +0 -0
  50. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/CHANGELOG.md +0 -0
  51. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/CODE_OF_CONDUCT.md +0 -0
  52. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/CONTRIBUTING.md +0 -0
  53. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/Dockerfile +0 -0
  54. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/LICENSE +0 -0
  55. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/Makefile +0 -0
  56. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/README.md +0 -0
  57. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/SECURITY.md +0 -0
  58. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docker-compose.yml +0 -0
  59. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/assets/logo.png +0 -0
  60. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/auth.md +0 -0
  61. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/client-setup.md +0 -0
  62. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/configuration.md +0 -0
  63. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-async-tool-execution.md +0 -0
  64. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-auth-status-limitation-categories.md +0 -0
  65. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-cache-invalidation.md +0 -0
  66. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-chart-theming.md +0 -0
  67. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-comments-first-class.md +0 -0
  68. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-composite-tools.md +0 -0
  69. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-condition-type-docstring-generation.md +0 -0
  70. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-converted-doc-change-detection.md +0 -0
  71. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-dev-team.md +0 -0
  72. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-docs-formatting.md +0 -0
  73. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-fork.md +0 -0
  74. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-gmail-domain.md +0 -0
  75. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-grid-data-size-cap.md +0 -0
  76. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-impact-reach-triage.md +0 -0
  77. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-local-fs-test-harness.md +0 -0
  78. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-mcp-v2-resource-context-access.md +0 -0
  79. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-pillow-image-dependency.md +0 -0
  80. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-prompt-qa-role.md +0 -0
  81. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-publishing.md +0 -0
  82. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-release-docs-roles.md +0 -0
  83. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-repositioning.md +0 -0
  84. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-response-size-cap-generalization.md +0 -0
  85. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-response-size-cap-reevaluation-519.md +0 -0
  86. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-review-finding-ticket-bar.md +0 -0
  87. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-supports-all-drives-lint-check.md +0 -0
  88. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-sync-folder-recursion.md +0 -0
  89. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-testing.md +0 -0
  90. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/decision-tool-error-visibility.md +0 -0
  91. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/index.md +0 -0
  92. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/decisions/role-file-history.md +0 -0
  93. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/blockquote-representation.md +0 -0
  94. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/borderless-table-columns.md +0 -0
  95. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/doc-replace-backup.md +0 -0
  96. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/doc-revision-export.md +0 -0
  97. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/doc-to-markdown.md +0 -0
  98. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/docs-ast-pipeline.md +0 -0
  99. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/effectiveformat-spike.md +0 -0
  100. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/heading-anchor-resolution.md +0 -0
  101. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/image-conversion.md +0 -0
  102. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/local-file-access-policy.md +0 -0
  103. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/markdown-support.md +0 -0
  104. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/module-history.md +0 -0
  105. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/oauth-reauthorize-from-tool-call.md +0 -0
  106. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/phase3-theme-system.md +0 -0
  107. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design/sse-consent-off-event-loop.md +0 -0
  108. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/design.md +0 -0
  109. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/index.md +0 -0
  110. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/known-limitations.md +0 -0
  111. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/notes-read.md +0 -0
  112. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/README.md +0 -0
  113. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/qa-fixture-pixel.png +0 -0
  114. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-d195-create-doc.md +0 -0
  115. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-d196-create-doc.html +0 -0
  116. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-d213-dollar-escape.md +0 -0
  117. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-d226-heading-table.md +0 -0
  118. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc102-image-conversion.html +0 -0
  119. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc103-image-conversion.md +0 -0
  120. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc104-nested-lists.html +0 -0
  121. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc105-nested-lists-gfm.md +0 -0
  122. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc106-nested-lists-4space.md +0 -0
  123. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc135-paragraph-boundary.md +0 -0
  124. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc136-interrupted-block-boundary.md +0 -0
  125. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc137-inline-hr-no-block-ancestor.html +0 -0
  126. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc138-nbsp-spacer-paragraph.md +0 -0
  127. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc141-mismatched-list-tags.html +0 -0
  128. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc142-heading-anchors.md +0 -0
  129. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc144-anchor-in-table-cell.md +0 -0
  130. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures/tc-doc145-anchor-on-first-element.md +0 -0
  131. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/fixtures.template.md +0 -0
  132. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/gmail-test-plan.md +0 -0
  133. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/operations.yaml +0 -0
  134. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/playwright_oauth.md +0 -0
  135. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/.gitkeep +0 -0
  136. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-02.md +0 -0
  137. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-14.md +0 -0
  138. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-17.md +0 -0
  139. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-18.md +0 -0
  140. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-21-drive-discovery.md +0 -0
  141. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-21-sheets-delete-clear.md +0 -0
  142. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-06-28.md +0 -0
  143. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-07-04-docs.md +0 -0
  144. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-07-04-drive-smoke.md +0 -0
  145. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-07-04-infra.md +0 -0
  146. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-07-04-sheets_read.md +0 -0
  147. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-07-04.md +0 -0
  148. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/results/2026-09-04.md +0 -0
  149. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/retro-v0.8.0.md +0 -0
  150. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/retro-v0.9.0.md +0 -0
  151. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/run.md +0 -0
  152. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/runs/README.md +0 -0
  153. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/runs/v0.8.0.md +0 -0
  154. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/runs/v0.8.1.md +0 -0
  155. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/runs/v0.9.0.md +0 -0
  156. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/runs/v0.9.1.md +0 -0
  157. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/setup.md +0 -0
  158. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/calendar.md +0 -0
  159. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/docs_layout.md +0 -0
  160. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/docs_style.md +0 -0
  161. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/docs_tables.md +0 -0
  162. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/drive_activity.md +0 -0
  163. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/drive_files.md +0 -0
  164. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/drive_sharing.md +0 -0
  165. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/drive_transfer.md +0 -0
  166. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/gmail.md +0 -0
  167. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/infra.md +0 -0
  168. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/sheets_charts.md +0 -0
  169. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/sheets_mgmt.md +0 -0
  170. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/sheets_read.md +0 -0
  171. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/qa/tests/sheets_write.md +0 -0
  172. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/style-guide.md +0 -0
  173. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/docs/tools.md +0 -0
  174. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/mkdocs.yml +0 -0
  175. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/pyproject.toml +0 -0
  176. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/pyrightconfig.json +0 -0
  177. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/check_supports_all_drives.py +0 -0
  178. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/gen_tool_docs.py +0 -0
  179. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/lane_context_hook.py +0 -0
  180. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/oauth_setup.py +0 -0
  181. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/qa_gmail_fixtures.py +0 -0
  182. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/qa_revision_temp_doc_parent.py +0 -0
  183. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/setup_team.sh +0 -0
  184. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/scripts/write_team_mcp_configs.sh +0 -0
  185. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/server.json +0 -0
  186. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/.env.template +0 -0
  187. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/__init__.py +0 -0
  188. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/cache.py +0 -0
  189. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/reauth.py +0 -0
  190. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/server.py +0 -0
  191. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/sse_shutdown.py +0 -0
  192. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/__init__.py +0 -0
  193. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/atomic_write.py +0 -0
  194. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/cache.py +0 -0
  195. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/calendar.py +0 -0
  196. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/concurrency.py +0 -0
  197. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/__init__.py +0 -0
  198. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/anchors.py +0 -0
  199. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/ast.py +0 -0
  200. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/ast_to_markdown.py +0 -0
  201. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/comments.py +0 -0
  202. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/doc_to_ast.py +0 -0
  203. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/editing.py +0 -0
  204. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/emitter.py +0 -0
  205. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/html_parser.py +0 -0
  206. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/indices.py +0 -0
  207. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/layout.py +0 -0
  208. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/markdown_export.py +0 -0
  209. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/named_ranges.py +0 -0
  210. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/style.py +0 -0
  211. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/docs/tables.py +0 -0
  212. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/drive/__init__.py +0 -0
  213. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/drive/activity.py +0 -0
  214. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/drive/files.py +0 -0
  215. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/drive/sharing.py +0 -0
  216. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/drive/transfer.py +0 -0
  217. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/gmail.py +0 -0
  218. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/http_errors.py +0 -0
  219. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/mime_types.py +0 -0
  220. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/pagination.py +0 -0
  221. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/response_limits.py +0 -0
  222. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/sheets/__init__.py +0 -0
  223. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/sheets/data.py +0 -0
  224. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/sheets/helpers.py +0 -0
  225. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/src/mcp_gee_sweet/tools/sheets/structure.py +0 -0
  226. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/__init__.py +0 -0
  227. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/conftest.py +0 -0
  228. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/drive/__init__.py +0 -0
  229. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/drive/test_activity.py +0 -0
  230. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/drive/test_files.py +0 -0
  231. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/drive/test_sharing.py +0 -0
  232. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/drive/test_transfer.py +0 -0
  233. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/fakes.py +0 -0
  234. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/integration/__init__.py +0 -0
  235. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/integration/conftest.py +0 -0
  236. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/integration/test_local_fs_harness.py +0 -0
  237. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/sheets/__init__.py +0 -0
  238. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/sheets/test_data.py +0 -0
  239. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/sheets/test_helpers.py +0 -0
  240. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/sheets/test_structure.py +0 -0
  241. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_atomic_write.py +0 -0
  242. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_auth.py +0 -0
  243. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_cache.py +0 -0
  244. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_calendar.py +0 -0
  245. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_check_supports_all_drives.py +0 -0
  246. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_concurrency.py +0 -0
  247. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_anchors.py +0 -0
  248. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_comments.py +0 -0
  249. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_core.py +0 -0
  250. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_editing.py +0 -0
  251. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_indices.py +0 -0
  252. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_layout.py +0 -0
  253. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_markdown_export.py +0 -0
  254. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_named_ranges.py +0 -0
  255. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_revision_export.py +0 -0
  256. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_style.py +0 -0
  257. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_docs_tables.py +0 -0
  258. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_gen_tool_docs.py +0 -0
  259. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_gmail.py +0 -0
  260. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_http_errors.py +0 -0
  261. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_lane_context_hook.py +0 -0
  262. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_mime_types.py +0 -0
  263. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_qa_gmail_fixtures.py +0 -0
  264. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_reauth.py +0 -0
  265. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_response_limits.py +0 -0
  266. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_server.py +0 -0
  267. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_server_json.py +0 -0
  268. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_sse_shutdown.py +0 -0
  269. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/tests/test_team_mcp_configs.py +0 -0
  270. {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev370}/uv.lock +0 -0
@@ -53,9 +53,9 @@ Each entry below says what a module owns and the invariants a future edit could
53
53
  - **`sync_folder(result_local_path=)`** is its response-cap bypass (`local_path` already means the sync directory). It's rejected with `ValueError` before any API call if it resolves inside `local_path`, where the manifest would be synced up. `enforce_response_size_cap(local_path_param=...)` names the right parameter in the cap error.
54
54
  - `tools/drive/activity.py` — `list_file_activity` (Drive Activity API v2; requires `drive.activity.readonly` scope)
55
55
  - `tools/docs/` — Google Docs package; `__init__.py` is a thin dispatcher that delegates to four submodules:
56
- - `docs/content.py` — helpers (`_md_to_html`, `_to_doc_requests`, `_html_to_doc_requests`) and tools (`create_doc`, `get_doc_content`, `write_doc_content`, `create_doc_from_file`, `update_doc_from_file`, `get_doc_structure`, `find_in_doc`). `_apply_doc_content` is shared by `create_doc`/`create_doc_from_file`/`write_doc_content`; `_replace_doc_content` (clear, then insert, as separate `batchUpdate` calls because of the same-batch `insertText` style-inheritance quirk) by `write_doc_content`/`update_doc_from_file`. `find_in_doc` returns UTF-16 offsets usable directly with `style_doc_range`. `get_doc_structure` surfaces each paragraph's `headingId` and `bullet` (`{listId, nestingLevel}`, a top-level item's absent level normalized to `0`). After conversion, `_has_pending_anchor_links(content_requests, tables)` gates `_resolve_heading_anchors`, which rewrites a `#slug` link to `.../edit?tab=t.0#heading=<headingId>` or strips it when no heading matches confidently: a link to the wrong section is worse than no link (`docs/design/heading-anchor-resolution.md`). Its walker, `_walk_headings_and_anchor_runs`, must recurse into table cells and carry the offset forward when an element has no `startIndex` (the doc's first element often doesn't). Markdown/HTML images go through `_resolve_image_source`: a local path (uploaded), `drive:<file_id>`, or a public `http(s)://` URL. Local and `drive:` sources are shared `anyone:reader` and revoked after embedding unless `revoke_sharing=False`. One unfetchable `insertInlineImage` fails the whole `batchUpdate`, so `_apply_doc_content` retries with that request stripped (its index parsed from Google's error); see `docs/design/image-conversion.md`. [History](docs/design/module-history.md#toolsdocscontentpy).
56
+ - `docs/content.py` — helpers (`_md_to_html`, `_to_doc_requests`, `_html_to_doc_requests`) and tools (`create_doc`, `get_doc_content`, `write_doc_content`, `create_doc_from_file`, `update_doc_from_file`, `get_doc_structure`, `find_in_doc`). `_apply_doc_content` is shared by `create_doc`/`create_doc_from_file`/`write_doc_content`; `_replace_doc_content` (clear, then insert, as separate `batchUpdate` calls because of the same-batch `insertText` style-inheritance quirk) by `write_doc_content`/`update_doc_from_file`. `find_in_doc` returns UTF-16 offsets usable directly with `style_doc_range`. `get_doc_structure` surfaces each paragraph's `headingId` and `bullet` (`{listId, nestingLevel}`, a top-level item's absent level normalized to `0`). After conversion, `_has_pending_anchor_links(content_requests, tables)` gates `_resolve_heading_anchors`, which rewrites a `#slug` link to `.../edit?tab=t.0#heading=<headingId>` or strips it when no heading matches confidently: a link to the wrong section is worse than no link (`docs/design/heading-anchor-resolution.md`). Its walker, `_walk_headings_and_anchor_runs`, must recurse into table cells and carry the offset forward when an element has no `startIndex` (the doc's first element often doesn't). Markdown/HTML images go through `_resolve_image_source`: a local path (uploaded), `drive:<file_id>`, or a public `http(s)://` URL. Local and `drive:` sources are shared `anyone:reader` and revoked after embedding unless `revoke_sharing=False`, through `images.ImageShareLifecycle` (below). One unfetchable `insertInlineImage` fails the whole `batchUpdate`, so `_apply_doc_content` retries with that request stripped (its index parsed from Google's error); see `docs/design/image-conversion.md`. [History](docs/design/module-history.md#toolsdocscontentpy).
57
57
  - `docs/editing.py` — text-range editing tools (`insert_doc_text`, `delete_doc_range`, `insert_page_break`, `insert_softbreak_paragraph`). `insert_softbreak_paragraph` joins lines with `"\v"` in a single `insertText` (the API keeps it one paragraph, like Shift+Enter) and sets `namedStyleType` explicitly over the inserted span. [History](docs/design/module-history.md#toolsdocseditingpy).
58
- - `docs/images.py` — tools (`insert_inline_image`, `insert_local_images`) plus the size validation, downscaling, and error rewriting shared by every `insertInlineImage` call site. The Docs backend fetches an image anonymously, so a `drive_file_id` must be shared `anyone`/`reader` first. Google's limits are 25 megapixels, 50MB, PNG/JPEG/GIF, and its own error names neither. `check_image_file` checks both limits before any upload, share, or embed call, reading only `stat()` and the header (it builds Pillow's format plugin directly, since `Image.open`'s decompression-bomb guard would skip huge headers); `check_drive_image_metadata` does the same for Drive sources from metadata. `auto_downscale` (default `False`) is opt-in: `downscale_drive_file` makes a `" (resized)"` copy and never mutates the original, and `prepare_local_image` uploads resized bytes for a local path. `downscale_image_bytes` runs via `asyncio.to_thread`, declines animated GIFs (returns `None`), and iterates when bytes, not pixels, are over. A bare `http(s)://` source is deliberately never fetched to pre-check; it gets `rewrite_too_large_error`, which names both limits because it can't tell which one was hit. [History](docs/design/module-history.md#toolsdocsimagespy).
58
+ - `docs/images.py` — tools (`insert_inline_image`, `insert_local_images`) plus the size validation, downscaling, and error rewriting shared by every `insertInlineImage` call site. The Docs backend fetches an image anonymously, so a `drive_file_id` must be shared `anyone`/`reader` first. Google's limits are 25 megapixels, 50MB, PNG/JPEG/GIF, and its own error names neither. `check_image_file` checks both limits before any upload, share, or embed call, reading only `stat()` and the header (it builds Pillow's format plugin directly, since `Image.open`'s decompression-bomb guard would skip huge headers); `check_drive_image_metadata` does the same for Drive sources from metadata. `auto_downscale` (default `False`) is opt-in: `downscale_drive_file` makes a `" (resized)"` copy and never mutates the original, and `prepare_local_image` uploads resized bytes for a local path. `downscale_image_bytes` runs via `asyncio.to_thread`, declines animated GIFs (returns `None`), and iterates when bytes, not pixels, are over. A bare `http(s)://` source is deliberately never fetched to pre-check; it gets `rewrite_too_large_error`, which names both limits because it can't tell which one was hit. `ImageShareLifecycle` is the one temporary-share lifecycle for an image-embedding doc edit, used by `_apply_doc_content` and `insert_local_images` (#908); route any new one through it rather than hand-rolling the steps (`docs/design/image-share-lifecycle.md`). `resolve()` runs the uploads/shares as a shielded gather and marks dirty every folder a result names in `created_in` (a resized `drive:` copy lands next to its original, not in the target folder; #666). `async with edit():` checkpoints before the first edit request (#904), marks the doc dirty on every exit and again when an abandoned request lands (#907), then revokes, shielded, and checkpoints again so a cancellation held off by the revoke's shield is still raised and logged. So a cancellation can surface after the edit fully landed: `edit_completed` tells a caller which, and `_replace_doc_content` passes its own lifecycle (`_apply_doc_content(lifecycle=...)`) so that case discards its backup copy instead of keeping it. [History](docs/design/module-history.md#toolsdocsimagespy).
59
59
  - `docs/anchors.py` — `resolve_heading_anchor`, the slug matching behind the anchor pass. It tries GitHub's non-collapsing hyphen scheme (hand-rolled) and GitLab's collapsing one (python-markdown's `toc` `slugify`), with `-1`/`-2` duplicate-heading suffixes, against the doc's full heading list. The fuzzy fallback (`_fuzzy_match`) tries the anchor's literal tokens at occurrence 0 first, and only then treats a trailing `-<digits>` as an occurrence index. A requested occurrence that doesn't exist returns `None`, never the nearest candidate. [History](docs/design/module-history.md#toolsdocsanchorspy).
60
60
  - `docs/tables.py` — tools (`insert_doc_table`, `insert_table_row`, `delete_table_row`, `insert_table_column`, `delete_table_column`, `merge_table_cells`)
61
61
  - `docs/style.py` — helpers (`_NAMED_STYLE_TYPES`, `_read_body_styles`, `_read_named_styles`, `_build_named_style_requests`, `_text_style_and_fields`, `_add_or_clear_field`) and tools (`style_doc_range`, `style_doc_table_cells`, `create_paragraph_bullets`, `delete_paragraph_bullets`, `get_doc_theme`, `get_doc_named_styles`, `apply_theme`). [History](docs/design/module-history.md#toolsdocsstylepy). Invariants:
@@ -129,7 +129,8 @@ Set `AUTH_METHOD` to pin a specific method with no fallback — removes ambiguit
129
129
  - Wrap every `.execute()` as `await execute_in_thread(chain.execute, service)`. Never write `asyncio.to_thread(chain.execute, http=thread_http(service))`: the kwarg is evaluated on the event-loop thread, so concurrent calls share one non-thread-safe `httplib2` transport.
130
130
  - Six multi-call tools (`sync_folder`, `get_multiple_sheet_data`, `get_multiple_spreadsheet_summary`, `import_csv_to_sheet`, `share_spreadsheet`, `share_file`) fan out with `asyncio.gather(..., return_exceptions=True)`.
131
131
  - A `ctx.report_progress()` call inside a gathered per-item coroutine must be wrapped in its own try/except, or a dropped client session turns an already-successful item into a failure.
132
- - Cleanup that must run when a tool call is cancelled (revoking a temporary share, deleting a temp file) needs `with anyio.CancelScope(shield=True):`, not just a `finally`. mcp cancels a request through an anyio cancel scope, which re-delivers the cancellation at every `await`, including the cleanup's own `await` inside `finally`. Shield the step that creates the resource too, or one created mid-`gather` is never recorded for cleanup. Keep shielded work bounded: a cancel waits for it. `_apply_doc_content` is the reference (PR #877).
132
+ - Cleanup that must run when a tool call is cancelled (revoking a temporary share, deleting a temp file) needs `with anyio.CancelScope(shield=True):`, not just a `finally`. mcp cancels a request through an anyio cancel scope, which re-delivers the cancellation at every `await`, including the cleanup's own `await` inside `finally`. Shield the step that creates the resource too, or one created mid-`gather` is never recorded for cleanup. Keep shielded work bounded: a cancel waits for it. `images.ImageShareLifecycle` is the reference (PR #877, #908).
133
+ - A cancelled `execute_in_thread` call still runs to completion: `asyncio.to_thread` can't stop a thread that has started. Before an unshielded write that a shielded step preceded, `await anyio.lowlevel.checkpoint()` so a held-off cancellation lands before the request is sent (#904). Cache invalidation for a write that can be cancelled mid-flight goes inside `with after_abandoned_calls(callback):` (`http_transport.py`), which reruns the callback on the loop once an abandoned request's thread finishes (#907); marking dirty only on the cancel path leaves a window where a concurrent read re-caches the pre-edit state.
133
134
  - `cache.py`'s SQLite I/O stays synchronous on purpose (see `cache.py::_open()`). `_BaseCache.snapshot_epoch()`/`store(..., epoch=...)` stop a mid-fetch `refresh_cache()` from being overwritten, per key (`SheetStructureCache`, `SheetDataCache`, `DriveFolderCache`). Size-bounded caches share `_get_sized`/`_store_sized`.
134
135
  - To unit-test real cross-thread concurrency, put the barrier inside the mocked `.execute()`, not `.list()`/`.create()`, which run on the event-loop thread (see `tests/drive/test_transfer.py::TestSyncFolderRecursive::test_recursive_sibling_subfolders_descend_concurrently`).
135
136
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mcp-gee-sweet
3
- Version: 0.9.2.dev364
3
+ Version: 0.9.2.dev370
4
4
  Summary: MCP server for Google Workspace — Sheets, Drive, Docs (HTML or Markdown), and Calendar.
5
5
  Project-URL: Homepage, https://github.com/khuisman/mcp-gee-sweet
6
6
  Project-URL: Bug Tracker, https://github.com/khuisman/mcp-gee-sweet/issues
@@ -0,0 +1,60 @@
1
+ # One Temporary-Image-Share Lifecycle
2
+
3
+ **Date:** 2026-10-13
4
+ **Issues:** #909 (bundle of #904, #907, #908, #666)
5
+
6
+ ## Problem
7
+
8
+ Every image a doc edit embeds from a local path or a `drive:` source is shared `anyone:reader` before the edit, because the Docs backend fetches inline images anonymously, and that share is revoked once the edit is over. `_apply_doc_content` (PR #877) and `insert_local_images` (PR #903) each implemented that sequence themselves, and the copies had drifted. The gaps PR #903's QA found were in exactly the places they differed:
9
+
10
+ - **#904.** `_apply_doc_content` had no checkpoint between its shielded image gather and its first doc edit. A cancellation held off by the shield was re-delivered at the content `batchUpdate`'s `execute_in_thread`, which by then had already handed the request to a worker thread. `asyncio.to_thread` can't stop a running thread, so a call the client had cancelled still edited the doc.
11
+ - **#908.** Its success-path revoke was shielded with no checkpoint afterward. A cancellation that arrived during the revoke was absorbed: no warning was logged, and the response that would have reported a revoke failure was discarded.
12
+ - **#907.** When the in-flight edit landed after the cancellation had unwound, the doc cache could hold the pre-edit state. `insert_local_images` marked the doc dirty on its cancel path, before the orphaned edit committed, so a read in between re-cached the old content. `_apply_doc_content`'s cancel path didn't invalidate at all.
13
+ - **#666 (2).** `write_doc_content` uploads a local image into the server's default folder without marking that folder's listing dirty. A resized `drive:` copy lands next to its original, which no tool marked dirty either. `insert_inline_image` had the same gap for its resized `drive_file_id` copy.
14
+
15
+ ## Design
16
+
17
+ ### `images.ImageShareLifecycle`
18
+
19
+ One object per doc edit, holding what the cleanup needs: `shares` (each `(outcome_entry, file_id, permission_id)` to revoke), `outcomes` (every image's entry, for the log), and `created_file_ids` (files the call made, which the log lists separately from the caller's own `drive:` files).
20
+
21
+ - `resolve(coros)` runs the upload/share coroutines as a gather shielded from cancellation (`return_exceptions=True`, as before), then marks dirty every folder a result names in `created_in`.
22
+ - `async with edit():` wraps the doc edit:
23
+ 1. A checkpoint (#904), inside the `try` whose handler revokes, so a cancellation landing here still revokes and logs.
24
+ 2. The body runs inside `after_abandoned_calls(mark the doc dirty)` (#907, below).
25
+ 3. A `finally` around the body marks the doc dirty on every exit, success included. Callers no longer do this themselves.
26
+ 4. A shielded revoke, then a checkpoint (#908), so a cancellation held off by the revoke's shield is raised here and the handler logs it.
27
+ 5. On any `BaseException` the handler revokes (at most once) and logs through `log_images_after_failed_edit`, then re-raises.
28
+
29
+ `_apply_doc_content` converts an `Exception` leaving the `async with` into `DocEditError` with the outcome list (#789), after the lifecycle has already revoked and logged. `insert_local_images` catches its own `batchUpdate` failure inside the body, as before. The body also runs when there's nothing to embed, so an all-failed call still checkpoints and logs its orphans (PR #903 QA finding 1).
30
+
31
+ ### `http_transport.after_abandoned_calls` (#907)
32
+
33
+ #907 suggested exposing `execute_in_thread`'s future so the cancel path could attach a done-callback. That would mean threading the future out of every request an edit makes, including `fill_tables` and anchor resolution, which issue their own requests several calls deep. Instead, a context-scoped hook: inside `with after_abandoned_calls(callback):`, `execute_in_thread` wraps the worker function so that, if the awaiting task gave up on the call while its thread was running, the thread schedules `callback` on the loop (`call_soon_threadsafe`) once it returns or raises. Nested requests are covered because the hook travels in a `ContextVar`, which gathered tasks and worker threads both copy.
34
+
35
+ The "gave up while running" check is a lock-guarded pair of flags. The worker sets `finished` in its `finally`, and the cancel path sets `abandoned` only if `finished` isn't set yet. Either the thread finished first, so the cancel path's own invalidation already runs after the commit, or the call was marked abandoned first, so the callback runs after the commit. A completed call, or a cancelled one whose thread never started, never triggers the callback, so the hook adds no cache writes on the normal path.
36
+
37
+ The same hook covers `_replace_doc_content`'s clear `batchUpdate` and `insert_inline_image`'s `batchUpdate`, which have the same orphaned-edit window but no images to share.
38
+
39
+ ### `created_in` (#666)
40
+
41
+ Only the call that creates a file knows its folder (`downscale_drive_file` picks the original's parent, falling back to the default folder). So `upload_and_share_image` and `upload_and_share_local_image` tag any result that carries a `file_id` they created, an orphan included, with `created_in` (`_with_created_in`). The caller never has to work out the folder. `record_image_outcome` doesn't copy the key into the caller-facing outcome. A `drive:` source's own `file_id` never gets one, since nothing was created.
42
+
43
+ ### `insert_inline_image`'s resized copy
44
+
45
+ `insert_inline_image` shares nothing temporarily (a `drive_file_id` must already be public), so it doesn't use the lifecycle. Its `auto_downscale` copy, though, is created and link-shared for good, and two exits used to lose its ID: a cancellation during the downscale or the edit, and a failed `batchUpdate`, whose `{"error"}` result omitted `resized_file_id`. The downscale is now shielded and followed by a checkpoint. A failed edit's result carries `resized_file_id`, and a cancelled call logs it as a WARNING, the same treatment PR #877 gave temporary shares.
46
+
47
+ ### #666 (1): already fixed by #511
48
+
49
+ #666's first item, a `files().get()` failing after a successful `permissions().create()` and losing the permission ID, can't happen any more. Since #511, `share_image_file` takes `webContentLink` from the `create()`/`get()` call that preceded the share and makes no request after it (`test_local_path_uploaded_shared_and_resolved` asserts no `files().get()`). There's nothing left to fix.
50
+
51
+ ### A cancellation after the edit finished (PR #1029 QA round 1)
52
+
53
+ The post-revoke checkpoint raises a cancellation that the revoke's shield held off, even though the edit itself completed. For `_replace_doc_content` that used to read as a partial write: `_failed` kept the backup copy of a doc whose new content had fully landed (reproduced live). The lifecycle now sets `edit_completed` once the edit body exits cleanly. `_replace_doc_content` builds the lifecycle itself, passes it to `_apply_doc_content(lifecycle=...)`, and on a cancellation with `edit_completed` set it discards the backup (shielded) and re-raises.
54
+
55
+ `create_doc`/`create_doc_from_file` now mark the target folder dirty right after the Drive `create()`. They used to do it only after the content step, which a cancellation skipped. The doc is in the folder from the create on, and images uploaded later are marked dirty by `resolve()`. The create itself (`_create_doc_file`) runs inside `after_abandoned_calls`, since a create cancelled in flight still lands after the post-create `mark_dirty` would have run (QA round 2).
56
+
57
+ ## Trade-offs
58
+
59
+ - A failed or cancelled `write_doc_content` now marks the doc dirty twice: once in the lifecycle and once in `_replace_doc_content`'s `_failed`. `_failed` has to keep its own call, because a doc that was cleared and whose `_apply_doc_content` raised before the edit phase (during image resolution, say) still changed. A redundant `mark_dirty` costs one SQLite write.
60
+ - `_apply_doc_content` now takes the lifespan context (`lc`) instead of the two services, since the lifecycle needs the doc and folder caches too.
@@ -17,3 +17,4 @@ These are more granular than the [decision records](../decisions/index.md), whic
17
17
  | [Local-File Access Policy](local-file-access-policy.md) | 2026-10-10 | #796: `LOCAL_FILE_ACCESS=full\|roots\|off` resolved at import from argv (plus an HTTP-request tripwire for launches argv can't see), one `check_read`/`check_write` at each choke point and per entry in folder walks, an identity-based (`samefile`) deny-list of the server's own credential/config/cache/log files, `@tool(local_only=True)` unregistering nine tools in `off` mode, mode and roots reported in `server://auth-status` and the refusal |
18
18
  | [Google Doc Revisions as Markdown](doc-revision-export.md) | 2026-10-11 | #959: `export_revision` on a Doc via DOCX export → temporary Doc → `get_doc_as_markdown`'s own converter (Drive's Markdown and HTML exports measured lossy), heading links and image URLs rewritten so two exports diff cleanly, shielded temp-Doc cleanup |
19
19
  | [Backup Copy Before Replacing a Doc's Content](doc-replace-backup.md) | 2026-10-12 | #878: `write_doc_content`/`update_doc_from_file` copy a non-empty doc with `files.copy` before the clear, delete it on success and name it as `backupId` on failure; the planned pre-clear revision ID was measured to 404 right after the clear |
20
+ | [One Temporary-Image-Share Lifecycle](image-share-lifecycle.md) | 2026-10-13 | #909: `images.ImageShareLifecycle` shared by `_apply_doc_content` and `insert_local_images` (shielded gather, pre-edit and post-revoke checkpoints, shielded revoke and log), `after_abandoned_calls` re-invalidating the doc cache once an abandoned edit lands, `created_in` tagging so each upload's folder is marked dirty |
@@ -3774,6 +3774,47 @@ Not covered live: a soft break (Shift+Enter) inside an inline code run in a para
3774
3774
 
3775
3775
  **Result (2026-10-11) ✅ PASS — Sky, PR #992 round 3 (`9271dfe`).** Ran the new step 7. Step 8: the first paragraph was `[![](<contentUri>)](https://example.com/bare)`, and the second was `[tail](https://example.com/block)`, then `[![](<contentUri>)](https://example.com/block)`, then an unlinked ` after`. The fix commit only touches `html_parser.py`'s anchor handling, so steps 1–6 weren't re-run.
3776
3776
 
3777
+ ### TC-DOC220: A literal fence line inside a code block doesn't close its export fence (PR #940) ⚠️ requires-oauth
3778
+ **Background:** a code-block paragraph used to export inside a fixed three-backtick fence, so a content line of three or more backticks closed the block early and everything after it fell out as ordinary Markdown. The fence is now one longer than the longest backtick run in the content, with a minimum of three.
3779
+
3780
+ **Setup:** none. Each step uses a scratch doc.
3781
+
3782
+ **Prompt**
3783
+ 1. `create_doc(title="TC-DOC220 three", folder_id={FOLDER_ID}, content='<pre>before\n```\nafter</pre>')`, with real newlines inside the `<pre>`
3784
+ 2. `get_doc_as_markdown(doc_id=<step 1 docId>)`
3785
+ 3. Repeat steps 1–2 with a middle line of four backticks, then of six
3786
+ 4. Repeat steps 1–2 with `<pre>x = 1\ny = 2</pre>`, which has no backticks
3787
+
3788
+ **Checks**
3789
+ - Step 2: `markdown` starts with ```````` ````\nbefore\n```\nafter\n```` ````````. A strict CommonMark renderer gives one `<pre><code>` holding exactly `before`, ```` ``` ````, `after`
3790
+ - Step 3: the fence is five backticks around the four-backtick line and seven around the six-backtick line. Each renders as one `<pre><code>` holding all three lines, with nothing after the literal line falling out of the block
3791
+ - Step 4: `markdown` starts with ```` ```\nx = 1\ny = 2\n``` ````, the plain three-backtick fence
3792
+ - Trailing newlines after the fence come from the doc's empty last paragraph and aren't part of any check
3793
+
3794
+ **Cleanup:** `delete_file` all four scratch docs
3795
+
3796
+ **Result (2026-10-13) ✅ PASS — post-merge live check, develop `6bf7961`.** Ran in an isolated service-account sandbox on a Shared Drive. The exports were ```````` ````\nbefore\n```\nafter\n````\n\n ````````, then the five- and seven-backtick equivalents, then ```` ```\nx = 1\ny = 2\n```\n\n ````. markdown-it-py 4.2.0's `commonmark` preset rendered each fenced block as one `<pre><code>` holding exactly the original lines. Control: the same renderer, given the pre-fix three-backtick fence around the step 1 content, ends the block after `before` and renders `after` as a paragraph. Scratch docs trashed.
3797
+
3798
+ ### TC-DOC221: Code segments split by an inline image each get a fence sized to their own content (PR #940) ⚠️ requires-oauth
3799
+ **Background:** a code-block paragraph with an inline image exports as one fenced block per code segment, with the image between them. Since PR #940, each segment's fence is sized to its own backtick runs, so a literal fence line in one segment doesn't lengthen the other's.
3800
+
3801
+ **Setup:**
3802
+ 1. `create_doc(title="TC-DOC221", folder_id={FOLDER_ID}, content='<pre>before\n```\nmid\nafter</pre>')`, with real newlines inside the `<pre>`
3803
+ 2. `get_doc_structure(doc_id=<docId>)` and note the code paragraph's `startIndex` (`{P}`). `mid` starts at `{P}+11`.
3804
+ 3. `insert_inline_image(doc_id=<docId>, index={P}+11, uri="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png")`
3805
+
3806
+ **Prompt**
3807
+ > "Export doc <docId> as Markdown"
3808
+
3809
+ **Checks**
3810
+ - `markdown` is a four-backtick fence holding `before` and ```` ``` ````, then `![](<contentUri>)`, then a three-backtick fence holding `mid` and `after`, in that order
3811
+ - A strict CommonMark renderer gives `<pre><code>`, `<img>`, `<pre><code>`, with the literal ```` ``` ```` inside the first block and nothing outside a block except the image
3812
+ - The first block also ends with an empty line: the soft break before the image belongs to the first segment. That's how segments have always split (#594), not part of this case
3813
+
3814
+ **Cleanup:** `delete_file` the scratch doc
3815
+
3816
+ **Result (2026-10-13) ✅ PASS — post-merge live check, develop `6bf7961`.** Ran in an isolated service-account sandbox on a Shared Drive. `{P}` was 1, so the image went in at index 12. The export was ````````` ````\nbefore\n```\n\n````\n\n![](<contentUri>)\n\n```\nmid\nafter\n```\n\n `````````. markdown-it-py 4.2.0's `commonmark` preset rendered `<pre><code>before\n```\n\n</code></pre>`, the `<img>`, then `<pre><code>mid\nafter\n</code></pre>`. Scratch doc trashed.
3817
+
3777
3818
  ---
3778
3819
 
3779
3820
  ## Orphan fileId on inline-image sharing failure (#649)
@@ -4201,6 +4242,12 @@ All files from both probes and the three steps, and the doc, were trashed.
4201
4242
 
4202
4243
  **Result (2026-10-04) ✅ PASS — Kit, PR #903 round 2 (`4e392c3`).** All six steps ran from the kit worktree with its OAuth token, on a fresh scratch doc in `{FOLDER_ID}`. Each step printed `cancelled at '<point>'; the tool returned nothing` and the WARNING `Doc edit for {DOC_ID} failed or was cancelled after its images were resolved; files created by this call: <one file ID>; pre-existing files: none; still link-shared by this call: ...`. That last field listed `{KEPT_FILE_ID}` for step 4 and was `none` for every other step. Steps 2 (`share-fail`, the orphan) and 6 (`revoke`), which logged nothing in round 1's probe, now log. `list_permissions` showed no `anyone` grant on `{SHARE_FILE_ID}`, `{ORPHAN_FILE_ID}`, `{EDIT_FILE_ID}`, `{INFLIGHT_FILE_ID}`, or `{REVOKE_FILE_ID}`, and showed `anyoneWithLink`/`reader` on `{KEPT_FILE_ID}`. After `refresh_cache`, `get_doc_as_markdown` read `Before`, `IMGMARKER883`, an image, an image, `After`. So steps 1–4 left `IMGMARKER883` untouched, step 6's edit landed before its cancel, and step 5's in-flight edit also landed (an image replaced `INFLIGHT883`). All six files and the doc were trashed.
4203
4244
 
4245
+ **Result (2026-10-14) ✅ PASS — Kit, PR #1029 round 1 (`089f6ee`).** Re-run on the shared `ImageShareLifecycle`. All six steps ran from the kit worktree with its OAuth token, on a fresh scratch doc in a scratch folder on the QA Shared Drive. Each printed `cancelled at '<point>'; the tool returned nothing` and the expected WARNING, whose `still link-shared by this call` listed `{KEPT_FILE_ID}` for step 4 and was `none` otherwise. `list_permissions` showed no `anyone` grant on the five revoked files and `anyoneWithLink`/`reader` on `{KEPT_FILE_ID}`. `get_doc_as_markdown` read `Before`, `IMGMARKER883`, an image, an image, `After`. New with #907: step 5 printed `(edit landed: no)` from the cancel path, then the lifecycle's "finished afterward" DEBUG line and a later `(edit landed: yes)`. Script note: steps 3–4 print `batchUpdates sent: 1; landed: 0`, but the `edit` gate cancels before the request is sent (`sent` is counted before the hold; sent back in the round 1 PR comment). Cleanup done.
4246
+
4247
+ **Result (2026-10-14) ✅ PASS (partial re-run) — Kit, PR #1029 round 2 (`fd591d9`).** Re-verified the script-counter fix only: step 3 (`edit`) on a fresh scratch doc printed the cancel line, the WARNING (`still link-shared by this call: none`), and `batchUpdates sent: 0; landed: 0` (round 1 printed `sent: 1`). `IMGMARKER883` was still in the doc, and the file had no `anyone` grant. Cleanup done.
4248
+
4249
+ **Result (2026-10-15) ✅ PASS — Kit, PR #1029 round 4 (`d748932`).** Re-run after the `develop` merge (#1023, #1034). All six steps ran from the kit worktree with its OAuth token, on a fresh scratch doc in a scratch folder on the QA Shared Drive. Each printed `cancelled at '<point>'; the tool returned nothing` and the expected WARNING, whose `still link-shared by this call` listed `{KEPT_FILE_ID}` for step 4 and was `none` otherwise. Steps 1–4 printed `batchUpdates sent: 0; landed: 0`. Step 5 printed `(edit landed: no)`, the lifecycle's "finished afterward" DEBUG line, then `(edit landed: yes)`. `list_permissions` showed no `anyone` grant on the five revoked files and `anyoneWithLink`/`reader` on `{KEPT_FILE_ID}`. After `refresh_cache`, `get_doc_as_markdown` read `Before`, `IMGMARKER883`, an image, an image, `After`. Cleanup done.
4250
+
4204
4251
  ## Unreadable source file returns an error — `create_doc_from_file` / `update_doc_from_file` (PR #961)
4205
4252
 
4206
4253
  Both tools read the local file through the shared `_read_doc_source_file` helper. Before PR #961's round 2, a path that existed but wasn't a readable UTF-8 regular file raised out of the tool (`[Errno 21] Is a directory`, `'utf-8' codec can't decode byte 0xe9 ...`) instead of returning `{"error": ...}`.
@@ -4333,7 +4380,8 @@ from mcp_gee_sweet import auth
4333
4380
  from mcp_gee_sweet.tools.docs import content as c
4334
4381
  creds = auth._oauth_creds()
4335
4382
  lc = SimpleNamespace(docs_service=build('docs', 'v1', credentials=creds),
4336
- drive_service=build('drive', 'v3', credentials=creds), doc_cache=MagicMock(), folder_id=None)
4383
+ drive_service=build('drive', 'v3', credentials=creds), doc_cache=MagicMock(),
4384
+ drive_folder_cache=MagicMock(), folder_id=None)
4337
4385
  with patch.object(c, 'fill_tables', side_effect=RuntimeError('injected failure')):
4338
4386
  print(asyncio.run(c._replace_doc_content(lc, '{DOC_ID}', '<p>TC-DOC219 failed write</p>', 'html',
4339
4387
  autolink_urls=True, revoke_sharing=True, auto_downscale=False)))
@@ -4356,7 +4404,8 @@ from mcp_gee_sweet import auth
4356
4404
  from mcp_gee_sweet.tools.docs import content as c
4357
4405
  creds = auth._oauth_creds()
4358
4406
  lc = SimpleNamespace(docs_service=build('docs', 'v1', credentials=creds),
4359
- drive_service=build('drive', 'v3', credentials=creds), doc_cache=MagicMock(), folder_id=None)
4407
+ drive_service=build('drive', 'v3', credentials=creds), doc_cache=MagicMock(),
4408
+ drive_folder_cache=MagicMock(), folder_id=None)
4360
4409
  real = c.execute_in_thread
4361
4410
  async def after_commit(fn, service):
4362
4411
  result = await real(fn, service)
@@ -4404,7 +4453,8 @@ from mcp_gee_sweet.tools.docs import content as c
4404
4453
  oauth, sa = auth._oauth_creds(), auth._service_account_creds()
4405
4454
  od, odocs = build('drive', 'v3', credentials=oauth), build('docs', 'v1', credentials=oauth)
4406
4455
  lc = SimpleNamespace(docs_service=build('docs', 'v1', credentials=sa),
4407
- drive_service=build('drive', 'v3', credentials=sa), doc_cache=MagicMock(), folder_id=None)
4456
+ drive_service=build('drive', 'v3', credentials=sa), doc_cache=MagicMock(),
4457
+ drive_folder_cache=MagicMock(), folder_id=None)
4408
4458
  def text(d):
4409
4459
  b = odocs.documents().get(documentId=d).execute()['body']['content']
4410
4460
  return ''.join(r.get('textRun', {}).get('content', '') for e in b for r in e.get('paragraph', {}).get('elements', [])).strip()
@@ -4439,3 +4489,75 @@ finally:
4439
4489
  **Result (2026-10-14) ✅ PASS — Sky, PR #1034 round 1 (`454001d`).** Ran the script as written from this slot's checkout, with this slot's OAuth token and the shared service-account key passed by env var. Line `A` had `web_link` and the expected `warning`, with doc text `'TC-DOC224 after'`. Line `B` had the expected "cleared first and couldn't be backed up (this account can't add a file to the document's folder)" error and no `backupId`. Line `C` listed only `TC-DOC224 doc`. Before each of `A` and `B`, the log showed googleapiclient's `403 … "insufficientFilePermissions"` and then `Replacing doc … without a backup: this account can't add a file to the document's folder`. `cleanup done` was printed. Extra probe: the service account was given writer access on both the doc and a My Drive folder, and the copy returned `storageQuotaExceeded`, as the design doc says. After the owner set `downloadRestrictions.itemDownloadRestriction.restrictedForWriters`, the same copy returned 403 `cannotCopyFile` (with or without `parents`). That reason isn't in `_no_backup_reason`, so such a writer is still refused.
4440
4490
 
4441
4491
  **Result (2026-10-14) ✅ PASS — Sky, PR #1034 round 2 (`ca210a4`).** Re-ran the script as written, and every check held, with the same `A`/`B`/`C` output and log lines as round 1. Extra probe for the round-1 fix: the same fixture, with `execute_in_thread` patched so that only the `webViewLink` lookup raises `ConnectionError`. The replace raised `RuntimeError` "The document's previous content was replaced without a backup copy (this account can't add a file to the document's folder). The new content was written, but looking up the document's link failed: injected lookup failure", with the `ConnectionError` as `__cause__`. The doc read `'TC-DOC224 lookup after'`, and the folder held no backup copy. `numChildrenInNonRootLimitExceeded` can't be produced live (a 500k-item folder), so it's unit-tested only. Cleanup done.
4492
+
4493
+ **Result (2026-10-14) ✅ PASS — Kit, PR #1029 round 4 (`d748932`).** Re-ran after `develop` (#1034) was merged into PR #1029, whose `ImageShareLifecycle` now runs inside `_replace_doc_content`. The script ran as written (its `\"` escapes undone for a file) from the kit checkout, with this slot's OAuth token and service-account key passed by env var. Lines `A`, `B` and `C`, both `Replacing doc … without a backup` log lines (each after a 403 `insufficientFilePermissions`), and `cleanup done` all matched the checks.
4494
+
4495
+ ## Image-share lifecycle: cancellation and cache follow-ups (#909)
4496
+
4497
+ `_apply_doc_content` (behind `create_doc`, `create_doc_from_file`, `write_doc_content`, `update_doc_from_file`) and `insert_local_images` now share one temporary-image-share lifecycle, `images.ImageShareLifecycle` (#908). Before this, `_apply_doc_content` sent its content `batchUpdate` even when the call was cancelled during the shielded image gather (#904), and logged nothing when a cancellation arrived during its success-path revoke (#908). Both tools' cancel paths invalidated the doc cache before an in-flight edit landed, or not at all (#907). And `write_doc_content` and a resized `drive:` copy never marked the folder they uploaded into as dirty (#666). TC-DOC203 covers `insert_local_images` on the same lifecycle and should be re-run alongside these.
4498
+
4499
+ ### TC-DOC222: A cancelled `write_doc_content` never sends its edit after a cancel during the share, logs a cancel during the revoke, and re-invalidates the cache once an in-flight edit lands (#904, #907, #908) ⚠️ requires-oauth ⚠️ destructive ⚠️ local-filesystem
4500
+
4501
+ **Background:** Same mechanism as TC-DOC203: `scripts/qa_cancel_insert_local_images.py` runs the checkout's own tool against the real APIs and cancels it at one point. `--tool write_doc_content` routes the call through `_replace_doc_content`/`_apply_doc_content` (its MARKER argument is ignored; `-` below). The script prints every doc-cache invalidation as `doc cache marked dirty for <id> (edit landed: yes|no)`, then waits for an in-flight edit to finish. Run it from the checkout under test with that checkout's OAuth token (`TOKEN_PATH`). It prints the tool's WARNINGs to stderr. On an empty doc `write_doc_content` sends no clear and makes no backup copy, so its first `batchUpdate` is the content one.
4502
+
4503
+ **Setup:**
4504
+ 1. `create_doc(title="TC-DOC222", folder_id={FOLDER_ID})` with no content. Record `docId` as `{DOC_ID}`.
4505
+ 2. `create_doc(title="TC-DOC222 inflight", folder_id={FOLDER_ID})` with no content. Record `docId` as `{INFLIGHT_DOC_ID}`.
4506
+ 3. `create_doc(title="TC-DOC222 markers", content="Before\n\nINFLIGHT909\n\nAfter", content_format="markdown", folder_id={FOLDER_ID})`. Record `docId` as `{MARKER_DOC_ID}`.
4507
+
4508
+ **Prompt**
4509
+ > (none — script-driven; the steps below are shell commands plus tool calls)
4510
+
4511
+ **Steps** (`<pixel>` is `<repo-root>/docs/qa/fixtures/qa-fixture-pixel.png`)
4512
+ 1. `uv run python scripts/qa_cancel_insert_local_images.py {DOC_ID} {FOLDER_ID} <pixel> - share --tool write_doc_content`. Record the file ID from the WARNING as `{SHARE_FILE_ID}`.
4513
+ 2. The same command with `revoke` in place of `share`. Record the WARNING's file ID as `{REVOKE_FILE_ID}`.
4514
+ 3. `uv run python scripts/qa_cancel_insert_local_images.py {INFLIGHT_DOC_ID} {FOLDER_ID} <pixel> - inflight --tool write_doc_content`. Record the WARNING's file ID as `{INFLIGHT_FILE_ID}`.
4515
+ 4. `uv run python scripts/qa_cancel_insert_local_images.py {MARKER_DOC_ID} {FOLDER_ID} <pixel> INFLIGHT909 inflight` (default tool, `insert_local_images`). Record the WARNING's file ID as `{ILI_FILE_ID}`.
4516
+ 5. Step 1's command again, with `inflight` in place of `share`. `{DOC_ID}` has content since step 2, so this cancels during the *clear* `batchUpdate`, before any image work. Record the backup copy's ID from its WARNING as `{BACKUP_ID}`.
4517
+
4518
+ **Checks**
4519
+ - Steps 1–4 each print `cancelled at '<point>'; the tool returned nothing` and a WARNING `Doc edit for <doc> failed or was cancelled after its images were resolved; files created by this call: <one file ID>; pre-existing files: none; still link-shared by this call: none`. Before #908, step 2 logged nothing
4520
+ - Step 1 prints `batchUpdates sent: 0; landed: 0`. Before #904, the content `batchUpdate` was still sent after the cancellation
4521
+ - Steps 3, 4 and 5 each print a `doc cache marked dirty for <doc> (edit landed: no)` line from the cancel path, then a later `doc cache marked dirty for <doc> (edit landed: yes)` line, and end with `batchUpdates sent: 1; landed: 1`. Before #907, the `(edit landed: yes)` line was missing. If a run shows only `(edit landed: yes)` lines, the edit finished before the cancel reached the tool; re-run that step on a fresh doc
4522
+ - Step 5 logs `Replacing doc {DOC_ID} was cancelled; kept its backup copy {BACKUP_ID}` and no image WARNING (no image was uploaded)
4523
+ - `list_permissions` on `{SHARE_FILE_ID}`, `{REVOKE_FILE_ID}`, `{INFLIGHT_FILE_ID}`, and `{ILI_FILE_ID}` shows no `anyone` permission
4524
+ - After `refresh_cache` on each doc, `get_doc_as_markdown` shows: `{INFLIGHT_DOC_ID}` with `Before`, an image, `After` (the in-flight edit landed); `{MARKER_DOC_ID}` with an image where `INFLIGHT909` was; `{DOC_ID}` empty (step 5's clear landed); `{BACKUP_ID}` with `Before`, an image, `After` (step 2's content)
4525
+
4526
+ **Cleanup:** trash `{SHARE_FILE_ID}`, `{REVOKE_FILE_ID}`, `{INFLIGHT_FILE_ID}`, `{ILI_FILE_ID}`, `{BACKUP_ID}`, `{DOC_ID}`, `{INFLIGHT_DOC_ID}`, and `{MARKER_DOC_ID}`.
4527
+
4528
+ **Result (2026-10-14) ✅ PASS (checks as written); ❌ sent back on a probe — Kit, PR #1029 round 1 (`089f6ee`).** Ran from the kit worktree with its OAuth token, docs in a scratch folder on the QA Shared Drive, the fixture pixel from this checkout. Steps 1–4 each printed the cancel line and the WARNING with `still link-shared by this call: none`. Step 1 printed `batchUpdates sent: 0; landed: 0`. Steps 3, 4 and 5 each printed `(edit landed: no)` line(s) from the cancel path (step 3 two: the lifecycle's and `_replace_doc_content`'s `_failed`), then `(edit landed: yes)`, and ended `sent: 1; landed: 1`. Step 5 logged `Replacing doc {DOC_ID} was cancelled; kept its backup copy {BACKUP_ID}` and no image WARNING. `list_permissions` showed no `anyone` grant on the four files. `get_doc_as_markdown`: `{INFLIGHT_DOC_ID}` `Before`/image/`After`; `{MARKER_DOC_ID}` an image where `INFLIGHT909` was; `{DOC_ID}` empty; `{BACKUP_ID}` `Before`/image/`After`. **Probe (failed):** step 2's command (`revoke`) on a doc that already had content, so a backup was made: two batchUpdates (clear + content) landed and the doc read `Before`/image/`After`, yet the call also logged `Replacing doc … was cancelled; kept its backup copy …`, and that copy was left in Drive for a replace that had fully succeeded. The lifecycle's new post-revoke checkpoint routes the cancel through `_failed` instead of after `_discard_backup` (review finding 2). Cleanup done.
4529
+
4530
+ **Result (2026-10-14) ✅ PASS (partial re-run) — Kit, PR #1029 round 2 (`fd591d9`).** Re-ran step 3 and step 5 on fresh scratch docs; both matched round 1 (step 3: `(edit landed: no)` lines, then `(edit landed: yes)`, `sent: 1; landed: 1`, the doc `Before`/image/`After`; step 5: `kept its backup copy` logged, the backup held the old content). Round 1's failed probe (`revoke` on a doc with content) now passes: both batchUpdates landed, the doc read `Before`/image/`After`, no `kept its backup copy` line was logged, and after `refresh_cache` the folder held no `(backup before replace)` copy of that doc. Cleanup done.
4531
+
4532
+ **Result (2026-10-14) ✅ PASS (probe only) — Kit, PR #1029 round 3 (`2311322`).** Steps not re-run; the round's fix only touches `create_doc`/`create_doc_from_file`'s Drive create. A scratch script (not committed) ran the checkout's `create_doc` against the real APIs with a mock folder cache and cancelled it while `files().create` ran on its worker thread. The tool returned nothing, the create landed afterward (the Doc was in the folder), and the folder was marked dirty once it landed. An uncancelled `create_doc` in the same folder marked it dirty as before. Cleanup done.
4533
+
4534
+ **Result (2026-10-15) ✅ PASS — Kit, PR #1029 round 4 (`d748932`).** Full re-run after the `develop` merge brought #1034's no-backup changes into `_replace_doc_content`. Ran from the kit worktree with its OAuth token, docs in a scratch folder on the QA Shared Drive. Steps 1–4 each printed the cancel line and the WARNING with `still link-shared by this call: none`. Step 1 printed `batchUpdates sent: 0; landed: 0`. Steps 3, 4 and 5 printed `(edit landed: no)` line(s) from the cancel path (step 3 two), then `(edit landed: yes)`, and ended `sent: 1; landed: 1`. Step 5 logged `Replacing doc {DOC_ID} was cancelled; kept its backup copy {BACKUP_ID}` and no image WARNING. `list_permissions` showed no `anyone` grant on the four files. `get_doc_as_markdown`: `{INFLIGHT_DOC_ID}` `Before`/image/`After`; `{MARKER_DOC_ID}` an image where `INFLIGHT909` was; `{DOC_ID}` empty; `{BACKUP_ID}` `Before`/image/`After`. Round 1's probe (`revoke` on a doc that already had content, so a backup was made) passed again: `sent: 2; landed: 2`, the doc read `Before`/image/`After`, no `kept its backup copy` line was logged, and the folder held no `(backup before replace)` copy of that doc. Cleanup done.
4535
+
4536
+ ---
4537
+
4538
+ ### TC-DOC223: An image upload or resized copy shows up in a cached folder listing without `refresh_cache`, and a failed edit still names its resized copy (#666) ⚠️ requires-oauth ⚠️ destructive ⚠️ local-filesystem
4539
+
4540
+ **Background:** `list_files` caches each folder's listing. `create_doc` marked its target folder dirty, but `write_doc_content` (which uploads a local image into the server's default folder) never did. A `drive:` source's or `drive_file_id`'s resized copy lands next to its original, which no tool marked dirty either. Every upload result now names the folder its file was created in, and the shared image lifecycle (or `insert_inline_image`) marks that folder dirty. The case reads each listing once to cache it, and never calls `refresh_cache`.
4541
+
4542
+ **Setup:**
4543
+ 1. `uv run python3 -c "from PIL import Image; Image.new('RGB', (6000, 6000), 'red').save('/tmp/qa-oversized-909.png')"`
4544
+ 2. `create_folder(name="TC-DOC223 originals", parent_folder_id={FOLDER_ID})`. Record its ID as `{ORIG_FOLDER_ID}`.
4545
+ 3. `upload_local_file(local_path="/tmp/qa-oversized-909.png", parent_folder_id={ORIG_FOLDER_ID})`. Record the returned `fileId` as `{OVERSIZED_FILE_ID}`.
4546
+ 4. `create_doc(title="TC-DOC223", content="Start", folder_id={FOLDER_ID})`. Record `docId` as `{DOC_ID}`.
4547
+ 5. Read the server's default folder from its config (`DRIVE_FOLDER_ID`) as `{DEFAULT_FOLDER_ID}`. If it isn't set, skip steps 3–4 below and their check: `write_doc_content` can't upload a local image without one.
4548
+
4549
+ **Steps**
4550
+ 1. `list_files(folder_id={ORIG_FOLDER_ID})`, to cache the listing. It shows only `qa-oversized-909.png`.
4551
+ 2. `insert_inline_image(doc_id={DOC_ID}, index=1, drive_file_id={OVERSIZED_FILE_ID}, auto_downscale=True)`. Record `resized_file_id`. Then `list_files(folder_id={ORIG_FOLDER_ID})` again.
4552
+ 3. `list_files(folder_id={DEFAULT_FOLDER_ID}, mime_type="image/png")`, to cache the listing.
4553
+ 4. `write_doc_content(doc_id={DOC_ID}, content="![Pixel](<repo-root>/docs/qa/fixtures/qa-fixture-pixel.png)", content_format="markdown")`. Record `images[0].fileId` as `{PIXEL_FILE_ID}`. Then `list_files(folder_id={DEFAULT_FOLDER_ID}, mime_type="image/png")` again.
4554
+ 5. Lock `{DOC_ID}` read-only with TC-DOC202's setup step 3 script (doc ID `{DOC_ID}`, reason `TC-DOC223`). Then `insert_inline_image(doc_id={DOC_ID}, index=1, drive_file_id={OVERSIZED_FILE_ID}, auto_downscale=True)` again.
4555
+
4556
+ **Checks**
4557
+ - Step 2's second listing includes `qa-oversized-909.png (resized)` with ID `resized_file_id`. Before the fix it showed only the original until `refresh_cache`
4558
+ - Step 4's second listing includes `{PIXEL_FILE_ID}` (`qa-fixture-pixel.png`). Before the fix it was missing until `refresh_cache`
4559
+ - Step 5 returns `{"error": ...}` with the Docs `batchUpdate`'s 403 "The caller does not have permission", plus a `resized_file_id` different from step 2's. That copy exists and is link-shared even though nothing was embedded; before the fix the error result didn't name it
4560
+
4561
+ **Cleanup:** unlock `{DOC_ID}` with the same script, using `body={'contentRestrictions': [{'readOnly': False}]}`. Trash both steps' `resized_file_id`, `{OVERSIZED_FILE_ID}`, `{ORIG_FOLDER_ID}`, `{PIXEL_FILE_ID}`, and `{DOC_ID}`. `rm /tmp/qa-oversized-909.png`
4562
+
4563
+ **Result (2026-10-14) ✅ PASS — Kit, PR #1029 round 1 (`089f6ee`).** Ran in a scratch folder on the QA Shared Drive; the oversized PNG went under this job's scratch dir instead of `/tmp`, and `{DEFAULT_FOLDER_ID}` is the Shared Drive root (`DRIVE_FOLDER_ID`). Step 1's listing showed only `qa-oversized-909.png`; step 2's second listing added `qa-oversized-909.png (resized)` with ID `resized_file_id`. Step 3's listing was empty; step 4's second listing showed `{PIXEL_FILE_ID}` (`qa-fixture-pixel.png`). No `refresh_cache` anywhere. Step 5 returned the 403 "The caller does not have permission" error plus a new `resized_file_id`, different from step 2's. Cleanup done.
@@ -248,7 +248,8 @@ Same shape as v0.8.1 — stabilize on defects that surfaced since v0.9.0 shipped
248
248
  - [x] `docs/images.py` oversized-image handling: duplicated logic + unneeded full pixel decode (#400 follow-up) ([#560](https://github.com/khuisman/mcp-gee-sweet/issues/560)) (PR #801)
249
249
  - [x] `write_doc_content`/`update_doc_from_file` leave the doc empty when the replacement fails after the clear — fixed by a pre-clear backup copy that is named in the error (`backupId`) and deleted on success; this replaced the 2026-10-04 revision-ID plan (`docs/design/doc-replace-backup.md`) — lane A, ahead of #957 (defect; same write path) ([#878](https://github.com/khuisman/mcp-gee-sweet/issues/878)) (PR #1017)
250
250
  - [x] `download_file` (missing `export_format`) and `sync_folder(dry_run=True)` create local directories on calls that write nothing. Observed in Aziz's v0.9.1 hotfix regression pass; predates v0.9.1 — lane A, after #878 (defect, ahead of #957) ([#1012](https://github.com/khuisman/mcp-gee-sweet/issues/1012)) (PR #1023)
251
- - [ ] `write_doc_content`/`update_doc_from_file` refuse the write when the pre-clear backup copy can't be created in the doc's folder (no permission to add files there, or the Shared Drive is at its item limit). Decision 2026-10-13: fall back to replacing without a backup, chosen by Drive's error reason and not the HTTP status, with a `warning` on success. New in v0.9.2 via #878 (from-review condition (a)) — lane A, after #1012, ahead of #957 (same write path) ([#1018](https://github.com/khuisman/mcp-gee-sweet/issues/1018))
251
+ - [x] `write_doc_content`/`update_doc_from_file` refuse the write when the pre-clear backup copy can't be created in the doc's folder (no permission to add files there, or the Shared Drive is at its item limit). Decision 2026-10-13: fall back to replacing without a backup, chosen by Drive's error reason and not the HTTP status, with a `warning` on success. New in v0.9.2 via #878 (from-review condition (a)) — lane A, after #1012, ahead of #957 (same write path) ([#1018](https://github.com/khuisman/mcp-gee-sweet/issues/1018)) (PR #1034)
252
+ - [ ] `write_doc_content`/`update_doc_from_file`: decide whether the `cannotCopyFile` (owner restricted copying for writers) and `activeItemCreationLimitExceeded` backup-copy refusals also replace without a backup, as #1018 does for the folder case. `loud/narrow`, regression since v0.9.1 (#878 introduced the copy); 2nd follow-up in #878's chain. Found in PR #1034's review — lane A, after #796. Decision 2026-10-15: keep refusing by default, with an opt-in `allow_no_backup` override; #1018's three reasons unchanged ([#1035](https://github.com/khuisman/mcp-gee-sweet/issues/1035))
252
253
  - [ ] CLAUDE.md: fix the stale `_SA_QUOTA_ERROR` invariant (PR #1006 made it false) and add the GHSA-hx2f `_safe_local_dest` rule for Drive-name joins. CLAUDE.md-only, via Bob's gate. Kept by maintainer decision 2026-10-13 (not a review-bar ticket) — Bob, v0.9.2 ([#1014](https://github.com/khuisman/mcp-gee-sweet/issues/1014))
253
254
  - [x] `export_revision`: support Google Docs revisions (returned as markdown), and fix `list_revisions`' docstring claim that native-file revisions are pruned after 30 days. Also what #878's recovery path points callers at — lane B, after #958 (PR #988) ([#959](https://github.com/khuisman/mcp-gee-sweet/issues/959))
254
255
  - [x] `export_revision`'s temporary Doc exposes an old revision's content to the default folder's audience (a whole Shared Drive) — decided 2026-10-11: under OAuth create it in My Drive root; a service account keeps the default folder, and that remaining exposure goes in `docs/known-limitations.md`. Found in PR #988 — lane B, after #990 (PR #1006) ([#989](https://github.com/khuisman/mcp-gee-sweet/issues/989))
@@ -287,7 +288,7 @@ Same shape as v0.8.1 — stabilize on defects that surfaced since v0.9.0 shipped
287
288
  **Testing** _(triaged out of `backlog` 2026-09-11)_
288
289
  - [x] **Bundle:** test-suite tightening, one PR closing [#392](https://github.com/khuisman/mcp-gee-sweet/issues/392), [#526](https://github.com/khuisman/mcp-gee-sweet/issues/526), [#551](https://github.com/khuisman/mcp-gee-sweet/issues/551), [#561](https://github.com/khuisman/mcp-gee-sweet/issues/561), [#574](https://github.com/khuisman/mcp-gee-sweet/issues/574) — lane B (PR #924) ([#891](https://github.com/khuisman/mcp-gee-sweet/issues/891))
289
290
  - [x] Live verification for PR #922 (reject unbounded A1 ranges); coverage in PR #929 (PR #929) ([#927](https://github.com/khuisman/mcp-gee-sweet/issues/927))
290
- - [ ] Live verification for community PR #940 (literal fences in code-block exports) ([#952](https://github.com/khuisman/mcp-gee-sweet/issues/952))
291
+ - [x] Live verification for community PR #940 (literal fences in code-block exports) ([#952](https://github.com/khuisman/mcp-gee-sweet/issues/952)) (PR #1027)
291
292
 
292
293
  **Infrastructure**
293
294
  - [x] pre-commit's `ruff` hook pins v0.11.9 while CI runs the project's locked 0.16.x, so a commit can pass a lint CI rejects. Seen live on PR #1000 (RUF043, three red CI runs). Moved out of the #897 bundle 2026-10-12 — lane B, after #989 ([#974](https://github.com/khuisman/mcp-gee-sweet/issues/974)) (PR #1022)
@@ -384,6 +385,7 @@ Follows the design in [`docs/decisions/decision-comments-first-class.md`](decisi
384
385
  - [ ] `update_doc_from_file`: opt-in incremental (`mode="patch"`) update that diffs block by block and rewrites only changed blocks, so comment anchors and revision history survive — lane A, after #878 (same write-path files) ([#957](https://github.com/khuisman/mcp-gee-sweet/issues/957))
385
386
  - [ ] Docstrings: `create_paragraph_bullets` carries internal API-quirk mechanics plus residual bare issue refs in `style.py` tool docstrings ([#683](https://github.com/khuisman/mcp-gee-sweet/issues/683))
386
387
  - [ ] `style_doc_range` has no `font_family` parameter — can't apply monospace to an existing range ([#720](https://github.com/khuisman/mcp-gee-sweet/issues/720))
388
+ - [ ] Document `font_family` on `insert_softbreak_paragraph` and widen the `style_doc_range` font test. Follow-up to #720 from duplicate PR #1028; blocked on #1026, which waits until after the v0.9.2 cut ([#1037](https://github.com/khuisman/mcp-gee-sweet/issues/1037))
387
389
  - [ ] **Bundle:** Calendar follow-ups from PR #912, one PR closing [#915](https://github.com/khuisman/mcp-gee-sweet/issues/915), [#918](https://github.com/khuisman/mcp-gee-sweet/issues/918) — lane B, after #892 ([#985](https://github.com/khuisman/mcp-gee-sweet/issues/985))
388
390
  - [ ] `qa`: `search_files` has no unit test coverage for the error-dict path ([#573](https://github.com/khuisman/mcp-gee-sweet/issues/573))
389
391
  - [ ] Interaction-log middleware for tool calls — structured, append-only JSONL log per call (inputs, duration, cache hit, error), opt-in ID redaction, swappable backend ([#646](https://github.com/khuisman/mcp-gee-sweet/issues/646))
@@ -0,0 +1,187 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Cancel a live image-embedding doc edit mid-flight (TC-DOC203 #883, TC-DOC222 #909).
4
+
5
+ No MCP client can cancel a tool call at a chosen point, so this script runs the
6
+ checkout's own `insert_local_images` (default) or `write_doc_content`
7
+ (`--tool write_doc_content`, which goes through `_apply_doc_content`) against the
8
+ real Docs/Drive APIs inside an anyio task group (mcp cancels a request through an
9
+ anyio cancel scope) and cancels it at one of these points:
10
+
11
+ - `share` — while the image's anyone:reader permission is being granted,
12
+ inside the upload gather.
13
+ - `share-fail` — the same, but the share then fails instead of being granted,
14
+ leaving a created-but-unshared upload (#649) and nothing to embed.
15
+ - `edit` — just before the doc's `batchUpdate` is sent.
16
+ - `inflight` — while the `batchUpdate` is running on its worker thread. The
17
+ thread can't be stopped, so the edit may still land after the cancel.
18
+ - `revoke` — while the post-edit revoke of the temporary share is running.
19
+
20
+ A gate on `execute_in_thread` (in `images` and `content`) holds the matching
21
+ request for a few seconds so the cancel lands there deterministically, then lets
22
+ it through (`share-fail` raises instead; `inflight` sends it at once and cancels
23
+ while it runs). The tool's own WARNING log (the only record a cancelled call
24
+ leaves) is printed to stderr.
25
+
26
+ Every doc-cache invalidation is printed as `doc cache marked dirty for <id>
27
+ (edit landed: yes|no)`, and the script waits for an in-flight edit to finish
28
+ before exiting, so the `inflight` point shows whether the doc is marked dirty
29
+ again once the abandoned edit lands (#907). A `batchUpdate` sent counts as
30
+ landed once its worker thread returns or raises; one the cancel
31
+ stopped before it was sent isn't counted.
32
+
33
+ With `--tool write_doc_content`, MARKER is ignored and the doc's content is
34
+ replaced with `Before`, the image, `After`. Use an empty doc, so there's no
35
+ clear `batchUpdate` (and no backup copy) ahead of the content one.
36
+
37
+ Usage:
38
+ uv run python scripts/qa_cancel_insert_local_images.py DOC_ID FOLDER_ID PNG_PATH MARKER POINT [--keep-shared] [--tool write_doc_content]
39
+
40
+ `--keep-shared` passes `revoke_sharing=False`. Uses the OAuth token from
41
+ `TOKEN_PATH`, like the server under test.
42
+ """
43
+
44
+ from __future__ import annotations
45
+
46
+ import argparse
47
+ import logging
48
+ from functools import partial
49
+ from unittest.mock import MagicMock
50
+
51
+ import anyio
52
+ from googleapiclient.discovery import build
53
+
54
+ from mcp_gee_sweet.auth import _oauth_creds
55
+ from mcp_gee_sweet.tools import docs
56
+ from mcp_gee_sweet.tools.docs import content, images
57
+
58
+ _HOLD_SECONDS = 3
59
+ _LANDING_WAIT_SECONDS = 15
60
+ _POINTS = ["share", "share-fail", "edit", "inflight", "revoke"]
61
+ _TOOLS = ["insert_local_images", "write_doc_content"]
62
+
63
+
64
+ def _register_tools() -> dict:
65
+ captured = {}
66
+
67
+ def tool(annotations=None):
68
+ def decorator(func):
69
+ captured[func.__name__] = func
70
+ return func
71
+
72
+ return decorator
73
+
74
+ docs.register(tool)
75
+ return captured
76
+
77
+
78
+ def _request(execute_fn) -> tuple[str, str]:
79
+ request = getattr(execute_fn, "__self__", None)
80
+ return getattr(request, "uri", ""), getattr(request, "method", "")
81
+
82
+
83
+ def _matches(execute_fn, point: str) -> bool:
84
+ uri, method = _request(execute_fn)
85
+ if point in ("share", "share-fail"):
86
+ return "/permissions" in uri and method == "POST"
87
+ if point == "revoke":
88
+ return "/permissions" in uri and method == "DELETE"
89
+ return ":batchUpdate" in uri
90
+
91
+
92
+ async def main(args: argparse.Namespace) -> None:
93
+ creds = _oauth_creds()
94
+ ctx = MagicMock()
95
+ lc = ctx.request_context.lifespan_context
96
+ lc.docs_service = build("docs", "v1", credentials=creds, cache_discovery=False)
97
+ lc.drive_service = build("drive", "v3", credentials=creds, cache_discovery=False)
98
+ lc.folder_id = args.folder_id
99
+
100
+ sent: list[bool] = [] # one entry per batchUpdate whose worker thread started it
101
+ landed: list[bool] = [] # one entry per batchUpdate whose thread returned or raised
102
+
103
+ def _mark_dirty(doc_id: str) -> None:
104
+ print(
105
+ f"doc cache marked dirty for {doc_id} "
106
+ f"(edit landed: {'yes' if len(landed) == len(sent) and landed else 'no'})"
107
+ )
108
+
109
+ lc.doc_cache.mark_dirty.side_effect = _mark_dirty
110
+
111
+ reached = anyio.Event()
112
+
113
+ def _gate(original):
114
+ async def gated(execute_fn, service):
115
+ run = execute_fn
116
+ if ":batchUpdate" in _request(execute_fn)[0]:
117
+ # Counted on the worker thread: `sent` once the request actually
118
+ # starts (a request the gate held and the cancel stopped never
119
+ # does), `landed` once it returns or raises.
120
+ def run(**kwargs):
121
+ sent.append(True)
122
+ try:
123
+ return execute_fn(**kwargs)
124
+ finally:
125
+ landed.append(True)
126
+
127
+ if reached.is_set() or not _matches(execute_fn, args.point):
128
+ return await original(run, service)
129
+ reached.set()
130
+ if args.point == "inflight":
131
+ # original() hands the request to a worker thread before its first
132
+ # suspension, so the cancel lands while the batchUpdate is running.
133
+ return await original(run, service)
134
+ await anyio.sleep(_HOLD_SECONDS)
135
+ if args.point == "share-fail":
136
+ raise RuntimeError("share-fail: simulated permission failure")
137
+ return await original(run, service)
138
+
139
+ return gated
140
+
141
+ images.execute_in_thread = _gate(images.execute_in_thread)
142
+ content.execute_in_thread = _gate(content.execute_in_thread)
143
+ tools = _register_tools()
144
+ if args.tool == "write_doc_content":
145
+ call = partial(
146
+ tools["write_doc_content"],
147
+ doc_id=args.doc_id,
148
+ content=f"Before\n\n![Pixel]({args.png_path})\n\nAfter",
149
+ content_format="markdown",
150
+ revoke_sharing=not args.keep_shared,
151
+ ctx=ctx,
152
+ )
153
+ else:
154
+ call = partial(
155
+ tools["insert_local_images"],
156
+ doc_id=args.doc_id,
157
+ images=[{"marker": args.marker, "local_path": args.png_path}],
158
+ revoke_sharing=not args.keep_shared,
159
+ ctx=ctx,
160
+ )
161
+ async with anyio.create_task_group() as tg:
162
+ tg.start_soon(call)
163
+ with anyio.fail_after(60):
164
+ await reached.wait()
165
+ tg.cancel_scope.cancel()
166
+ print(f"cancelled at {args.point!r}; the tool returned nothing")
167
+
168
+ # An abandoned edit's thread keeps running; wait for it, then give its
169
+ # loop callback a moment to run.
170
+ with anyio.move_on_after(_LANDING_WAIT_SECONDS):
171
+ while len(landed) < len(sent):
172
+ await anyio.sleep(0.1)
173
+ await anyio.sleep(0.5)
174
+ print(f"batchUpdates sent: {len(sent)}; landed: {len(landed)}")
175
+
176
+
177
+ if __name__ == "__main__":
178
+ parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
179
+ parser.add_argument("doc_id")
180
+ parser.add_argument("folder_id")
181
+ parser.add_argument("png_path")
182
+ parser.add_argument("marker")
183
+ parser.add_argument("point", choices=_POINTS)
184
+ parser.add_argument("--keep-shared", action="store_true")
185
+ parser.add_argument("--tool", choices=_TOOLS, default="insert_local_images")
186
+ logging.basicConfig(level=logging.WARNING, format="%(levelname)s %(name)s: %(message)s")
187
+ anyio.run(main, parser.parse_args())
@@ -33,6 +33,7 @@ from .cache import (
33
33
  SheetStructureCache,
34
34
  )
35
35
  from .http_transport import ( # noqa: F401 — re-exported for tool imports
36
+ after_abandoned_calls,
36
37
  execute_in_thread,
37
38
  thread_http,
38
39
  )