@quikit/quikpilot-runner 9.3.0-rc.77 → 9.3.0-rc.78

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/README.md CHANGED
@@ -182,6 +182,8 @@ wrong (a field that arrives from a database row or a request), so it only warns
182
182
 
183
183
  **9.3.0-rc.77 also - the tables a proposed migration names are looked for in the files the run could read, and the first note that names one nothing shows is sent back (QUIKTR-2448).** In the live trial of 9 Nov 2026 (F8, QTRIA-54) the draft pull request's SQL read `ALTER TABLE "app_quiktrack"."QptIssueComment"`; the model lives in `app_quikprojects` (renamed on 23 Sep 2026), the AI never opened the schema, and `schemaFileSeen` came out true because an empty schema-file name counted as seen. `migrationNames.ts` reads the existing tables a SQL migration names (`ALTER TABLE`, `CREATE INDEX ... ON`, `REFERENCES`, `INSERT INTO`; a table the same migration creates is left out; comments are ignored; a migration in an ORM's own language, such as Django's operations or Rails' `add_column`, names none and gets no check). `nameEvidence.ts` looks for each in tracked files the run could read (the read listing, not a read-denied path, not documentation: `.md`, `.mdx`, `.txt`, `.rst`, `.adoc`, `.doc`, `.docx`, not the run's own note): a bare table by its name as a whole word, a schema-qualified one by the schema and the table together in one file. `DatabaseChangeNote` takes an optional checker: the first `write_file` of the note that names a table nothing shows is answered `bad_args` with the names (identifiers only, two shown, within 300 characters) and is not recorded; the next write is recorded whatever it names, with the names still not found as `unchecked`. `finalDatabaseChange` sends them as the callback's `namesUnchecked` (at most 8, left out when none) and `schemaFileSeen` is false when no schema file is named. `run.ts` builds the checker from the read listing and the denied paths. A checker that fails says nothing. QuikProjects words the unchecked names on the draft pull request and must ship before this runner (its callback schema is strict). New tests: `migrationNames.test.ts`, `nameEvidence.test.ts` (the F8 repository in miniature: the right schema in the schema file, the old one only in a document and in a migration the space denies), the note and the report in `databaseChange.test.ts`, and four end-to-end scenarios on real git repositories (`codegenStep.databaseChange.test.ts`). Seventeen mutations turn tests red (documentation counted, read-denied files counted, a qualified name found by its table alone, the read listing ignored, the run's own note counted, a table the migration creates asked about, statements in comments read, the first write never or always sent back, the names not kept, an empty schema-file name seen, a failing checker breaking the note, the checker dropped by the step or the loop).
184
184
 
185
+ **9.3.0-rc.78 - a part of the design whose name or description is a little too long is cut, not a reason to drop every part (QUIKTR-2449).** In the live trial of 9 Nov 2026 (F8, QTRIA-56, "Let people pin a comment so it stays at the top of the thread") one part's description was 354 characters and the runner accepts 300. `partsFromDesign` returned NO parts for the whole list when any part failed a check, so `parts_check.on` said `parts: 0`: no parts check, no `storedProposals`, no database change proposed, and the pull request opened as a normal pull request with code written for a column that does not exist. The 150 and 300 limits are only words in the AI Runtime's design form, and the site passes the design through untouched, so the model can exceed them. Now `partsFromDesignCut` (and `partsFromDesign`, which wraps it) cuts a name over 150 and a `what` over 300 characters to the limit (never between the two halves of a character) and keeps every part; `designForTargeting` sends targeting the parts as the runner reads them (a cut design with every other key of the design and of each part kept, or the very same design object when nothing was cut); `parts_check.on` carries `cut: <parts that had a field cut>` only when something was cut. A design that is broken in any other way (an id not shaped `P<n>`, an unknown kind, a repeated id, an empty name, a `what` that is not text, more than eight parts, an entry that is not an object) still gives no parts, as before. Switched off, a bug run, a design with no parts, and a design that fits: every request, log line and callback is what it was. New tests in `partsCheck.test.ts` and `run.parts.test.ts` (the two rows that pinned "a long name or description gives no parts" moved into the new cases); ten mutations turn tests red.
186
+
185
187
  **9.3.0-rc.75 - a part of a feature planned only in test files counts as built when one of them changed (QUIKTR-2325).** In the live trial of 9 Nov 2026 (F5, run cmw8rufpl0002hmgg02h2zkh7, "Show 20 expenses per page by default instead of 10.") the design listed "Existing default page size test" as a part, targeting planned it in the only file it could (`src/history.test.js`), and the person approved changing that test at the test decision. Both attempts still failed `part_missing` ("P4 Existing default page size test (logic, planned in src/history.test.js)"), because since rc.71 a changed test file never builds a part, so a part planned only in tests could never pass. Now a part whose planned files are all tests (the loop's own test rule) is built when one of them changed or was created; a part with any other planned file still needs one of those changed, and a test file alone still never builds it. The same rule holds at the code phase's DONE and at the last gate before the commit. The AI Runtime is told in the same release not to list a test or a test update as a part. New tests in `partsCheck.test.ts` (the F5 shape fails on rc.74; a test-only part none of whose files changed; a part planned in a source file and a test, only the test changed); two mutations (the rule removed; any planned test file counted) turn tests red. Switched off (`QUIKPILOT_PARTS_CHECK` not `on`), nothing changes.
186
188
 
187
189
  **9.3.0-rc.74 - a line that calls an endpoint is no longer read by the scope check as a new route (found in the QUIKTR-2325 trial).** In the live trial of 8 Nov 2026 (F4, run cmw7okqnl0002d4d1hco1nqey) the AI built every part of the feature and 74/74 tests passed, then the run failed "public/index.html adds POST /api/groups, not declared in the design's API changes": the page's new Restore button calls the new endpoint with `fetch(`/api/groups/${groupId}/expenses/${expenseId}/restore`, { method: "POST" })`, and the scope check (QUIKTR-1081), which reads any added line naming a method and a path as a route being added, took that call for one. The design had named the endpoint in words only, so nothing matched it. A call uses a route, it cannot add one, so a line that calls an endpoint is now passed over: any `...fetch(` (fetch, useFetch, $fetch), axios, jQuery's ajax/get/post, XMLHttpRequest and its `open("POST", ...)`, an `http.` client call (Node, Angular's HttpClient, Go's Get/Post/NewRequest), Python's requests and httpx, Java's `HttpRequest.newBuilder`, and curl. A route defined on a server is still held to the design as before (`app.post(...)`, `router.post(...)`, `@app.route(..., methods=["POST"])`, `mux.HandleFunc("POST /...")`, `req.method === "POST"`, and the documenting comment of the original incident), and a file that both calls one route and defines an undeclared one still fails, naming only the defined one. New tests in `scopeCheck.test.ts` (the F4 line, thirteen client calls, six server definitions, and the mixed file) fail on rc.73 where they should; two mutations (the rule removed; any `.post(` counted as a call, which swallows Express and router routes) turn tests red. Not behind a switch: it changes only which added lines the existing scope check reads.
package/dist/index.js CHANGED
@@ -48877,26 +48877,45 @@ var MARKER_RE = /\[(P\d+)(?:=(exists|proposed))?\]/g;
48877
48877
  function isRecord4(x) {
48878
48878
  return typeof x === "object" && x !== null && !Array.isArray(x);
48879
48879
  }
48880
- function partsFromDesign(design) {
48881
- if (!isRecord4(design) || !Array.isArray(design.parts)) return [];
48880
+ function cutTo(text3, max) {
48881
+ if (text3.length <= max) return text3;
48882
+ const last = text3.charCodeAt(max - 1);
48883
+ const end = last >= 55296 && last <= 56319 ? max - 1 : max;
48884
+ return text3.slice(0, end);
48885
+ }
48886
+ function partsFromDesignCut(design) {
48887
+ const none = { parts: [], cut: 0 };
48888
+ if (!isRecord4(design) || !Array.isArray(design.parts)) return none;
48882
48889
  const raw = design.parts;
48883
- if (raw.length === 0 || raw.length > MAX_PARTS) return [];
48890
+ if (raw.length === 0 || raw.length > MAX_PARTS) return none;
48884
48891
  const out2 = [];
48885
48892
  const ids = /* @__PURE__ */ new Set();
48893
+ let cut2 = 0;
48886
48894
  for (const p of raw) {
48887
- if (!isRecord4(p)) return [];
48895
+ if (!isRecord4(p)) return none;
48888
48896
  const { id, kind, name: name2, what } = p;
48889
- if (typeof id !== "string" || !PART_ID_RE.test(id) || ids.has(id)) return [];
48890
- if (typeof kind !== "string" || !PART_KINDS.includes(kind)) return [];
48891
- if (typeof name2 !== "string" || name2.trim() === "" || name2.length > MAX_NAME_CHARS3) return [];
48892
- if (typeof what !== "string" || what.length > MAX_WHAT_CHARS) return [];
48897
+ if (typeof id !== "string" || !PART_ID_RE.test(id) || ids.has(id)) return none;
48898
+ if (typeof kind !== "string" || !PART_KINDS.includes(kind)) return none;
48899
+ if (typeof name2 !== "string" || name2.trim() === "") return none;
48900
+ if (typeof what !== "string") return none;
48901
+ const shortName = cutTo(name2, MAX_NAME_CHARS3);
48902
+ const shortWhat = cutTo(what, MAX_WHAT_CHARS);
48903
+ if (shortName !== name2 || shortWhat !== what) cut2 += 1;
48893
48904
  ids.add(id);
48894
- out2.push({ id, kind, name: name2, what });
48905
+ out2.push({ id, kind, name: shortName, what: shortWhat });
48895
48906
  }
48896
- return out2;
48907
+ return { parts: out2, cut: cut2 };
48897
48908
  }
48898
48909
  function designForTargeting(design, on) {
48899
- if (on && partsFromDesign(design).length > 0) return { design, partsCheck: true };
48910
+ if (on) {
48911
+ const read = partsFromDesignCut(design);
48912
+ if (read.parts.length > 0) {
48913
+ if (read.cut === 0) return { design, partsCheck: true };
48914
+ const raw = design.parts;
48915
+ const parts2 = raw.map((p, i3) => ({ ...p, name: read.parts[i3].name, what: read.parts[i3].what }));
48916
+ return { design: { ...design, parts: parts2 }, partsCheck: true };
48917
+ }
48918
+ }
48900
48919
  if (!design || !Object.prototype.hasOwnProperty.call(design, "parts")) return { design, partsCheck: false };
48901
48920
  const { parts: _parts, ...rest } = design;
48902
48921
  void _parts;
@@ -53732,7 +53751,7 @@ var FAILURE_ARTIFACT_DIR = "quikpilot-failure";
53732
53751
  var REPORT_COPY = "final-test-report.xml";
53733
53752
  var MAX_REPORT_BYTES = 5 * 1024 * 1024;
53734
53753
  var MAX_FILES = 200;
53735
- var RUNNER_VERSION = true ? "9.3.0-rc.77" : "dev";
53754
+ var RUNNER_VERSION = true ? "9.3.0-rc.78" : "dev";
53736
53755
  function safeDestination(base, repoPath) {
53737
53756
  if (!repoPath || (0, import_node_path27.isAbsolute)(repoPath)) return null;
53738
53757
  const destination = (0, import_node_path27.resolve)(base, repoPath);
@@ -54600,8 +54619,9 @@ async function run2(env2) {
54600
54619
  }
54601
54620
  const outOfScope = (packet.outOfScope ?? []).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
54602
54621
  const partsOn = partsCheckOn();
54603
- const designParts = partsOn ? partsFromDesign(packet.design) : [];
54604
- if (partsOn) console.log(JSON.stringify({ event: "parts_check.on", parts: designParts.length }));
54622
+ const designRead = partsOn ? partsFromDesignCut(packet.design) : { parts: [], cut: 0 };
54623
+ const designParts = designRead.parts;
54624
+ if (partsOn) console.log(JSON.stringify({ event: "parts_check.on", parts: designParts.length, ...designRead.cut > 0 ? { cut: designRead.cut } : {} }));
54605
54625
  const featureSwitch = featureTestUpdatesOn();
54606
54626
  const setupStartedAt = Date.now();
54607
54627
  runCommand(packet.commands.setup, "Setup");