Skip to content

CIT-0: neutral citation target - #7775

Merged
briansrls merged 16 commits into
mainfrom
session/cit-0
Aug 6, 2026
Merged

briansrls merged 16 commits into
mainfrom
session/cit-0

Conversation

@briansrls

@briansrls briansrls commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CIT-0 neutral citation substrate — three-carrier model:

  • CitationTarget — expected_pin + valid CitationSelector only (no embedded retrieval observation).
  • CitationRetrievalObservation — dated request receipt (RepresentationRetrieved, access refused, unreachable, rate-limited, response-without-representation).
  • CitationVerificationReceipt — explicit join of target + observation + reconciliation verdict.

Other landed facts:

  • Symbolic source: Pin<CitedRepresentationIdentity> grounds source on ExternalSubjectRef, with access_route and byte_domain as separate identity axes.
  • Canonical URI equality: extdeps.uri uri_eq compares scheme + locator; used in identity reconciliation and request binding (http vs https on the same locator are distinct).
  • Honest verification outcomes: only RepresentationMatch inhabits CitationRepresentationVerified; mismatch/incomparable/missing are separate terminal arms — no absorbing success.
  • Selector construction wall: CitationSelectorConstruction = Constructed | Refused; CitationSelector carries valid arms only.
  • HTTP success gate: RepresentationRetrieved with non-2xx status refuses verification (HttpStatusNotSuccessful).
  • Typed non-retrieval refusals: unreachable/access-refused/rate-limited/204 preserve their observation arm in refusal causes.
  • citation_exact_pin: Sha256Digest admission boundary only; reconcile max conclusion is supplied-equals-supplied.

Test plan

  • citation_cit0_witness_test green by execution (scheme mismatch, HTTP 404 refusal, verified-vs-mismatch split, selector construction, identity/reconcile controls).

@gunbai-bot gunbai-bot Bot changed the title Rich PDF citation anchors CIT-0: neutral citation target Aug 4, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 4, 2026 02:57
@gunbai-bot

gunbai-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Addressed review 47926 (retry_after_seconds finding).

Fix (dafadbb): CitationRateLimited.retry_after_seconds: Int? → retry_after: Second? with import std.measure { Second } — duration now rides the measured-time carrier, not a bare Int in std/.

Collateral: importing std.measure pulls extdeps.units.* into the witness closure, where homonymous extdeps_external_authority_anchor rows shadow the web-annotation symbol at eval time. Added web_annotation_authority (inlined URI, citation-facing name) in extdeps.standards.web_annotation and pointed std.citation + the witness at it. 8/8 citation_cit0_witness_test fns green by execution.

— sent from smart-cat-178

@gunbai-bot

gunbai-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

review 47935 — duplicate authority anchor: fixed (3294caaf47)

Verified against current code: web_annotation_authority was re-minting the same Uri block as extdeps_external_authority_anchor at lines 15–20. That is a same-file parallel representation.

Fix: data web_annotation_authority: ExternalAuthority = extdeps_external_authority_anchor — the established extdeps alias pattern (jq_authority precedent). The citation-facing export name is preserved for the std.measure homonym disambiguation; the cited fact has one editable source.

Witness: web_annotation_authority_is_cited_for_selectors now proves alias identity (web_annotation_authority.uri.locator == extdeps_external_authority_anchor.uri.locator), matching provider_lifecycle_witness_test — not a second string literal. 13/13 citation_cit0_witness_test green locally.

— sent from smart-cat-178

@gunbai-bot
gunbai-bot Bot marked this pull request as draft August 4, 2026 04:33
@gunbai-bot
gunbai-bot Bot force-pushed the session/cit-0 branch 2 times, most recently from e319a72 to 80a5aca Compare August 5, 2026 03:52
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 5, 2026 18:31
@gunbai-bot

gunbai-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Read review 48922 against 80a5aca.

Both minor notes are intentional CIT-0 choices, not gaps:

  1. Zero-length TextPositionSelector (end == start) — admitted in text_position_selector's Equal arm; W3C TextPositionSelector allows a degenerate range and we only refuse end < start (TextPositionEndBeforeStart). Happy to add an explicit sentence to text_position_selector_cross_field_note in a follow-up if the operator wants the note to carry it; not blocking merge.

  2. uri_eq exact-string locator match — deliberate fail-closed CIT-0 binding (RequestLocatorMismatch on any string mismatch including trailing-slash drift). URI normalization belongs in CIT-1+ (citation_fragment_selector_conforms_to / fragment open-parameter work), not silently absorbed here.

No code change from this review.

— sent from smart-cat-178

@gunbai-bot

gunbai-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Addressed review 48947 (REQUEST_CHANGES on uri_eq).

Fix (31ec542): deleted uri_eq from extdeps.uri and regen; std.citation + citation_cit0_witness_test now use substrate Uri == / != directly (cited_representation_identity_eq, verify_citation_representation locator checks). Agree with the finding — Uri is a closed record and rest.dag already dissolved the parallel rest_uri_eq predicate for the same §2/§3 reason.

CI re-running on the new head.

— sent from smart-cat-178

Brian Searls and others added 16 commits August 5, 2026 21:03
std.citation + extdeps.standards.web_annotation + hermetic witnesses only; ExternalAuthority untouched. observed_at grounded on EpochMs.

Co-authored-by: Cursor <cursoragent@cursor.com>
…IT-0.

Delete constant-true widened_sketch and its witness; layer discrimination stays on admitted/refused pair via admit_citation_retrieval_observation only. Move MediaWiki provider observation to CIT-2 scaffold; std.citation stays provider-neutral.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace bare Int retry_after_seconds with retry_after: Second? per review 47926 (value-Measure single authority). Add web_annotation_authority as a citation-facing disambiguated export so std.measure's extdeps.units closure cannot shadow extdeps_external_authority_anchor homonyms at witness time.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace RepresentationPin/Pinned/Unpinned with extdeps.pin Pin<CitedRepresentation> where CitedRepresentation carries authority and RepresentationByteDomain; version and expected_identity fuse on Pin. media_type uses extdeps.http.server MediaType; http_status uses std.types HttpStatus. Absent pin is optional, not a constructor. Nine hermetic witnesses green.

Co-authored-by: Cursor <cursoragent@cursor.com>
Finding 6: start/end use std.integer.NonNegativeInt per W3C Web Annotation;
text_position_selector refuses end<start via SelectorRefused with explicit
validation note. Finding 7: replace free-string refusal causes with typed
coproducts (SelectorRefusalCause, CitationAccessRefusalCause,
CitationUnreachableCause). 13/13 CIT-0 witnesses green.

Co-authored-by: Cursor <cursoragent@cursor.com>
Per review 47935: consume the module anchor instead of duplicating the
Uri literal (jq_authority pattern). Witness now proves alias identity
against the anchor, not a second string literal.

Co-authored-by: Cursor <cursoragent@cursor.com>
Per loyal-ant-382 CIT-0 sign-off: citation_unreachable_cause_note pins
TransportUnreachable to transport-layer failures outside the four named
arms — not an unclassifiable catch-all. Unclassifiable observations need
a separate arm when the transport layer lands.

Co-authored-by: Cursor <cursoragent@cursor.com>
…model.

Ground pin.subject on ExternalSubjectRef, split CitationTarget from retrieval observation and verification receipt, delete the born-fired scaffold, and update citation_cit0_witness_test imports off the removed CitedRepresentation name.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add extdeps.uri uri_eq (scheme + locator) for identity and request binding; split CitationVerificationOutcome so only RepresentationMatch inhabits Verified; route selector construction through CitationSelectorConstruction; refuse non-success HTTP status; preserve typed non-retrieval observation causes.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rebase picks up main's positional call-shape fixes for change/keyed_roster; regen closes stage0 drift for the CIT-0 uri_eq addition.

Co-authored-by: Cursor <cursoragent@cursor.com>
Uri is a closed record — hand-rolled scheme/locator equality duplicates rest.dag's dissolved rest_uri_eq pattern and spreads a second authority through std.citation.

Co-authored-by: Cursor <cursoragent@cursor.com>
Equal and Greater both construct the same TextPositionSelector; refuse only on Less.

Co-authored-by: Cursor <cursoragent@cursor.com>
witness_coproduct_arms_parse_only was parsing all 638 files under
src/v2/test/claim and exceeded the 5s fast-lane CPU budget under CI
load; narrowing the pool to the witness fixture directory drops eval
from ~4s to ~11ms without changing what the witness asserts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Read review 49053 (APPROVE).

Both non-blocking observations are already the intended CIT-0 posture:

  1. TransportUnreachable — named fifth arm, not a silent catch-all; citation_unreachable_cause_note states unclassifiable transport failures must land on a separate arm when that layer lands (CIT-2 transport observation work).

  2. web_annotation_authority — citation-facing export alias to extdeps_external_authority_anchor for the std.measure homonym disambiguation in witness closures; single editable cited fact, same pattern as jq_authority. Witness proves alias identity, not a second locator literal.

No code change from this review.

— sent from smart-cat-178

@gunbai-bot

gunbai-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Read review 49055 (APPROVE).

Clean approval — no actionable findings on the changed lines. Nothing to change from this review.

— sent from smart-cat-178

@briansrls
briansrls merged commit a815410 into main Aug 6, 2026
5 checks passed
@briansrls
briansrls deleted the session/cit-0 branch August 6, 2026 00:09
@gunbai-bot gunbai-bot Bot mentioned this pull request Aug 6, 2026
2 tasks done
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