@yagni-app/code-staging 1.2.14-staging.2243.1 → 1.2.14-staging.2244.1
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.
|
@@ -67,13 +67,6 @@ export declare function sessionPaths(home: string, attemptId: string): {
|
|
|
67
67
|
sessionFile: string;
|
|
68
68
|
skillFile: string;
|
|
69
69
|
};
|
|
70
|
-
/** One plan answer as `plan-answers.json` carries it. */
|
|
71
|
-
interface PlanAnswer {
|
|
72
|
-
answer: string;
|
|
73
|
-
question?: string;
|
|
74
|
-
}
|
|
75
|
-
/** The answers in `plan-answers.json`, or none when it is missing or does not read. */
|
|
76
|
-
export declare function readPlanAnswers(text: string | null): PlanAnswer[];
|
|
77
70
|
/** What a turn's message is built from. */
|
|
78
71
|
export interface TurnFacts {
|
|
79
72
|
stage: CloudStage;
|
|
@@ -81,7 +74,6 @@ export interface TurnFacts {
|
|
|
81
74
|
resumed: boolean;
|
|
82
75
|
inputDir: string;
|
|
83
76
|
outDir: string;
|
|
84
|
-
answers: readonly PlanAnswer[];
|
|
85
77
|
continuation?: ContinuationInputs;
|
|
86
78
|
/** The input folder has `hand-off-answer.md`: a person answered a stop. */
|
|
87
79
|
handOffAnswer: boolean;
|
|
@@ -175,5 +167,4 @@ export interface SessionTurnOutcome {
|
|
|
175
167
|
}
|
|
176
168
|
/** Run one turn of the run's session and write what the host reads. Never throws for the model's sake. */
|
|
177
169
|
export declare function runSessionTurn(input: SessionTurnInput, deps?: SessionTurnDeps): Promise<SessionTurnOutcome>;
|
|
178
|
-
export {};
|
|
179
170
|
//# sourceMappingURL=sessionLane.d.ts.map
|
|
@@ -112,34 +112,6 @@ function feedStage(stage) {
|
|
|
112
112
|
return "fix";
|
|
113
113
|
return "implement";
|
|
114
114
|
}
|
|
115
|
-
/** The answers in `plan-answers.json`, or none when it is missing or does not read. */
|
|
116
|
-
export function readPlanAnswers(text) {
|
|
117
|
-
if (!text)
|
|
118
|
-
return [];
|
|
119
|
-
try {
|
|
120
|
-
const data = JSON.parse(text);
|
|
121
|
-
if (!Array.isArray(data.answers))
|
|
122
|
-
return [];
|
|
123
|
-
return data.answers.flatMap((entry) => {
|
|
124
|
-
if (!entry || typeof entry !== "object")
|
|
125
|
-
return [];
|
|
126
|
-
const { answer, question } = entry;
|
|
127
|
-
if (typeof answer !== "string" || !answer.trim())
|
|
128
|
-
return [];
|
|
129
|
-
return [
|
|
130
|
-
{
|
|
131
|
-
answer: answer.trim().slice(0, 1_000),
|
|
132
|
-
...(typeof question === "string" && question.trim()
|
|
133
|
-
? { question: question.trim().slice(0, 500) }
|
|
134
|
-
: {}),
|
|
135
|
-
},
|
|
136
|
-
];
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
catch {
|
|
140
|
-
return [];
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
115
|
/** The file the host writes a person's note for the next step to (`attempts/inputs.ts`). */
|
|
144
116
|
export const NEXT_STEP_NOTE_FILE_NAME = "next-step-note.md";
|
|
145
117
|
const REPORT_CONTRACT = (outDir) => `Last, write ${join(outDir, SESSION_REPORT_FILE_NAME)} as JSON, honestly: ` +
|
|
@@ -199,17 +171,10 @@ export function turnMessage(facts) {
|
|
|
199
171
|
parts.push(PLAN_RULES);
|
|
200
172
|
return parts.join("\n\n");
|
|
201
173
|
}
|
|
202
|
-
const answers = facts.answers.length > 0
|
|
203
|
-
? [
|
|
204
|
-
"Their answers:",
|
|
205
|
-
...facts.answers.map((entry) => entry.question ? `- ${entry.question}: ${entry.answer}` : `- ${entry.answer}`),
|
|
206
|
-
].join("\n")
|
|
207
|
-
: "";
|
|
208
174
|
if (facts.stage === "implement" && facts.resumed && !facts.continuation) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
parts.push(`The option they picked is binding. If it is not the one you recommended, re-plan in place first: write the plan you will build to ${join(facts.outDir, "plan.md")}, then build that. ${PLAN_CHANGES_RULE}`);
|
|
175
|
+
// Spec 2026-11-02: every answer is in the plan before Approve, so the
|
|
176
|
+
// plan as approved is the whole contract and nothing rides beside it.
|
|
177
|
+
parts.push(`The person approved the plan. The plan as approved is ${at("plan.md")}: their answers are already in it, under Decisions and Not doing, and it supersedes the draft you wrote earlier in this session. Build that plan. Leave out everything under Not doing. ${PLAN_CHANGES_RULE}`);
|
|
213
178
|
}
|
|
214
179
|
else if (facts.stage === "fix" && facts.review) {
|
|
215
180
|
parts.push(`A review or the CI on this attempt's pull request asks for changes. They are in ${at("ticket.md")}, under "Review on this attempt's pull request", each with its id; the branch may hold a person's commits since your last turn, so read the code as it is now. Address every item with the smallest change that does it, write the outcomes file that section names, and commit.`);
|
|
@@ -222,10 +187,8 @@ export function turnMessage(facts) {
|
|
|
222
187
|
? `Pick up the attempt where it stands on this branch.${why}`
|
|
223
188
|
: `You are building an approved plan for this ticket, on a branch that holds whatever this attempt committed so far.${why}`);
|
|
224
189
|
if (!facts.resumed) {
|
|
225
|
-
parts.push(INPUTS(facts.inputDir), `- plan.md: the plan a person approved,
|
|
190
|
+
parts.push(INPUTS(facts.inputDir), `- plan.md: the plan a person approved, with their answers in it under Decisions and Not doing. The steps are guidance.`);
|
|
226
191
|
}
|
|
227
|
-
if (answers && !facts.resumed)
|
|
228
|
-
parts.push(answers);
|
|
229
192
|
if (facts.stage === "verify") {
|
|
230
193
|
parts.push("Check the work on this branch against the plan: run the checks, fix only what this change broke, and commit any fix.");
|
|
231
194
|
}
|
|
@@ -305,21 +268,7 @@ export function parseSessionReport(text, known = new Map()) {
|
|
|
305
268
|
.map((entry) => line(entry))
|
|
306
269
|
.filter((entry) => entry !== null)
|
|
307
270
|
.slice(0, MAX_REPORT_LINES);
|
|
308
|
-
|
|
309
|
-
// words) in an earlier turn of the same session still counts: each is a
|
|
310
|
-
// change to the plan as a whole, its step named in what it did instead.
|
|
311
|
-
const planChanges = data.planChanges !== undefined
|
|
312
|
-
? parsePlanChanges(data.planChanges)
|
|
313
|
-
: parsePlanChanges(list(data.departures).map((entry) => {
|
|
314
|
-
const record = (entry ?? {});
|
|
315
|
-
const what = line(record.what);
|
|
316
|
-
const from = line(record.from, 200);
|
|
317
|
-
return {
|
|
318
|
-
step: null,
|
|
319
|
-
instead: what && from ? `${from}: ${what}` : what,
|
|
320
|
-
why: record.why,
|
|
321
|
-
};
|
|
322
|
-
}));
|
|
271
|
+
const planChanges = parsePlanChanges(data.planChanges);
|
|
323
272
|
return { summary: line(data.summary, 1_500), checks, notVerified, planChanges };
|
|
324
273
|
}
|
|
325
274
|
/** The checks the host named in `checks.json`, by their command, with how each stands on the base. */
|
|
@@ -483,7 +432,6 @@ export async function runSessionTurn(input, deps = {}) {
|
|
|
483
432
|
resumed,
|
|
484
433
|
inputDir: input.inputDir,
|
|
485
434
|
outDir: input.outDir,
|
|
486
|
-
answers: readPlanAnswers(readOrNull(join(input.inputDir, "plan-answers.json"))),
|
|
487
435
|
...(input.continuation ? { continuation: input.continuation } : {}),
|
|
488
436
|
handOffAnswer: exists(join(input.inputDir, "hand-off-answer.md")),
|
|
489
437
|
review: exists(join(input.inputDir, "fix-round.json")),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.2.14-staging.
|
|
3
|
+
"version": "1.2.14-staging.2244.1",
|
|
4
4
|
"description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"turndown": "^7.2.4",
|
|
59
59
|
"typebox": "^1.3.15"
|
|
60
60
|
},
|
|
61
|
-
"yagniSourceSha": "
|
|
61
|
+
"yagniSourceSha": "026d28b72cc0909a00e49bab55ae11643a3a89be"
|
|
62
62
|
}
|