@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.
- package/hone-cli.js +217 -201
- package/lib/bundle-paths.js +118 -18
- package/lib/doctor-admin-merge.js +11 -3
- package/lib/git-remote.js +103 -0
- package/lib/judge-provider.js +39 -34
- package/lib/mcp-tools.js +42 -1
- package/lib/run-context.js +4 -3
- package/lib/run-target.js +34 -2
- package/lib/story-provenance.js +19 -12
- package/package.json +1 -1
package/lib/story-provenance.js
CHANGED
|
@@ -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
|
-
*
|
|
57
|
-
* remote's host
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
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
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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,
|