@ygrishajev/jig 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +135 -2
- package/dist/adapters/find-symlink.js +23 -0
- package/dist/adapters/git/git-workspace.js +297 -0
- package/dist/adapters/local-store/credentials-file.js +51 -0
- package/dist/adapters/local-store/local-run-store.js +45 -0
- package/dist/adapters/local-store/local-state.js +12 -0
- package/dist/adapters/local-store/metrics-log.js +119 -0
- package/dist/adapters/local-store/run-artefacts.js +76 -0
- package/dist/adapters/local-store/run-lock.js +51 -0
- package/dist/adapters/local-store/run-paths.js +49 -0
- package/dist/adapters/logging/create-logger.js +29 -0
- package/dist/adapters/run-store/composite-run-store.js +57 -0
- package/dist/adapters/run-store/git-remote-run-store.js +239 -0
- package/dist/adapters/sandbox-image/docker-images.js +93 -0
- package/dist/adapters/sandbox-image/image-recipe.js +96 -0
- package/dist/adapters/sandbox-image/latest-agent-versions.js +9 -0
- package/dist/adapters/sandcastle/agents.js +100 -0
- package/dist/adapters/sandcastle/codex-auth.js +191 -0
- package/dist/adapters/sandcastle/git-hooks.js +20 -0
- package/dist/adapters/sandcastle/open-session.js +67 -0
- package/dist/adapters/sandcastle/private-clone-docker.js +232 -0
- package/dist/adapters/sandcastle/sandcastle-env.js +17 -0
- package/dist/adapters/sandcastle/sandcastle-session.js +338 -0
- package/dist/adapters/sandcastle/structured-output.js +35 -0
- package/dist/adapters/sandcastle/usage.js +65 -0
- package/dist/adapters/telemetry/open-telemetry.js +29 -0
- package/dist/adapters/terminal/ask-for-agents.js +61 -0
- package/dist/adapters/terminal/ask-for-credential.js +32 -0
- package/dist/adapters/terminal/ask-for-preset.js +15 -0
- package/dist/adapters/terminal/standard-input.js +7 -0
- package/dist/adapters/terminal/terminal.js +45 -0
- package/dist/app/container.js +131 -0
- package/dist/app/init-sandbox.js +185 -0
- package/dist/app/observed-events.js +10 -0
- package/dist/app/report-cleanup.js +10 -0
- package/dist/app/run-jig.js +101 -0
- package/dist/app/run-status.js +20 -0
- package/dist/app/run-stores.js +107 -0
- package/dist/app/sandbox-image.js +151 -0
- package/dist/app/throwaway-sandbox.js +49 -0
- package/dist/cli/app-action.js +18 -0
- package/dist/cli/commands/presets.js +32 -0
- package/dist/cli/commands/run.js +82 -0
- package/dist/cli/commands/sandbox.js +54 -0
- package/dist/cli/commands/status.js +41 -0
- package/dist/cli/config-option.js +18 -0
- package/dist/cli/exit-when-done.js +11 -0
- package/dist/cli/log-format-option.js +14 -0
- package/dist/cli/main.js +33 -0
- package/dist/cli/read-request.js +36 -0
- package/dist/cli/with-app.js +73 -0
- package/dist/cli/with-error-handling.js +31 -0
- package/dist/cli/with-input.js +27 -0
- package/dist/config/describe-issues.js +6 -0
- package/dist/config/environment.js +53 -0
- package/dist/config/load-config.js +122 -0
- package/dist/config/presets.js +150 -0
- package/dist/config/write-config.js +39 -0
- package/dist/domain/agent-role.js +12 -0
- package/dist/domain/apply-outcome.js +132 -0
- package/dist/domain/completion-reuse.js +176 -0
- package/dist/domain/design-docs.js +3 -0
- package/dist/domain/design-review-report.js +86 -0
- package/dist/domain/design-review.js +193 -0
- package/dist/domain/errors.js +139 -0
- package/dist/domain/events.js +8 -0
- package/dist/domain/final-check.js +133 -0
- package/dist/domain/outcome.js +26 -0
- package/dist/domain/plan-coverage.js +129 -0
- package/dist/domain/protected-paths.js +35 -0
- package/dist/domain/retry.js +21 -0
- package/dist/domain/run-id.js +42 -0
- package/dist/domain/run-state.js +147 -0
- package/dist/domain/settings.js +49 -0
- package/dist/domain/slice.js +63 -0
- package/dist/domain/usage.js +1 -0
- package/dist/domain/work-facts.js +22 -0
- package/dist/flow/define-flow.js +11 -0
- package/dist/flow/engine.js +255 -0
- package/dist/flow/run-flow.js +129 -0
- package/dist/git/branch.js +26 -0
- package/dist/git/merge.js +92 -0
- package/dist/git/repository.js +48 -0
- package/dist/git/throwaway-branch.js +64 -0
- package/dist/observers/logging-observer.js +51 -0
- package/dist/observers/metrics.js +109 -0
- package/dist/observers/run-events.js +25 -0
- package/dist/observers/tracing-observer.js +86 -0
- package/dist/ports/agent-session.js +1 -0
- package/dist/ports/observability.js +1 -0
- package/dist/ports/run-store.js +1 -0
- package/dist/ports/sandbox-git.js +1 -0
- package/dist/ports/sandbox-images.js +1 -0
- package/dist/ports/workspace.js +1 -0
- package/dist/prompts/design-review.js +172 -0
- package/dist/prompts/final-check.js +58 -0
- package/dist/prompts/planning.js +111 -0
- package/dist/prompts/pull-request.js +78 -0
- package/dist/prompts/slice.js +254 -0
- package/dist/prompts/toolchain.js +37 -0
- package/dist/steps/completion-reuse.js +32 -0
- package/dist/steps/design-review.js +38 -0
- package/dist/steps/final-check.js +39 -0
- package/dist/steps/finishing.js +72 -0
- package/dist/steps/planning.js +77 -0
- package/dist/steps/pull-request-description.js +142 -0
- package/dist/steps/slice.js +149 -0
- package/package.json +95 -4
- package/presets/cheap-volume.json +7 -0
- package/presets/claude-only.json +7 -0
- package/presets/codex-only.json +7 -0
- package/presets/codex-reviewed-opencode.json +7 -0
- package/presets/full-power-codex.json +7 -0
- package/presets/full-power.json +7 -0
- package/presets/long-claude.json +7 -0
- package/presets/open-weight.json +7 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { reusedCompletion, reusedCompletionReport, } from '../domain/completion-reuse.js';
|
|
2
|
+
import { unresolvedFindings, wholeRunFulfillment, wholeRunVerification, } from '../domain/final-check.js';
|
|
3
|
+
import { sliceStopReason } from '../domain/settings.js';
|
|
4
|
+
import { slicesInOrder } from '../domain/slice.js';
|
|
5
|
+
export const DEFAULT_PR_TEMPLATE = [
|
|
6
|
+
'## What',
|
|
7
|
+
'',
|
|
8
|
+
'<!-- The result, in plain words: what a user or operator can do or see now. No code, paths or jargon. -->',
|
|
9
|
+
'',
|
|
10
|
+
'## Why',
|
|
11
|
+
'',
|
|
12
|
+
'<!-- The motivation, in plain words. -->',
|
|
13
|
+
'',
|
|
14
|
+
'## How',
|
|
15
|
+
'',
|
|
16
|
+
'<!-- For reviewers: the approach and the notable decisions, a few lines. -->',
|
|
17
|
+
'',
|
|
18
|
+
'## Verification',
|
|
19
|
+
'',
|
|
20
|
+
'<!-- The commands that were run and what they reported. Say what could not be run. -->',
|
|
21
|
+
'',
|
|
22
|
+
'## Deletions and deviations',
|
|
23
|
+
'',
|
|
24
|
+
'<!-- Requirements not met or changed, work left unfinished and why. Write "None" if none. -->',
|
|
25
|
+
].join('\n');
|
|
26
|
+
/**
|
|
27
|
+
* The describer's filled-in template, or — when it failed — the repo's own template, or a plain
|
|
28
|
+
* summary; jig's own verification report, from the recorded run state rather than the describer's
|
|
29
|
+
* claims; what the whole-run final check decided; the findings it left under a heading jig owns;
|
|
30
|
+
* then the agent run, design and plan, collapsed.
|
|
31
|
+
*/
|
|
32
|
+
export function renderPullRequest(state, input) {
|
|
33
|
+
const lead = input.filled ?? input.template ?? plainSummary(state);
|
|
34
|
+
return [
|
|
35
|
+
lead,
|
|
36
|
+
verificationBlock(state.slices, input.verifyCommand),
|
|
37
|
+
wholeRunBlock(state),
|
|
38
|
+
...deviationsBlock(state.finalCheck),
|
|
39
|
+
collapsed('Agent run', agentRun(state)),
|
|
40
|
+
...planningDocs(state),
|
|
41
|
+
]
|
|
42
|
+
.join('\n\n')
|
|
43
|
+
.trimEnd();
|
|
44
|
+
}
|
|
45
|
+
function plainSummary({ plan }) {
|
|
46
|
+
return ['## Summary', '', plan.summary, '', '## Approach', '', plan.approach].join('\n');
|
|
47
|
+
}
|
|
48
|
+
function verificationBlock(slices, verifyCommand) {
|
|
49
|
+
return ['### Verification by jig', '', verificationReport(slices, verifyCommand)].join('\n');
|
|
50
|
+
}
|
|
51
|
+
/** What jig itself verified, per slice from the recorded run state — never the describer's claims. */
|
|
52
|
+
function verificationReport(slices, verifyCommand) {
|
|
53
|
+
if (!verifyCommand)
|
|
54
|
+
return 'No verify command is configured, so jig ran no checks.';
|
|
55
|
+
const ordered = slicesInOrder(slices);
|
|
56
|
+
const command = ordered[0]?.verification?.command;
|
|
57
|
+
if (command !== undefined &&
|
|
58
|
+
ordered.every((slice) => slice.status === 'approved' && slice.verification?.command === command)) {
|
|
59
|
+
return `\`${command}\` passed in the sandbox on every slice (${ordered.length}/${ordered.length}).`;
|
|
60
|
+
}
|
|
61
|
+
return ordered
|
|
62
|
+
.map((slice) => slice.verification
|
|
63
|
+
? `- \`${slice.id}\`: \`${slice.verification.command}\` passed`
|
|
64
|
+
: `- \`${slice.id}\`: not verified (${slice.status})`)
|
|
65
|
+
.join('\n');
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* What the whole-run final check decided, from the recorded result; a run that finished on its
|
|
69
|
+
* combined review's evidence reports that evidence instead, and a run with neither — a legacy save
|
|
70
|
+
* or a slice that got stuck before the check — reports the check as not run.
|
|
71
|
+
*/
|
|
72
|
+
function wholeRunBlock(state) {
|
|
73
|
+
const reused = reusedCompletion(state);
|
|
74
|
+
if (reused !== undefined)
|
|
75
|
+
return reusedCompletionBlock(reused);
|
|
76
|
+
return finalCheckBlock(state.finalCheck);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* A reused completion with its source evidence. Commits and ranges are written bare, so the forge
|
|
80
|
+
* links each to the commit or comparison it names.
|
|
81
|
+
*/
|
|
82
|
+
function reusedCompletionBlock(evidence) {
|
|
83
|
+
return [
|
|
84
|
+
'### Whole-run final check (reused from the slice review)',
|
|
85
|
+
'',
|
|
86
|
+
...reusedCompletionReport(evidence),
|
|
87
|
+
'',
|
|
88
|
+
'Source evidence:',
|
|
89
|
+
`- Reviewed range: ${evidence.scope.range.start}...${evidence.scope.range.end}`,
|
|
90
|
+
`- Reviewed work: commit ${evidence.checked.commit}, tree \`${evidence.checked.tree}\``,
|
|
91
|
+
...verificationSource(evidence.verification),
|
|
92
|
+
].join('\n');
|
|
93
|
+
}
|
|
94
|
+
function verificationSource(verification) {
|
|
95
|
+
const at = verification?.observed?.after.host.commit;
|
|
96
|
+
if (verification === undefined || at === undefined)
|
|
97
|
+
return [];
|
|
98
|
+
return [`- Verification: \`${verification.command}\` passed at commit ${at}`];
|
|
99
|
+
}
|
|
100
|
+
function finalCheckBlock(finalCheck) {
|
|
101
|
+
const heading = finalCheck === undefined
|
|
102
|
+
? '### Whole-run final check'
|
|
103
|
+
: `### Whole-run final check (round ${finalCheck.round})`;
|
|
104
|
+
const report = finalCheck === undefined
|
|
105
|
+
? 'The whole-run final check did not run.'
|
|
106
|
+
: [wholeRunVerification(finalCheck), wholeRunFulfillment(finalCheck)].join('\n');
|
|
107
|
+
return [heading, '', report].join('\n');
|
|
108
|
+
}
|
|
109
|
+
/** The whole-run findings under a heading jig owns, shown whatever the describer or template did. */
|
|
110
|
+
function deviationsBlock(finalCheck) {
|
|
111
|
+
if (finalCheck === undefined)
|
|
112
|
+
return [];
|
|
113
|
+
const findings = unresolvedFindings(finalCheck);
|
|
114
|
+
if (findings.length === 0)
|
|
115
|
+
return [];
|
|
116
|
+
return [['### Deviations by jig', '', ...findings].join('\n')];
|
|
117
|
+
}
|
|
118
|
+
function collapsed(title, body) {
|
|
119
|
+
return ['<details>', `<summary>${title}</summary>`, '', body, '', '</details>'].join('\n');
|
|
120
|
+
}
|
|
121
|
+
function agentRun({ plan, slices }) {
|
|
122
|
+
return [`**${plan.summary}**`, '', plan.approach, '', sliceChecklist(slices)].join('\n');
|
|
123
|
+
}
|
|
124
|
+
/** A blocked run is read from here alone, so a stuck slice keeps its reviewer feedback under it. */
|
|
125
|
+
function sliceChecklist(slices) {
|
|
126
|
+
const lines = slicesInOrder(slices).flatMap((slice) => {
|
|
127
|
+
const line = `- [${slice.status === 'approved' ? 'x' : ' '}] ${slice.id} — ${slice.description.split('\n')[0]}`;
|
|
128
|
+
const reason = slice.status === 'stuck' ? ` Stopped: ${sliceStopReason(slice)}.` : undefined;
|
|
129
|
+
const entry = reason ? [line, reason] : [line];
|
|
130
|
+
if (!slice.lastFeedback)
|
|
131
|
+
return entry;
|
|
132
|
+
const quoted = slice.lastFeedback
|
|
133
|
+
.split('\n')
|
|
134
|
+
.map((feedbackLine) => ` > ${feedbackLine}`)
|
|
135
|
+
.join('\n');
|
|
136
|
+
return [...entry, ` **[${slice.status}]** feedback:`, quoted];
|
|
137
|
+
});
|
|
138
|
+
return ['### Slices', '', ...lines].join('\n');
|
|
139
|
+
}
|
|
140
|
+
function planningDocs({ docs }) {
|
|
141
|
+
return [collapsed('Design', docs.design.trim()), collapsed('Plan', docs.plan.trim())];
|
|
142
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { Result } from 'better-result';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { completionEvidenceOf, wholeRequestOf, } from '../domain/completion-reuse.js';
|
|
4
|
+
import { AgentOutputInvalid, CommitRejected, } from '../domain/errors.js';
|
|
5
|
+
import { fulfillmentVerdictSchema } from '../domain/final-check.js';
|
|
6
|
+
import { protectedChanges } from '../domain/protected-paths.js';
|
|
7
|
+
import { slicesInOrder } from '../domain/slice.js';
|
|
8
|
+
import { combinedReviewPrompt, commitRejectedFeedback, implementPrompt, nothingChangedFeedback, reviewPrompt, verifyFailedFeedback, } from '../prompts/slice.js';
|
|
9
|
+
export const implementSlice = ({ state, slice, settings, ports }) => Result.gen(async function* () {
|
|
10
|
+
const { workspace } = ports;
|
|
11
|
+
const attemptStart = yield* Result.await(workspace.headCommit());
|
|
12
|
+
const reply = await ports.agent.runForOutput({
|
|
13
|
+
role: 'implementer',
|
|
14
|
+
prompt: implementPrompt(slice, settings.verifyCommand),
|
|
15
|
+
schema: implementerReplySchema,
|
|
16
|
+
});
|
|
17
|
+
const message = yield* commitMessageOf(reply, slice);
|
|
18
|
+
const approved = yield* Result.await(sliceStart(state, slice, ports));
|
|
19
|
+
const saved = await workspace.saveWork(message, { approved });
|
|
20
|
+
if (saved.isErr() && CommitRejected.is(saved.error)) {
|
|
21
|
+
return Result.ok({
|
|
22
|
+
type: 'hookRejected',
|
|
23
|
+
feedback: commitRejectedFeedback(saved.error.output),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
yield* saved;
|
|
27
|
+
const head = yield* Result.await(workspace.headCommit());
|
|
28
|
+
if (head === approved) {
|
|
29
|
+
return Result.ok({
|
|
30
|
+
type: 'nothingChanged',
|
|
31
|
+
feedback: nothingChangedFeedback(slice),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const commit = yield* Result.await(workspace.summariseCommitsSince(attemptStart));
|
|
35
|
+
return Result.ok({ type: 'implemented', commit });
|
|
36
|
+
});
|
|
37
|
+
const implementerReplySchema = z.object({ commitMessage: z.string().trim().min(1) });
|
|
38
|
+
/**
|
|
39
|
+
* The message for what the implementer left uncommitted. A reply jig cannot read must not cost
|
|
40
|
+
* the work it describes, so the slice title stands in and the repository's hooks judge it.
|
|
41
|
+
*/
|
|
42
|
+
function commitMessageOf(reply, slice) {
|
|
43
|
+
if (reply.isOk())
|
|
44
|
+
return Result.ok(reply.value.commitMessage);
|
|
45
|
+
return AgentOutputInvalid.is(reply.error) ? Result.ok(slice.title) : Result.err(reply.error);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Where a slice's commits begin: where the slice before it ended, or the run branch's fork point
|
|
49
|
+
* for the first. Derived from approved work rather than read from HEAD, so an attempt resumed
|
|
50
|
+
* after a crash still counts the commits the interrupted attempt left behind.
|
|
51
|
+
*/
|
|
52
|
+
async function sliceStart(state, slice, ports) {
|
|
53
|
+
const previousEnd = slicesInOrder(state.slices)
|
|
54
|
+
.filter((candidate) => candidate.order < slice.order && candidate.commit)
|
|
55
|
+
.at(-1)?.commit;
|
|
56
|
+
return previousEnd ? Result.ok(previousEnd) : ports.workspace.forkPoint();
|
|
57
|
+
}
|
|
58
|
+
export const reviewSlice = (context) => Result.gen(async function* () {
|
|
59
|
+
const { slice, ports, state } = context;
|
|
60
|
+
const start = yield* Result.await(sliceStart(state, slice, ports));
|
|
61
|
+
const changed = yield* Result.await(ports.workspace.changedFilesSince(start));
|
|
62
|
+
const whole = wholeRequestOf(state);
|
|
63
|
+
const outcome = whole
|
|
64
|
+
? yield* Result.await(reviewTheWholeRequest(context, whole, { start, changed }))
|
|
65
|
+
: yield* Result.await(reviewTheSlice(context, { start, changed }));
|
|
66
|
+
return Result.ok(outcome);
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* The combined review of an eligible run: the slice's code and, in the same pass, the whole
|
|
70
|
+
* request against its plan. The whole-request verdict is recorded whatever the code verdict
|
|
71
|
+
* says, bound to the exact work the review saw before and after it ran.
|
|
72
|
+
*/
|
|
73
|
+
async function reviewTheWholeRequest({ slice, ports, settings }, whole, { start, changed }) {
|
|
74
|
+
return Result.gen(async function* () {
|
|
75
|
+
const before = yield* Result.await(ports.workspace.collectFacts());
|
|
76
|
+
const verdict = yield* Result.await(ports.agent.runForOutput({
|
|
77
|
+
role: 'reviewer',
|
|
78
|
+
prompt: combinedReviewPrompt({
|
|
79
|
+
slice,
|
|
80
|
+
range: `${start}..HEAD`,
|
|
81
|
+
protectedChanges: protectedChanges(changed),
|
|
82
|
+
request: whole.request,
|
|
83
|
+
plan: whole.plan,
|
|
84
|
+
}),
|
|
85
|
+
schema: wholeRequestVerdictSchema,
|
|
86
|
+
}));
|
|
87
|
+
const after = yield* Result.await(ports.workspace.collectFacts());
|
|
88
|
+
const fulfillment = fulfillmentVerdictSchema.safeParse(verdict);
|
|
89
|
+
const completion = fulfillment.success
|
|
90
|
+
? completionEvidenceOf({
|
|
91
|
+
reviewed: whole,
|
|
92
|
+
settings,
|
|
93
|
+
verification: slice.verification,
|
|
94
|
+
verdict: fulfillment.data,
|
|
95
|
+
observed: { before, after },
|
|
96
|
+
range: { start, end: after.host.commit },
|
|
97
|
+
})
|
|
98
|
+
: undefined;
|
|
99
|
+
return Result.ok({ ...outcomeOfReview(verdict), completion });
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
const reviewVerdictSchema = z.object({
|
|
103
|
+
approved: z.boolean(),
|
|
104
|
+
feedback: z.string(),
|
|
105
|
+
onlyRuleFindings: z.boolean().optional(),
|
|
106
|
+
});
|
|
107
|
+
/** One reply answering both questions: the code verdict, and the request verdict beside it. */
|
|
108
|
+
const wholeRequestVerdictSchema = reviewVerdictSchema.extend({
|
|
109
|
+
fulfilled: z.unknown().optional(),
|
|
110
|
+
gaps: z.unknown().optional(),
|
|
111
|
+
});
|
|
112
|
+
function outcomeOfReview(verdict) {
|
|
113
|
+
if (verdict.approved)
|
|
114
|
+
return { type: 'approved' };
|
|
115
|
+
const type = verdict.onlyRuleFindings ? 'rulesFixRequested' : 'changesRequested';
|
|
116
|
+
return { type, feedback: verdict.feedback };
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The ordinary slice review of a run that is not a candidate for a combined one: the slice's code
|
|
120
|
+
* against its description, its recorded verification and the repository's rules — nothing else.
|
|
121
|
+
*/
|
|
122
|
+
async function reviewTheSlice({ slice, ports }, { start, changed }) {
|
|
123
|
+
const verdict = await ports.agent.runForOutput({
|
|
124
|
+
role: 'reviewer',
|
|
125
|
+
prompt: reviewPrompt(slice, `${start}..HEAD`, protectedChanges(changed)),
|
|
126
|
+
schema: reviewVerdictSchema,
|
|
127
|
+
});
|
|
128
|
+
return verdict.map(outcomeOfReview);
|
|
129
|
+
}
|
|
130
|
+
export const verifySlice = ({ settings, ports }) => {
|
|
131
|
+
const command = settings.verifyCommand;
|
|
132
|
+
if (!command)
|
|
133
|
+
return Promise.resolve(Result.ok({ type: 'verified' }));
|
|
134
|
+
return Result.gen(async function* () {
|
|
135
|
+
const before = yield* Result.await(ports.workspace.collectFacts());
|
|
136
|
+
const { exitCode, output } = yield* Result.await(ports.agent.exec(command));
|
|
137
|
+
const after = yield* Result.await(ports.workspace.collectFacts());
|
|
138
|
+
const observed = { before, after };
|
|
139
|
+
if (exitCode !== 0) {
|
|
140
|
+
return Result.ok({
|
|
141
|
+
type: 'verificationFailed',
|
|
142
|
+
feedback: verifyFailedFeedback(command, output),
|
|
143
|
+
command,
|
|
144
|
+
observed,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
return Result.ok({ type: 'verified', command, observed });
|
|
148
|
+
});
|
|
149
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,97 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ygrishajev/jig",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Agentic SDLC pipeline orchestrator",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20.17"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"jig": "./dist/cli/main.js"
|
|
12
|
+
},
|
|
13
|
+
"main": "./dist/cli/main.js",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"presets"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/ygrishajev/jig.git"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"provenance": true
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"validate": "node --import tsx scripts/validate.ts",
|
|
28
|
+
"build": "tsc -p tsconfig.build.json",
|
|
29
|
+
"install:local": "npm run build && T=$(npm pack --silent | tail -1) && trap 'rm -f \"$T\"' EXIT && env -u _VOLTA_TOOL_RECURSION \"${VOLTA_HOME:+$VOLTA_HOME/bin/}npm\" i -g \"$PWD/$T\"",
|
|
30
|
+
"dev": "tsx src/cli/main.ts",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"lint:duplication": "jscpd",
|
|
33
|
+
"format": "prettier --write .",
|
|
34
|
+
"format:check": "prettier --check .",
|
|
35
|
+
"test": "vitest run --project unit",
|
|
36
|
+
"test:e2e": "npm run build && node --env-file-if-exists=tests/e2e/.env node_modules/vitest/vitest.mjs run --workspace vitest.workspace.ts --project e2e --reporter verbose",
|
|
37
|
+
"test:coverage": "vitest run --project unit --coverage",
|
|
38
|
+
"test:watch": "vitest --project unit",
|
|
39
|
+
"test:mutation": "stryker run",
|
|
40
|
+
"secretlint": "secretlint '**/*'",
|
|
41
|
+
"prepare": "husky || true",
|
|
42
|
+
"typecheck": "tsc -p tsconfig.typecheck.json"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@ai-hero/sandcastle": "^0.14.0",
|
|
46
|
+
"@inquirer/prompts": "^8.7.5",
|
|
47
|
+
"@opentelemetry/api": "^1.9.1",
|
|
48
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
|
|
49
|
+
"@opentelemetry/sdk-node": "^0.223.0",
|
|
50
|
+
"awilix": "^13.0.5",
|
|
51
|
+
"better-result": "^3.0.1",
|
|
52
|
+
"commander": "^13.0.0",
|
|
53
|
+
"execa": "^9.5.0",
|
|
54
|
+
"latest-version": "^9.0.0",
|
|
55
|
+
"p-timeout": "^6.1.4",
|
|
56
|
+
"picomatch": "^4.0.7",
|
|
57
|
+
"pino": "^10.4.0",
|
|
58
|
+
"pino-pretty": "^13.2.0",
|
|
59
|
+
"proper-lockfile": "^4.1.2",
|
|
60
|
+
"safe-stable-stringify": "^2.5.0",
|
|
61
|
+
"simple-git": "^3.27.0",
|
|
62
|
+
"write-file-atomic": "^8.0.0",
|
|
63
|
+
"zod": "^3.24.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@commitlint/cli": "^21.2.4",
|
|
67
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
68
|
+
"@eslint/js": "^9.17.0",
|
|
69
|
+
"@faker-js/faker": "^10.6.0",
|
|
70
|
+
"@opentelemetry/sdk-trace-base": "^2.12.0",
|
|
71
|
+
"@secretlint/secretlint-rule-preset-recommend": "^9.0.0",
|
|
72
|
+
"@stryker-mutator/core": "^8.7.0",
|
|
73
|
+
"@stryker-mutator/vitest-runner": "^8.7.0",
|
|
74
|
+
"@types/node": "^22.10.0",
|
|
75
|
+
"@types/picomatch": "^4.0.3",
|
|
76
|
+
"@types/proper-lockfile": "^4.1.4",
|
|
77
|
+
"@types/write-file-atomic": "^4.0.3",
|
|
78
|
+
"@typescript-eslint/rule-tester": "^8.70.1",
|
|
79
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
80
|
+
"eslint": "^9.17.0",
|
|
81
|
+
"eslint-config-prettier": "^9.1.0",
|
|
82
|
+
"eslint-plugin-simple-import-sort": "^13.0.0",
|
|
83
|
+
"eslint-plugin-sonarjs": "^4.2.2",
|
|
84
|
+
"husky": "^9.1.7",
|
|
85
|
+
"jscpd": "^5.4.2",
|
|
86
|
+
"prettier": "^3.4.0",
|
|
87
|
+
"secretlint": "^9.0.0",
|
|
88
|
+
"tsx": "^4.19.0",
|
|
89
|
+
"typescript": "^5.7.0",
|
|
90
|
+
"typescript-eslint": "^8.19.0",
|
|
91
|
+
"vitest": "^2.1.0",
|
|
92
|
+
"vitest-mock-extended": "^2.0.2"
|
|
93
|
+
},
|
|
94
|
+
"volta": {
|
|
95
|
+
"node": "26.13.0"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Pay-per-token: open-weight implementer, strong reviewer",
|
|
3
|
+
"planner": { "provider": "codex", "model": "gpt-6.1-sol" },
|
|
4
|
+
"implementer": { "provider": "opencode", "model": "openrouter/z-ai/glm-5.3" },
|
|
5
|
+
"reviewer": { "provider": "claude", "model": "opus" },
|
|
6
|
+
"describer": { "provider": "opencode", "model": "openrouter/deepseek/deepseek-v4.1-flash" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Codex is out of limits",
|
|
3
|
+
"planner": { "provider": "claude", "model": "opus" },
|
|
4
|
+
"implementer": { "provider": "claude", "model": "sonnet" },
|
|
5
|
+
"reviewer": { "provider": "claude", "model": "opus" },
|
|
6
|
+
"describer": { "provider": "claude", "model": "haiku" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Claude is out of limits",
|
|
3
|
+
"planner": { "provider": "codex", "model": "gpt-6-astra" },
|
|
4
|
+
"implementer": { "provider": "codex", "model": "gpt-6.1-sol" },
|
|
5
|
+
"reviewer": { "provider": "codex", "model": "gpt-6-astra" },
|
|
6
|
+
"describer": { "provider": "codex", "model": "gpt-6-luna" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Codex plans and reviews; OpenCode implements and describes",
|
|
3
|
+
"planner": { "provider": "codex", "model": "gpt-6-astra" },
|
|
4
|
+
"implementer": { "provider": "opencode", "model": "openrouter/z-ai/glm-5.3" },
|
|
5
|
+
"reviewer": { "provider": "codex", "model": "gpt-6.1-sol" },
|
|
6
|
+
"describer": { "provider": "opencode", "model": "openrouter/deepseek/deepseek-v4.1-flash" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Subscriptions: best quality, spends Codex most",
|
|
3
|
+
"planner": { "provider": "claude", "model": "opus" },
|
|
4
|
+
"implementer": { "provider": "codex", "model": "gpt-6.1-sol" },
|
|
5
|
+
"reviewer": { "provider": "claude", "model": "opus" },
|
|
6
|
+
"describer": { "provider": "codex", "model": "gpt-6-luna" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Subscriptions: best quality, spends Claude most",
|
|
3
|
+
"planner": { "provider": "codex", "model": "gpt-6-astra" },
|
|
4
|
+
"implementer": { "provider": "claude", "model": "opus" },
|
|
5
|
+
"reviewer": { "provider": "codex", "model": "gpt-6.1-sol" },
|
|
6
|
+
"describer": { "provider": "claude", "model": "haiku" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Subscriptions: many slices, Sonnet stretches the Claude window",
|
|
3
|
+
"planner": { "provider": "claude", "model": "opus" },
|
|
4
|
+
"implementer": { "provider": "claude", "model": "sonnet" },
|
|
5
|
+
"reviewer": { "provider": "codex", "model": "gpt-6.1-sol" },
|
|
6
|
+
"describer": { "provider": "claude", "model": "haiku" }
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Both subscriptions are out; simpler requests only",
|
|
3
|
+
"planner": { "provider": "opencode", "model": "openrouter/moonshotai/kimi-k3" },
|
|
4
|
+
"implementer": { "provider": "opencode", "model": "openrouter/z-ai/glm-5.3" },
|
|
5
|
+
"reviewer": { "provider": "opencode", "model": "openrouter/deepseek/deepseek-v4-pro" },
|
|
6
|
+
"describer": { "provider": "opencode", "model": "openrouter/deepseek/deepseek-v4.1-flash" }
|
|
7
|
+
}
|