Skip to content

Enhance performance and improve rules#358

Merged
mickgmdb merged 2 commits intomainfrom
development
Apr 25, 2026
Merged

Enhance performance and improve rules#358
mickgmdb merged 2 commits intomainfrom
development

Conversation

@mickgmdb
Copy link
Copy Markdown
Collaborator

This pull request updates documentation and test logic to reflect the increased number of detection rules, improves documentation accuracy and workflows, and strengthens the integration test for external project builds. The most important changes are grouped below.

Documentation and Rule Count Updates:

  • Updated all references to the number of detection rules from 934/938 to 942, and provided a more detailed breakdown (820 standalone detectors, 122 dependent rules, 484 with live validation as of 2026-04-24) in AGENTS.md, docs-site/mkdocs.yml, and docs-site/overrides/home.html to ensure consistency across user-facing documentation. [1] [2] [3] [4]
  • Added a reminder in AGENTS.md to update rule counts in documentation using a specific script and to sync totals in docs-site/overrides/ and docs-site/mkdocs.yml before rebuilding the docs site.
  • Added new documentation structure notes for docs/viewer/ and docs-site/ directories in AGENTS.md.
  • Added workflow guidance to rebuild the docs site after changes to docs-site/ sources.
  • Added a note to CLAUDE.md to read and follow AGENTS.md before starting any task.

Test Improvements:

  • In the integration test library_crates_external_project.rs, now copies Cargo.lock from the main repo and explicitly generates the lockfile offline before running the test build, then runs cargo run --frozen to ensure reproducible builds and better test isolation. [1] [2]

Copilot AI review requested due to automatic review settings April 24, 2026 19:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates repository guidance/docs to reflect the current detection rule totals and strengthens an integration test that builds Kingfisher crates from a temporary “external” Cargo project.

Changes:

  • Updated user-facing rule count references to 942 across docs-site templates and configuration.
  • Expanded agent documentation (AGENTS.md) with rule-count breakdown, docs-site structure notes, and rebuild guidance; added CLAUDE.md pointer to AGENTS.md.
  • Hardened library_crates_external_project integration test by copying Cargo.lock, generating a lockfile offline, and running cargo run --frozen for reproducibility.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/library_crates_external_project.rs Improves external-project build determinism via lockfile handling and --frozen execution.
docs-site/overrides/main.html Updates JSON-LD description to reflect the new rule count.
docs-site/overrides/home.html Updates homepage stat for detection rules.
docs-site/mkdocs.yml Updates site description to reflect the new rule count.
CLAUDE.md Adds instruction to follow AGENTS.md before starting work.
AGENTS.md Updates rule count/breakdown and adds docs-site workflow guidance and structure notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread AGENTS.md
- Add a detection rule: follow the workflow below and validate with relevant tests.
- Add a CLI command: implement under `src/cli/commands/` and register in the CLI command wiring.
- Add a validator (rare exception path): implement it in `crates/kingfisher-scanner/src/validation/`, prefer `raw.rs` for one-off provider flows, and wire the narrowest feature/dependencies in `crates/kingfisher-scanner/Cargo.toml` only when YAML validation cannot express the required logic.
- Update docs-site rule counts: use `uv run '/Users/mickg/src/kingfisher/data/default/rule_cleanup/count_rules.py'` and update `docs-site/overrides/` plus `docs-site/mkdocs.yml` to match the reported totals before rebuilding the docs site.
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

This instruction hard-codes a developer-specific absolute path (/Users/mickg/...), which will be wrong for everyone else and in CI. Use a repo-relative path (e.g., data/default/rule_cleanup/count_rules.py) and let the script’s own DEFAULT_RULES_DIR handle locating rules, or document running it from repo root.

Suggested change
- Update docs-site rule counts: use `uv run '/Users/mickg/src/kingfisher/data/default/rule_cleanup/count_rules.py'` and update `docs-site/overrides/` plus `docs-site/mkdocs.yml` to match the reported totals before rebuilding the docs site.
- Update docs-site rule counts: use `uv run data/default/rule_cleanup/count_rules.py` and update `docs-site/overrides/` plus `docs-site/mkdocs.yml` to match the reported totals before rebuilding the docs site.

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
- If validation commands cannot be run, report exactly what was skipped and why.
- Prefer `kingfisher scan --format toon` when invoking Kingfisher from an LLM or agent workflow; keep `pretty` for interactive human CLI use unless the task explicitly calls for a different format.
- After markdown/doc changes, verify local documentation links when practical.
- After `docs-site/` source changes, rebuild with `docs-site/.venv/bin/mkdocs build -f docs-site/mkdocs.yml` when practical so checked-in generated output stays in sync.
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The rebuild command references docs-site/.venv/bin/mkdocs, but docs-site/.venv isn’t present in the repo and the docs workflow builds with cd docs-site && mkdocs build --strict (see .github/workflows/docs.yml:44). Recommend documenting the same command (or uv run mkdocs ...) to avoid a non-existent/host-specific venv path.

Suggested change
- After `docs-site/` source changes, rebuild with `docs-site/.venv/bin/mkdocs build -f docs-site/mkdocs.yml` when practical so checked-in generated output stays in sync.
- After `docs-site/` source changes, rebuild with `cd docs-site && mkdocs build --strict` when practical so checked-in generated output stays in sync.

Copilot uses AI. Check for mistakes.
@mickgmdb mickgmdb merged commit 9ddec4a into main Apr 25, 2026
12 checks passed
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.

2 participants