@link-assistant/hive-mind 2.6.1 → 2.7.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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/agent.prompts.lib.mjs +4 -4
- package/src/claude.prompts.lib.mjs +4 -4
- package/src/codex.prompts.lib.mjs +4 -4
- package/src/deep-analysis.lib.mjs +35 -0
- package/src/development-log.lib.mjs +2 -0
- package/src/gemini.prompts.lib.mjs +4 -4
- package/src/opencode.prompts.lib.mjs +4 -4
- package/src/qwen.prompts.lib.mjs +4 -4
- package/src/solve.config.lib.mjs +5 -0
- package/src/solve.mjs +3 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ import { getExperimentsExamplesSubPrompt } from './experiments-examples.prompts.
|
|
|
8
8
|
import { getThinkingPromptInstruction } from './thinking-prompt.lib.mjs';
|
|
9
9
|
import { buildWorkLanguageDirective } from './work-language.prompts.lib.mjs';
|
|
10
10
|
import { buildRequestedBaseBranchDirective } from './solve-option-contract.prompts.lib.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { buildIssueResearchPrompt } from './deep-analysis.lib.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Build the user prompt for Agent
|
|
@@ -67,9 +67,9 @@ export const buildUserPrompt = params => {
|
|
|
67
67
|
promptLines.push('');
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
promptLines.push(
|
|
70
|
+
const issueResearchPrompt = buildIssueResearchPrompt({ argv, issueNumber, prNumber }).trim();
|
|
71
|
+
if (issueResearchPrompt) {
|
|
72
|
+
promptLines.push(issueResearchPrompt, '');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
const thinkingPromptInstruction = getThinkingPromptInstruction({ tool: 'agent', argv });
|
|
@@ -10,7 +10,7 @@ import { primaryModelNames } from './models/index.mjs';
|
|
|
10
10
|
import { getThinkingPromptInstruction } from './thinking-prompt.lib.mjs';
|
|
11
11
|
import { buildWorkLanguageDirective } from './work-language.prompts.lib.mjs';
|
|
12
12
|
import { buildRequestedBaseBranchDirective } from './solve-option-contract.prompts.lib.mjs';
|
|
13
|
-
import {
|
|
13
|
+
import { buildIssueResearchPrompt } from './deep-analysis.lib.mjs';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Build the user prompt for Claude
|
|
@@ -80,9 +80,9 @@ export const buildUserPrompt = params => {
|
|
|
80
80
|
promptLines.push('');
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
promptLines.push(
|
|
83
|
+
const issueResearchPrompt = buildIssueResearchPrompt({ argv, issueNumber, prNumber }).trim();
|
|
84
|
+
if (issueResearchPrompt) {
|
|
85
|
+
promptLines.push(issueResearchPrompt, '');
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
const thinkingPromptInstruction = getThinkingPromptInstruction({ tool: 'claude', argv, claudeVersion });
|
|
@@ -9,7 +9,7 @@ import { getExperimentsExamplesSubPrompt } from './experiments-examples.prompts.
|
|
|
9
9
|
import { getThinkingPromptInstruction } from './thinking-prompt.lib.mjs';
|
|
10
10
|
import { buildWorkLanguageDirective } from './work-language.prompts.lib.mjs';
|
|
11
11
|
import { buildRequestedBaseBranchDirective } from './solve-option-contract.prompts.lib.mjs';
|
|
12
|
-
import {
|
|
12
|
+
import { buildIssueResearchPrompt } from './deep-analysis.lib.mjs';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Build the user prompt for Codex
|
|
@@ -68,9 +68,9 @@ export const buildUserPrompt = params => {
|
|
|
68
68
|
promptLines.push('');
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
const
|
|
72
|
-
if (
|
|
73
|
-
promptLines.push(
|
|
71
|
+
const issueResearchPrompt = buildIssueResearchPrompt({ argv, issueNumber, prNumber }).trim();
|
|
72
|
+
if (issueResearchPrompt) {
|
|
73
|
+
promptLines.push(issueResearchPrompt, '');
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
const thinkingPromptInstruction = getThinkingPromptInstruction({ tool: 'codex', argv });
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { buildDevelopmentLogDirectory, buildDevelopmentLogPrompt, isBugIssueType, isDevelopmentLogEnabled } from './development-log.lib.mjs';
|
|
2
|
+
|
|
3
|
+
export const isDeepAnalysisEnabled = argv => argv?.deepAnalysis === true || argv?.['deep-analysis'] === true;
|
|
4
|
+
|
|
5
|
+
export const buildDeepAnalysisPrompt = ({ argv, issueNumber, prNumber, issueType }) => {
|
|
6
|
+
if (!isDeepAnalysisEnabled(argv)) return '';
|
|
7
|
+
|
|
8
|
+
const resolvedIssueType = issueType ?? argv?.issueType ?? null;
|
|
9
|
+
const isBug = isBugIssueType(resolvedIssueType);
|
|
10
|
+
const lines = [];
|
|
11
|
+
|
|
12
|
+
// Issue #1596 owns development-log collection. Deep analysis may refer to
|
|
13
|
+
// that directory, but must never activate logging by itself.
|
|
14
|
+
if (isDevelopmentLogEnabled(argv)) {
|
|
15
|
+
const directory = buildDevelopmentLogDirectory({ issueNumber, prNumber });
|
|
16
|
+
lines.push(isBug ? `Download all logs and collect data related about the issue to this repository, and compile that data into the ${directory} folder.` : `Collect data related about the issue to this repository, and compile that data into the ${directory} folder.`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (isBug) {
|
|
20
|
+
lines.push('Use the collected evidence to do a deep analysis (search online for additional facts and data), reconstruct the timeline/sequence of events, list each and every requirement from the issue, find the root cause of each problem, and propose possible solutions and solution plans for each requirement. Also check online for known existing components/libraries that solve a similar problem or can help.', 'If there is not enough data to find the actual root cause, add debug output and a verbose mode (if not already present) so the root cause can be found on the next iteration. Keep the default state switched off.', 'If the issue is related to another repository/project, report issues on GitHub for that project when possible. Each report must contain reproducible examples, workarounds, and suggestions for fixing the issue in code.');
|
|
21
|
+
} else {
|
|
22
|
+
lines.push('Do a deep analysis (search online for additional facts and data), list each and every requirement from the issue, and propose possible solutions and solution plans for each requirement. Also check online for known existing components/libraries that solve a similar problem or can help.');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
lines.push('Double-check that the requirements are fully applied to the entire codebase: if an issue exists in multiple places, apply it in all of them.');
|
|
26
|
+
return `\n${lines.join('\n\n')}\n`;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// Development-log and deep-analysis instructions occupy the same position in
|
|
30
|
+
// the initial user prompt. Selecting deep analysis subsumes the shorter
|
|
31
|
+
// development-log sentence so it is not duplicated when both flags are used.
|
|
32
|
+
export const buildIssueResearchPrompt = params => {
|
|
33
|
+
const deepAnalysisPrompt = buildDeepAnalysisPrompt(params);
|
|
34
|
+
return deepAnalysisPrompt || buildDevelopmentLogPrompt(params);
|
|
35
|
+
};
|
|
@@ -40,6 +40,8 @@ export const isBugIssueType = issueType => {
|
|
|
40
40
|
// (yargs exposes both the camelCase and kebab-case keys).
|
|
41
41
|
export const isDevelopmentLogEnabled = argv => argv?.developmentLog === true || argv?.['development-log'] === true;
|
|
42
42
|
|
|
43
|
+
export const isIssueTypeAwarePromptEnabled = argv => isDevelopmentLogEnabled(argv) || argv?.deepAnalysis === true || argv?.['deep-analysis'] === true;
|
|
44
|
+
|
|
43
45
|
export const buildDevelopmentLogPrompt = ({ argv, issueNumber, prNumber, issueType }) => {
|
|
44
46
|
if (!(argv?.developmentLog || argv?.['development-log'])) return '';
|
|
45
47
|
|
|
@@ -8,7 +8,7 @@ import { getExperimentsExamplesSubPrompt } from './experiments-examples.prompts.
|
|
|
8
8
|
import { getThinkingPromptInstruction } from './thinking-prompt.lib.mjs';
|
|
9
9
|
import { buildWorkLanguageDirective } from './work-language.prompts.lib.mjs';
|
|
10
10
|
import { buildRequestedBaseBranchDirective } from './solve-option-contract.prompts.lib.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { buildIssueResearchPrompt } from './deep-analysis.lib.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Build the user prompt for Gemini
|
|
@@ -58,9 +58,9 @@ export const buildUserPrompt = params => {
|
|
|
58
58
|
promptLines.push('');
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
promptLines.push(
|
|
61
|
+
const issueResearchPrompt = buildIssueResearchPrompt({ argv, issueNumber, prNumber }).trim();
|
|
62
|
+
if (issueResearchPrompt) {
|
|
63
|
+
promptLines.push(issueResearchPrompt, '');
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const thinkingPromptInstruction = getThinkingPromptInstruction({ tool: 'gemini', argv });
|
|
@@ -8,7 +8,7 @@ import { getExperimentsExamplesSubPrompt } from './experiments-examples.prompts.
|
|
|
8
8
|
import { getThinkingPromptInstruction } from './thinking-prompt.lib.mjs';
|
|
9
9
|
import { buildWorkLanguageDirective } from './work-language.prompts.lib.mjs';
|
|
10
10
|
import { buildRequestedBaseBranchDirective } from './solve-option-contract.prompts.lib.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { buildIssueResearchPrompt } from './deep-analysis.lib.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Build the user prompt for OpenCode
|
|
@@ -67,9 +67,9 @@ export const buildUserPrompt = params => {
|
|
|
67
67
|
promptLines.push('');
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
72
|
-
promptLines.push(
|
|
70
|
+
const issueResearchPrompt = buildIssueResearchPrompt({ argv, issueNumber, prNumber }).trim();
|
|
71
|
+
if (issueResearchPrompt) {
|
|
72
|
+
promptLines.push(issueResearchPrompt, '');
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
const thinkingPromptInstruction = getThinkingPromptInstruction({ tool: 'opencode', argv });
|
package/src/qwen.prompts.lib.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { getExperimentsExamplesSubPrompt } from './experiments-examples.prompts.
|
|
|
8
8
|
import { getThinkingPromptInstruction } from './thinking-prompt.lib.mjs';
|
|
9
9
|
import { buildWorkLanguageDirective } from './work-language.prompts.lib.mjs';
|
|
10
10
|
import { buildRequestedBaseBranchDirective } from './solve-option-contract.prompts.lib.mjs';
|
|
11
|
-
import {
|
|
11
|
+
import { buildIssueResearchPrompt } from './deep-analysis.lib.mjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Build the user prompt for Qwen Code
|
|
@@ -58,9 +58,9 @@ export const buildUserPrompt = params => {
|
|
|
58
58
|
promptLines.push('');
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
promptLines.push(
|
|
61
|
+
const issueResearchPrompt = buildIssueResearchPrompt({ argv, issueNumber, prNumber }).trim();
|
|
62
|
+
if (issueResearchPrompt) {
|
|
63
|
+
promptLines.push(issueResearchPrompt, '');
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const thinkingPromptInstruction = getThinkingPromptInstruction({ tool, argv });
|
package/src/solve.config.lib.mjs
CHANGED
|
@@ -518,6 +518,11 @@ export const SOLVE_OPTION_DEFINITIONS = {
|
|
|
518
518
|
description: 'Prompt for issue-data collection under ./dev/log/issues/{issue-id}/pulls/{pull-id}, preserve native tool state under sessions/{UUID}, and commit the artifacts when solve finishes. Supported for --tool claude, --tool codex, --tool opencode, --tool agent, --tool qwen, and --tool gemini.',
|
|
519
519
|
default: false,
|
|
520
520
|
},
|
|
521
|
+
'deep-analysis': {
|
|
522
|
+
type: 'boolean',
|
|
523
|
+
description: 'Prompt for issue-type-aware deep analysis, online research, complete requirement coverage, and solution planning. Data collection under ./dev/log is included only when --development-log is also enabled. Supported for --tool claude, --tool codex, --tool opencode, --tool agent, --tool qwen, and --tool gemini.',
|
|
524
|
+
default: false,
|
|
525
|
+
},
|
|
521
526
|
'use-handoff': {
|
|
522
527
|
type: 'boolean',
|
|
523
528
|
description: '[EXPERIMENTAL] Enable the HANDOFF.md continuity Agent Skill so a session can continue the work of a previous session — even when a different AI tool is used (e.g. Claude and Codex continuing each other in the same pull request). A real SKILL.md (the open Agent Skills standard) is deployed into the working directory so each tool loads it natively (.claude/skills/handoff/ for Claude, .agents/skills/handoff/ for Codex). The AI reads HANDOFF.md (repository root) first when present and keeps it updated with task, current state, decisions, next steps, gotchas, and critical files. HANDOFF.md is committed to the PR branch so it persists across the ephemeral per-session working directories; the SKILL.md itself is re-deployed each session and git-excluded so it never pollutes the PR. The same skill file is used identically for --tool claude and --tool codex. Disabled by default (issue #1877).',
|
package/src/solve.mjs
CHANGED
|
@@ -62,7 +62,7 @@ const { recordAfterCloneSize, recordAfterAgentSize } = await import('./solve.dis
|
|
|
62
62
|
const { createOrCheckoutBranch } = await import('./solve.branch.lib.mjs');
|
|
63
63
|
const { startWorkSession, endWorkSession, SESSION_TYPES } = await import('./solve.session.lib.mjs');
|
|
64
64
|
const { attachFinalLogIfMissing } = await import('./attach-logs-guarantee.lib.mjs'); // Issue #1952
|
|
65
|
-
const { collectAndCommitDevelopmentLogArtifacts, fetchIssueType, isDevelopmentLogEnabled } = await import('./development-log.lib.mjs');
|
|
65
|
+
const { collectAndCommitDevelopmentLogArtifacts, fetchIssueType, isDevelopmentLogEnabled, isIssueTypeAwarePromptEnabled } = await import('./development-log.lib.mjs');
|
|
66
66
|
const { createDevelopmentLogFinalizer } = await import('./development-log.finalize.lib.mjs');
|
|
67
67
|
// Issue #1625: centralized markers + tracked comment posting for solve.mjs's
|
|
68
68
|
// own usage-limit notifications (so they're excluded from the
|
|
@@ -486,8 +486,8 @@ if (isPrUrl) {
|
|
|
486
486
|
}
|
|
487
487
|
// Issues #1212, #1462: Store issueNumber globally for error handlers (attach failure logs to issue when no PR exists)
|
|
488
488
|
global.issueNumber = issueNumber;
|
|
489
|
-
//
|
|
490
|
-
if (
|
|
489
|
+
// Issues #1595 and #1596: detect the issue type so analysis and logging prompts use bug vs feature/task wording.
|
|
490
|
+
if (isIssueTypeAwarePromptEnabled(argv) && issueNumber) argv.issueType = await fetchIssueType({ owner, repo, issueNumber, $, log });
|
|
491
491
|
const workspaceInfo = argv.enableWorkspaces ? { owner, repo, issueNumber } : null;
|
|
492
492
|
const { tempDir, workspaceTmpDir, needsClone } = await setupTempDirectory(argv, workspaceInfo);
|
|
493
493
|
cleanupContext.tempDir = tempDir;
|