@hone-ai/cli 1.38.0 → 1.38.1

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.
@@ -53,11 +53,12 @@ function isIssueShapedId(storyId) {
53
53
  /**
54
54
  * Is this a HOSTNAME we may compare against `html_url`'s host?
55
55
  *
56
- * Binding decision 2 (operator, step_1 gate of run fa6e00c4): compare hosts ONLY when the
57
- * remote's host is a dotted domain — the GitHub Enterprise case. An SSH host alias such as
58
- * `github-work` from `~/.ssh/config` is not a hostname, and treating it as one would make
59
- * every collaborator's issue untrusted for every operator who uses one. That false
60
- * fail-closed is the version of this feature that gets reverted.
56
+ * HC-GF-270's binding decision 2 (operator, step_1 gate of run fa6e00c4) compared hosts ONLY when
57
+ * the remote's host was a dotted domain, because an SSH alias such as `github-work` is not a
58
+ * hostname and comparing it would refuse every collaborator's issue for every operator who uses
59
+ * one. HC-GF-283 removes the reason for the exception: run-story now resolves an alias with
60
+ * `ssh -G` (cli/lib/git-remote.js) and records the REAL host, so the comparison runs always, and a
61
+ * recorded host that is still not a hostname is a host nobody established — untrusted.
61
62
  */
62
63
  function isDottedDomain(host) {
63
64
  const h = String(host == null ? '' : host).trim();
@@ -237,13 +238,18 @@ function assessStorySource(source, storyId) {
237
238
  + 'or the request redirected to a different repository');
238
239
  }
239
240
 
240
- const remoteHost = source.remoteHost;
241
- if (isDottedDomain(remoteHost)) {
242
- const rh = String(remoteHost).trim().toLowerCase();
243
- if (rh !== url.hostname.toLowerCase()) {
244
- return no('issue', `the git remote's host ${rh} is not ${url.hostname.toLowerCase()} — the issue was read `
245
- + 'from a different GitHub host than this repository lives on, where someone else can own the same name');
246
- }
241
+ // HC-GF-283: ALWAYS. An unresolved alias left gh on its default host, where the same owner/repo
242
+ // name can belong to someone else — the case binding decision 2's exception let through.
243
+ const rh = String(source.remoteHost == null ? '' : source.remoteHost).trim().toLowerCase();
244
+ if (!isDottedDomain(rh)) {
245
+ return no('issue', rh
246
+ ? `the git remote's host was recorded as '${rh}', which is not a hostname — an SSH alias that was never `
247
+ + `resolved (a run started before HC-GF-283), so which GitHub host issue ${refLabel(source)} was read from cannot be checked`
248
+ : `no git remote host was recorded for issue ${refLabel(source)}, so which GitHub host it was read from cannot be checked`);
249
+ }
250
+ if (rh !== url.hostname.toLowerCase()) {
251
+ return no('issue', `the git remote's host ${rh} is not ${url.hostname.toLowerCase()} — the issue was read `
252
+ + 'from a different GitHub host than this repository lives on, where someone else can own the same name');
247
253
  }
248
254
 
249
255
  return yes('issue', `issue ${refLabel(source)} was authored by ${source.author || 'an unknown user'} `
@@ -258,6 +264,7 @@ function assessStorySource(source, storyId) {
258
264
  module.exports = {
259
265
  assessStorySource,
260
266
  remoteHostFromUrl,
267
+ rawRemoteHost,
261
268
  isIssueShapedId,
262
269
  isDottedDomain,
263
270
  refLabel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hone-ai/cli",
3
- "version": "1.38.0",
3
+ "version": "1.38.1",
4
4
  "description": "Hone AI — Enterprise SDLC Pipeline CLI",
5
5
  "main": "hone-cli.js",
6
6
  "bin": {