Strategy files and fg.load
What changed
A strategy is now written as one fg.Strategy class per file, with FORGE_API = 1 at the top. Settings are declared with fg.param as class attributes, and fg.Meta names the strategy and its tags. setup(self, ctx) may raise fg.InvalidParams to reject a combination of settings.
fg.load(path) runs a file's top level, checks it and returns the checked program. A refused file raises an error whose findings list every problem with its line. Loading runs the file's top-level code, so load only code you trust.
Strategy.describe() returns the machine description of a strategy's settings: a JSON Schema with each range, group, label and help.
Was this page helpful?