Skip to content

Review rules TS copy: follow-ups from the #781 reviews (Unicode drift, one-side cases, LensPost input) #799

Open

Description

@scuttletoby

Follow-up from the reviews of #781 (review rules row T2b: the TypeScript copy of the gate's comment rules). The fix round fixed the blocking and major items, the TS time bound, the &# crash and the note on how vectors are made. These minors are left for here. None of them can loosen the gate today, because Python decides and the TS copy is not used yet. They matter before row T5 relies on the TS copy.

Reviews: lens A and lens B.

  1. Unicode version drift (lens A, minor 2). Node ships a newer Unicode than the runner's Python 3.12 (Unicode 15.0). Code points assigned after 15.0 read differently in \w, digits, NFKC and lowercase, in both directions. For example, Ᲊ just before major: is a finding in Python but not in TS. Fix: refuse such code points, or pin both sides to one Unicode version, and add a vector.
  2. plan.ts reads only ASCII digits in a status (lens A, minor 3). Python's isdigit also takes ². TS is stricter, and git never writes such a status. Add a comment, or match Python.
  3. "No header" key wording (lens A, minor 4). TS now keys a NO_HEADER entry the way the gate does when the caller gives where (by <author> at <time>). Without it, TS falls back to post N. T5 should pass where and must never match on the key text.
  4. Cases on only one side (lens B, minors 5 and 6). The TS-only cases ("Python's regex and int rules", "Python's text rules") and the copied linear-time lines are second lists the gate never replays. Move them into shared vectors, for example a python-text group and a linear section that both sides time. Also add the named group to test_each_rule_keeps_its_vectors's counts.
  5. LensPost is thinner than what the gate reads (lens B, minor 8). It has no "flags unread" state (the gate's FLAGS_UNREAD: a review whose includesCreatedEdit/isMinimized were not read). The newest post is taken by list order, while the gate picks by (createdAt, index) across comments, reviews and inline comments. T5 must sort the posts and map the flags. Alternatively, take when and an unread flag now and add scan vectors with reviews and out-of-order posts.

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