@zhixuan92/multi-model-agent-core 5.0.3 → 5.1.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/dist/events/plain-log-entry.d.ts +1 -1
- package/dist/events/plain-log-entry.d.ts.map +1 -1
- package/dist/events/plain-log-entry.js +5 -1
- package/dist/events/plain-log-entry.js.map +1 -1
- package/dist/events/wire-schema.d.ts +4 -4
- package/dist/lifecycle/derive-completion.d.ts +4 -0
- package/dist/lifecycle/derive-completion.d.ts.map +1 -1
- package/dist/lifecycle/derive-completion.js +14 -1
- package/dist/lifecycle/derive-completion.js.map +1 -1
- package/dist/lifecycle/git-exec.d.ts +62 -0
- package/dist/lifecycle/git-exec.d.ts.map +1 -0
- package/dist/lifecycle/git-exec.js +135 -0
- package/dist/lifecycle/git-exec.js.map +1 -0
- package/dist/lifecycle/goal-builder.d.ts +35 -0
- package/dist/lifecycle/goal-builder.d.ts.map +1 -0
- package/dist/lifecycle/goal-builder.js +56 -0
- package/dist/lifecycle/goal-builder.js.map +1 -0
- package/dist/lifecycle/goal-preconditions.d.ts +21 -0
- package/dist/lifecycle/goal-preconditions.d.ts.map +1 -0
- package/dist/lifecycle/goal-preconditions.js +33 -0
- package/dist/lifecycle/goal-preconditions.js.map +1 -0
- package/dist/lifecycle/goal-prompts.d.ts +27 -0
- package/dist/lifecycle/goal-prompts.d.ts.map +1 -0
- package/dist/lifecycle/goal-prompts.js +204 -0
- package/dist/lifecycle/goal-prompts.js.map +1 -0
- package/dist/lifecycle/goal-report.d.ts +42 -0
- package/dist/lifecycle/goal-report.d.ts.map +1 -0
- package/dist/lifecycle/goal-report.js +125 -0
- package/dist/lifecycle/goal-report.js.map +1 -0
- package/dist/lifecycle/handlers/annotate-stage.d.ts.map +1 -1
- package/dist/lifecycle/handlers/annotate-stage.js +27 -0
- package/dist/lifecycle/handlers/annotate-stage.js.map +1 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.d.ts +3 -3
- package/dist/lifecycle/handlers/prepare-execution-context-handler.d.ts.map +1 -1
- package/dist/lifecycle/handlers/prepare-execution-context-handler.js +3 -25
- package/dist/lifecycle/handlers/prepare-execution-context-handler.js.map +1 -1
- package/dist/lifecycle/handlers/review-fix-stage.d.ts +9 -0
- package/dist/lifecycle/handlers/review-fix-stage.d.ts.map +1 -0
- package/dist/lifecycle/handlers/review-fix-stage.js +75 -0
- package/dist/lifecycle/handlers/review-fix-stage.js.map +1 -0
- package/dist/lifecycle/handlers/terminal-handlers.d.ts.map +1 -1
- package/dist/lifecycle/handlers/terminal-handlers.js +15 -3
- package/dist/lifecycle/handlers/terminal-handlers.js.map +1 -1
- package/dist/lifecycle/stage-io.d.ts +0 -23
- package/dist/lifecycle/stage-io.d.ts.map +1 -1
- package/dist/lifecycle/stage-io.js +0 -11
- package/dist/lifecycle/stage-io.js.map +1 -1
- package/dist/lifecycle/stage-plan-builder.d.ts.map +1 -1
- package/dist/lifecycle/stage-plan-builder.js +42 -49
- package/dist/lifecycle/stage-plan-builder.js.map +1 -1
- package/dist/lifecycle/stage-plan-types.d.ts +8 -8
- package/dist/lifecycle/stage-plan-types.d.ts.map +1 -1
- package/dist/lifecycle/stage-plan-types.js.map +1 -1
- package/dist/lifecycle/task-executor.d.ts.map +1 -1
- package/dist/lifecycle/task-executor.js +46 -1
- package/dist/lifecycle/task-executor.js.map +1 -1
- package/dist/lifecycle/task-runner.d.ts.map +1 -1
- package/dist/lifecycle/task-runner.js +3 -1
- package/dist/lifecycle/task-runner.js.map +1 -1
- package/dist/lifecycle/write-goal-lock.d.ts +29 -0
- package/dist/lifecycle/write-goal-lock.d.ts.map +1 -0
- package/dist/lifecycle/write-goal-lock.js +70 -0
- package/dist/lifecycle/write-goal-lock.js.map +1 -0
- package/dist/providers/claude-session.d.ts.map +1 -1
- package/dist/providers/claude-session.js +14 -0
- package/dist/providers/claude-session.js.map +1 -1
- package/dist/research/adapters/arxiv.d.ts.map +1 -1
- package/dist/research/adapters/arxiv.js +6 -1
- package/dist/research/adapters/arxiv.js.map +1 -1
- package/dist/tools/delegate/brief-slot.d.ts +14 -11
- package/dist/tools/delegate/brief-slot.d.ts.map +1 -1
- package/dist/tools/delegate/brief-slot.js +29 -53
- package/dist/tools/delegate/brief-slot.js.map +1 -1
- package/dist/tools/delegate/schema.d.ts +0 -4
- package/dist/tools/delegate/schema.d.ts.map +1 -1
- package/dist/tools/delegate/schema.js +3 -2
- package/dist/tools/delegate/schema.js.map +1 -1
- package/dist/tools/delegate/tool-config.d.ts.map +1 -1
- package/dist/tools/delegate/tool-config.js +20 -17
- package/dist/tools/delegate/tool-config.js.map +1 -1
- package/dist/tools/execute-plan/brief-slot.d.ts +11 -5
- package/dist/tools/execute-plan/brief-slot.d.ts.map +1 -1
- package/dist/tools/execute-plan/brief-slot.js +57 -13
- package/dist/tools/execute-plan/brief-slot.js.map +1 -1
- package/dist/tools/execute-plan/tool-config.d.ts.map +1 -1
- package/dist/tools/execute-plan/tool-config.js +18 -67
- package/dist/tools/execute-plan/tool-config.js.map +1 -1
- package/dist/tools/journal/record/brief-slot.d.ts +9 -6
- package/dist/tools/journal/record/brief-slot.d.ts.map +1 -1
- package/dist/tools/journal/record/brief-slot.js +18 -14
- package/dist/tools/journal/record/brief-slot.js.map +1 -1
- package/dist/tools/journal/record/tool-config.d.ts.map +1 -1
- package/dist/tools/journal/record/tool-config.js +18 -11
- package/dist/tools/journal/record/tool-config.js.map +1 -1
- package/dist/tools/retry/brief-slot.d.ts +1 -1
- package/dist/tools/retry/brief-slot.d.ts.map +1 -1
- package/dist/tools/retry/brief-slot.js +2 -1
- package/dist/tools/retry/brief-slot.js.map +1 -1
- package/dist/tools/retry/schema.d.ts +0 -1
- package/dist/tools/retry/schema.d.ts.map +1 -1
- package/dist/tools/retry/schema.js +6 -6
- package/dist/tools/retry/schema.js.map +1 -1
- package/dist/tools/retry/tool-config.d.ts.map +1 -1
- package/dist/tools/retry/tool-config.js +23 -28
- package/dist/tools/retry/tool-config.js.map +1 -1
- package/dist/types/goal.d.ts +47 -0
- package/dist/types/goal.d.ts.map +1 -0
- package/dist/types/goal.js +2 -0
- package/dist/types/goal.js.map +1 -0
- package/dist/types/task-spec.d.ts +11 -0
- package/dist/types/task-spec.d.ts.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/lifecycle/diff-tracker.d.ts +0 -88
- package/dist/lifecycle/diff-tracker.d.ts.map +0 -1
- package/dist/lifecycle/diff-tracker.js +0 -429
- package/dist/lifecycle/diff-tracker.js.map +0 -1
- package/dist/lifecycle/handlers/compose-commit-message.d.ts +0 -15
- package/dist/lifecycle/handlers/compose-commit-message.d.ts.map +0 -1
- package/dist/lifecycle/handlers/compose-commit-message.js +0 -227
- package/dist/lifecycle/handlers/compose-commit-message.js.map +0 -1
- package/dist/lifecycle/handlers/git-commit-handler.d.ts +0 -4
- package/dist/lifecycle/handlers/git-commit-handler.d.ts.map +0 -1
- package/dist/lifecycle/handlers/git-commit-handler.js +0 -202
- package/dist/lifecycle/handlers/git-commit-handler.js.map +0 -1
- package/dist/lifecycle/handlers/journal-review-prompt.d.ts +0 -7
- package/dist/lifecycle/handlers/journal-review-prompt.d.ts.map +0 -1
- package/dist/lifecycle/handlers/journal-review-prompt.js +0 -54
- package/dist/lifecycle/handlers/journal-review-prompt.js.map +0 -1
- package/dist/lifecycle/handlers/parse-review-report.d.ts +0 -15
- package/dist/lifecycle/handlers/parse-review-report.d.ts.map +0 -1
- package/dist/lifecycle/handlers/parse-review-report.js +0 -40
- package/dist/lifecycle/handlers/parse-review-report.js.map +0 -1
- package/dist/lifecycle/handlers/quality-review-prompt.d.ts +0 -7
- package/dist/lifecycle/handlers/quality-review-prompt.d.ts.map +0 -1
- package/dist/lifecycle/handlers/quality-review-prompt.js +0 -50
- package/dist/lifecycle/handlers/quality-review-prompt.js.map +0 -1
- package/dist/lifecycle/handlers/review-stage.d.ts +0 -4
- package/dist/lifecycle/handlers/review-stage.d.ts.map +0 -1
- package/dist/lifecycle/handlers/review-stage.js +0 -277
- package/dist/lifecycle/handlers/review-stage.js.map +0 -1
- package/dist/lifecycle/handlers/rework-prompt.d.ts +0 -6
- package/dist/lifecycle/handlers/rework-prompt.d.ts.map +0 -1
- package/dist/lifecycle/handlers/rework-prompt.js +0 -18
- package/dist/lifecycle/handlers/rework-prompt.js.map +0 -1
- package/dist/lifecycle/handlers/rework-stage.d.ts +0 -4
- package/dist/lifecycle/handlers/rework-stage.d.ts.map +0 -1
- package/dist/lifecycle/handlers/rework-stage.js +0 -191
- package/dist/lifecycle/handlers/rework-stage.js.map +0 -1
- package/dist/lifecycle/handlers/spec-review-prompt.d.ts +0 -8
- package/dist/lifecycle/handlers/spec-review-prompt.d.ts.map +0 -1
- package/dist/lifecycle/handlers/spec-review-prompt.js +0 -47
- package/dist/lifecycle/handlers/spec-review-prompt.js.map +0 -1
- package/dist/lifecycle/handlers/tier-policy.d.ts +0 -11
- package/dist/lifecycle/handlers/tier-policy.d.ts.map +0 -1
- package/dist/lifecycle/handlers/tier-policy.js +0 -12
- package/dist/lifecycle/handlers/tier-policy.js.map +0 -1
- package/dist/lifecycle/repo-commit-lock.d.ts +0 -20
- package/dist/lifecycle/repo-commit-lock.d.ts.map +0 -1
- package/dist/lifecycle/repo-commit-lock.js +0 -40
- package/dist/lifecycle/repo-commit-lock.js.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { AgentType, ToolMode, SandboxPolicy } from './task-spec.js';
|
|
2
|
+
export type GoalSource = 'delegate' | 'execute-plan' | 'journal-record';
|
|
3
|
+
export type GoalPhaseMode = 'implement' | 'review-fix';
|
|
4
|
+
export type GoalReviewPolicy = 'review-fix' | 'none';
|
|
5
|
+
export interface GoalPhase {
|
|
6
|
+
/** Provider tier this phase runs on. Route-configurable, not a constant. */
|
|
7
|
+
tier: AgentType;
|
|
8
|
+
mode: GoalPhaseMode;
|
|
9
|
+
}
|
|
10
|
+
export interface GoalTask {
|
|
11
|
+
/** 1-based task number, used in the `[task N]` commit convention. */
|
|
12
|
+
n: number;
|
|
13
|
+
/** Short heading — derived per route; used in the commit subject + report. */
|
|
14
|
+
heading: string;
|
|
15
|
+
/** The task's full instruction body (plan section / prompt / learning). */
|
|
16
|
+
body: string;
|
|
17
|
+
/** 1-based plan-phase index this task belongs to (for `PHASE k` checkpoints). */
|
|
18
|
+
phase: number;
|
|
19
|
+
}
|
|
20
|
+
export interface Goal {
|
|
21
|
+
goalId: string;
|
|
22
|
+
cwd: string;
|
|
23
|
+
source: GoalSource;
|
|
24
|
+
/** Ordered, ≥1. Empty input is rejected upstream (`empty_plan`). */
|
|
25
|
+
tasks: GoalTask[];
|
|
26
|
+
/** Number of plan-phase boundaries (distinct `GoalTask.phase` values). */
|
|
27
|
+
phaseCount: number;
|
|
28
|
+
/** The whole plan rendered as one prompt body, with `PHASE k:` + `[task N]` markers. */
|
|
29
|
+
planText: string;
|
|
30
|
+
/** Optional route-specific procedure prepended to both phase prompts (e.g. the
|
|
31
|
+
* journal integration procedure). Undefined for delegate/execute-plan. */
|
|
32
|
+
preamble?: string;
|
|
33
|
+
/** [implement] or [implement, review-fix]; tiers are route-configured. */
|
|
34
|
+
phases: GoalPhase[];
|
|
35
|
+
reviewPolicy: GoalReviewPolicy;
|
|
36
|
+
sandboxPolicy: SandboxPolicy;
|
|
37
|
+
tools: ToolMode;
|
|
38
|
+
skills?: string[];
|
|
39
|
+
contextBlockIds?: string[];
|
|
40
|
+
/** Per-phase wall-clock override; default derived from task count. */
|
|
41
|
+
goalPhaseTimeoutMs?: number;
|
|
42
|
+
/** Idle-stall threshold for goal-mode sends; default max(perTaskIdle, 10m). */
|
|
43
|
+
goalIdleStallMs?: number;
|
|
44
|
+
/** Honored as a contract budget when present; otherwise uncapped (meter only). */
|
|
45
|
+
maxCostUSD?: number;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=goal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AM,CAAC;IAC5B,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal.js","sourceRoot":"","sources":["../../src/types/goal.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BriefQualityPolicy } from './brief-quality-policy.js';
|
|
2
|
+
import type { Goal } from './goal.js';
|
|
2
3
|
export type ToolMode = 'none' | 'readonly' | 'no-shell' | 'full';
|
|
3
4
|
export type SandboxPolicy = 'none' | 'cwd-only';
|
|
4
5
|
export type AgentType = 'standard' | 'complex';
|
|
@@ -79,5 +80,15 @@ export interface TaskSpec {
|
|
|
79
80
|
};
|
|
80
81
|
taskDescriptor?: string;
|
|
81
82
|
planBasename?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Write-route goal-set primitive. Set by each write route's buildGoal (via
|
|
85
|
+
* the single-brief slot). When present, the task is a goal-set: the implement
|
|
86
|
+
* stage sends the implement prompt (already materialized into `prompt`), and
|
|
87
|
+
* the review-fix stage + annotate read `goal` for phase-2 tier, conventions,
|
|
88
|
+
* and report rebuild. Absent on read routes.
|
|
89
|
+
*/
|
|
90
|
+
goal?: Goal;
|
|
91
|
+
/** Per-task idle-stall override (goal mode widens this); falls back to config default. */
|
|
92
|
+
idleStallMs?: number;
|
|
82
93
|
}
|
|
83
94
|
//# sourceMappingURL=task-spec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-spec.d.ts","sourceRoot":"","sources":["../../src/types/task-spec.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"task-spec.d.ts","sourceRoot":"","sources":["../../src/types/task-spec.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,E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E,kBAAkB,CAAA;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,gBAAgB,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;IAChG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;uFACmF;IACnF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QACT,gBAAgB,EAAE,MAAM,CAAC;QACzB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,qBAAqB,CAAC,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAChE,CAAA;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,0FAA0F;IAC1F,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { ReviewVerdict, StageName, RawStageStats, StageStatsMap, } from './types/stage-stats.js';
|
|
2
2
|
export type { ToolMode, SandboxPolicy, AgentType, Effort, CostTier, WorkerStatus, FormatConstraints, TaskSpec, } from './types/task-spec.js';
|
|
3
|
+
export type { Goal, GoalTask, GoalPhase, GoalSource, GoalPhaseMode, GoalReviewPolicy, } from './types/goal.js';
|
|
3
4
|
export type { AgentConfig, CodexProviderConfig, ClaudeProviderConfig, ProviderConfig, ResearchConfig, MultiModelConfig, } from './types/config.js';
|
|
4
5
|
export type { Commit, RunResult, RuntimeRunResult, ReviewPromptParts, CacheHints, ReviewRunOptions, Provider, } from './types/run-result.js';
|
|
5
6
|
export type { ErrorCode } from './error-codes.js';
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAK/B,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,aAAa,EACb,SAAS,EACT,aAAa,EACb,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,YAAY,EACV,QAAQ,EACR,aAAa,EACb,SAAS,EACT,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAK/B,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhixuan92/multi-model-agent-core",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Core library for multi-model-agent: provider runners (Claude, Codex, OpenAI-compatible), routing logic, config schema, and tool/sandbox primitives.",
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DiffTracker — snapshot files at task start, produce a cumulative
|
|
3
|
-
* unified diff at any point during the lifecycle.
|
|
4
|
-
*
|
|
5
|
-
* Tool sweep #6 motivation: every reviewer template (spec / quality /
|
|
6
|
-
* diff) was reviewing the worker's TEXT CLAIM about its work, not the
|
|
7
|
-
* actual change on disk. Result:
|
|
8
|
-
* - Spec reviewers defaulted to "changes_required" because they
|
|
9
|
-
* could not verify a claim they couldn't see → endless rework
|
|
10
|
-
* spirals on already-correct work.
|
|
11
|
-
* - Quality findings were rooted in the worker's prose summary
|
|
12
|
-
* rather than diff lines → false positives, missed regressions.
|
|
13
|
-
* - The "diff reviewer" did not actually receive a diff (a misnomer).
|
|
14
|
-
*
|
|
15
|
-
* Fix: every reviewer prompt now receives `cumulativeDiff` — the
|
|
16
|
-
* unified diff of every change made since task start, regardless of
|
|
17
|
-
* which rework round produced it. With evidence in hand the reviewer
|
|
18
|
-
* can be precise: "diff matches brief? approve" — single round, no
|
|
19
|
-
* spiral, no waste.
|
|
20
|
-
*
|
|
21
|
-
* "Cumulative" matters: across spec_rework rounds 1..N, the reviewer
|
|
22
|
-
* needs to see the totality of edits so it can confirm prior reworks'
|
|
23
|
-
* additions are still present. A latest-round-only diff would make
|
|
24
|
-
* the round-2 reviewer say "you didn't add Y" when round-1 actually
|
|
25
|
-
* did.
|
|
26
|
-
*
|
|
27
|
-
* Implementation choice: snapshot-based, NOT git-based.
|
|
28
|
-
* - Works in non-git directories (test fixtures, sandboxes,
|
|
29
|
-
* fresh-scaffold projects).
|
|
30
|
-
* - No assumption about HEAD state.
|
|
31
|
-
* - No mutation of `.git/` (no `add -N`, no temporary index entries).
|
|
32
|
-
* - Captures new files cleanly (baseline=null → full new-file diff).
|
|
33
|
-
*
|
|
34
|
-
* Diff format: unified diff (`@@ -before,count +after,count @@`)
|
|
35
|
-
* generated via Myers-style line LCS. The LLM is the consumer; the
|
|
36
|
-
* format is what every model has been trained on.
|
|
37
|
-
*
|
|
38
|
-
* Output cap: 50KB total. Excess is truncated with a "[diff truncated
|
|
39
|
-
* at 50KB — N more bytes elided]" marker so the LLM knows the diff is
|
|
40
|
-
* incomplete and can react accordingly (rather than silently judging
|
|
41
|
-
* a partial picture).
|
|
42
|
-
*/
|
|
43
|
-
export declare class DiffTracker {
|
|
44
|
-
private cwd;
|
|
45
|
-
private baselines;
|
|
46
|
-
constructor(cwd: string);
|
|
47
|
-
/**
|
|
48
|
-
* Capture current file content as the baseline. Idempotent: if a
|
|
49
|
-
* path was already snapshotted, the existing baseline wins (the
|
|
50
|
-
* earliest-known content is the canonical pre-task state).
|
|
51
|
-
*
|
|
52
|
-
* Call once at task start with all `task.filePaths`; call again
|
|
53
|
-
* lazily (via `ensureSnapshotted`) if a worker writes a path that
|
|
54
|
-
* wasn't pre-declared.
|
|
55
|
-
*/
|
|
56
|
-
snapshot(relativePaths: ReadonlyArray<string>): Promise<void>;
|
|
57
|
-
/**
|
|
58
|
-
* Defensive: if the worker writes a file that wasn't pre-declared
|
|
59
|
-
* in `task.filePaths`, we don't have a baseline for it. Capture
|
|
60
|
-
* one NOW (whatever the file's current state) so subsequent diffs
|
|
61
|
-
* show only what THIS rework round changed for it. This is a
|
|
62
|
-
* best-effort fallback; the operator should declare filePaths.
|
|
63
|
-
*/
|
|
64
|
-
ensureSnapshotted(relativePath: string): Promise<void>;
|
|
65
|
-
/** Return the unified diff of every snapshotted path against its
|
|
66
|
-
* current on-disk content. Empty string when nothing changed.
|
|
67
|
-
* Capped at MAX_DIFF_BYTES with a truncation marker.
|
|
68
|
-
*
|
|
69
|
-
* Snapshot-based diffs only cover the paths captured at task start
|
|
70
|
-
* (typically `task.filePaths`). For dispatch routes where the worker
|
|
71
|
-
* modifies files NOT pre-declared (notably `mma-execute-plan` —
|
|
72
|
-
* filePaths is the plan markdown, but the worker edits source files
|
|
73
|
-
* derived from the plan's own contents), the snapshot path returns
|
|
74
|
-
* empty even when the worker did real work.
|
|
75
|
-
*
|
|
76
|
-
* Fallback: when the snapshot diff is empty AND the cwd is inside a
|
|
77
|
-
* git repository, use `git diff HEAD` for tracked changes plus
|
|
78
|
-
* `git ls-files --others --exclude-standard` for new untracked files.
|
|
79
|
-
* This recovers the actual on-disk delta in the common case (any
|
|
80
|
-
* project under git) without false positives in test fixtures
|
|
81
|
-
* (temp dirs aren't git repos → fallback returns null → snapshot
|
|
82
|
-
* empty result preserved).
|
|
83
|
-
*/
|
|
84
|
-
cumulativeDiff(): Promise<string>;
|
|
85
|
-
/** Test hook: how many baselines have been captured. */
|
|
86
|
-
size(): number;
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=diff-tracker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff-tracker.d.ts","sourceRoot":"","sources":["../../src/lifecycle/diff-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAgBH,qBAAa,WAAW;IAGV,OAAO,CAAC,GAAG;IAFvB,OAAO,CAAC,SAAS,CAA+B;gBAE5B,GAAG,EAAE,MAAM;IAE/B;;;;;;;;OAQG;IACG,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAmBnE;;;;;;OAMG;IACG,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D;;;;;;;;;;;;;;;;;;OAkBG;IACG,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IA8BvC,wDAAwD;IACxD,IAAI,IAAI,MAAM;CAGf"}
|
|
@@ -1,429 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DiffTracker — snapshot files at task start, produce a cumulative
|
|
3
|
-
* unified diff at any point during the lifecycle.
|
|
4
|
-
*
|
|
5
|
-
* Tool sweep #6 motivation: every reviewer template (spec / quality /
|
|
6
|
-
* diff) was reviewing the worker's TEXT CLAIM about its work, not the
|
|
7
|
-
* actual change on disk. Result:
|
|
8
|
-
* - Spec reviewers defaulted to "changes_required" because they
|
|
9
|
-
* could not verify a claim they couldn't see → endless rework
|
|
10
|
-
* spirals on already-correct work.
|
|
11
|
-
* - Quality findings were rooted in the worker's prose summary
|
|
12
|
-
* rather than diff lines → false positives, missed regressions.
|
|
13
|
-
* - The "diff reviewer" did not actually receive a diff (a misnomer).
|
|
14
|
-
*
|
|
15
|
-
* Fix: every reviewer prompt now receives `cumulativeDiff` — the
|
|
16
|
-
* unified diff of every change made since task start, regardless of
|
|
17
|
-
* which rework round produced it. With evidence in hand the reviewer
|
|
18
|
-
* can be precise: "diff matches brief? approve" — single round, no
|
|
19
|
-
* spiral, no waste.
|
|
20
|
-
*
|
|
21
|
-
* "Cumulative" matters: across spec_rework rounds 1..N, the reviewer
|
|
22
|
-
* needs to see the totality of edits so it can confirm prior reworks'
|
|
23
|
-
* additions are still present. A latest-round-only diff would make
|
|
24
|
-
* the round-2 reviewer say "you didn't add Y" when round-1 actually
|
|
25
|
-
* did.
|
|
26
|
-
*
|
|
27
|
-
* Implementation choice: snapshot-based, NOT git-based.
|
|
28
|
-
* - Works in non-git directories (test fixtures, sandboxes,
|
|
29
|
-
* fresh-scaffold projects).
|
|
30
|
-
* - No assumption about HEAD state.
|
|
31
|
-
* - No mutation of `.git/` (no `add -N`, no temporary index entries).
|
|
32
|
-
* - Captures new files cleanly (baseline=null → full new-file diff).
|
|
33
|
-
*
|
|
34
|
-
* Diff format: unified diff (`@@ -before,count +after,count @@`)
|
|
35
|
-
* generated via Myers-style line LCS. The LLM is the consumer; the
|
|
36
|
-
* format is what every model has been trained on.
|
|
37
|
-
*
|
|
38
|
-
* Output cap: 50KB total. Excess is truncated with a "[diff truncated
|
|
39
|
-
* at 50KB — N more bytes elided]" marker so the LLM knows the diff is
|
|
40
|
-
* incomplete and can react accordingly (rather than silently judging
|
|
41
|
-
* a partial picture).
|
|
42
|
-
*/
|
|
43
|
-
import * as fs from 'node:fs/promises';
|
|
44
|
-
import * as path from 'node:path';
|
|
45
|
-
import { execFile } from 'node:child_process';
|
|
46
|
-
import { promisify } from 'node:util';
|
|
47
|
-
const execFileP = promisify(execFile);
|
|
48
|
-
const MAX_DIFF_BYTES = 50 * 1024; // 50KB cap to protect reviewer context window
|
|
49
|
-
const CONTEXT_LINES = 3; // unified-diff convention
|
|
50
|
-
export class DiffTracker {
|
|
51
|
-
cwd;
|
|
52
|
-
baselines = new Map();
|
|
53
|
-
constructor(cwd) {
|
|
54
|
-
this.cwd = cwd;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Capture current file content as the baseline. Idempotent: if a
|
|
58
|
-
* path was already snapshotted, the existing baseline wins (the
|
|
59
|
-
* earliest-known content is the canonical pre-task state).
|
|
60
|
-
*
|
|
61
|
-
* Call once at task start with all `task.filePaths`; call again
|
|
62
|
-
* lazily (via `ensureSnapshotted`) if a worker writes a path that
|
|
63
|
-
* wasn't pre-declared.
|
|
64
|
-
*/
|
|
65
|
-
async snapshot(relativePaths) {
|
|
66
|
-
for (const rel of relativePaths) {
|
|
67
|
-
if (this.baselines.has(rel))
|
|
68
|
-
continue;
|
|
69
|
-
const abs = path.resolve(this.cwd, rel);
|
|
70
|
-
try {
|
|
71
|
-
const content = await fs.readFile(abs, 'utf-8');
|
|
72
|
-
this.baselines.set(rel, content);
|
|
73
|
-
}
|
|
74
|
-
catch (e) {
|
|
75
|
-
if (e.code === 'ENOENT') {
|
|
76
|
-
// File didn't exist at task start. Worker may create it →
|
|
77
|
-
// diff later will show as a full new-file diff.
|
|
78
|
-
this.baselines.set(rel, null);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
throw e;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Defensive: if the worker writes a file that wasn't pre-declared
|
|
88
|
-
* in `task.filePaths`, we don't have a baseline for it. Capture
|
|
89
|
-
* one NOW (whatever the file's current state) so subsequent diffs
|
|
90
|
-
* show only what THIS rework round changed for it. This is a
|
|
91
|
-
* best-effort fallback; the operator should declare filePaths.
|
|
92
|
-
*/
|
|
93
|
-
async ensureSnapshotted(relativePath) {
|
|
94
|
-
if (this.baselines.has(relativePath))
|
|
95
|
-
return;
|
|
96
|
-
await this.snapshot([relativePath]);
|
|
97
|
-
}
|
|
98
|
-
/** Return the unified diff of every snapshotted path against its
|
|
99
|
-
* current on-disk content. Empty string when nothing changed.
|
|
100
|
-
* Capped at MAX_DIFF_BYTES with a truncation marker.
|
|
101
|
-
*
|
|
102
|
-
* Snapshot-based diffs only cover the paths captured at task start
|
|
103
|
-
* (typically `task.filePaths`). For dispatch routes where the worker
|
|
104
|
-
* modifies files NOT pre-declared (notably `mma-execute-plan` —
|
|
105
|
-
* filePaths is the plan markdown, but the worker edits source files
|
|
106
|
-
* derived from the plan's own contents), the snapshot path returns
|
|
107
|
-
* empty even when the worker did real work.
|
|
108
|
-
*
|
|
109
|
-
* Fallback: when the snapshot diff is empty AND the cwd is inside a
|
|
110
|
-
* git repository, use `git diff HEAD` for tracked changes plus
|
|
111
|
-
* `git ls-files --others --exclude-standard` for new untracked files.
|
|
112
|
-
* This recovers the actual on-disk delta in the common case (any
|
|
113
|
-
* project under git) without false positives in test fixtures
|
|
114
|
-
* (temp dirs aren't git repos → fallback returns null → snapshot
|
|
115
|
-
* empty result preserved).
|
|
116
|
-
*/
|
|
117
|
-
async cumulativeDiff() {
|
|
118
|
-
const segments = [];
|
|
119
|
-
for (const [rel, before] of this.baselines.entries()) {
|
|
120
|
-
const abs = path.resolve(this.cwd, rel);
|
|
121
|
-
let after;
|
|
122
|
-
try {
|
|
123
|
-
after = await fs.readFile(abs, 'utf-8');
|
|
124
|
-
}
|
|
125
|
-
catch (e) {
|
|
126
|
-
if (e.code === 'ENOENT')
|
|
127
|
-
after = null;
|
|
128
|
-
else
|
|
129
|
-
throw e;
|
|
130
|
-
}
|
|
131
|
-
if (before === after)
|
|
132
|
-
continue;
|
|
133
|
-
const seg = formatUnifiedDiff(rel, before, after);
|
|
134
|
-
if (seg)
|
|
135
|
-
segments.push(seg);
|
|
136
|
-
}
|
|
137
|
-
let result = segments.join('\n\n');
|
|
138
|
-
// 4.2.3+ git fallback: snapshot diff is empty (no pre-declared paths
|
|
139
|
-
// changed) — try git for the on-disk delta. Cheap, idempotent, no
|
|
140
|
-
// mutation. Only fires when snapshot returned nothing, so projects
|
|
141
|
-
// that DO have proper filePaths snapshotting see no behavior change.
|
|
142
|
-
if (result === '') {
|
|
143
|
-
const gitDiff = await tryGitDiff(this.cwd);
|
|
144
|
-
if (gitDiff !== null && gitDiff.trim().length > 0) {
|
|
145
|
-
result = gitDiff;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return capWithMarker(result);
|
|
149
|
-
}
|
|
150
|
-
/** Test hook: how many baselines have been captured. */
|
|
151
|
-
size() {
|
|
152
|
-
return this.baselines.size;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
function capWithMarker(s) {
|
|
156
|
-
if (s.length <= MAX_DIFF_BYTES)
|
|
157
|
-
return s;
|
|
158
|
-
const elided = s.length - MAX_DIFF_BYTES;
|
|
159
|
-
return s.slice(0, MAX_DIFF_BYTES) + `\n\n[diff truncated at ${MAX_DIFF_BYTES} bytes — ${elided} more bytes elided]`;
|
|
160
|
-
}
|
|
161
|
-
/** Unified-diff for one file. */
|
|
162
|
-
function formatUnifiedDiff(relPath, before, after) {
|
|
163
|
-
if (before === after)
|
|
164
|
-
return '';
|
|
165
|
-
const beforeLines = before === null ? [] : splitKeepNewlines(before);
|
|
166
|
-
const afterLines = after === null ? [] : splitKeepNewlines(after);
|
|
167
|
-
const aLabel = before === null ? '/dev/null' : `a/${relPath}`;
|
|
168
|
-
const bLabel = after === null ? '/dev/null' : `b/${relPath}`;
|
|
169
|
-
const ops = lineDiff(beforeLines, afterLines);
|
|
170
|
-
const hunks = collectHunks(ops, CONTEXT_LINES);
|
|
171
|
-
if (hunks.length === 0)
|
|
172
|
-
return '';
|
|
173
|
-
const out = [];
|
|
174
|
-
out.push(`--- ${aLabel}`);
|
|
175
|
-
out.push(`+++ ${bLabel}`);
|
|
176
|
-
for (const h of hunks) {
|
|
177
|
-
out.push(`@@ -${h.beforeStart + 1},${h.beforeCount} +${h.afterStart + 1},${h.afterCount} @@`);
|
|
178
|
-
for (const line of h.lines)
|
|
179
|
-
out.push(line);
|
|
180
|
-
}
|
|
181
|
-
return out.join('\n');
|
|
182
|
-
}
|
|
183
|
-
function splitKeepNewlines(s) {
|
|
184
|
-
// Split into logical lines. Trailing newline is preserved on each
|
|
185
|
-
// line except the last (which may or may not have one, like POSIX).
|
|
186
|
-
if (s === '')
|
|
187
|
-
return [];
|
|
188
|
-
const out = s.split('\n');
|
|
189
|
-
// If original ended with \n, the split produces a trailing '' which
|
|
190
|
-
// represents "the final newline" — drop it (unified diff lines DON'T
|
|
191
|
-
// include the trailing newline; it's implicit).
|
|
192
|
-
if (out.length > 0 && out[out.length - 1] === '')
|
|
193
|
-
out.pop();
|
|
194
|
-
return out;
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Line-level diff using a simple LCS (Hirschberg / dynamic-programming).
|
|
198
|
-
* Returns ops in document order. For typical edits (a few lines changed
|
|
199
|
-
* in a file of hundreds of lines) this is O(N×M) but with N×M small.
|
|
200
|
-
* For huge files it's still bounded — the result is line-count
|
|
201
|
-
* sensitive, not byte-count sensitive.
|
|
202
|
-
*/
|
|
203
|
-
function lineDiff(a, b) {
|
|
204
|
-
const n = a.length;
|
|
205
|
-
const m = b.length;
|
|
206
|
-
// Build LCS length matrix.
|
|
207
|
-
const dp = Array.from({ length: n + 1 }, () => new Array(m + 1).fill(0));
|
|
208
|
-
for (let i = n - 1; i >= 0; i--) {
|
|
209
|
-
for (let j = m - 1; j >= 0; j--) {
|
|
210
|
-
if (a[i] === b[j])
|
|
211
|
-
dp[i][j] = dp[i + 1][j + 1] + 1;
|
|
212
|
-
else
|
|
213
|
-
dp[i][j] = Math.max(dp[i + 1][j], dp[i][j + 1]);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
// Backtrack to produce ops.
|
|
217
|
-
const ops = [];
|
|
218
|
-
let i = 0, j = 0;
|
|
219
|
-
while (i < n && j < m) {
|
|
220
|
-
if (a[i] === b[j]) {
|
|
221
|
-
ops.push({ kind: 'equal', text: a[i] });
|
|
222
|
-
i++;
|
|
223
|
-
j++;
|
|
224
|
-
}
|
|
225
|
-
else if (dp[i + 1][j] >= dp[i][j + 1]) {
|
|
226
|
-
ops.push({ kind: 'delete', text: a[i] });
|
|
227
|
-
i++;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
ops.push({ kind: 'insert', text: b[j] });
|
|
231
|
-
j++;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
while (i < n)
|
|
235
|
-
ops.push({ kind: 'delete', text: a[i++] });
|
|
236
|
-
while (j < m)
|
|
237
|
-
ops.push({ kind: 'insert', text: b[j++] });
|
|
238
|
-
return ops;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Group ops into unified-diff hunks with `context` lines of unchanged
|
|
242
|
-
* surrounding code. Skip pure-equal stretches longer than 2×context.
|
|
243
|
-
*/
|
|
244
|
-
function collectHunks(ops, context) {
|
|
245
|
-
const hunks = [];
|
|
246
|
-
let i = 0;
|
|
247
|
-
let beforeIdx = 0; // 0-based line index into the "before" file
|
|
248
|
-
let afterIdx = 0;
|
|
249
|
-
while (i < ops.length) {
|
|
250
|
-
// Skip purely-equal runs up to first change.
|
|
251
|
-
while (i < ops.length && ops[i].kind === 'equal') {
|
|
252
|
-
// Tentatively advance — but if a change is within `context`
|
|
253
|
-
// ahead, we'll back off to include it as preceding-context.
|
|
254
|
-
let lookahead = i;
|
|
255
|
-
while (lookahead < ops.length && lookahead < i + context && ops[lookahead].kind === 'equal')
|
|
256
|
-
lookahead++;
|
|
257
|
-
if (lookahead < ops.length && ops[lookahead].kind !== 'equal')
|
|
258
|
-
break;
|
|
259
|
-
beforeIdx++;
|
|
260
|
-
afterIdx++;
|
|
261
|
-
i++;
|
|
262
|
-
}
|
|
263
|
-
if (i >= ops.length)
|
|
264
|
-
break;
|
|
265
|
-
// Start a hunk. Include up to `context` preceding equal lines.
|
|
266
|
-
const hunkLines = [];
|
|
267
|
-
let preStart = Math.max(0, i - context);
|
|
268
|
-
// Walk back to preStart, but only include 'equal' ops on the way.
|
|
269
|
-
// Use bookkeeping: how many equal lines we step back.
|
|
270
|
-
const preLines = [];
|
|
271
|
-
let walkBack = i - 1;
|
|
272
|
-
while (walkBack >= preStart && ops[walkBack].kind === 'equal' && preLines.length < context) {
|
|
273
|
-
preLines.unshift(' ' + ops[walkBack].text);
|
|
274
|
-
walkBack--;
|
|
275
|
-
}
|
|
276
|
-
const hunkBeforeStart = beforeIdx - preLines.length;
|
|
277
|
-
const hunkAfterStart = afterIdx - preLines.length;
|
|
278
|
-
hunkLines.push(...preLines);
|
|
279
|
-
// Walk forward, collecting changes + interleaved equals (up to
|
|
280
|
-
// 2×context equals before splitting into a new hunk).
|
|
281
|
-
let beforeCount = preLines.length;
|
|
282
|
-
let afterCount = preLines.length;
|
|
283
|
-
let trailingEqualCount = 0;
|
|
284
|
-
while (i < ops.length) {
|
|
285
|
-
const op = ops[i];
|
|
286
|
-
if (op.kind === 'equal') {
|
|
287
|
-
if (trailingEqualCount >= 2 * context) {
|
|
288
|
-
// Decide whether to split: peek to see if more changes coming.
|
|
289
|
-
let look = i;
|
|
290
|
-
while (look < ops.length && ops[look].kind === 'equal')
|
|
291
|
-
look++;
|
|
292
|
-
if (look >= ops.length || look - i > context) {
|
|
293
|
-
// No more changes within range — close the hunk with `context` trailing.
|
|
294
|
-
break;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
hunkLines.push(' ' + op.text);
|
|
298
|
-
beforeCount++;
|
|
299
|
-
afterCount++;
|
|
300
|
-
beforeIdx++;
|
|
301
|
-
afterIdx++;
|
|
302
|
-
trailingEqualCount++;
|
|
303
|
-
i++;
|
|
304
|
-
}
|
|
305
|
-
else if (op.kind === 'delete') {
|
|
306
|
-
hunkLines.push('-' + op.text);
|
|
307
|
-
beforeCount++;
|
|
308
|
-
beforeIdx++;
|
|
309
|
-
trailingEqualCount = 0;
|
|
310
|
-
i++;
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
// insert
|
|
314
|
-
hunkLines.push('+' + op.text);
|
|
315
|
-
afterCount++;
|
|
316
|
-
afterIdx++;
|
|
317
|
-
trailingEqualCount = 0;
|
|
318
|
-
i++;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
// Trim trailing context to exactly `context` lines if we accumulated more.
|
|
322
|
-
while (trailingEqualCount > context) {
|
|
323
|
-
const last = hunkLines[hunkLines.length - 1];
|
|
324
|
-
if (last.startsWith(' ')) {
|
|
325
|
-
hunkLines.pop();
|
|
326
|
-
beforeCount--;
|
|
327
|
-
afterCount--;
|
|
328
|
-
trailingEqualCount--;
|
|
329
|
-
beforeIdx--;
|
|
330
|
-
afterIdx--;
|
|
331
|
-
i--;
|
|
332
|
-
}
|
|
333
|
-
else
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
hunks.push({
|
|
337
|
-
beforeStart: hunkBeforeStart,
|
|
338
|
-
beforeCount,
|
|
339
|
-
afterStart: hunkAfterStart,
|
|
340
|
-
afterCount,
|
|
341
|
-
lines: hunkLines,
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
return hunks;
|
|
345
|
-
}
|
|
346
|
-
/**
|
|
347
|
-
* Git-based fallback for `cumulativeDiff()` (4.2.3+). Returns:
|
|
348
|
-
* - null when cwd isn't inside a git repo, or git isn't on PATH, or
|
|
349
|
-
* anything goes wrong (caller treats as "no fallback available")
|
|
350
|
-
* - empty string when cwd IS in a git repo but the worktree is clean
|
|
351
|
-
* - non-empty diff otherwise
|
|
352
|
-
*
|
|
353
|
-
* Combines `git diff HEAD` (tracked modifications + staged changes) with
|
|
354
|
-
* synthesized full-file diffs for untracked files (so newly-created files
|
|
355
|
-
* the worker added show up in the reviewer's diff just like modifications
|
|
356
|
-
* do — same `+++ b/path / @@ -0,0 +N,N @@` shape).
|
|
357
|
-
*
|
|
358
|
-
* Only called when snapshot-based diff is empty, so this never adds noise
|
|
359
|
-
* to runs where the operator declared filePaths properly. Adds zero cost
|
|
360
|
-
* for the common case (snapshot diff non-empty).
|
|
361
|
-
*/
|
|
362
|
-
async function tryGitDiff(cwd) {
|
|
363
|
-
try {
|
|
364
|
-
// Confirm we're in a git work tree. exitCode 0 + stdout 'true' = yes.
|
|
365
|
-
const { stdout: insideOut } = await execFileP('git', ['rev-parse', '--is-inside-work-tree'], {
|
|
366
|
-
cwd, encoding: 'utf-8', timeout: 5000, windowsHide: true,
|
|
367
|
-
});
|
|
368
|
-
if (insideOut.trim() !== 'true')
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
catch {
|
|
372
|
-
// Not a git repo, or git not on PATH, or rev-parse failed. No fallback.
|
|
373
|
-
return null;
|
|
374
|
-
}
|
|
375
|
-
let trackedDiff = '';
|
|
376
|
-
try {
|
|
377
|
-
const { stdout } = await execFileP('git', ['diff', 'HEAD'], {
|
|
378
|
-
cwd, encoding: 'utf-8', timeout: 10_000, maxBuffer: MAX_DIFF_BYTES * 4, windowsHide: true,
|
|
379
|
-
});
|
|
380
|
-
trackedDiff = stdout;
|
|
381
|
-
}
|
|
382
|
-
catch {
|
|
383
|
-
// Worktree exists but `git diff HEAD` failed (e.g. no commits yet).
|
|
384
|
-
// Try plain `git diff` (working tree vs index) as a softer fallback.
|
|
385
|
-
try {
|
|
386
|
-
const { stdout } = await execFileP('git', ['diff'], {
|
|
387
|
-
cwd, encoding: 'utf-8', timeout: 10_000, maxBuffer: MAX_DIFF_BYTES * 4, windowsHide: true,
|
|
388
|
-
});
|
|
389
|
-
trackedDiff = stdout;
|
|
390
|
-
}
|
|
391
|
-
catch {
|
|
392
|
-
trackedDiff = '';
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
// Untracked files — render each as a full new-file diff so reviewers see
|
|
396
|
-
// them with the same shape as modifications.
|
|
397
|
-
let untrackedDiff = '';
|
|
398
|
-
try {
|
|
399
|
-
const { stdout } = await execFileP('git', ['ls-files', '--others', '--exclude-standard'], {
|
|
400
|
-
cwd, encoding: 'utf-8', timeout: 5000, windowsHide: true,
|
|
401
|
-
});
|
|
402
|
-
const paths = stdout.split('\n').map(p => p.trim()).filter(p => p.length > 0);
|
|
403
|
-
for (const rel of paths) {
|
|
404
|
-
try {
|
|
405
|
-
const abs = path.resolve(cwd, rel);
|
|
406
|
-
const content = await fs.readFile(abs, 'utf-8');
|
|
407
|
-
const seg = formatUnifiedDiff(rel, null, content);
|
|
408
|
-
if (seg) {
|
|
409
|
-
if (untrackedDiff.length > 0)
|
|
410
|
-
untrackedDiff += '\n\n';
|
|
411
|
-
untrackedDiff += seg;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
catch {
|
|
415
|
-
// Non-text file or unreadable — skip.
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
catch {
|
|
420
|
-
untrackedDiff = '';
|
|
421
|
-
}
|
|
422
|
-
const parts = [];
|
|
423
|
-
if (trackedDiff.trim().length > 0)
|
|
424
|
-
parts.push(trackedDiff);
|
|
425
|
-
if (untrackedDiff.trim().length > 0)
|
|
426
|
-
parts.push(untrackedDiff);
|
|
427
|
-
return parts.join('\n\n');
|
|
428
|
-
}
|
|
429
|
-
//# sourceMappingURL=diff-tracker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff-tracker.js","sourceRoot":"","sources":["../../src/lifecycle/diff-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEtC,MAAM,cAAc,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,8CAA8C;AAChF,MAAM,aAAa,GAAG,CAAC,CAAC,CAAU,0BAA0B;AAM5D,MAAM,OAAO,WAAW;IAGF;IAFZ,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;IAEhD,YAAoB,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;IAAG,CAAC;IAEnC;;;;;;;;OAQG;IACH,KAAK,CAAC,QAAQ,CAAC,aAAoC;QACjD,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;YAChC,IAAI,IAAI,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