Uncommited changes with MAAPI

module example-module {
  yang-version 1.1;
  namespace "urn:example:module";
  prefix example;

  container policies {
    list policy {
      key "policy-name";
      leaf policy-name {
        type string;
      }
      container queue-size {
        leaf min {
          type uint32;
        }
        leaf max {
          type uint32;
        }
        tailf:validate vp {
          tailf:dependency ".";
        }
      }
    }

    list policy-state {
      key "policy-name";
      leaf policy-name {
        type string;
      }
      leaf config {
        type boolean;
      }
      container queue-size {
        leaf min {
          type uint32;
        }
        leaf max {
          type uint32;
        }
        tailf:validate vp {
          tailf:dependency ".";
        }
      }
    }
  }
}

Validation Points at:

"/example:policy-state/example:queue-size/" 
  "/example:policy/example:queue-size/"

Have the same validation point "vp"

Scenario

In confd_cli, I am configuring a device according to the yang file. I have configured a policy 
named "p1", which already commited.

Then I am changing the "min" leaf  which is under the container "queue-size" (which 
has a validation point), WITHOUT commiting it.

In this UNCOMMITED change I tried to perform a maapi_exists on the uncommitted change using,
      
    (1) confd_cmd -e -c 'mexists /example:policies{policy_name}/example:queue-size/
    
    or 
    
    (2) confd_cmd -e -c 'cdb_exists /example:policies{policy_name}/example:queue-size/

Note that in (2) the command return 0, which is the expected value regarding that the change in no commited.
On the other hand, in (1) I am using confd_lib_maapi api (mexists), which in my case returned 0 for the uncommited change, which was not what I expected.

Is this UNCOMMITED change going to be written in the candidate database of ConfD?
Is the candidate database meant to be used in such way? And thus, will I be able to observe the UNCOMMITED (and yet unvalidated) change, by using maapi functions?

After issuing the commit and before its completion, the validation callback is running. 
In the validation callback I want to be able to access the uncommited changes in order to validate those before the commited is completed.
To do so, I assumed that confd_lib_maapi would be the only choice, knowing that confd_lib_cdb calls can not show uncommited values. 
Having said that, 

Is maapi_exists() intended to provide with the uncommited changes, or shall we retrieve those using the newval and keypath (argument of the validate() cb)?
Knowing that policy-state subtree, which contains operational data, should the new value be printable (through confd_cmd) only after the commit succeeds?

I am facing a similar problem. In a validation callback I need to retrieve the uncommitted values. Since the validation callback is not a leaf node, I need to use a maapi cursor to go get the values. While I can see the values correctly in the running db, there is actually nothing gotten from the candidate db.

Did you ever resolve this problem?

You need to use MAAPI attach() to attach to the transaction and retrieve the uncommitted values. Search the ConfD example set for ‘attach(’ and see the ConfD UG section “Validating Data in C” for examples.