Skip to content

fix: make the policy health check satisfy json object mode - #300

Merged
Barsoomx merged 1 commit into
masterfrom
fix/validation-json-mode
Jul 29, 2026
Merged

fix: make the policy health check satisfy json object mode#300
Barsoomx merged 1 commit into
masterfrom
fix/validation-json-mode

Conversation

@Barsoomx

Copy link
Copy Markdown
Owner

An OpenAI curation policy could never pass engram_validate_policies / the console's Test connection button.

Observed on the stand right after migrating it to OpenAI:

curation   openai gpt-5-mini            status=FAIL error=provider_http_error (400)
digest     openai gpt-5-nano            status=PASS
generation openai gpt-5-nano            status=PASS
embedding  openai text-embedding-3-small status=PASS

Only curation failed, because it is the only task type whose health check uses a structured response kind: _validation_response_kind returns candidates for curation, candidates is in _STRUCTURED_RESPONSE_KINDS, and openai_json_mode_override therefore sets response_format: json_object for an OpenAI policy. OpenAI rejects that unless the messages mention json, and VALIDATION_PROMPT did not.

Proved against the real API, both prompts, same policy shape:

OLD  HTTP 400 'messages' must contain the word 'json' in some form, to use 'response_format'...
NEW  OK  out=14  content={"ok": true}

Fix is the prompt itself. The test pins the relationship rather than the wording: it asserts that the curation health check's response kind really is a structured one, and that the prompt satisfies the mode that implies.

Pre-existing — it would have hit any OpenAI curation policy before this week; nobody had one until now.

Backend suites: 815 passed.

🤖 Generated with Claude Code

@Barsoomx

Copy link
Copy Markdown
Owner Author

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov-commenter

codecov-commenter commented Jul 29, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

Affected Assets, Files, and Routes:

view changes for bundle: engram-frontend-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
server/middleware-*.js 2.72kB 3.21kB 548.89% ⚠️
server/middleware-*.js -2.72kB 495 bytes -84.59%
static/A3RWyqOJYQIawHj4nWJHS/_buildManifest.js (New) 1.51kB 1.51kB 100.0% 🚀
static/A3RWyqOJYQIawHj4nWJHS/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/fT1P5ugzkNt6fxJqQJY2R/_buildManifest.js (Deleted) -1.51kB 0 bytes -100.0% 🗑️
static/fT1P5ugzkNt6fxJqQJY2R/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.03%. Comparing base (ba194b4) to head (fafe322).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #300   +/-   ##
=======================================
  Coverage   91.03%   91.03%           
=======================================
  Files         221      221           
  Lines       23099    23099           
=======================================
  Hits        21029    21029           
  Misses       2070     2070           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Barsoomx
Barsoomx merged commit 82f2382 into master Jul 29, 2026
14 checks passed
@Barsoomx
Barsoomx deleted the fix/validation-json-mode branch July 29, 2026 04:30
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