A lack of descriptive metadata currently exists in the Maniphest Transaction data for core:edge transactions. Whether a task edit transaction adds or removes a project or both, for example, is undefined. The only metadata that is currently provided is EDGECONST written as type:"41". If a single task edit includes both an add and a remove, perhaps these should be written as two separate transactions assigned with distinct metadata types. Providing the logic that compares the old value with the new and writes metadata with a unique type depending on the result should be possible.
The use case for this is to provide projects with a history of scope changes, including task adds and removes. Specifically, because a remove type core:edge transaction is very relevant to the edge (project), it may be useful to also write this event to the project transaction table. Otherwise, the project has no way to track changes of this type since the task is no longer in its scope. This would provide a limited subset of maniphest transaction data to the project.
This is the questionable code from ManiphestTaskEditController lines 284-303.
foreach ($changes as $type => $value) { $transaction = clone $template; $transaction->setTransactionType($type); if ($type == ManiphestTransaction::TYPE_PROJECT_COLUMN) { $transaction->setNewValue($value['new']); $transaction->setOldValue($value['old']); } else if ($type == PhabricatorTransactions::TYPE_EDGE) { $project_type = PhabricatorProjectObjectHasProjectEdgeType::EDGECONST; $transaction ->setMetadataValue('edge:type', $project_type) ->setNewValue( array( '=' => array_fuse($value), )); } else { $transaction->setNewValue($value); } $transactions[] = $transaction; }