Skip to content

Cite a reply's content: the cite guest builds Web Annotations the judge accepts - #180

Draft
afflom wants to merge 4 commits into
mainfrom
claude/project-thread-9kd31o
Draft

afflom wants to merge 4 commits into
mainfrom
claude/project-thread-9kd31o

Conversation

@afflom

@afflom afflom commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Requested by Alex · project thread

What

Second slice of citations for chat replies, after #160 (the judge). The cite guest builds the citations of one reply as W3C Web Annotations.

  • app/src/PrismCite.lex.tex: from the reply's address and, per placeholder, its start and end in the reply's text, the address of the item it was filled from and the exact text, the annotations as a JSON array in RFC 8785 form. Each has motivation linking, a target that is a Specific Resource on the reply with a TextPositionSelector, a body that is a Specific Resource on the item with a TextQuoteSelector, and as id the SHA-256 address of itself without an id.
  • An annotation is answered only when the annotation judge (PrismAnnotation, held to the web-platform-tests suite) finds every annotationMusts assertion as the suite expects. Otherwise the answer is invalid. The refusal is in the model, not in a test beside it.
  • app/src/Sha256.lex.tex: the SHA-256 module of generators/snapshot (held there to NIST's CAVP vectors), with the title the app's lexicon has. Registered under FIPS 180-4.
  • app/specs/guests/annotation/cite.json, site/annotation/guest/cite.wasm. site/annotation/guest.mjs now exports GUESTS { judge, cite }; nothing on the page imports it yet.

Request: <reply address>\n, then per citation <start> <end> <item address> <n>\n<n bytes of exact text>\n. An address is sha256: and 64 lower-case hex digits, as agreed with the chat and snapshots work.

How it is held

No expected answer is the model's own output. Each of the 23 answers in app/specs/cite/spec.json is built outside LexLean: the object of the agreed shape, written by the RFC 8785 author's canonicalizer (pinned by hash), addressed by SHA-256, and accepted by the suite's own validator. The exact texts and positions are the TextQuoteSelector and TextPositionSelector values of the W3C documents #160 pins and the strings of the RFC 8785 author's test data; the addresses are digests of NIST's SHA-256 short messages. Three more vectors are refusals the request form defines.

prismpm build runs all 26 in the locked SDK, and the built wasm gives the same answers.

Not in this PR

Resolving a selector against a snapshot's text (no oracle yet, recorded in the oracle gaps by #160), and the chat's use of the guest.

Gates run locally on main dfbb311

ST-01, GU-01, GN-01 (run.sh --check, with the parts check), realize, HW-01 (no growth), PV-01.


Generated by Claude Code

…ge accepts

PrismCite takes a reply's address and, per placeholder, its start and end in
the reply, the address of the item it was filled from and the exact text, and
answers the citations as W3C Web Annotations in RFC 8785 form, each with the
SHA-256 address of itself without an id as its id. An annotation is answered
only when the annotation judge finds every annotationMusts assertion as the
suite expects.

No expected answer is the model's own: each is built outside LexLean by the
RFC 8785 author's canonicalizer, SHA-256 and the suite's validator, over
selector values of the pinned W3C documents, the RFC 8785 test data's strings
and NIST's SHA-256 digests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3NKtifq75V8QbFCACT
@afflom afflom self-assigned this Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merge train notice: the merge train merges this pull request once it is green on current main; don't enable auto-merge.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Merge train: d265f57: not merged, because it conflicts with main (dfbb311) and the pull requests the train takes before it. Fix it on this branch (merge main first) and the train tests it again.


Generated by Claude Code

@afflom
afflom marked this pull request as draft November 16, 2026 20:02
The item address is one token of 1 to 100 bytes of letters, digits
and : # - _ . (a vault address, with or without a fragment); the
reply address stays sha256. Reference vectors now cycle k1 and sha256
item addresses and include one the suite refuses as no IRI.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3NKtifq75V8QbFCACT

This branch has not been deployed

No deployments
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