@floh-solutions/pharos-cli 0.24.0 → 0.26.0

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.
Files changed (53) hide show
  1. package/README.md +97 -10
  2. package/dist/adopt-type.d.ts +58 -0
  3. package/dist/adopt-type.d.ts.map +1 -0
  4. package/dist/adopt-type.js +61 -0
  5. package/dist/adopt-type.js.map +1 -0
  6. package/dist/bridge.d.ts +156 -0
  7. package/dist/bridge.d.ts.map +1 -0
  8. package/dist/bridge.js +157 -0
  9. package/dist/bridge.js.map +1 -0
  10. package/dist/cli.d.ts +1 -1
  11. package/dist/cli.d.ts.map +1 -1
  12. package/dist/cli.js +176 -31
  13. package/dist/cli.js.map +1 -1
  14. package/dist/commands/bridge.d.ts +30 -0
  15. package/dist/commands/bridge.d.ts.map +1 -0
  16. package/dist/commands/bridge.js +255 -0
  17. package/dist/commands/bridge.js.map +1 -0
  18. package/dist/commands/comment-github.d.ts +138 -0
  19. package/dist/commands/comment-github.d.ts.map +1 -0
  20. package/dist/commands/comment-github.js +427 -0
  21. package/dist/commands/comment-github.js.map +1 -0
  22. package/dist/commands/comment.d.ts.map +1 -1
  23. package/dist/commands/comment.js +114 -19
  24. package/dist/commands/comment.js.map +1 -1
  25. package/dist/commands/doctor.d.ts +169 -0
  26. package/dist/commands/doctor.d.ts.map +1 -1
  27. package/dist/commands/doctor.js +241 -44
  28. package/dist/commands/doctor.js.map +1 -1
  29. package/dist/commands/issue.d.ts +133 -0
  30. package/dist/commands/issue.d.ts.map +1 -1
  31. package/dist/commands/issue.js +292 -110
  32. package/dist/commands/issue.js.map +1 -1
  33. package/dist/commands/setup.d.ts +45 -0
  34. package/dist/commands/setup.d.ts.map +1 -1
  35. package/dist/commands/setup.js +74 -0
  36. package/dist/commands/setup.js.map +1 -1
  37. package/dist/half-link.d.ts +14 -4
  38. package/dist/half-link.d.ts.map +1 -1
  39. package/dist/half-link.js +14 -4
  40. package/dist/half-link.js.map +1 -1
  41. package/dist/output.d.ts.map +1 -1
  42. package/dist/output.js +123 -1
  43. package/dist/output.js.map +1 -1
  44. package/dist/session.d.ts +51 -2
  45. package/dist/session.d.ts.map +1 -1
  46. package/dist/session.js +62 -11
  47. package/dist/session.js.map +1 -1
  48. package/dist/target.d.ts +40 -4
  49. package/dist/target.d.ts.map +1 -1
  50. package/dist/target.js +14 -3
  51. package/dist/target.js.map +1 -1
  52. package/package.json +4 -4
  53. package/skill/SKILL.md +167 -7
@@ -1 +1 @@
1
- {"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/commands/comment.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,UAAU,EAA0B,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,OAAO,EAAgB,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAe,MAAM,cAAc,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,SAAS,GAA+B;IAC5C,MAAM;IACN,SAAS;IACT,OAAO;IACP,QAAQ;IACR,OAAO;IACP,UAAU;CACX,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,EAAM,EACN,OAAgB,EAChB,WAA8B,EAC9B,KAAoC;IAEpC,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,UAAU,CAAC,mEAAmE,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACjC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,UAAU,CACd,iCAAiC,IAAI,oDAAoD;cACrF,oBAAoB,CACzB,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CA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M,UAAU,CACd,0FAA0F,CAC3F,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { GhAccount, GitHubClient, RepoBinding } from "@floh-solutions/gh-core";
1
2
  import { type ExitCode, type Io } from "../output.js";
2
3
  /**
3
4
  * `pharos doctor` — what is installed, what is missing, and what each missing
@@ -50,5 +51,173 @@ export interface DoctorCommandOptions {
50
51
  /** Also prove the token against Azure DevOps. Costs two requests. */
51
52
  verify: boolean;
52
53
  }
54
+ export interface Check {
55
+ id: string;
56
+ name: string;
57
+ tier: 0 | 1 | 2;
58
+ /** Plain-language: what having this gets you. Rendered as-is by a GUI. */
59
+ unlocks: string;
60
+ /** What is lost without it — never "it is broken" when it is not. */
61
+ without: string;
62
+ ok: boolean;
63
+ version: string | null;
64
+ path: string | null;
65
+ /** The command that would install it here, or null when we cannot say. */
66
+ install: string | null;
67
+ /** Set when something needs saying beyond present/absent. */
68
+ note?: string;
69
+ /**
70
+ * **`gh-auth` only: does `repos.json` list at least one binding?** (#892)
71
+ *
72
+ * `true` when it lists one or more, `false` when it lists none or does not
73
+ * exist. **Absent** on every other check, on an older CLI, and — deliberately
74
+ * — in the two states where the answer was never established: `gh` missing
75
+ * (the config is not read at all) and a `repos.json` that could not be
76
+ * parsed, where "lists none" and "lists plenty" are indistinguishable.
77
+ * Absent means *not known*, never `false`; that is the same trap `gh` sets
78
+ * with an empty `scopes` on a non-`valid` account.
79
+ *
80
+ * It exists because the app cannot get this fact any other way without
81
+ * breaking a rule. `gh-auth` is `ok: true` whenever gh holds healthy
82
+ * credentials, so on the wizard's success path the row is green and its note
83
+ * is suppressed — and the "No repository is bound yet" sentence goes with it.
84
+ * The obvious fix, rendering the note when it *contains* that sentence, is
85
+ * prose sniffing: `CommandLineTools.swift` renders a row per id and never
86
+ * reads English, precisely so that rewording a note cannot silently break a
87
+ * GUI. So the fact travels as a field.
88
+ *
89
+ * Not a check of its own, either: `gh-repo-bound` would be permanently red on
90
+ * every machine that has `gh` for ordinary git work and does not want the
91
+ * bridge, which is the red-row-nobody-reads this whole section avoids.
92
+ */
93
+ bound?: boolean;
94
+ /** Per-account detail for `gh-account`. See {@link AccountReport}. */
95
+ accounts?: AccountReport[];
96
+ /** Per-repository detail for `gh-repo-access`. See {@link RepoReport}. */
97
+ repos?: RepoReport[];
98
+ }
99
+ /**
100
+ * One configured GitHub account, and whether `gh` still holds a token for it.
101
+ *
102
+ * **`active` is reported and never acted on.** On the machine plan §2 was
103
+ * measured on, the account a project is bound to is *not* the active one, so a
104
+ * report that omitted this would be unreadable the first time it disagreed with
105
+ * what `gh auth status` prints by hand.
106
+ */
107
+ export interface AccountReport {
108
+ account: string;
109
+ ok: boolean;
110
+ /** What `gh` calls active, or null when `gh auth status` could not say. */
111
+ active: boolean | null;
112
+ detail: string;
113
+ }
114
+ /**
115
+ * One configured repository, reached **as its configured account**.
116
+ *
117
+ * `resolved` and `nodeId` are the point: a 200 proves nothing on a machine with
118
+ * two accounts, because `owner/widgets` can exist under both. What GitHub
119
+ * answered with is recorded so the mismatch is a fact rather than an inference.
120
+ */
121
+ export interface RepoReport {
122
+ repo: string;
123
+ account: string;
124
+ /**
125
+ * Access was **proven**. `false` is therefore "not proven", which is wider
126
+ * than "broken": `problem: "unreachable"` lands here having judged nothing.
127
+ * Anything rendering this must read `problem` before drawing a failure.
128
+ */
129
+ ok: boolean;
130
+ /** Who the token turned out to belong to — `gh api user`'s login. */
131
+ viewer: string | null;
132
+ /** The `full_name` GitHub actually returned. */
133
+ resolved: string | null;
134
+ /** GitHub's node id for it: the identity that survives a rename. */
135
+ nodeId: string | null;
136
+ /**
137
+ * `gh-core`'s closed set: no-token | unauthorized | not-visible |
138
+ * wrong-repository | issues-disabled | archived | **unreachable** | unknown.
139
+ *
140
+ * `unreachable` is the one that is not a fault — no answer was obtained, so
141
+ * neither the binding nor the credential was judged. It is the `gh-auth`
142
+ * row's `unverified` in a different vocabulary, and the check stays green on
143
+ * it.
144
+ */
145
+ problem: string | null;
146
+ detail: string | null;
147
+ }
53
148
  export declare function runDoctor(io: Io, env: NodeJS.ProcessEnv, options: DoctorCommandOptions, pretty: boolean, version: string): Promise<ExitCode>;
149
+ /**
150
+ * `gh` is fine and nothing is bound — say so **as data** on the `gh-auth` row
151
+ * (#892), and name the command that fixes it **as data** too (#890).
152
+ *
153
+ * Its own function because of the one rule inside it that a test cannot reach
154
+ * through `pharos doctor`: **an existing `install` is never overwritten.** The
155
+ * state that matters is a credential GitHub has actively REFUSED — `authCheck`
156
+ * puts `gh auth login --user <login>` on the row for it — and binding a
157
+ * repository to a dead token achieves nothing, so that command outranks this
158
+ * one. Replacing it would be #886's mistake (naming the wrong command with
159
+ * confidence) committed in the row directly above #886's.
160
+ *
161
+ * Arranging a refused credential on a real machine is not something a test may
162
+ * do, so the precedence is asserted here instead, against a synthesised row.
163
+ */
164
+ export declare function markUnbound(auth: Check, configPath: string, configExists: boolean, held?: readonly GhAccount[]): void;
165
+ /** The `gh-auth` row, worded by which of the three states we are actually in. */
166
+ export declare function authCheck(base: Omit<Check, "ok" | "install">, accounts: readonly GhAccount[], accountReports: readonly AccountReport[], authFailure: string | undefined): Check;
167
+ /**
168
+ * `gh-repo-access` — **the one that a status code cannot answer.**
169
+ *
170
+ * Plan §2: with two `gh` accounts in play, `owner/widgets` can exist under both,
171
+ * so the wrong identity returns a perfectly good 200 for a different
172
+ * repository. `verifyAccess` compares the `full_name` GitHub answered with
173
+ * against what was configured; this records the account it asked as, the viewer
174
+ * that token turned out to be, and the node id — the identity that survives a
175
+ * rename — so a disagreement is a fact on the page rather than an inference.
176
+ *
177
+ * ## It is also the one row that makes real calls, so it can fail to ask (#886)
178
+ *
179
+ * This is the only GitHub row that needs the network — which means it is the
180
+ * only one that can be offline, and the first draft reported that as a fault.
181
+ * `gh-core` returned `unknown` for a dead socket, and `unknown` landed in the
182
+ * `else` below as {@link BIND_COMMAND}: **run the wizard on a plane and it told
183
+ * you to re-record a binding that was perfectly correct.**
184
+ *
185
+ * {@link authCheck} had already met this exactly one layer up and answered it —
186
+ * an `unverified` account is reported as not-a-fault and is deliberately NOT
187
+ * offered `gh auth login`, because sending somebody to re-authenticate over the
188
+ * network that is itself the problem is the original bug wearing a new hat.
189
+ * That reasoning is not about credentials specifically; it is about the
190
+ * difference between "we asked and the answer was no" and "we could not ask".
191
+ * `gh-core` now spells the second one `unreachable`, and this row treats it the
192
+ * same way `gh-auth` treats `unverified`:
193
+ *
194
+ * - the check is **green**, because nothing here is broken;
195
+ * - `install` is **null**, because no command would help — offering the wrong
196
+ * one is worse than offering none;
197
+ * - the note says *could not ask*, never *failed*.
198
+ *
199
+ * The per-repository row keeps `ok: false` with `problem: "unreachable"`, which
200
+ * is the honest pair: access was not proven, and it was not disproven either.
201
+ * A consumer rendering `repos` must branch on `problem` rather than paint every
202
+ * `ok: false` red — {@link render} below does, and the app's wizard step
203
+ * (`CommandLineStep.swift`, todo #888) has to as well.
204
+ *
205
+ * A **mixed** run still fails, and that is the point of separating them rather
206
+ * than counting: one repository unreachable and another genuinely unauthorized
207
+ * is a real fault with a real fix, and the fix is named for the fault.
208
+ */
209
+ export declare function repoAccessCheck(client: GitHubClient, bindings: readonly RepoBinding[], configPath: string): Promise<Check>;
210
+ /**
211
+ * The mark beside one repository — and there are **three** of them, not two.
212
+ *
213
+ * `ok: false` covers two different states (#886): GitHub gave a verdict and it
214
+ * was no, and nobody could be asked at all. Printing `✗` against an unreachable
215
+ * host is the same overclaim in ink that `install: BIND_COMMAND` was in JSON —
216
+ * a broken-looking line underneath a check that has just said it is fine. `?`
217
+ * is the state `gh` itself calls `unverified`.
218
+ *
219
+ * Its own function because it is the assertable half of that decision, and
220
+ * `render` is not reachable from a test without a machine in a known state.
221
+ */
222
+ export declare function repoMark(repo: Pick<RepoReport, "ok" | "problem">): "✓" | "?" | "✗";
54
223
  //# sourceMappingURL=doctor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAcA,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,cAAc,CAAC;AAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,MAAM,WAAW,oBAAoB;IACnC,qEAAqE;IACrE,MAAM,EAAE,OAAO,CAAC;CACjB;AAwOD,wBAAsB,SAAS,CAC7B,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,QAAQ,CAAC,CA8DnB"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EAEZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAkB,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,cAAc,CAAC;AAItE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,MAAM,WAAW,oBAAoB;IACnC,qEAAqE;IACrE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6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ED,iFAAiF;AACjF,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,SAAS,CAAC,EACnC,QAAQ,EAAE,SAAS,SAAS,EAAE,EAC9B,cAAc,EAAE,SAAS,aAAa,EAAE,EACxC,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,KAAK,CAuHP;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,SAAS,WAAW,EAAE,EAChC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,KAAK,CAAC,CA6FhB;AAwDD;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,SAAS,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAGlF"}
@@ -454,21 +454,39 @@ async function verifyScopes(env, configured) {
454
454
  * ## Why `gh-auth` never says "you are signed out"
455
455
  *
456
456
  * **Measured on gh 2.87.3.** `gh auth status` validates every token against
457
- * github.com. With the host unreachable it prints `X Failed to log in to
458
- * github.com account ASNNetworks` / `The token in keyring is invalid` — a
459
- * connectivity fault worded as a credential fault. `gh-core`'s parser matches
460
- * `Logged in to account …`, so {@link GhTokenSource.accounts} comes back
461
- * **empty on a machine holding two accounts** whenever the network is down.
462
- *
463
- * A check that reported that as "no accounts" would tell somebody on a plane to
464
- * run `gh auth login`, which is the one thing that cannot work there. So an
465
- * empty result is reported as the disjunction it actually is — and where a repo
466
- * is bound it is settled for free, because `gh auth token --user` reads the
467
- * keyring and is fully offline (0.043s, measured both ways). A keyring hit while
468
- * `auth status` came back empty is proof the network is the problem.
469
- *
470
- * The source fix is #793: `gh auth status --json hosts` exists in 2.87.3, always
471
- * exits zero, and carries a per-account `state`. It is not this track's file.
457
+ * github.com, and with the host unreachable it words a connectivity fault as a
458
+ * credential fault: `X Failed to log in to github.com account ASNNetworks` /
459
+ * `The token in keyring is invalid`. A check that repeated that would tell
460
+ * somebody on a plane to run `gh auth login`, which is the one thing that cannot
461
+ * work there.
462
+ *
463
+ * **#793 has since landed in `gh-core`**, and it changed the shape of the
464
+ * problem rather than removing it. `gh auth status --json hosts` lists every
465
+ * account whatever happens, each carrying a `state`:
466
+ *
467
+ * | `state` | what it means | what to tell somebody |
468
+ * |---|---|---|
469
+ * | `valid` | GitHub answered for this token | nothing |
470
+ * | `rejected` | GitHub answered **401/403** — the credential really is bad | `gh auth login --user <login>` |
471
+ * | `unverified` | nobody judged it: host unreachable, GitHub erred, or `gh` too old | check the network, **not** the credential |
472
+ *
473
+ * So the failure this section was written about — an empty list on a machine
474
+ * holding two accounts — no longer happens for an unreachable host. **The
475
+ * hazard moved**: a listed account is no longer the same thing as a working
476
+ * one, and reading `accounts.length > 0` as "signed in" now reports a token
477
+ * GitHub has actively refused as healthy. {@link authCheck} branches on `state`
478
+ * for that reason.
479
+ *
480
+ * An empty list is still possible and still a disjunction, because `gh auth
481
+ * status` reads `$XDG_CONFIG_HOME/gh/hosts.yml` while `gh auth token --user`
482
+ * reads the keyring — a moved or overridden `GH_CONFIG_DIR` empties the first
483
+ * and not the second. The keyring cross-check below stays for that case, which
484
+ * is the only one it was ever able to settle.
485
+ *
486
+ * **One trap when reading an account:** `scopes` is empty whenever `state` is
487
+ * not `valid`, because `gh` takes them off the `X-OAuth-Scopes` *response*
488
+ * header. Empty means *not known*, never "no scopes" — the same overclaim as
489
+ * the original bug, one field along. Check `state` first.
472
490
  *
473
491
  * ## What is emitted, and what is deliberately not
474
492
  *
@@ -563,14 +581,10 @@ async function githubChecks(env, gh, verify) {
563
581
  return checks;
564
582
  }
565
583
  if (bindings.length === 0) {
566
- const auth = checks[0];
567
- auth.note =
568
- `${auth.note ?? ""} No repository is bound yet — `
569
- + `${configExists ? `${configPath} lists none` : `${configPath} does not exist`}. `
570
- + `\`${BIND_COMMAND}\` binds one, and \`gh-account\` and \`gh-repo-access\` appear `
571
- + "once it does.";
584
+ markUnbound(checks[0], configPath, configExists, accounts);
572
585
  return checks;
573
586
  }
587
+ checks[0].bound = true;
574
588
  const accountsOk = accountReports.every((report) => report.ok);
575
589
  checks.push({
576
590
  id: "gh-account",
@@ -598,8 +612,60 @@ const ACCOUNT_UNLOCKS = "Every bound repository is reached as the account bound
598
612
  + "happens to have active.";
599
613
  const ACCOUNT_WITHOUT = "`pharos issue` fails on that repository with an account error rather than a GitHub outage.";
600
614
  const BIND_COMMAND = "pharos setup --repo owner/name --gh-account <login>";
615
+ /**
616
+ * `gh` is fine and nothing is bound — say so **as data** on the `gh-auth` row
617
+ * (#892), and name the command that fixes it **as data** too (#890).
618
+ *
619
+ * Its own function because of the one rule inside it that a test cannot reach
620
+ * through `pharos doctor`: **an existing `install` is never overwritten.** The
621
+ * state that matters is a credential GitHub has actively REFUSED — `authCheck`
622
+ * puts `gh auth login --user <login>` on the row for it — and binding a
623
+ * repository to a dead token achieves nothing, so that command outranks this
624
+ * one. Replacing it would be #886's mistake (naming the wrong command with
625
+ * confidence) committed in the row directly above #886's.
626
+ *
627
+ * Arranging a refused credential on a real machine is not something a test may
628
+ * do, so the precedence is asserted here instead, against a synthesised row.
629
+ */
630
+ export function markUnbound(auth, configPath, configExists, held = []) {
631
+ // **The accounts `gh` holds, as data, in the one state where nothing else
632
+ // reports them** (#889). `gh-account` carries the per-binding list, but it is
633
+ // emitted only once a repository is bound — so on an unbound machine, which is
634
+ // exactly when somebody needs to choose an account to bind AS, the app had no
635
+ // decoded list of accounts at all and could only have scraped this note.
636
+ //
637
+ // Attached here rather than on every `gh-auth` row so the wizard never draws
638
+ // the same accounts twice: once bound, `gh-account` owns that display.
639
+ if (held.length > 0) {
640
+ auth.accounts = held.map((account) => ({
641
+ account: account.login,
642
+ // Listed is not the same as working (#793): a REJECTED credential is one
643
+ // GitHub has actively refused, and binding a repository to it achieves
644
+ // nothing. The picker uses this to refuse the account rather than to hide
645
+ // it — a missing account is a question, a refused one is an answer.
646
+ ok: account.state !== "rejected",
647
+ active: account.active,
648
+ detail: account.state === "rejected"
649
+ ? `GitHub refused this credential${account.stateDetail === undefined ? "" : ` — ${account.stateDetail}`}.`
650
+ : `gh holds a token for "${account.login}".`,
651
+ }));
652
+ }
653
+ auth.note =
654
+ `${auth.note ?? ""} No repository is bound yet — `
655
+ + `${configExists ? `${configPath} lists none` : `${configPath} does not exist`}. `
656
+ + `\`${BIND_COMMAND}\` binds one, and \`gh-account\` and \`gh-repo-access\` appear `
657
+ + "once it does.";
658
+ auth.bound = false;
659
+ // The app renders `install` as a COPYABLE command wherever it shows a note,
660
+ // and it must not have to dig this out of the sentence above — that is the
661
+ // prose sniffing `bound` exists to end. No install BUTTON appears: that is
662
+ // driven by `CommandLineStep.isOffered`, which lists skill, pharos-convert,
663
+ // gh, libreoffice and pdftotext, and `gh-auth` is not among them. Signing in
664
+ // stays the user's own job (#890).
665
+ auth.install ??= BIND_COMMAND;
666
+ }
601
667
  /** The `gh-auth` row, worded by which of the three states we are actually in. */
602
- function authCheck(base, accounts, accountReports, authFailure) {
668
+ export function authCheck(base, accounts, accountReports, authFailure) {
603
669
  if (authFailure !== undefined) {
604
670
  return {
605
671
  ...base,
@@ -608,17 +674,61 @@ function authCheck(base, accounts, accountReports, authFailure) {
608
674
  note: `\`gh auth status\` could not be run: ${authFailure}`,
609
675
  };
610
676
  }
677
+ // **LISTED IS NOT THE SAME AS WORKING, since #793.** `gh auth status --json
678
+ // hosts` lists an account whatever GitHub said about it, so reading
679
+ // `accounts.length > 0` as "signed in" reports a token GitHub has actively
680
+ // refused as healthy — and offers no way to fix it. Branch on `state`.
611
681
  if (accounts.length > 0) {
612
- const listed = accounts
613
- .map((account) => `${account.login}${account.active ? " (active)" : ""}`)
614
- .join(", ");
682
+ const describe = (account) => `${account.login}${account.active ? " (active)" : ""}`;
683
+ const rejected = accounts.filter((account) => account.state === "rejected");
684
+ const unverified = accounts.filter((account) => account.state === "unverified");
685
+ // REJECTED IS THE ONE STATE THAT EARNS `gh auth login`, because it is the
686
+ // only one where GitHub itself has judged the credential. Named per account:
687
+ // re-authenticating the wrong login leaves the broken one broken.
688
+ if (rejected.length > 0) {
689
+ const reasons = rejected
690
+ .map((account) => account.stateDetail === undefined
691
+ ? describe(account)
692
+ : `${describe(account)} — ${account.stateDetail}`)
693
+ .join("; ");
694
+ return {
695
+ ...base,
696
+ ok: false,
697
+ install: `gh auth login --user ${rejected[0].login}`,
698
+ note: `GitHub REFUSED the credential for ${reasons}. This is the one case that is genuinely `
699
+ + "a credential fault — gh asked and got a 401 or 403 back, rather than failing to ask. "
700
+ + (accounts.length > rejected.length
701
+ ? `Also held: ${accounts.filter((a) => a.state !== "rejected").map(describe).join(", ")}.`
702
+ : ""),
703
+ };
704
+ }
705
+ // UNVERIFIED IS NOT A FAULT AND MUST NOT OFFER `gh auth login`. gh holds the
706
+ // token and could not get an answer about it — an unreachable host, a 5xx, a
707
+ // gh too old to say. Sending somebody to re-authenticate over the network
708
+ // that is itself the problem is the original bug wearing a new hat.
709
+ if (unverified.length > 0) {
710
+ const reasons = unverified
711
+ .map((account) => account.stateDetail === undefined
712
+ ? describe(account)
713
+ : `${describe(account)} — ${account.stateDetail}`)
714
+ .join("; ");
715
+ return {
716
+ ...base,
717
+ ok: true,
718
+ install: null,
719
+ note: `gh holds ${reasons}, but could not check it with GitHub — unreachable, erroring, or a `
720
+ + "gh too old to say which. That is NOT a credential fault and `gh auth login` is the "
721
+ + "wrong answer to it; check the connection. The token still works for anything that "
722
+ + "does not call out, because `gh auth token --user` reads the keyring offline.",
723
+ };
724
+ }
615
725
  return {
616
726
  ...base,
617
727
  ok: true,
618
728
  install: null,
619
- note: `Signed in: ${listed}. The active account is reported and never acted on — a repository `
620
- + "is reached as the account bound to it in repos.json, because on this machine's own "
621
- + "measurement the active one was the wrong one (plan §2).",
729
+ note: `Signed in: ${accounts.map(describe).join(", ")}. The active account is reported and `
730
+ + "never acted on — a repository is reached as the account bound to it in repos.json, "
731
+ + "because on this machine's own measurement the active one was the wrong one (plan §2).",
622
732
  };
623
733
  }
624
734
  // Empty. Which cause it is, we may or may not be able to say — and saying the
@@ -654,10 +764,11 @@ function authCheck(base, accounts, accountReports, authFailure) {
654
764
  ...base,
655
765
  ok: false,
656
766
  install: "gh auth login",
657
- note: "`gh auth status` listed no accounts. That is either nothing signed in OR github.com "
658
- + "unreachable, and from here the two are identical: `auth status` validates every token "
659
- + "over the network and reports an unreachable host as an invalid credential (measured, "
660
- + "gh 2.87.3). Check the connection before re-authenticating.",
767
+ note: "`gh auth status` listed no accounts at all. Since #793 an unreachable github.com no "
768
+ + "longer produces this an account gh holds is listed whatever GitHub said, as "
769
+ + "`unverified` — so the remaining causes are that nothing is signed in, or that gh is "
770
+ + "reading a different config directory than the one holding your hosts.yml (a moved or "
771
+ + "overridden GH_CONFIG_DIR / XDG_CONFIG_HOME).",
661
772
  };
662
773
  }
663
774
  /**
@@ -669,8 +780,40 @@ function authCheck(base, accounts, accountReports, authFailure) {
669
780
  * against what was configured; this records the account it asked as, the viewer
670
781
  * that token turned out to be, and the node id — the identity that survives a
671
782
  * rename — so a disagreement is a fact on the page rather than an inference.
783
+ *
784
+ * ## It is also the one row that makes real calls, so it can fail to ask (#886)
785
+ *
786
+ * This is the only GitHub row that needs the network — which means it is the
787
+ * only one that can be offline, and the first draft reported that as a fault.
788
+ * `gh-core` returned `unknown` for a dead socket, and `unknown` landed in the
789
+ * `else` below as {@link BIND_COMMAND}: **run the wizard on a plane and it told
790
+ * you to re-record a binding that was perfectly correct.**
791
+ *
792
+ * {@link authCheck} had already met this exactly one layer up and answered it —
793
+ * an `unverified` account is reported as not-a-fault and is deliberately NOT
794
+ * offered `gh auth login`, because sending somebody to re-authenticate over the
795
+ * network that is itself the problem is the original bug wearing a new hat.
796
+ * That reasoning is not about credentials specifically; it is about the
797
+ * difference between "we asked and the answer was no" and "we could not ask".
798
+ * `gh-core` now spells the second one `unreachable`, and this row treats it the
799
+ * same way `gh-auth` treats `unverified`:
800
+ *
801
+ * - the check is **green**, because nothing here is broken;
802
+ * - `install` is **null**, because no command would help — offering the wrong
803
+ * one is worse than offering none;
804
+ * - the note says *could not ask*, never *failed*.
805
+ *
806
+ * The per-repository row keeps `ok: false` with `problem: "unreachable"`, which
807
+ * is the honest pair: access was not proven, and it was not disproven either.
808
+ * A consumer rendering `repos` must branch on `problem` rather than paint every
809
+ * `ok: false` red — {@link render} below does, and the app's wizard step
810
+ * (`CommandLineStep.swift`, todo #888) has to as well.
811
+ *
812
+ * A **mixed** run still fails, and that is the point of separating them rather
813
+ * than counting: one repository unreachable and another genuinely unauthorized
814
+ * is a real fault with a real fix, and the fix is named for the fault.
672
815
  */
673
- async function repoAccessCheck(client, bindings, configPath) {
816
+ export async function repoAccessCheck(client, bindings, configPath) {
674
817
  const repos = await Promise.all(bindings.map(async (binding) => {
675
818
  const report = await client.repos.verifyAccess(binding);
676
819
  return {
@@ -685,6 +828,34 @@ async function repoAccessCheck(client, bindings, configPath) {
685
828
  };
686
829
  }));
687
830
  const failed = repos.filter((report) => !report.ok);
831
+ // **Split before counting.** `failed` mixes two different things: repositories
832
+ // GitHub gave a verdict on, and repositories nobody could reach. Only the
833
+ // first kind is a fault, only the first kind earns an `install`, and the
834
+ // second kind is the whole of #886.
835
+ //
836
+ // A RATE LIMIT joins that second kind (#894). It arrives as a 403 carrying
837
+ // rate-limit headers, so before it was classified it read as a refused
838
+ // credential and earned the bind command — #886's mistake with the budget
839
+ // instead of the network. It is worded separately because the remedy is
840
+ // different: you wait, and telling somebody to check their connection because
841
+ // GitHub is rationing them would be wrong in a new way.
842
+ const unreachable = failed.filter((report) => report.problem === "unreachable");
843
+ const limited = failed.filter((report) => report.problem === "rate-limited");
844
+ const faults = failed.filter((report) => report.problem !== "unreachable" && report.problem !== "rate-limited");
845
+ /** Everything that was not judged, for the counts the note reports. */
846
+ const unasked = unreachable.length + limited.length;
847
+ const couldNotAsk = (unreachable.length === 0
848
+ ? ""
849
+ : ` ${unreachable.length} of ${repos.length} could not be asked at all `
850
+ + `(${unreachable.map((report) => report.repo).join(", ")}) — unreachable host or `
851
+ + "GitHub erroring, which judges neither the binding nor the credential. Nothing to fix "
852
+ + "here; check the connection and run this again.")
853
+ + (limited.length === 0
854
+ ? ""
855
+ : ` ${limited.length} of ${repos.length} hit the rate limit `
856
+ + `(${limited.map((report) => report.repo).join(", ")}) — GitHub is rationing this `
857
+ + "account, which judges neither the binding nor the credential. Nothing to fix here; "
858
+ + "wait for the budget to reset and run this again.");
688
859
  return {
689
860
  id: "gh-repo-access",
690
861
  name: "Bound repositories, read as their own account",
@@ -693,25 +864,35 @@ async function repoAccessCheck(client, bindings, configPath) {
693
864
  + "returned is the owner asked for.",
694
865
  without: "A repository can 200 from the WRONG account and look fine, because two accounts can "
695
866
  + "each see one of that name. Silent, and wrong.",
696
- ok: failed.length === 0,
867
+ // An unreachable host is not a failing check. See this function's note.
868
+ ok: faults.length === 0,
697
869
  version: null,
698
870
  path: configPath,
699
871
  // The generic fix is the binding, EXCEPT where gh simply has no credential
700
872
  // for the account — pointing that at `pharos setup` would send somebody to
701
- // re-record a pair that is already right.
702
- install: failed.length === 0
873
+ // re-record a pair that is already right. Same for a repository nobody
874
+ // could reach, which is why `faults` is what is asked here and not `failed`:
875
+ // there is no command for "the network is down", and BIND_COMMAND was being
876
+ // offered as one.
877
+ install: faults.length === 0
703
878
  ? null
704
- : failed.some((report) => report.problem === "no-token")
879
+ : faults.some((report) => report.problem === "no-token")
705
880
  ? "gh auth login"
706
881
  : BIND_COMMAND,
707
882
  repos,
708
883
  // Deliberately NOT a re-listing of `repos` — that array is the detail, and
709
884
  // a note that restates it is two places to read and one place to disagree.
710
- note: (failed.length === 0
711
- ? "Every bound repository answered as the account it is bound to, and the owner "
712
- + `returned matched the owner configured (${repos.length} checked).`
713
- : `${failed.length} of ${repos.length} failed: `
714
- + `${failed.map((report) => `${report.repo} (${report.problem ?? "unknown"})`).join(", ")}.`)
885
+ note: (faults.length > 0
886
+ ? `${faults.length} of ${repos.length} failed: `
887
+ + `${faults.map((report) => `${report.repo} (${report.problem ?? "unknown"})`).join(", ")}.`
888
+ : unasked === 0
889
+ ? "Every bound repository answered as the account it is bound to, and the owner "
890
+ + `returned matched the owner configured (${repos.length} checked).`
891
+ : unasked === repos.length
892
+ ? "Nothing was proven either way — no repository could be asked."
893
+ : `${repos.length - unasked} of ${repos.length} answered as the account `
894
+ + "they are bound to, and the owner returned matched the owner configured.")
895
+ + couldNotAsk
715
896
  + " Each was reached as its configured account rather than whichever one `gh` has active;"
716
897
  + " per-repository detail, including the node id, is in `repos`.",
717
898
  };
@@ -765,6 +946,23 @@ async function exists(path) {
765
946
  return false;
766
947
  }
767
948
  }
949
+ /**
950
+ * The mark beside one repository — and there are **three** of them, not two.
951
+ *
952
+ * `ok: false` covers two different states (#886): GitHub gave a verdict and it
953
+ * was no, and nobody could be asked at all. Printing `✗` against an unreachable
954
+ * host is the same overclaim in ink that `install: BIND_COMMAND` was in JSON —
955
+ * a broken-looking line underneath a check that has just said it is fine. `?`
956
+ * is the state `gh` itself calls `unverified`.
957
+ *
958
+ * Its own function because it is the assertable half of that decision, and
959
+ * `render` is not reachable from a test without a machine in a known state.
960
+ */
961
+ export function repoMark(repo) {
962
+ if (repo.ok)
963
+ return "✓";
964
+ return repo.problem === "unreachable" ? "?" : "✗";
965
+ }
768
966
  /** The human rendering. Grouped by tier, because that is what "missing" means. */
769
967
  function render(result) {
770
968
  const lines = [];
@@ -793,8 +991,7 @@ function render(result) {
793
991
  lines.push(` ${mark} ${account.account}${active} — ${account.detail}`);
794
992
  }
795
993
  for (const repo of check.repos ?? []) {
796
- const mark = repo.ok ? "✓" : "✗";
797
- lines.push(` ${mark} ${repo.repo} as ${repo.account}`);
994
+ lines.push(` ${repoMark(repo)} ${repo.repo} as ${repo.account}`);
798
995
  if (repo.viewer !== null)
799
996
  lines.push(` token belongs to: ${repo.viewer}`);
800
997
  if (repo.resolved !== null)