mcp-gee-sweet 0.9.2.dev364__tar.gz → 0.9.2.dev375__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.
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/CLAUDE.md +10 -3
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/PKG-INFO +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/configuration.md +35 -0
- mcp_gee_sweet-0.9.2.dev375/docs/design/image-share-lifecycle.md +60 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/index.md +1 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/local-file-access-policy.md +16 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/known-limitations.md +41 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/docs_content.md +125 -3
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/infra.md +168 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/roadmap.md +8 -4
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/tools.md +9 -9
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/gen_tool_docs.py +1 -1
- mcp_gee_sweet-0.9.2.dev375/scripts/qa_cancel_insert_local_images.py +187 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/qa_revision_temp_doc_parent.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/.env.template +9 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/auth.py +1 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/http_transport.py +66 -2
- mcp_gee_sweet-0.9.2.dev375/src/mcp_gee_sweet/local_files.py +330 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/server.py +59 -19
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/content.py +264 -246
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/images.py +267 -190
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/markdown_export.py +4 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/drive/files.py +14 -4
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/drive/transfer.py +305 -197
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/gmail.py +10 -3
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/response_limits.py +8 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/sheets/data.py +13 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/drive/test_activity.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/drive/test_files.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/drive/test_sharing.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/drive/test_transfer.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/fakes.py +11 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/sheets/test_data.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/sheets/test_structure.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_calendar.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_comments.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_content.py +244 -3
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_editing.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_images.py +169 -5
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_layout.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_markdown_export.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_named_ranges.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_revision_export.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_style.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_tables.py +1 -1
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_gmail.py +1 -1
- mcp_gee_sweet-0.9.2.dev375/tests/test_http_transport.py +126 -0
- mcp_gee_sweet-0.9.2.dev375/tests/test_local_file_sites.py +589 -0
- mcp_gee_sweet-0.9.2.dev375/tests/test_local_files.py +506 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_server.py +290 -1
- mcp_gee_sweet-0.9.2.dev364/scripts/qa_cancel_insert_local_images.py +0 -126
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/cleanup-worktrees.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/merge-pr.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/notify-kai.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/notify-partner.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/orchestrator.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/prep-for-pr.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/qa-kickoff.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/release.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/retro.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/roadmap-status.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/security-advisory.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/start-worktree.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/team-member.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/commands/verify-pr.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/settings.json +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/amy.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/aziz.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/bob.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/dev.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/joy.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/kai.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.claude/team-roles/qa.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.dockerignore +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/dependabot.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/workflows/ci.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/workflows/docs.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/workflows/publish-dev.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.github/workflows/release.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.gitignore +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.pre-commit-config.yaml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/.python-version +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/CHANGELOG.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/CODE_OF_CONDUCT.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/CONTRIBUTING.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/Dockerfile +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/LICENSE +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/Makefile +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/README.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/SECURITY.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docker-compose.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/assets/logo.png +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/auth.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/client-setup.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-async-tool-execution.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-auth-status-limitation-categories.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-cache-invalidation.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-chart-theming.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-comments-first-class.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-composite-tools.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-condition-type-docstring-generation.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-converted-doc-change-detection.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-dev-team.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-docs-formatting.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-fork.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-gmail-domain.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-grid-data-size-cap.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-impact-reach-triage.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-local-fs-test-harness.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-mcp-v2-resource-context-access.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-pillow-image-dependency.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-prompt-qa-role.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-publishing.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-release-docs-roles.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-repositioning.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-response-size-cap-generalization.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-response-size-cap-reevaluation-519.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-review-finding-ticket-bar.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-supports-all-drives-lint-check.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-sync-folder-recursion.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-testing.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/decision-tool-error-visibility.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/index.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/decisions/role-file-history.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/blockquote-representation.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/borderless-table-columns.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/doc-replace-backup.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/doc-revision-export.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/doc-to-markdown.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/docs-ast-pipeline.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/effectiveformat-spike.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/heading-anchor-resolution.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/image-conversion.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/markdown-support.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/module-history.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/oauth-reauthorize-from-tool-call.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/phase3-theme-system.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/sse-consent-off-event-loop.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/index.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/notes-read.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/README.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/qa-fixture-pixel.png +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-d195-create-doc.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-d196-create-doc.html +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-d213-dollar-escape.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-d226-heading-table.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc102-image-conversion.html +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc103-image-conversion.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc104-nested-lists.html +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc105-nested-lists-gfm.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc106-nested-lists-4space.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc135-paragraph-boundary.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc136-interrupted-block-boundary.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc137-inline-hr-no-block-ancestor.html +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc138-nbsp-spacer-paragraph.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc141-mismatched-list-tags.html +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc142-heading-anchors.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc144-anchor-in-table-cell.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures/tc-doc145-anchor-on-first-element.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/fixtures.template.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/gmail-test-plan.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/operations.yaml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/playwright_oauth.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/.gitkeep +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-02.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-14.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-17.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-18.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-21-drive-discovery.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-21-sheets-delete-clear.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-06-28.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-07-04-docs.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-07-04-drive-smoke.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-07-04-infra.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-07-04-sheets_read.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-07-04.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/results/2026-09-04.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/retro-v0.8.0.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/retro-v0.9.0.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/run.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/runs/README.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/runs/v0.8.0.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/runs/v0.8.1.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/runs/v0.9.0.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/runs/v0.9.1.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/setup.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/calendar.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/docs_layout.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/docs_style.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/docs_tables.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/drive_activity.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/drive_files.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/drive_sharing.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/drive_transfer.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/gmail.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/sheets_charts.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/sheets_mgmt.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/sheets_read.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/qa/tests/sheets_write.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/style-guide.md +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/mkdocs.yml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/pyproject.toml +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/pyrightconfig.json +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/check_supports_all_drives.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/lane_context_hook.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/oauth_setup.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/qa_gmail_fixtures.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/setup_team.sh +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/scripts/write_team_mcp_configs.sh +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/server.json +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/cache.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/reauth.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/sse_shutdown.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/atomic_write.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/cache.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/calendar.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/concurrency.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/anchors.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/ast.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/ast_to_markdown.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/comments.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/doc_to_ast.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/editing.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/emitter.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/html_parser.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/indices.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/layout.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/named_ranges.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/style.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/docs/tables.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/drive/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/drive/activity.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/drive/sharing.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/http_errors.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/mime_types.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/pagination.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/sheets/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/sheets/helpers.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/src/mcp_gee_sweet/tools/sheets/structure.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/conftest.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/drive/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/integration/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/integration/conftest.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/integration/test_local_fs_harness.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/sheets/__init__.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/sheets/test_helpers.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_atomic_write.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_auth.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_cache.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_check_supports_all_drives.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_concurrency.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_anchors.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_core.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_docs_indices.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_gen_tool_docs.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_http_errors.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_lane_context_hook.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_mime_types.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_qa_gmail_fixtures.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_reauth.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_response_limits.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_server_json.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_sse_shutdown.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/tests/test_team_mcp_configs.py +0 -0
- {mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/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
|
|
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:
|
|
@@ -84,6 +84,12 @@ Each entry below says what a module owns and the invariants a future edit could
|
|
|
84
84
|
- A code-styled paragraph's internal `"\n"` breaks become `"\v"` (`_is_code_paragraph`) so a fenced block stays one Docs paragraph; `doc_to_ast.py` reverses it.
|
|
85
85
|
- `tools/cache.py` — `refresh_cache`, `set_cache_ttl`/`get_cache_ttl` (runtime TTL change, no restart needed)
|
|
86
86
|
- `tools/calendar.py` — Calendar API tools
|
|
87
|
+
- `local_files.py` — the local-file access policy, `LOCAL_FILE_ACCESS=full|roots|off` (#796, `docs/design/local-file-access-policy.md`). Resolved once at import from env and argv (`cli_transport`, shared with `main()`): the default is `full` under stdio and `off` otherwise, and `_timed`'s `request_over_http` tripwire refuses a defaulted `full` that reaches an HTTP request. Invariants:
|
|
88
|
+
- Every local read or write a tool makes goes through `check_read`/`check_write`, *before* any `stat` of the path, so a refusal reads the same whether or not the path exists. The check returns the resolved path. Where a site uses it (`_upload_local_file`'s upload, `_read_doc_source_file`, `import_csv_to_sheet`, Gmail attachments) it narrows the window before the I/O; writes keep the caller's path, since `_write_atomically` resolves a symlinked destination itself. Neither closes the check-then-use race, which is a documented known limitation. Take a filename or suffix from the caller's own spelling, so a symlink keeps its link name. A malformed path (a NUL byte) is a `LocalFileAccessError` too, so a per-item site fails only that item.
|
|
89
|
+
- A folder walk checks each entry, not just the root: a symlink inside a root can point anywhere. In `sync_folder` a refusal is a `local_read_fail` plan step (`_sync_policy_refusal`). `_sync_local_check` picks the check from what the plan can do to the local side (read, write, or either for a both-sides bidirectional entry) and returns None for a name on one side only that the direction never touches, which is skipped unchecked. Wrap a walk in `local_files.many_checks()`, which stats the deny-list once for the whole walk instead of once per entry, on the loop. It also resolves each parent directory once, keyed by the path's raw spelling. Never normalize it lexically (`abspath`/`normpath`): `link/..` is the parent of the link's target, and collapsing it first let a write land in a deny-listed directory (PR #1039 QA round 2). A relative path bypasses the cache.
|
|
90
|
+
- `resolve_policy` never raises: an invalid setting resolves to `off` with `Policy.error` set, and only `main()`'s serving path exits on it (`exit_if_invalid`), so `mcp-gee-sweet auth` and `gen_tool_docs.py` still run.
|
|
91
|
+
- A tool that can only work on local files takes `@tool(local_only=True)`, which `off` mode doesn't register. A tool with an optional `local_path` checks it at entry, before any fetch; `write_capped_result_to_disk` is the backstop and also checks the joined `default_filename`.
|
|
92
|
+
- A new tool parameter that takes a local path fails `tests/test_server.py::TestLocalPathToolsAreCovered` until the tool is added to `_LOCAL_ONLY_TOOLS` or `_OPTIONAL_LOCAL_PATH_TOOLS` there, with its check in place.
|
|
87
93
|
- `tools/response_limits.py` — shared response-size safety net (`enforce_response_size_cap`, `write_capped_result_to_disk`); imported cross-package the same way `tools/drive/__init__.py`'s `_SA_QUOTA_ERROR` is. Cap configured via `MAX_TOOL_RESPONSE_CHARS` (see `docs/configuration.md` for the current default — raised in issue #519 after live-testing found the client-connection-death failure mode it defends against no longer reproduces at the old default's scale, kept as defense-in-depth for other/untested MCP clients); see `docs/decisions/decision-response-size-cap-generalization.md` and `docs/decisions/decision-response-size-cap-reevaluation-519.md`
|
|
88
94
|
|
|
89
95
|
`__init__.py` loads `src/mcp_gee_sweet/.env` via `python-dotenv` before importing `server`, so env vars from that file are in `os.environ` by the time any module-level `os.environ.get()` runs. Priority: real env var > `.env` > default.
|
|
@@ -129,7 +135,8 @@ Set `AUTH_METHOD` to pin a specific method with no fallback — removes ambiguit
|
|
|
129
135
|
- 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
136
|
- 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
137
|
- 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. `
|
|
138
|
+
- 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).
|
|
139
|
+
- 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
140
|
- `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
141
|
- 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
142
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: mcp-gee-sweet
|
|
3
|
-
Version: 0.9.2.
|
|
3
|
+
Version: 0.9.2.dev375
|
|
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
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
| `OAUTH_CONSENT_TIMEOUT_SECONDS` | SSE only: how long the server waits for the browser consent when there's no usable OAuth token, before starting without Google access. See [Authentication](auth.md) | `300` |
|
|
14
14
|
| `CREDENTIALS_CONFIG` | Base64-encoded credentials JSON (for containers) | — |
|
|
15
15
|
| `ENABLED_TOOLS` | Comma-separated list of tool names to register | all tools |
|
|
16
|
+
| `LOCAL_FILE_ACCESS` | Which local files tools may read and write: `full`, `roots`, or `off`. See [Local file access](#local-file-access) | `full` under stdio, `off` under SSE and streamable HTTP |
|
|
17
|
+
| `LOCAL_FILE_ROOTS` | With `LOCAL_FILE_ACCESS=roots`, the directories tools may use, separated by `:` (`;` on Windows), like `PATH` | — |
|
|
16
18
|
| `CACHE_DB_PATH` | Path to the SQLite cache database | `/tmp/mcp_gee_sweet.db` |
|
|
17
19
|
| `CACHE_TTL` | Cache time-to-live in seconds. Also adjustable at runtime via the `set_cache_ttl` tool, no restart needed | `1800` (30 min) |
|
|
18
20
|
| `CACHE_VALIDATE_MODIFIED_TIME` | Validate sheet/doc cache hits against Drive's `modifiedTime` before serving them, catching edits from other sessions without waiting out the TTL. Costs one extra Drive API call per cache lookup | `true` |
|
|
@@ -113,6 +115,39 @@ list_messages,get_message,list_threads,get_thread,list_labels,send_message,creat
|
|
|
113
115
|
|
|
114
116
|
See [Tools](tools.md) for the full list of tool names.
|
|
115
117
|
|
|
118
|
+
## Local file access
|
|
119
|
+
|
|
120
|
+
Some tools read or write files on the machine the server runs on: uploads, downloads, `sync_folder`, `create_doc_from_file`, Gmail attachments, local images in Markdown, and the `local_path` destination that large results can be written to. `LOCAL_FILE_ACCESS` decides which files they may use:
|
|
121
|
+
|
|
122
|
+
| Mode | What tools may use |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `full` | Any local path the server process can open |
|
|
125
|
+
| `roots` | Only paths under a directory listed in `LOCAL_FILE_ROOTS`. Paths are resolved first, symlinks included, so a link inside a root that points outside it is refused |
|
|
126
|
+
| `off` | No local files |
|
|
127
|
+
|
|
128
|
+
**Default:** `full` under stdio, where the caller is the person running the server, and `off` under SSE and streamable HTTP, where it may not be. A network-facing server that should use local files needs `LOCAL_FILE_ACCESS` set explicitly.
|
|
129
|
+
|
|
130
|
+
**Always refused, in every mode:** the server's own credential, config, cache, and log files. That's `CREDENTIALS_PATH`, `TOKEN_PATH`, `SERVICE_ACCOUNT_PATH`, `GOOGLE_APPLICATION_CREDENTIALS`, gcloud's default ADC file, `src/mcp_gee_sweet/.env`, `CACHE_DB_PATH` (and its `-wal`/`-shm` files), `LOG_FILE`, and `ACCESS_LOG_FILE`. A file is matched by identity, so a hardlink or a differently cased path to one of them is refused too.
|
|
131
|
+
|
|
132
|
+
**In `off` mode** these tools aren't registered, since they can only work on local files: `upload_local_file`, `upload_local_folder`, `download_file`, `download_folder`, `sync_folder`, `import_csv_to_sheet`, `create_doc_from_file`, `update_doc_from_file`, and `insert_local_images`. Tools with an optional local path stay registered and return an error if one is used. That covers `local_path` on large-result tools, Gmail's `attachments[].local_path` (`content_base64` still works), and local image paths in `create_doc`/`write_doc_content` content, which fail per image while the doc is still written.
|
|
133
|
+
|
|
134
|
+
During a folder walk (`upload_local_folder`, `download_folder`, `sync_folder`), each file and subfolder is checked, not just the top directory. A refused entry is listed under `failed`, and the rest of the walk continues.
|
|
135
|
+
|
|
136
|
+
`server://auth-status` reports the active policy under `local_file_access`: its `mode`, whether it was set `explicit`ly, the `roots` in `roots` mode, and the `unregistered_tools` that `off` mode left out.
|
|
137
|
+
|
|
138
|
+
Docker example, with the host's `./data` directory as the only one tools may use:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
docker run --rm -p 8000:8000 \
|
|
142
|
+
-v "$PWD/data:/data" \
|
|
143
|
+
-e LOCAL_FILE_ACCESS=roots \
|
|
144
|
+
-e LOCAL_FILE_ROOTS=/data \
|
|
145
|
+
-e CREDENTIALS_CONFIG=<base64> \
|
|
146
|
+
mcp-gee-sweet
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
An invalid `LOCAL_FILE_ACCESS` value, `roots` mode without `LOCAL_FILE_ROOTS`, or a root that isn't an existing directory stops the server at startup, before it serves. `mcp-gee-sweet auth` still runs, so a root that isn't mounted yet doesn't block re-authorization. Design: [local-file-access-policy.md](design/local-file-access-policy.md).
|
|
150
|
+
|
|
116
151
|
## Caching
|
|
117
152
|
|
|
118
153
|
The server caches responses in a local SQLite database to reduce API calls and latency. Five namespaces are cached: sheet structure, sheet data, Drive folder listings, doc content, and calendar metadata.
|
|
@@ -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 |
|
{mcp_gee_sweet-0.9.2.dev364 → mcp_gee_sweet-0.9.2.dev375}/docs/design/local-file-access-policy.md
RENAMED
|
@@ -107,7 +107,7 @@ Don't interpolate `TOKEN_PATH`'s value or other secret-named values into log lin
|
|
|
107
107
|
|
|
108
108
|
### 4. Configuration validation
|
|
109
109
|
|
|
110
|
-
Done at import, alongside `ENABLED_TOOLS`. An invalid value raises `SystemExit` with a one-line message, so a misconfigured server never starts serving:
|
|
110
|
+
Done at import, alongside `ENABLED_TOOLS`. An invalid value raises `SystemExit` with a one-line message, so a misconfigured server never starts serving (as implemented, the exit moved to `main()`'s serving path; see [As implemented](#as-implemented)):
|
|
111
111
|
|
|
112
112
|
- `LOCAL_FILE_ACCESS` not in `full|roots|off` (case-insensitive).
|
|
113
113
|
- `roots` with `LOCAL_FILE_ROOTS` empty or unset.
|
|
@@ -219,6 +219,21 @@ Unit tests only for the policy itself; it has no Google API surface.
|
|
|
219
219
|
|
|
220
220
|
Live QA: the policy makes no Google API calls of its own, so live QA is limited to confirming the real launch paths. One stdio and one SSE subprocess run through `tests/integration/` (`decision-local-fs-test-harness.md`): under SSE with no setting, `sync_folder` is absent from `tools/list`; with `LOCAL_FILE_ACCESS=roots`, `upload_local_file` works inside the root and is refused outside it.
|
|
221
221
|
|
|
222
|
+
## As implemented
|
|
223
|
+
|
|
224
|
+
Where the implementation goes beyond the design above:
|
|
225
|
+
|
|
226
|
+
- **The `off` refusal says why when the mode was defaulted.** An explicit `off` reads as in §3. A defaulted one reads `local file access is disabled on this server: LOCAL_FILE_ACCESS is unset, which means off for the <transport> transport`, since `(LOCAL_FILE_ACCESS=off)` would name a setting the operator never made. The deny-list message ends `can't be read by a tool` or `can't be written by a tool`, depending on the operation.
|
|
227
|
+
- **An optional `local_path` is also checked at the tool's entry.** A live SSE run showed `get_sheet_data(local_path=...)` in `off` mode fetching first: a bad spreadsheet ID reported its 404 instead of the refusal, and a good one paid for a fetch it would then refuse to write. The ten tools with an optional `local_path` now call `check_write` before any API call. `write_capped_result_to_disk` keeps its own check as the backstop.
|
|
228
|
+
- **`sync_folder` checks a download's target even when nothing exists locally.** §6 checks each local entry; a Drive-only file is checked at the path it would be written to, so a Drive file named `token.json` can't plant a token in the directory holding `TOKEN_PATH`. A name on one side only that the direction never touches (local-only under `download`, Drive-only under `upload`) is planned as the usual skip without a check (`_sync_policy_refusal`), the way `_unsafe_name_step` treats an unsafe name.
|
|
229
|
+
- **The docstring note joins each local-only tool's first paragraph.** `gen_tool_docs.py` takes only the first paragraph, so a separate one wouldn't have reached `docs/tools.md`.
|
|
230
|
+
- **An invalid setting doesn't exit at import (PR #1039 QA round 1, finding 4).** §4's import-time `SystemExit` also blocked `mcp-gee-sweet auth` and `gen_tool_docs.py`, neither of which serves, and a `roots` entry that isn't mounted yet blocked re-authorization. `resolve_policy` now resolves an invalid setting to `off`, the fail-safe for registration, with the reason in `Policy.error`. It logs one `ERROR` at import, and `main()`'s serving path exits on it with the same one-line message (`exit_if_invalid`).
|
|
231
|
+
- **`sync_folder`'s verb follows the operation (finding 3).** `_sync_local_check` maps `(in_drive, in_local, direction)` to no check, `check_read`, `check_write`, or `check_read_write` for a both-sides entry under `bidirectional`, whose refusal says "can't be read or written". The sync root counts as a both-sides entry, and `_unsafe_name_step`'s skip rule uses the same helper.
|
|
232
|
+
- **A NUL byte is a refusal, not a crash (finding 1).** `os.path.realpath` raises a plain `ValueError` for one, which the per-item sites didn't catch; `_check` turns it into a `LocalFileAccessError`, so that item fails alone, as a missing file did before.
|
|
233
|
+
- **The case-insensitive compare applies only to a target that doesn't exist (finding 5).** An existing target matches by exact path or file identity, so on a case-sensitive filesystem a distinct `Token.json` beside `token.json` is allowed.
|
|
234
|
+
- **`many_checks()` for walks (finding 6).** A check cost about 75µs, most of it `realpath`'s `lstat` per component plus a `stat` of every deny-list entry. Inside `many_checks()`, which wraps the walks in `upload_local_folder`, `download_folder` and `sync_folder`, the deny-list is statted once and each parent directory resolved once, leaving one `lstat` per entry: about 13µs. The parent cache is keyed by the path's raw spelling and never normalizes lexically (QA round 2): `os.path.abspath` collapsed `<symlink>/..` before the symlink was resolved, so a walk rooted there checked one directory and wrote into another. A relative path bypasses the cache.
|
|
235
|
+
- **No CHANGELOG entry.** `CHANGELOG.md` stops at 0.8.1, so the breaking default for network transports goes in the PR body for the release notes instead.
|
|
236
|
+
|
|
222
237
|
## Known limitations
|
|
223
238
|
|
|
224
239
|
- **Check-then-use race.** A symlink swapped between the check and the `open` defeats `roots`. A remote caller can't create symlinks through any tool (downloads write regular files and `sync_folder` never creates links), so exploiting it needs a local actor with write access inside a root. Closing it fully would mean `openat`-style descriptor-relative I/O through every site, which is out of proportion here.
|
|
@@ -289,3 +289,44 @@ A rename means the destination only ever holds the old content or the complete n
|
|
|
289
289
|
|
|
290
290
|
**Workaround:** Re-apply ACLs, tags, or ownership after downloading, if they matter. Delete a
|
|
291
291
|
leftover `.gee-sweet-partial-*` file once no download into that folder is running.
|
|
292
|
+
|
|
293
|
+
## Local file access
|
|
294
|
+
|
|
295
|
+
### `LOCAL_FILE_ACCESS=roots` checks a path before it's used, not as it's used
|
|
296
|
+
|
|
297
|
+
**What:** A path is resolved, symlinks included, and checked against `LOCAL_FILE_ROOTS` just
|
|
298
|
+
before the tool opens it. If a symlink inside a root is swapped to point outside it between
|
|
299
|
+
that check and the open, the tool follows the new link.
|
|
300
|
+
|
|
301
|
+
**Why:** Closing the gap fully means descriptor-relative I/O (`openat`) through every local
|
|
302
|
+
read and write, which is out of proportion here. No tool can create a symlink (downloads write
|
|
303
|
+
regular files and `sync_folder` never creates links), so a remote caller can't stage the swap.
|
|
304
|
+
It takes a local user with write access inside a root.
|
|
305
|
+
|
|
306
|
+
**Workaround:** Don't give untrusted local users write access to a directory listed in
|
|
307
|
+
`LOCAL_FILE_ROOTS`.
|
|
308
|
+
|
|
309
|
+
### `roots` mode can refuse a path spelled in a different case on macOS
|
|
310
|
+
|
|
311
|
+
**What:** On a case-insensitive filesystem (macOS's default), a path whose directories are
|
|
312
|
+
spelled with a different case than the configured root, such as `/Data/x.csv` under the root
|
|
313
|
+
`/data`, can be refused even though it names a file inside the root.
|
|
314
|
+
|
|
315
|
+
**Why:** Containment is a test on the resolved path's text, and resolving keeps the caller's
|
|
316
|
+
spelling of existing directories. A case mismatch can therefore refuse a path inside a root,
|
|
317
|
+
but never allows one outside it. The always-refused credential files are matched by file
|
|
318
|
+
identity instead, so a case variant of one of them is still refused.
|
|
319
|
+
|
|
320
|
+
**Workaround:** Spell paths with the same case as the `LOCAL_FILE_ROOTS` entry.
|
|
321
|
+
|
|
322
|
+
### Only the server's own files are protected
|
|
323
|
+
|
|
324
|
+
**What:** In every mode, tools can't read or write the server's own credential, config, cache,
|
|
325
|
+
and log files. Any other secret is readable in `full` mode, or in `roots` mode when it's
|
|
326
|
+
inside a root.
|
|
327
|
+
|
|
328
|
+
**Why:** The server can't know which other files are sensitive. `roots` mode is how an
|
|
329
|
+
operator limits tools to directories meant for them.
|
|
330
|
+
|
|
331
|
+
**Workaround:** Use `LOCAL_FILE_ACCESS=roots` with roots that hold only files meant for the
|
|
332
|
+
server.
|
|
@@ -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 `[](https://example.com/bare)`, and the second was `[tail](https://example.com/block)`, then `[](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 ``, 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\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(),
|
|
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(),
|
|
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(),
|
|
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="", 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.
|