Skip to content

feat(file-system): add versioned instructions for desktop folders#61494

Merged
raquelmsmith merged 16 commits into
masterfrom
posthog-code/desktop-folder-instructions
Jun 6, 2026
Merged

feat(file-system): add versioned instructions for desktop folders#61494
raquelmsmith merged 16 commits into
masterfrom
posthog-code/desktop-folder-instructions

Conversation

@raquelmsmith

@raquelmsmith raquelmsmith commented Jun 3, 2026

Copy link
Copy Markdown
Member

video description

https://www.loom.com/share/2821ed9df9bf4ca4ae34c518eb6cab7f

Problem

The desktop filesystem surface has folders but no way to describe what a folder contains. We want to attach a markdown "instructions" blob to each individual desktop folder — conceptually like the markdown body that backs a shared skill in the skills store — so the contents of a folder can be documented and that documentation can evolve over time with history preserved.

Changes

Adds per-folder, versioned markdown instructions for the desktop surface only.

  • New model FileSystemFolderInstructions (posthog/models/file_system/folder_instructions.py) — a separate, versioned table rather than a column on FileSystem. Rationale: versioning can't live on a single column; a separate table keeps the hot FileSystem table lean, and keying to the folder's stable row FK survives renames/moves. Uses TeamScopedRootMixin (fail-closed team scoping) with content / version / is_latest / deleted and two partial unique constraints (one latest + unique version per folder), mirroring the LLMSkill shape.
  • Versioning service (folder_instructions_service.py) — publish / get-latest / list-versions / soft-delete, with a base_version optimistic-concurrency check and a 100 KB content size cap.
  • APIinstructions (GET/PUT/PATCH/DELETE) and instructions/versions (GET) detail actions added to DesktopFileSystemViewSet only, so the web sidebar tree is unaffected. Reuses the existing project + access-control scoping via get_object().
  • Serializers carry help_text on every field and validate content size.

No frontend changes — the desktop surface is consumed by a separate client that will wire up the editor against these endpoints.

How did you test this code?

I'm an agent. I added automated API tests in posthog/api/file_system/test/test_folder_instructions.py covering: publish + version increment, latest GET, version history, size-cap rejection (400), folder-type guard (400), cross-team IDOR (404), web-surface isolation (404), soft delete + republish, and concurrency conflict (409).

I could not run the Python test suite or makemigrations --check/build:openapi in my environment (no Django virtualenv available). Before merge, please run:

  • hogli test posthog/api/file_system/test/test_folder_instructions.py
  • python manage.py makemigrations --check (verify the hand-written migration 1208_filesystemfolderinstructions matches model state)
  • hogli build:openapi (the new serializers/endpoints add to the OpenAPI spec, so generated TS/Zod types + MCP schemas must be regenerated and committed)

I verified locally that all new/changed files pass ruff check, ruff format --check, and py_compile.

🤖 Agent context

Authored with Claude Code (PostHog Code). The user asked to research whether folder instructions should be a column on the file store or a separate model; after confirming the requirements (per-individual-folder, versioned history, desktop surface only) I chose a separate versioned model patterned on the existing skills store (LLMSkill), since versioning rules out a single column and a separate table avoids widening the heavily-used FileSystem table while surviving folder rename/move via the row FK.

Open question for the reviewer: confirm whether the desktop client UI lives in this repo (and thus whether follow-up UI work is in scope) or is a separate application consuming this API.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

MCP UI Apps size report

App JS CSS
debug 586.6 KB 146.6 KB
action 355.0 KB 146.6 KB
action-list 520.2 KB 146.6 KB
cohort 354.0 KB 146.6 KB
cohort-list 519.1 KB 146.6 KB
error-details 375.4 KB 146.6 KB
error-issue 354.7 KB 146.6 KB
error-issue-list 520.1 KB 146.6 KB
experiment 517.0 KB 146.6 KB
experiment-list 520.9 KB 146.6 KB
experiment-results 518.8 KB 146.6 KB
feature-flag 552.8 KB 146.6 KB
feature-flag-list 556.9 KB 146.6 KB
feature-flag-testing 432.7 KB 146.6 KB
insight-actors 515.5 KB 146.6 KB
llm-costs 515.1 KB 146.6 KB
session-recording 355.8 KB 146.6 KB
session-summary 361.5 KB 146.6 KB
survey 355.5 KB 146.6 KB
survey-global-stats 517.8 KB 146.6 KB
survey-list 520.8 KB 146.6 KB
survey-stats 517.8 KB 146.6 KB
trace-span 354.4 KB 146.6 KB
trace-span-list 520.1 KB 146.6 KB
workflow 354.3 KB 146.6 KB
workflow-list 519.5 KB 146.6 KB
query-results 536.9 KB 146.6 KB
visual-review-snapshots 359.0 KB 146.6 KB

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 82.2 MB

ℹ️ View Unchanged
Filename Size
frontend/dist-report/decompression-worker/src/scenes/session-recordings/player/snapshot-processing/decompressionWorker 2.85 kB
frontend/dist-report/exporter/_chunks/chunk 8.72 MB
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Action 25 kB
frontend/dist-report/exporter/_parent/products/actions/frontend/pages/Actions 1.33 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityScene 120 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 19.9 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 132 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/AIObservabilityUsers 872 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.64 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.1 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 915 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.19 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 38 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.83 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillScene 895 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 912 B
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB
frontend/dist-report/exporter/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.31 kB
frontend/dist-report/exporter/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 20.4 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.67 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.06 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.06 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.82 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 34.4 kB
frontend/dist-report/exporter/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.07 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 79.3 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.65 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.18 kB
frontend/dist-report/exporter/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.86 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/DataWarehouseScene 46.8 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.15 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 26.6 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.1 kB
frontend/dist-report/exporter/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.31 kB
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.02 kB
frontend/dist-report/exporter/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.24 kB
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointScene 44.4 kB
frontend/dist-report/exporter/_parent/products/endpoints/frontend/EndpointsScene 24.5 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.34 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 104 kB
frontend/dist-report/exporter/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 33.6 kB
frontend/dist-report/exporter/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.08 kB
frontend/dist-report/exporter/_parent/products/games/368Hedgehogs/368Hedgehogs 5.61 kB
frontend/dist-report/exporter/_parent/products/games/FlappyHog/FlappyHog 6.12 kB
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 60.5 kB
frontend/dist-report/exporter/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 6.28 kB
frontend/dist-report/exporter/_parent/products/links/frontend/LinkScene 25.2 kB
frontend/dist-report/exporter/_parent/products/links/frontend/LinksScene 4.55 kB
frontend/dist-report/exporter/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/LogsScene 17.8 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.2 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsAlertNotificationDetailScene/LogsAlertNotificationDetailScene 8.49 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.3 kB
frontend/dist-report/exporter/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.25 kB
frontend/dist-report/exporter/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.6 kB
frontend/dist-report/exporter/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.6 kB
frontend/dist-report/exporter/_parent/products/metrics/frontend/MetricsScene 16.2 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.31 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.14 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 8.57 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.41 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.63 kB
frontend/dist-report/exporter/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.43 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/observations/ReplayObservation 14.1 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 41.6 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 17.1 kB
frontend/dist-report/exporter/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.59 kB
frontend/dist-report/exporter/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.5 kB
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.05 kB
frontend/dist-report/exporter/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.2 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/SlackTaskContextScene 8.88 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskDetailScene 23.8 kB
frontend/dist-report/exporter/_parent/products/tasks/frontend/TaskTracker 14.6 kB
frontend/dist-report/exporter/_parent/products/tracing/frontend/TracingScene 67.2 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterview 9.37 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviewResponse 7.79 kB
frontend/dist-report/exporter/_parent/products/user_interviews/frontend/UserInterviews 6.08 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.56 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.8 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.32 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB
frontend/dist-report/exporter/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.6 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/Workflows/WorkflowScene 111 kB
frontend/dist-report/exporter/_parent/products/workflows/frontend/WorkflowsScene 60.1 kB
frontend/dist-report/exporter/src/exporter/exporter 36.8 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterDashboardScene 2.02 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterHeatmapScene 19.9 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterInsightScene 3.02 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterInterviewScene 310 kB
frontend/dist-report/exporter/src/exporter/scenes/ExporterNotebookScene 2.71 MB
frontend/dist-report/exporter/src/exporter/scenes/ExporterRecordingScene 1.13 kB
frontend/dist-report/exporter/src/exporterSharedChunkAnchors 1.19 kB
frontend/dist-report/exporter/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB
frontend/dist-report/exporter/src/lib/components/MonacoDiffEditor 471 B
frontend/dist-report/exporter/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.25 kB
frontend/dist-report/exporter/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 842 B
frontend/dist-report/exporter/src/lib/lemon-ui/Link/Link 359 B
frontend/dist-report/exporter/src/lib/monaco/CodeEditorInline 832 B
frontend/dist-report/exporter/src/lib/monaco/vimMode 211 kB
frontend/dist-report/exporter/src/lib/ui/Button/ButtonPrimitives 422 B
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitals 7.52 kB
frontend/dist-report/exporter/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.09 kB
frontend/dist-report/exporter/src/queries/schema 894 kB
frontend/dist-report/exporter/src/scenes/approvals/changeRequestsLogic 884 B
frontend/dist-report/exporter/src/scenes/authentication/shared/passkeyLogic 824 B
frontend/dist-report/exporter/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.2 kB
frontend/dist-report/exporter/src/scenes/data-pipelines/TransformationsScene 6.58 kB
frontend/dist-report/exporter/src/scenes/insights/views/BoxPlot/BoxPlot 5.39 kB
frontend/dist-report/exporter/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 8.84 kB
frontend/dist-report/exporter/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB
frontend/dist-report/exporter/src/scenes/insights/views/WorldMap/WorldMap 1.04 MB
frontend/dist-report/exporter/src/scenes/models/ModelsScene 19 kB
frontend/dist-report/exporter/src/scenes/models/NodeDetailScene 17 kB
frontend/dist-report/monaco-editor-worker/src/lib/monaco/workers/monacoEditorWorker 288 kB
frontend/dist-report/monaco-json-worker/src/lib/monaco/workers/monacoJsonWorker 419 kB
frontend/dist-report/monaco-typescript-worker/src/lib/monaco/workers/monacoTsWorker 7.02 MB
frontend/dist-report/posthog-app/_chunks/chunk 8.92 MB
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Action 25.1 kB
frontend/dist-report/posthog-app/_parent/products/actions/frontend/pages/Actions 1.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityScene 120 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilitySessionScene 19.9 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityTraceScene 132 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/AIObservabilityUsers 906 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClusterScene 21.7 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/clusters/AIObservabilityClustersScene 55.1 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetScene 21 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/datasets/AIObservabilityDatasetsScene 3.67 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluation 59.9 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/AIObservabilityEvaluationsScene 28.2 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/evaluations/EvaluationTemplates 949 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/LLMASessionFeedbackDisplay 5.23 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/playground/AIObservabilityPlaygroundScene 38 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptScene 29.2 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/prompts/LLMPromptsScene 4.86 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillScene 929 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/skills/LLMSkillsScene 946 B
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTag 27.4 kB
frontend/dist-report/posthog-app/_parent/products/ai_observability/frontend/tags/AIObservabilityTagsScene 7.34 kB
frontend/dist-report/posthog-app/_parent/products/business_knowledge/frontend/scenes/BusinessKnowledgeScene 20.4 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/Assignee/CyclotronJobInputAssignee 1.71 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/SlaBusinessHours/CyclotronJobInputBusinessHours 3.09 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/components/TicketTags/CyclotronJobInputTicketTags 1.09 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/settings/SupportSettingsScene 1.85 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/ticket/SupportTicketScene 26.6 kB
frontend/dist-report/posthog-app/_parent/products/conversations/frontend/scenes/tickets/SupportTicketsScene 1.11 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/CustomerAnalyticsScene 78 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerAnalyticsConfigurationScene/CustomerAnalyticsConfigurationScene 2.68 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyBuilderScene/CustomerJourneyBuilderScene 2.22 kB
frontend/dist-report/posthog-app/_parent/products/customer_analytics/frontend/scenes/CustomerJourneyTemplatesScene/CustomerJourneyTemplatesScene 7.9 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/DataWarehouseScene 1.81 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/NewSourceScene/NewSourceScene 1.25 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SchemaScene/SchemaScene 26.6 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourceScene/SourceScene 1.17 kB
frontend/dist-report/posthog-app/_parent/products/data_warehouse/frontend/scenes/SourcesScene/SourcesScene 6.34 kB
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeature 1.2 kB
frontend/dist-report/posthog-app/_parent/products/early_access_features/frontend/EarlyAccessFeatures 3.28 kB
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointScene 44.5 kB
frontend/dist-report/posthog-app/_parent/products/endpoints/frontend/EndpointsScene 22.4 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingFingerprintsScene/ErrorTrackingIssueFingerprintsScene 7.37 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingIssueScene/ErrorTrackingIssueScene 103 kB
frontend/dist-report/posthog-app/_parent/products/error_tracking/frontend/scenes/ErrorTrackingScene/ErrorTrackingScene 33.7 kB
frontend/dist-report/posthog-app/_parent/products/feature_flags/frontend/FeatureFlagTemplatesScene 7.12 kB
frontend/dist-report/posthog-app/_parent/products/games/368Hedgehogs/368Hedgehogs 5.65 kB
frontend/dist-report/posthog-app/_parent/products/games/FlappyHog/FlappyHog 6.16 kB
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentNewScene 60.5 kB
frontend/dist-report/posthog-app/_parent/products/legal_documents/frontend/scenes/LegalDocumentsScene 6.32 kB
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinkScene 25.2 kB
frontend/dist-report/posthog-app/_parent/products/links/frontend/LinksScene 4.58 kB
frontend/dist-report/posthog-app/_parent/products/live_debugger/frontend/LiveDebugger 19.5 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/LogsScene 17.8 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsAlertDetailScene/LogsAlertDetailScene 17.3 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsAlertNotificationDetailScene/LogsAlertNotificationDetailScene 8.53 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingDetailScene/LogsSamplingDetailScene 5.34 kB
frontend/dist-report/posthog-app/_parent/products/logs/frontend/scenes/LogsSamplingNewScene/LogsSamplingNewScene 2.29 kB
frontend/dist-report/posthog-app/_parent/products/managed_migrations/frontend/ManagedMigration 14.9 kB
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsScene 40.6 kB
frontend/dist-report/posthog-app/_parent/products/mcp_analytics/frontend/MCPAnalyticsToolDetail 18.6 kB
frontend/dist-report/posthog-app/_parent/products/metrics/frontend/MetricsScene 16.2 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessBarChart/StickinessBarChart 3.35 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/stickiness/StickinessLineChart/StickinessLineChart 3.18 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsBarChart/TrendsBarChart 8.61 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLifecycleChart/TrendsLifecycleChart 4.45 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart 4.66 kB
frontend/dist-report/posthog-app/_parent/products/product_analytics/frontend/insights/trends/TrendsPieChart/TrendsPieChart 4.47 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/observations/ReplayObservation 14.1 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScanner 41.7 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ReplayScannersScene 17.2 kB
frontend/dist-report/posthog-app/_parent/products/replay_vision/frontend/replay_scanners/ScannerTemplatesScene 4.63 kB
frontend/dist-report/posthog-app/_parent/products/revenue_analytics/frontend/RevenueAnalyticsScene 26.7 kB
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummariesTable 5.09 kB
frontend/dist-report/posthog-app/_parent/products/session_summaries/frontend/SessionGroupSummaryScene 19.3 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/SlackTaskContextScene 8.91 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskDetailScene 23.9 kB
frontend/dist-report/posthog-app/_parent/products/tasks/frontend/TaskTracker 14.7 kB
frontend/dist-report/posthog-app/_parent/products/tracing/frontend/TracingScene 67.3 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterview 9.41 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviewResponse 7.83 kB
frontend/dist-report/posthog-app/_parent/products/user_interviews/frontend/UserInterviews 6.12 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewIndexScene 2.59 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunScene 44.9 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewRunsScene 7.36 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSettingsScene 11.1 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotHistoryScene 13.9 kB
frontend/dist-report/posthog-app/_parent/products/visual_review/frontend/scenes/VisualReviewSnapshotOverviewScene 19.6 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/TemplateLibrary/MessageTemplate 16.7 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/Workflows/WorkflowScene 105 kB
frontend/dist-report/posthog-app/_parent/products/workflows/frontend/WorkflowsScene 60.3 kB
frontend/dist-report/posthog-app/src/index 62 kB
frontend/dist-report/posthog-app/src/layout/panel-layout/ai-first/tabs/NavTabChat 7.26 kB
frontend/dist-report/posthog-app/src/lib/components/Cards/TextCard/TextCardMarkdownEditor 11.3 kB
frontend/dist-report/posthog-app/src/lib/components/MonacoDiffEditor 471 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonMarkdown/MermaidDiagram 2.29 kB
frontend/dist-report/posthog-app/src/lib/lemon-ui/LemonTextArea/LemonTextAreaMarkdown 876 B
frontend/dist-report/posthog-app/src/lib/lemon-ui/Link/Link 359 B
frontend/dist-report/posthog-app/src/lib/monaco/CodeEditorInline 866 B
frontend/dist-report/posthog-app/src/lib/monaco/vimMode 211 kB
frontend/dist-report/posthog-app/src/lib/ui/Button/ButtonPrimitives 426 B
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitals 7.55 kB
frontend/dist-report/posthog-app/src/queries/nodes/WebVitals/WebVitalsPathBreakdown 4.12 kB
frontend/dist-report/posthog-app/src/queries/schema 894 kB
frontend/dist-report/posthog-app/src/scenes/activity/explore/EventsScene 3.33 kB
frontend/dist-report/posthog-app/src/scenes/activity/explore/SessionsScene 4.73 kB
frontend/dist-report/posthog-app/src/scenes/activity/live/LiveEventsTable 5.62 kB
frontend/dist-report/posthog-app/src/scenes/agentic/AgenticAuthorize 5.88 kB
frontend/dist-report/posthog-app/src/scenes/approvals/ApprovalDetail 16.6 kB
frontend/dist-report/posthog-app/src/scenes/approvals/changeRequestsLogic 918 B
frontend/dist-report/posthog-app/src/scenes/audit-logs/AdvancedActivityLogsScene 42.1 kB
frontend/dist-report/posthog-app/src/scenes/AuthenticatedShell 173 kB
frontend/dist-report/posthog-app/src/scenes/authentication/account/AccountConnected 3.36 kB
frontend/dist-report/posthog-app/src/scenes/authentication/account/AgenticAccountMismatch 2.77 kB
frontend/dist-report/posthog-app/src/scenes/authentication/account/credential-review/CredentialReview 4.02 kB
frontend/dist-report/posthog-app/src/scenes/authentication/cli/CLIAuthorize 11.8 kB
frontend/dist-report/posthog-app/src/scenes/authentication/cli/CLILive 4.41 kB
frontend/dist-report/posthog-app/src/scenes/authentication/email-mfa-verify/EmailMFAVerify 3.42 kB
frontend/dist-report/posthog-app/src/scenes/authentication/invite-signup/InviteSignup 1.31 kB
frontend/dist-report/posthog-app/src/scenes/authentication/login-2fa/Login2FA 5.12 kB
frontend/dist-report/posthog-app/src/scenes/authentication/login/Login 1.34 kB
frontend/dist-report/posthog-app/src/scenes/authentication/password-reset/PasswordReset 4.75 kB
frontend/dist-report/posthog-app/src/scenes/authentication/password-reset/PasswordResetComplete 3.37 kB
frontend/dist-report/posthog-app/src/scenes/authentication/shared/passkeyLogic 858 B
frontend/dist-report/posthog-app/src/scenes/authentication/signup/SignupContainer 1.3 kB
frontend/dist-report/posthog-app/src/scenes/authentication/two-factor-reset/TwoFactorReset 4.41 kB
frontend/dist-report/posthog-app/src/scenes/authentication/vercel/VercelConnect 5.37 kB
frontend/dist-report/posthog-app/src/scenes/authentication/vercel/VercelLinkError 2.64 kB
frontend/dist-report/posthog-app/src/scenes/authentication/verify-email/VerifyEmail 5.16 kB
frontend/dist-report/posthog-app/src/scenes/billing/AuthorizationStatus 1.1 kB
frontend/dist-report/posthog-app/src/scenes/billing/Billing 867 B
frontend/dist-report/posthog-app/src/scenes/billing/BillingSection 21.2 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohort 28.5 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/CohortCalculationHistory 6.61 kB
frontend/dist-report/posthog-app/src/scenes/cohorts/Cohorts 9.81 kB
frontend/dist-report/posthog-app/src/scenes/coupons/Coupons 1.1 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/Dashboard 1.68 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/Dashboards 19.9 kB
frontend/dist-report/posthog-app/src/scenes/dashboard/dashboards/templates/DashboardTemplateCopyScene 6.09 kB
frontend/dist-report/posthog-app/src/scenes/data-management/DataManagementScene 1.02 kB
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionEdit 18.3 kB
frontend/dist-report/posthog-app/src/scenes/data-management/definition/DefinitionView 24.4 kB
frontend/dist-report/posthog-app/src/scenes/data-management/MaterializedColumns/MaterializedColumns 12 kB
frontend/dist-report/posthog-app/src/scenes/data-management/variables/SqlVariableEditScene 7.63 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/batch-exports/BatchExportScene 60.1 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DataPipelinesNewScene 2.76 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/DestinationsScene 3.13 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/event-filtering/EventFilterScene 22.3 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/legacy-plugins/LegacyPluginScene 21 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/TransformationsScene 2.37 kB
frontend/dist-report/posthog-app/src/scenes/data-pipelines/WebScriptsScene 2.99 kB
frontend/dist-report/posthog-app/src/scenes/data-warehouse/DataWarehouseScene 1.75 kB
frontend/dist-report/posthog-app/src/scenes/data-warehouse/editor/EditorScene 1.52 kB
frontend/dist-report/posthog-app/src/scenes/debug/DebugScene 20.3 kB
frontend/dist-report/posthog-app/src/scenes/debug/hog/HogRepl 7.75 kB
frontend/dist-report/posthog-app/src/scenes/experiments/Experiment 211 kB
frontend/dist-report/posthog-app/src/scenes/experiments/Experiments 21.8 kB
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetric 6.45 kB
frontend/dist-report/posthog-app/src/scenes/experiments/SharedMetrics/SharedMetrics 923 B
frontend/dist-report/posthog-app/src/scenes/exports/ExportsScene 4.45 kB
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlag 111 kB
frontend/dist-report/posthog-app/src/scenes/feature-flags/FeatureFlags 1.12 kB
frontend/dist-report/posthog-app/src/scenes/groups/Group 15.4 kB
frontend/dist-report/posthog-app/src/scenes/groups/Groups 4.29 kB
frontend/dist-report/posthog-app/src/scenes/groups/GroupsNew 7.73 kB
frontend/dist-report/posthog-app/src/scenes/health-alerts/HealthAlertsScene 4.17 kB
frontend/dist-report/posthog-app/src/scenes/health/categoryDetail/HealthCategoryDetailScene 7.64 kB
frontend/dist-report/posthog-app/src/scenes/health/HealthScene 11.7 kB
frontend/dist-report/posthog-app/src/scenes/health/pipelineStatus/PipelineStatusScene 11.5 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapNewScene 5.41 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapRecordingScene 4.27 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmap/HeatmapScene 6.91 kB
frontend/dist-report/posthog-app/src/scenes/heatmaps/scenes/heatmaps/HeatmapsScene 4.27 kB
frontend/dist-report/posthog-app/src/scenes/hog-functions/HogFunctionScene 55.3 kB
frontend/dist-report/posthog-app/src/scenes/inbox/InboxScene 63.4 kB
frontend/dist-report/posthog-app/src/scenes/insights/InsightQuickStart/InsightQuickStart 5.81 kB
frontend/dist-report/posthog-app/src/scenes/insights/InsightScene 34.9 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/BoxPlot/BoxPlot 5.43 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/CalendarHeatMap/CalendarHeatMap 4.87 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/RegionMap/RegionMap 29.8 kB
frontend/dist-report/posthog-app/src/scenes/insights/views/WorldMap/WorldMap 5.16 kB
frontend/dist-report/posthog-app/src/scenes/instance/AsyncMigrations/AsyncMigrations 13.5 kB
frontend/dist-report/posthog-app/src/scenes/instance/DeadLetterQueue/DeadLetterQueue 5.77 kB
frontend/dist-report/posthog-app/src/scenes/instance/QueryPerformance/QueryPerformance 9.01 kB
frontend/dist-report/posthog-app/src/scenes/instance/SystemStatus/SystemStatus 17.4 kB
frontend/dist-report/posthog-app/src/scenes/IntegrationsRedirect/IntegrationsRedirect 1.11 kB
frontend/dist-report/posthog-app/src/scenes/marketing-analytics/MarketingAnalyticsScene 42.1 kB
frontend/dist-report/posthog-app/src/scenes/max/Max 1.06 kB
frontend/dist-report/posthog-app/src/scenes/models/ModelsScene 19.1 kB
frontend/dist-report/posthog-app/src/scenes/models/NodeDetailScene 17.1 kB
frontend/dist-report/posthog-app/src/scenes/moveToPostHogCloud/MoveToPostHogCloud 4.84 kB
frontend/dist-report/posthog-app/src/scenes/new-tab/NewTabScene 1.85 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookCanvasScene 3.81 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookPanel/NotebookPanel 5.84 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebookScene 9.16 kB
frontend/dist-report/posthog-app/src/scenes/notebooks/NotebooksScene 8.01 kB
frontend/dist-report/posthog-app/src/scenes/oauth/OAuthAuthorize 1.01 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/coupon/OnboardingCouponRedemption 1.58 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/Onboarding 792 kB
frontend/dist-report/posthog-app/src/scenes/onboarding/sdks/SdkDoctorScene 8.31 kB
frontend/dist-report/posthog-app/src/scenes/organization/ConfirmOrganization/ConfirmOrganization 4.87 kB
frontend/dist-report/posthog-app/src/scenes/organization/Create/Create 1.03 kB
frontend/dist-report/posthog-app/src/scenes/organization/Deactivated 1.51 kB
frontend/dist-report/posthog-app/src/scenes/organization/PendingDeletion 2.48 kB
frontend/dist-report/posthog-app/src/scenes/persons/PersonScene 20.5 kB
frontend/dist-report/posthog-app/src/scenes/persons/PersonsScene 6.12 kB
frontend/dist-report/posthog-app/src/scenes/PreflightCheck/PreflightCheck 5.95 kB
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTour 275 kB
frontend/dist-report/posthog-app/src/scenes/product-tours/ProductTours 5.06 kB
frontend/dist-report/posthog-app/src/scenes/project-homepage/ProjectHomepage 19.1 kB
frontend/dist-report/posthog-app/src/scenes/project/Create/Create 1.21 kB
frontend/dist-report/posthog-app/src/scenes/resource-transfer/ResourceTransfer 9.56 kB
frontend/dist-report/posthog-app/src/scenes/saved-insights/SavedInsights 1.04 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/detail/SessionRecordingDetail 2.14 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/file-playback/SessionRecordingFilePlaybackScene 4.86 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/kiosk/SessionRecordingsKiosk 10.3 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/player/snapshot-processing/DecompressionWorkerManager 329 B
frontend/dist-report/posthog-app/src/scenes/session-recordings/playlist/SessionRecordingsPlaylistScene 5.42 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/SessionRecordings 1.08 kB
frontend/dist-report/posthog-app/src/scenes/session-recordings/settings/SessionRecordingsSettingsScene 2.28 kB
frontend/dist-report/posthog-app/src/scenes/sessions/SessionProfileScene 15.6 kB
frontend/dist-report/posthog-app/src/scenes/settings/SettingsScene 3.94 kB
frontend/dist-report/posthog-app/src/scenes/sites/Site 1.9 kB
frontend/dist-report/posthog-app/src/scenes/startups/StartupProgram 21.6 kB
frontend/dist-report/posthog-app/src/scenes/StripeConfirmInstall/StripeConfirmInstall 3.92 kB
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionScene 14.4 kB
frontend/dist-report/posthog-app/src/scenes/subscriptions/SubscriptionsScene 5.23 kB
frontend/dist-report/posthog-app/src/scenes/surveys/forms/SurveyFormBuilder 1.93 kB
frontend/dist-report/posthog-app/src/scenes/surveys/Survey 1.39 kB
frontend/dist-report/posthog-app/src/scenes/surveys/Surveys 26.8 kB
frontend/dist-report/posthog-app/src/scenes/surveys/wizard/SurveyWizard 72.8 kB
frontend/dist-report/posthog-app/src/scenes/themes/CustomCssScene 3.94 kB
frontend/dist-report/posthog-app/src/scenes/toolbar-launch/ToolbarLaunch 2.86 kB
frontend/dist-report/posthog-app/src/scenes/Unsubscribe/Unsubscribe 2.04 kB
frontend/dist-report/posthog-app/src/scenes/web-analytics/SessionAttributionExplorer/SessionAttributionExplorerScene 7.01 kB
frontend/dist-report/posthog-app/src/scenes/web-analytics/WebAnalyticsScene 14.8 kB
frontend/dist-report/posthog-app/src/scenes/wizard/Wizard 4.83 kB
frontend/dist-report/posthog-app/src/sharedChunkAnchors 1.19 kB
frontend/dist-report/render-query/src/render-query/render-query 27.7 MB
frontend/dist-report/toolbar/src/toolbar/toolbar 16 MB

compressed-size-action

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Migration SQL Changes

Hey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:

posthog/migrations/1213_filesystemfolderinstructions.py

BEGIN;
--
-- Create model FileSystemFolderInstructions
--
CREATE TABLE "posthog_filesystemfolderinstructions" ("id" uuid NOT NULL PRIMARY KEY, "content" text NOT NULL, "version" integer NOT NULL CHECK ("version" >= 0), "is_latest" boolean NOT NULL, "deleted" boolean NOT NULL, "created_at" timestamp with time zone NOT NULL, "updated_at" timestamp with time zone NOT NULL, "created_by_id" integer NULL, "folder_id" uuid NOT NULL, "team_id" integer NOT NULL);
--
-- Create constraint unique_folder_instructions_version on model filesystemfolderinstructions
--
CREATE UNIQUE INDEX "unique_folder_instructions_version" ON "posthog_filesystemfolderinstructions" ("folder_id", "version") WHERE NOT "deleted";
--
-- Create constraint unique_folder_instructions_latest on model filesystemfolderinstructions
--
CREATE UNIQUE INDEX "unique_folder_instructions_latest" ON "posthog_filesystemfolderinstructions" ("folder_id") WHERE (NOT "deleted" AND "is_latest");
ALTER TABLE "posthog_filesystemfolderinstructions" ADD CONSTRAINT "posthog_filesystemfo_created_by_id_49fe4260_fk_posthog_u" FOREIGN KEY ("created_by_id") REFERENCES "posthog_user" ("id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "posthog_filesystemfolderinstructions" ADD CONSTRAINT "posthog_filesystemfo_folder_id_04419ba1_fk_posthog_f" FOREIGN KEY ("folder_id") REFERENCES "posthog_filesystem" ("id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE "posthog_filesystemfolderinstructions" ADD CONSTRAINT "posthog_filesystemfo_team_id_3ce330b8_fk_posthog_t" FOREIGN KEY ("team_id") REFERENCES "posthog_team" ("id") DEFERRABLE INITIALLY DEFERRED;
CREATE INDEX "posthog_filesystemfolderinstructions_created_by_id_49fe4260" ON "posthog_filesystemfolderinstructions" ("created_by_id");
CREATE INDEX "posthog_filesystemfolderinstructions_folder_id_04419ba1" ON "posthog_filesystemfolderinstructions" ("folder_id");
CREATE INDEX "posthog_filesystemfolderinstructions_team_id_3ce330b8" ON "posthog_filesystemfolderinstructions" ("team_id");
COMMIT;

Last updated: 2026-06-06 19:43 UTC (b7aadfa)

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🔍 Migration Risk Analysis

We've analyzed your migrations for potential risks.

Summary: 1 Safe | 0 Needs Review | 0 Blocked

✅ Safe

Brief or no lock, backwards compatible

posthog.1213_filesystemfolderinstructions
  └─ #1 ✅ CreateModel
     Creating new table is safe
     model: FileSystemFolderInstructions
  │
  └──> ℹ️  INFO:
       ℹ️  Skipped operations on newly created tables (empty tables
       don't cause lock contention).

Last updated: 2026-06-06 19:43 UTC (b7aadfa)

raquelmsmith and others added 6 commits June 4, 2026 10:30
Adds per-folder, versioned markdown instructions to the desktop filesystem
surface, modeled on the skills store.

- New FileSystemFolderInstructions model (TeamScopedRootMixin), keyed to the
  FileSystem folder row, with content/version/is_latest/deleted and partial
  unique constraints (one latest + unique version per folder).
- Versioning service (publish/get-latest/list-versions/soft-delete) with
  optimistic-concurrency base_version check and a 100KB size cap.
- instructions + instructions/versions detail actions on
  DesktopFileSystemViewSet only, so the web tree is unaffected.
- API tests covering versioning, size cap, folder guard, cross-team IDOR,
  web-surface isolation, soft delete, and concurrency conflict.

Generated-By: PostHog Code
Task-Id: b4b691b4-2b7c-418e-9ffe-b5c37e1f0a22
Lets agents create desktop channels (folders) and manage their instructions,
and guarantees every channel has an instruction set.

- Auto-create a blank version-1 instruction set when a desktop folder is
  created, backfilling every ancestor folder along the path. Idempotent
  ensure_blank_folder_instructions helper; never clobbers existing content.
- Enable desktop file-system create/list/retrieve and the instructions
  retrieve/update/versions tools in the MCP core.yaml. Instructions content can
  be erased by publishing empty content; the instruction set itself cannot be
  deleted (destroy tool left disabled).
- Update tests for the new versioning baseline (fresh channel = blank v1, first
  edit = v2) and ancestor backfill.

Note: hogli build:openapi + MCP codegen must run in a full dev env to
regenerate the OpenAPI spec, generated tool handlers/schemas, and frontend
types.

Generated-By: PostHog Code
Task-Id: b4b691b4-2b7c-418e-9ffe-b5c37e1f0a22
Address failing CI checks on the desktop folder instructions PR:

- mypy: drop the invalid .unscoped() on FileSystem's plain manager and cast
  folder_id to UUID in the test lookups.
- IDOR coverage: register FileSystemFolderInstructions in the team-scoped
  semgrep IDOR rules.
- MCP unit tests: commit the generated tool-schema snapshots for the newly
  enabled desktop channel/instructions tools and the updated exec-tool catalog.

Generated-By: PostHog Code
Task-Id: b4b691b4-2b7c-418e-9ffe-b5c37e1f0a22
@raquelmsmith raquelmsmith force-pushed the posthog-code/desktop-folder-instructions branch from d7d489a to ba54e55 Compare June 4, 2026 17:35
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright report

⚠️ 2 flaky tests:

  • create experiment via wizard, add metrics, and launch (chromium)
  • Configure step ordering and session aggregation gating (chromium)

These issues are not necessarily caused by your changes.
Annoyed by this comment? Help fix flakies and failures and it'll disappear!

raquelmsmith and others added 2 commits June 5, 2026 16:39
…p-folder-instructions

# Conflicts:
#	posthog/migrations/max_migration.txt
#	services/mcp/tests/unit/__snapshots__/exec-tool.json
DRF's @instructions.mapping.{put,patch,delete} resolve view.action to
publish_instructions / delete_instructions, which weren't in the default
read/write action lists, so APIScopePermission returned None and rejected
PAK auth with "This action does not support personal API key access".

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@raquelmsmith raquelmsmith requested a review from adamleithp June 6, 2026 00:26
@raquelmsmith raquelmsmith marked this pull request as ready for review June 6, 2026 00:26
raquelmsmith added a commit to PostHog/code that referenced this pull request Jun 6, 2026
Wires the desktop folder-instructions endpoints from PostHog/posthog#61494
into a per-folder CONTEXT.md leaf in the channels sidebar. Clicking opens
a deep-linkable route with rendered/edit toggle, save publishes a new
version with optimistic concurrency, and a version dropdown surfaces
history. Refetches on every mount so the view reflects edits made by
other users or agents.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
posthog/api/file_system/file_system.py:1044-1053
**Response shape mismatch between implementation and generated client**

`instructions_versions` returns a raw list, but the generated TypeScript client (`desktopFileSystemInstructionsVersionsList`) declares `Promise<PaginatedFolderInstructionsVersionListApi>` — which wraps results in `{ count, next, previous, results: [] }`. Any desktop client using the generated types will attempt to access `.results` on a flat array and get `undefined`.

drf-spectacular infers a paginated schema here because `DesktopFileSystemViewSet` inherits `pagination_class = FileSystemsLimitOffsetPagination`, and the `@extend_schema(responses={200: FolderInstructionsVersionSerializer(many=True)})` decorator is not sufficient to suppress that wrapping. The fix is either:
1. Actually paginate — replace the manual `Response(...)` with `self.paginate_queryset(versions)` / `self.get_paginated_response(...)` (matches the `limit`/`offset` params already present in `DesktopFileSystemInstructionsVersionsListParams`), or
2. Suppress the wrapper — add `paginator=None` inside `@extend_schema` to prevent drf-spectacular from wrapping the response.

The test at line 104 (`[v["version"] for v in versions]`) also silently validates the flat-array shape and will need updating if pagination is added.

Reviews (1): Last reviewed commit: "chore(file-system): format rebased migra..." | Re-trigger Greptile

Comment on lines +1044 to +1053
@extend_schema(responses={200: FolderInstructionsVersionSerializer(many=True)})
@action(methods=["GET"], detail=True, url_path="instructions/versions")
def instructions_versions(self, request: Request, *args: Any, **kwargs: Any) -> Response:
"""List the version history for this folder's instructions, newest first."""
folder = self._get_folder_or_400()
if isinstance(folder, Response):
return folder

versions = get_folder_instructions_versions(folder)
return Response(FolderInstructionsVersionSerializer(versions, many=True).data)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Response shape mismatch between implementation and generated client

instructions_versions returns a raw list, but the generated TypeScript client (desktopFileSystemInstructionsVersionsList) declares Promise<PaginatedFolderInstructionsVersionListApi> — which wraps results in { count, next, previous, results: [] }. Any desktop client using the generated types will attempt to access .results on a flat array and get undefined.

drf-spectacular infers a paginated schema here because DesktopFileSystemViewSet inherits pagination_class = FileSystemsLimitOffsetPagination, and the @extend_schema(responses={200: FolderInstructionsVersionSerializer(many=True)}) decorator is not sufficient to suppress that wrapping. The fix is either:

  1. Actually paginate — replace the manual Response(...) with self.paginate_queryset(versions) / self.get_paginated_response(...) (matches the limit/offset params already present in DesktopFileSystemInstructionsVersionsListParams), or
  2. Suppress the wrapper — add paginator=None inside @extend_schema to prevent drf-spectacular from wrapping the response.

The test at line 104 ([v["version"] for v in versions]) also silently validates the flat-array shape and will need updating if pagination is added.

Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/api/file_system/file_system.py
Line: 1044-1053

Comment:
**Response shape mismatch between implementation and generated client**

`instructions_versions` returns a raw list, but the generated TypeScript client (`desktopFileSystemInstructionsVersionsList`) declares `Promise<PaginatedFolderInstructionsVersionListApi>` — which wraps results in `{ count, next, previous, results: [] }`. Any desktop client using the generated types will attempt to access `.results` on a flat array and get `undefined`.

drf-spectacular infers a paginated schema here because `DesktopFileSystemViewSet` inherits `pagination_class = FileSystemsLimitOffsetPagination`, and the `@extend_schema(responses={200: FolderInstructionsVersionSerializer(many=True)})` decorator is not sufficient to suppress that wrapping. The fix is either:
1. Actually paginate — replace the manual `Response(...)` with `self.paginate_queryset(versions)` / `self.get_paginated_response(...)` (matches the `limit`/`offset` params already present in `DesktopFileSystemInstructionsVersionsListParams`), or
2. Suppress the wrapper — add `paginator=None` inside `@extend_schema` to prevent drf-spectacular from wrapping the response.

The test at line 104 (`[v["version"] for v in versions]`) also silently validates the flat-array shape and will need updating if pagination is added.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 57aef59. Switched instructions_versions to use self.paginate_queryset / self.get_paginated_response so the runtime shape matches the generated PaginatedFolderInstructionsVersionListApi contract, and updated the test to read response.json()["results"]. Pagination matches the limit/offset params already declared on DesktopFileSystemInstructionsVersionsListParams. Will need hogli build:openapi rerun before merge to confirm no schema drift.

@tests-posthog

tests-posthog Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

⏭️ Skipped snapshot commit because branch advanced to 0c76fd0 while workflow was testing fecfb81.

The new commit will trigger its own snapshot update workflow.

If you expected this workflow to succeed: This can happen due to concurrent commits. To get a fresh workflow run, either:

  • Merge master into your branch, or
  • Push an empty commit: git commit --allow-empty -m 'trigger CI' && git push

@tests-posthog

tests-posthog Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Query snapshots: Backend query snapshots updated

Changes: 1 snapshots (1 modified, 0 added, 0 deleted)

What this means:

  • Query snapshots have been automatically updated to match current output
  • These changes reflect modifications to database queries or schema

Next steps:

  • Review the query changes to ensure they're intentional
  • If unexpected, investigate what caused the query to change

Review snapshot changes →

raquelmsmith and others added 3 commits June 6, 2026 06:29
Use APIClient.credentials() instead of unpacking **headers, which mypy
flagged against the strict get/patch signatures.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
DesktopFileSystemViewSet inherits FileSystemsLimitOffsetPagination, so
drf-spectacular generates a paginated response schema for the versions
endpoint. Returning a flat list broke the generated TS client's
{count,next,previous,results} contract.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…p-folder-instructions

# Conflicts:
#	posthog/migrations/max_migration.txt
Comment on lines +62 to +72
if current_latest is None:
if base_version is not None and base_version != 0:
raise FolderInstructionsVersionConflictError(current_version=0)
return FileSystemFolderInstructions.objects.create(
team=folder.team,
folder=folder,
content=content,
version=1,
is_latest=True,
created_by=user,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race condition when creating the first version. If two requests simultaneously try to publish the first version for a folder, both will find current_latest=None (since select_for_update() has nothing to lock), and both will attempt to create version 1. One will succeed and the other will raise an unhandled IntegrityError due to the unique_folder_instructions_version constraint.

Fix: Wrap the create in a try-except to handle the IntegrityError:

if current_latest is None:
    if base_version is not None and base_version != 0:
        raise FolderInstructionsVersionConflictError(current_version=0)
    try:
        return FileSystemFolderInstructions.objects.create(
            team=folder.team,
            folder=folder,
            content=content,
            version=1,
            is_latest=True,
            created_by=user,
        )
    except IntegrityError:
        # Concurrent create won; retry to find the latest version
        current_latest = (
            FileSystemFolderInstructions.objects.select_for_update()
            .filter(folder=folder, deleted=False, is_latest=True)
            .order_by("-version", "-created_at", "-id")
            .first()
        )
        # Continue to the version increment logic below
Suggested change
if current_latest is None:
if base_version is not None and base_version != 0:
raise FolderInstructionsVersionConflictError(current_version=0)
return FileSystemFolderInstructions.objects.create(
team=folder.team,
folder=folder,
content=content,
version=1,
is_latest=True,
created_by=user,
)
if current_latest is None:
if base_version is not None and base_version != 0:
raise FolderInstructionsVersionConflictError(current_version=0)
try:
return FileSystemFolderInstructions.objects.create(
team=folder.team,
folder=folder,
content=content,
version=1,
is_latest=True,
created_by=user,
)
except IntegrityError:
# Concurrent create won; retry to find the latest version
current_latest = (
FileSystemFolderInstructions.objects.select_for_update()
.filter(folder=folder, deleted=False, is_latest=True)
.order_by("-version", "-created_at", "-id")
.first()
)
# Continue to the version increment logic below

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@raquelmsmith raquelmsmith enabled auto-merge (squash) June 6, 2026 20:45
@raquelmsmith raquelmsmith merged commit db2fbbe into master Jun 6, 2026
294 of 298 checks passed
@raquelmsmith raquelmsmith deleted the posthog-code/desktop-folder-instructions branch June 6, 2026 20:55
@deployment-status-posthog

deployment-status-posthog Bot commented Jun 6, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-06-06 22:23 UTC Run
prod-us ✅ Deployed 2026-06-06 22:36 UTC Run
prod-eu ✅ Deployed 2026-06-06 22:40 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants