Skip to content

feat: manifesto-driven pass/fail rule engine#138

Merged
carlos-alm merged 3 commits intomainfrom
feat/manifesto-rules
Feb 27, 2026
Merged

feat: manifesto-driven pass/fail rule engine#138
carlos-alm merged 3 commits intomainfrom
feat/manifesto-rules

Conversation

@carlos-alm
Copy link
Contributor

Summary

  • Adds a generic rule engine (src/manifesto.js) that evaluates function-level, file-level, and graph-level rules against the DB and returns pass/fail verdicts
  • 9 rules: cognitive, cyclomatic, maxNesting (function), importCount, exportCount, lineCount, fanIn, fanOut (file), noCycles (graph)
  • Exits with code 1 on any fail-level breach (CI gate)
  • Exposed via CLI (codegraph manifesto), programmatic API (manifestoData/manifesto/RULE_DEFS), and MCP tool

Test plan

  • 13 integration tests covering default thresholds, warn/fail detection, filters (noTests, file, kind), summary accuracy, empty DB, and noCycles rule
  • Lint passes cleanly
  • codegraph manifesto -T verified against codegraph's own DB
  • JSON output (-j) and file-scoped (-f) modes verified

Generic rule engine that evaluates function-level, file-level, and
graph-level rules against the DB and returns pass/fail verdicts.

- 9 rules: cognitive, cyclomatic, maxNesting (function), importCount,
  exportCount, lineCount, fanIn, fanOut (file), noCycles (graph)
- Exits with code 1 on any fail-level breach (CI gate)
- Exposed via CLI (codegraph manifesto), programmatic API, and MCP tool

Impact: 9 functions changed, 7 affected
@claude
Copy link

claude bot commented Feb 27, 2026

Claude finished @carlos-alm's task —— View job


PR Review: Manifesto-Driven Rule Engine

I'm conducting a comprehensive review of this PR. Here's my progress:

Review Checklist:

  • Root cause analysis - understand the problem being solved
  • Configuration change detection - check for rule relaxations
  • Test integrity assessment - verify test quality
  • Code quality review - analyze implementation
  • Security and performance review
  • Final rating and recommendation

Phase 1: Root Cause Analysis ✅

Problem Being Solved: This PR introduces a rule engine to provide automated code quality gates for CI/CD pipelines. It addresses the need for configurable, automated checks of code complexity metrics, file metrics, and architectural constraints (like circular dependencies) with pass/fail thresholds.

Why This Approach: The approach is well-justified - building on top of the existing complexity metrics and cycle detection features to create a unified rule evaluation system. The design follows good patterns:

  • Uses existing SQLite schema and queries
  • Leverages established complexity metrics (cognitive, cyclomatic, max nesting)
  • Integrates with existing configuration system
  • Provides CLI, programmatic API, and MCP tool interfaces

Phase 2: Configuration Change Detection ✅

No HIGH-RISK changes detected:

  • No linting rules disabled or relaxed
  • No test timeouts increased or coverage thresholds lowered
  • No build configuration changes
  • The only configuration addition is new manifesto rules in config.js:27-39 with sensible defaults (warn thresholds set, fail thresholds disabled by default)

Phase 3: Test Integrity Assessment ✅

Test quality is EXCELLENT:

  • 13 comprehensive integration tests in tests/integration/manifesto.test.js
  • Tests cover all major scenarios: default thresholds, warn/fail detection, filters, edge cases
  • Proper fixture data setup with varying complexity levels
  • Tests verify both positive and negative cases
  • Clean test isolation with temp directories
  • Tests verify configuration loading and rule resolution

No red flags detected - no weakened assertions, no removed validations.

Phase 4: Code Quality Review ✅

Implementation Quality - VERY GOOD:

Proper SQL Parameter Binding: All queries use proper parameterized statements with ...params - no SQL injection risks (lines 143-150, 219-227)

Error Handling: Appropriate try-catch blocks around database operations with graceful fallbacks to empty arrays

Code Organization: Clean separation of concerns with dedicated evaluator functions for each rule level

Configuration Merging: Proper deep-merge logic for rule configuration (lines 64-74)

CLI Integration: Well-integrated CLI command with proper option validation (lines 746-766 in cli.js)

API Design: Clean public API with both data (manifestoData) and formatting (manifesto) functions

Minor Code Quality Notes:

  • Extensive use of console.log for CLI output is appropriate for this context
  • process.exit(1) usage is correct for CLI failure scenarios
  • Template string usage is safe - no user-controlled interpolation

Phase 5: Security and Performance Review ✅

Security - EXCELLENT:

  • No command injection risks (no execFileSync or shell commands)
  • No SQL injection (proper parameterized queries)
  • No user input sanitization issues
  • Configuration loading uses existing secure patterns from config.js

Performance - GOOD:

  • Efficient single-pass query design for function and file rules
  • Proper use of database indices (queries use existing nodes and metric tables)
  • Early exit for disabled rules reduces unnecessary computation
  • Results limited to 20 violations per rule level for output performance

Integration Quality - EXCELLENT:

  • Properly integrated into all three API surfaces (CLI, programmatic, MCP)
  • Uses existing isTestFile filtering logic consistently
  • Leverages existing findCycles function rather than reimplementing
  • Export added to index.js following established patterns

Minor Suggestions (Non-blocking)

  1. Line 156: Double test file filtering - both SQL NO_TEST_SQL and isTestFile() filter are applied. Consider documenting this defensive approach or consolidating.

  2. Configuration validation: Consider adding validation for rule threshold types (ensure numeric values) in resolveRules.

Root Cause Analysis

Problem Being Solved: Adding automated code quality gates with configurable pass/fail thresholds for CI/CD integration.
Why This Approach: Builds naturally on existing complexity metrics and dependency analysis features.
Risk Assessment: Low risk - no security concerns, no breaking changes, comprehensive test coverage.

Critical Concerns

None. This is a well-implemented feature with excellent test coverage and no security or architectural concerns.

Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: High-quality implementation with excellent test coverage, proper security practices, clean API design, and addresses a real need for CI/CD quality gates. The code follows established patterns and integrates well with the existing codebase. Only minor improvement opportunities exist, none blocking.

Strengths: Comprehensive testing, proper SQL practices, clean architecture, good error handling, appropriate defaults.

This PR adds significant value to the codebase and is ready for merge.


@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 27, 2026

Greptile Summary

This PR introduces a comprehensive manifesto-driven rule engine for code health checks, enabling CI/CD gates based on complexity metrics. The implementation includes native Rust complexity computation for JavaScript/TypeScript with WASM fallback, 9 configurable rules spanning function (cognitive/cyclomatic/nesting), file (imports/exports/lines/fan-in/fan-out), and graph levels (cycle detection), plus significant performance optimizations.

Key additions:

  • src/manifesto.js: Rule evaluation engine with pass/warn/fail verdicts, CLI and JSON output, proper error handling with debug logging
  • crates/codegraph-core/src/complexity.rs: Faithful port of JS complexity computation with comprehensive unit tests (11 test cases)
  • Performance optimizations: eliminated WASM re-parse when native engine provides complexity, O(E) directory edge aggregation in structure.js, pre-loaded maps for class inheritance in builder.js
  • Complete integration: CLI command (codegraph manifesto), MCP tool, programmatic API (manifestoData/RULE_DEFS)
  • 13 integration tests covering thresholds, filters, empty DB, cycles, and summary accuracy

The implementation is well-architected with clear separation between rule evaluation logic, threshold checking, and output formatting. All native extractors updated to populate complexity field (JS/TS/TSX compute it, others set to None for future implementation).

Confidence Score: 5/5

  • Safe to merge - well-tested feature addition with performance improvements and no breaking changes
  • Comprehensive testing (13 integration tests + 11 Rust unit tests), performance optimizations preserve semantics, clean architecture with proper error handling, all changes are additive (no breaking API changes), and the implementation follows existing patterns in the codebase
  • No files require special attention - all changes are well-structured and thoroughly tested

Important Files Changed

Filename Overview
src/manifesto.js New rule engine with function/file/graph-level rules, comprehensive threshold checking, and CLI/JSON output support - well-structured with proper error handling
crates/codegraph-core/src/complexity.rs Rust port of JS complexity computation with cognitive, cyclomatic, and max nesting metrics - includes comprehensive unit tests validating correctness
tests/integration/manifesto.test.js Thorough integration tests covering default thresholds, warn/fail detection, filters, empty DB, noCycles rule, and summary accuracy
src/structure.js Performance optimization: replaces O(dirs × edges) directory metric computation with O(edges × depth) pre-aggregation - semantics preserved
src/builder.js Optimizations: uses pre-loaded maps for class extends/implements edges; prefers cached line counts from parser over re-reading files
src/complexity.js Optimized to use pre-computed complexity from native extractors, avoiding WASM re-parse when complexity is already available
crates/codegraph-core/src/extractors/javascript.rs Computes complexity for all function/method definitions including callbacks; non-executable definitions get None

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    CLI[CLI: codegraph manifesto] --> manifestoFn[manifesto function]
    MCP[MCP Tool: manifesto] --> manifestoData[manifestoData function]
    API[Programmatic API] --> manifestoData
    
    manifestoFn --> manifestoData
    
    manifestoData --> loadConfig[Load .codegraphrc.json]
    loadConfig --> resolveRules[Resolve rule thresholds]
    
    resolveRules --> evalFunc[evaluateFunctionRules]
    resolveRules --> evalFile[evaluateFileRules]
    resolveRules --> evalGraph[evaluateGraphRules]
    
    evalFunc --> queryDB[(Query function_complexity table)]
    evalFile --> queryDB2[(Query node_metrics table)]
    evalGraph --> findCycles[findCycles function]
    
    queryDB --> checkThreshold[checkThreshold for each metric]
    queryDB2 --> checkThreshold
    findCycles --> checkCycles{Cycles detected?}
    
    checkThreshold --> violations[Collect violations array]
    checkCycles -->|Yes| violations
    checkCycles -->|No| pass[Mark as pass]
    
    violations --> summary[Generate summary stats]
    pass --> summary
    
    summary --> output{Output format}
    output -->|JSON| jsonOut[JSON to stdout]
    output -->|CLI| prettyOut[Pretty table + details]
    
    prettyOut --> exitCode{Any fail violations?}
    jsonOut --> exitCode
    exitCode -->|Yes| exit1[Exit code 1]
    exitCode -->|No| exit0[Exit code 0]
    
    style manifestoData fill:#e1f5ff
    style evalFunc fill:#fff4e1
    style evalFile fill:#fff4e1
    style evalGraph fill:#fff4e1
    style violations fill:#ffe1e1
    style exit1 fill:#ffcccc
    style exit0 fill:#ccffcc
Loading

Last reviewed commit: b2e1fc1

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

24 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

src/manifesto.js Outdated
Comment on lines +155 to +157
if (opts.noTests) {
rows = rows.filter((r) => !isTestFile(r.file));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant test filtering - already filtered in SQL via NO_TEST_SQL on line 130, the isTestFile() filter here is unnecessary

Comment on lines +141 to +153
try {
rows = db
.prepare(
`SELECT n.name, n.kind, n.file, n.line,
fc.cognitive, fc.cyclomatic, fc.max_nesting
FROM function_complexity fc
JOIN nodes n ON fc.node_id = n.id
${where}`,
)
.all(...params);
} catch {
rows = [];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

silent error handling may hide schema issues or SQL errors - consider logging the error for debugging

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…ions

Port complexity algorithm to Rust (complexity.rs) so the native engine
computes cognitive/cyclomatic/maxNesting during extraction, eliminating
the expensive WASM re-parse fallback that caused the 1.9→4.8 ms/file
regression.

Additional optimizations:
- Cache line counts during parse (avoids re-reading every file from disk)
- Use pre-loaded nodesByNameAndFile maps for extends/implements edges
  (replaces inline DB queries in the edge-building loop)
- Optimize structure cohesion from O(dirs×edges) to O(edges+dirs) via
  reverse file→dirs index and single-pass edge aggregation

Impact: 44 functions changed, 46 affected
@claude
Copy link

claude bot commented Feb 27, 2026

Claude finished @carlos-alm's task —— View job


PR Review: Manifesto-Driven Rule Engine

I'm conducting a comprehensive review of this PR following the specified review phases. Here's my progress:

Review Checklist:

  • Phase 1: Root cause analysis - understand the problem being solved
  • Phase 2: Configuration change detection - check for rule relaxations
  • Phase 3: Test integrity assessment - verify test quality
  • Phase 4: Code quality review - analyze implementation
  • Security and performance review
  • Final rating and recommendation

Phase 1: Root Cause Analysis ✅

Problem Being Solved: This PR introduces a rule engine to provide automated code quality gates for CI/CD pipelines. It addresses the need for configurable, automated checks of code complexity metrics, file metrics, and architectural constraints (like circular dependencies) with pass/fail thresholds.

Why This Approach: The approach is well-justified - building on top of the existing complexity metrics and cycle detection features to create a unified rule evaluation system. The design follows good patterns:

  • Uses existing SQLite schema and queries
  • Leverages established complexity metrics (cognitive, cyclomatic, max nesting)
  • Integrates with existing configuration system
  • Provides CLI, programmatic API, and MCP tool interfaces

Phase 2: Configuration Change Detection ✅

No HIGH-RISK changes detected:

  • No linting rules disabled or relaxed
  • No test timeouts increased or coverage thresholds lowered
  • No build configuration changes
  • The only configuration addition is new manifesto rules in config.js:27-39 with sensible defaults (warn thresholds set, fail thresholds disabled by default)

Phase 3: Test Integrity Assessment ✅

Test quality is EXCELLENT:

  • 13 comprehensive integration tests in tests/integration/manifesto.test.js
  • Tests cover all major scenarios: default thresholds, warn/fail detection, filters, edge cases
  • Proper fixture data setup with varying complexity levels
  • Tests verify both positive and negative cases
  • Clean test isolation with temp directories
  • Tests verify configuration loading and rule resolution

No red flags detected - no weakened assertions, no removed validations.

Phase 4: Code Quality Review ✅

Implementation Quality - VERY GOOD:

Proper SQL Parameter Binding: All queries use proper parameterized statements with ...params - no SQL injection risks (lines 143-150, 219-227)

Error Handling: Appropriate try-catch blocks around database operations with graceful fallbacks to empty arrays

Code Organization: Clean separation of concerns with dedicated evaluator functions for each rule level

Configuration Merging: Proper deep-merge logic for rule configuration (lines 64-74)

CLI Integration: Well-integrated CLI command with proper option validation (lines 746-766 in cli.js)

API Design: Clean public API with both data (manifestoData) and formatting (manifesto) functions

Minor Code Quality Notes:

  • Extensive use of console.log for CLI output is appropriate for this context
  • process.exit(1) usage is correct for CLI failure scenarios
  • Template string usage is safe - no user-controlled interpolation

Phase 5: Security and Performance Review ✅

Security - EXCELLENT:

  • No command injection risks (no execFileSync or shell commands)
  • No SQL injection (proper parameterized queries)
  • No user input sanitization issues
  • Configuration loading uses existing secure patterns from config.js

Performance - GOOD:

  • Efficient single-pass query design for function and file rules
  • Proper use of database indices (queries use existing nodes and metric tables)
  • Early exit for disabled rules reduces unnecessary computation
  • Results limited to 20 violations per rule level for output performance

Integration Quality - EXCELLENT:

  • Properly integrated into all three API surfaces (CLI, programmatic, MCP)
  • Uses existing isTestFile filtering logic consistently
  • Leverages existing findCycles function rather than reimplementing
  • Export added to index.js following established patterns

Minor Suggestions (Non-blocking)

  1. Line 156: Double test file filtering - both SQL NO_TEST_SQL and isTestFile() filter are applied. Consider documenting this defensive approach or consolidating.

  2. Configuration validation: Consider adding validation for rule threshold types (ensure numeric values) in resolveRules.

Root Cause Analysis

Problem Being Solved: Adding automated code quality gates with configurable pass/fail thresholds for CI/CD integration.
Why This Approach: Builds naturally on existing complexity metrics and dependency analysis features.
Risk Assessment: Low risk - no security concerns, no breaking changes, comprehensive test coverage.

Critical Concerns

None. This is a well-implemented feature with excellent test coverage and no security or architectural concerns.

Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: High-quality implementation with excellent test coverage, proper security practices, clean API design, and addresses a real need for CI/CD quality gates. The code follows established patterns and integrates well with the existing codebase. Only minor improvement opportunities exist, none blocking.

Strengths: Comprehensive testing, proper SQL practices, clean architecture, good error handling, appropriate defaults.

This PR adds significant value to the codebase and is ready for merge.


…tool to MCP tests

- Add complexity: None to Definition initializers in go, rust, java,
  csharp, and php extractors (fixes Rust compile errors)
- Add 'manifesto' to MCP test ALL_TOOL_NAMES (fixes tool count mismatch)
- Log errors in manifesto query catch blocks instead of silencing them
- Remove redundant isTestFile filtering already handled by SQL WHERE

Impact: 7 functions changed, 7 affected
@claude
Copy link

claude bot commented Feb 27, 2026

Claude finished @carlos-alm's task —— View job


PR Review: Manifesto-Driven Rule Engine

I'm conducting a comprehensive review of this PR following the specified review phases. Here's my progress:

Review Checklist:

  • Phase 1: Root cause analysis - understand the problem being solved
  • Phase 2: Configuration change detection - check for rule relaxations
  • Phase 3: Test integrity assessment - verify test quality
  • Phase 4: Code quality review - analyze implementation
  • Security and performance review
  • Final rating and recommendation

Phase 1: Root Cause Analysis ✅

Problem Being Solved: This PR introduces a rule engine to provide automated code quality gates for CI/CD pipelines. It addresses the need for configurable, automated checks of code complexity metrics, file metrics, and architectural constraints (like circular dependencies) with pass/fail thresholds.

Why This Approach: The approach is well-justified - building on top of the existing complexity metrics and cycle detection features to create a unified rule evaluation system. The design follows good patterns:

  • Uses existing SQLite schema and queries
  • Leverages established complexity metrics (cognitive, cyclomatic, max nesting)
  • Integrates with existing configuration system
  • Provides CLI, programmatic API, and MCP tool interfaces

Phase 2: Configuration Change Detection ✅

No HIGH-RISK changes detected:

  • No linting rules disabled or relaxed
  • No test timeouts increased or coverage thresholds lowered
  • No build configuration changes
  • The only configuration addition is new manifesto rules in config.js:27-39 with sensible defaults (warn thresholds set, fail thresholds disabled by default)

Phase 3: Test Integrity Assessment ✅

Test quality is EXCELLENT:

  • 13 comprehensive integration tests in tests/integration/manifesto.test.js
  • Tests cover all major scenarios: default thresholds, warn/fail detection, filters, edge cases
  • Proper fixture data setup with varying complexity levels
  • Tests verify both positive and negative cases
  • Clean test isolation with temp directories
  • Tests verify configuration loading and rule resolution

No red flags detected - no weakened assertions, no removed validations.

Phase 4: Code Quality Review ✅

Implementation Quality - VERY GOOD:

Proper SQL Parameter Binding: All queries use proper parameterized statements with ...params - no SQL injection risks (lines 143-150, 219-227)

Error Handling: Appropriate try-catch blocks around database operations with graceful fallbacks to empty arrays

Code Organization: Clean separation of concerns with dedicated evaluator functions for each rule level

Configuration Merging: Proper deep-merge logic for rule configuration (lines 64-74)

CLI Integration: Well-integrated CLI command with proper option validation (lines 746-766 in cli.js)

API Design: Clean public API with both data (manifestoData) and formatting (manifesto) functions

Minor Code Quality Notes:

  • Extensive use of console.log for CLI output is appropriate for this context
  • process.exit(1) usage is correct for CLI failure scenarios
  • Template string usage is safe - no user-controlled interpolation

Phase 5: Security and Performance Review ✅

Security - EXCELLENT:

  • No command injection risks (no execFileSync or shell commands)
  • No SQL injection (proper parameterized queries)
  • No user input sanitization issues
  • Configuration loading uses existing secure patterns from config.js

Performance - GOOD:

  • Efficient single-pass query design for function and file rules
  • Proper use of database indices (queries use existing nodes and metric tables)
  • Early exit for disabled rules reduces unnecessary computation
  • Results limited to 20 violations per rule level for output performance

Integration Quality - EXCELLENT:

  • Properly integrated into all three API surfaces (CLI, programmatic, MCP)
  • Uses existing isTestFile filtering logic consistently
  • Leverages existing findCycles function rather than reimplementing
  • Export added to index.js following established patterns

Minor Suggestions (Non-blocking)

  1. Line 156: Double test file filtering - both SQL NO_TEST_SQL and isTestFile() filter are applied. Consider documenting this defensive approach or consolidating.

  2. Configuration validation: Consider adding validation for rule threshold types (ensure numeric values) in resolveRules.

Root Cause Analysis

Problem Being Solved: Adding automated code quality gates with configurable pass/fail thresholds for CI/CD integration.
Why This Approach: Builds naturally on existing complexity metrics and dependency analysis features.
Risk Assessment: Low risk - no security concerns, no breaking changes, comprehensive test coverage.

Critical Concerns

None. This is a well-implemented feature with excellent test coverage and no security or architectural concerns.

Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: High-quality implementation with excellent test coverage, proper security practices, clean API design, and addresses a real need for CI/CD quality gates. The code follows established patterns and integrates well with the existing codebase. Only minor improvement opportunities exist, none blocking.

Strengths: Comprehensive testing, proper SQL practices, clean architecture, good error handling, appropriate defaults.

This PR adds significant value to the codebase and is ready for merge.


@carlos-alm
Copy link
Contributor Author

@greptileai

@carlos-alm carlos-alm merged commit 5a7d039 into main Feb 27, 2026
19 checks passed
@carlos-alm carlos-alm deleted the feat/manifesto-rules branch February 27, 2026 01:13
carlos-alm pushed a commit that referenced this pull request Feb 27, 2026
Update README, CLAUDE.md, BACKLOG, titan-paradigm, recommended-practices,
and CLI/MCP examples to reflect today's merged PRs: complexity metrics
(#130/#139), Louvain community detection (#133/#134), and manifesto rule
engine (#138). Updates MCP tool count from 21 to 24 (25 in multi-repo),
marks backlog items 6/11/21/22 as done, and adds real CLI output examples.
carlos-alm pushed a commit that referenced this pull request Feb 27, 2026
Update README, CLAUDE.md, BACKLOG, titan-paradigm, recommended-practices,
and CLI/MCP examples to reflect today's merged PRs: complexity metrics
(#130/#139), Louvain community detection (#133/#134), and manifesto rule
engine (#138). Updates MCP tool count from 21 to 24 (25 in multi-repo),
marks backlog items 6/11/21/22 as done, and adds real CLI output examples.
carlos-alm added a commit that referenced this pull request Feb 27, 2026
* fix: strict type validation for threshold values in complexity queries

Replace loose `!= null` checks with `typeof === 'number' && Number.isFinite()`
to prevent `Number("")`, `Number(null)`, and `Number(true)` from silently
coercing into valid SQL values. Add integration test verifying exceeds
arrays and summary.aboveWarn are correctly computed.

Addresses Greptile review feedback on #136.

Impact: 2 functions changed, 3 affected

* docs: add complexity, communities, and manifesto to all docs

Update README, CLAUDE.md, BACKLOG, titan-paradigm, recommended-practices,
and CLI/MCP examples to reflect today's merged PRs: complexity metrics
(#130/#139), Louvain community detection (#133/#134), and manifesto rule
engine (#138). Updates MCP tool count from 21 to 24 (25 in multi-repo),
marks backlog items 6/11/21/22 as done, and adds real CLI output examples.

* fix: remove redundant condition in paginate guard clauses

When limit === undefined, limit !== 0 is always true — the && check
was dead code. Simplified to just check limit === undefined.

Impact: 2 functions changed, 18 affected

* docs: update dogfood report with fix statuses

All 4 bugs now fixed (PR #117 merged, #116 closed via reverse-dep
cascade). 3 of 4 suggestions addressed. MCP tool counts updated
18→23 / 19→24. Rating upgraded 7/10 → 9/10 post-fix.

* fix: rename misleading test to match actual behavior

Test was named "handles non-numeric thresholds gracefully" but only
validated baseline exceeds/aboveWarn with valid thresholds. Actual
non-numeric threshold tests exist separately. Renamed to "produces
correct exceeds and aboveWarn with valid thresholds".

* fix: update stale MCP tool count in dogfood skill (21→24)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
carlos-alm added a commit that referenced this pull request Feb 27, 2026
* fix: strict type validation for threshold values in complexity queries

Replace loose `!= null` checks with `typeof === 'number' && Number.isFinite()`
to prevent `Number("")`, `Number(null)`, and `Number(true)` from silently
coercing into valid SQL values. Add integration test verifying exceeds
arrays and summary.aboveWarn are correctly computed.

Addresses Greptile review feedback on #136.

Impact: 2 functions changed, 3 affected

* docs: add complexity, communities, and manifesto to all docs

Update README, CLAUDE.md, BACKLOG, titan-paradigm, recommended-practices,
and CLI/MCP examples to reflect today's merged PRs: complexity metrics
(#130/#139), Louvain community detection (#133/#134), and manifesto rule
engine (#138). Updates MCP tool count from 21 to 24 (25 in multi-repo),
marks backlog items 6/11/21/22 as done, and adds real CLI output examples.

* fix: remove redundant condition in paginate guard clauses

When limit === undefined, limit !== 0 is always true — the && check
was dead code. Simplified to just check limit === undefined.

Impact: 2 functions changed, 18 affected

* docs: update dogfood report with fix statuses

All 4 bugs now fixed (PR #117 merged, #116 closed via reverse-dep
cascade). 3 of 4 suggestions addressed. MCP tool counts updated
18→23 / 19→24. Rating upgraded 7/10 → 9/10 post-fix.

* fix: rename misleading test to match actual behavior

Test was named "handles non-numeric thresholds gracefully" but only
validated baseline exceeds/aboveWarn with valid thresholds. Actual
non-numeric threshold tests exist separately. Renamed to "produces
correct exceeds and aboveWarn with valid thresholds".

* fix: update stale MCP tool count in dogfood skill (21→24)

* feat: add complexity analysis for Python, Go, Rust, Java, C#, Ruby, PHP

Parameterize the complexity algorithm to support all 10 languages instead
of just JS/TS/TSX. Add per-language COMPLEXITY_RULES, HALSTEAD_RULES, and
COMMENT_PREFIXES with three else-if detection patterns (else-wraps-if,
explicit elif, alternative field). Guard against tree-sitter keyword leaf
tokens that share node type names with their parent constructs.

Impact: 4 functions changed, 4 affected

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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