Skip to content

Enhance linting, testing setup, and LLM model handling#17

Merged
oarisur merged 10 commits into
mainfrom
test-drift-action
May 24, 2026
Merged

Enhance linting, testing setup, and LLM model handling#17
oarisur merged 10 commits into
mainfrom
test-drift-action

Conversation

@oarisur
Copy link
Copy Markdown
Owner

@oarisur oarisur commented May 24, 2026

This pull request introduces several improvements across documentation, testing, workflows, and code quality. The most notable changes include expanded and more robust test coverage (including a new top-level integration test for the main entry point), improved linting and code quality enforcement (especially for test files), updates to workflow and template files for better usability and accuracy, and minor documentation and configuration adjustments.

Testing improvements:

  • Added a comprehensive index.test.ts file to test the main orchestration entry point, mocking all major dependencies and verifying correct wiring and error handling. This significantly increases confidence in the integration of core components.
  • Enhanced test coverage for LLMClient and DriftDetector to handle additional edge cases, such as different Anthropic response formats, retry logic, and error handling in drift detection analysis. [1] [2]

Linting and code quality:

  • Updated ESLint configuration to include test files (__tests__/**/*.ts), added a dedicated config block for test environments, and allowed certain globals and relaxed some rules for test code. [1] [2] [3]
  • The lint npm script now also checks test files, ensuring consistent code quality across the project.

Workflow and template updates:

  • Improved the bug report issue template to better target the Knowledge Diff action, request more relevant information (workflow YAML, logs, environment), and set the bug label by default.
  • In the CI workflow, switched from npm ci to npm install for dependency installation, improving compatibility in some environments.
  • In the self-check workflow, added an explicit repository checkout step and updated the token reference for clarity.

Documentation and configuration:

  • Updated cost estimate and usage instructions in README.md for accuracy, including revised token/cost calculations and an added lint command. [1] [2]
  • Set stricter Jest coverage thresholds (90% statements/functions/lines, 75% branches) in package.json to enforce high test coverage.
  • Minor update to the license year to include "present".

These changes collectively improve the project's reliability, maintainability, and usability.

oarisur added 10 commits May 23, 2026 16:36
- Updated ESLint configuration to include support for test files and added new globals for Jest.
- Modified package.json to include test files in linting and added coverage thresholds.
- Introduced a set of common stopwords in doc-extractor for better keyword extraction.
- Refactored doc-patcher to implement retry logic for GitHub API calls.
- Enhanced drift-detector to skip large document sections and handle LLM call errors gracefully.
- Improved LLM client to truncate text at newlines and increased max tokens for API calls.
- Added retry logic for PR commenting to handle potential API rate limits.
- Created comprehensive tests for the main orchestration entry point, covering various scenarios and edge cases.
@github-actions
Copy link
Copy Markdown

✅ Knowledge Diff — No Rationale Drift Detected

Checked 12 changed file(s) against 1 documentation file(s) — all clear.

🧠 knowledge-diff • analysed 17 candidate pair(s)

@oarisur oarisur merged commit 13dfeea into main May 24, 2026
@oarisur oarisur deleted the test-drift-action branch May 24, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant