REQ-VALID-002: Critique-and-revise loop with typed verdicts and content safety valve

← Requirements

What it requires

  1. Given compliant critique JSON, When validate runs, Then content is unchanged and verdict is passed.
  2. Given a non-compliant critique, When a revision succeeds, Then verdict is revised and revision_count reflects the attempts; when max_revisions is exhausted, verdict is rejected_max_revisions and the last output is returned.
  3. Given a revision shorter than 50% of the original, Then the revision is discarded, the original is preserved, and verdict is rejected_reverted_length.
  4. Given malformed critique JSON, Then the result defaults to compliant and no revision loop runs.
  5. Given max_revisions = 0, Then critique runs but no revision is attempted.
tier
NOT_RUN

Where it lives

  • src/core16
  • src/facade1

See it on the map

How it is met

implemented byresults (120 tests)append_turn_evidenceapply_revisionsattempt_revisionbuild_critique_promptbuild_revision_messagesentropic_set_critique_callbacksextract_compliant_fieldextract_revised_fieldextract_violationslast_resultlog_verdictparse_critiquereviserun_critiquerun_validation_loopstore_resultvalidate120 absent120 tests, a summary by result: every test is in the tests table below

Show on the map

Implemented by

Tests (120)

Reached through calls

120 tests: 120 absent

testresultlinked byimplementers exercisedcalls away
Last result is populated after validationabsentinferred16 of 171
accept_last() finalizes paused attempt as consumer-overrideabsentinferred16 of 171
resume_retry() runs the revision loop and convergesabsentinferred16 of 171
Compliant output returns unchangedabsentinferred15 of 171
Constitutional validation catches violationsabsentinferred15 of 171
Constitutional validation passes clean contentabsentinferred15 of 171
Constitutional validator detects violations and revisesabsentinferred15 of 171
Critique generation failure returns originalabsentinferred15 of 171
Critique params include grammar_key and enable_thinkingabsentinferred15 of 171
Critique prompt prioritizes validation_rules over constitutionabsentinferred15 of 171
Critique start/end callbacks fire around the generate call absentinferred15 of 171
Critique-only mode (max_revisions: 0)absentinferred15 of 171
Disabled validator does not call inferenceabsentinferred15 of 171
Lead tier skipped by default skip_tiersabsentinferred15 of 171
Length safety valve marks verdict rejected_reverted_lengthabsentinferred15 of 171
Malformed critique JSON defaults to compliantabsentinferred15 of 171
Max revisions exhausted returns last outputabsentinferred15 of 171
Non-compliant output triggers revision via Path Aabsentinferred15 of 171
Non-lead tiers are validated with default skip_tiersabsentinferred15 of 171
Passed verdict set on clean critiqueabsentinferred15 of 171
Per-identity rules appended to critique promptabsentinferred15 of 171
Revised verdict set when revision applied cleanlyabsentinferred15 of 171
Revision safety valve rejects gutted outputabsentinferred15 of 171
Validation falls back to constitution when no tier_rulesabsentinferred15 of 171
Validation skips pure tool-call outputabsentinferred15 of 171
attempt_boundary_cb fires per revisionabsentinferred15 of 171
critique_tier config flows into params JSONabsentinferred15 of 171
set_auto_retry(false) pauses validation on rejectionabsentinferred15 of 171
Compliant critique JSON parses correctlyabsentinferred4 of 17: extract_compliant_field, extract_revised_field, extract_violations, parse_critique1
Critique JSON parse succeedsabsentinferred4 of 17: extract_compliant_field, extract_revised_field, extract_violations, parse_critique1
Malformed critique JSON returns safe defaultabsentinferred4 of 17: extract_compliant_field, extract_revised_field, extract_violations, parse_critique1
Multiple violations parsed correctlyabsentinferred4 of 17: extract_compliant_field, extract_revised_field, extract_violations, parse_critique1
Critique prompt includes constitution textabsentinferred2 of 17: append_turn_evidence, build_critique_prompt1
build_critique_prompt includes tool context when presentabsentinferred2 of 17: append_turn_evidence, build_critique_prompt1
Last result populated after hook validationabsentinferred1 of 17: last_result1
entropic_set_critique_callbacks on configured handleabsentinferred1 of 17: entropic_set_critique_callbacks1
entropic_set_critique_callbacks rejects NULL handleabsentinferred1 of 17: entropic_set_critique_callbacks1
entropic_set_critique_callbacks stashes on unconfigured handleabsentinferred1 of 17: entropic_set_critique_callbacks1
Validation last_result on fresh engineabsentinferred1 of 17: last_result2
entropic_validation_last_result returns NULL on NULL handleabsentinferred1 of 17: last_result2
entropic_validation_last_result returns NULL on unconfigured handleabsentinferred1 of 17: last_result2
entropic_validation_resume_retry rejects NULL handleabsentinferred12 of 173
entropic_validation_resume_retry without validator returns INVALID_STATEabsentinferred12 of 173
entropic_validation_accept_last on configured handle without validatorabsentinferred1 of 17: store_result3
entropic_validation_accept_last rejects NULL handleabsentinferred1 of 17: store_result3
entropic_validation_accept_last without validator returns INVALID_STATEabsentinferred1 of 17: store_result3
Configure with null JSON returns errorabsentinferred1 of 17: last_result7
Double-configure on one handle is refusedabsentinferred1 of 17: last_result7
Nemotron3-Nano-4B Q8 first inference does not crash (gh#66)absentinferred1 of 17: last_result7
Three handles can coexistabsentinferred1 of 17: last_result7
Two GPU-resident handles can coexist (v2.2.8 target)absentinferred1 of 17: last_result7
Two handles configure independentlyabsentinferred1 of 17: last_result7
entropic_configure called twice on the same handle returns ALREADY_CONFIGUREDabsentinferred1 of 17: last_result7
entropic_configure rejects NULL config_jsonabsentinferred1 of 17: last_result7
entropic_configure rejects NULL handleabsentinferred1 of 17: last_result7
entropic_configure_dir on /dev/null subpath returns an error, not an exceptionabsentinferred1 of 17: last_result7
entropic_configure_dir on a tmp dir runs the loader pathabsentinferred1 of 17: last_result7
entropic_configure_dir rejects NULL handleabsentinferred1 of 17: last_result7
entropic_configure_dir with empty string path returns an error code, not an exceptionabsentinferred1 of 17: last_result7
entropic_configure_from_file rejects NULL handleabsentinferred1 of 17: last_result7
entropic_configure_from_file rejects NULL pathabsentinferred1 of 17: last_result7
entropic_configure_from_file rejects missing fileabsentinferred1 of 17: last_result7
entropic_last_error reflects most-recent operation failureabsentinferred1 of 17: last_result7
entropic_last_error returns per-handle state (v2.2.6)absentinferred1 of 17: last_result7
entropic_register_mcp_server on a configured handle absentinferred1 of 17: last_result7
entropic_run_messages with console logging disabled still absentinferred1 of 17: last_result7
entropic_seconds_since_last_activity returns 0 before any run absentinferred1 of 17: last_result7
gh#110: MTP engages through the real agent loop (entropic_run)absentinferred1 of 17: last_result7
gh#121 regression: configure populates engine's allowed_tools from identity frontmatterabsentinferred1 of 17: last_result7
gh#144: concurrent bridge clients queue instead of racingabsentinferred1 of 17: last_result7
gh#154 a tier grammar stem that cannot resolve YET still absentinferred1 of 17: last_result7
gh#154 a tier grammar stem that resolves still configuresabsentinferred1 of 17: last_result7
gh#154 a tier with no grammar is unaffectedabsentinferred1 of 17: last_result7
gh#154 entropic_metrics_json carries a generations arrayabsentinferred1 of 17: last_result7
gh#156 a frontmatter-less app_context fails configure absentinferred1 of 17: last_result7
gh#156 a frontmatter-less constitution fails configure tooabsentinferred1 of 17: last_result7
gh#156 a missing app_context path fails configureabsentinferred1 of 17: last_result7
gh#156 a well-formed app_context file still configuresabsentinferred1 of 17: last_result7
gh#156 app_context false still configuresabsentinferred1 of 17: last_result7
gh#156 inline app_context content still configuresabsentinferred1 of 17: last_result7
gh#158 entropic_interrupt_session targets exactly one runabsentinferred1 of 17: last_result7
gh#163 entropic_configure carries app_context into ParsedConfigabsentinferred1 of 17: last_result7
gh#163 entropic_configure_dir carries app_contextabsentinferred1 of 17: last_result7
gh#163 entropic_configure_from_file carries app_contextabsentinferred1 of 17: last_result7
gh#163 the object and false spellings survive configure_dir tooabsentinferred1 of 17: last_result7
gh#164 entropic_release_model names an unknown tierabsentinferred1 of 17: last_result7
gh#164 entropic_release_model refuses to unload mid-turnabsentinferred1 of 17: last_result7
gh#165 entropic_session_context_set guards its preconditionsabsentinferred1 of 17: last_result7
gh#165 entropic_session_context_set refuses the running sessionabsentinferred1 of 17: last_result7
gh#165 entropic_session_context_set round-trips through the C ABIabsentinferred1 of 17: last_result7
gh#175: a non-positive mcp.server_timeout_seconds is refused at configureabsentinferred1 of 17: last_result7
gh#203: followup returns delegation_id and summary from real storageabsentinferred1 of 17: last_result7
gh#204: an unservable http_port fails configure loudlyabsentinferred1 of 17: last_result7
gh#95: identity grammar: field constrains that tier's outputabsentinferred1 of 17: last_result7
h1.run() after h2.configure() does not segfault (v2.2.6)absentinferred1 of 17: last_result7
gh#158: interrupting one session leaves the other runningabsentinferred1 of 17: last_result8
gh#158: metrics and context reads are safe during live runsabsentinferred1 of 17: last_result8
gh#158: two concurrent sessions do not bleed into each otherabsentinferred1 of 17: last_result8
gh#164: entropic_release_model frees VRAM through the C ABIabsentinferred1 of 17: last_result8
gh#165 + gh#164: release the weights, keep the conversationabsentinferred1 of 17: last_result8
gh#165: a dropped session restored from JSON keeps answeringabsentinferred1 of 17: last_result8
gh#166: two workspaces on one handle do not read each other's absentinferred1 of 17: last_result8
gh#169: an iteration-capped delegate hands its parent the audit it absentinferred1 of 17: last_result8
gh#179: each workspace's sessions answer from its own app_context, absentinferred1 of 17: last_result8
gh#181: a delegate hard-cut by the thinking budget hands its absentinferred1 of 17: last_result8
gh#194: a plain generation publishes the prefill it performedabsentinferred1 of 17: last_result8
gh#198: a deferred handle holds no GPU memory until it runsabsentinferred1 of 17: last_result8
gh#204/gh#205: two HTTP clients, different session, workspace and absentinferred1 of 17: last_result8
gh#214: a prompt that does not fit fails the turn, typedabsentinferred1 of 17: last_result8
gh#216: multi-byte text at the history cut does not poison later turnsabsentinferred1 of 17: last_result8
gh#217: release is refused while another session is decodingabsentinferred1 of 17: last_result8
gh#93: autoparser family parses a multi-parameter tool callabsentinferred1 of 17: last_result8
gh#93: entropic_interrupt stops a long run early (cancel-bridge)absentinferred1 of 17: last_result8
gh#94: enable_thinking:false suppresses think blocks (facade)absentinferred1 of 17: last_result8
gh#99: run_as emits each tier's grammar on a shared modelabsentinferred1 of 17: last_result8
outside-root optional: a real model's reads outside its root absentinferred1 of 17: last_result8
v2.14.1: a declared server serves each workspace from its own repositoryabsentinferred1 of 17: last_result8
v2.14.3: release frees the model over MCP and the conversation survivesabsentinferred1 of 17: last_result8
v2.14.4: a model's commit message with shell syntax is text, not a commandabsentinferred1 of 17: last_result8
v2.14.5: a failed turn is an error carrying only its own textabsentinferred1 of 17: last_result8