docgrity 0.1.2 → 0.1.4
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 +109 -126
- package/{action/action.yml → action.yml} +4 -1
- package/{action/bin → bin}/action.js +12 -6
- package/{action/bin → bin}/docgrity.js +23 -9
- package/package.json +31 -164
- package/src/heuristics.js +146 -0
- package/{action/src → src}/issues.js +4 -1
- package/{action/src → src}/report.js +2 -1
- package/{action/src → src}/scan.js +32 -7
- package/.github/workflows/ci.yml +0 -54
- package/.vscodeignore +0 -13
- package/action/LICENSE +0 -21
- package/action/README.md +0 -104
- package/action/examples/docgrity.yml +0 -61
- package/action/package.json +0 -38
- package/action/test/corpus.test.mjs +0 -59
- package/action/test/issues.test.mjs +0 -89
- package/action/test/report.test.mjs +0 -76
- package/docgrity_logo.png +0 -0
- package/image.png +0 -0
- package/media/icon.png +0 -0
- package/media/icon.svg +0 -5
- package/samples/api-limits.md +0 -23
- package/samples/architecture-notes.md +0 -28
- package/samples/deployment-guide.md +0 -23
- package/samples/integration-guide.md +0 -21
- package/samples/release-process.md +0 -23
- package/src/agents/assess.ts +0 -187
- package/src/agents/prompts.ts +0 -94
- package/src/agents/selectModel.ts +0 -50
- package/src/core/json.ts +0 -58
- package/src/core/prefilter.ts +0 -56
- package/src/core/slug.ts +0 -10
- package/src/core/verify.ts +0 -15
- package/src/extension.ts +0 -142
- package/src/findings/diagnostics.ts +0 -78
- package/src/findings/report.ts +0 -68
- package/src/findings/store.ts +0 -60
- package/src/findings/tree.ts +0 -93
- package/src/github/issues.ts +0 -90
- package/src/github/owners.ts +0 -60
- package/src/log.ts +0 -22
- package/src/scanner/candidates.ts +0 -62
- package/src/scanner/corpus.ts +0 -75
- package/src/scanner/scan.ts +0 -215
- package/test/candidates.test.ts +0 -63
- package/test/json.test.ts +0 -87
- package/test/prefilter.test.ts +0 -65
- package/test/slug.test.ts +0 -31
- package/test/verify.test.ts +0 -47
- package/tsconfig.json +0 -15
- package/vitest.config.mts +0 -9
- /package/{action/src → src}/corpus.js +0 -0
- /package/{action/src → src}/llm.js +0 -0
- /package/{action/src → src}/prompts.js +0 -0
package/test/verify.test.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { verifyExcerpts } from '../src/core/verify';
|
|
3
|
-
|
|
4
|
-
const docA = 'The deploy pipeline runs on every merge to main.\nReleases are weekly.';
|
|
5
|
-
const docB = 'Releases happen monthly after QA sign-off.';
|
|
6
|
-
|
|
7
|
-
describe('verifyExcerpts', () => {
|
|
8
|
-
it('accepts excerpts present verbatim', () => {
|
|
9
|
-
expect(verifyExcerpts([{ excerpt: 'Releases are weekly.' }], [docA, docB])).toBe(true);
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it('is whitespace-insensitive', () => {
|
|
13
|
-
expect(
|
|
14
|
-
verifyExcerpts([{ excerpt: 'deploy pipeline runs on every merge' }], [docA])
|
|
15
|
-
).toBe(true);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is case-insensitive', () => {
|
|
19
|
-
expect(verifyExcerpts([{ excerpt: 'RELEASES HAPPEN MONTHLY' }], [docB])).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('rejects hallucinated excerpts', () => {
|
|
23
|
-
expect(verifyExcerpts([{ excerpt: 'Releases are daily.' }], [docA, docB])).toBe(false);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('rejects when any excerpt fails (all-or-nothing)', () => {
|
|
27
|
-
expect(
|
|
28
|
-
verifyExcerpts(
|
|
29
|
-
[{ excerpt: 'Releases are weekly.' }, { excerpt: 'invented claim' }],
|
|
30
|
-
[docA, docB]
|
|
31
|
-
)
|
|
32
|
-
).toBe(false);
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
it('rejects empty excerpts', () => {
|
|
36
|
-
expect(verifyExcerpts([{ excerpt: ' ' }], [docA])).toBe(false);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('accepts an empty excerpt list (nothing to verify)', () => {
|
|
40
|
-
expect(verifyExcerpts([], [docA])).toBe(true);
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('only compares the first 200 normalised chars of long excerpts', () => {
|
|
44
|
-
const long = 'x'.repeat(300);
|
|
45
|
-
expect(verifyExcerpts([{ excerpt: long }], [`prefix ${'x'.repeat(200)} suffix`])).toBe(true);
|
|
46
|
-
});
|
|
47
|
-
});
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"outDir": "out",
|
|
7
|
-
"rootDir": "src",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"types": ["node"],
|
|
12
|
-
"skipLibCheck": true
|
|
13
|
-
},
|
|
14
|
-
"include": ["src"]
|
|
15
|
-
}
|
package/vitest.config.mts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
// action/ is a zero-dependency package tested with node:test (`cd action && npm test`);
|
|
4
|
-
// vitest covers the extension sources only.
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
test: {
|
|
7
|
-
exclude: ['**/node_modules/**', 'action/**', 'out/**'],
|
|
8
|
-
},
|
|
9
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|