[Canon] Per-concept source/item authority overrides (AuthoritativeFor + GraphEdge.AuthorityTierID)

Aperta
#6,757 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
sql, typescript

Direzione di ricerca

Start with the referenced semantic graph migration, MJGraphEdgeEntityServer.server.ts, and GraphEngine.ts, then review related issues #6675, #6723, and #6724 for the governance and visibility dependencies. The design also points to CanonGraphEngine.ts for concept matching. Done means the schema, edge governance and cache projection, and per-concept authority resolution follow the stated precedence and preserve separate overrides for opposing concepts; the issue leaves visibility and hierarchy tie-breaking open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

canon
What Canon should do

Support per-concept authority overrides from MJ: Content Sources or MJ: Content Items to MJ: Graph Concepts by adding:

  1. A seeded global GraphEdgeType AuthoritativeFor (InverseName: 'HasAuthoritySource', IsDirected: true, AllowStored: true, DefaultWeight: 1.0) constrained via MJ: Graph Edge Type Endpoints strictly to 'MJ: Content Sources' / 'MJ: Content Items' -> 'MJ: Graph Concepts'.
  2. A nullable [AuthorityTierID] foreign key column on __mj.GraphEdge referencing __mj.GraphAuthorityTier([ID]), guarded by Graph: Approve Edges (Workstream 5a/5b) and cached in GraphEngine.
  3. A resolution contract combining chunk provenance traversal (SourcedFrom + ParentID / Broader Than) and strict Exact/Mention query concept matching (later enhanced by Backlog item 1 concept vectorization) without flattening multi-concept overrides across opposing topics.
Who needs this

Associations and multi-topic knowledge bases (e.g., Betty) commonly have two sources that both cover multiple topics with opposite authority:

  • 2026 Rulebook (Reference, 20) is authoritative on Competition Scoring (Board Policy, 80), while its appendix notes on event schedules are secondary.
  • Public Website (Reference, 20) is authoritative on Registration Deadlines / Events (Executive SOP, 60), while an older blog post on scoring is secondary.

Why existing primitives cannot express this:

  • Flat per-source AuthorityTier (GraphOverlay.types.ts#L167-L188) assigns one default tier per ContentSource, which cannot invert between Concept X and Concept Y.
  • Binary Supersedes edges (UQ_GraphEdge in V202611022300__v6.2.x__Semantic_Graph_And_Graph_Concepts.sql#L199) only allow one (Source, Target) pair per edge type without a concept key, and chunk-anchored Supersedes edges are disallowed because chunks regenerate on re-ingest and concept-boundary chunk splitting is brittle.
  • Reusing SourcedFrom conflicts with #6724 (5c, source-bounded concept visibility: a concept is readable if the caller and audience share at least one readable SourcedFrom target) and with pipeline provenance (ManagedPromptConceptSynthesizer.ts#L99-L116). Adding a Staff-only authority source via SourcedFrom or attaching a Public source at low tier would invert intended visibility.
Layer
  • Extraction and entity storage
  • Concepts and authority
  • Search and agents
  • Schema
  • UI / governance
Related work
Rough size
  • Small (1-2 days, localized change)
  • Medium (a week or two, touches a couple of layers)
  • Large (multi-PR / architectural)

Design Sketch
1. Schema & Seed Metadata (Dec 3 Review)
  • Add nullable [AuthorityTierID] on __mj.GraphEdge:
    ALTER TABLE [${flyway:defaultSchema}].[GraphEdge]
    ADD [AuthorityTierID] UNIQUEIDENTIFIER NULL
        CONSTRAINT [FK_GraphEdge_GraphAuthorityTier]
        REFERENCES [${flyway:defaultSchema}].[GraphAuthorityTier]([ID]);
    
    NULL keeps existing edge semantics untouched (Weight stays strictly for graph traversal relevance, not authority rank). PostgreSQL migration counterpart is generated on release per MJ's schema workflow.
  • Seed global GraphEdgeType AuthoritativeFor (InverseName: 'HasAuthoritySource', IsDirected: true, AllowStored: true, DefaultWeight: 1.0).
  • Seed MJ: Graph Edge Type Endpoints for AuthoritativeFor pinned strictly to canonical ISA parent entity names (avoiding ISA child EntityID drift across host apps, since GraphEngine keys nodes by <EntityID>|<RecordID> per GraphEngine.ts#L1401-L1417):
    • SourceEntity: 'MJ: Content Sources', 'MJ: Content Items'
    • TargetEntity: 'MJ: Graph Concepts'
  • Keep SourcedFrom exclusively for provenance and #6724 (5c) visibility; never overload it for authority overrides.
2. Governance, Decisions 2/3/6 & GraphEngine Caching
  • MJGraphEdgeEntityServer: Add 'AuthorityTierID' to CONTENT_FIELDS (MJGraphEdgeEntityServer.server.ts#L505) so editing AuthorityTierID on an Approved edge triggers ContentChanged (#L568) and requires Graph: Approve Edges / #6723 (5b) per-graph Approve.
  • GraphEngine cache projection: Include AuthorityTierID in STORED_EDGE_FIELDS (GraphEngine.ts#L103-L121) and project AuthorityTierID plus resolved tier Name and Rank (via GraphEngine.Instance.AuthorityTiers) onto GraphEdgeView (GraphEngine.ts#L849-L904).
  • Decisions 3 & 6 (#6675):
    • Steward-created AuthoritativeFor edges set Origin = 'Declared' and follow Decision 2 (#6723 5b Approve gating).
    • Any future automated or feedback-driven proposer creates edges with Origin = 'Inferred', Status = 'Proposed', DryRun = true by default, and skips any (GraphID, AuthoritativeFor, SourceEntityID, SourceRecordID, TargetEntityID, TargetRecordID) pair that already exists in any Status (Proposed, Approved, or Rejected) so rejected or declared overrides are never duplicated or overwritten.
3. Interaction with #6724 (5c) Visibility & Org-Only Source RLS
  • 0-SourcedFrom concepts: GraphConcept currently has no Origin column (V202611022300...sql#L211-L234), and #6724 (5c) defaults concepts with zero SourcedFrom edges to StewardsOnly. Consequently, a steward-authored concept created solely as an AuthoritativeFor target would not be visible to non-steward callers unless paired with at least one readable SourcedFrom edge or handled by an explicit human-origin visibility rule in #6724 (5c).
  • Host entitlement gating: In deployments where 'MJ: Content Sources' RLS is org-scoped rather than role/entitlement-scoped, authority resolution runs only on hits that have already passed host scoped search and entitlement hydration, and #6724 (5c) visibility checks must honor host entitlement boundaries before surfacing concept metadata.
4. Concept & Override Resolution Contract
  • Concept resolution (replacing raw Token-only triggers from #6667):
    • Path A (Chunk-to-Concept): For surviving retrieved chunks, traverse inbound SourcedFrom edges (ContentItemChunk / ContentItem -> GraphConcept) and climb ParentID / Broader Than hierarchy edges within visible (#6723 5b + #6724 5c) concepts.
    • Path B (Query-to-Concept): Match the query/sub-query against visible concepts using strict Exact or Mention classification only (CanonGraphEngine.ts#L75-L90, #L800-L837)—suppressing weak Token-only matches until Backlog item 1 concept vectorization lands.
  • Tier precedence for (ContentItemID, ContentSourceID) on a matched concept:
    Concept <- ContentItem (AuthoritativeFor, Approved) > Concept <- ContentSource (AuthoritativeFor, Approved) > ContentSource default AuthorityTier.
  • Compound / multi-concept queries: Never collapse multiple matched concepts to max(rank) across a whole query (which cancels opposite overrides like Rulebook > Website on Scoring vs Website > Rulebook on Deadlines). Resolve overrides per retrieved passage (RecordID|ChunkID) or per decomposed retrieval sub-request, keeping baseline relevance when opposing concepts co-occur in one undivided request and qualifying composer provenance by concept (e.g., Authority: Board Policy (for Competition Scoring)).
5. Open Questions for Dec 3 Review
  1. 0-SourcedFrom human concepts (#6724 5c coordination): Should steward-authored concepts used for AuthoritativeFor always be paired with a readable SourcedFrom source/item anchor, or should GraphConcept add an Origin (Declared | Inferred) / explicit audience visibility mechanism?
  2. Hierarchy tie-breaking: When a query matches both a parent concept and a child concept (ParentID / Broader Than) that have conflicting AuthoritativeFor tiers for the same source/item, should nearest-concept-hop (most specific concept) win over highest tier rank?
Lingua principale
TSQL
Stelle
32
Fork
7
Merge medio
1g 16h
PR unite (30g)
504

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MemberJunction/MJ

Tutte le issue di MemberJunction/MJ

Issue simili

Altre issue su Security

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.