mrvn-cli 0.5.22 → 0.5.23
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/dist/index.js +47 -12
- package/dist/index.js.map +1 -1
- package/dist/marvin-serve.js +46 -11
- package/dist/marvin-serve.js.map +1 -1
- package/dist/marvin.js +47 -12
- package/dist/marvin.js.map +1 -1
- package/package.json +1 -1
package/dist/marvin-serve.js
CHANGED
|
@@ -20732,11 +20732,12 @@ async function _assessArtifactRecursive(store, client, host, options, visited, d
|
|
|
20732
20732
|
}
|
|
20733
20733
|
}
|
|
20734
20734
|
const primaryHasComments = jiraKey ? (jiraIssues.get(jiraKey)?.comments.length ?? 0) > 0 : false;
|
|
20735
|
+
let commentAnalysisProgress = null;
|
|
20735
20736
|
if (depth < MAX_LLM_DEPTH && jiraKey && primaryHasComments) {
|
|
20736
20737
|
const estimatedChars = estimateCommentTextSize(jiraIssues, linkedJiraIssues, linkedIssueSignals);
|
|
20737
20738
|
if (estimatedChars <= MAX_LLM_COMMENT_CHARS) {
|
|
20738
20739
|
try {
|
|
20739
|
-
const
|
|
20740
|
+
const analysis = await analyzeSingleArtifactComments(
|
|
20740
20741
|
fm.id,
|
|
20741
20742
|
fm.title,
|
|
20742
20743
|
jiraKey,
|
|
@@ -20745,7 +20746,20 @@ async function _assessArtifactRecursive(store, client, host, options, visited, d
|
|
|
20745
20746
|
linkedJiraIssues,
|
|
20746
20747
|
linkedIssueSignals
|
|
20747
20748
|
);
|
|
20748
|
-
commentSummary = summary;
|
|
20749
|
+
commentSummary = analysis.summary;
|
|
20750
|
+
commentAnalysisProgress = analysis.progressEstimate;
|
|
20751
|
+
if (commentAnalysisProgress !== null) {
|
|
20752
|
+
const hasExplicitProgress = "progress" in fm && typeof fm.progress === "number";
|
|
20753
|
+
if (!hasExplicitProgress && !fm.progressOverride && commentAnalysisProgress !== currentProgress) {
|
|
20754
|
+
proposedUpdates.push({
|
|
20755
|
+
artifactId: fm.id,
|
|
20756
|
+
field: "progress",
|
|
20757
|
+
currentValue: currentProgress,
|
|
20758
|
+
proposedValue: commentAnalysisProgress,
|
|
20759
|
+
reason: `Comment analysis estimates ${commentAnalysisProgress}% progress`
|
|
20760
|
+
});
|
|
20761
|
+
}
|
|
20762
|
+
}
|
|
20749
20763
|
} catch (err) {
|
|
20750
20764
|
errors.push(`Comment analysis failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
20751
20765
|
}
|
|
@@ -20843,6 +20857,7 @@ async function _assessArtifactRecursive(store, client, host, options, visited, d
|
|
|
20843
20857
|
progressDrift,
|
|
20844
20858
|
commentSignals,
|
|
20845
20859
|
commentSummary,
|
|
20860
|
+
commentAnalysisProgress,
|
|
20846
20861
|
linkedIssues,
|
|
20847
20862
|
linkedIssueSignals,
|
|
20848
20863
|
children,
|
|
@@ -20935,13 +20950,15 @@ function estimateCommentTextSize(jiraIssues, linkedJiraIssues, linkedIssueSignal
|
|
|
20935
20950
|
}
|
|
20936
20951
|
var SINGLE_ARTIFACT_COMMENT_PROMPT = `You are a delivery management assistant analyzing Jira comments for a single work item.
|
|
20937
20952
|
|
|
20938
|
-
|
|
20939
|
-
-
|
|
20940
|
-
-
|
|
20941
|
-
- Any decisions, handoffs, or scheduling mentioned
|
|
20942
|
-
- Relevant context from linked issue comments (if provided)
|
|
20953
|
+
Analyze the comments and produce:
|
|
20954
|
+
1. A 2-3 sentence progress summary covering: what work has been completed, what is pending or blocked, any decisions/handoffs/scheduling mentioned, and relevant context from linked issue comments (if provided).
|
|
20955
|
+
2. A progress estimate (0-100%) based on evidence in the comments \u2014 e.g., if comments indicate all items have been triaged into tasks, or implementation is complete pending review, estimate accordingly. If you cannot determine progress from the comments, set progressEstimate to null.
|
|
20943
20956
|
|
|
20944
|
-
Return
|
|
20957
|
+
Return a JSON object with this exact structure:
|
|
20958
|
+
{"summary": "your 2-3 sentence summary", "progressEstimate": 75}
|
|
20959
|
+
|
|
20960
|
+
Use null for progressEstimate if the comments don't provide enough evidence to estimate.
|
|
20961
|
+
IMPORTANT: Only return the JSON object, no other text.`;
|
|
20945
20962
|
async function analyzeSingleArtifactComments(artifactId, title, jiraKey, jiraStatus, jiraIssues, linkedJiraIssues, linkedIssueSignals) {
|
|
20946
20963
|
const promptParts = [];
|
|
20947
20964
|
const primaryData = jiraIssues.get(jiraKey);
|
|
@@ -20964,7 +20981,7 @@ ${commentTexts}`);
|
|
|
20964
20981
|
promptParts.push(`### Linked: ${signal.sourceKey} (${signal.linkType})
|
|
20965
20982
|
${commentTexts}`);
|
|
20966
20983
|
}
|
|
20967
|
-
if (promptParts.length === 0) return null;
|
|
20984
|
+
if (promptParts.length === 0) return { summary: null, progressEstimate: null };
|
|
20968
20985
|
const prompt = promptParts.join("\n\n");
|
|
20969
20986
|
const result = query2({
|
|
20970
20987
|
prompt,
|
|
@@ -20981,11 +20998,25 @@ ${commentTexts}`);
|
|
|
20981
20998
|
(b) => b.type === "text"
|
|
20982
20999
|
);
|
|
20983
21000
|
if (textBlock) {
|
|
20984
|
-
return textBlock.text.trim();
|
|
21001
|
+
return parseCommentAnalysis(textBlock.text.trim());
|
|
20985
21002
|
}
|
|
20986
21003
|
}
|
|
20987
21004
|
}
|
|
20988
|
-
return null;
|
|
21005
|
+
return { summary: null, progressEstimate: null };
|
|
21006
|
+
}
|
|
21007
|
+
function parseCommentAnalysis(text) {
|
|
21008
|
+
const parsed = parseLlmJson(text);
|
|
21009
|
+
if (parsed && typeof parsed.summary === "string") {
|
|
21010
|
+
const progressEstimate2 = typeof parsed.progressEstimate === "number" && parsed.progressEstimate >= 0 && parsed.progressEstimate <= 100 ? Math.round(parsed.progressEstimate) : null;
|
|
21011
|
+
return { summary: parsed.summary, progressEstimate: progressEstimate2 };
|
|
21012
|
+
}
|
|
21013
|
+
let progressEstimate = null;
|
|
21014
|
+
const pctMatch = text.match(/(\d{1,3})%/);
|
|
21015
|
+
if (pctMatch) {
|
|
21016
|
+
const pct = parseInt(pctMatch[1], 10);
|
|
21017
|
+
if (pct >= 0 && pct <= 100) progressEstimate = pct;
|
|
21018
|
+
}
|
|
21019
|
+
return { summary: text, progressEstimate };
|
|
20989
21020
|
}
|
|
20990
21021
|
function emptyArtifactReport(artifactId, errors) {
|
|
20991
21022
|
return {
|
|
@@ -21005,6 +21036,7 @@ function emptyArtifactReport(artifactId, errors) {
|
|
|
21005
21036
|
progressDrift: false,
|
|
21006
21037
|
commentSignals: [],
|
|
21007
21038
|
commentSummary: null,
|
|
21039
|
+
commentAnalysisProgress: null,
|
|
21008
21040
|
linkedIssues: [],
|
|
21009
21041
|
linkedIssueSignals: [],
|
|
21010
21042
|
children: [],
|
|
@@ -21042,6 +21074,9 @@ function formatArtifactReport(report) {
|
|
|
21042
21074
|
if (report.commentSummary) {
|
|
21043
21075
|
parts.push(`## Comments`);
|
|
21044
21076
|
parts.push(report.commentSummary);
|
|
21077
|
+
if (report.commentAnalysisProgress !== null) {
|
|
21078
|
+
parts.push(` \u{1F4CA} Comment-derived progress estimate: ${report.commentAnalysisProgress}%`);
|
|
21079
|
+
}
|
|
21045
21080
|
parts.push("");
|
|
21046
21081
|
}
|
|
21047
21082
|
if (report.children.length > 0) {
|