Skip to content

Large suites: manifest and group hashes, charged per group (sc-8868, part 1) - #46

Merged
ndbroadbent merged 4 commits into
mainfrom
group-hashes
Dec 2, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
group-hashes

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

sc-8868, part 1 of 2: manifest and group hashes for large suites, charged per group checked (Nathan: "1 credit per group hash checked").

How it works:

  • A run of 500 or more snapshots (VISUALCI_GROUPS overrides) first sends POST /api/v1/builds/:id/groups: a hash of the whole run and one per group of names. A name's group is its path without the last two segments, or its first group_depth segments (a new visualci.yml field).
  • Hashes come from visualci_core::manifest over (name, platform, kind, fingerprint, threshold, anti-aliasing, engine, format, ignore rules). The CLI builds its entries from the same registration it sends (client::registration, entry_of), normalized as the server stores them.
  • The server computes the baseline's hashes from its own rows (baselines::resolve), never from a client's claim. A claimed hash with no matching baseline rows is a changed group.
  • It records build_groups and answers which groups differ. The CLI sends only those groups' files.
  • Processing carries the matched groups' snapshots forward from their baselines, as a subset build's are (carried_forward, not charged per snapshot). A whole-run match (builds.manifest_same_as_build_id) carries everything. Every reader sees a complete build, so baselines, review, the gallery and PR comments are unchanged. A name missing from a changed group is still "removed".
  • Billing: CREDITS_PER_GROUP_CHECK = 1 per matched group, 1 for a matched run, and changed groups' snapshots as usual (Usage.groups_checked, "N groups checked" in the ledger).
  • Shards: a group can be sent by one shard only; a second is refused with a clear message.
  • The UI and get_build: "N groups unchanged: M snapshots in them are the same as #X", or "Nothing changed: …" on a match, with the groups listed on demand. get_build has the same groups object.
  • Migration 000042 adds build_groups, builds.group_depth and builds.manifest_same_as_build_id. CLI 0.2.15.
  • Docs:
    • credits: the new row and a "Large suites" section with a worked example;
    • llms.txt's header, the landing page's pricing, and the five comparison pages' 35k example ("at most 55,000 … less when runs of 500 or more are checked by group");
    • the config and CLI references, and the design doc.

Tests (with MinIO, on docspring-dev):

  • an identical run carries the whole build forward for 1 credit, and a later build anchors on it;
  • one changed group: only it is sent, 2 groups and 2 snapshots charged, and the summary counts;
  • a missing file in a changed group is removed;
  • forged hashes (an unknown group, a made-up hash) are changed;
  • a group can't span shards, and the refused shard can resend;
  • unit tests for grouping and hashing.

On the dev server (visualci/demo, 600 screenshots in 30 groups, through the CLI):

Build What happened Credits
#7 (baseline) sent all 600 600
#8 (identical) "all the same as build #7: nothing to send" 1
#9 (one page changed) 29 groups unchanged, 20 snapshots registered, 1 uploaded, 1 image diff 59, instead of 610

Images load from outside; both pages fit at 1440 and 390.

Next (part 2):

  • unchanged groups stop writing rows at all: an effective_snapshots view, build_groups.source_build_id (one hop), and a nightly check for builds or groups that resolve to no rows;
  • bundle uploads (tar.zst through visualci-core::bundle);
  • the pdf_engine proof.

Review: the landing page's pricing text changes (one sentence), and so do the comparison pages and llms.txt text; the build page has a new notice only on grouped builds, which aren't captured.

…ore::manifest), POST /builds/:id/groups compares them with the baseline's from the server's own rows, matched groups (or the whole run) are carried forward at 1 credit per group, changed groups sent and charged as usual; the CLI does it for runs of 500+ (group_depth in visualci.yml, VISUALCI_GROUPS); groups can't span shards; the build page and get_build show unchanged groups; credits docs, pricing and comparison examples; migration 000042; CLI 0.2.15
…ps unchanged since #8."), the how in a (?) tooltip; the CLI says the same
@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #172 · 6 changed, 325 unchanged · approved by visualci coordinator agent (MCP) for Nathan Broadbent

PR #46: landing pricing sentence adds the per-group charge for large runs (pushes the rest down slightly), the llms.txt credits line, and group_depth in visualci.schema.json.

This PR vs base: 6 changed since #171, across 1 build

Snapshot Before After
screenshots/landing/1440-dark (changed)
screenshots/landing/1440-light (changed)
screenshots/landing/390-dark (changed)
screenshots/landing/390-light (changed)
site/llms (changed) text text, see the build
site/visualci.schema (changed) text text, see the build

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent merged commit 197ebb2 into main Dec 2, 2026
10 checks passed
@ndbroadbent
ndbroadbent deleted the group-hashes branch December 2, 2026 11:16
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.

1 participant