Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions demos/killer-demo/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,45 @@ h1 {
.proof-card h3 { margin: 0 0 8px; }
.proof-card p, .proof-card li { color: var(--muted); font-size: 12px; line-height: 1.55; }
.proof-card code { color: #dce6f0; font: 11px var(--mono); }
.pattern { margin: 0 0 42px; }
.snippet {
margin-top: 14px;
border: 1px solid #222d38;
border-radius: 12px;
background: #05080c;
overflow: hidden;
}
.snippet-head {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
padding: 10px 13px;
border-bottom: 1px solid #222d38;
color: var(--muted);
font: 800 9px var(--mono);
letter-spacing: .08em;
}
.snippet-copy { padding: 7px 12px; font-size: 9px; }
.snippet-body {
margin: 0;
max-height: 340px;
overflow: auto;
padding: 13px;
color: #9eabb7;
font: 11px/1.55 var(--mono);
white-space: pre;
scrollbar-width: thin;
}
.snippet-body:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.snippet-status {
min-height: 15px;
margin: 0;
padding: 0 13px 11px;
color: var(--lime);
font: 10px var(--mono);
}
.legacy-contract { display: none; }
.footer {
display: flex;
Expand Down
50 changes: 49 additions & 1 deletion demos/killer-demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
stages: $$('[data-stage]'),
baselineLane: $('[data-lane="baseline"]'),
marginalLane: $('[data-lane="marginal"]'),
copyTrace: $('[data-action="copy-trace"]'),
trace: $("#no-progress-trace"),
copyStatus: $("#copy-status"),
};

function metric(lane, name) {
Expand Down Expand Up @@ -230,6 +233,51 @@
dom.pause.disabled = true;
}

function announceCopy(message) {
if (dom.copyStatus) dom.copyStatus.textContent = message;
}

function copyWithSelection(text) {
const restore = document.activeElement;
const holder = document.createElement("textarea");
holder.value = text;
holder.setAttribute("readonly", "");
holder.setAttribute("aria-hidden", "true");
holder.style.position = "fixed";
holder.style.top = "-1000px";
holder.style.opacity = "0";
document.body.appendChild(holder);
holder.select();
let copied = false;
try {
copied = document.execCommand("copy");
} catch (error) {
copied = false;
}
holder.remove();
if (restore instanceof HTMLElement) restore.focus();
return copied;
}

function copyTrace() {
if (!dom.trace) return;
announceCopy("");
const text = dom.trace.textContent || "";
const copied = () => announceCopy("No-progress trace copied.");
const blocked = () =>
announceCopy("Copy was blocked. Select the trace and copy it manually.");
if (navigator.clipboard && navigator.clipboard.writeText) {
navigator.clipboard.writeText(text).then(copied, () => {
if (copyWithSelection(text)) copied();
else blocked();
});
return;
}
if (copyWithSelection(text)) copied();
else blocked();
}

dom.copyTrace?.addEventListener("click", copyTrace);
dom.run?.addEventListener("click", playRace);
dom.pause?.addEventListener("click", pauseRace);
dom.step?.addEventListener("click", () => {
Expand All @@ -244,7 +292,7 @@

document.addEventListener("keydown", (event) => {
const tag = document.activeElement?.tagName || "";
if (["INPUT", "SELECT", "TEXTAREA", "BUTTON"].includes(tag)) return;
if (["INPUT", "SELECT", "TEXTAREA", "BUTTON", "PRE"].includes(tag)) return;
if (event.code === "Space") {
event.preventDefault();
state.playing ? pauseRace() : playRace();
Expand Down
57 changes: 57 additions & 0 deletions demos/killer-demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
<nav class="navlinks" aria-label="Killer Demo navigation">
<a href="#race">Race</a>
<a href="#proof">Proof</a>
<a href="#no-progress">Pattern</a>
<a href="trace.jsonl">Trace</a>
<a href="https://github.com/SignalLayerLabs/Marginal">GitHub ↗</a>
</nav>
Expand Down Expand Up @@ -227,6 +228,62 @@ <h3>Deterministic replay. No fake telemetry.</h3>
</article>
</section>

<section class="pattern" id="no-progress">
<article class="proof-card">
<span class="eyebrow">QUOTABLE MECHANISM · ILLUSTRATIVE</span>
<h3>The no-progress pattern, in four lines.</h3>
<p>
Same semantic action, successful outcome, unchanged workspace state, no new evidence.
That is the sequence MARGINAL treats as a no-progress repetition candidate. The trace
below is replayed from the shipped control over a fixed synthetic observation
sequence, so it is an illustration of the mechanism and not provider telemetry,
a production run, or an enforcement benchmark.
</p>
<div class="snippet">
<div class="snippet-head">
<span>no-progress-trace.txt</span>
<button
class="control snippet-copy"
type="button"
data-action="copy-trace"
aria-describedby="copy-status"
>COPY TRACE</button>
</div>
<pre
class="snippet-body"
id="no-progress-trace"
tabindex="0"
role="region"
aria-label="Illustrative no-progress trace"
># MARGINAL no-progress pattern
# illustrative deterministic sequence, replayed from the shipped control
# not provider telemetry, not an enforcement benchmark
# threshold: max_same_evidence_completions=2

t1 patch:apply outcome=success state=w#4f2a evidence=e#91c0 -&gt; NO_PROGRESS_CLEAR
state or completion evidence changed
t2 verify:targeted outcome=success state=w#8b13 evidence=e#2d77 -&gt; NO_PROGRESS_CLEAR
state or completion evidence changed
t3 verify:targeted outcome=success state=w#8b13 evidence=e#2d77 -&gt; NO_PROGRESS_OBSERVED
unchanged completion evidence remains below the stop threshold
t4 verify:targeted outcome=success state=w#8b13 evidence=e#2d77 -&gt; NO_PROGRESS_ENFORCEMENT_ELIGIBLE
successful completions repeated without state or evidence change

Shadow Mode records the stop recommendation; the action still executes.
Earned Enforcement is separate. It requires an adapter with real blocking
capability and sufficient local evidence, and this
illustration grants none of it.
</pre>
<p class="snippet-status" id="copy-status" role="status" aria-live="polite"></p>
</div>
<p>
Shadow Mode records that recommendation and still lets the action execute. Earned
Enforcement is a separate authority that an adapter has to earn from local evidence,
and nothing on this page grants it.
</p>
</article>
</section>

<div class="legacy-contract" aria-hidden="true">
<span>MARGINAL Killer Demo</span>
<span>Same verified outcome. Far fewer tokens, lower cost, lower latency.</span>
Expand Down
Binary file modified plugins/marginal/runtime/marginal_runtime.pyz
Binary file not shown.
2 changes: 1 addition & 1 deletion plugins/marginal/runtime/provenance.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"builder":"scripts/build_codex_plugin.py","python_requires":">=3.10","schema_version":1,"sha256":"da07e5b564960dbd288e8d39ada481f9549101b0a9ca6629c88033f0e8d908b7","source_hash":"3d55fcb9c1021ebf424f0363f4c69a3574191b572844cd4b075f19b22cf77545"}
{"builder":"scripts/build_codex_plugin.py","python_requires":">=3.10","schema_version":1,"sha256":"b39f7844b1284e2d7dde4223e1fd5f54d194afc39d8ff85c2b7c1c3f2ac8c0b2","source_hash":"033cdfa97274975b3814519313f82c3aee356dcd510ad3cf717b9fe4063ade22"}
Loading
Loading