ticket-runner 0.6.3 → 0.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +4 -4
- package/README.md +3 -3
- package/docs/templates/operator-skill.md +7 -7
- package/package.json +1 -1
- package/src/acceptance-criteria.ts +2 -2
- package/src/adapters/claude-agent-runner.ts +49 -5
- package/src/adapters/exec.ts +19 -4
- package/src/adapters/gh-tracker.ts +17 -17
- package/src/adapters/git-workspace.ts +12 -8
- package/src/adapters/liveness.ts +77 -0
- package/src/adapters/process-tree.ts +4 -7
- package/src/adapters/version.ts +5 -5
- package/src/branch.ts +1 -1
- package/src/cli.ts +2 -2
- package/src/config.ts +7 -6
- package/src/conventions.ts +23 -20
- package/src/credential.ts +92 -7
- package/src/criteria.ts +107 -15
- package/src/failing-base.ts +7 -7
- package/src/failure-message.ts +72 -0
- package/src/guards.ts +2 -2
- package/src/handoff.ts +2 -2
- package/src/init.ts +8 -8
- package/src/landing.ts +1 -1
- package/src/lifecycle.ts +2 -2
- package/src/lock.ts +10 -2
- package/src/note-schema.ts +3 -3
- package/src/notes.ts +8 -6
- package/src/operator-skill.ts +2 -2
- package/src/orchestrator.ts +194 -144
- package/src/ports/agent-runner.ts +21 -1
- package/src/ports/tracker.ts +14 -13
- package/src/ports/workspace.ts +23 -22
- package/src/progress.ts +2 -2
- package/src/prompts.ts +74 -25
- package/src/readiness.ts +11 -11
- package/src/remove.ts +7 -7
- package/src/resume.ts +12 -12
- package/src/run-log.ts +5 -5
- package/src/run.ts +72 -10
- package/src/staleness.ts +14 -14
- package/src/start.ts +20 -15
- package/src/stranded.ts +19 -19
- package/src/templates.ts +191 -73
- package/src/timer.ts +25 -0
- package/src/title.ts +45 -9
- package/src/verdict.ts +7 -7
- package/src/version-number.ts +13 -13
- package/src/version-pr.ts +12 -12
package/src/version-number.ts
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Arithmetic on
|
|
3
|
-
* or a
|
|
2
|
+
* Arithmetic on version numbers: which of two is higher, and which number a tag
|
|
3
|
+
* or a version string carries.
|
|
4
4
|
*
|
|
5
5
|
* Three readers share it and would otherwise each have a comparison of their
|
|
6
|
-
* own: the check on a
|
|
6
|
+
* own: the check on a release PR, the notice a Run prints when a newer version
|
|
7
7
|
* has been published, and the mark a Target's conventions document bears
|
|
8
8
|
* (ADR-0007). Nothing here reads a file or asks GitHub — a number against a
|
|
9
|
-
* number — so the one thing every
|
|
9
|
+
* number — so the one thing every version question turns on is proved once.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
/** A number on its own: the three parts every
|
|
12
|
+
/** A number on its own: the three parts every version tag is cut at. */
|
|
13
13
|
const NUMBER = /^\d+\.\d+\.\d+$/;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* The number a
|
|
16
|
+
* The number a version string reports, without the commit a development
|
|
17
17
|
* checkout adds: `0.4.0+331d79c.dirty` is `0.4.0`.
|
|
18
18
|
*
|
|
19
19
|
* Undefined where the string carries no number at all, which is what a copy
|
|
20
20
|
* with no package to read calls itself. Comparing by number is what lets a
|
|
21
|
-
* checkout running a commit past the latest
|
|
22
|
-
* than as stale: between two
|
|
21
|
+
* checkout running a commit past the latest version count as current rather
|
|
22
|
+
* than as stale: between two versions the commit says nothing either way.
|
|
23
23
|
*/
|
|
24
24
|
export function versionNumber(version: string): string | undefined {
|
|
25
25
|
const [number = ""] = version.split("+");
|
|
26
26
|
return NUMBER.test(number) ? number : undefined;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/** The number a
|
|
29
|
+
/** The number a version tag names: `v0.4.0` is `0.4.0`, and nothing else is one. */
|
|
30
30
|
export function tagNumber(tag: string): string | undefined {
|
|
31
31
|
return tag.startsWith("v") ? versionNumber(tag.slice(1)) : undefined;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
/** A
|
|
34
|
+
/** A version tag, in both halves its readers want: `v0.4.0` and `0.4.0`. */
|
|
35
35
|
export interface VersionTag {
|
|
36
36
|
tag: string;
|
|
37
37
|
number: string;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
|
-
* The highest
|
|
42
|
-
* is no
|
|
41
|
+
* The highest version among tags shaped `v<x.y.z>`, and undefined where there
|
|
42
|
+
* is no version tag at all — the first version, which nothing can be measured
|
|
43
43
|
* against.
|
|
44
44
|
*
|
|
45
45
|
* Every other tag is ignored rather than refused: a repository is free to tag
|
|
46
|
-
* whatever else it likes, and only the
|
|
46
|
+
* whatever else it likes, and only the versions say what has been cut. The tag
|
|
47
47
|
* comes back beside its number because a message names the tag as it was cut
|
|
48
48
|
* and the comparison is on the number.
|
|
49
49
|
*/
|
package/src/version-pr.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What a
|
|
2
|
+
* What a release PR has to get right, and what its merge publishes.
|
|
3
3
|
*
|
|
4
|
-
* A
|
|
5
|
-
* up, `CHANGELOG.md` gains that
|
|
4
|
+
* A version is cut by merging a release PR: the number in `package.json` goes
|
|
5
|
+
* up, `CHANGELOG.md` gains that version's section, and the push to `main`
|
|
6
6
|
* creates the tag and a GitHub Release whose body is that section (ADR-0007).
|
|
7
7
|
* The check on the pull request and the workflow that publishes read the same
|
|
8
8
|
* changelog, so they are written together here: a check that found a section
|
|
9
|
-
* the extraction then missed would tag a
|
|
9
|
+
* the extraction then missed would tag a version and publish nothing, which is
|
|
10
10
|
* the one failure neither half can see on its own.
|
|
11
11
|
*
|
|
12
12
|
* Both functions are pure. Everything they judge — the two numbers, the tags,
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
import { highestVersion, isHigher } from "./version-number.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* The one heading every
|
|
20
|
+
* The one heading every version's notes carry, whatever they group the rest by.
|
|
21
21
|
* What a Target or its human has to do after upgrading is the thing a reader of
|
|
22
22
|
* this tool cannot get anywhere else, so its absence is a refusal.
|
|
23
23
|
*/
|
|
24
24
|
const AFTER_UPGRADING = "### After upgrading";
|
|
25
25
|
|
|
26
|
-
/** A pull request, in the five things a
|
|
26
|
+
/** A pull request, in the five things a release PR is judged by. */
|
|
27
27
|
export interface VersionPr {
|
|
28
28
|
/** The number in `package.json` on the head. */
|
|
29
29
|
number: string;
|
|
@@ -31,7 +31,7 @@ export interface VersionPr {
|
|
|
31
31
|
baseNumber: string;
|
|
32
32
|
/** The number in the lock file on the head. */
|
|
33
33
|
lockNumber: string;
|
|
34
|
-
/** Every tag the repository has,
|
|
34
|
+
/** Every tag the repository has, version tags and anything else. */
|
|
35
35
|
tags: string[];
|
|
36
36
|
/** `CHANGELOG.md` on the head, empty where the head has none. */
|
|
37
37
|
changelog: string;
|
|
@@ -41,11 +41,11 @@ export interface VersionPr {
|
|
|
41
41
|
* Every reason this pull request may not merge, in the order a reader meets
|
|
42
42
|
* them, and empty where it may.
|
|
43
43
|
*
|
|
44
|
-
* All of them at once rather than the first: the human fixing a
|
|
44
|
+
* All of them at once rather than the first: the human fixing a release PR is
|
|
45
45
|
* running the check through a pull request, and one refusal per push would cost
|
|
46
46
|
* a round trip each.
|
|
47
47
|
*
|
|
48
|
-
* A number equal to the base branch's is not a
|
|
48
|
+
* A number equal to the base branch's is not a release PR at all, so nothing
|
|
49
49
|
* else is looked at. That is every Ticket's pull request, which passes this
|
|
50
50
|
* check without being written for it.
|
|
51
51
|
*/
|
|
@@ -56,7 +56,7 @@ export function versionPrRefusals(pr: VersionPr): string[] {
|
|
|
56
56
|
const highest = highestVersion(pr.tags);
|
|
57
57
|
if (highest !== undefined && !isHigher(pr.number, highest.number)) {
|
|
58
58
|
refusals.push(
|
|
59
|
-
`\`${pr.number}\` is not higher than every
|
|
59
|
+
`\`${pr.number}\` is not higher than every version tag; \`${highest.tag}\` exists.`,
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
if (pr.lockNumber !== pr.number) {
|
|
@@ -75,12 +75,12 @@ export function versionPrRefusals(pr: VersionPr): string[] {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* The
|
|
78
|
+
* The release notes for `number`: its section of the changelog, without the
|
|
79
79
|
* `## ` heading the number is written in, and undefined where the changelog has
|
|
80
80
|
* no section for it.
|
|
81
81
|
*
|
|
82
82
|
* Undefined is not a failure. The tag workflow falls back to GitHub's generated
|
|
83
|
-
* notes, because a
|
|
83
|
+
* notes, because a version that reached `main` is cut either way.
|
|
84
84
|
*/
|
|
85
85
|
export function versionNotes(changelog: string, number: string): string | undefined {
|
|
86
86
|
return sections(changelog).get(number)?.trim();
|