Fbe::Conclude#follow allows _id, even though every new fact in the FBE factbase receives its own _id automatically. Following a source fact's _id then appends that old identifier to the new fact's already assigned identifier, violating the one-ID rule and aborting the transaction.
Steps to reproduce:
- Put a fact with an
_id and a what value in the factbase.
- Run
Fbe.conclude with a matching on query, follow '_id', and a draw block that creates a normal result.
Actual result: follow accepts _id, then fill copies it with fact.public_send(:_id=, v). Fbe.fb assigns a new _id when the result fact is inserted, so the copy makes that fact contain two _id values. The configured unique-ID rule raises ArgumentError and the conclusion rolls back instead of producing the result.
Expected result: reject _id in follow with an actionable Fbe::Error, like the existing checks for what and details, or explicitly exclude system identity fields from copying.
Technical evidence: lib/fbe/conclude.rb rejects only what and details in follow, and fill copies every listed property. lib/fbe/fb.rb assigns a fresh _id on insertion, while the FBE Factbase is wrapped in Factbase::Rules with uid: '_id', which rejects a fact containing more than one _id.
Fbe::Conclude#followallows_id, even though every new fact in the FBE factbase receives its own_idautomatically. Following a source fact's_idthen appends that old identifier to the new fact's already assigned identifier, violating the one-ID rule and aborting the transaction.Steps to reproduce:
_idand awhatvalue in the factbase.Fbe.concludewith a matchingonquery,follow '_id', and adrawblock that creates a normal result.Actual result:
followaccepts_id, thenfillcopies it withfact.public_send(:_id=, v).Fbe.fbassigns a new_idwhen the result fact is inserted, so the copy makes that fact contain two_idvalues. The configured unique-ID rule raisesArgumentErrorand the conclusion rolls back instead of producing the result.Expected result: reject
_idinfollowwith an actionableFbe::Error, like the existing checks forwhatanddetails, or explicitly exclude system identity fields from copying.Technical evidence:
lib/fbe/conclude.rbrejects onlywhatanddetailsinfollow, andfillcopies every listed property.lib/fbe/fb.rbassigns a fresh_idon insertion, while the FBE Factbase is wrapped inFactbase::Ruleswithuid: '_id', which rejects a fact containing more than one_id.