Skip to content

Web: name the auto-created web app 'Verify web <hash>' so the URL's host stays out of Revyl - #96

Merged
capy-ai[bot] merged 8 commits into
mainfrom
capy/web-app-no-host
Dec 5, 2026
Merged

capy-ai[bot] merged 8 commits into
mainfrom
capy/web-app-no-host

Conversation

@anamhira47

@anamhira47 anamhira47 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

G1 from the /verify device and test-editor dogfood (REVL-46674, REVL-46672): keep private preview hosts out of Revyl org data.

What changes

  • A web target without appId finds or creates its Revyl web app as Verify web <hash> instead of Verify: <host>. <hash> is the first 10 hex digits of SHA-256 of the same host string as before (lowercase, IPv6 in brackets, port when not 443). Each host still maps to one app through the existing find-or-create (409 app_exists → reuse), and TypeScript, Python and Go produce the same name for every ASCII and IPv6 host. They were checked on 12 URLs, including Unicode IDN hosts (TS hashes the Unicode form, as Python and Go do), IPv6 and :0443. One gap remains: a host typed already in punycode (xn--…) still hashes differently in Python and Go, because closing it in Go would need golang.org/x/net/idna.
  • The two errors that quoted the app name (403 on create, and create without an id) no longer show the host.
  • Docs, READMEs and the revyl-verify skill use the new name. web.md and configuration.md now say Revyl reuses the build that already holds the same URL, and that the build keeps the full URL.
  • CHANGELOG: 0.9.3 / Go 0.8.3 / Python 0.7.3. Upgrading creates one new app per host on the next open(); the old Verify: <host> apps can be deleted in Revyl, or pinned with appId.

Build records: no SDK change needed

POST /api/v1/apps/{id}/builds/external already reuses one record per app + URL (+ commit, which Verify doesn't send). The backend inserts with ON CONFLICT DO NOTHING on a unique index for live web_external builds and returns was_reused: true (cognisim_backend/app/services/builds/web_external_builds.py, app/db/repositories/builds_repo.py). So repeat open()s of one URL don't pile up records. Skipping registration isn't possible: a web start needs an app_id, refuses a raw URL, and otherwise opens the app's latest build. Each distinct URL still gets one record that holds it. Removing that needs a backend change, such as an ephemeral flag on builds/external or a URL on the start request; that's proposed in the report, not built.

Proposal, needs Anam's approval (not built)

An option to name the auto-created app, which defaults to Verify web <hash> and can't be combined with appId:

  • TypeScript: app: { url, name?: string }
  • Python: Target(..., app_name=None)
  • Go: Target.AppName

Deleting the auto-created app on close() is not recommended. The app is shared through find-or-create by every concurrent process for that host, deleting it hides finished sessions, it needs a delete permission many keys lack, and it doesn't remove recorded builds.

Review

An independent review found no high-severity issues. Its medium finding (IDN parity) and two lows (Go :0443, comment wording) are fixed in cbded2d.

Checks

  • TS build, typecheck and npm test (317 + 8).
  • Python ruff, format, mypy and pytest (780).
  • Go gofmt, vet and test.
  • check:links.

No tests added or changed, and not run live. Conflicts expected with #94 and the G2/G3 PR on the CHANGELOG headings and the web-app error lines; whichever merges second rebases.

Open in Capy


Note

Medium Risk
Behavior change on every web open without appId (new Revyl apps per host until pinned), with coordinated logic across three SDKs; not auth-critical but affects org metadata and upgrading users.

Overview
Web targets without a pinned app id no longer register Revyl web apps as Verify: <host>. Verify now finds or creates them as Verify web <hash>, where <hash> is the first 10 hex digits of SHA-256 over a normalized host string (Unicode IDN, port when not 443), so preview hostnames stay out of org app lists. TypeScript, Python, and Go share the same naming and normalization logic, including new punycode handling in Go.

Optional labeling is added across all three SDKs: app: { url, name }, Target(app_name=...), and Target.AppName, to pick a human-readable app name (1–100 trimmed chars, not combinable with an existing app id). Process-level web app caches now key on host plus optional name.

Migration: existing Verify: <host> apps are not matched; the next open() per host creates one new app (logged with created;). Errors for wrong-platform apps and missing build ids no longer echo the URL. Docs, READMEs, CHANGELOG, and the verify skill document the new defaults, name, and build reuse.

Reviewed by Cursor Bugbot for commit 12a20e2. Bugbot is set up for automated code reviews on this repo. Configure here.

Stack

Based on #94 (capy/persistent-refuse-running) so the three 0.9.3 PRs merge in order without conflicts: #94 → #96 → #97. The 0.9.3 CHANGELOG sections are built up once across the stack.

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai
capy-ai Bot marked this pull request as draft December 5, 2026 00:17
anamhira47 and others added 4 commits December 5, 2026 00:17
…RL's host stays out of the app list

TypeScript, Python and Go name it from the first 10 hex digits of the
SHA-256 of the host (lowercase, port when not 443), keeping one app per
host with the same find-or-create and 409 app_exists reuse. Docs, READMEs
and the revyl-verify skill say the new name and that Revyl reuses the
build holding the same URL.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…se the Go port as a number

TypeScript hashed the punycode host, so an international domain got a
different app name than in Python and Go; it now hashes
domainToUnicode(hostname), lowercased. Go compares the port as an
integer so :0443 counts as 443. Comments say the name doesn't show the
host rather than reveal it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… hosts name the same app

TypeScript hashes the Unicode host from domainToUnicode. Python now decodes
each xn-- label with the built-in punycode codec and Go with a small
stdlib-only RFC 3492 decoder, lowercased, keeping a label as written when
it doesn't decode.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ppName

A web target with url and no app id can name the Revyl web app Verify finds
or creates, such as 'Checkout previews': 1 to 100 characters after
trimming, no control characters, not with an app id, and rejected on iOS,
Android, computers and inside a computer. Without it the name stays
'Verify web <hash>'. The per-process cache is keyed by the name too, and
the non-web-app and missing-build-id errors no longer show the URL.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@anamhira47
anamhira47 force-pushed the capy/web-app-no-host branch from 57c6577 to 4c9fa97 Compare December 5, 2026 00:24
@capy-ai
capy-ai Bot marked this pull request as ready for review December 5, 2026 00:29

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

…() does

So a name padded with a byte-order mark finds the same Revyl web app and
passes the same length check in all three languages.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

Open in Capy

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a54b099. Configure here.

const name = `Verify: ${host}`;
const unicodeHostname = hostname.startsWith('[') ? hostname : domainToUnicode(hostname).toLowerCase();
const nameHost = port && port !== '443' ? `${unicodeHostname}:${port}` : unicodeHostname;
const name = appName ?? `Verify web ${createHash('sha256').update(nameHost).digest('hex').slice(0, 10)}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rejected hosts share one app

Medium Severity

domainToUnicode returns an empty string when it rejects a host, and that empty result is hashed with no fallback to the original hostname. Every rejected host then shares one Verify web app, or one per port, while Python and Go keep the raw label, so the same URL does not map to the same app.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a54b099. Configure here.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
#	packages/verify/docs/web.md
@capy-ai
capy-ai Bot changed the base branch from main to capy/persistent-refuse-running December 5, 2026 01:16

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

View 1 other finding in Capy.

Open in Capy

@capy-ai capy-ai Bot left a comment

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.

Capy found no issues.

Open in Capy

@capy-ai
capy-ai Bot changed the base branch from capy/persistent-refuse-running to main December 5, 2026 03:54
@capy-ai
capy-ai Bot merged commit 5e8a8c2 into main Dec 5, 2026
7 checks passed
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