mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
drop_closure exists to refuse a drop that is really a refactor: if code we keep still imports a product, deleting it is a ModuleNotFoundError waiting for the next boot. It only ever read Python, so half the dependency graph was invisible to it and five products whose TypeScript the core still imports were dropped anyway — 21 files left importing 25 specifiers that resolve to nothing, including lib/api.ts, which 760 files import, and seven lazy scene imports in productScenes.tsx. Django booted past it and the bundle did not, which is why the Python-only rule looked like it was working. The closure now reads both module systems through one table of (extensions, pattern) pairs, so a third one is a row rather than a branch. The TypeScript pattern is anchored on the import keyword rather than on the path, because jest's testPathIgnorePatterns and oxlint's ignore list quote a product path precisely because it is NOT built; matching those would hold desktop, the 4,797-file product the drop is mostly for. integrations, wizard, platform_features, visual_review and ai_gateway come back with their Django apps and workspace entries, since the closure now spares them. desktop, field_notes, ingestion and support stay dropped.
246 lines
12 KiB
YAML
246 lines
12 KiB
YAML
# MCP tool definition — tool entries are scaffolded from the OpenAPI schema.
|
|
# The tool list and operation IDs are kept in sync automatically:
|
|
# pnpm --filter=@hanzo/mcp run scaffold-yaml -- --sync-all
|
|
#
|
|
# To enable a tool, set enabled: true and add required scopes + annotations.
|
|
# All other fields (title, description, enrich_url, etc.) are yours to configure.
|
|
category: Visual review
|
|
feature: visual_review
|
|
url_prefix: /visual_review
|
|
ui_apps:
|
|
visual-review-snapshots:
|
|
type: custom
|
|
app_name: Insights Visual Review Snapshots
|
|
description: Visual review run snapshots — diff viewer with approve/tolerate actions
|
|
tools:
|
|
visual-review-repos-baselines-retrieve:
|
|
operation: visual_review_repos_baselines_retrieve
|
|
enabled: false
|
|
visual-review-repos-create:
|
|
operation: visual_review_repos_create
|
|
enabled: false
|
|
visual-review-repos-list:
|
|
operation: visual_review_repos_list
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
list: true
|
|
title: List visual review repos
|
|
description: >
|
|
List visual review repos (test suites) for the current project. A repo typically maps to a GitHub repository
|
|
and owns the baselines, runs, and tolerated hashes for that codebase. Returns repo id, external id, full
|
|
name, baseline file paths, and pr-comment configuration.
|
|
feature_flag: visual-review
|
|
visual-review-repos-partial-update:
|
|
operation: visual_review_repos_partial_update
|
|
enabled: false
|
|
visual-review-repos-quarantine-create:
|
|
operation: visual_review_repos_quarantine_create
|
|
enabled: false
|
|
visual-review-repos-quarantine-expire-create:
|
|
operation: visual_review_repos_quarantine_expire_create
|
|
enabled: false
|
|
visual-review-repos-quarantine-list:
|
|
operation: visual_review_repos_quarantine_list
|
|
enabled: false
|
|
visual-review-repos-retrieve:
|
|
operation: visual_review_repos_retrieve
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
title: Get visual review repo
|
|
description: >
|
|
Get a visual review repo by id. Returns baseline file paths keyed by run_type (e.g. storybook → baseline
|
|
YAML path in the repo), pr-comment setting, and repo metadata.
|
|
feature_flag: visual-review
|
|
visual-review-repos-runs-counts-retrieve:
|
|
operation: visual_review_repos_runs_counts_retrieve
|
|
enabled: false
|
|
visual-review-repos-runs-list:
|
|
operation: visual_review_repos_runs_list
|
|
enabled: false
|
|
visual-review-repos-snapshots-list:
|
|
operation: visual_review_repos_snapshots_list
|
|
enabled: false
|
|
visual-review-repos-thumbnails-retrieve:
|
|
operation: visual_review_repos_thumbnails_retrieve
|
|
enabled: false
|
|
visual-review-runs-add-snapshots-create:
|
|
operation: visual_review_runs_add_snapshots_create
|
|
enabled: false
|
|
visual-review-runs-approve-create:
|
|
operation: visual_review_runs_approve_create
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:write
|
|
annotations:
|
|
readOnly: false
|
|
destructive: false
|
|
idempotent: true
|
|
title: Mark visual review snapshots reviewed
|
|
description: >
|
|
Mark specific snapshots as reviewed (approved) in a run. Pass a `snapshots` list, each entry being
|
|
`{identifier, new_hash}` — `new_hash` is the `content_hash` of the snapshot's `current_artifact`. This only
|
|
records the review in the database (the per-snapshot "Accept change" action) — it does NOT update the
|
|
baseline, push a commit, or change the GitHub gate, and it can be re-run safely. To actually ship the visual
|
|
change (commit the baseline + green the gate), use `visual-review-runs-finalize-create`.
|
|
feature_flag: visual-review
|
|
visual-review-runs-complete-create:
|
|
operation: visual_review_runs_complete_create
|
|
enabled: false
|
|
visual-review-runs-counts-retrieve:
|
|
operation: visual_review_runs_counts_retrieve
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
title: Visual review run counts
|
|
description: >
|
|
Return review state counts across all runs for the current project: `needs_review`, `clean`, `processing`,
|
|
`stale`. Useful as a single call to show reviewer workload before drilling into the list.
|
|
feature_flag: visual-review
|
|
visual-review-runs-create:
|
|
operation: visual_review_runs_create
|
|
enabled: false
|
|
visual-review-runs-finalize-create:
|
|
operation: visual_review_runs_finalize_create
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:write
|
|
annotations:
|
|
readOnly: false
|
|
destructive: true
|
|
idempotent: false
|
|
title: Finalize a visual review run
|
|
description: >
|
|
Finalize a fully-reviewed run: commit the approved baseline to the PR branch and green the GitHub
|
|
visual-review check. Commits exactly the snapshots approved in the DB (tolerated snapshots keep their
|
|
baseline and are never overwritten) and is all-or-nothing — it only succeeds once every changed/new snapshot
|
|
is resolved (approved, tolerated, or quarantined), otherwise it returns the unresolved list. With
|
|
`approve_all: true` every still-pending changed/new snapshot is approved first. When a baseline commit is
|
|
pushed its SHA comes back on the run's `metadata.baseline_commit_sha`; it's absent when nothing needed
|
|
committing (all changes resolved by toleration/quarantine — the gate still greens) or when the commit was
|
|
skipped (no PR, or a `409 sha_mismatch` from newer PR commits, which leaves the gate red — re-run CI and
|
|
finalize again). STOP: never finalize on your own initiative. Require explicit, per-run human confirmation
|
|
first — finalizing ships the visual change and rewrites the committed baseline.
|
|
feature_flag: visual-review
|
|
visual-review-runs-list:
|
|
operation: visual_review_runs_list
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
enrich_url: runs/{id}
|
|
list: true
|
|
title: List visual review runs
|
|
description: >
|
|
List visual review runs for the current project. Each run represents a single CI execution that captured
|
|
screenshots for a commit. Filter by `review_state` (e.g. `needs_review`, `clean`, `processing`, `stale`) to
|
|
triage workload, or by `pr_number` / `commit_sha` / `branch` to find the specific run(s) blocking a PR.
|
|
Returns status, review decision, commit sha, branch, pr number, and a summary of changed / new / removed /
|
|
unchanged snapshots.
|
|
feature_flag: visual-review
|
|
visual-review-runs-recompute-create:
|
|
operation: visual_review_runs_recompute_create
|
|
enabled: false
|
|
visual-review-runs-retrieve:
|
|
operation: visual_review_runs_retrieve
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
enrich_url: runs/{id}
|
|
title: Get visual review run
|
|
description: >
|
|
Get a visual review run by id. Returns run status, review decision, commit/branch/pr context, a summary
|
|
(total, changed, new, removed, unchanged, tolerated-matched snapshot counts), and staleness info if a newer
|
|
run supersedes this one. Use `visual-review-runs-snapshots-list` for per-snapshot diff details.
|
|
feature_flag: visual-review
|
|
visual-review-runs-snapshot-history-list:
|
|
operation: visual_review_runs_snapshot_history_list
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
title: Snapshot change history
|
|
description: >
|
|
List recent change history for a snapshot `identifier` across previous runs in the same repo. Useful for
|
|
diagnosing flaky snapshots — if the same identifier flips between changed and clean across runs, it is a
|
|
candidate for tolerated hashes or quarantine. Requires `identifier` query parameter.
|
|
feature_flag: visual-review
|
|
visual-review-runs-snapshots-list:
|
|
operation: visual_review_runs_snapshots_list
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
list: true
|
|
title: List run snapshots
|
|
description: >
|
|
List the snapshots captured in a run with their diff results. Each snapshot carries an `identifier` (e.g.
|
|
Storybook story id + theme), a `result` (`unchanged`, `changed`, `new`, `removed`), an optional
|
|
`classification_reason` (`tolerated_hash`, `below_threshold`, `exact`), diff percentage / pixel count, and
|
|
`review_state` (`pending`, `approved`). Currently-quarantined snapshots are EXCLUDED by default — they are
|
|
known-flaky noise, not changes to review — and reported only as a `quarantined_count` on the response; pass
|
|
`include_quarantined=true` to fetch them too. Renders an interactive diff viewer with baseline / current /
|
|
diff images and approve / tolerate actions. Paginated — pass a `limit` (e.g. 50) when a run might have many
|
|
snapshots (a broken run can produce 3000+ pairs); the diff viewer caps the visible list at 100 and
|
|
prioritises actionable results regardless.
|
|
ui_app: visual-review-snapshots
|
|
feature_flag: visual-review
|
|
visual-review-runs-tolerate-create:
|
|
operation: visual_review_runs_tolerate_create
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:write
|
|
annotations:
|
|
readOnly: false
|
|
destructive: false
|
|
idempotent: true
|
|
title: Tolerate visual review snapshot
|
|
description: >
|
|
Mark a single changed snapshot as a known tolerated alternate. The snapshot's current hash is recorded
|
|
alongside the existing baseline so future runs producing the same alternate are not flagged as changes —
|
|
useful for benign rendering variants (anti-aliasing noise, blinking cursors, etc.). Pass `snapshot_id` — the
|
|
UUID of the snapshot in this run. Does not change the baseline. Use approve to actually update the baseline
|
|
image.
|
|
feature_flag: visual-review
|
|
visual-review-runs-tolerated-hashes-list:
|
|
operation: visual_review_runs_tolerated_hashes_list
|
|
enabled: true
|
|
scopes:
|
|
- visual_review:read
|
|
annotations:
|
|
readOnly: true
|
|
destructive: false
|
|
idempotent: true
|
|
title: List tolerated hashes
|
|
description: >
|
|
List known tolerated alternate hashes for a snapshot `identifier` in the run's repo. Tolerated hashes
|
|
catalog acceptable rendering variants (e.g. anti-aliasing noise) so future runs don't flag them as changes.
|
|
Requires `identifier` query parameter.
|
|
feature_flag: visual-review
|