@floh-solutions/pharos-cli 0.24.0 → 0.25.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.
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC;AACzB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC;AAC7B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC;AAC5B,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAuB9B;;;;;;GAMG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,IAAI,CAAY;IAChB,QAAQ,CAAW;IACnB,MAAM,CAA0B;IAEzC;;;;;;OAMG;IACM,OAAO,GAAG,IAAI,CAAC;IAExB,YACE,OAAe,EACf,IAAe,EACf,QAAkB,EAClB,SAAkC,EAAE;QAEpC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF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
27
  export declare class Session {
28
28
  #private;
29
- readonly client: AdoClient;
30
- readonly wiki: WikiApi;
31
29
  readonly budget: WriteBudget;
32
30
  readonly apply: boolean;
33
31
  readonly previewOnly: boolean;
@@ -41,6 +39,31 @@ export declare class Session {
41
39
  */
42
40
  readonly halfLinks: HalfLinkJournal;
43
41
  constructor(options: SessionOptions);
42
+ /**
43
+ * The Azure DevOps client — **resolved on first use, not in the constructor.**
44
+ *
45
+ * It was built eagerly, and that made `ADO_PAT` the price of entry to the
46
+ * whole CLI: `pharos comment list contoso/widgets#45` reads a GitHub issue
47
+ * through `gh-core` with the `gh` credential and never touches Azure DevOps,
48
+ * and it answered `{"kind":"config","message":"ADO_PAT is not set…"}` (#839).
49
+ * Somebody with `gh` signed in and no Azure DevOps PAT — a state
50
+ * `pharos doctor` reports as fine, and which the separate Keychain entries
51
+ * exist to make possible — could not use a single GitHub verb.
52
+ *
53
+ * {@link github} was made lazy for exactly this reason (#782) and this half
54
+ * was not. The fix belongs here rather than in the `comment` dispatch: any
55
+ * verb family that grows a GitHub target inherits it, and a special case in
56
+ * one command is a special case the next one has to remember.
57
+ *
58
+ * **Resolution failure is deferred, never softened.** The `AdoConfigError`
59
+ * still names the missing variable and still exits 2 — it arrives when
60
+ * something actually needs Azure DevOps, which is where it is an answer
61
+ * rather than an obstacle. See {@link approve} for the one place that
62
+ * ordering has to be forced.
63
+ */
64
+ get client(): AdoClient;
65
+ /** The wiki API, over {@link client}'s transport — and lazy for its sake. */
66
+ get wiki(): WikiApi;
44
67
  /**
45
68
  * The GitHub client, resolved once, from `~/.config/pharos/repos.json`.
46
69
  *
@@ -103,6 +126,16 @@ export interface DestructiveAction {
103
126
  what: string;
104
127
  /** The structured version, emitted either way so a preview is machine-readable. */
105
128
  would: Record<string, unknown>;
129
+ /**
130
+ * Which platform is about to be written to. Defaults to `"ado"`.
131
+ *
132
+ * It exists so {@link approve} can put the two refusals in the right order —
133
+ * see its doc. Azure DevOps is the default because it is what all but one of
134
+ * the destructive verbs here write to, and because the failure mode of
135
+ * forgetting the flag is loud (a GitHub-only verb starts demanding a PAT,
136
+ * which is #839 and has a test) rather than silent.
137
+ */
138
+ platform?: "ado" | "github" | undefined;
106
139
  }
107
140
  /**
108
141
  * The gate in front of anything that destroys or overwrites.
@@ -121,6 +154,22 @@ export interface DestructiveAction {
121
154
  * is how a half-finished job gets reported as done (`docs/pharos-cli-plan.md`
122
155
  * §2.5). `--dry-run` exits 0 because there the preview IS the deliverable.
123
156
  *
157
+ * ## The credential is checked before the gate, and that ordering is the point
158
+ *
159
+ * {@link Session.client} resolves on first use (#839), and every arm below
160
+ * runs *before* the verb touches it. So on a machine with no `ADO_PAT`,
161
+ * `pharos comment delete 210 5` would answer "Refusing to delete comment 5 on
162
+ * #210 without --yes" — a refusal that invites a retry with `--yes` which then
163
+ * fails on the credential anyway. Two refusals, the useful one second.
164
+ *
165
+ * Touching the client here puts the credential failure back in front, exactly
166
+ * where it was when the client was eager. A `--dry-run` preview of an Azure
167
+ * DevOps write is refused for the same reason: a preview of something this
168
+ * machine cannot do is a preview of nothing.
169
+ *
170
+ * A GitHub action says so and is exempt — that is the whole bug this ordering
171
+ * has to avoid recreating.
172
+ *
124
173
  * @returns `undefined` to proceed with the write, or the exit code to return.
125
174
  */
126
175
  export declare function approve(io: Io, session: Session, action: DestructiveAction): ExitCode | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAsC,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,aAAa,CAAC;AAEzF;;;GAGG;AA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;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,GAAG,QAAQ,GAAG,SAAS,CAejG"}
package/dist/session.js CHANGED
@@ -3,8 +3,6 @@ import { WriteBudget } from "./budget.js";
3
3
  import { HalfLinkJournal } from "./half-link.js";
4
4
  import { EXIT_OK, emit, refusal, usageError } from "./output.js";
5
5
  export class Session {
6
- client;
7
- wiki;
8
6
  budget;
9
7
  apply;
10
8
  previewOnly;
@@ -18,7 +16,11 @@ export class Session {
18
16
  */
19
17
  halfLinks;
20
18
  #env;
19
+ #organization;
20
+ #project;
21
21
  #wikiHint;
22
+ #client;
23
+ #wikiApi;
22
24
  #resolvedWiki;
23
25
  #github;
24
26
  constructor(options) {
@@ -27,18 +29,48 @@ export class Session {
27
29
  this.previewOnly = options.previewOnly;
28
30
  this.pretty = options.pretty;
29
31
  this.#env = options.env;
32
+ this.#organization = options.organization;
33
+ this.#project = options.project;
30
34
  this.#wikiHint = options.wiki;
35
+ this.#client = options.client;
31
36
  this.#github = options.github;
32
37
  this.halfLinks = new HalfLinkJournal(options.env);
33
- this.client =
34
- options.client
35
- ?? AdoClient.fromEnv(options.env, {
36
- ...(options.organization === undefined ? {} : { organization: options.organization }),
37
- ...(options.project === undefined ? {} : { project: options.project }),
38
- // Every write goes through here, whoever issued it.
39
- fetch: options.budget.wrap((input, init) => globalThis.fetch(input, init)),
40
- });
41
- this.wiki = new WikiApi(this.client.http);
38
+ }
39
+ /**
40
+ * The Azure DevOps client — **resolved on first use, not in the constructor.**
41
+ *
42
+ * It was built eagerly, and that made `ADO_PAT` the price of entry to the
43
+ * whole CLI: `pharos comment list contoso/widgets#45` reads a GitHub issue
44
+ * through `gh-core` with the `gh` credential and never touches Azure DevOps,
45
+ * and it answered `{"kind":"config","message":"ADO_PAT is not set…"}` (#839).
46
+ * Somebody with `gh` signed in and no Azure DevOps PAT — a state
47
+ * `pharos doctor` reports as fine, and which the separate Keychain entries
48
+ * exist to make possible — could not use a single GitHub verb.
49
+ *
50
+ * {@link github} was made lazy for exactly this reason (#782) and this half
51
+ * was not. The fix belongs here rather than in the `comment` dispatch: any
52
+ * verb family that grows a GitHub target inherits it, and a special case in
53
+ * one command is a special case the next one has to remember.
54
+ *
55
+ * **Resolution failure is deferred, never softened.** The `AdoConfigError`
56
+ * still names the missing variable and still exits 2 — it arrives when
57
+ * something actually needs Azure DevOps, which is where it is an answer
58
+ * rather than an obstacle. See {@link approve} for the one place that
59
+ * ordering has to be forced.
60
+ */
61
+ get client() {
62
+ this.#client ??= AdoClient.fromEnv(this.#env, {
63
+ ...(this.#organization === undefined ? {} : { organization: this.#organization }),
64
+ ...(this.#project === undefined ? {} : { project: this.#project }),
65
+ // Every write goes through here, whoever issued it.
66
+ fetch: this.budget.wrap((input, init) => globalThis.fetch(input, init)),
67
+ });
68
+ return this.#client;
69
+ }
70
+ /** The wiki API, over {@link client}'s transport — and lazy for its sake. */
71
+ get wiki() {
72
+ this.#wikiApi ??= new WikiApi(this.client.http);
73
+ return this.#wikiApi;
42
74
  }
43
75
  /**
44
76
  * The GitHub client, resolved once, from `~/.config/pharos/repos.json`.
@@ -166,9 +198,28 @@ export class Session {
166
198
  * is how a half-finished job gets reported as done (`docs/pharos-cli-plan.md`
167
199
  * §2.5). `--dry-run` exits 0 because there the preview IS the deliverable.
168
200
  *
201
+ * ## The credential is checked before the gate, and that ordering is the point
202
+ *
203
+ * {@link Session.client} resolves on first use (#839), and every arm below
204
+ * runs *before* the verb touches it. So on a machine with no `ADO_PAT`,
205
+ * `pharos comment delete 210 5` would answer "Refusing to delete comment 5 on
206
+ * #210 without --yes" — a refusal that invites a retry with `--yes` which then
207
+ * fails on the credential anyway. Two refusals, the useful one second.
208
+ *
209
+ * Touching the client here puts the credential failure back in front, exactly
210
+ * where it was when the client was eager. A `--dry-run` preview of an Azure
211
+ * DevOps write is refused for the same reason: a preview of something this
212
+ * machine cannot do is a preview of nothing.
213
+ *
214
+ * A GitHub action says so and is exempt — that is the whole bug this ordering
215
+ * has to avoid recreating.
216
+ *
169
217
  * @returns `undefined` to proceed with the write, or the exit code to return.
170
218
  */
171
219
  export function approve(io, session, action) {
220
+ // Raises `AdoConfigError` naming the missing variable, or does nothing.
221
+ if (action.platform !== "github")
222
+ void session.client;
172
223
  if (session.previewOnly) {
173
224
  emit(io, { applied: false, dryRun: true, ...action.would });
174
225
  return EXIT_OK;
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAgB,MAAM,0BAA0B,CAAC;AAG5E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAA0B,MAAM,aAAa,CAAC;AAyBzF,MAAM,OAAO,OAAO;IACT,MAAM,CAAY;IAClB,IAAI,CAAU;IACd,MAAM,CAAc;IACpB,KAAK,CAAU;IACf,WAAW,CAAU;IACrB,MAAM,CAAU;IACzB;;;;;;OAMG;IACM,SAAS,CAAkB;IAE3B,IAAI,CAAoB;IACxB,SAAS,CAAqB;IACvC,aAAa,CAAsB;IACnC,OAAO,CAA2B;IAElC,YAAY,OAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;QAC9B,I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AK,CAAC,MAAM,yDAAyD,EACzF,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CACpD,CAAC;IACJ,CAAC;CACF;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,OAAO,CAAC,EAAM,EAAE,OAAgB,EAAE,MAAyB;IACzE,wEAAwE;IACxE,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ;QAAE,KAAK,OAAO,CAAC,MAAM,CAAC;IAEtD,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;QACxB,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5D,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,OAAO,CAAC,eAAe,MAAM,CAAC,IAAI,sCAAsC,EAAE;YAC9E,GAAG,MAAM,CAAC,KAAK;YACf,IAAI,EAAE,8EAA8E;SACrF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
package/dist/target.d.ts CHANGED
@@ -1,9 +1,11 @@
1
+ import { type IssueCoordinate } from "@floh-solutions/gh-core";
1
2
  /**
2
- * What a comment verb is addressing: a work item, or a wiki page.
3
+ * What a comment verb is addressing: a work item, a wiki page, or a GitHub
4
+ * issue.
3
5
  *
4
- * The two comment surfaces are different APIs with different quirks, but from
5
- * where an agent stands they are one idea — "the discussion about this thing" —
6
- * so `pharos comment` takes either and the target says which.
6
+ * Three comment surfaces, three APIs with different quirks, but from where an
7
+ * agent stands they are one idea — "the discussion about this thing" — so
8
+ * `pharos comment` takes any of them and the target says which.
7
9
  *
8
10
  * **The rule is that a wiki page is an absolute path, and that is not a
9
11
  * convention invented here.** The Azure DevOps wiki API answers 404 for a page
@@ -12,6 +14,20 @@
12
14
  * spelling that disambiguates is also the only spelling that works, and a
13
15
  * target that omits it is rejected with the reason rather than quietly fixed —
14
16
  * somebody passing `Plans/Foo` has a bug somewhere upstream worth finding.
17
+ *
18
+ * **A GitHub issue is `owner/name#45`** — the form plan §8 already chose for
19
+ * `pharos issue`, so one spelling addresses an issue everywhere in this CLI.
20
+ * The three grammars cannot collide: a work item is all digits, a wiki page
21
+ * opens with `/`, and a repository name may contain neither a `#` nor a second
22
+ * `/`. `gh-core` owns the parse (it also accepts `owner/name/45` and a full
23
+ * issue URL, because all three get pasted), so there is no second grammar here.
24
+ *
25
+ * **A GitHub target carries no account, deliberately.** The account is resolved
26
+ * from `repos.json` at the point of use — plan §2's whole finding is that
27
+ * letting anything else decide returns a cheerful 200 from the wrong
28
+ * repository. A `Target` is what the caller *said*; the binding is what this
29
+ * machine is configured to do about it, and conflating them is how the wrong
30
+ * one gets used.
15
31
  */
16
32
  export type Target = {
17
33
  kind: "workItem";
@@ -19,7 +35,27 @@ export type Target = {
19
35
  } | {
20
36
  kind: "wikiPage";
21
37
  path: string;
38
+ } | {
39
+ kind: "githubIssue";
40
+ issue: IssueCoordinate;
22
41
  };
42
+ /**
43
+ * The two Azure DevOps surfaces, as their own type.
44
+ *
45
+ * Named rather than left implicit because the arms that handle them are written
46
+ * as "work item, else wiki page" — which was total when there were two kinds
47
+ * and silently stopped being when GitHub arrived. Taking this type makes the
48
+ * compiler carry that guarantee instead of a reader having to.
49
+ */
50
+ export type AdoTarget = Extract<Target, {
51
+ kind: "workItem";
52
+ } | {
53
+ kind: "wikiPage";
54
+ }>;
55
+ /** A GitHub issue target, for the arms that only accept one. */
56
+ export type GitHubTarget = Extract<Target, {
57
+ kind: "githubIssue";
58
+ }>;
23
59
  export declare function parseTarget(raw: string): Target;
24
60
  export declare function describeTarget(target: Target): string;
25
61
  //# sourceMappingURL=target.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAsB/C;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAIrF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,eAAe,CAAA;CAAE,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,CAAC;AAErF,gEAAgE;AAChE,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAEpE,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAyB/C;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CASrD"}
package/dist/target.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { parseIssueCoordinate } from "@floh-solutions/gh-core";
1
2
  import { usageError } from "./output.js";
2
3
  export function parseTarget(raw) {
3
4
  const value = raw.trim();
@@ -13,11 +14,21 @@ export function parseTarget(raw) {
13
14
  }
14
15
  return { kind: "wikiPage", path: value };
15
16
  }
17
+ const issue = parseIssueCoordinate(value);
18
+ if (issue !== undefined)
19
+ return { kind: "githubIssue", issue };
16
20
  throw usageError(`Cannot tell what "${raw}" is. A work item is its number (210); a wiki page is an absolute `
17
- + `path (/Plans/Foo). The leading slash is required by the wiki API itself, not by this tool `
18
- + `— it answers 404 without one.`, { target: raw });
21
+ + `path (/Plans/Foo); a GitHub issue is owner/name#45. The leading slash on a wiki page is `
22
+ + `required by the wiki API itself, not by this tool — it answers 404 without one.`, { target: raw });
19
23
  }
20
24
  export function describeTarget(target) {
21
- return target.kind === "workItem" ? `#${target.id}` : target.path;
25
+ switch (target.kind) {
26
+ case "workItem":
27
+ return `#${target.id}`;
28
+ case "wikiPage":
29
+ return target.path;
30
+ case "githubIssue":
31
+ return `${target.issue.repo}#${target.issue.number}`;
32
+ }
22
33
  }
23
34
  //# sourceMappingURL=target.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"target.js","sourceRoot":"","sources":["../src/target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAqBzC,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAEzB,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,EAAE,IAAI,CAAC;YAAE,MAAM,UAAU,CAAC,IAAI,GAAG,0BAA0B,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QAClF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE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AC,EAAE,CAAC;QAC1B,IAAI,KAAK,KAAK,GAAG,EAAE,CAAC;YAClB,MAAM,UAAU,CAAC,8CAA8C,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAC3C,CAAC;IAED,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAE/D,MAAM,UAAU,CACd,qBAAqB,GAAG,oEAAoE;UACxF,0FAA0F;UAC1F,iFAAiF,EACrF,EAAE,MAAM,EAAE,GAAG,EAAE,CAChB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,UAAU;YACb,OAAO,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACzB,KAAK,UAAU;YACb,OAAO,MAAM,CAAC,IAAI,CAAC;QACrB,KAAK,aAAa;YAChB,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACzD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floh-solutions/pharos-cli",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Azure DevOps from a headless shell, for an agent: the whole context of a task in one call, and the wiki/comment verbs Microsoft's MCP server does not ship.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "FLOH Solutions",
@@ -24,9 +24,9 @@
24
24
  "node": ">=22"
25
25
  },
26
26
  "dependencies": {
27
+ "@floh-solutions/ado-core": "0.9.1",
27
28
  "@floh-solutions/plan-to-board": "0.1.1",
28
- "@floh-solutions/gh-core": "0.1.0",
29
- "@floh-solutions/ado-core": "0.9.1"
29
+ "@floh-solutions/gh-core": "0.2.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.10.2",
package/skill/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pharos
3
- description: "Use for AZURE DEVOPS work — when the user says Azure DevOps, ADO or dev.azure.com, or names an ADO work item by number (\"pick up 4821\", \"what's on 210\"). Covers reading or updating an ADO work item, ticket, bug, story or epic; the ADO board, backlog, sprint or iteration; what is assigned to you in Azure DevOps; reading or writing an ADO project wiki page and its comments; linking a plan to an epic; attaching a file to a work item or taking one off; inline images in a description, comment or wiki page; @mentioning somebody so they are actually notified; importing Markdown, Word or PDF files as wiki pages; and whether a failed ADO call is worth retrying. ALSO the GITHUB ISSUE ↔ work item EDGE: adopting an issue as a work item linked at both ends, bulk-adopting a repo, one reply reaching the reporter and the board at once, where they have drifted, and closing both ends together. NOT a GitHub CLI: listing, viewing or commenting on an issue is `gh`'s job. NOT for other trackers — the Argus board, Jira or Linear."
3
+ description: "Use for AZURE DEVOPS work — when the user says Azure DevOps, ADO or dev.azure.com, or names an ADO work item by number (\"pick up 4821\", \"what's on 210\"). Covers reading or updating an ADO work item, ticket, bug, story or epic; the ADO board, backlog, sprint or iteration; what is assigned to you; reading or writing an ADO wiki page and its comments; linking a plan to an epic; attaching a file to a work item or taking one off; inline images in a field or wiki page; @mentioning somebody so they are notified; importing Markdown, Word or PDF as wiki pages; and whether a failed call is retryable. ALSO the GITHUB ISSUE ↔ work item EDGE: adopting an issue as a work item linked at both ends, bulk-adopting a repo, one reply reaching reporter and board, where they have drifted, closing both ends together, and changing a comment that ALREADY EXISTS: editing, deleting, reacting, hiding, pinning. NOT a GitHub CLI: listing or viewing an issue, or POSTING a comment, is `gh`'s job. NOT for other trackers — Argus, Jira, Linear."
4
4
  license: Proprietary
5
5
  ---
6
6
 
@@ -59,8 +59,16 @@ wiki image <file> a picture for a PAGE or page comment. Different
59
59
  wiki import <file...> .md .txt .docx .pdf .rtf .html -> pages. A
60
60
  .pptx is refused, on purpose — see below
61
61
  --under <path> --as <name>
62
- comment list | add | edit | delete <target> is a work item id OR a wiki path
63
- comment react | unreact | reactors like dislike heart hooray smile confused
62
+ comment list | add | edit | delete <target> is a work item id, a wiki path,
63
+ comment react | unreact | reactors OR a GitHub issue (contoso/widgets#45)
64
+ comment hide | unhide | pin | unpin GITHUB ONLY — Azure DevOps has neither
65
+ REACTIONS ARE NOT ONE VOCABULARY. Azure DevOps:
66
+ like dislike heart hooray smile confused. GitHub:
67
+ thumbs-up thumbs-down laugh hooray confused heart
68
+ rocket eyes. Passing one platform's name to the
69
+ other is refused, not translated
70
+ `comment add` is REFUSED on a GitHub issue — see
71
+ "Editing a GitHub comment" below
64
72
  issue adopt <owner/name#45> a GitHub ISSUE becomes a work item, with BOTH
65
73
  ends of the link written. --type --title --parent
66
74
  issue link <owner/name#45> <id> join an existing pair — or finish a join that
@@ -76,6 +84,11 @@ issue backfill <owner/name> bulk adopt every issue the board does not link
76
84
  yet. Needs --yes. --limit --state --label
77
85
  issue close <id|owner/name#45> close BOTH ends, then RE-READ both to say what
78
86
  actually moved. --to --reason --all
87
+ issue edit <owner/name#45> the issue's OWN fields, behind a lost-update
88
+ guard. Needs --yes. --title --text/--file/--stdin
89
+ --milestone --add-label --remove-label
90
+ --add-assignee --remove-assignee --if-title
91
+ --if-body. `gh issue edit` is the UNGUARDED one
79
92
  hooks list | check | create | repoint | delete service hooks for realtime.
80
93
  `check` needs --hub <url>; `list` shows the URL
81
94
  already in use
@@ -632,6 +645,25 @@ plainly commenting on an issue is `gh`'s job and `gh` is better at it; closing
632
645
  one *end* is `gh issue close`. Pharos owns the one thing `gh` cannot see: which
633
646
  work item tracks this issue, written so it survives in both databases.
634
647
 
648
+ The one place that line moved: **a comment that already exists** is reachable
649
+ through `pharos comment <verb> <owner/name#45>` — edit, delete, react, unreact,
650
+ reactors, hide, unhide, pin, unpin. Two reasons, and neither is symmetry for its
651
+ own sake. Editing or deleting one can destroy the link record, so it needs the
652
+ guard below rather than a bare `gh api`. And hiding or pinning has **no
653
+ first-class `gh` verb at all** — they are GraphQL mutations with no REST route,
654
+ which is the "nothing else can do this" test the rest of these verbs pass.
655
+ Posting a *new* comment is still not ours.
656
+
657
+ The second place it moved, and it is the only verb here that overlaps `gh` head
658
+ on: **`pharos issue edit` exists to REFUSE.** `gh issue edit` does the same
659
+ write and does it well — what it cannot do is notice that somebody changed the
660
+ thing you were overwriting. It reads nothing and compares nothing, so if a
661
+ colleague renamed the issue while you were composing, their rename is gone and
662
+ neither of you is told. That is fine for a human at a terminal and wrong for an
663
+ agent, which reads an issue, spends a minute thinking, and writes back into a
664
+ world that moved. **If you want an unguarded edit, use `gh issue edit` — it is
665
+ right there and it is better at it.**
666
+
635
667
  Azure DevOps has its own GitHub integration and **the link it makes carries
636
668
  nothing** — title, body, comments, labels and state stay on their own island,
637
669
  and the transition only ever fires from a commit or a PR merge, never from
@@ -645,8 +677,52 @@ pharos issue say contoso/widgets#45 --file reply.md
645
677
  pharos issue drift # where the two disagree
646
678
  pharos issue backfill contoso/widgets --limit 25 --yes
647
679
  pharos issue close 4821 --text "Shipped in 1.4.0."
680
+ pharos issue edit contoso/widgets#45 --title "Crash on resize" --yes
648
681
  ```
649
682
 
683
+ ### Editing an issue, and the guard GitHub does not give us
684
+
685
+ **There is no conditional write.** `PATCH /repos/{o}/{r}/issues/{n}` answers
686
+ **400** to `If-Match` — measured, not assumed — so the `{"op":"test","path":
687
+ "/rev"}` guarantee behind every Azure DevOps patch has no GitHub equivalent.
688
+ Never send `If-Match` here yourself either: it is not inert, it fails the write,
689
+ and the 400 reads like a malformed body.
690
+
691
+ **And do not guard on `updated_at` or the ETag.** Both move when somebody merely
692
+ *comments* on the issue, so a guard keyed on either refuses a good edit for a
693
+ change that touched nothing — it fires on the case that is *not* a collision.
694
+
695
+ So the guard compares the **value of the field you are overwriting**: re-read
696
+ immediately before sending, and refuse only if that text moved. A comment cannot
697
+ cause it, which is what makes the refusal worth reading.
698
+
699
+ | you pass | the base is | what it protects |
700
+ |---|---|---|
701
+ | nothing | this command's own read | one round trip. Honest, and small |
702
+ | `--if-title` / `--if-body` / `--if-body-file` | what **you** saw | the whole gap between your read and your write |
703
+
704
+ Pass `--if-*` whenever you read the issue and then thought about it — that gap is
705
+ where a collision actually happens. The output says which window it guarded, as
706
+ `fields.guard.window`: `in-command` or `caller`.
707
+
708
+ A refusal is `kind: "conflict"`, exit **1**, and carries `conflicts` (base,
709
+ remote and proposed for each field) plus `attribution` naming who renamed it.
710
+ Re-read, fold their change into yours, edit again with `--if-title` set to what
711
+ you just read. **It is not atomic and nothing client-side can make it so** — it
712
+ narrows the race to one round trip rather than closing it.
713
+
714
+ Two things GitHub does *quietly*, which this verb reports and a bare `gh api`
715
+ would not:
716
+
717
+ | endpoint | the silence |
718
+ |---|---|
719
+ | `POST …/labels` | **creates** a repository label that does not exist — 200, grey, permanent, spelled exactly as you typed it. So an unknown label is REFUSED with the near misses named; `--create-label` is how you mean it |
720
+ | `POST …/assignees` | **ignores** a login it will not assign and still answers 201. Read `assignees.ignored` — a status code is not the answer here |
721
+
722
+ Labels and assignees go through those add/remove endpoints and never through the
723
+ whole-issue PATCH, which carries them as *whole arrays* — one label write would
724
+ otherwise blindly overwrite every label on the issue.
725
+
650
726
  ### Bind the repository first, or none of this runs
651
727
 
652
728
  ```bash
@@ -829,6 +905,71 @@ something none of this models. `close` does not compose `Closes #45` /
829
905
  `Fixes AB#123` into a PR body either: those fire on a PR *merge*, so there would
830
906
  be nothing to compose into and nothing to verify.
831
907
 
908
+ ### Editing a GitHub comment, and the trailer you must not break
909
+
910
+ A comment that already exists is `pharos comment`, with the issue as the target.
911
+ The verb set is the one you already know from work items and wiki pages:
912
+
913
+ ```bash
914
+ pharos comment list contoso/widgets#45 # ids, state, and what you MAY do
915
+ pharos comment edit contoso/widgets#45 900 --file fixed.md
916
+ pharos comment delete contoso/widgets#45 900 --yes
917
+ pharos comment react contoso/widgets#45 900 thumbs-up
918
+ pharos comment hide contoso/widgets#45 900 off-topic
919
+ pharos comment pin contoso/widgets#45 900
920
+ ```
921
+
922
+ **Start with `list`.** It is the only way to learn a comment id, and it also
923
+ answers the question that saves a failed write: every row carries a `may` object
924
+ — `edit`, `delete`, `hide`, `pin`, `react` — read from GitHub's own view of what
925
+ this account may do. A comment you may not edit is `"edit": false` before you
926
+ try, not a 403 afterwards. Each row also carries `pharosAuthored` and
927
+ `workItemId`, so you can see at a glance which comment is the link.
928
+
929
+ Two ids come back per comment and **both are printed because neither can be
930
+ derived from the other**: `id` is the number that edit, delete and reactions
931
+ address, `nodeId` is what hide and pin take. Either is accepted anywhere a
932
+ comment is named; passing back the one the verb wants saves a request.
933
+
934
+ **An edit cannot double or strip the `pharos:v1` trailer, and this is enforced
935
+ rather than requested.** That trailer is the durable record of which work item
936
+ tracks this issue *and* the guard that stops the two platforms summarising each
937
+ other's summaries. So:
938
+
939
+ | what you send | what happens |
940
+ |---|---|
941
+ | new prose, no trailer | the existing trailer is **restored**, and `markerPreserved: true` says so |
942
+ | the body you read back, trailer intact | sent unchanged |
943
+ | two trailers | refused — `doubled` |
944
+ | a trailer naming a different work item | refused — `repointed`; `pharos issue link` is the verb for that |
945
+ | a trailer on a comment that had none | refused — `forged` |
946
+
947
+ You do not have to think about any of this: hand over the words you want and the
948
+ record survives. It is written down because the refusals name a reason, and the
949
+ reason is actionable.
950
+
951
+ **Deleting the comment that carries the trailer destroys the GitHub half of the
952
+ link.** It is allowed — a mis-adoption is a real thing — but the `--yes` refusal
953
+ says so first, names the work item, and gives you the `pharos issue link` command
954
+ that puts it back. Under `--dry-run` you get the same preview and exit 0. A
955
+ delete that finds the comment already gone reports `alreadyGone: true` and
956
+ succeeds, so a retry after a lost reply is safe.
957
+
958
+ **`hide` and `pin` exist on GitHub and nowhere else** — they are GraphQL
959
+ mutations with no REST route, which is why `gh` has no verb for them. Hiding
960
+ needs a classifier and there is no neutral default, because GitHub shows it
961
+ beside the hidden comment: `spam`, `abuse`, `off-topic`, `outdated`,
962
+ `duplicate`, `resolved`, `low-quality`. Ask for `off-topic` and `off-topic` is
963
+ what reads back. On a work item or a wiki page these four verbs are refused with
964
+ "Azure DevOps has neither" rather than as an unknown verb — there is no endpoint
965
+ to go looking for.
966
+
967
+ **`pharos comment add` is refused on a GitHub issue.** Posting is already
968
+ covered twice and which one you want depends on whether the board should hear:
969
+ `pharos issue say` writes to the reporter *and* the work item, `gh issue comment`
970
+ writes to GitHub only. A third door here would post on an adopted issue that the
971
+ work item never hears about — the exact asymmetry `say` exists to prevent.
972
+
832
973
  ## What `pharos` does NOT do — read this before you go looking
833
974
 
834
975
  - **Free-text and code search.** Nothing here covers it. For work items,
@@ -839,10 +980,12 @@ be nothing to compose into and nothing to verify.
839
980
  - **Wiki content search.** `wiki tree` then `wiki read` is the only way through;
840
981
  there is no grep across pages.
841
982
  - Pull requests, builds, pipelines.
842
- - **Anything on GitHub that is not the join.** No issue list, no issue view, no
843
- plain comment, no labels or milestones, no pull requests — `gh` does all of it
844
- better and a second GitHub CLI would only drift from it. The seven `issue`
845
- verbs are the edge and deliberately nothing else.
983
+ - **Almost anything on GitHub that is not the join.** No issue list, no issue
984
+ view, no *posting* a comment, no labels or milestones, no pull requests — `gh`
985
+ does all of it better and a second GitHub CLI would only drift from it. The
986
+ seven `issue` verbs are the edge. The one addition is a comment that already
987
+ exists (`pharos comment <verb> <owner/name#45>`): editing or deleting one can
988
+ break the link record, and hiding or pinning has no `gh` verb at all.
846
989
  - **Jira, Linear, and the Argus board.** Not covered, not planned. "Task",
847
990
  "todo" and "board" mean something else there.
848
991
 
@@ -1072,3 +1215,12 @@ an `issue` verb names `repos.json` rather than an environment variable.
1072
1215
  ```bash
1073
1216
  pharos setup --repo contoso/widgets --gh-account alisina-tibata
1074
1217
  ```
1218
+
1219
+ **A verb whose target is a GitHub issue does not need `ADO_PAT` at all.**
1220
+ `pharos comment list|edit|delete|react|unreact|reactors|hide|unhide|pin|unpin
1221
+ <owner/name#n>` runs on `gh`'s credential alone, on a machine that has never had
1222
+ an Azure DevOps token. So a `config` error naming `ADO_PAT` from one of those is
1223
+ a defect worth reporting, not something to go and provision a token over. The
1224
+ two credentials are independent — separate keychain entries, and `pharos doctor`
1225
+ reports them separately — and `pharos issue` is the one family that genuinely
1226
+ needs both, because it writes to both platforms in one invocation.