Skip to content

Sync upstream 2026-11-13 (753 commits) - #25

Merged
hjescalona merged 1157 commits into
smgfrom
sync/upstream-20261113-1934
Nov 13, 2026
Merged

hjescalona merged 1157 commits into
smgfrom
sync/upstream-20261113-1934

Conversation

@hjescalona

Copy link
Copy Markdown

Merges 753 upstream commits from CapSoftware/Cap:main into smg.

Database migrations

This sync adds migrations. They run when Cap Web starts, and rolling back the image does not roll back the schema, so it does not auto-merge.

  • packages/database/migrations/0056_developer_billing_read_indexes.sql
  • packages/database/migrations/0057_developer_transcript_video.sql
  • packages/database/migrations/0058_developer_webhook_endpoints.sql
  • packages/database/migrations/0059_developer_video_first_month.sql
  • packages/database/migrations/0060_developer_video_imports.sql
  • packages/database/migrations/0061_developer_delivery_metering.sql
  • packages/database/migrations/meta/0056_snapshot.json
  • packages/database/migrations/meta/0057_snapshot.json
  • packages/database/migrations/meta/0058_snapshot.json
  • packages/database/migrations/meta/0059_snapshot.json
  • packages/database/migrations/meta/0060_snapshot.json
  • packages/database/migrations/meta/0061_snapshot.json
  • packages/database/migrations/meta/_journal.json

Read the migrations. Take a MySQL backup before merging, then merge by hand.

Upstream commits

  • 26d0572 feat(home): hero notice links to Introducing Cap Infra
  • c520551 feat(blog): pin Introducing Cap Infra on /blog
  • 577be3f feat(infra): /infra/llms.txt, /infra/llms-full.txt and Markdown discovery (feat(infra): /infra/llms.txt, /infra/llms-full.txt and Markdown discovery CapSoftware/Cap#4233)
  • 5d1519b style(infra): solid grey Back to Cap bar
  • d5b514c chore(infra): tidy header comment
  • d31755f feat(infra): Back to Cap bar above the Infra header
  • 55c6fcd fix(infra): full Back to Cap label on phones
  • 5470ce8 feat(infra): Back to Cap link in the Infra header on every screen size
  • 51767f8 fix(web): one delivery row in the Cap Infra post price card
  • 8865834 fix(player): keep the play button off the seek bar on short phone embeds
  • c53f650 copy(infra): speed figures match the launch film
  • e945677 feat(infra): link back to cap.so from the Infra header
  • 7044b32 fix(web): a failed delivery read gives delivery null in GET /usage, not a 500
  • 03773a6 test(web): GET /usage answers when the delivery read fails
  • 4001d57 chore(web): declare esbuild for the developer API cold path test
  • 01872bf fix(web): keep the keyboard on the player when k replays from the Replay button
  • 5d690ff chore(infra-mcp): count docs_read in the stdio tools and the 0.2.0 changelog
  • 920c7eb docs(infra-mcp): describe videoId transcripts in the 0.2.0 changelog
  • 9030de3 fix(infra-mcp): local transcripts of a stored video send its videoId
  • 3ef0b4a fix(infra-mcp): say each part listed in parts in the hosted upload steps
  • 9424e60 docs(infra-mcp): note credit links, durationSeconds and userId in the 0.2.0 changelog
  • 94c7e62 docs(infra-mcp): list videos_import and ship a changelog
  • 569e6e7 chore(infra-mcp): version 0.2.0
  • 573ffd2 feat(infra-mcp): serve videos_import from the npm package too
  • d20b20c test(web): keep sign-in and email code out of the developer API startup graph
  • 046ff76 perf(web): load sign-in and email code only when a request needs it
  • 1d1c098 fix(infra-mcp): report a cancelled docs_read as cancelled
  • 472a030 test(media-server): run the audio-only source test in the encoder image build
  • 3ec0f1f fix(media-server): read audio-only sources on the audio routes
  • cd59f74 fix(media-server): answer 422 for a source with no video stream on the audio routes
  • c036dcb fix(infra-mcp): a cancelled call stops waiting for a shared credit lookup
  • 6bf475a fix(web): bill delivery in delivered minutes in the Cap Infra post
  • 0cd6f6a perf(infra): find the latest delivery day without sorting every row the account has
  • 8fe359d test(web): keep the parallel read test at the end of its file
  • a5752b6 test(web): pin an upload create at 7 statements, 5 in a row
  • 2e1ea56 perf(web): read the latest first month and storage day charges at once
  • 4b3c320 fix(infra-mcp): time docs fetches without AbortSignal.any and keep body failures as docs_unavailable
  • cc19463 Docs: name the FFmpeg releases that stop after one HLS segment
  • 087fb27 fix(web): step up at the next segment without a flush when there is no connection hint
  • 603d603 feat(infra-mcp): read the docs from the MCP with docs_read
  • 9e8f3a1 test(infra): pass the test database to shortfallOwed as an executor
  • 8ae7ffe feat(web): Introducing Cap Infra blog post
  • b15ff68 refactor(web): reusable Cap Infra night shell
  • 20e802f refactor(web): share blog post metadata between post routes
  • 91d35a8 fix(infra): let only a delivery day charged with no shortfall open carry the standing
  • 527f086 fix(web): switch a sharper pick at once only on a fast line, and name the rendition on screen until it lands
  • 2cf5fdb fix(web): type the optional frame callback in the player source
  • a9d7b28 fix(web): no oEmbed iframe for a video limited to its owner's sites
  • 766e628 test(web): delivery fixtures match the migrated table
  • 350cf83 docs: delivered minutes definition and finality in the agreed words
  • 960dc04 refactor(web): read delivery through the shared developerDeliveryDaily schema
  • 7bd533f fix(infra): never let an unpaid delivery day lower what an open shortfall needs to recover
  • 88c2d96 test(web): delivery finality, audio tier and a missing final column against a real database
  • eb2da84 docs: say how delivered minutes are measured, with no billing claim
  • 95b0c85 feat(web): GET /usage delivery reports minutes, tiers and finalThrough
  • 7bbda8d fix(web): tell a failed delivery read apart from no delivery on Usage
  • 2177c5f feat(web): leave out the audio tier, report the last final day and wait for the final column
  • c1688dd test(web): delivered minutes against a real database, console and API in step
  • fe9b702 docs: delivered minutes in Get Usage are measured, not billed
  • 5faeca4 feat(web): report delivered minutes in GET /usage, measured and not billed
  • c087790 feat(web): show delivered minutes on the Infra Usage page
  • f567438 feat(web): read delivered minutes per tier for an Infra app
  • f7ec049 test(infra): create the delivery rollup table if missing with the metering migration's DDL
  • 2e7ae84 fix(infra): always show the delivery start date beside the console price
  • 8b97be0 feat(infra): state the delivery start date on the pricing page and read it from the env in the console
  • f008dd3 test(infra): charge the final total once when a recompute lowers a day or drops an app
  • 329d3d5 fix(infra): finalize a delivery day from the recorded file versions in one transaction
  • 06b5bf2 feat(infra): return the delivery rate in GET /usage rates
  • 09540ad fix(infra): settle delivery days that go final up to seven days late, with one row per day
  • a5b37b1 fix(infra): order delivery days posted in the same second by their day
  • b8f7e32 fix(web): without a connection hint, step up only once the first frame is on screen
  • 763b210 fix(infra-mcp): keep the credit lookup inside the call budget
  • 610d247 docs(infra): add the delivered minutes summary to the definition
  • 15bea80 fix(infra): label a delivery row Delivery like a storage row, with the day in its reference
  • c6e3671 fix(infra): report an invalid delivery start day once, not on every standing read
  • 8b0b210 Infra: the URL import 402 links the app's Billing page too
  • 4933ce0 feat(infra): price delivery at one flat rate on the landing page, docs and console
  • 09e3c7f feat(infra): keep delivery billing inert until CAP_INFRA_DELIVERY_BILLING_FROM is set
  • 9d2c172 Infra console: plain upload errors and true upload copy
  • 8d46928 Infra: credit links open the app that needs credit
  • 8c47709 fix(infra): finalize a delivery day only when its log files are all read, label HLS-less MP4s, use the HttpApi cron pattern
  • bbf1058 fix(web): keep invalid share dates empty and test the shared clock
  • 0184508 test(web): clear the first month start after each billing and round trip database test
  • 19bf9da fix(web): let ShareNowProvider take children positionally
  • 67b8d99 fix(web): start low without a connection hint and switch at once to a sharper manual pick
  • 2ec03fa test(web): a recent start is read again, and a cached start hands out copies
  • e92acd5 fix(web): keep the first month start only once it is older than any open transaction
  • a1c752c feat(infra): record abandoned transfer bytes and renumber the migration after 0060
  • 1e4842f Docs: captions in the HLS master, and the FFmpeg 9 byte-range limit
  • fbfe0a6 Drop a comment that restates the subtitle playlist code
  • 7d2826a feat(infra): estimate segment seconds from the video row when the playlist is gone
  • 9d70a8b test(infra): load the auto top-up mock before the delivery sweep imports it
  • 390acf0 perf(web): remember when first month charging began once it is known
  • 24972aa feat(infra): meter delivered seconds per app from CDN logs
  • 6f11e3e style: format the hosted MCP test
  • f7a05be fix(web): no hydration mismatch from comment times on share pages
  • 9674dff fix(infra): read the latest storage and delivery days together, and list delivery_daily in the agent API
  • 9625583 test(web): same second credits never cover a shortfall, across 500 seeded sequences
  • 4039770 test(web): available credit on top-ups and the Pro credit, and the Pro claim locks before it reads
  • 611534f fix(web): cover a shortfall only with a credit from a later second that leaves enough available
  • 587bec7 fix(web): record the credit available after each top-up and Pro credit, read under the account lock
  • 586ddea feat(infra): charge delivered minutes daily behind CAP_INFRA_DELIVERY_BILLING_FROM
  • a3fd18d fix: lock rotate and delete while a webhook add is in flight
  • eba7cb1 ci: run the Infra database job when developer actions or Infra dashboard data change
  • 4e13874 Leave Vary off compressed rendition playlists
  • 2121310 ci: run the Infra database job only on Infra billing, schema and migration changes
  • 6fc0923 test(web): an upload fee row on a settled video does not move the first month start
  • cb21754 fix(web): count only rows written by a first month charge toward the start
  • 3313ad3 revert(web): move the shortfall recovery changes to a follow-up PR
  • b802afd ci: run the Infra database suites against MySQL
  • c78ea79 test(web): size the measured-race allowance to the first-month reservation
  • 162324d fix(infra): reclaim a stale import reservation, replay a keyed import without a credit check
  • c08f539 fix(infra): count every import attempt, fail both rows together, abort parts after a failed completion
  • ff77bf2 docs: link the published local MCP package from /infra as Markdown
  • f1782c3 fix: never replace a shown webhook secret with another
  • e3e213b fix: console webhook actions spend the REST account budget
  • a2fe257 fix(infra): check the balance as an undeclared import grows, keep signed source queries out of MCP results
  • 1de994a test(web): type the HttpApi handler stub in the oEmbed test
  • bb620f4 fix(web): oEmbed iframe allows autoplay, route uses HttpApi, drop narrating comments
  • 8a0afcd test(web): fakes answer the first month start and held credit reads
  • fd6bc41 fix(web): build the available credit expression when a restore is checked
  • fe14259 style(infra-mcp): format the npm package script
  • ff04ba0 fix: hide a shown secret when its endpoint is deleted
  • 307caea feat: videos also report their length as durationSeconds
  • ea26563 fix: list a video caption track only once its WebVTT file is written
  • ed9677f test: type the tool description read in the hosted MCP test
  • 54c02d6 feat: discovery for the Cap Infra MCP server and /infra as Markdown
  • 87f38cc docs: list the 405 method_not_allowed response in the OpenAPI document
  • f11ee6a feat: usage reports the monthly cost of every stored video
  • 6e133b9 docs: say the shortest wait timeout that checks more than once
  • a437f35 fix: videos_create_upload returns up to 10 part links per result
  • 09e42ab fix: keyed video ids use the same alphabet and length as other video ids
  • 315516f fix: transcripts from a video inherit the video's userId
  • 1102ff7 docs(api): point agents at the local MCP server for uploads from disk
  • 5e2b3da docs(infra-mcp): install with npx and say how to publish
  • 81af7fc build(infra-mcp): write the npm package as @cap.so/infra-mcp
  • 3bbbad3 fix(web): narrow the measured size in the oEmbed route
  • 7ebae89 improve: tighten Webhooks page layout
  • 55129d5 test(media-server): run the Infra poster test in both image builds
  • 923343c fix(media-server): Cap Infra posters up to 1920 on the long side
  • d0f0989 test(web): pin the first month start and the restore rules on a real database, across 500 seeded sequences
  • a3961e8 test(web): top-ups and Pro credit record available credit, and fakes read the new restore queries
  • 28fc84f fix(web): restore a shortfall only from a top-up after the charge that covers it with available credit
  • 65070fa fix(web): start first month charging at the first real first month charge
  • b48b78c Compress Infra rendition playlists at the edge and purge cached playback on delete
  • 07564d0 Add Cap Infra to the site navigation
  • dbb645b docs(infra): document importing a video from a URL
  • b3be34a feat(infra-mcp): videos_import on the hosted MCP
  • f5cedaa docs(infra): describe importDeveloperVideo in the OpenAPI document
  • ea0a650 feat(infra): show the import on Get Video and Get Video Status
  • 4961fb1 docs: say why the embed snippet keeps allow autoplay
  • bbec29b fix(web): read Auto on the quality control before the first play
  • 5cb6aad fix(web): keep event times through a native HLS quality switch and a start time
  • 93788a8 fix(web): remove allowed sites through the shared Effect runtime
  • 9a1f783 fix(web): restrict every address that serves the embed
  • df3e4b8 feat: Webhooks page in the Infra console
  • 90df2ad feat: console server actions for webhook endpoints
  • c8c7d66 refactor: share webhook endpoint input schemas
  • 38e7b6d test(web): send comment media test uploads as a Blob body
  • c5c1ec3 test(infra): cover URL import guards, limits and the download step
  • c0ef28e feat(infra): POST /api/developer/v1/videos imports from a URL
  • 3344b25 feat(infra): import a video from a public https URL
  • 8e2af4f test(web): type the share page retry helper for both routes
  • 36edd70 perf(web): keep each embed's allowed sites for a minute per instance
  • 4d57024 List Infra captions as HLS subtitles in the master playlist
  • 842c93c test(web): prove processing retries against a real database
  • 6b0ee06 docs: say the allowed sites list controls who can embed the player
  • 29d0a92 feat(web): bring back the allowed sites list in Cap Infra settings
  • fce00e5 fix(web): accept only https sites, or localhost, as allowed embed sites
  • 35549f4 feat(web): limit Infra embeds to the app's allowed sites
  • 8c597ad feat(web): unfurl hosted video share links with og:video and oEmbed
  • 4f77d70 feat(infra): add developer_video_imports table
  • e826f82 feat(web): show a replay button when the hosted player reaches the end
  • 29ebd83 fix(web): give the hosted player's failed state a heading and a line
  • 1c7fab5 feat(web): read embed start times like 1m30s and 1h2m3s
  • 2aa6a0c test(web): prove the comment media quota against a real database and bucket
  • 8e856b1 chore(media-server): keep only comments that explain the codec lists
  • c483e16 fix(media-server): do not give the server the root group for open GPU devices
  • dd6d2c7 test(web): expect Infra billing actions and the mobile tab to be open to every account
  • 8a77146 fix(web): make the ledger Type label wrap over the table cell's nowrap
  • bef2113 test(web): ledger Type and Reference cell classes at narrow widths
  • 0f1aa67 fix(web): keep the Infra ledger readable when the table is narrow
  • c184892 fix: scroll an overflowing menu sheet from the top and place it again on resize
  • e09062b fix: size the phone menu sheet inside the player
  • cfe4cf8 test: expect the embed report link to hide while a menu is open
  • 7847235 fix: clamp out of range embed quality and radius as documented
  • 6ae7565 fix: send the embed error event for a deleted or unknown video
  • 3dcfed4 fix: keep embed shortcuts after a mouse play and show phone menus as a sheet
  • 864989d test(media-server): run the older-format tests in both image builds
  • e6ceb01 fix(media-server): accept older video and audio codecs in imports again
  • 5dd6ca7 fix(web): keep a long ledger reference to one truncated line
  • 58404ca fix(web): one way to add a US EIN on the top-up form, and it names the invoice
  • 6669a20 docs: cap the webhook receiver example's body at 1 MB
  • 43a2d2f fix(web): only quote a string in the unknown event message
  • dcf5939 fix(web): keep polling when a due video.ready fails to send
  • e31a924 test(web): type the EIN hint test's top-up props
  • 5ad8043 test(web): allow the agreed EIN sentence in the billing docs
  • 7b50721 fix: clear an earlier purge mark when the staff purge fails
  • 54277c1 docs: webhook receiver, ready timing, playlist start and embed options
  • 271dce5 fix(web): plain webhook event errors and webhook docs links
  • …and 553 more

Richie McIlroy and others added 30 commits November 13, 2026 08:33
The router matches the dev and embed segments case-insensitively and
decodes the playback id, so /Dev/%70.../Embed rendered the same player
without the policy. The embed is now found from the decoded id with the
static segments compared case-insensitively. Paths that are not an embed
still take main's exact branch.
…a-quota-atomic

fix(web): enforce the comment media quota atomically
# Conflicts:
#	apps/web/lib/rate-limit.ts
An imported video stays uploading while its file downloads. The import
state on the single-video reads tells a poller it is still on its way,
and a repeated keyed import returns the video once the file is
recorded.
videos_wait keeps waiting while an imported file downloads. The stdio
package gets the tool with its next release, since its README lists the
tools.
Adds an Infra link after Agents in the desktop header and the phone menu, with a test for order and styles.
…-allowed-domains

feat(web): limit Infra embeds to the app's allowed sites
…ack on delete

Rendition playlists sign a URL per segment and run to tens of KB. They are
now sent as text/plain with Vary: Accept-Encoding, which the platform
compresses (31 KB to about 1.2 KB with brotli for a 2.5 minute video). The
body is unchanged and nothing is compressed in the handler. The master and
subtitle playlists keep the HLS type.

Every cacheable playback answer is tagged with its video and app, and a
customer delete, console delete, app delete, staff delete, takedown or
restore deletes those tags from the CDN cache, so a removed video stops
answering on the next request instead of up to a minute later. s-maxage is
unchanged.
…etry-limit

fix(web): rate limit transcription and AI generation retries
richiemcilroy and others added 24 commits November 13, 2026 12:50
…delivery-read

fix(web): GET /usage answers with delivery null when the delivery read fails
…old-path

perf(web): load sign-in and email code only when a developer API request needs it
The landing price rows now include delivery, so the post adds only its speech row and reads the delivery price from lib/infra-pricing.
…elivery-constant

Cap Infra post: one delivery row in the price card
…very (CapSoftware#4233)

* feat(infra): serve /infra/llms.txt and /infra/llms-full.txt

* feat(infra): declare the Markdown alternate on /infra

* fix(docs): redirect /docs/api to Get Started and trace the Infra llms docs

* docs(infra): point llms.txt at the Infra index, webhooks and local MCP

* test(infra): cover the Infra llms.txt routes
…ra-post

feat(web): pin Introducing Cap Infra on the landing page and /blog
…harge-concurrency

test(web): fix the Infra measured-race test allowance and run Infra database suites in CI
Upstream's CI now runs the whole apps/web/__tests__/unit folder in a new
'Test web' step instead of listing files under 'Test web React
compatibility'. Find the step by the command it runs and pass folders
through to vitest as well as files.
@hjescalona hjescalona added the migrations-approved A human reviewed the migrations and took a MySQL backup label Nov 13, 2026
@hjescalona
hjescalona merged commit 80f2622 into smg Nov 13, 2026
6 checks passed
@hjescalona
hjescalona deleted the sync/upstream-20261113-1934 branch November 13, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has-migrations migrations-approved A human reviewed the migrations and took a MySQL backup upstream-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants