Skip to content

Latest commit

 

History

History
75 lines (55 loc) · 2.87 KB

File metadata and controls

75 lines (55 loc) · 2.87 KB

Reference Implementation (illustrative, clean-room)

This directory contains an original, clean-room, dependency-light reference implementation accompanying the defensive publication ../DEFENSIVE-PUBLICATION.md. It exists to make the novel mechanism concrete and runnable. It is illustrative, not production code, and contains no proprietary source, no secrets, and no internal infrastructure identifiers.

What it demonstrates

The "Proactive-Action Engine with Layered Cooldowns": on each scan tick a single pass runs a plurality of heterogeneous signal sources, each emitting typed candidate actions; every candidate is then filtered by two gates, before any (here stubbed) model call:

  1. a role-availability gate(role, type) → allowed?; and
  2. a per-action-TYPE cooldown gate — keyed on the action class, not the item, so one cooldown spans all instances of a class.

Only survivors are enqueued; the engine never executes the actions itself. Cadence (scan interval, per-type cooldowns, per-type allowed roles) is read from a configuration bridge.

Files

File Purpose
proactive-engine.js The engine: ConfigBridge, CooldownLedger, createProactiveEngine, and four illustrative signal sources.
demo.js A deterministic scenario printing per-tick emissions, gate drops, and enqueues.
self_check.js Asserts the three core invariants and exits non-zero on failure.

How to run

Requires Node.js 16+ (standard library only — no npm install needed).

# Watch the mechanism in action (many stale items => one stale-review):
node demo.js

# Verify the core invariants:
node self_check.js

Expected self_check.js output

  PASS  INV-1 per-action-type cooldown suppresses class spam
  PASS  INV-2 role-availability gate suppresses class pre-enqueue
  PASS  INV-3 config bridge drives cooldown cadence

ALL CHECKS PASSED

What demo.js shows

  • Tick 0: agent-ana (lead) enqueues team-checkin and one stale-review (despite 7 stale items); agent-bob (member) enqueues deadline-reminder and one stale-review, but no team-checkin (role gate).
  • Tick 1 (+2 min): stale items unchanged, but the stale-review class is dropped by the per-action-type cooldown for both agents — no duplicate spam.
  • Tick 2 (+5 h): the 4 h stale-review cooldown has elapsed, so a fresh stale-review is permitted again.

Note on scope

This implementation deliberately stubs the downstream "cognitive loop" and the model invocation. The point is to demonstrate the control structure — the single-pass multi-source scan plus the two gates plus the class-level cooldown — which is the subject of the publication. It is not a complete agent runtime.


Copyright 2026 Gus IT LLC (Florida, USA). Licensed under AGPL-3.0-or-later.