@quikit/quikpilot-runner 9.3.0-rc.54 → 9.3.0-rc.56
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 +2 -0
- package/dist/index.js +302 -75
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -164,6 +164,8 @@ wrong (a field that arrives from a database row or a request), so it only warns
|
|
|
164
164
|
|
|
165
165
|
**9.3.0-rc.46 — the existing tests to read first include the ones that reach the code through one file in between (QUIKTR-1845).** On the live bug-6 run (QTRIA-17) the design changed `lib/services/issueFilters.ts`, and the two tests that assert the bug import `app/api/issues/route.ts`, which imports it, so the list of existing tests the AI reads before writing (`testsToCheck`, rc.44) was empty. When fewer than 3 test files are found by name or a direct import, the runner now takes one more step: of the files the tests import (code, not a test, not under a denied path; the 150 most shared first) it keeps the ones that import a changed file, and adds the tests that import them, after the others and up to 10 in all. A file in between imported by more than 12 tests only brings the tests named after it (a route by its folder) or after the changed file. Paths only, as before. With 3 or more found the list is exactly as in rc.45. Also in rc.46: everything in rc.45. Nothing else changes.
|
|
166
166
|
|
|
167
|
+
**9.3.0-rc.56 - outline and find_definition for eight languages, the last test-file names, and the AI's own tests kept in Python, Go and Java (QUIKTR-1701, release 2).** (1) `definitions.ts` reads the definitions of a Python, Go, Java, Kotlin, C#, Rust, Ruby or PHP file from its tree-sitter tree - functions, classes, methods, structs, interfaces, enums, modules, with exact line ranges and nesting (a Java or C# method, a Kotlin `fun`, a Ruby `valid?` and `def self.x`, a Rust `impl`). `read_file` mode "outline" and the too-large answer use it (`engine: "treesitter"`), and `find_definition` looks a name up in the tree of every file that holds it (at most 80 files are parsed per call; the rest, a file that does not parse and any other language keep the line patterns). The name rule is widened to any language: a letter of any script, `_` or `$`, then letters, digits, `_` or `$`, optionally a Ruby-style `?` or `!` at the end (the AI service checks the same rule first: deploy it BEFORE this runner), and a regular-expression character in a name can no longer break the pattern. The grammars are loaded once at the start of a run for the languages in the repository. (2) Test-file names: Surefire's `Test*.java` and `*TestCase.java`, Failsafe's `*IT.java`, Kotest and ScalaTest `FooSpec.kt/.scala`, Django `tests.py` and every file of a C# test project (`Acme.Tests/`) are test files (same table in the AI service and QuikProjects). (3) A fix may correct a test the AI wrote in this run in a Python, Go or Java file but not remove it, skip it (`@pytest.mark.skip`, `t.Skip()`, `@Disabled`) or leave it with fewer checks (assertion statements, `t.Error`/`t.Fatal`, `pytest.raises`, `fail(...)`), as for JavaScript. `QUIKPILOT_LANG_CHECKS=js` and `QUIKPILOT_TEST_LOCATE=js` switch the readers off. Also in rc.56: everything in rc.54 (rc.55 is QUIKTR-1853, built on its own branch).
|
|
168
|
+
|
|
167
169
|
**9.3.0-rc.54 - eight languages share one tree-sitter base: a syntax check and "never weaken an existing test" by structure (QUIKTR-1701, release 1).** Until now the runner's safety checks read code with a JavaScript parser and switched off for any other language: nothing noticed a broken Go or Ruby file, and an existing test in another language was protected only by the text rule, which lets any text be added in front of or behind the matched part (`t.Skip()`, an early `return`, `@pytest.mark.skip`, `@Disabled`, a shadowing `test_a = lambda: None` all passed). Now `languages.ts` is the one table of the languages read with tree-sitter - Python, Go, Java, Kotlin, C#, Rust, Ruby and PHP (JavaScript and TypeScript keep acorn and sucrase and every check they have). (1) Syntax: after each edit the code-writing loop tells the AI "the file no longer parses (a syntax error at line N)" when a file that parsed does not, and at hand-over a file that parsed before and does not now stops the run, exactly as for JavaScript; a file that was already broken, or a language whose grammar is not loaded, is never judged. (2) Existing tests (`existingTestsLang.ts`): every unit of the test file as it was before the run (a function, a class, an import, a statement - with its decorators, annotations and modifiers) must still be there, byte for byte and in order; a class, module, `impl` or RSpec `describe` is compared by what is around its body and then by its own units; an import may only gain names or a whole new import may be added; comments between units are free; a NEW unit may only declare something whose name no unit of that level has, and may not be a hook that runs around every test (`setUp`, `TestMain`, `init`, `@BeforeEach`, `[SetUp]`, a constructor, an RSpec `before`/`let`, a fixture, a static or `init` block, an inner attribute), a build constraint, a statement that declares nothing (`pytest.skip(...)` at module level), or a Rust attribute in front of an old item. The reasons are the same closed words as for JavaScript (`changed_text`, `removed_text`, `moved_block`, `affects_existing`). A file that does not parse falls back to the text rule. Size: the five new grammars are vendored brotli-compressed and embedded the same way (each decoded on first use, 2-25 ms), and the published source map no longer copies the source text, so the package is about 1.4 MB (rc.53: about 1.9 MB). `QUIKPILOT_LANG_CHECKS=js` turns both checks back to the old behaviour. Also in rc.54: everything in rc.53.
|
|
168
170
|
|
|
169
171
|
**9.3.0-rc.53 - a Python, Go or Java test that pins the bug can be reported to a person (QUIKTR-1855, release 2).** Until now the stop "an existing test expects what an approved case calls wrong - may I change it?" worked only for JavaScript and TypeScript tests: the test was found, and an edit of it judged, by a JavaScript parser, so a Go, Python or Java test ended the run with `test_unsupported_language`. Now `testLocateLang.ts` finds the tests of those languages with tree-sitter (a Python `def test_*` with its decorators, a Go `func TestX` whose subtests are its rows, a Java `@Test`/`@ParameterizedTest` method with its annotations) and judges an edit by its SHAPE: the test's tokens with every literal value (text, number, true/false/None/nil/null), assertion statements (`assert ...`, `self.assertEqual`, `assert.Equal`, `assertEquals`, `assertThat(...)...`), comments and the test's own name taken out must be the same before and after - so the values of a `parametrize` list, a Go table or a `@CsvSource` may change, and the call the test makes, its loops and its set-up may not. Data a test reads from elsewhere in the file (a module-level list, a `@MethodSource`) is outside the test and an edit there is refused as outside it. The tests are found by the function's name (a Java `@DisplayName` is the title when there is one); a reply that does not find the title lists the file's test names. A later job (the approval) reads the file the same way. The tree-sitter runtime and the three grammars (`vendor/tree-sitter/`, MIT, about 1.3 MB) are embedded in the bundle as base64 and decoded only when the first Python, Go or Java test file is read, so a JavaScript run pays nothing; the package grows from about 330 KB to about 700 KB gzipped and stays one file with no dependencies. A file that does not parse cleanly, and any other language (Kotlin, C#, Ruby, PHP), is still `test_unsupported_language`. `QUIKPILOT_TEST_LOCATE=js` turns the new readers off. Also in rc.53: everything in rc.52.
|