Skip to content

reason: remove hardcoded quality-contract boilerplate injection #299

Closed

Description

@hurttlocker

Problem

enforceResponseQualityContract() currently rewrites model output into a static template when needsContractRepair() fails.

In production digests this causes repetitive low-signal text like:

  • "This response was normalized to meet the required output contract..."
  • canned Evidence/Conflicts/Next Actions blocks

This masks actual model output quality and creates stale/generic digests even when retrieval has relevant context.

Root cause

internal/reason/quality_contract.go injects boilerplate content instead of returning model output + letting downstream quality gates decide pass/fail.

Proposed fix

  • Make enforceResponseQualityContract() passthrough (trim only), no boilerplate rewrite.
  • Keep/strengthen external quality gates at call sites (cron runners) to reject malformed outputs.

Why this is safer

  • Preserves true model output for observability/debugging.
  • Prevents fake compliance from canned text.
  • Lets operators control policy (retry/fallback) outside the core reason engine.

Validation plan

  • Unit tests updated for passthrough behavior.
  • Full go test ./... green.
  • Verify no more "normalized to meet required output contract" in generated digests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions