docs: pre-format Markdown code blocks for Ruff 0.16 (prep for #288) - #296
Conversation
Ruff 0.16 formats fenced Python blocks in Markdown by default, and the ruff-pre-commit v0.16.8 hook adds markdown to its file types. #288 moves the toolchain to Ruff 0.16.8; landing these formatting-only changes first keeps #288 under the 50-file reviewable-size policy. - `ruff format` (0.16.8) applied to 37 Markdown files. Only fenced code blocks change; the prose is untouched. - Rename `docs/ACTION ITEMS.MD` -> `docs/ACTION ITEMS.md` and update its entry in tools/l9_meta_injector.py. identify tags `.MD` as markdown, but Ruff infers the language case-sensitively and parses the file as Python, so the v0.16.8 hook fails on it. Neutral under the current toolchain (Ruff 0.15.12 does not format Markdown): `ruff check` and `ruff format --check` pass on both 0.15.12 and 0.16.8. Content is byte-identical to the corresponding files on the #288 head (7b3be91), so merging main into #288 afterwards is conflict-free. Refs: audit finding F-288-001 (contract work unit R1) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuFGxFjdiHKkGEvxDvADD1
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
📋 Best Practices for Large Changes
✅ This PR passes the blocking limit but is larger than recommended. |
L9 Audit Harness Report
Step Results
Architecture Audit Findings
See Spec Coverage
See Next StepsAll checks passed. Safe to merge. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The PR introduces documentation rendering issues (a stray ====== line and a broken/invalid Python example snippet indentation) that should be fixed before merge.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
This PR prepares the repository’s Markdown (and embedded code examples) for Ruff 0.16’s default Markdown formatting, to keep the upcoming Ruff toolchain bump (#288) smaller and reviewable.
Changes:
- Reformat fenced code blocks and surrounding whitespace across docs/ and agent documentation to match Ruff 0.16’s Markdown formatting.
- Normalize the
docs/ACTION ITEMS.mdfilename casing (and update the meta injector registry accordingly). - Minor punctuation/whitespace adjustments in code examples (commas, spacing, line breaks) driven by formatter behavior.
| File | Description |
|---|---|
| CLAUDE.md | Reformat fenced Python examples for Ruff 0.16 Markdown formatting. |
| GUARDRAILS.md | Reformat fenced code block spacing for Ruff 0.16. |
| TESTING.md | Reformat fenced test examples for Ruff 0.16. |
| agents/cursor/README.md | Remove/adjust blank lines in code blocks per Ruff formatting. |
| agents/cursor/docs/CURSOR-L9-INTEGRATION.md | Reformat code examples/comments for Ruff 0.16. |
| agents/cursor/docs/PRODUCTION-SPEED-PACK.md | Reformat code snippets and spacing for Ruff 0.16. |
| agents/cursor/perplexity_research_results/01-15-2026 - memory-substrate-stages/PHASE-0-TODO-STAGE-4-BELIEF-REVISION.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/perplexity_research_results/01-15-2026 - memory-substrate-stages/stage4_belief_revision_system.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/perplexity_research_results/01-15-2026 - memory-substrate-stages/stage6_multi_agent_consensus.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/perplexity_research_results/01-16-2026 - predictive-memory-warming/perplexity-deep-research-output.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/perplexity_research_results/01-16-2026 - predictive-memory-warming/stage5_predictive_memory_warming.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/perplexity_research_results/01-20-2026-langgraph-checkpoint-postgres/langgraph-checkpoint-postgres-best-practices.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/prompts/gmp_examples/GMP-Action-Add-Learning-API-Routes.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/prompts/gmp_examples/GMP-Action-Create-Learning-Tests.md | Reformat code blocks per Ruff 0.16. |
| agents/cursor/prompts/gmp_examples/GMP-Action-Wire-Learning-Engine.md | Reformat code blocks per Ruff 0.16. |
| docs/ACTION ITEMS.md | Rename file casing + apply Ruff-compatible Markdown/code formatting. |
| docs/GRAPH-architecture.md | Reformat code examples per Ruff 0.16. |
| docs/INFERENCE_ENGINE_KG_ROADMAP.md | Reformat code examples per Ruff 0.16. |
| docs/L9_Contract_Enforcement_System.md | Reformat embedded Python example for Ruff 0.16. |
| docs/TROUBLESHOOTING.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/DEPENDENCY_INJECTION.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/ERROR_HANDLING.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/FIELD_NAMES.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/HANDLER_PAYLOADS.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/KGE_EMBEDDINGS.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/MEMORY_SUBSTRATE_ACCESS.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/NODE_REGISTRATION.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/OBSERVABILITY.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/PACKET_ENVELOPE_FIELDS.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/PII_HANDLING.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/PYDANTIC_YAML_MAPPING.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/RETURN_VALUES.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/SCORING_WEIGHT_CEILING.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/SHARED_MODELS.md | Reformat code examples per Ruff 0.16. |
| docs/contracts/TEST_PATTERNS.md | Reformat code examples per Ruff 0.16. |
| reports/hoprag_ceg_enhancement_program.md | Reformat embedded code snippet per Ruff 0.16. |
| tests/README.md | Reformat embedded test examples per Ruff 0.16. |
| tools/l9_meta_injector.py | Update FileMeta registry entry to match renamed docs filename casing. |
| tools/research/cognitive-engine-revenue-patterns.md | Reformat embedded code examples per Ruff 0.16. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…elds The "Standard Optional Fields" snippet was an indented continuation of `class PacketEnvelope`. Ruff 0.16 Markdown formatting dedented it into top-level assignments, which misstates the contract. Repeat the class header so the block is valid Python and stays stable under ruff format. Reported by Copilot review on #296. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuFGxFjdiHKkGEvxDvADD1
…elds The "Standard Optional Fields" snippet was an indented continuation of `class PacketEnvelope`. Ruff 0.16 Markdown formatting dedented it into top-level assignments, which misstates the contract. Repeat the class header so the block is valid Python and stays stable under ruff format. Reported by Copilot review on #296. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuFGxFjdiHKkGEvxDvADD1
|
* chore(deps)(deps): bump the dev-tools group with 2 updates Bumps the dev-tools group with 2 updates: [ruff](https://github.com/astral-sh/ruff) and [mypy](https://github.com/python/mypy). Updates `ruff` from 0.15.12 to 0.16.8 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](astral-sh/ruff@0.15.12...0.16.8) Updates `mypy` from 1.14.0 to 2.3.1 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.14.0...v2.3.1) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.16.8 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dev-tools - dependency-name: mypy dependency-version: 2.3.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dev-tools ... Signed-off-by: dependabot[bot] <support@github.com> * fix(deps): converge Ruff 0.16.8 / Mypy 2.3.1 across all toolchain consumers Closes audit finding F-288-001 (contract work unit R1). The Dependabot bump moved Ruff to 0.16.8 only in pyproject/poetry.lock, so CI (which installs from requirements-ci.txt, the declared SSOT) still ran Ruff 0.15.12 and pre-commit still pinned ruff-pre-commit v0.15.5 and mirrors-mypy v1.14.0. - requirements-ci.txt, requirements-dev.txt: ruff 0.15.12 -> 0.16.8 - .pre-commit-config.yaml: ruff-pre-commit v0.15.5 -> v0.16.8, mirrors-mypy v1.14.0 -> v2.3.1 No rules, ignores, or excludes changed. Remediation-Cycle: #288/cycle-1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuFGxFjdiHKkGEvxDvADD1 * fix(lint): resolve findings newly exposed by Ruff 0.16.8 Scope extension to R1 approved by the operator: fix the findings Ruff 0.16.8 surfaces (0.15.12 was clean) rather than suppressing them. No rule ignores, per-file ignores, or excludes were added. PLR0917 (too-many-positional-arguments, 18 sites): parameters that call sites already pass by keyword become keyword-only (`*`). Call sites that passed more than five positionals were converted to keywords: - tools/contract_scanner.py `_rule`: `remediation` is keyword-only (28 rules) - tests/test_algorithmic_upgrades.py `_make_fp`: `entropy`, `concentration` - tools/auditors/log_safety.py `_emit_finding`: all keyword-only Public engine APIs touched (AuditLogger.log_*, measure_health_impact, track_conversion_event, MultiHopTraverser) keep every required parameter positional; only optional defaults became keyword-only, and every in-repo caller already passes them by keyword. ISC004 (3 sites): parenthesize the implicit string concatenations in engine/intake/impact_reporter.py format_impact_summary. Markdown: Ruff 0.16 formats fenced Python blocks in .md by default, and the ruff-pre-commit v0.16.8 hook now includes markdown files. Applied `ruff format` to 37 docs (code-fence changes only). Renamed `docs/ACTION ITEMS.MD` -> `.md` (reference updated in tools/l9_meta_injector.py): identify tags `.MD` as markdown but Ruff infers language case-sensitively and parsed it as Python. Validation: ruff check / ruff format --check clean; mypy engine/ clean (2.3.1); pre-commit run --all-files all hooks pass; contract scanner clean; pytest (non-integration) 2134 passed. The 4 tests/performance errors need a Docker socket and fail the same way on the unmodified tree. Remediation-Cycle: #288/cycle-1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuFGxFjdiHKkGEvxDvADD1 * docs(contracts): restore class context for PacketEnvelope optional fields The "Standard Optional Fields" snippet was an indented continuation of `class PacketEnvelope`. Ruff 0.16 Markdown formatting dedented it into top-level assignments, which misstates the contract. Repeat the class header so the block is valid Python and stays stable under ruff format. Reported by Copilot review on #296. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JuFGxFjdiHKkGEvxDvADD1 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>




Problem
docs: pre-format Markdown code blocks for Ruff 0.16 (prep for #288)
Ruff 0.16 formats fenced Python blocks in Markdown by default, and the ruff-pre-commit v0.16.8 hook adds markdown to its file types. #288 moves the toolchain to Ruff 0.16.8; landing these formatting-only changes first keeps #288 under the 50-file reviewable-size policy.
Closes #
Fix
docs: pre-format Markdown code blocks for Ruff 0.16 (prep for #288)
Risk
Blast radius: measured paths in Changes by intent
Rollback: revert this PR
Evidence
Gates
semgrepclean, or findings triaged below — n/a — not this changeReviewer focus
See Changes by intent and Protected-root (if any additive_only path).
Changes by intent
Added
Modified
CLAUDE.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)GUARDRAILS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)TESTING.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/README.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/docs/CURSOR-L9-INTEGRATION.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/docs/PRODUCTION-SPEED-PACK.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/perplexity_research_results/01-15-2026 - memory-substrate-stages/PHASE-0-TODO-STAGE-4-BELIEF-REVISION.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/perplexity_research_results/01-15-2026 - memory-substrate-stages/stage4_belief_revision_system.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/perplexity_research_results/01-15-2026 - memory-substrate-stages/stage6_multi_agent_consensus.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/perplexity_research_results/01-16-2026 - predictive-memory-warming/perplexity-deep-research-output.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/perplexity_research_results/01-16-2026 - predictive-memory-warming/stage5_predictive_memory_warming.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/perplexity_research_results/01-20-2026-langgraph-checkpoint-postgres/langgraph-checkpoint-postgres-best-practices.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/prompts/gmp_examples/GMP-Action-Add-Learning-API-Routes.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/prompts/gmp_examples/GMP-Action-Create-Learning-Tests.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)agents/cursor/prompts/gmp_examples/GMP-Action-Wire-Learning-Engine.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/ACTION ITEMS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/GRAPH-architecture.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/INFERENCE_ENGINE_KG_ROADMAP.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/L9_Contract_Enforcement_System.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/TROUBLESHOOTING.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/DEPENDENCY_INJECTION.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/ERROR_HANDLING.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/FIELD_NAMES.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/HANDLER_PAYLOADS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/KGE_EMBEDDINGS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/MEMORY_SUBSTRATE_ACCESS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/NODE_REGISTRATION.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/OBSERVABILITY.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/PACKET_ENVELOPE_FIELDS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/PII_HANDLING.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/PYDANTIC_YAML_MAPPING.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/RETURN_VALUES.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/SCORING_WEIGHT_CEILING.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/SHARED_MODELS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)docs/contracts/TEST_PATTERNS.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)reports/hoprag_ceg_enhancement_program.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)tests/README.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)tools/l9_meta_injector.py— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)tools/research/cognitive-engine-revenue-patterns.md— docs: pre-format Markdown code blocks for Ruff 0.16 (prep for chore(deps)(deps): bump the dev-tools group with 2 updates #288)Deleted
Files touched
Commits
Test plan
make prlocal gate receipt presentrelease_authorized)Changed files
Generated by Claude Code