Skip to content

Commit 7331886

Browse files
committed
analyzer.ts: remove truncation limits and fix build permissions
Why: The analyzer was cutting lists to small fixed slices, hiding useful details in reports. The build step also bundled chmod logic that belongs in postinstall. What: - Return full missing, extra, reworded, and agreed lists in reports - Return full section and citation diffs - Move chmod logic to a postinstall script and simplify build step
1 parent f12ce1b commit 7331886

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
"vitest": "^3.1.1"
100100
},
101101
"scripts": {
102-
"build": "npx tsc && cp -r src/templates dist/ && chmod +x dist/cli.js",
102+
"build": "npx tsc && cp -r src/templates dist/",
103+
"postinstall": "test -f dist/cli.js && chmod +x dist/cli.js || exit 0",
103104
"start": "node dist/cli.js",
104105
"test": "vitest run",
105106
"lint": "eslint . --ext .ts",

src/lib/analyzer.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -826,19 +826,19 @@ export const analyzeContent = (
826826
const rewordedWikiSentences = new Set(rewordedPairs.map((pair) => pair.wikipedia));
827827
const trulyMissingAll = missingAll.filter((sentence) => !rewordedWikiSentences.has(sentence));
828828

829-
const missing = missingAll.slice(0, 5);
830-
const extra = extraAll.slice(0, 5);
831-
const trulyMissing = trulyMissingAll.slice(0, 5);
832-
const reworded = rewordedPairs.slice(0, 5);
833-
const agreed = agreedSentences.slice(0, 10);
829+
const missing = missingAll;
830+
const extra = extraAll;
831+
const trulyMissing = trulyMissingAll;
832+
const reworded = rewordedPairs;
833+
const agreed = agreedSentences;
834834

835835
const wikiSections = wiki.content.sections;
836836
const grokSections = grok.content.sections;
837-
const missingSections = difference(wikiSections, grokSections).slice(0, 5);
838-
const extraSections = difference(grokSections, wikiSections).slice(0, 5);
837+
const missingSections = difference(wikiSections, grokSections);
838+
const extraSections = difference(grokSections, wikiSections);
839839

840-
const missingCitations = difference(wiki.content.citations, grok.content.citations).slice(0, 5);
841-
const extraCitations = difference(grok.content.citations, wiki.content.citations).slice(0, 5);
840+
const missingCitations = difference(wiki.content.citations, grok.content.citations);
841+
const extraCitations = difference(grok.content.citations, wiki.content.citations);
842842

843843
const sectionAlignment = alignSections(wiki.article, grok.article);
844844
const claimAlignment = alignClaims(wiki.article, grok.article);

0 commit comments

Comments
 (0)