@phosphorco/bb-cross-references 0.3.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTRACT.md CHANGED
@@ -265,3 +265,135 @@ committed source; old strict V1 signals are unchanged. Clipped/coarse wakes can
265
265
  refresh mounted literal-URL coverage conditionally. No idle polling/factory SDK
266
266
  subscription/new worker. Later consumers share lazy mounted queries, cancel on
267
267
  teardown and retain rows/cursors when only coverage changes.
268
+
269
+ ## Producer ingress reservation (0.4, wire family1)
270
+
271
+ The separately negotiated producer family has four methods:
272
+ `crossReferencesProducer.describe`, `crossReferencesProducerV1GetState`,
273
+ `crossReferencesProducerV1Apply`, and `crossReferencesProducerV1ReportStatus`.
274
+ Use the exported schemas/client/registration helpers. Inputs are strict; outputs
275
+ admit bounded additive object fields. The existing V1 graph methods, digests,
276
+ claim uniqueness and counts retain their meaning. These source additions do not
277
+ establish registry availability of0.4 or compatibility with an older advertised SDK.
278
+
279
+ The first source kind is `thread-brief`, producer `thread-brief`, fixed verified
280
+ thread-storage `BRIEF.md`. One complete replacement contains the V1 projection,
281
+ its full primary evidence and an independently computed evidence digest. Existing
282
+ V1 resource/presentation validation remains authoritative. Limits are1MiB total,
283
+ 256 targets/256KiB V1 payload,512 locations/100 per target and256UTF8 bytes per
284
+ named heading. Presentation limits remain256/1024/2048UTF8 bytes and4096 JSON
285
+ bytes. The preflight returns the actual closed hit codes; it never truncates,
286
+ splits, silently withholds an overlong safe presentation or partially installs.
287
+
288
+ Let G be current graph revision and S retained blocked attempt; high-water is
289
+ max(G,S). A prospective producer Apply must exceed that high-water and satisfy
290
+ unchanged graph CAS. Exact current bound graph/evidence replay is nonmutating,
291
+ ignores stale CAS like V1 duplicate/equal, and exposes rather than clears newer
292
+ status. Same graph payload with different/unbound evidence cannot graft evidence.
293
+ `currentRevision` always means G. Apply commits graph, evidence, mappings and
294
+ superseded status deletion atomically, before any invalidation. Status-only
295
+ writes create no graph resources/claims/evidence, including a first-ever source.
296
+
297
+ ReportStatus precedence is exact stored attempt+digest replay; nonreplay<=G
298
+ stale; lower prior status stale/same attempt different content conflict; then
299
+ expectedRevision graph CAS. Its digest excludes attempt/CAS/clocks. Unknown
300
+ write outcomes require exact GetState reconciliation, never an automatic retry.
301
+ Ordinary V1 writes remain compatible and unfenced by S: retained evidence can
302
+ become unconfirmed and retained status can become superseded-by-graph. There
303
+ is one prospective V1 allocator, not a separate evidence/status revision clock.
304
+
305
+ Blocked states are `over-limit` (actual hit codes) and `identity-unrepresentable`
306
+ (fixed identity codes and any actual limit hits). UI text is exactly “brief
307
+ references not updated: over limit” or “brief references not updated: identity
308
+ cannot be represented safely”. Neither status transports raw errors or metadata.
309
+
310
+ ### Display safety and original locations
311
+
312
+ `classifyBriefDisplayTextV1` and `classifyBriefDisplayFieldsV1` are one pure bounded
313
+ lexical display-policy implementation, independent of recognition and Markdown.
314
+ They reuse existing safe URL/credential parameter policy, inspect raw plus at
315
+ most three strict security decode views, and return safe, unsafe or unclassified
316
+ with fixed reasons/work counters. URL userinfo, query/fragment parameters and
317
+ query-shaped sensitive-name assignments are covered. Percent UTF8, textual JSON
318
+ escapes and the closed numeric/ASCII HTML entity set are security views only.
319
+ Unknown, ambiguous, deep, malformed, control or budget-limited data is never safe.
320
+ No host/provider/resource discovery/parser call or cross-acceptance cache exists.
321
+ Bulk work admits required identities first, memoizes exact final values across
322
+ roles, and has fixed8192-field/4096-distinct/2MiB-original/8MiB-work limits.
323
+
324
+ Explicit B slots distinguish exact safe data, absent data and withheld digest plus
325
+ fixed generic display. Intro is null; named-empty is still a named heading.
326
+ Withheld digest is SHA256 of canonical `['brief-withheld',1,role,originalKnownValue]`.
327
+ Raw withheld values are never transported/stored. CR independently classifies
328
+ received safe/available fields; it cannot attest unseen originals behind digests.
329
+ Unsafe required identity rejects the whole revision. Optional unsafe metadata
330
+ keeps safe primary claims/counts/locations with explicit withholding; withheld
331
+ codec metadata supplies no new raw mapping/family authority. Exact authored URL
332
+ proof is separate from canonical identity and uses only safe original spelling.
333
+ Withheld/unknown URL proof contributes conservative coverage, never reconstruction.
334
+
335
+ Brief V2 rows are `brief-occurrence` with original ref-N, raw SHA/frame/bodyBase,
336
+ B section, original line/span and producer-attested/retained-unconfirmed binding.
337
+ They have no invented conversation role/messageSeq/time, and excerpts are only
338
+ unavailable/not-materialized. Direct active full producer/source/target joins,
339
+ query-relevant semantic tokens, keysets/counts/shared1MiB response admission and
340
+ independent coverage-on-not-modified remain. No derived postings or bootstrap.
341
+
342
+ ### Navigation provider seam
343
+
344
+ `registerBriefNavigation` and `createBriefNavigationClient` negotiate the separate
345
+ Thread Brief provider. A strict request pins the fixed file, raw revision, full
346
+ UTF16/BOM/bodyBase/native-line frame and explicit section/original line. A ready
347
+ proof must match all of them and the same complete accepted revision. Otherwise
348
+ open only fixed BRIEF top with a bounded note. FileLink alone is not freshness.
349
+
350
+ The TB adopter must implement one fresh bounded contained RAW read/hash per
351
+ explicit primary click, bypass stat/idle caches, and reuse accepted section/native
352
+ facts only after source/raw/frame equality. No hidden parse/recognition/model
353
+ construction or newer-heading relocation. Intro needs explicit same-pass intro
354
+ facts. Source/service generation guards are independent of viewer teardown. BOM
355
+ and LF/CRLF/loneCR mapping require actual adopter proof; unknown means top.
356
+
357
+ One mounted CR surface owns pending proof and dispatch entitlement across all
358
+ rows. New modifier/defaultPrevented/download/nonprimary/aux/context-menu intent
359
+ cancels prior proof before native top dispatch, without interception/new read.
360
+ Identical in-flight primary shares one read AND open. Primary prevents default
361
+ synchronously; current validated continuation opens once, with no automatic retry.
362
+ The public provider/accessor repairs and exact published0.4 TB adoption remain
363
+ separate work; source schemas do not claim that provider is already installed.
364
+
365
+ PR-family membership requires authority on each admitted record, recomputed to
366
+ the same canonical target. A PR sibling never promotes issue/kindless/withheld
367
+ siblings. An own available typed descriptor can support the real claim sentinel
368
+ when no admitted family location exists. Resource-level kindless mappings are
369
+ insufficient. Missing authority is independently scoped partial coverage using
370
+ `pr-family-authority-unknown`, including an all-unknown empty result; known issue
371
+ alone is excluded without fabricated unknown. Exact-self/literal semantics stay
372
+ unchanged, and no parser/secondary graph edge/target enumeration is added.
373
+
374
+ ### Rendered Brief reader destination (0.4.1)
375
+
376
+ The navigation describe envelope may advertise `renderedReaderVersions: [1]`.
377
+ After explicit negotiation, either existing ready or fallback result may add
378
+ `reader` with literal kind `thread-brief-reader`, version `1`, owner
379
+ `thread-brief`, path `reveal`, the exact source thread id, and a bounded opaque
380
+ UUIDv4 token. Existing proof, source-file, frame, line and fallback meanings do
381
+ not change. Older clients continue using the fixed native file preview.
382
+
383
+ `encodeBriefReaderPath` constructs only the declared same-origin native plugin
384
+ route; `decodeBriefReaderPath` accepts only that exact path grammar. Consumers
385
+ must project known fields and use the shared codec, never an arbitrary returned
386
+ href, scheme, origin, owner or panel. A malformed, unnegotiated or cross-thread
387
+ destination cannot grant another navigation target. Primary dispatch remains
388
+ owned by the existing one-surface intent generation. Modifier/auxiliary/menu
389
+ navigation retains the semantic fixed native FileLink.
390
+
391
+ The opaque token is a presentation handle, not access authority. The Thread
392
+ Brief owner binds it to the original input and accepted record, and checks the
393
+ accepted/displayed raw revision, frame and section again before scrolling its
394
+ own section ref. Missing, expired, withheld, changed or ambiguous selections
395
+ open the known thread's brief at TOP with a short note, or honestly report
396
+ unavailability; they never relocate by heading text. The route provides a back
397
+ to thread action, is lazy, and reuses the accepted reader service and rendering
398
+ without a second parser or recognition pipeline. Dispatch/conformance is not
399
+ proof that the native rendered heading is visible; that requires live proof.
package/README.md CHANGED
@@ -69,3 +69,20 @@ not-modified includes current coverage. Existing V1 clients stay unchanged. See
69
69
  CONTRACT.md for strict inputs, tolerant bounded outputs, direct-query/time limits,
70
70
  no-word-cut behavior and read-only conformance. Package source tests and private
71
71
  emission are distinct from a published registry consumer or live host proof.
72
+
73
+ The unreleased0.4 producer additions are exported through existing root, `/bb`
74
+ and `/testing` entries. Use `createCrossReferencesProducerClient` for complete
75
+ Brief graph/evidence replacement and status/readback, and
76
+ `runCrossReferencesProducerConformance` against an adopter's real registered
77
+ handlers. `runBriefNavigationConformance` requires an actual accepted-reader
78
+ fixture; it never supplies a fake freshness proof. Explicitly compile
79
+ `test/public-producer-types.mts`; ordinary test discovery does not compile it.
80
+ `tools/packed-producer-consumer.mjs` checks actual independent installed native
81
+ ESM imports and physical roots; resolver fixtures are not package/registry proof.
82
+ See CONTRACT.md for display withholding, bounds, revision fencing and the still
83
+ separate TB raw-reader/public navigation adoption duties.
84
+
85
+ In 0.4.1, Brief navigation can negotiate a rendered Thread Brief reader route.
86
+ The optional fixed destination and shared path codec preserve the existing
87
+ same-revision proof and native-file fallback. The reader owner validates the
88
+ accepted section again; stale or expired selections stay at the top with a note.