Formal-State-Augmented Language Models
This browser-only, scripted demonstration implements the quota-and-permission reference monitor. You supply candidate JSON proposals; a separate JavaScript function checks and commits them. No language model is contacted and no Python server is required.
1 · Initialize example state
0 ≤ quota ≤ 3Guard: a reader can only propose 0. A writer may propose −1, 0, or +1, but only a valid successor is committed.
2 · Submit a proposal
{"delta":-1}, {"delta":0}, or {"delta":1}. Invalid JSON or unsupported types are rejected.3 · State and lossy rendering
Current role: writer. The illustrative model-visible rendering r(q,p)=min(q,2) omits the role and merges quota values 2 and 3. The monitor reads the full state, not the rendering.
Audit version: 0
4 · Rendering counterexamples
Load either of two states and submit the same {"delta":1} proposal to observe different admissibility despite identical rendered quota.
Both render to 2; the first is accepted and the second rejected. Similarly, (1, reader) and (1, writer) both render to 1, but have different permissions.
5 · Ordered audit trail
| # | Before | Action | Decision | Reason | After |
|---|
No proposals yet.
6 · Run browser-only semantics tests
Run exhaustive checks of the eight valid initial states with three actions, all 1,944 length-five proposal traces, strict parser edge cases, rendering collisions, audit ordering, and stale-version rejection. The suite tests this browser implementation; cross-language differential testing is supplied separately in the verification report.
Scope and limitations: This HTML file is a faithful educational implementation of the paper's finite quota monitor, not a connected-model experiment, a tamper-resistant authority boundary, or a proof of implementation correctness. Browser users can inspect and modify local code/state through developer tools. The paper's non-bypassability assumption would require a separately enforced execution boundary in a deployed system. No network calls, credentials, or additional hosting are involved.