Track additional field in validation set for brief
type
#590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a column
brief_cls
toagent$validation_set
that tracks how the string values in thebrief
should be interpreted w.r.t. yaml read/write (namely, whether it had been autogenerated or not).Example:
This is achieved by formalizing an
<autobrief>
class which is attached byresolve_brief()
when forwarding togenerate_autobriefs()
. For minimal invasiveness to existing code,<autobrief>
gets a methods such that indexing a vector of autobriefs perserves the class (much like behavior of<AsIs>
). Since the class information is then immediately extracted out intobrief_cls
insidecreate_validation_step()
, this approach allows thebrief
column to retain its atomic character type.Speaking of
<AsIs>
, this is optional but I'm also testing an experimental support for verbatim yaml to be stored/round-tripped in an agent'sbrief
field. This should only requires a light extension to the infrastructure.For example, it would be nice if one could pack some metadata about a validation step into a yaml and pass it to
brief
, after marking it withI()
, like this:The intended effect would be for
brief
to have its structure restored in the yaml representation when the agent is written out. And upon being read back into R, thebrief
column values would again be transformed into its flat string representation.Related GitHub Issues and PRs
Checklist
testthat
unit tests totests/testthat
for any new functionality.