Skip to content

AFK: Extend approve-rule for re-approval, one branch per rule #64

Description

@WilcoFiers

Parent

#60

Type

AFK for the script. W3C write tokens remain HITL (tracked on the epic). Changelog text is not this ticket — that is #73.

What to build

Today CG approve-rule.mjs writes index.md via rule-transform without --proposed, then asserts the rule is absent from rule-versions.yml. That is first-time approval only. The CG / WAI readme already asks for a change list on updates, but the workflow only takes ruleId and branch.

Extend the same script for re-approval of a rule that already has index.md:

  • Copy current index.md to {previousIsoDate}.md
  • Write new index.md with ruleTransform (proposed: false)
  • Update rule-versions.yml: new index.md row with changes: from an explicit input; previous index row becomes the dated file
  • Keep examples.json approved: true
  • One git branch per rule (no batching several rules onto one branch)

Changelog input: required for updates, omitted for first-time approval. Accept repeated --change "…" flags and/or a small YAML file. A workflow_dispatch text box is a poor authoring surface; the skill in #73 (or a person) writes the list, then this script consumes it.

Do not fill changes: from classifier git subjects. Those are board raw material; the published WAI bullets are a confirmed, user-facing list (see existing rule-versions.yml entries). Refuse a re-approval with an empty changelog.

Do not open the GitHub PR in this ticket unless that is the cheapest way to verify; opening PRs is #67. The intended human/agent front-end is #73.

Acceptance criteria

  • First-time approval still works when the rule is not yet in rule-versions.yml with an index.md (no changes: required)
  • Re-approval archives the old snapshot and records the supplied change list
  • Re-approval with an empty changelog fails
  • Still one rule per branch
  • Tests or a dry-run fixture cover both first-time and update paths

Blocked by

Nothing in this epic. Classifier JSON (#62) is already on main; it is useful context for #73, not an input to this script.

Unblocks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions