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

Abierto
#6,757 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
sql, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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?
Lenguaje dominante
TSQL
Estrellas
32
Forks
7
Merge medio
1 d 16 h
PR fusionados (30 d)
504

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MemberJunction/MJ

Todos los issues de MemberJunction/MJ

Issues similares

Más issues de Security

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.