Skip to content

lens_start: separate same-change check for 'already read' (T3b first item) #841

Open

Description

@scuttletoby

Follow-up from the round-2 review of #825 (Lens A R2 and Lens B R2 comments on #825). First item for T3b, before lens_start is wired to a tool.

Problem (stuck state, fails closed): lensStart.ts uses one changeOf check for two different questions:

  • round counting: the gate compares the PR's own diff;
  • "this lens already read the head": the gate needs the head to be the read commit, or that commit merged with the base and nothing else.

After an amended commit message, a rebase or a force-push of the same change, the diff is the same, so lens_start counts every lens as "already read" and starts nothing, while the gate fails. The PR is then stuck until a person acts. No unreviewed code can merge (the gate still refuses).

Fix:

  • Give lens_start a separate sameChange input for the pass check that matches the gate's own rule exactly, and keep changeOf for round counting.
  • Fix the test model of the gate in lensStart.test.ts (it shares the mistake, around line 368).
  • Add a test where the diff matches but the commits do not.

Minors from the same reviews:

  • 10-PR cap: add a test at exactly 10 PRs (> to >= stays green today).
  • When the gate already passes, a "past the round cap" refusal wrongly says a person must act.
  • The refusal message for an empty required-lenses input wrongly says the gate fails every head.
  • The restart loop for dead lens children has no cap.
  • Enforce mode can get stuck when a report reads nothing and only a non-person override covers it.
  • Two refusal messages are tested only loosely; assert the text.
  • Note that shadow mode starts extra lenses on purpose (slot and Fable cost).
  • T3b must pass in the earlier lens children and store each child's lens and PRs (long request ids are hashed and cannot be read back), with a test.

🤖 Generated with Claude Code

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions