Where in the database does fieldset and field instance info live? Background: I'm writing a module that will hopefully make reverse-engineering specs for site audits easier. (If you're interested, you can see the Topograph module-in-progress on my Github account.)

Basically it's a bunch of byzantine views that use custom handlers to pull things like serialized data out of the DB to display stuff like nodetype settings to the admin user.

I'm having a lot of trouble finding certain things, though. Fieldset info is a major one, as well as settings like whether the field is required. I'm not finding it in the blob of data pulled from the {field_config_instance} table (though I might be overlooking it). Can someone point me to where this info can be retrieved per nodetype/field instance?
Whether a field is required or not can vary by content type (ie, the bundle).  I am pretty sure you need to use field_info_instances($entity_type, $bundle_name).  You can then use field_info_field($field_name) on the results.  Something like:

$fields_info = field_info_instances('node', $bundle);

foreach ($fields_info as $field_name =&gt; $instance) {
  $field_info = field_info_field($field_name);
}


dpm() both the $instance and $field_info.  Everything you need should be in those two variables.  This is a snippet from a dynamic exporter I have.