feat(record): support .agentnoteignore for AI ratio#63
Conversation
Agentnote-Session: 019da962-23cc-7aa0-bbe3-a10f60fddada
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request introduces a repository-root ChangesAI Ratio Exclusion Feature
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/core/record.ts`:
- Around line 1310-1330: The regex built in compileAgentnoteIgnorePattern can be
vulnerable to ReDoS for adversarial patterns; before constructing new RegExp in
compileAgentnoteIgnorePattern, add a lightweight complexity guard: reject
patterns that exceed a safe length (e.g. >200 chars) or contain an excessive
count of wildcard tokens (e.g. more than 10 occurrences of '*' or '**') or
repeated overlapping wildcards (e.g. sequences like '*.*' or multiple
consecutive '**'), returning null if the pattern is too complex; keep the rest
of the logic (negated, directoryOnly, anchored, prefix/suffix and the regex
creation) unchanged so trusted small repo patterns still compile but
pathological patterns are refused.
In `@README.md`:
- Around line 106-107: Update the README.md wording to explicitly state that the
.agentnoteignore file must be placed at the repository root (not any
subdirectory) so the feature can read it correctly; locate the sentence that
currently reads "If committed bundles or generated outputs should stay visible
but not affect AI Ratio, add them to `.agentnoteignore`:" and change it to
clarify placement, e.g. "add a `.agentnoteignore` file at the repository root
(top-level directory):", ensuring the README now clearly instructs users to
create the file in the repo root.
In `@README.ru.md`:
- Around line 106-113: The README text about `.agentnoteignore` is ambiguous
about its location; update the Russian README snippet describing
`.agentnoteignore` to state explicitly that the file must be at the repository
root. Edit the paragraph that currently starts "Если закоммиченные bundles..."
and the surrounding example to mention "файл .agentnoteignore в корне
репозитория" (referencing the symbol `.agentnoteignore`) so readers know to
create the root-level file rather than placing it in subdirectories.
In `@website/src/content/docs/how-it-works.mdx`:
- Line 156: Clarify that .agentnoteignore must live at the repository root (not
nested) by updating the sentence in how-it-works.mdx to state "place a single
.agentnoteignore at the repository root" and explicitly disallow nested files;
apply the same wording to all localized how-it-works pages edited in this PR so
the phrasing is identical across locales and keeps user-facing guidance
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d3593419-e79f-4a33-9c58-6babfbbd13ed
⛔ Files ignored due to path filters (2)
packages/cli/dist/cli.jsis excluded by!**/dist/**,!**/dist/**packages/pr-report/dist/index.jsis excluded by!**/dist/**,!**/dist/**
📒 Files selected for processing (55)
.agentnoteignoreREADME.de.mdREADME.es.mdREADME.fr.mdREADME.id.mdREADME.it.mdREADME.ja.mdREADME.ko.mdREADME.mdREADME.pt-br.mdREADME.ru.mdREADME.zh-cn.mdREADME.zh-tw.mddocs/architecture.mdpackages/cli/src/core/constants.tspackages/cli/src/core/entry.test.tspackages/cli/src/core/entry.tspackages/cli/src/core/record.test.tspackages/cli/src/core/record.tswebsite/src/content/docs/agent-support.mdxwebsite/src/content/docs/data-and-privacy.mdxwebsite/src/content/docs/de/agent-support.mdxwebsite/src/content/docs/de/data-and-privacy.mdxwebsite/src/content/docs/de/how-it-works.mdxwebsite/src/content/docs/es/agent-support.mdxwebsite/src/content/docs/es/data-and-privacy.mdxwebsite/src/content/docs/es/how-it-works.mdxwebsite/src/content/docs/fr/agent-support.mdxwebsite/src/content/docs/fr/data-and-privacy.mdxwebsite/src/content/docs/fr/how-it-works.mdxwebsite/src/content/docs/how-it-works.mdxwebsite/src/content/docs/id/agent-support.mdxwebsite/src/content/docs/id/data-and-privacy.mdxwebsite/src/content/docs/id/how-it-works.mdxwebsite/src/content/docs/it/agent-support.mdxwebsite/src/content/docs/it/data-and-privacy.mdxwebsite/src/content/docs/it/how-it-works.mdxwebsite/src/content/docs/ja/agent-support.mdxwebsite/src/content/docs/ja/data-and-privacy.mdxwebsite/src/content/docs/ja/how-it-works.mdxwebsite/src/content/docs/ko/agent-support.mdxwebsite/src/content/docs/ko/data-and-privacy.mdxwebsite/src/content/docs/ko/how-it-works.mdxwebsite/src/content/docs/pt-br/agent-support.mdxwebsite/src/content/docs/pt-br/data-and-privacy.mdxwebsite/src/content/docs/pt-br/how-it-works.mdxwebsite/src/content/docs/ru/agent-support.mdxwebsite/src/content/docs/ru/data-and-privacy.mdxwebsite/src/content/docs/ru/how-it-works.mdxwebsite/src/content/docs/zh-cn/agent-support.mdxwebsite/src/content/docs/zh-cn/data-and-privacy.mdxwebsite/src/content/docs/zh-cn/how-it-works.mdxwebsite/src/content/docs/zh-tw/agent-support.mdxwebsite/src/content/docs/zh-tw/data-and-privacy.mdxwebsite/src/content/docs/zh-tw/how-it-works.mdx
Agentnote-Session: 019da962-23cc-7aa0-bbe3-a10f60fddada
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/core/record.test.ts`:
- Around line 2313-2315: The PRE_BLOBS_FILE test fixture contains an event entry
with event: "pre_blob" which is inconsistent with the other pre-blob fixtures
and weakens the assertion; update that entry to use the canonical event value
"pre_edit" (modify the string in the PRE_BLOBS_FILE fixture where the JSON
contains "event":"pre_blob") so the fixture matches the surrounding pre-blob
events used by the tests.
In `@README.ko.md`:
- Line 104: Change the section title text "Generated Bundle" to the plural form
"Generated Bundles" (or the appropriate Korean plural/localized phrasing) so the
heading matches the content describing multiple outputs; update the heading
string in the README.ko.md where the title appears to ensure consistency.
In `@README.md`:
- Line 113: Update the README sentence that currently reads "Those files still
appear in PR Report and Dashboard. They are only removed from the AI Ratio
denominator." to explicitly include "Notes" as part of the visibility list so it
reads something like "Those files still appear in PR Report, Dashboard, and
Notes. They are only removed from the AI Ratio denominator." Locate and edit the
line containing that exact phrase in README.md and replace it with the clarified
wording to reflect Notes visibility.
In `@README.zh-cn.md`:
- Around line 106-113: The README.zh-cn.md section containing the
`.agentnoteignore` example and explanation is written in Chinese and must be
converted to English to comply with the repo's English-only policy; replace the
Chinese paragraph and the two-line gitignore example description with an English
version that explains: if submitted bundles or generated outputs should remain
visible but be excluded from AI Ratio, add entries like `packages/cli/dist/**`
and `packages/pr-report/dist/**` to `.agentnoteignore` in the repository root,
and clarify that these files will still appear in PR Report and Dashboard but
will be excluded from the AI Ratio denominator.
In `@README.zh-tw.md`:
- Around line 104-114: The new non-English section titled "將生成的 Bundle 排除在 AI
Ratio 之外" (and its body describing writing patterns to `.agentnoteignore` with
the example gitignore lines `packages/cli/dist/**` and
`packages/pr-report/dist/**`) violates the repo English-only docs policy;
rewrite the entire section and its heading in clear English (e.g., "Exclude
generated bundles from AI Ratio") preserving the same instructions and
`.agentnoteignore` examples, and ensure all inline text, code block comments,
and descriptions in that section are in English so it complies with the
source-language rule.
In `@website/src/content/docs/id/agent-support.mdx`:
- Line 75: Ubah kalimat yang dimulai dengan "Generated artifacts dan path yang
tercantum di `.agentnoteignore`..." agar tegas menyatakan bahwa pengecualian
hanya berlaku untuk perhitungan denominator AI ratio dan bukan untuk menghapus
atau menyembunyikan file dari tampilan; misalnya ubah menjadi satu kalimat
eksplisit yang menyebutkan "file tetap terlihat di repository/tampilan, hanya
dikecualikan dari perhitungan AI ratio (denominator)". Pastikan frasa
`.agentnoteignore` tetap disebut untuk konteks dan jangan ubah bagian lain dalam
paragraf.
In `@website/src/content/docs/it/how-it-works.mdx`:
- Line 156: Uniforma la frase al solo italiano sostituendo i termini inglesi
misti: rimpiazza "generated artifact" con "artefatti generati", "best effort"
con "per quanto possibile" e "generated output" con "output generato"; mantieni
i nomi di directory e i riferimenti tecnici in codice (es. `build/`, `dist/`,
`.agentnoteignore`, `AI ratio`) e riformula la frase in modo naturale (es. "Gli
artefatti generati vengono esclusi dal denominatore di `AI ratio` per quanto
possibile usando segnali specifici...") così da ottenere una versione coerente
in italiano senza cambiare i riferimenti tecnici.
In `@website/src/content/docs/pt-br/agent-support.mdx`:
- Line 75: Replace the mixed-language bullet text "Generated artifacts e paths
listados na `.agentnoteignore` na raiz do repository podem ser excluídos do
denominador do AI ratio." with fully Portuguese wording; specifically change the
fragment to something like "Artefatos gerados e caminhos listados em
`.agentnoteignore` na raiz do repositório podem ser excluídos do denominador da
razão de IA." and update any nearby occurrences of "repository", "paths", or "AI
ratio" to their PT-BR equivalents to keep locale parity.
In `@website/src/content/docs/ru/agent-support.mdx`:
- Line 75: Измените фразу "Generated artifacts и пути из `.agentnoteignore` в
корне репозитория можно исключить из AI ratio denominator" так, чтобы явно
указывать, что исключение применяется только к расчёту AI ratio (AI ratio
denominator) и не влияет на отображение или видимость файлов в отчётах;
отредактируйте строку с текстом "Generated artifacts и пути из
`.agentnoteignore`..." добавив уточнение типа "это исключение влияет только на
расчёт AI ratio и не удаляет файлы из отчетов — они остаются видимыми", чтобы
читатели не поняли, что файлы полностью исключаются.
In `@website/src/content/docs/zh-cn/how-it-works.mdx`:
- Around line 156-157: Replace remaining English technical terms in the
paragraph to improve zh-CN localization: change "signal" → "信号", "repository
root" → "仓库根目录", "framework/cache path" → "框架/缓存路径", "generated filename/suffix"
→ "生成的文件名/后缀", and "committed file header" → "已提交的文件头"; also rephrase the
sentence "把路径写入 repository root 的 `.agentnoteignore`" to the more natural
Chinese "将路径添加到仓库根目录的 `.agentnoteignore` 文件中" while keeping the original meaning
about excluding generated artifacts from the AI ratio.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 7579f02f-55d0-4644-acd4-6e2c6794ddcf
⛔ Files ignored due to path filters (1)
packages/cli/dist/cli.jsis excluded by!**/dist/**,!**/dist/**
📒 Files selected for processing (50)
README.de.mdREADME.es.mdREADME.fr.mdREADME.id.mdREADME.it.mdREADME.ja.mdREADME.ko.mdREADME.mdREADME.pt-br.mdREADME.ru.mdREADME.zh-cn.mdREADME.zh-tw.mdpackages/cli/src/core/record.test.tspackages/cli/src/core/record.tswebsite/src/content/docs/agent-support.mdxwebsite/src/content/docs/data-and-privacy.mdxwebsite/src/content/docs/de/agent-support.mdxwebsite/src/content/docs/de/data-and-privacy.mdxwebsite/src/content/docs/de/how-it-works.mdxwebsite/src/content/docs/es/agent-support.mdxwebsite/src/content/docs/es/data-and-privacy.mdxwebsite/src/content/docs/es/how-it-works.mdxwebsite/src/content/docs/fr/agent-support.mdxwebsite/src/content/docs/fr/data-and-privacy.mdxwebsite/src/content/docs/fr/how-it-works.mdxwebsite/src/content/docs/how-it-works.mdxwebsite/src/content/docs/id/agent-support.mdxwebsite/src/content/docs/id/data-and-privacy.mdxwebsite/src/content/docs/id/how-it-works.mdxwebsite/src/content/docs/it/agent-support.mdxwebsite/src/content/docs/it/data-and-privacy.mdxwebsite/src/content/docs/it/how-it-works.mdxwebsite/src/content/docs/ja/agent-support.mdxwebsite/src/content/docs/ja/data-and-privacy.mdxwebsite/src/content/docs/ja/how-it-works.mdxwebsite/src/content/docs/ko/agent-support.mdxwebsite/src/content/docs/ko/data-and-privacy.mdxwebsite/src/content/docs/ko/how-it-works.mdxwebsite/src/content/docs/pt-br/agent-support.mdxwebsite/src/content/docs/pt-br/data-and-privacy.mdxwebsite/src/content/docs/pt-br/how-it-works.mdxwebsite/src/content/docs/ru/agent-support.mdxwebsite/src/content/docs/ru/data-and-privacy.mdxwebsite/src/content/docs/ru/how-it-works.mdxwebsite/src/content/docs/zh-cn/agent-support.mdxwebsite/src/content/docs/zh-cn/data-and-privacy.mdxwebsite/src/content/docs/zh-cn/how-it-works.mdxwebsite/src/content/docs/zh-tw/agent-support.mdxwebsite/src/content/docs/zh-tw/data-and-privacy.mdxwebsite/src/content/docs/zh-tw/how-it-works.mdx
Agentnote-Session: 019da962-23cc-7aa0-bbe3-a10f60fddada
Summary
Verification
🧑💬🤖 Agent Note
Total AI Ratio: ████████ 100%
Model:
gpt-5.4985ebc0feat(record): support agentnoteignore for ai ratio0b881ecfix(record): harden agentnoteignore patterns6708dbadocs: clarify agentnoteignore visibility💬 Prompts & Responses (5 shown / 8 total)
985ebc0feat(record): support agentnoteignore for ai ratio6708dbadocs: clarify agentnoteignore visibilitySummary by CodeRabbit
New Features
Documentation
Tests