Skip to content

Releases: h13/constraint-engine

v0.5.8

03 Mar 23:05
@h13 h13

Choose a tag to compare

v0.5.8 — Cross-Path Consistency & SQL Hardening

Fixes

  • NULL-safe aggregation: Added COALESCE to checkpoint_summary.sql and checkpoint_period_summary.sql (matching recall_summary.sql from v0.5.6)
  • MCP validation parity: QuickRecorder now validates taskContext after fallback resolution, matching CheckpointRecorder behavior

Tests (2 new)

  • QuickRecorderTest: whitespace-only taskContext rejection
  • GoNoGoVerdictTest: friction at limit with unmet targets returns pending

Review Notes

  • Reviewer flagged REST diff validation as missing, but Diff semantic validator (src/Semantic/Diff.php) already rejects empty values via Be framework — confirmed as false positive
  • HATEOAS link template on Sessions uses standard HAL {sessionId} template expansion — correct BEAR.Sunday behavior

Stats

  • 183 tests, 368 assertions (was 181/365)
  • composer build green

v0.5.7

02 Mar 22:21
@h13 h13

Choose a tag to compare

v0.5.7 — Final Polish

Fixes

  • Verdict ambiguity: Changed NO_GONO-GO in MCP tool output to prevent substring false positives when checking for GO
  • Type safety: Initialized firstRate/lastRate as float instead of null to eliminate PHPStan null-dereference risk in arithmetic

Review Status

7th review cycle found only 2 minor issues — project has reached diminishing returns on review cycles. All 10 review dimensions (concurrency, SQL, Unicode, response format, MCP types, test determinism, memory, validation, API contract, compilation) confirmed clean.

Stats

  • 181 tests, 365 assertions
  • composer build green (cs + sa + test + compile)

v0.5.6

02 Mar 22:15
@h13 h13

Choose a tag to compare

v0.5.6 — Test Coverage & SQL Hardening

Fixes

  • NULL-safe aggregation: recall_summary.sql now uses COALESCE so empty tables return 0 instead of SQL NULL
  • PostgreSQL compatibility: Quoted reserved-word aliases (date, count) in checkpoint_trend.sql and checkpoint_tag_distribution.sql

Tests (8 new)

  • CheckpointRecorder: 3 tests for empty/whitespace input guards (aiProposal, humanFinal, taskContext)
  • ImprovementSuggester: 2 tests for empty input guards (aiProposal, taskContext)
  • PatternViewer: 2 tests for invalid date format error paths (comparePeriods, showImprovementRate)
  • PatternDashboard: 1 test for 400 response on invalid periodEnd

Stats

  • 181 tests, 365 assertions (was 173/349)
  • composer build green

v0.5.5

02 Mar 22:07
@h13 h13

Choose a tag to compare

v0.5.5 — Architecture & Correctness Review

Fixes

  • Period symmetry: comparePeriods default now uses symmetric 7-day windows (was 8 vs 7 days)
  • TOCTOU fix: SessionAnalysis derives checkpointCount from fetched array instead of separate aggregation query

Documentation

  • SessionManager: Documented ephemeral state limitation; return message now prompts users to save session ID for crash recovery
  • McpModule: Documented PDO singleton dependency required for lastInsertId() correctness

Stats

  • 173 tests, 349 assertions
  • composer build green

v0.5.4

02 Mar 22:01
@h13 h13

Choose a tag to compare

v0.5.4 — Deep Architecture Review

Fixes

  • SQLite compatibility: CAST(date_created AS DATE)DATE(date_created) in trend/factual-rate queries (silently returned wrong GROUP BY results)
  • Error sanitization: AnthropicClient no longer leaks response body or Guzzle exception details
  • Index resource: Replaced scaffold greeting with application metadata
  • Singleton scope: AnthropicClient binding now properly scoped as singleton

Tests

  • Added tearDown() to ResourceTestCase and all 5 MCP integration test classes for proper test isolation
  • Updated AnthropicClientTest and IndexTest assertions

Stats

  • 173 tests, 349 assertions
  • composer build green

v0.5.3 — PatternViewer Polish & Type Safety

01 Mar 23:35
@h13 h13

Choose a tag to compare

Changes

UX Improvements

  • Comparison output: Now shows both current and previous period counts (e.g., "Factual: 3 (30.0%) vs 4 (50.0%) (-20.0pp)")
  • Partial date rejection: compare_periods and show_improvement_rate now return clear error messages when only some date parameters are provided, instead of silently using defaults

Type Safety

  • Cast strtotime() return to int for PHP 8.1+ strict typing compatibility

Tests

  • Added partial args rejection tests for comparePeriods and showImprovementRate
  • 173 tests, 348 assertionscomposer build green

v0.5.2 — Date Validation, Test Suite Fix, Exception Consistency

01 Mar 23:31
@h13 h13

Choose a tag to compare

Changes

Bug Fixes

  • Date validation: PatternDashboard returns 400 (not 500) on malformed date query params; PatternViewer MCP tools return error strings for invalid dates
  • Exception consistency: Checkpoint::onPut catches PDOException instead of RuntimeException, aligning with rest of codebase

Test Infrastructure

  • PHPUnit config fix: tests/Semantic/ and tests/ root were missing from phpunit.xml.dist — 43 tests were not being discovered (129 → 172)
  • DateHelper unit tests: Boundary dates (month/year/leap year) and invalid input coverage
  • UserId whitespace test: Added missing whitespace-only validation test

Stats

  • 172 tests, 344 assertions
  • composer build green (cs + sa + test + compile)

v0.5.1 — Error Sanitization, DateHelper, SQL Guards

01 Mar 23:25
@h13 h13

Choose a tag to compare

Changes

Security

  • Error message sanitization: All MCP tools now return generic error messages instead of leaking raw PDOException/RuntimeException details (table names, DSN, constraint info)

Code Quality

  • DateHelper extraction: nextDay() extracted from PatternViewer and PatternDashboard into shared DateHelper class with strtotime false guard (throws InvalidArgumentException on malformed dates)
  • Input validation: ImprovementSuggester.suggestImprovements() now validates empty aiProposal and taskContext

Performance

  • SQL LIMIT: Added missing LIMIT to session_analysis (500), session_list (200), team_summary (200)

Tests

  • Added empty/whitespace taskContext validation tests for SessionManager.startSession()
  • Updated error message assertions to verify sanitized output
  • 129 tests, 283 assertionscomposer build green

v0.5.0 — PostgreSQL Compatibility & Input Validation

01 Mar 23:17
@h13 h13

Choose a tag to compare

Changes

PostgreSQL Compatibility

  • Period queries: Replace SQLite-specific date() / BETWEEN with portable >= / < pattern and PHP-side nextDay() helper
  • lastInsertId(): Guard against empty string return (PostgreSQL without sequence name)
  • SQL portability: Replace DATE() with CAST(AS DATE), CAST(AS FLOAT) with * 100.0

Input Validation

  • Validate empty inputs in MCP CheckpointRecorder (aiProposal, humanFinal, taskContext)
  • Validate empty parse result in QuickRecorder
  • Validate empty taskContext in SessionManager.startSession()

Stats

  • 127 tests, 272 assertions
  • composer build green (cs + sa + test + compile)

v0.4.9

01 Mar 23:03
@h13 h13

Choose a tag to compare

SQL correctness, data integrity, and deployment improvements

Critical Fixes

  • BETWEEN date truncation: All period queries (checkpoint_period_summary, checkpoint_trend, checkpoint_factual_rate) now use >= :periodStart AND < date(:periodEnd, '+1 day') instead of BETWEEN. Previously, same-day records were excluded because SQLite string comparison with date-only end values (e.g., '2026-03-02') missed timestamps like '2026-03-02 14:30:00'

SQL Improvements

  • Deterministic session taskContext: Replaced MAX(task_context) with correlated subquery returning the earliest checkpoint's context in session_list.sql and session_analysis_summary.sql
  • Bounded list queries: Added LIMIT 200 to checkpoint_list.sql and checkpoint_filter.sql to prevent unbounded REST result sets
  • userId in item query: GET /checkpoints/{id} now returns userId — previously write-only

Deployment

  • Docker env vars: Forward ANTHROPIC_MODEL and API_BASE_URL to app container in compose.yaml

Tests

  • Added recordDiscovery and recordFriction not-found path tests in RecallTrackerTest

Stats

  • 127 tests, 272 assertions
  • PHPStan: no errors
  • Full build green