[Canon] 5a follow-ups: govern Concept.Origin; evidence retraction can strand edgeless approved concepts

Abierto
#6,837 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
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Start with CONCEPT_GOVERNED_FIELDS in packages/MJCoreEntitiesServer/src/custom/MJGraphConceptEntityServer.server.ts and the dirty-column check in that entity's save path, then read the concept-approval gate it consults. For item 2, read removeConcept in packages/ContentPipeline/engine/src/GraphEvidenceRetractor.ts alongside the gate that accepts GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION versus the one that only accepts GRAPH_PIPELINE_EDGE_APPROVAL_OPERATION. Item 1 is done when a test fails for an ungoverned dirty column; item 2 waits on Robert's choice between (a), (b) and (c) before a test can assert no edgeless concept survives a source-document delete.

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

Descripción

canon

Follow-ups from @rkihm-BC's approval of MJ #6731 (workstream 5a, merged 2026-11-22 as 23055e7cd). Both come from #6762 and #6731 meeting on next. Each pull request was correct on its own. Workstream 5 of the Canon master plan covers this; owner cmbrock-BC.

Both problems, checked against next at 0d1950895:

1. Origin is not governed on approved concepts

CONCEPT_GOVERNED_FIELDS in packages/MJCoreEntitiesServer/src/custom/MJGraphConceptEntityServer.server.ts lists GraphID, ParentID, Name, ConceptTypeID, AuthorityTierID, Description, Specification and Synonyms. #6762 added GraphConcept.Origin (person-entered or machine-generated), and it isn't on that list. On an Approved or Deprecated concept, anyone can therefore change Origin without Graph: Approve Edges. Robert confirmed this with a test. Canon concepts are not affected; concepts in other graph types are.

Fix: invert the rule so it fails closed: every dirty column except Status (and the system columns) is governed. A column added later is then protected without anyone remembering to list it. The smaller fix is to add Origin to the list. Either way, add a test that fails when a new column on the entity isn't governed.

2. Evidence retraction can strand edgeless concepts

GraphEvidenceRetractor.removeConcept (packages/ContentPipeline/engine/src/GraphEvidenceRetractor.ts) deletes the concept's remaining Inferred edges and then calls concept.Delete(). MJGraphConceptEntityServer.Delete() refuses to delete an Approved or Deprecated concept without Graph: Approve Edges. The retractor runs inside GRAPH_PIPELINE_EVIDENCE_RETRACTION_OPERATION, which the edge gate recognises and the concept gate doesn't, since the concept gate only checks GRAPH_PIPELINE_EDGE_APPROVAL_OPERATION.

So when a document is deleted, an orphaned concept that the pipeline auto-approved loses its edges, its delete is refused, and only a LogError records it. The concept is left with no edges, and no later retraction will find it, because retraction starts from edges. This affects non-Canon graphs that auto-approve.

Fix options, for Robert to choose:

  • (a) Let the concept gate accept the retraction scope for a delete of a pipeline-originated concept (Origin = 'Inferred' once item 1 governs Origin).
  • (b) Check that the concept can be deleted before deleting its edges, and skip both when it can't, so the concept keeps its edges.
  • (c) Both.

Whichever is chosen, add a test that deletes a source document whose only concept is pipeline-approved, and asserts that no edgeless concept remains.

Scope

Item 1 finishes 5a and is small. Item 2 is a defect in code that has already merged. The master plan treats both as named exceptions to the Dec 1 freeze, subject to Robert's ruling.


Generated by Claude Code

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.