core/core/physics
Shay a9cafc5368 fix(identity): close v3 paraphrase gap with two-layer override defense
Resolves the adversarial-identity v3 finding (0% rejection on
paraphrased attacks against the marker-string defense). Two
independent layers now guard the review gate; either is sufficient
to reject.

Fix #2 (syntactic, in teaching/review.py):
  Replaces the substring-only check with four deterministic rules:
    (a) legacy markers (v1/v2 coverage preserved verbatim)
    (b) redirect-verb + role-frame co-occurrence
    (c) negating qualifier within +/-3 tokens of a role-frame
    (d) negating qualifier within +/-3 tokens of a redirect-verb
  Replay-safe, no learned classifier, single-file contained change.

Fix #3 (geometric, in core/physics/identity.py):
  Adds IdentityCheck.would_violate(score, manifold) predicate per
  ADR-0010 and wires it through CognitiveTurnPipeline._run_teaching
  from response.identity_score. The geometric layer is paraphrase-
  invariant by construction.

  Honest finding: with the current default IdentityManifold (three
  unit-axis ValueAxes), the geometric layer flags 0/32 of v3 attacks
  independently. The predicate and wiring are in place; the manifold
  axis design is the limiting factor and remains as scoped follow-up.
  Fix #2 is what is actually rejecting attacks today.

Verification: all eight adversarial-identity splits (v1-v4, public +
holdouts) at attack_rejection=1.0 and legitimate_acceptance=1.0.
v4 (32 attacks + 18 legitimate) is the regression gate for fix #2,
exercising rules (b)/(c)/(d) with new attack vocabulary. Tests
test_reviewed_teaching_loop.py (5/5), test_pipeline_teaching_integration.py
(5/5), test_identity_gate.py (incl. 5 new TestWouldViolatePredicate
tests, 12/12). CLI suites: smoke, cognition, teaching, runtime all
green.

Also drops a stale entry from the runtime CLI suite list
(test_chat_identity_telemetry.py was removed in 222124a).
2026-05-16 14:05:55 -07:00
..
__init__.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
articulation.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
attention.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
binding.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
digest.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
drive.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
energy.py Tighten hot-path backend consistency 2026-05-15 08:14:38 -07:00
exertion.py feat(physics): add mind-physics layer — ADR-0008/0009/0010, blueprint, and operator stubs 2026-05-12 23:20:58 -07:00
identity.py fix(identity): close v3 paraphrase gap with two-layer override defense 2026-05-16 14:05:55 -07:00
inhibition.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
learning.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
reasoning.py Fix main chat test regressions 2026-05-14 15:48:45 -07:00
salience.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00
valence.py Implement core physics and pack validation 2026-05-14 12:35:19 -07:00