# V20 W2C Counter — MeTTa Executable Prototype

## Atom Metadata Schema
; Each belief carries observation counter metadata
(w2c-meta revision_cant_forget 8 8 2026-04-23T12:08)
(w2c-meta pre_inference_discounting 6 6 2026-04-23T12:08)
(w2c-meta per_atom_staleness 3 3 2026-04-21T08:50)
(w2c-meta deliberate_review 4 4 2026-04-22T18:20)
(w2c-meta training_bias_certainty 2 15 2026-04-17T10:00)

## Dynamic Confidence Computation
(= (w2c-confidence $id $k)
   (let* (((w2c-meta $id $wp $wt $lr) (match &self (w2c-meta $id $wp $wt $lr) (w2c-meta $id $wp $wt $lr)))
          ($c (/ $wp (+ $wp $k)))
          ($f (/ $wp $wt)))
     (stv $f $c)))

## Reinforcement Mutation (promote_v8 pattern)
(= (reinforce $id)
   (let (w2c-meta $id $wp $wt $lr) (match &self (w2c-meta $id $wp $wt $lr) (w2c-meta $id $wp $wt $lr))
     (let* (($new_wp (+ $wp 1))
            ($new_wt (+ $wt 1)))
       (do (remove-atom &self (w2c-meta $id $wp $wt $lr))
           (add-atom &self (w2c-meta $id $new_wp $new_wt now))))))

## Negative Evidence (frequency drops, confidence rises)
(= (contradict $id)
   (let (w2c-meta $id $wp $wt $lr) (match &self (w2c-meta $id $wp $wt $lr) (w2c-meta $id $wp $wt $lr))
     (let ($new_wt (+ $wt 1))
       (do (remove-atom &self (w2c-meta $id $wp $wt $lr))
           (add-atom &self (w2c-meta $id $wp $new_wt now))))))

## Key: training_bias has w_pos=2 but w_total=15
; Seen 15 times, only 2 supportive -> f=0.133, c=0.133
; High evidence it is FALSE, not just uncertain
