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

Aperta
#6,837 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à
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

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.

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

Descrizione

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

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.