Skip to content

fix(work, where, record): the review findings on #113, GitHub Issues as a tracker - #115

Merged
mmaclay merged 8 commits into
mainfrom
fix/59-read-route-review
Nov 7, 2026
Merged

mmaclay merged 8 commits into
mainfrom
fix/59-read-route-review

Conversation

@mmaclay

@mmaclay mmaclay commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

This fixes the review findings on #113 (PR A of #59, merged as 6b0b86b), and the two review rounds on this PR, at 4cf186d and 96481bb.

Three of the #113 findings put the wrong ticket number on real branches and pull requests:

  • where.sh read release/1.2.0 as issue 1 and 2026-11-06-cleanup as issue 2026.
  • --ticket 7 failed under a recorded GH-\d+ pattern.
  • Ticket: none — split from #68 was recorded as ticket 68, on Jira as well as on GitHub.

The rest cover an issue tracker kept in another repository, where an issue's number can match a pull request's number here.

Changes

  • hooks/where.sh, on a GitHub tracker.
    • A branch's number must be followed by -, _ or the end of the name, but not by -NN-NN. So release/1.2.0, 2fa-support, 123abc, 2026-11-06-cleanup, feature/2026-11-06 and 59.x name no issue.
    • hotfix/3 names issue 3. This is deliberate: a number as the whole last part of the name is how feature/59-style issue branches are written, and the session-start line shows #3, so a misread is visible at once.
    • --ticket <n> takes the bare number as well as a key in the pattern.
  • scripts/profile.sh. The defaults are read once, even when --defaults is refused.
  • The Ticket: line, one rule. record.py and next_phase.py both read it through profile.py's ticket_named.
    • A value that starts with the word none, in any case, is none. none-of-the-above and NONE-12 are not.
    • Otherwise the first key anywhere in the line counts, as it did on main: in a link, a URL or emphasis.
    • On a GitHub tracker the key is the tracker's issue: a github.com issues URL (www. allowed, no other host), <owner/repo>#<n>, or #<n>. With issue_tracker.location set to another repository, the issue is that repository's, <location>#<n>, and a bare #<n> counts only when the location is this repository.
    • A key such as PROJ-7 is another tracker's only when it leads the line, after [, emphasis or a backtick. So PROJ-7 · fixes #59 is another tracker's, while the UTF-8 fix, #59 and the ISO-8601 dates, #59 give 59.
    • For a line that is another tracker's (a leading Jira key, or another repository's issue), next_phase.py refuses it in routing. record.py records none, so records of a repository's Jira-era pull requests can still be regenerated after it moves to GitHub Issues.
  • next_phase.py.
    • It reads the profile for a Ticket: line only when the line does not start with none. A refused profile is reported as the Ticket line being unreadable.
    • "This repository" is the one the origin remote names, read outside the profile's refusal. When there is no origin, the refusal says so.
    • --issue-state on a tracker that is not GitHub's, and --ticket-status on a GitHub one, exit 1 whichever row decides.
    • The first line names "pull request #N" by the row, so it still does when the pull request's number equals the issue's.
  • skills/work (1.9.1).
    • With the location in another repository, work reads a number here first and at the location second. If it is a pull request here and an issue there, work asks which is meant.
    • Row 3's pull request search sits under row 3 and runs only when row 3 matches. A closed issue reads no pull request, whatever its labels.
    • The search writes <location>#<n> whenever the location is not none, as pr-create writes the line.
  • skills/work/servers.md. The 404 example says what a 404 can mean and that work stops there.
  • skills/pr-create (3.8.1). Writes Ticket: <owner/repo>#<n> when the location is not none.
  • agents/source-reader.md. Labels come from get; get_labels is dropped. Links: comes from get_parent, called when has_parent is true.
  • docs/contracts.md.
    • "The local facts" goes to version 10.
    • "The next phase" goes to version 6, and names its dependence on origin.
    • "The record" goes to version 14, and record.py writes contract: 14.
  • Tests.
    • test_where.sh: every branch above, --ticket 7 under GH-\d+, and a real Jira-tracker standard.
    • test_record.py and test_next_phase.py:
      • every Jira and GitHub form above, on each tracker;
      • UTF-8, ISO-8601 and SHA-256 words, against PROJ-7 · fixes #59;
      • the none word boundary, www.github.com URLs, and the location matrix;
      • a refused standard under Ticket: PROJ-7, and no origin with a location set.
    • test_sandbox.py: the token search, through a fixture pull request whose body names o/r#90.

The stub against the real server

Checked read-only with issue_read (get, get_labels, get_parent) and search_pull_requests on lasp/dev-tools #114, #113 and 99999.

Left for later

  • next_phase.py takes "this repository" from origin. The full fix is a repo: line in pr-reader's state block, so the block names its own repository. That changes the state block's contract and pr-reader, so it is left out of this PR.
    • With no origin, profile.py reads no standard for the checkout at all, so the case shows up today as no GitHub tracker, not as a wrong number.

Doubts

  • A leading word that looks like a key is still read as another tracker's: ISO-8601 dates, #59 refuses, since it has the same shape as PROJ-7 · fixes #59. Only a word further in, as in the ISO-8601 dates, #59, is passed over.
  • No scenario covers a tracker in another repository, because the stub serves every repository the same fixture.

Origin: #59 (review of #113)
Sandbox: A = 6b0b86b (main); B = this branch at 96481bb unless noted. haiku, run.py --check, sandbox/tracker-github/. Closed scenarios expect no pr-reader. 994a78d changes the scripts' Ticket reading and the wording of row 3's search form only, so it was not rerun.

Scenario A B
tracker-gh-work-closed 9/10 10/10 (7/10 and 8/10 at bc9b5f8 and 4cf186d)
tracker-gh-work-closed-labeled (new, #17) — 10/10
tracker-gh-work-pr (new) 4/5 9/10 at bc9b5f8
tracker-gh-work-unlabeled — 10/10 at bc9b5f8
tracker-gh-work-labeled — 9/10 at bc9b5f8
tracker-gh-work-branch — 9/10 at bc9b5f8
  • Every failure is wording only; every run routed correctly.
  • On -pr, every run, on main and on this branch, took 15 as a pull request and never ran where.sh --ticket 15.
  • Cost: $3.94 over 105 runs.

Canary: none yet

🤖 Generated with Claude Code

mmaclay and others added 5 commits November 6, 2026 15:41
…e --ticket number

On a GitHub tracker a branch's number must be followed by `-`, `_` or the
name's end and must not be a date's year, so release/1.2.0, 2fa-support,
123abc and 2026-11-06-cleanup name no issue; hotfix/3 names issue 3.
`--ticket <n>` takes the bare number under a recorded pattern such as
GH-\d+, as work, implement-change and next_phase.py pass it.
profile.sh reads the defaults once even when --defaults is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… by one rule

profile.py's ticket_named is the one reading of a body's Ticket: line for
record.py and next_phase.py: the key the value starts with, so
`none — split from #68` is none on every tracker. On a GitHub tracker the
issue is `#<n>`, or `<location>#<n>` when the tracker is another
repository's; another repository's issue or a key such as PROJ-9 is
refused rather than read as none. next_phase.py refuses --issue-state on
a non-GitHub tracker and --ticket-status on a GitHub one whichever row
decides, and its first line names a pull request whose number is the
issue's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acker is elsewhere

work reads a number in this repository first and at an issue tracker in
another repository second, asking when it is a pull request here and an
issue there, and says what a 404 at the location means. pr-create writes
`Ticket: <owner/repo>#<n>` for such a tracker, and work searches for that
form. source-reader reads labels from get and the parent from get_parent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t, and add tracker-gh-work-pr

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rch below the table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmaclay
mmaclay marked this pull request as ready for review November 6, 2026 23:53
mmaclay and others added 3 commits November 6, 2026 17:08
…in, none when it starts with none

Reading only at the line's start dropped keys main read: a Jira URL,
**PROJ-9**, `PROJ-9`, "see PROJ-9", and on GitHub "Fixes #59" or an issues
URL. ticket_named now takes the first key anywhere, a GitHub issues URL
included, and a value starting with `none` names none. A first key of
another tracker's form is refused in next_phase.py's routing and
recorded as none by record.py, so a repository's Jira-era pull requests
still regenerate. A bare #<n> counts when the location is this
repository. next_phase.py reads the profile for a Ticket: line only when
it does not start with none, and says the line could not be read when
the profile is refused. "The record" goes to version 14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a closed issue

The closed scenarios now expect no pr-reader, and a closed issue still
labeled `in progress`, #17, gets its own scenario. The stub's token
search is tested through a pull request whose body names o/r#90.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… only where it leads the line

On a GitHub tracker, `the UTF-8 fix, #59` and `the ISO-8601 dates, #59`
named no ticket, since any capitalised hyphen-number word read as a Jira
key. A key such as PROJ-7 is another tracker's only when it leads the
value, after `[`, emphasis or a backtick, so `PROJ-7 · fixes #59` still
refuses. `none` is a word of its own: `none-of-the-above` and `NONE-12`
are not it. www.github.com issue URLs are read. next_phase.py reads this
repository from the origin remote outside the profile's refusal, names
that dependency, and says when there is no origin. work's pull request
search writes `<location>#<n>` whenever the location is not none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mmaclay
mmaclay merged commit a773a69 into main Nov 7, 2026
1 check passed
@mmaclay
mmaclay deleted the fix/59-read-route-review branch November 7, 2026 05:34
mmaclay added a commit that referenced this pull request Nov 7, 2026
"The next phase" keeps #115's version 6 and this branch's unfiled line as
version 7. The pack keeps both sets of scenarios, every work scenario removes
the writes file, and the WORK set gains tracker-gh-work-pr and
tracker-gh-work-closed-labeled. The stub's docstring lists get_label and
get_parent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant