Skip to content

feat(chat): check the text and links of a page an agent wants to publish - #1968

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:feature/chat-go-live-page-checks
Nov 2, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:feature/chat-go-live-page-checks

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

AUTONOMOUS-GO-LIVE PR 3: pure checks of the text and links of a page an agent wants to take live on its own (§6.3 Part B, owner's Q1 answer B). The page is checked as it will go out, not by the run-wide taint flag that every content agent carries. Nothing calls the checks yet; PR 5's go-live step will. No migration.

What changes

  • lib/chat/go-live-checks.ts (pure):
    • outgoingTextCheck(html, kept) returns why the page is held, or null:

      • instructions: text aimed at AI (looksLikeInjection) in the reader's text, the whole HTML including its JSON-LD, or the stripped HTML;
      • hidden_text: anything stripHidden removes (zero-width or tag characters, comments, hidden elements);
      • copied: 30 words in a row that an untrusted read of the run returned. Past the 32 KB cap the check can't tell, so it holds.
    • foreignLink(html, sites): the first link that goes anywhere other than these:

      • the brand's domains;
      • a draft source;
      • a page a read listed (page-sites linksToSites, sitesOfPages);
      • an in-page or relative link, a phone number, or mail to the brand's domain.

      javascript: and other schemes are held.

    • Shingles:

      • 64-bit FNV-1a hashes of each 12-word run, 11 base64url characters each, stored end to end;
      • words are NFKC, lower case, letters and digits.
  • Engine: an agent run keeps its untrusted reads' hashes in progress.untrustedShingles, each once, up to 32 KB. A person's own chat keeps none.

Related issue

None. AUTONOMOUS-GO-LIVE spec, PR 3.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

Unit tests:

  • go-live-checks: words, hashes, 30 vs 29 words, the cap, each hold, allowed and foreign links;
  • page-sites;
  • engine: an agent run keeps its hashes, a person's chat doesn't.

No visible change, no Help article, no AI call.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes
  • yarn typecheck passes
  • yarn format:check passes
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

CI passed on this branch (655c15e), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41355934650): schema is up to date; web format:check, lint, typecheck, all tests and yarn build pass; server lint, format:check and all tests pass.

🤖 Generated with Claude Code

cihan-gyk and others added 2 commits November 2, 2026 00:03
AUTONOMOUS-GO-LIVE PR 3 (owner's Q1 answer B): pure checks on the page as
it would go out, for a later PR's go-live step. go-live-checks.ts holds a
page with text aimed at AI (in its text or its structured data), hidden
text, 30 words in a row copied from an untrusted read of the run, or a
link to a site that isn't the brand's, a source the draft lists, or a page
a read listed (page-sites linksToSites, sitesOfPages). An agent run now
keeps its untrusted reads as 64-bit hashes of 12-word runs in its
progress, 32 KB at most; past that the check holds the page. A person's
own chat keeps none. Nothing calls the checks yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… test's model steps out of a hook-named helper

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@gkhngyk gkhngyk 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.

LGTM

@gkhngyk gkhngyk 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.

LGTM

@gkhngyk
gkhngyk merged commit fa3df03 into ansvisor:main Nov 2, 2026
6 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.

2 participants