Skip to content

gh simulator (2/3): the write paths #87

Closed

Description

@glennfaison

Category: feature
Area: Evaluation (tests/)
Impact: Skills mostly act by writing: labels, comments, merges, PRs. Until the simulator writes, diffWorlds has nothing to judge.
Confidence: traced

Part 2 of 3 of #60. Next: #88.

Problem (the use case)

With only the read paths (#86), a run cannot change the world, so there is nothing for diffWorlds to turn into effects.

Proposed solution

Add the write paths, each changing the world file in place (atomically) and logging the call:

  • issue: edit (--add-label, --remove-label, --body-file), close (--reason, --comment), create (--title, --body, --body-file, --label), comment (--body, --body-file), reopen.
  • pr: edit (labels, --add-reviewer), create (--base, --title, --body, --head), comment, merge (--match-head-commit, --squash|--merge|--rebase, --delete-branch).
  • label create (--color, --description, --force).
  • A write the world cannot take fails as gh fails: a label that does not exist, an unknown item, a merge pinned to a head that is not the head.
  • A comment's <!-- agent:... --> marker is stored as the scenario's marker, so diffWorlds(before, after) gives the effects the checker takes.
  • Refuse to write into a scenario file.

Acceptance criteria

  • Every write above changes the world as gh would, and the change shows in the next read.
  • diffWorlds(before, after) of a run made only of these calls round-trips through applyEffects.
  • A wrong call (unknown label, wrong pinned head) exits non-zero and leaves the world unchanged.
  • A claim and a release through lib.sh leave the world as the golden scenarios say.

Non-goals

api (#88). Merge queues, branch protection, review state.

Blocked by: #86

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions