MathSphere Nexus
A shared machine should know whose work is whose — without accounts, passwords, or anything for the added people to download. The design's floor layer is three small things:
1. An author field on every creation. When a project is created, it carries its name, its classification, and its author — written into the record at that moment.
2. A receipt chain underneath everything. Every act — a creation, an archive, a deletion — is appended to a hash-chained log. The log is the user log: read it by author, and you see who made what, and when.
3. Deletion rights with edges. A user may delete their own chats, and nothing else on their own. Projects never delete on their own — a project is removed only by the machine owner's deliberate act, and the creator's work is exported first. Chats, and only chats, also live under a lifecycle: past a set count they are archived, and past a further count the oldest archives are deleted — every step receipted.
The prototype implements exactly that, in one standard-library Python file (172 lines), so the design can be tested instead of merely described.
Every record carries the hash of the record before it. Change any earlier record — an author line, a date, anything — and verification fails, because the hashes no longer line up. That is what makes the record tamper-evident rather than merely stored:
def append(self, kind, **fields):
rec = {"seq": len(self.records) + 1, "ts": time.time(), "kind": kind}
rec.update(fields)
rec["prev"] = self.records[-1]["hash"] if self.records else "GENESIS"
rec["hash"] = _digest(dict(rec))
self.records.append(rec)
with self.path.open("a") as f:
f.write(json.dumps(rec) + "\n")
return rec
def verify(self):
prev = "GENESIS"
for i, rec in enumerate(self.records, 1):
if rec["seq"] != i or rec["prev"] != prev:
return False
body = {k: v for k, v in rec.items() if k != "hash"}
if _digest(body) != rec["hash"]:
return False
prev = rec["hash"]
return True
Creation writes three lines and receipts them in the same motion — the author is part of the record from birth, not a label stuck on later:
def create_project(self, name, classification, author):
if name in self.projects:
raise ValueError(f"project already exists: {name}")
self.projects[name] = {
"name": name,
"classification": classification,
"author": author,
}
self.chain.append(
"project_created", project=name,
classification=classification, author=author,
)
self._save()
return self.projects[name]
The user log needs no machinery of its own: it is this chain, filtered — by author, by project — and the authors summary is a count over the same records.
When a new chat arrives, the author's chats roll: the oldest active chats are archived past the active cap, and the oldest archived are deleted past the archive cap. Projects are never touched by this code path — there is no call in it that can reach a project:
def _lifecycle(self, author):
"""Chats only: roll active -> archived -> deleted past the caps."""
mine = [c for c in self.chats.values() if c["author"] == author]
active = [c for c in mine if c["state"] == "active"]
archived = [c for c in mine if c["state"] == "archived"]
while len(active) > self.active_cap:
oldest = active.pop(0)
oldest["state"] = "archived"
archived.append(oldest)
self.chain.append("chat_archived", chat=oldest["id"], author=author)
while len(archived) > self.archive_cap:
oldest = archived.pop(0)
del self.chats[oldest["id"]]
self.chain.append(
"chat_deleted", chat=oldest["id"], author=author, via="lifecycle")
In the prototype's tests the caps are set tiny — 3 active, 2 archived — so the roll is visible in a short run. In the design, the caps are settings.
Two functions carry the whole policy. Deleting a chat requires the double-ask and requires that the deleter be the chat's own author:
def delete_chat(self, chat_id, by, double_asked=False):
"""The one deletion a user holds on their own: their own chats.
Destructive: the double-ask is a call contract — no double-ask, no deletion."""
if not double_asked:
raise RuntimeError("double-ask required before deletion")
chat = self.chats[chat_id]
if chat["author"] != by:
raise PermissionError("a user deletes only their own chats")
del self.chats[chat_id]
self.chain.append(
"chat_deleted", chat=chat_id, author=chat["author"], by=by,
via="chat_owner")
self._save()
Deleting a project requires the double-ask, the owner's act, and produces the creator's export before anything is removed:
def delete_project(self, name, by, owner=False, export_dir=None,
double_asked=False):
"""Existence rule: only the owner's act deletes a project, export first.
Destructive: both the double-ask and the export destination are call
contracts — no double-ask, no deletion; no export, no deletion.
(Export boundary sealed 2026-11-13: review catch by GM — with
export_dir optional, an owner caller could delete with no export
at all and the receipt recorded it quietly.)"""
if not double_asked:
raise RuntimeError("double-ask required before deletion")
if not owner:
raise PermissionError("a project is deleted only by the owner's act")
if not export_dir:
raise ValueError(
"export directory required before project deletion"
" — no export, no delete")
proj = self.projects[name]
export_file = Path(export_dir) / f"{name}-export.json"
export_file.write_text(json.dumps(proj, indent=1))
del self.projects[name]
self.chain.append(
"project_deleted", project=name, author=proj["author"], by=by,
export=str(export_file),
)
self._save()
return export_file
The double-ask appears here as a call contract: a library cannot ask a person questions at a terminal, so the prototype enforces the shape — a deletion that does not arrive double-asked is refused outright. In the real build, the terminal asks the person twice; the contract underneath is this one.
Hardened in review, the same day. As first built, the export destination was an optional argument — and an owner caller who simply omitted it deleted the project with no export at all, the receipt quietly recording the absence. The invariant was stated in prose and tested on the path taken, but not enforced at the boundary. Review by GM caught it (November 13, 2026); the boundary was sealed the same day — the export destination is now a call contract like the double-ask: no export, no deletion — and two checks were added for exactly that refusal. The second run in the Terminal Record below is the proof.
The prototype's test file runs every feature live. Result on November 13, 2026: 21 checks, all passing (19 in the first run; two added the same day when the export boundary was sealed — see the Terminal Record).
The dated terminal proof of the run above — the actual output, unedited — followed by its parse: how to use everything that was tested and proved.
$ date Friday, November 13, 2026 — 17:39 PST $ python3 test_creations_prototype.py ok - author field on creation ok - search by author ok - authors summary ok - cross-user chat delete refused ok - chat delete without double-ask refused ok - own chat deleted ok - non-owner project delete refused ok - project delete without double-ask refused ok - project survives refused delete ok - lifecycle caps hold ok - lifecycle steps receipted ok - projects exempt from lifecycle ok - export produced before delete ok - export carries the author's work ok - project deleted by owner act ok - log by author ok - log by project ok - chain verifies ok - tamper detected all 19 checks passed
The second run — after the export boundary was sealed (November 13, 2026). The first record above stands as it ran; nothing in it was rewritten. The same evening, after review, the prototype was hardened and re-run in full:
$ date Friday, November 13, 2026 — 22:59 PST $ python3 test_creations_prototype.py ok - author field on creation ok - search by author ok - authors summary ok - cross-user chat delete refused ok - chat delete without double-ask refused ok - own chat deleted ok - non-owner project delete refused ok - project delete without double-ask refused ok - project survives refused delete ok - project delete without export_dir refused ok - project survives refused delete (no export) ok - lifecycle caps hold ok - lifecycle steps receipted ok - projects exempt from lifecycle ok - export produced before delete ok - export carries the author's work ok - project deleted by owner act ok - log by author ok - log by project ok - chain verifies ok - tamper detected all 21 checks passed
The two new lines prove the sealed boundary: a project deletion attempted with the owner flag and the double-ask but no export destination is refused (project delete without export_dir refused), and the project is still there afterward (project survives refused delete (no export)).
The parse — how each proved thing is used. To create with an author line, a project is created with three values — name, classification, author — and the receipt is written in the same motion (proved by author field on creation). To find a person's work, search by author, or read the log filtered by author or by project (search by author, log by author, log by project); to see everyone on the machine, take the authors summary. To delete a chat, its own author asks twice and calls the deletion — anyone else is refused, and a call without the double-ask is refused (cross-user chat delete refused, chat delete without double-ask refused, own chat deleted). To remove a project, only the owner calls it, double-asked, and an export file lands before the project does (non-owner project delete refused, export produced before delete, project deleted by owner act). To run the lifecycle, nothing is called at all: creating chats past the caps rolls the oldest through archive and deletion on its own, receipted at each step, and never touches a project (lifecycle caps hold, lifecycle steps receipted, projects exempt from lifecycle). To check the record itself, verification walks the chain (chain verifies) — and catches any later edit (tamper detected).
Receipts, hash-chained — every act above is receipted, and the chain verifies. Double-ask on destructive acts — enforced as the call contract shown above. Standard library only — the prototype imports nothing outside Python's standard library. Demo discipline — this page is the documentation half; the test file is the live half.
Honesty about scope: the prototype proves the floor's shape — authorship, the log, the lifecycle, the deletion rights — in miniature, with toy caps and plain files. It does not contain the hub layer (sign-ins, project passwords), the gate, or the broker; those are later prototypes in the roadmap's order. And an author line is a claim, not an authentication: on a trusted machine that is the design's deliberate trade — what the chain proves is that the record was not rewritten afterward.
A command is what you type. The name is what the project is.
On Saturday, November 14, 2026, the owner ran all four prototypes together on his own machine — one runner, four suites. This prototype’s verdict in that run:
all 21 checks passed
and the run’s summary closed: All four prototypes pass house.