Skip to content

scripts/rule_manifest.py apply stores a "name" param; a non-DCA rule named "dca" would read "no stop by design" #974

Closed

Description

@eaitbrahim

Found while reviewing PR #972 (round 5, held). Outside that PR's diff.

#961 (PR #972) judges a live tranche with no bracket as "no stop by design" when its positions.rule_name names a kind whose class declares places_bracket = False (only Dca). rule_name is rule.name. Every shipped writer of rules keeps name out of the stored params: seed stores describe()["params"], and keel rules add (and dca plan, through it) refuses a name param. Both are pinned by test_every_kind_is_named_its_kind_and_stores_no_name_param and test_add_rule_row_refuses_a_name_param_and_writes_no_row.

scripts/rule_manifest.py apply (not in the wheel) writes manifest params as given. A manifest that put "name": "dca" on a turtle rule would store a turtle named dca. Its tranches would then read "no stop by design" instead of WARN "NO bracket", which is the one direction that hides a missing bracket.

Fix, either:

  • have apply refuse a name param (the same dropped-param refusal add_rule_row uses); or
  • key the verdict off rules.kind through positions.rule_id where one is present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions