Picolab / pico-engine

An implementation of the pico-engine hosted on node.js
http://picolabs.io/
MIT License
43 stars 8 forks source link

Testing tab failure to thrive #568

Closed b1conrad closed 3 years ago

b1conrad commented 3 years ago

I added a global function to a ruleset with its name added to the shares statement in the meta section.

Flushing the ruleset and visiting the Testing tab and the function does not show up on the Testing tab. Need a second pair of eyes on this, and or figure out how it is getting missed.

b1conrad commented 3 years ago

Tried isolating the function in a ruleset. The function was copied from the original ruleset to eliminate the possibility of some obscure compiler error.

ruleset surrogate {
  meta {
    use module io.picolabs.pds alias pds
    shares surrogate
  }
  global {
    surrogate = function(){
      stuff_names = [
        "Last Name",
        "Work Email",
        "F/T-P/T Status",
      ]
      stuff = stuff_names.map(function(n){
        pds:getData("person",n)
      }).join(":")
      stuff
    }
  }
}

and this works fine.

However, I need it not in a separate ruleset, but in the ruleset which is already installed in every person pico.

b1conrad commented 3 years ago

Looked at the compile code of the ruleset, and everything looks fine, including the __testing map.

So, this must be a UI issue. Maybe something about the name surrogate?

b1conrad commented 3 years ago

No, how could it be a UI issue when it appears fine in a smaller ruleset?

Remains a mystery. I will try changing the name. And that worked.

Leaving this open in case someone wants a mystery to look into...

b1conrad commented 3 years ago

It has happened again. See these commits:

  1. add a function and a rule to a preexisting ruleset (commit)
  2. flush the ruleset in the pico where it is already installed
  3. neither the function nor the rule appear in the Testing tab! Further: the rule doesn't select.
  4. try moving the function to a different place (commit)
  5. try a modification which couldn't actually have helped (commit) because the rule had never selected
  6. try relaxing what is needed for the rule to be selected (commit)

None of the experiments changed what showed in the Testing tab!

Working hypothesis is to look at step 2. What if I try deleting and then installing the ruleset again in the pico? It could be a difference between ruleset install and ruleset flush.

This is a serious problem because it interrupts the development cycle and draws attention away from what is being worked on to why the pico isn't behaving differently (i.e. has a different Testing tab) when a change is made to a ruleset.

b1conrad commented 3 years ago

Found the problem. The first commit added a dependency on a module which the pico did not have installed. So, flushing didn't actually change the ruleset in the pico, although it did report a new hash.

b1conrad commented 3 years ago

It would be helpful to programmers if the error was reported in the UI. Open issue #569 for this purpose.