Skip to content

feat: corrected text suggestions alongside flags #13

@Jamie-BitFlight

Description

@Jamie-BitFlight

Summary

When a hallucination pattern is flagged, generate a suggested rewrite that replaces the speculative/ungrounded language with evidence-based alternatives.

Current Behavior

The stop hook outputs a warning message with the flagged evidence but does not suggest what to say instead. The user/agent must figure out the rewrite themselves.

Proposed Behavior

Each trigger match includes a suggestedFix field with a rewritten version:

{
  kind: 'speculation_language',
  evidence: 'I think',
  offset: 12,
  original: 'I think the issue is in the config.',
  suggestedFix: 'I have not verified the root cause. To investigate, I can check the config file.'
}

Fix Templates (per category)

Speculation Language

  • "I think X" → "I have not verified X. To check: [verification step]."
  • "X is probably Y" → "X may be Y — I can verify by [method]."
  • "It should be working" → "I have not confirmed whether it is working. Next step: [test]."

Causality Language

  • "X because Y" → "X was observed. Y is a hypothesis — to verify: [method]."
  • "caused by Z" → "Potential cause: Z. Evidence needed: [what to check]."

Completeness Claims

  • "all files checked" → "I checked [list files]. Other files were not examined."
  • "fully resolved" → "The specific issue in [file:line] is fixed. Other instances not checked."

Pseudo-Quantification

  • "8.5/10" → Remove or replace with specific measurable criteria.
  • "70% improvement" → "Measured: [before] → [after] by [method]."

Implementation

Acceptance Criteria

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimpact: contractChanges stdin/stdout contract with Claude Code. High risk.phase: 5-output-pipelinePhase 5: Output format (must preserve hook contract)risk: lowLow risk — additive, backward-compatibletopic: outputOutput format, JSON, suggested fixes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions