:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(tasks): bake ffmpeg and the CI lint tools into the dev-stack image (#122150)
Alessandro Pogliaghi598ae0eb6f46
diff --git a/docs/published/handbook/engineering/ai/sandboxed-agents.md b/docs/published/handbook/engineering/ai/sandboxed-agents.mdindex eaf9c466319d..e4cb38d79f06 100644--- a/docs/published/handbook/engineering/ai/sandboxed-agents.md+++ b/docs/published/handbook/engineering/ai/sandboxed-agents.md@@ -504,7 +504,9 @@ that landed since the last bake. The snapshot clones the migrated Postgres datab`test_posthog`, so pytest's default `--reuse-db` path also applies only newer migrations.The pnpm store and Playwright's Chromium are prewarmed too:`pnpm install --frozen-lockfile --prefer-offline` is a fast linking pass and browser installs-are no-ops. Build outputs (node_modules, Storybook dist, Vite/Turbo caches) are deliberately+are no-ops. The image also has `ffmpeg`, because the lean VM base ships no codec tooling,+and the CI-pinned `semgrep`, `actionlint` and `shellcheck`, so agents can run the repo's lint gates before they push.+Build outputs (node_modules, Storybook dist, Vite/Turbo caches) are deliberatelynot baked — the bake's checkout is deleted before the snapshot — so frontend builds always runfrom the task's own source. The bake must run on the real VM runtime —dockerd cannot run inside Modal's gVisor image builder — which is why it is a sandbox filesystemdiff --git a/products/tasks/backend/sandbox/images/bake-posthog-dev-stack.sh b/products/tasks/backend/sandbox/images/bake-posthog-dev-stack.shindex 2e701e4cf4f3..937555ba8b04 100644--- a/products/tasks/backend/sandbox/images/bake-posthog-dev-stack.sh+++ b/products/tasks/backend/sandbox/images/bake-posthog-dev-stack.sh@@ -62,6 +62,8 @@ PROTOC_VERSION=28.3PROTOC_SHA256_AMD64=0ad949f04a6a174da83cdcbdb36dee0a4925272a5b6d83f79a6bf9852076d53fPROTOC_SHA256_ARM64=1de522032a8b194002fe35cab86d747848238b5e4de4f99648372079f5b46f9aSQLX_CLI_VERSION=0.8.3+ACTIONLINT_VERSION=1.7.12+SEMGREP_VERSION=1.175.0export RUSTUP_HOME=/opt/rust/rustupexport CARGO_HOME=/opt/rust/cargo@@ -107,6 +109,7 @@ log "installing dev toolchain (brotli, phrocs, go, rust)"# need their toolchains.apt-get updateapt-get install -y --no-install-recommends brotli make unzip build-essential libssl-dev pkg-config cmake libclang-dev+apt-get install -y --no-install-recommends ffmpeg shellcheckrm -rf /var/lib/apt/lists/*case "$(uname -m)" in@@ -137,6 +140,19 @@ tar -xzf /tmp/go.tar.gz -C /usr/localrm /tmp/go.tar.gzln -sf /usr/local/go/bin/go /usr/local/go/bin/gofmt /usr/local/bin/+log "installing actionlint ${ACTIONLINT_VERSION} and semgrep ${SEMGREP_VERSION} (same pins as CI)"+GOBIN=/usr/local/bin go install "github.com/rhysd/actionlint/cmd/actionlint@v${ACTIONLINT_VERSION}"+actionlint -version+UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/opt/uv-tools/bin uv tool install "semgrep==${SEMGREP_VERSION}"+printf '%s\n' \+ '#!/bin/sh' \+ 'for name in HTTP_PROXY HTTPS_PROXY ALL_PROXY http_proxy https_proxy all_proxy SSL_CERT_FILE SSL_CERT_DIR; do' \+ ' eval "[ -n \"\${$name:-}\" ] || unset $name"' \+ 'done' \+ 'exec /opt/uv-tools/bin/semgrep "$@"' > /usr/local/bin/semgrep+chmod +x /usr/local/bin/semgrep+semgrep --version+# phrocs is built from this checkout rather than downloaded via tools/phrocs/install.sh:# the phrocs-latest release that installer trusts is mutable and ships checksums.txt# next to its binaries, so verifying one against the other proves nothing an attacker