@yagni-app/code-staging 1.2.15-staging.2575.1 → 1.2.15-staging.2581.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.
@@ -81,12 +81,18 @@ export interface PlanFile {
81
81
  /**
82
82
  * The plan turn's own judgment of how big the build will be
83
83
  * (`small | standard | complex`), absent when the plan wrote none or one
84
- * outside the vocabulary. Recorded only (YAG-1083's first half): nothing
85
- * reads it back yet.
84
+ * outside the vocabulary. The host's gate and plan review read it for a
85
+ * yak's ticket (YAG-1306).
86
86
  */
87
87
  size?: PlanSize;
88
88
  /** One line on why the size, clipped; absent when the plan wrote none. */
89
89
  sizeReason?: string;
90
+ /**
91
+ * How many files the plan says the build will change, a codemod's or an
92
+ * autofix's included (YAG-1482): the host's gate reads it beside the files
93
+ * the plan names. Absent when the plan wrote no whole number.
94
+ */
95
+ fileCount?: number;
90
96
  /**
91
97
  * The ticket's problem is already gone, as the ticket check shows: the plan
92
98
  * recommends closing the ticket, with its evidence, and has nothing to
@@ -217,6 +217,14 @@ function repoPath(value) {
217
217
  return null;
218
218
  return path;
219
219
  }
220
+ /** The most files a plan's count may say; a larger number is read as this. */
221
+ const MAX_FILE_COUNT = 100_000;
222
+ /** A whole, non-negative count, capped; null for anything else. */
223
+ function countOf(value) {
224
+ if (typeof value !== "number" || !Number.isInteger(value) || value < 0)
225
+ return null;
226
+ return Math.min(value, MAX_FILE_COUNT);
227
+ }
220
228
  /**
221
229
  * `plan.json` from the plan's text. `found` is false when the plan carried no
222
230
  * block that parses: the file then holds no questions, and `paths` falls back
@@ -262,6 +270,7 @@ export function buildPlanFile(planText, fallbackPaths) {
262
270
  const pieces = closeTicket ? [] : readPieces(block?.pieces);
263
271
  const size = PLAN_SIZES.find((known) => known === block?.size);
264
272
  const sizeReason = size && typeof block?.sizeReason === "string" ? text(block.sizeReason, 200) : null;
273
+ const fileCount = closeTicket ? null : countOf(block?.fileCount);
265
274
  return {
266
275
  file: {
267
276
  version: 1,
@@ -276,6 +285,7 @@ export function buildPlanFile(planText, fallbackPaths) {
276
285
  ...(pieces.length > 0 ? { pieces } : {}),
277
286
  ...(size ? { size } : {}),
278
287
  ...(size && sizeReason ? { sizeReason } : {}),
288
+ ...(fileCount !== null ? { fileCount } : {}),
279
289
  ...(closeTicket ? { closeTicket } : {}),
280
290
  },
281
291
  found: block !== null,
@@ -257,7 +257,8 @@ export const YAK_PLAN_JSON_CONTRACT = "End your answer with a fenced ```plan-jso
257
257
  ' "paths": ["apps/web"],\n' +
258
258
  ' "questions": [{"text": "...", "kind": "decision", "alternatives": [{"answer": "...", "why": "..."}]}],\n' +
259
259
  ' "size": "small|standard|complex",\n' +
260
- ' "sizeReason": "one line on why the size"\n' +
260
+ ' "sizeReason": "one line on why the size",\n' +
261
+ ' "fileCount": 2\n' +
261
262
  "}\n" +
262
263
  "```\n" +
263
264
  "Rules the host enforces:\n" +
@@ -268,9 +269,11 @@ export const YAK_PLAN_JSON_CONTRACT = "End your answer with a fenced ```plan-jso
268
269
  "choices you would make yourself, saying each as one line under ## Scope. Write no recommendation on a question " +
269
270
  "you need answered; give at most two alternatives a person could pick.\n" +
270
271
  '- "size" is your own judgment of the build (small: a one-file or config fix; standard: a change across one or ' +
271
- 'two packages; complex: a cross-package, schema or contract change), with one line as "sizeReason". A small or ' +
272
- "standard plan with no question starts its build without waiting for a person; a complex plan, one with a " +
273
- "question, or one with no size waits for one. Size it honestly: a plan sized too small is built unseen.\n" +
272
+ 'two packages; complex: a cross-package, schema or contract change), with one line as "sizeReason". ' +
273
+ '"fileCount" is how many files the build changes, every file an autofix or codemod rewrites included. ' +
274
+ "A small or standard plan with no question starts its build without waiting for a person; a complex plan, " +
275
+ "one with a question, one that changes many files, or one with no size waits for one. Size it honestly: a " +
276
+ "plan sized too small is built unseen.\n" +
274
277
  "Add these only when they apply, and leave them out otherwise:\n" +
275
278
  '- "repositoriesNeeded": [{"repository": "owner/name", "summary": "one line on what changes there"}] when the ' +
276
279
  "change writes to more than one repository the ticket's Other repositories section lists, in the order they " +
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code-staging",
3
- "version": "1.2.15-staging.2575.1",
3
+ "version": "1.2.15-staging.2581.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": "192dd4287a4a4b74fa6edfe4e393d41e58f231f4"
61
+ "yagniSourceSha": "544bf83f77c9937af31a67a9553a7256ccaedde3"
62
62
  }