Repository navigation
Clean up readability warnings in the analysis, collection and comparison modules - #45
Merged
Merged
Conversation
Rename only: callback parameters and the parsed option values in analysis.ts and collection.ts get descriptive names. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
collect delegates the conflicting-classification check, linking an already verified copy, writing the managed copy and building the file record. runCollection delegates argument and URL checks, finding the selected row, the unavailable and decide inputs and the edition evidence. report names its next-step message instead of nesting ternaries. Every await stays where it was or ends a helper that the original code also awaited at that point. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
relationState delegates the source-relation check, the origin label, missing and unregistered claim references, the current dependencies and the staleness test. Values it read before awaiting the source states are still read before that await. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runAnalysis delegates argument parsing, opening an analysis document (the Paper connection check and the new edition section) and saving an answer (answer JSON checks). comparisonInput delegates sorting one paper's candidate claims into included and held items. The held item type is written out so the exported declaration stays the same. Every await stays where it was or ends a helper that the original also awaited at that point. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moving the URL check out of runCollection changed its inferred return type from Promise<undefined> to Promise<void>. Declare the original type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ison modules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The split computed needs_recheck while spreading the relation into the result object, after the copy. The original computed it first. Keep that order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
partitionCandidateClaims splits candidates without reordering them, the document returned by opening or saving is named document, and nextStep takes a boolean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
The second readability cleanup after ESLint was added (#43, #44). It covers
src/core/analysis.ts,collection.tsandcomparison.ts. These files had 29 readability warnings and now have none, and this PR adds them to the list ineslint.config.jswhere the five readability rules are errors. It changes no behavior.The commits are meant to be read separately.
git diff --color-movedhelps tell moved code from new code.f5b7f7aRenames only. One-letter callback parameters and the parsed option values get descriptive names.67c858d,fe33700,c67b17e).collection.ts:collectdelegates the conflicting-classification check, linking an already verified copy, writing the managed copy and building the file record.runCollectiondelegates argument and URL checks, finding the selected row, and the unavailable, decide and collect inputs.reportnames its next-step message instead of nesting ternaries.comparison.ts:relationStatedelegates the source-relation check, the origin label, missing and unregistered claim references, the current dependencies and the staleness test.analysis.ts:runAnalysisdelegates argument parsing, opening an analysis document and saving an answer.comparisonInputdelegates splitting one paper's candidate claims into included and held items.bd3cfc9keepsrunCollection's declared return type (Promise<undefined>), which moving the URL check had changed toPromise<void>.8814c04promotes the rules for these three files.61eb59f,1724242Review fixes.relationStatecomputes staleness before building its result, as before, and three helper names are clearer.The first cleanup (#44) showed that splitting async code can add
awaitpoints. Here, only synchronous parts were moved out, or whole blocks that the original already awaited at that point. Values the original read before anawaitare still read before it. The managed copy thatcollectcreates is still removed when a later check fails.No warning needed a behavior change to fix. Remaining warnings in the repository: 328 (357 on main).
Verification
npm run lint: 0 errors; 0 warnings in the three files. A scratch one-letter name incomparison.tsfails lint.npm run check:format,npm test(94 product and 143 skill tests),npm run check:docs,npm run test:package,node dist/cli.js validate --workspace examples/minimal --jsonandgit diff --checkpassed on Windows 11 with Node 24.22.3.efca5d3and this branch) were loaded in one process, and the same 600 seeded command sequences (16,511 steps) ran against a fresh synthetic topic and card workspace at the same path. They covered topic selection, PDF collection with existing and downloaded files, URLs, published and draft editions and wrong PDFs,unavailable, draft consent,sources, card and review changes,analysis-openandanalysis-savewith valid and invalid answers,analysis-list,comparison-input,comparison.json, relation files with pinned dependencies, andcompare --json. Targeted sequences also covered reclassifying a published file as a draft, reusing a verified copy in a second selection round, publishing a renamed copy when the managed name is taken, and a withdrawn claim in a relation. Each step's return value, printed JSON (withgenerated_atand random file names masked), thrown error (class, code, message, exit code) and the final file tree were identical.comparisonInput'sheldunion and therunCollectionreturn type; both are fixed. Comparing two different modules makes the check fail.efca5d3on8814c04, before the two small review fixes.openAnalysis,saveAnswerorwriteManagedCopy, the helper settles a few microtasks later. A microtask injected by instrumentation can therefore run before the lock release after a validation failure, or before the next file check. Outputs, errors and write order are unchanged.compare --port) is outside these files and was not exercised.Checklist
🤖 Generated with Claude Code