Skip to content

feat(evolution): human ground-truth feedback seam with polarity-aware reflection lifecycle (implemented on liam-cyberpro fork, PR #28) #1011

Description

@liam-cyberpro

Documenting a completed feature on the liam-cyberpro fork for upstream awareness — no upstream action required. (A cross-repo PR isn't possible: the fork is not in this repo's GitHub fork network, and per standing convention no branches are pushed here.)

Full implementation + review trail: https://github.com/liam-cyberpro/Deus/pull/28

Summary

Generic, dependency-free seam in evolution/ for external trace sources and human annotation write-back:

  • interactions.source_ref — set-once external-origin ref (COALESCE-preserved upsert, indexed) for exact source matching (replaces prompt-prefix heuristics).
  • interactions.human_score/comment/scored_at/processed_at — human ground-truth feedback; NULL-safe idempotent updates (IS, not the NULL-poisoned !=).
  • reflections.polarity — persisted 'corrective'|'positive' threaded through all 8 interaction-keyed save_reflection writers; a completeness test pins the writer list. Persisted rather than inferred because category sets collide between generators and score_at_gen is decoupled from polarity by the user-signal writer and env-tunable thresholds.
  • maintenance.process_human_feedback — direction-aware routing (human-low → corrective; human-high overriding a judge false-negative → positive, eps-tolerant boundary) + zone-alignment archival soft-deleting contradicted-polarity reflections; NULL-polarity legacy rows never archived.
  • Prompt-injection defense on the human comment (cap + bracket-strip + boundary tags + post-boundary instruction) since generated lessons persist into the retrieval pool.

Additive-only schema; 24 new tests + full evolution suite green; dual-backend warden trail (plan 10 rounds / code / ai-eng / verification, all SHIP) in the PR body.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions