@hone-ai/cli 1.13.0 → 1.14.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.
- package/hone-cli.js +34 -1
- package/package.json +1 -1
package/hone-cli.js
CHANGED
|
@@ -4447,9 +4447,42 @@ program
|
|
|
4447
4447
|
try { branch = execSync('git symbolic-ref --short HEAD', { encoding: 'utf8' }).trim(); } catch { branch = null; }
|
|
4448
4448
|
}
|
|
4449
4449
|
|
|
4450
|
+
// HC-019n-followup-11: when storyId is a bare integer, treat it as a
|
|
4451
|
+
// GitHub issue number and fetch the issue's title + body via the local
|
|
4452
|
+
// `gh` CLI. Inject into config.story_description so the orchestrator's
|
|
4453
|
+
// buildStepContext (HC-019n root-cause fix B) hands the real story
|
|
4454
|
+
// text to step_0 instead of letting the LLM produce placeholder
|
|
4455
|
+
// [ASSUMPTION] grooming. Hook reused — no server change required.
|
|
4456
|
+
//
|
|
4457
|
+
// Gracefully degrade on any error (gh missing, no remote, network
|
|
4458
|
+
// fail, private repo without auth): warn and proceed without context.
|
|
4459
|
+
// The existing HC-019n-followup-7 hard_pause safety net catches the
|
|
4460
|
+
// resulting placeholder cascade at step_1.
|
|
4461
|
+
const orchestrateConfig = {};
|
|
4462
|
+
if (/^\d+$/.test(storyIdOrRunId)) {
|
|
4463
|
+
try {
|
|
4464
|
+
const remoteUrl = execSync('git remote get-url origin', { encoding: 'utf8' }).trim();
|
|
4465
|
+
const m = remoteUrl.match(/[/:]([^/]+)\/([^/]+?)(?:\.git)?$/);
|
|
4466
|
+
if (!m) throw new Error(`could not parse owner/repo from remote: ${remoteUrl}`);
|
|
4467
|
+
const ownerRepo = `${m[1]}/${m[2]}`;
|
|
4468
|
+
const issueJson = execSync(
|
|
4469
|
+
`gh issue view ${storyIdOrRunId} --repo ${ownerRepo} --json title,body,url`,
|
|
4470
|
+
{ encoding: 'utf8' }
|
|
4471
|
+
);
|
|
4472
|
+
const issue = JSON.parse(issueJson);
|
|
4473
|
+
const desc = `# ${issue.title}\n\n${issue.body || '_(issue body is empty)_'}\n\n_Source: ${issue.url}_`;
|
|
4474
|
+
orchestrateConfig.story_description = desc;
|
|
4475
|
+
console.log(` → fetched GitHub issue #${storyIdOrRunId} for story context (${desc.length} chars)`);
|
|
4476
|
+
} catch (e) {
|
|
4477
|
+
const msg = (e && e.message) ? e.message.split('\n')[0] : String(e);
|
|
4478
|
+
console.warn(` ⚠ could not fetch GitHub issue context: ${msg}`);
|
|
4479
|
+
console.warn(' → proceeding without story_description; step_0 may produce placeholder output');
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
|
|
4450
4483
|
try {
|
|
4451
4484
|
const { data } = await client.post('/orchestrate', {
|
|
4452
|
-
storyId: storyIdOrRunId, repoName, branch, mode: opts.mode, config:
|
|
4485
|
+
storyId: storyIdOrRunId, repoName, branch, mode: opts.mode, config: orchestrateConfig,
|
|
4453
4486
|
});
|
|
4454
4487
|
|
|
4455
4488
|
console.log('');
|