@under18dev/veritas-improvement 0.0.0-stage → 0.1.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.
@@ -0,0 +1,83 @@
1
+ import { lstatSync } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { resolveInsideRoot } from '@under18dev/veritas-core';
4
+ /** Directories that never receive patch files. */
5
+ const FORBIDDEN_DIRS = new Set(['node_modules', '.git', '.veritas', '.mutator']);
6
+ /** Focus, skip and todo markers in Vitest/Jest style, including the `x`/`f` aliases. */
7
+ const DISABLING = [
8
+ /\.\s*(?:skip|only|todo|skipIf|runIf)\b/,
9
+ /\b(?:xit|xtest|xdescribe|fit|fdescribe|ftest)\s*\(/,
10
+ ];
11
+ function isMarkdownOrReadme(file) {
12
+ const base = path.posix.basename(file).toLowerCase();
13
+ return base.startsWith('readme') || /\.(md|mdx|markdown|rst|txt)$/.test(base);
14
+ }
15
+ function exists(file) {
16
+ try {
17
+ lstatSync(file);
18
+ return true;
19
+ }
20
+ catch (error) {
21
+ if (error.code === 'ENOENT')
22
+ return false;
23
+ throw error;
24
+ }
25
+ }
26
+ /**
27
+ * Mechanical safety check of a patch before anything is written, even into the isolated workspace.
28
+ * Returns the list of violations; an empty list means the patch only adds new test files inside `root`.
29
+ */
30
+ export function validatePatch(root, files, rules) {
31
+ const problems = [];
32
+ if (files.length === 0)
33
+ problems.push('the patch contains no file');
34
+ if (files.length > rules.maxPatchFiles) {
35
+ problems.push(`the patch has ${files.length} files, more than maxPatchFiles (${rules.maxPatchFiles})`);
36
+ }
37
+ const seen = new Set();
38
+ for (const file of files) {
39
+ const p = file.path;
40
+ const label = JSON.stringify(p);
41
+ if (file.operation !== 'add') {
42
+ problems.push(`${label}: operation "${file.operation}" is not allowed; only new test files may be added`);
43
+ }
44
+ if (p === '' ||
45
+ p.includes('\0') ||
46
+ p.includes('\\') ||
47
+ path.posix.isAbsolute(p) ||
48
+ /^[A-Za-z]:/.test(p) ||
49
+ p.split('/').some((s) => s === '..' || s === '.' || s === '')) {
50
+ problems.push(`${label}: not a normalized relative path inside the project`);
51
+ continue;
52
+ }
53
+ if (seen.has(p))
54
+ problems.push(`${label}: listed more than once`);
55
+ seen.add(p);
56
+ if (p.split('/').some((s) => FORBIDDEN_DIRS.has(s))) {
57
+ problems.push(`${label}: inside a directory that is never patched`);
58
+ }
59
+ if (isMarkdownOrReadme(p))
60
+ problems.push(`${label}: documentation and README files are never changed`);
61
+ if (!rules.testInclude.some((glob) => path.posix.matchesGlob(p, glob))) {
62
+ problems.push(`${label}: not a test file (does not match analysis.testInclude)`);
63
+ }
64
+ let absolute;
65
+ try {
66
+ absolute = resolveInsideRoot(root, p);
67
+ }
68
+ catch (error) {
69
+ problems.push(`${label}: ${error.message}`);
70
+ continue;
71
+ }
72
+ if (exists(absolute))
73
+ problems.push(`${label}: already exists; existing files are never edited`);
74
+ for (const pattern of DISABLING) {
75
+ if (pattern.test(file.content)) {
76
+ problems.push(`${label}: contains a skip/only/todo marker (${pattern.source})`);
77
+ break;
78
+ }
79
+ }
80
+ }
81
+ return problems;
82
+ }
83
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAQ7D,kDAAkD;AAClD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAEjF,wFAAwF;AACxF,MAAM,SAAS,GAAG;IAChB,wCAAwC;IACxC,oDAAoD;CACrD,CAAC;AAEF,SAAS,kBAAkB,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,C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,CAAC,CAAC;QACxC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,KAAM,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;YACvD,SAAS;QACX,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,CAAC;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,mDAAmD,CAAC,CAAC;QAEjG,KAAK,MAAM,OAAO,IAAI,SAAS,EAAE,CAAC;YAChC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,uCAAuC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;gBAChF,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,19 @@
1
+ export type TestStatus = 'passed' | 'failed' | 'skipped';
2
+ export type VitestRun = {
3
+ status: 'ok';
4
+ /** `<relative file>::<full test name>` -> status. A file that fails to load is `<file>::(file)`. */
5
+ tests: Map<string, TestStatus>;
6
+ failures: string[];
7
+ passed: number;
8
+ failed: number;
9
+ } | {
10
+ status: 'error';
11
+ detail: string;
12
+ };
13
+ /** Run the project's own Vitest once in `cwd` with the JSON reporter, without a shell. */
14
+ export declare function runVitest(cwd: string, options: {
15
+ timeoutMs: number;
16
+ label: string;
17
+ signal?: AbortSignal;
18
+ }): Promise<VitestRun>;
19
+ //# sourceMappingURL=vitest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../src/vitest.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,MAAM,SAAS,GACjB;IACE,MAAM,EAAE,IAAI,CAAC;IACb,oGAAoG;IACpG,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAyBxC,0FAA0F;AAC1F,wBAAsB,SAAS,CAC7B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GAClE,OAAO,CAAC,SAAS,CAAC,CAoEpB"}
package/dist/vitest.js ADDED
@@ -0,0 +1,77 @@
1
+ import { existsSync, mkdirSync, readFileSync, realpathSync } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { redact, runProjectTests } from '@under18dev/veritas-core';
4
+ function longPath(p) {
5
+ try {
6
+ return realpathSync.native(path.resolve(p));
7
+ }
8
+ catch {
9
+ return path.resolve(p);
10
+ }
11
+ }
12
+ function short(text, max = 300) {
13
+ const one = redact(text).replace(/\s+/g, ' ').trim();
14
+ return one.length > max ? `${one.slice(0, max)}...` : one;
15
+ }
16
+ /** Run the project's own Vitest once in `cwd` with the JSON reporter, without a shell. */
17
+ export async function runVitest(cwd, options) {
18
+ const bin = path.join(cwd, 'node_modules', 'vitest', 'vitest.mjs');
19
+ if (!existsSync(bin))
20
+ return { status: 'error', detail: 'vitest is not installed in the project' };
21
+ const outDir = path.join(cwd, '.veritas', 'improve');
22
+ mkdirSync(outDir, { recursive: true });
23
+ const outFile = path.join(outDir, `vitest-${options.label}.json`);
24
+ const result = await runProjectTests(process.execPath, [bin, 'run', '--reporter=json', `--outputFile=${outFile}`], {
25
+ cwd,
26
+ timeoutMs: options.timeoutMs,
27
+ ...(options.signal ? { signal: options.signal } : {}),
28
+ });
29
+ if (result.spawnError)
30
+ return { status: 'error', detail: `could not start vitest: ${result.spawnError}` };
31
+ if (result.timedOut)
32
+ return { status: 'error', detail: `vitest exceeded ${options.timeoutMs} ms` };
33
+ if (options.signal?.aborted)
34
+ return { status: 'error', detail: 'cancelled' };
35
+ let report;
36
+ try {
37
+ report = JSON.parse(readFileSync(outFile, 'utf8'));
38
+ }
39
+ catch {
40
+ return {
41
+ status: 'error',
42
+ detail: `vitest wrote no JSON report (exit ${result.exitCode}): ${short(result.stderr || result.stdout)}`,
43
+ };
44
+ }
45
+ const tests = new Map();
46
+ const failures = [];
47
+ // Compare real long paths: on Windows the temp directory may be an 8.3 short name (RUNNER~1) while Vitest
48
+ // reports the long form, which would make every relative path wrong.
49
+ const base = longPath(cwd);
50
+ for (const file of report.testResults ?? []) {
51
+ const rel = path
52
+ .relative(base, longPath(file.name ?? ''))
53
+ .split(path.sep)
54
+ .join('/');
55
+ const assertions = file.assertionResults ?? [];
56
+ if (assertions.length === 0 && file.status === 'failed') {
57
+ tests.set(`${rel}::(file)`, 'failed');
58
+ failures.push(`${rel}: ${short(file.message ?? 'failed to load')}`);
59
+ }
60
+ for (const a of assertions) {
61
+ const key = `${rel}::${a.fullName ?? a.title ?? '?'}`;
62
+ const status = a.status === 'passed' ? 'passed' : a.status === 'failed' ? 'failed' : 'skipped';
63
+ tests.set(key, status);
64
+ if (status === 'failed')
65
+ failures.push(`${key}: ${short(a.failureMessages?.[0] ?? 'failed')}`);
66
+ }
67
+ }
68
+ const values = [...tests.values()];
69
+ return {
70
+ status: 'ok',
71
+ tests,
72
+ failures,
73
+ passed: values.filter((s) => s === 'passed').length,
74
+ failed: values.filter((s) => s === 'failed').length,
75
+ };
76
+ }
77
+ //# sourceMappingURL=vitest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.js","sourceRoot":"","sources":["../src/vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,IAAI,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AAG,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IAEnC,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,KAAK;QACL,QAAQ;QACR,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,MAAM;QACnD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,MAAM;KACpD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { PatchFile } from './schema.js';
2
+ /** Directories that are tool state or dependencies, not project content. */
3
+ export declare const IGNORED_DIRS: Set<string>;
4
+ /** sha256 per project file (symlinks by their target text), keyed by POSIX relative path. */
5
+ export declare function snapshotTree(root: string): Map<string, string>;
6
+ export declare function treeHash(snapshot: Map<string, string>): string;
7
+ export declare function projectHash(root: string): string;
8
+ /** Paths whose hash differs between two snapshots (added, removed or changed). */
9
+ export declare function diffSnapshots(before: Map<string, string>, after: Map<string, string>): string[];
10
+ /**
11
+ * Copy the project into a fresh temporary directory, leaving out dependencies and tool state, and link
12
+ * `node_modules` so the project's own Vitest and mutator are used without reinstalling.
13
+ */
14
+ export declare function createWorkspace(root: string): string;
15
+ export declare function removeWorkspace(dir: string): void;
16
+ export interface WriteRecord {
17
+ files: string[];
18
+ dirs: string[];
19
+ }
20
+ /**
21
+ * Create each file exclusively (fails if anything already exists at the path, including a symlink).
22
+ * On any error, everything written so far is removed again and the error is rethrown.
23
+ */
24
+ export declare function writeNewFiles(root: string, files: PatchFile[]): WriteRecord;
25
+ /** Remove written files and the directories created for them (deepest first). Returns paths that could not be removed. */
26
+ export declare function undoWrites(record: WriteRecord): string[];
27
+ //# sourceMappingURL=workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,4EAA4E;AAC5E,eAAO,MAAM,YAAY,aAA4D,CAAC;AAEtF,6FAA6F;AAC7F,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAmB9D;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAE9D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,kFAAkF;AAClF,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,CAQ/F;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA2BpD;AAoBD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,WAAW,CAyB3E;AAED,0HAA0H;AAC1H,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAsBxD"}
@@ -0,0 +1,166 @@
1
+ import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, readlinkSync, realpathSync, rmdirSync, rmSync, symlinkSync, unlinkSync, writeFileSync, } from 'node:fs';
2
+ import { tmpdir } from 'node:os';
3
+ import path from 'node:path';
4
+ import { hashValue, resolveInsideRoot, sha256, VeritasError } from '@under18dev/veritas-core';
5
+ /** Directories that are tool state or dependencies, not project content. */
6
+ export const IGNORED_DIRS = new Set(['node_modules', '.git', '.veritas', '.mutator']);
7
+ /** sha256 per project file (symlinks by their target text), keyed by POSIX relative path. */
8
+ export function snapshotTree(root) {
9
+ const out = new Map();
10
+ const walk = (dir, rel) => {
11
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
12
+ const relPath = rel ? `${rel}/${entry.name}` : entry.name;
13
+ const abs = path.join(dir, entry.name);
14
+ if (entry.isDirectory()) {
15
+ if (!IGNORED_DIRS.has(entry.name))
16
+ walk(abs, relPath);
17
+ }
18
+ else if (entry.isSymbolicLink()) {
19
+ if (!IGNORED_DIRS.has(entry.name))
20
+ out.set(relPath, `symlink:${readlinkSync(abs)}`);
21
+ }
22
+ else if (entry.isFile()) {
23
+ out.set(relPath, sha256(readFileSync(abs)));
24
+ }
25
+ }
26
+ };
27
+ walk(root, '');
28
+ return out;
29
+ }
30
+ export function treeHash(snapshot) {
31
+ return hashValue([...snapshot.entries()].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));
32
+ }
33
+ export function projectHash(root) {
34
+ return treeHash(snapshotTree(root));
35
+ }
36
+ /** Paths whose hash differs between two snapshots (added, removed or changed). */
37
+ export function diffSnapshots(before, after) {
38
+ const changed = new Set();
39
+ for (const [p, h] of before)
40
+ if (after.get(p) !== h)
41
+ changed.add(p);
42
+ for (const p of after.keys())
43
+ if (!before.has(p))
44
+ changed.add(p);
45
+ return [...changed].sort();
46
+ }
47
+ /**
48
+ * Copy the project into a fresh temporary directory, leaving out dependencies and tool state, and link
49
+ * `node_modules` so the project's own Vitest and mutator are used without reinstalling.
50
+ */
51
+ export function createWorkspace(root) {
52
+ const dir = realpathSync(mkdtempSync(path.join(tmpdir(), 'veritas-improve-')));
53
+ const realRoot = realpathSync(root);
54
+ cpSync(realRoot, dir, {
55
+ recursive: true,
56
+ verbatimSymlinks: true,
57
+ filter: (src) => {
58
+ const rel = path.relative(realRoot, src);
59
+ return rel === '' || !rel.split(path.sep).some((s) => IGNORED_DIRS.has(s));
60
+ },
61
+ });
62
+ const escaping = linksLeaving(dir);
63
+ if (escaping.length > 0) {
64
+ removeWorkspace(dir);
65
+ throw new VeritasError('user', 'IMPROVE_UNSAFE_LINK', `the project has links outside the project, which the isolated run could write through: ${escaping.join(', ')}`, 'replace them with real files or directories before applying an improvement');
66
+ }
67
+ const modules = path.join(realRoot, 'node_modules');
68
+ if (existsSync(modules))
69
+ linkPackages(modules, path.join(dir, 'node_modules'));
70
+ return dir;
71
+ }
72
+ /** Copied symbolic links (kept verbatim) whose target is not inside `dir`, as `path -> target`. */
73
+ function linksLeaving(dir) {
74
+ const out = [];
75
+ const walk = (current) => {
76
+ for (const entry of readdirSync(current, { withFileTypes: true })) {
77
+ const abs = path.join(current, entry.name);
78
+ if (entry.isSymbolicLink()) {
79
+ const target = readlinkSync(abs);
80
+ const rel = path.relative(dir, path.resolve(current, target));
81
+ if (rel.startsWith('..') || path.isAbsolute(rel))
82
+ out.push(`${path.relative(dir, abs).split(path.sep).join('/')} -> ${target}`);
83
+ }
84
+ else if (entry.isDirectory())
85
+ walk(abs);
86
+ }
87
+ };
88
+ walk(dir);
89
+ return out;
90
+ }
91
+ export function removeWorkspace(dir) {
92
+ rmSync(dir, { recursive: true, force: true });
93
+ }
94
+ /**
95
+ * Create each file exclusively (fails if anything already exists at the path, including a symlink).
96
+ * On any error, everything written so far is removed again and the error is rethrown.
97
+ */
98
+ export function writeNewFiles(root, files) {
99
+ const record = { files: [], dirs: [] };
100
+ try {
101
+ for (const file of files) {
102
+ const abs = resolveInsideRoot(root, file.path);
103
+ const missing = [];
104
+ for (let d = path.dirname(abs); !existsSync(d); d = path.dirname(d))
105
+ missing.unshift(d);
106
+ for (const d of missing) {
107
+ mkdirSync(d);
108
+ record.dirs.push(d);
109
+ }
110
+ // Re-check after creating directories: a directory swapped for a symlink must not redirect the write.
111
+ resolveInsideRoot(root, file.path);
112
+ writeFileSync(abs, file.content, { flag: 'wx' });
113
+ record.files.push(abs);
114
+ }
115
+ return record;
116
+ }
117
+ catch (error) {
118
+ undoWrites(record);
119
+ throw error;
120
+ }
121
+ }
122
+ /** Remove written files and the directories created for them (deepest first). Returns paths that could not be removed. */
123
+ export function undoWrites(record) {
124
+ const failed = [];
125
+ for (const file of [...record.files].reverse()) {
126
+ try {
127
+ if (lstatSync(file).isFile())
128
+ unlinkSync(file);
129
+ }
130
+ catch (error) {
131
+ if (error.code !== 'ENOENT')
132
+ failed.push(file);
133
+ }
134
+ }
135
+ for (const dir of [...record.dirs].reverse()) {
136
+ try {
137
+ rmdirSync(dir);
138
+ }
139
+ catch (error) {
140
+ if (error.code !== 'ENOENT')
141
+ failed.push(dir);
142
+ }
143
+ }
144
+ record.files = [];
145
+ record.dirs = [];
146
+ return failed;
147
+ }
148
+ /**
149
+ * Link each installed package (and `.bin`) individually into a real `node_modules` directory of the workspace.
150
+ * Tools write caches into `node_modules` (`.vite`, `.vitest-cache`); with a real directory those writes stay in
151
+ * the workspace instead of reaching the project through a link.
152
+ */
153
+ function linkPackages(from, to) {
154
+ mkdirSync(to, { recursive: true });
155
+ for (const entry of readdirSync(from)) {
156
+ if (entry.startsWith('.') && entry !== '.bin')
157
+ continue;
158
+ const source = path.join(from, entry);
159
+ if (entry.startsWith('@')) {
160
+ linkPackages(source, path.join(to, entry));
161
+ continue;
162
+ }
163
+ symlinkSync(realpathSync(source), path.join(to, entry), 'junction');
164
+ }
165
+ }
166
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAA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;IACtE,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "@under18dev/veritas-improvement",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Plans test-only improvements and applies them after measuring them in an isolated workspace",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/under18dev/veritas.git",
9
+ "directory": "packages/improvement"
10
+ },
11
+ "type": "module",
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "engines": {
22
+ "node": ">=24"
23
+ },
24
+ "dependencies": {
25
+ "@under18dev/veritas-core": "0.1.0",
26
+ "@under18dev/veritas-engine": "0.1.0",
27
+ "@under18dev/veritas-formal-core": "0.1.0",
28
+ "@under18dev/veritas-mutation-adapter": "0.1.0",
29
+ "zod": "4.6.7",
30
+ "@under18dev/veritas-property-engine": "0.1.0"
31
+ }
6
32
  }