Skip to content

fix: keep context artifacts out of quality gates - #862

Merged
keito4 merged 1 commit into
mainfrom
chore/context-artifact-quality-gates
Jun 18, 2026
Merged

fix: keep context artifacts out of quality gates#862
keito4 merged 1 commit into
mainfrom
chore/context-artifact-quality-gates

Conversation

@keito4

@keito4 keito4 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • ignore shared .context artifacts in ESLint and persistent .context/worktrees in Jest
  • prevent AGENTS.md generation from listing untracked local directories
  • refresh audit reference integration expectation to use an existing docs reference

Checks

  • npm run format:check
  • npm run lint
  • npm test
  • npm run test:integration
  • npm run shellcheck
  • bash script/update-agents-md.sh --check
  • bash script/repo-maintenance.sh --mode check-only --skip cleanup
  • npm audit --audit-level=moderate

Summary by CodeRabbit

  • Configuration

    • Updated ESLint and Jest to ignore .context/worktrees/ directories, preventing interference with linting and test workflows.
  • Script Improvements

    • Enhanced directory filtering to skip untracked directories during automated documentation generation.
  • Tests

    • Added comprehensive test coverage validating context directory handling, script behavior, and configuration settings.

@claude

claude Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 0s —— View job


I'll analyze this and get back to you.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e25f66e6-7580-46b3-97f4-a4dda614fd8c

📥 Commits

Reviewing files that changed from the base of the PR and between 24b4423 and 98e4cf2.

📒 Files selected for processing (7)
  • eslint.config.mjs
  • jest.config.js
  • script/update-agents-md.sh
  • test/claude-workflow-contract.test.js
  • test/eslint-config.test.js
  • test/integration/audit_references.bats
  • test/jest-config.test.js

📝 Walkthrough

Walkthrough

ESLint's flat config gains .context/ in its top-level ignores. Jest's config adds testPathIgnorePatterns and modulePathIgnorePatterns for .context/worktrees/. update-agents-md.sh introduces a dir_has_tracked_files helper that gates directory emission in collect_dirs on the presence of git-tracked files. Tests are added or updated for all three changes.

Changes

.context/ tooling exclusions

Layer / File(s) Summary
ESLint and Jest .context/ ignore rules
eslint.config.mjs, jest.config.js
eslint.config.mjs adds .context/ to the top-level ignores array; jest.config.js adds testPathIgnorePatterns and modulePathIgnorePatterns for <rootDir>/.context/worktrees/.
update-agents-md.sh: dir_has_tracked_files guard
script/update-agents-md.sh
Adds dir_has_tracked_files helper (git-tracked check with find fallback) and applies it in collect_dirs to filter .claude subdirectories and registered directories that contain no tracked files.
Tests for all three changes
test/jest-config.test.js, test/eslint-config.test.js, test/claude-workflow-contract.test.js, test/integration/audit_references.bats
Asserts worktrees ignore patterns in Jest config; adds --no-ignore to runEslint and asserts .context/ in ESLint config text; adds temp-repo helper and contract test that docs/ is included while untracked next/ is excluded; updates expected TSV row in the bats integration test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • keito4/config#129: Introduces the flat ESLint config that this PR extends by adding .context/ to the ignores list.
  • keito4/config#615: Introduces script/update-agents-md.sh and its collect_dirs logic, which this PR refines with the dir_has_tracked_files guard.

Poem

🐇 Hippity-hop through the context tree,
Untracked directories? Not for me!
ESLint shall not lint what hides in .context/,
Jest won't wander where worktrees are present.
With git-tracked files the AGENTS.md grows,
And the rabbit hops on — where the clean repo flows! 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description provides a clear summary and detailed explanation of changes, but is missing required template sections like 'Why', 'What' (structured list), 'How to test', and the checklist. Fill in all required template sections: explain why this change is needed, provide a structured bulleted list of changes, describe testing steps, and complete the checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main objective: preventing context artifacts from interfering with quality gates through configuration changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/context-artifact-quality-gates

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

test/claude-workflow-contract.test.js

Oops! Something went wrong! :(

ESLint: 10.5.0

ReferenceError: describe is not defined
at Object. (/test/eslint-config.test.js:35:1)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26

test/eslint-config.test.js

Oops! Something went wrong! :(

ESLint: 10.5.0

ReferenceError: describe is not defined
at Object. (/test/eslint-config.test.js:35:1)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26

test/jest-config.test.js

Oops! Something went wrong! :(

ESLint: 10.5.0

ReferenceError: describe is not defined
at Object. (/test/eslint-config.test.js:35:1)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98e4cf2814

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread jest.config.js
module.exports = {
testEnvironment: 'node',
testMatch: ['**/test/**/*.test.js', '**/test/**/*.spec.js'],
testPathIgnorePatterns: ['<rootDir>/.context/worktrees/'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Ignore every .context artifact in Jest

Because this only excludes .context/worktrees, Jest's testMatch still discovers tests in other .context subdirectories. In this repo, agents are instructed to store intermediate artifacts under .context/, and I verified npx --no-install jest --config jest.config.js --runInBand --reporters=default --listTests lists .context/review-jest/test/leak.test.js; such artifacts can make npm test fail despite the quality-gate fix. Consider ignoring <rootDir>/.context/ rather than only worktrees.

Useful? React with 👍 / 👎.

@keito4 keito4 self-assigned this Jun 18, 2026
@keito4
keito4 merged commit 70fc2b6 into main Jun 18, 2026
21 checks passed
@keito4
keito4 deleted the chore/context-artifact-quality-gates branch June 18, 2026 10:16
@claude claude Bot mentioned this pull request Jun 19, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.119.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant