Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Reference Implementation — src/

Original, clean-room, dependency-free Node.js implementation of the technique described in ../DEFENSIVE-PUBLICATION.md.

This is illustrative prior-art code, not production code. It reproduces no proprietary source, performs no I/O, requires no external packages, and contains no secrets. Its only purpose is to enable the disclosure — to show that the invention reduces to practice.

Files

File What it shows
band-router.js The full mechanism: a per-action-type band store, the routing trichotomy (routeAUTO / ESCALATE / REVIEW), outcome recording into a recency-weighted sliding window, and rolling recalibration with clamps, hysteresis (maxStep), minWidth, and a minSamples gate — all configurable globally and per action type.
example.js A runnable scenario and self-check: drives chat (high success) and email (low success) through outcome streams, prints how each band moves and how a fixed confidence routes, and asserts invariants R1, R6, R7, R11.

Run it

Requires Node.js 18+ (uses only the standard library).

cd src
node example.js

Expected: the chat band loosens (bounds drop → more AUTO), the email band tightens (bounds rise → more REVIEW/ESCALATE), the two types stay isolated, invalid confidence routes to REVIEW, and the script prints All self-checks passed.

How it maps to the claims

Claim element Code
Per-action-type bands (Claim 1, 3, 15) states: Map<actionType, BandState>, cfgFor, stateFor.
Routing trichotomy (Claim 1, 9) route() returning AUTO/ESCALATE/REVIEW.
Outcome + sliding window (Claim 1, 4) recordOutcome() with recency-decayed ring buffer.
Human-free recalibration, tighten/loosen (Claim 1, 2) recalibrate() with the signed delta rule.
min-samples gate (Claim 5) if (window.length < minSamples) ....
recalc every M (Claim 6) sinceRecalc >= recalcEvery.
clamps + ordering (Claim 7) clamp, enforceOrdering.
hysteresis / max-step (Claim 8) boundedStep.
audit hook (Claim 10, 11) audit('recalibrate', …), getStatus/getAllStatus.
seed unseen type (Claim 12) seedLow/seedHigh defaults in stateFor.
fail-safe (Claim 13) invalid confidence → REVIEW.
emergent gradient (Claim 14) demonstrated by example.js divergence.