@dreamforgestudiollc/emet 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +18 -1
- package/CHANGELOG.md +42 -12
- package/CHARTER.md +2 -2
- package/CONTRIBUTING.md +21 -0
- package/README.md +25 -14
- package/RELEASE_NOTES-0.2.6.md +43 -0
- package/RELEASE_NOTES-0.3.6.md +29 -0
- package/SECURITY.md +13 -0
- package/docs/BOTS.md +3 -3
- package/docs/DEPLOY.md +53 -14
- package/docs/ERROR-CODES-SPEC.md +1 -1
- package/docs/ERROR-CODES.md +1 -0
- package/docs/GUIDED-SETUP.md +1 -1
- package/docs/ROADMAP.md +62 -49
- package/docs/SETUP.md +30 -7
- package/package.json +5 -2
- package/server.json +2 -2
- package/src/annotations.js +1 -0
- package/src/attribution.js +9 -9
- package/src/bound-door.js +75 -42
- package/src/break-glass.js +7 -1
- package/src/carry-forward-close.js +1 -1
- package/src/chooser.js +15 -8
- package/src/claimed-tag.js +1 -1
- package/src/database.js +1 -1
- package/src/dispatch.js +2 -2
- package/src/error-codes.js +1 -0
- package/src/error-report.js +1 -1
- package/src/gem-check.js +4 -1
- package/src/grants.js +29 -6
- package/src/host-reach.js +1 -1
- package/src/http-remote.js +18 -8
- package/src/index.js +2 -2
- package/src/invites.js +2 -2
- package/src/owl.js +18 -18
- package/src/owner-approvals.js +1 -1
- package/src/proof-run.js +2 -2
- package/src/rotate.js +1 -1
- package/src/session-graph.js +5 -5
- package/src/session.js +2 -2
- package/src/setup.js +14 -10
- package/src/subkeys.js +4 -1
- package/src/tools.js +29 -28
- package/src/transcript-session.js +2 -2
- package/src/version.js +1 -1
- package/src/writer-approval.js +11 -6
- package/templates/SESSIONDISPOSITION.md +2 -2
- package/verification/load-gate/load-gate.mjs +1 -1
package/docs/GUIDED-SETUP.md
CHANGED
|
@@ -243,7 +243,7 @@ railway init # from the repo root; name it emet
|
|
|
243
243
|
railway variables --set MONGODB_URI=<from .env> --set MONGODB_DB=emet \
|
|
244
244
|
--set EMET_OAUTH_PASSPHRASE=<generated passphrase> --set EMET_SOURCE_TAGS=<every host's tag, e.g. laptop,phone>
|
|
245
245
|
railway up --detach
|
|
246
|
-
railway domain # prints https
|
|
246
|
+
railway domain # prints the public https origin
|
|
247
247
|
railway variables --set PUBLIC_URL=https://<that host>
|
|
248
248
|
railway up --detach # second pass: PUBLIC_URL is the OAuth issuer and must match
|
|
249
249
|
```
|
package/docs/ROADMAP.md
CHANGED
|
@@ -1,63 +1,76 @@
|
|
|
1
1
|
# EMET — Next Steps and Proposed Features
|
|
2
2
|
|
|
3
|
-
Status as of 2026-
|
|
3
|
+
Status as of 2026-11-11. This is a working roadmap, not a commitment. Nothing here is built unless it says so. Items move only when the owner rules on them. Each unbuilt item still has to answer the four questions in charter commitment 6 before any code is written.
|
|
4
|
+
|
|
5
|
+
EMET stays **one shared server** with verified per-client attribution. One collaborative project is one instance: one database, one deploy, one owner connect secret. There is no fork to keep in sync, and core memory work is not a GEM. Live chat stays out of EMET. The focus is document control (ISO 9001 7.5.3 / ISO 13485 4.2.5). EMET holds no certification and claims no conformity.
|
|
4
6
|
|
|
5
7
|
## Where things stand
|
|
6
8
|
|
|
7
|
-
- **Live:**
|
|
8
|
-
- **The
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
- **
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
- **
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
9
|
+
- **Live:** the public site and the npm package `@dreamforgestudiollc/emet` are published. Version 0.3.6 is this repository. 38 tools (15 read-only); `EMET_SUBKEYS=1` adds four sub-key tools. Topic pages shipped in 0.3.0: `emet_page`, `emet_pages`, and `emet_page_lint`. Layer writes and reads are native to MongoDB. Server-side checks run on session start and close. Receipts are required at close. The handoff is a record, superseded and never amended.
|
|
10
|
+
- **The extension socket is built.** It is `src/socket.js`. Its note is [gem/README.md](gem/README.md). The standard in this repository is Draft, in [`gem-library/`](../gem-library/README.md). Neurendipity and the other bundled GEMs stay off unless the install names them. A RUNED GEM stays off unless the install names it. The socket serves each RUNE and does not run it. Client-side execution shipped with the socket. A public repository for outside GEM submissions does not exist yet. Its name is not chosen.
|
|
11
|
+
- **The aleph** verifies every write by reading it back before any receipt, and every later read by its digests, signature, and place in its layer's hash chain. `emet_gaps` walks the whole chain for any host.
|
|
12
|
+
- **Guardrails and monorails** ([GUARDRAILS-AND-MONORAILS.md](GUARDRAILS-AND-MONORAILS.md)): the server checks the order of a session's writes. Enforce only since 0.2.1: every skipped step is refused with the way to pass, and every check is stored as a timestamped lab result. There is no report mode and no off switch.
|
|
13
|
+
- **The database** login runs under the least-privilege role `emetRecordKeeper`: it can insert and update, and it cannot remove the record.
|
|
14
|
+
- **Startup load:** `emet_initialize` is served in pages of at most 18,000 bytes as received, so a host that cuts long results short still reads all of it. `page: "all"` returns it whole on a host with no size limit.
|
|
15
|
+
- **Attribution that already ships:** source tags, an owner door (`/owner/chooser`, `/owner/break-glass`), and member and guest access codes bound to source tags. See [SECURITY-AT-SCALE.md](SECURITY-AT-SCALE.md).
|
|
16
|
+
- **Composite retrieval scoring is live.** Recall ranks by how many query words match, then by importance. Current entries come first in every order, including time order. Nothing fades or is down-weighted for age.
|
|
17
|
+
- **Public landing page and npm package (live).** The site in `site/` is published to GitHub Pages, and `@dreamforgestudiollc/emet` is on npm. The 0.3.5 package on npm was published before the wording cleanup in 0.3.6.
|
|
18
|
+
|
|
19
|
+
`emet_page_lint` shipped in 0.3.0 and flags a topic page. It does not edit.
|
|
20
|
+
|
|
21
|
+
## Upcoming work
|
|
22
|
+
|
|
23
|
+
Nothing in this section is a commitment to a date or a design freeze. A status label means:
|
|
24
|
+
|
|
25
|
+
- **Proposed** — design conversation only. Not approved to build. No prototype.
|
|
26
|
+
- **Planned** — the direction is decided, and the public release does not contain it yet.
|
|
27
|
+
- **Later phase** — accepted as future work on this same server, and not scheduled as the next change.
|
|
28
|
+
|
|
29
|
+
### Collaboration workplace
|
|
30
|
+
|
|
31
|
+
- **Workshop Village MCP (Proposed, not built).** A Workshop Village MCP server for bot-team collaboration: a shared workplace where a user's bot teams can be present in the same space, hand work off, and meet on a schedule. It may be built onto EMET, or as a separate MCP server that works with EMET. That choice is not decided. Either way, EMET stays one shared memory server with verified per-client attribution. Workshop Village does not fork EMET, does not replace EMET with a generic memory server, and does not turn core EMET memory work into a GEM. Live collaboration stays in the Village. Durable decisions, records, and "save to memory" writes stay in EMET. Scope, as currently proposed: bot teams, not a wake path for a lone chat instance on another host. The proposed workplace is a real spatial environment (a game-engine core, engine not chosen), rooms where every bot present can hear the speaker, doors and a doorbell when there is no avatar presence, Available / Do Not Disturb, spaces that scale to the people and bots in them, and scheduled meetings. If a complete physics environment is needed later, the engine should be able to support it; it is not assumed to be always on. Bots should experience workplace time. If the Village is ever sold, engine licensing must be compatible with that. A robust open-source engine is preferred when it meets the bar. No engine brand is selected. No prototype, public URL, or connector is approved.
|
|
32
|
+
- **Drawers (Proposed, not built).** Shared project drawers: places to save project files and documents so bot teams can share them, hand them off, and submit them, because users will not have access to each other's workstation files, and may not have a company network drive. A drawer is a shared handoff and submission store, not a personal disk. Optionally, an organization may designate its shared network drive as the storage backend, to reduce database usage. Access control per drawer, and attribution with credential-backed source tags consistent with EMET's per-client attribution, are open design questions and are not decided. Not approved to build.
|
|
33
|
+
- **Shared hive memory, closed as its own item.** An earlier idea of a separate shared hive memory for bots is closed. It is not part of the GEM socket. Bot-team collaboration of that kind is the Workshop Village item above, still Proposed. A bot that shares one EMET still needs its own source tag and scope.
|
|
34
|
+
|
|
35
|
+
### Attribution, handoffs, and who can write
|
|
36
|
+
|
|
37
|
+
- **Per-source-tag handoffs (Planned, not in this public release).** A later public release may add per-AI handoffs keyed to credential-backed source tags. Each writing AI writes only its own handoff (`HANDOFF/<tag>`). The hub keeps the shared `HANDOFF.md` and resolves conflicts. A shared view is computed on read, not stored as a second record. Read-only AIs would use the shared view. Today the public server keeps one shared `HANDOFF.md` and, for bots, `bots/<tag>/HANDOFF.md`. A private build has the later handoff shape behind a flag. That flag is not part of public 0.3.6, and this release does not ship the tools, documents, or settings for it.
|
|
38
|
+
- **Fuller multi-person support on one server (Later phase, not built).** EMET already supports one shared instance with per-client attribution, an owner door, and member and guest access codes bound to source tags. Richer multi-person use of that same server, beyond those doors, is a later phase. The supported model remains one collaborative project, one instance. Many separate EMET instances, or a gateway between them, is a different idea and is not built. See [SECURITY-AT-SCALE.md](SECURITY-AT-SCALE.md).
|
|
39
|
+
- **Source-tag onboarding and further socket extensions (Planned).** Source tags, the owner door, and the bound-host door already ship. Stronger hardening of source-tag onboarding and client attribution is still to be done. The extension socket is built. Additional per-door extensions on that socket are Planned and are not built. A switch that picks a GEM is one of those later pieces. It is not built.
|
|
40
|
+
|
|
41
|
+
### Document control
|
|
42
|
+
|
|
43
|
+
- **Continuity-currency enforcement (Planned, not built).** `emet_initialize` does not yet refuse to run when `HANDOFF.md` or `STATE.md` is stale because a newer record exists. That gate is Planned. Session close can already cite a later continuity record through `carry_forward` (shipped in 0.3.3). That close path is not this initialize gate.
|
|
44
|
+
- **Topic pages with currency and lock levels (Planned).** Topic pages shipped in 0.3.0 as views computed on each request: `emet_page`, `emet_pages`, and `emet_page_lint`. A page is not a stored record. Area selectors can name a staleness window, and lint can flag a stale line. Wiki-style currency and lock levels for controlled documents are not built. Stored compiled pages are not built. If a compiled-page pilot is ever written, it needs its own page subject. It does not revive the closed hive-memory item.
|
|
45
|
+
- **Lint sweep of the semantic layer (Proposed).** The scheduled sweep for contradictions, outdated claims, missing links, and subjects with no page is still proposed. Findings would be reported, never applied automatically. Nothing in EMET fades.
|
|
46
|
+
|
|
47
|
+
### Operations
|
|
48
|
+
|
|
49
|
+
- **Backup, restore verification, and a clone-instance recipe (Planned).** The clone-instance recipe is already documented in [SECURITY-AT-SCALE.md](SECURITY-AT-SCALE.md): a new project is a new database, a new deploy, and a new passphrase. It does not add a tenant to an existing database. Bot-team backup, when the first-run interview records yes, is a written recipe the assistant follows. EMET does not copy prompts or settings itself. A backup and restore verification runbook, and export / import / restore-and-compare, are not built. They are listed in the README known gaps. An instance control plane that only provisions an isolated instance is not built. Charter commitment 6 is not answered for that tool.
|
|
50
|
+
|
|
51
|
+
### Records and reads
|
|
52
|
+
|
|
53
|
+
- **Transcript and history queries, and read-tool input validation (Planned).** `query_transcripts` already reads by time range or session id. `read_doc` already accepts an expected version and an expected digest. Further query improvements and stricter validation of read-tool inputs are Planned and are not a finished change in this release.
|
|
54
|
+
- **Claim-status grading (Proposed).** Extend provenance so every recorded claim carries a status: established, deduced, proposed, still owed, or rejected. Rejected routes stay on the record with the reason they failed.
|
|
55
|
+
- **Index-first retrieval (Proposed).** Score candidates against a one-line-per-item index before opening anything, open only the best match, and follow one link at most.
|
|
56
|
+
|
|
57
|
+
### Still proposed, and not built
|
|
58
|
+
|
|
59
|
+
- **Monorail switches.** Small logic at each junction where a session's flow must fork, tripped only by its condition. Designed, not built. No hosted model and no API. A switch that picks a GEM is the later GEM item below.
|
|
47
60
|
- **Organizational use.** Many private EMETs and a document gateway between them. Nothing built before a named customer.
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
- **Compiled topic pages, pilot (proposed 2026-09-30).** After the LLM-wiki pattern: a document prefix of topic pages compiled from semantic entries. Every claim cites its entry or transcript span; a compiled page never cites another compiled page as evidence; pages are derived, never the source of truth; one compiler role builds pages, others write entries only. No database change. The document store already versions, hashes, signs and checks form. Pilot page: the hive-memory idea. The hive-memory feature is closed as its own item (2026-10-11) and folded into the socket. If this pilot is built, it needs a different page. Nothing added beyond what the pilot needs.
|
|
51
|
-
- **Lint pass over the semantic layer (proposed 2026-09-30).** A scheduled sweep for contradictions between entries, outdated claims a newer entry supersedes, entries that should link and don't, and subjects mentioned often with no compiled page. Findings are reported, never applied automatically; corrections go through supersession. Built after the pilot page, and only once it names its measure. Design inputs from the LLM Wiki v2 review (typed links, multi-agent sync rules, drift invariants, confidence only on top of provenance) are each weighed against commitment 6 before adoption. Its idea of letting entries fade from what surfaces is not taken: nothing in EMET fades.
|
|
52
|
-
- **Advisory judge for team traffic (parked).** A fast external decision model (TypeSafe's Jev was evaluated) could sort traffic and interactions when many people and hosts share one EMET. Never in the write path — no model decides what EMET stores. Not for single-user installs.
|
|
53
|
-
- **Local open-weight model as a host.** A read-only trial of EMET under a locally run model, once the host machine's GPU and RAM are on record.
|
|
61
|
+
- **Advisory judge for team traffic (parked).** A fast external decision model could sort traffic when many people and hosts share one EMET. It would never sit in the write path. Not for single-user installs.
|
|
62
|
+
- **Local open-weight model as a host.** A read-only trial under a locally run model, once the host machine's capacity is on record.
|
|
54
63
|
- **Stranger install.** A clean-machine install by someone who has never seen EMET, to find first-run friction.
|
|
55
64
|
- **Remove Dynamic Client Registration** by 2027-06-01, as MCP moves to client ID metadata documents.
|
|
56
|
-
- **
|
|
65
|
+
- **Later GEM work, not built.** Creator keyring and signature checks, a public GEM submission repository, accepting a library GEM onto the load list, and a monorail switch that picks a GEM. Each waits on its own proposal. The socket itself is built and is not in this list.
|
|
66
|
+
|
|
67
|
+
### How to follow progress and give feedback
|
|
68
|
+
|
|
69
|
+
This file is the public list. It changes in the repository when an item moves. Discussion belongs in [GitHub issues](https://github.com/dreamforgestudiollc/EMET/issues). Open an issue before a pull request for anything beyond a typo. Say which roadmap item you mean, and do not send passphrases, tokens, connection strings, or memory content.
|
|
57
70
|
|
|
58
71
|
## Design commitments these must keep
|
|
59
72
|
|
|
60
73
|
- No model in the write path: EMET stores what the assistant deliberately chose to write.
|
|
61
|
-
- Controls, not reminders
|
|
74
|
+
- Controls, not reminders. A rule that matters is checked by the server.
|
|
62
75
|
- Over-engineering is a defect, and the check comes before the build: nothing is built until it names the failure it fixes, what it replaces, how we will know it worked, and what holds it once it works (charter commitment 6). DMADV while EMET is in design; DMAIC once stable.
|
|
63
76
|
- Correct the record by superseding, never by editing.
|
package/docs/SETUP.md
CHANGED
|
@@ -103,11 +103,12 @@ when you want a second device to reach the same memory.
|
|
|
103
103
|
5. **Pick a database name** and set `MONGODB_DB`. It defaults to `emet`. Collections (`emet_episodic`, `emet_semantic`, …) are
|
|
104
104
|
created on first write — there is nothing to pre-create.
|
|
105
105
|
|
|
106
|
-
6. **One database per EMET instance.**
|
|
107
|
-
`documents_history`
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
6. **One database per EMET instance.** These collections are not prefixed:
|
|
107
|
+
`documents`, `documents_history`, `transcripts`, `exchanges`, `persons`, `invites`,
|
|
108
|
+
`close_attempts`, `error_log`, `error_log_summary`, and `_emet_verify`. Two instances
|
|
109
|
+
pointed at the same database share all of them, even when their memory collections use
|
|
110
|
+
different prefixes. If you want two separate memories, give them separate databases -
|
|
111
|
+
not just separate prefixes.
|
|
111
112
|
|
|
112
113
|
7. **Vector index — only if you want `semantic_recall`.** Keyword search works without it.
|
|
113
114
|
For meaning-based search, create an Atlas Vector Search index named
|
|
@@ -227,8 +228,10 @@ it is.
|
|
|
227
228
|
| `EMET_VECTOR_INDEX` | `cascade_content_auto` | the Atlas Vector Search index `semantic_recall` uses |
|
|
228
229
|
| `EMET_CORPORA` | your corpus names, comma-separated | only if you use `corpus_recall`; leave unset otherwise |
|
|
229
230
|
|
|
230
|
-
`EMET_COLLECTION_PREFIX` also governs the counters collection
|
|
231
|
-
collections
|
|
231
|
+
`EMET_COLLECTION_PREFIX` also governs the counters collection, the three OAuth
|
|
232
|
+
collections (`oauth_clients`, `oauth_codes`, `oauth_tokens`), and `sessions`,
|
|
233
|
+
`subkeys`, `subkeys_history`, `rotations`, `meta`, `doc_stages`, `gem_serves`,
|
|
234
|
+
`writer_approvals`, `owl_retirement`, and `graph_lab`, so **devices you have already authorized stay authorized** - there is no
|
|
232
235
|
re-consent step.
|
|
233
236
|
|
|
234
237
|
Your old `CASCADE_SOURCE_TAG` and `CASCADE_OAUTH_PASSPHRASE` continue to work; the `EMET_`
|
|
@@ -248,6 +251,26 @@ it should come back `ready` with your existing identity, not `setup_required`. I
|
|
|
248
251
|
`setup_required`, one of the four variables above is wrong; **do not run the setup interview,
|
|
249
252
|
which would write a new identity over your existing one.**
|
|
250
253
|
|
|
254
|
+
## Upgrading to 0.3.6
|
|
255
|
+
|
|
256
|
+
0.3.6 is a docs and wording release. Stored data shapes are unchanged. No new setting. Deploy over 0.3.5 as is. The public roadmap's Upcoming work section is not built unless it says so.
|
|
257
|
+
|
|
258
|
+
ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
259
|
+
|
|
260
|
+
## Upgrading to 0.3.5
|
|
261
|
+
|
|
262
|
+
0.3.5 brings the public docs current. Stored data shapes are unchanged. The bound door's tag is `bound-host`. Writes from a stored legacy token or sub-key are stamped `bound-host`. The alias covers stored data only. The previous spelling is refused for a new consent, a new sub-key request, a new writer request, a new member or guest code, a new setup source, a chooser decision, and a break-glass reissue.
|
|
263
|
+
|
|
264
|
+
ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
265
|
+
|
|
266
|
+
## Upgrading to 0.3.4
|
|
267
|
+
|
|
268
|
+
0.3.3 and 0.3.4 leave stored data shapes as they were in 0.3.2. Deploy over 0.3.2 or 0.3.3 as is.
|
|
269
|
+
|
|
270
|
+
From 0.3.4, `EMET-MEM-018` is checked on the append that opens a transcript, and on an append that would become the lowest stored index. Send the measured machine line on that first append, or the words `no local shell MCP`. A refused exchange 1 does not let a higher index start the transcript. With no machine table in the install notes, the check stays not enforced.
|
|
271
|
+
|
|
272
|
+
ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
273
|
+
|
|
251
274
|
## Upgrading to 0.3.2
|
|
252
275
|
|
|
253
276
|
0.3.2 adds door grants, the owner chooser, household rotation, and writer approval. An existing store keeps its records. After you deploy:
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamforgestudiollc/emet",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control memory for AI agents. Nothing is deleted. EMET 0.3.
|
|
3
|
+
"version": "0.3.6",
|
|
4
|
+
"description": "ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control memory for AI agents. Nothing is deleted. EMET 0.3.6 — Enduring Memory & Epistemic Tiers. An MCP memory server with persistent shared memory for AI agents, bot teams and chats: layered memory, verified writes, a verbatim transcript tier, per-client attribution and approvals, and client-side GEM execution. EMET verifies the record, not the computation. A GEM is seated only when its released flag is true. Every error carries a stable code; the owner-only emet_error_report returns a report and an email draft the user sends. npm run verify drives the registered tools from a checkout, and docs/features is the map of every feature.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-memory",
|
|
7
7
|
"ai-agents",
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
"docs/*.md",
|
|
49
49
|
"CHARTER.md",
|
|
50
50
|
"CHANGELOG.md",
|
|
51
|
+
"RELEASE_NOTES*.md",
|
|
52
|
+
"SECURITY.md",
|
|
53
|
+
"CONTRIBUTING.md",
|
|
51
54
|
"server.json",
|
|
52
55
|
".env.example",
|
|
53
56
|
"README.md",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.dreamforgestudiollc/emet",
|
|
4
4
|
"title": "EMET",
|
|
5
5
|
"description": "ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control memory for AI agents. Nothing is deleted.",
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.6",
|
|
7
7
|
"websiteUrl": "https://dreamforgestudiollc.github.io/EMET/",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/dreamforgestudiollc/EMET",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"registryType": "npm",
|
|
23
23
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
24
24
|
"identifier": "@dreamforgestudiollc/emet",
|
|
25
|
-
"version": "0.3.
|
|
25
|
+
"version": "0.3.6",
|
|
26
26
|
"transport": {
|
|
27
27
|
"type": "stdio"
|
|
28
28
|
},
|
package/src/annotations.js
CHANGED
|
@@ -132,6 +132,7 @@ const ANNOTATION_TABLE = {
|
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
function subkeyAnnotationsHidden() {
|
|
135
|
+
// CASCADE_SUBKEYS is a legacy environment name. EMET_SUBKEYS is the name to set.
|
|
135
136
|
return process.env.EMET_SUBKEYS !== '1' && process.env.CASCADE_SUBKEYS !== '1';
|
|
136
137
|
}
|
|
137
138
|
|
package/src/attribution.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* stamped with (source_basis "declared", source_login = the login's tag),
|
|
10
10
|
* but a declared tag never gains rights beyond the login's tag (A3): every
|
|
11
11
|
* guard is run for BOTH tags and the write must pass both (rightsTags()).
|
|
12
|
-
*
|
|
12
|
+
* bound-host on the token bound to hub-bot is not that
|
|
13
13
|
* claim: it is refused (BOUND's own door). A credential row (basis
|
|
14
14
|
* "credential") is not a remembered tag for the shared client.
|
|
15
15
|
*
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* (transcript parts, documents, layer entries): if those rows carry another
|
|
33
33
|
* tag, the write is refused.
|
|
34
34
|
*
|
|
35
|
-
* OWNER (A2). Live owner tokens carry the owner's person id
|
|
35
|
+
* OWNER (A2). Live owner tokens carry the owner's person id;
|
|
36
36
|
* older ones carry "owner" or nothing. All three are the owner.
|
|
37
37
|
*/
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ import { setting } from './env.js';
|
|
|
40
40
|
import { chooserBinding } from './deep-links.js';
|
|
41
41
|
import { isOwlIdentity } from './owl.js';
|
|
42
42
|
import { isMasterBlasterActor } from './writer-approval.js';
|
|
43
|
-
import {
|
|
43
|
+
import { isBoundHostCredential, isBoundHostTag, boundHostClaimOnSharedLogin, BOUND_LOGIN_MESSAGE, CLAIM_TAG, MB_TAG } from './bound-door.js';
|
|
44
44
|
|
|
45
45
|
export const APPROVALS_DOC = 'emet/CLIENT_APPROVALS.md';
|
|
46
46
|
export const WRITE_TOOLS = new Set([
|
|
@@ -350,7 +350,7 @@ export async function preflight(ctx, actor, args, toolName) {
|
|
|
350
350
|
if (foreign) throw refusal(`source "${actor.subkeyTag}" is bound to another person's login, so this session may not write under it. Pass your own tag. Nothing was written.`);
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
if (STRICT_TAG_TOOLS.has(toolName) &&
|
|
353
|
+
if (STRICT_TAG_TOOLS.has(toolName) && boundHostClaimOnSharedLogin(actor, declared)) {
|
|
354
354
|
const denied = refusal(
|
|
355
355
|
BOUND_LOGIN_MESSAGE,
|
|
356
356
|
chooserBinding({ kind: 'onboarding_required', grantId: actor.grantId, tag: CLAIM_TAG, door: 'member' })
|
|
@@ -413,8 +413,8 @@ export async function preflight(ctx, actor, args, toolName) {
|
|
|
413
413
|
const keptAuto = !declared && !bound && remembered.length === 1 ? remembered[0] : null;
|
|
414
414
|
let effective = declared || bound || keptAuto || (actor.clientId && actor.clientId !== 'http:visitor' ? autoTag(actor.clientId) : null);
|
|
415
415
|
let basis = declared && declared !== bound ? 'declared' : (bound ? 'login' : (keptAuto ? 'remembered' : (effective ? 'auto' : null)));
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
416
|
+
const boundHostDoor = isBoundHostCredential(actor) && (!declared || isBoundHostTag(declared) || declared === MB_TAG);
|
|
417
|
+
if (boundHostDoor) {
|
|
418
418
|
effective = CLAIM_TAG;
|
|
419
419
|
basis = 'credential';
|
|
420
420
|
}
|
|
@@ -425,7 +425,7 @@ export async function preflight(ctx, actor, args, toolName) {
|
|
|
425
425
|
|
|
426
426
|
// New-client gate (the owner 2026-10-12). Bound tags were approved at consent;
|
|
427
427
|
// registered tags by the owner's env. Everything else needs the record.
|
|
428
|
-
if (!
|
|
428
|
+
if (!boundHostDoor && deps && effective && basis !== 'login' && basis !== 'credential' && !registry.includes(effective)) {
|
|
429
429
|
const cur = await loadApprovals(deps);
|
|
430
430
|
if (cur.broken) {
|
|
431
431
|
actor.approvalState = 'unreadable';
|
|
@@ -537,10 +537,10 @@ export async function clientApprove(deps, actor, ownerId, { tag, decision, reaso
|
|
|
537
537
|
if (!(ownerOk || cosOk)) throw refusal(`emet_client_approve: only the owner${cosTag() ? ` or the chief of staff (${cosTag()})` : ''} may decide new clients. Nothing was changed.`);
|
|
538
538
|
if (isOwlIdentity(actor)) throw refusal('emet_client_approve: the owl MCP clone account was retired by R6 and cannot approve. the owner decides a new writer on /owner/chooser. Nothing was changed.');
|
|
539
539
|
if (decision === 'approve' && isMasterBlasterActor(actor) && !(actor && actor.ownerSession === true)) {
|
|
540
|
-
throw refusal('emet_client_approve: an AI cannot grant a writer.
|
|
540
|
+
throw refusal('emet_client_approve: an AI cannot grant a writer. The hub login prepares a request. the owner decides it on /owner/chooser. Nothing was changed.');
|
|
541
541
|
}
|
|
542
542
|
if (decision === 'approve' && cosOk && !(actor && actor.ownerSession === true)) {
|
|
543
|
-
throw refusal('emet_client_approve: an AI cannot grant a writer.
|
|
543
|
+
throw refusal('emet_client_approve: an AI cannot grant a writer. The hub login prepares a request. the owner decides it on /owner/chooser. Nothing was changed.');
|
|
544
544
|
}
|
|
545
545
|
if (setting('SUBKEYS') === '1') {
|
|
546
546
|
const { decideSubkeyIfPending } = await import('./subkeys.js');
|
package/src/bound-door.js
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BOUND's door (init audit items 3 and 5, 2026-10-27).
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* is bound to hub-bot. A
|
|
4
|
+
* bound-host is a host tag. It is not a declared claim on the hub login's
|
|
5
|
+
* token that shares OAuth client bound-login-client. That token
|
|
6
|
+
* is bound to hub-bot. A bound-host claim on it is refused
|
|
7
7
|
* and is not stamped hub-bot.
|
|
8
8
|
*
|
|
9
|
-
* A credential is the token's own source_tag
|
|
10
|
-
* a legacy token with no door) or a sub-key whose tag is
|
|
9
|
+
* A credential is the token's own source_tag bound-host (member, owner, or
|
|
10
|
+
* a legacy token with no door) or a sub-key whose tag is bound-host. Guest
|
|
11
11
|
* is not a writer credential. One EMET server. No second instance.
|
|
12
12
|
*
|
|
13
|
-
* The approvals row lists that credential. It does not remember
|
|
13
|
+
* The approvals row lists that credential. It does not remember bound-host
|
|
14
14
|
* onto the shared client, so the claim path stays closed. CI does not mint a
|
|
15
15
|
* live key and does not approve a production client.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import crypto from 'node:crypto';
|
|
18
19
|
import { rawActor } from './persons.js';
|
|
19
20
|
import { chooserBinding } from './deep-links.js';
|
|
20
21
|
import { ValidationError } from './validation.js';
|
|
21
22
|
|
|
22
|
-
export const CLAIM_TAG = '
|
|
23
|
+
export const CLAIM_TAG = 'bound-host';
|
|
24
|
+
/** First 16 hex of sha256(the exact 0.3.4 bound-door tag). The spelling stays out of this file. */
|
|
25
|
+
export const LEGACY_CLAIM_TAG_DIGEST = '43897607a89a6b2e';
|
|
23
26
|
/** Same string as writer-approval.js MB_TAG. */
|
|
24
27
|
export const MB_TAG = 'hub-bot';
|
|
25
28
|
export const SHARED_GROK_CLIENT = 'bound-login-client';
|
|
26
|
-
export const EPISODIC_697_ID = 697;
|
|
27
29
|
export const CORRECTION_NOTE_DATE = '2026-10-27';
|
|
28
30
|
|
|
29
31
|
export const BOUND_LOGIN_MESSAGE =
|
|
@@ -34,39 +36,68 @@ export const BOUND_LOGIN_MESSAGE =
|
|
|
34
36
|
* Guest is not a writer credential. A declared tag does not remove a login
|
|
35
37
|
* credential and is not itself a credential.
|
|
36
38
|
*/
|
|
37
|
-
export function
|
|
39
|
+
export function boundHostTagDigest(tag) {
|
|
40
|
+
return crypto.createHash('sha256').update(String(tag).trim()).digest('hex').slice(0, 16);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Current `bound-host`, or the exact 0.3.4 spelling still stored on a token, approval row, writer request, or sub-key. A different case is not that door. */
|
|
44
|
+
export function isBoundHostTag(tag) {
|
|
45
|
+
if (typeof tag !== 'string') return false;
|
|
46
|
+
const text = tag.trim();
|
|
47
|
+
if (!text) return false;
|
|
48
|
+
if (text === CLAIM_TAG) return true;
|
|
49
|
+
return boundHostTagDigest(text) === LEGACY_CLAIM_TAG_DIGEST;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** The stored 0.3.4 spelling. A newly chosen consent, sub-key, or writer request must not use it. */
|
|
53
|
+
export function isLegacyBoundHostSpelling(tag) {
|
|
54
|
+
if (typeof tag !== 'string') return false;
|
|
55
|
+
const text = tag.trim();
|
|
56
|
+
return text !== CLAIM_TAG && isBoundHostTag(text);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function boundHostMapKey(map) {
|
|
60
|
+
if (!map || typeof map !== 'object') return null;
|
|
61
|
+
if (Object.prototype.hasOwnProperty.call(map, CLAIM_TAG)) return CLAIM_TAG;
|
|
62
|
+
for (const key of Object.keys(map)) {
|
|
63
|
+
if (isBoundHostTag(key)) return key;
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function isBoundHostCredential(actor) {
|
|
38
69
|
if (!actor || actor.transport !== 'http' || actor.authenticated !== true) return false;
|
|
39
70
|
if (actor.door === 'guest') return false;
|
|
40
|
-
if (actor.subkeySession === true && actor.subkeyTag
|
|
71
|
+
if (actor.subkeySession === true && isBoundHostTag(actor.subkeyTag)) return true;
|
|
41
72
|
const login = typeof actor.sourceTag === 'string' ? actor.sourceTag.trim() : '';
|
|
42
|
-
if (login
|
|
73
|
+
if (!isBoundHostTag(login)) return false;
|
|
43
74
|
return actor.door === 'member' || actor.door === 'owner' || actor.door == null;
|
|
44
75
|
}
|
|
45
76
|
|
|
46
77
|
/**
|
|
47
|
-
* The shared Grok client, bound to
|
|
78
|
+
* The shared Grok client, bound to the hub login, claiming bound-host.
|
|
48
79
|
* A BOUND credential is not this claim. Only the caller string counts, so a
|
|
49
80
|
* tag left on a reused actor object cannot refuse a later write that names
|
|
50
81
|
* no source.
|
|
51
82
|
*/
|
|
52
|
-
export function
|
|
83
|
+
export function boundHostClaimOnSharedLogin(actor, callerTag) {
|
|
53
84
|
if (!actor || actor.transport !== 'http' || actor.authenticated !== true) return false;
|
|
54
85
|
if (actor.clientId !== SHARED_GROK_CLIENT) return false;
|
|
55
86
|
const bound = typeof actor.sourceTag === 'string' ? actor.sourceTag.trim() : '';
|
|
56
87
|
if (bound !== MB_TAG) return false;
|
|
57
|
-
if (
|
|
88
|
+
if (isBoundHostCredential(actor)) return false;
|
|
58
89
|
const declared = typeof callerTag === 'string' ? callerTag.trim() : '';
|
|
59
|
-
return declared
|
|
90
|
+
return isBoundHostTag(declared);
|
|
60
91
|
}
|
|
61
92
|
|
|
62
|
-
/** Stamp
|
|
63
|
-
export function
|
|
64
|
-
if (!
|
|
93
|
+
/** Stamp bound-host when the credential's caller is empty, itself, or the hub login. */
|
|
94
|
+
export function boundHostCredentialOverrides(actor, callerTag) {
|
|
95
|
+
if (!isBoundHostCredential(actor)) return false;
|
|
65
96
|
const caller = typeof callerTag === 'string' ? callerTag.trim() : '';
|
|
66
|
-
return caller === '' || caller
|
|
97
|
+
return caller === '' || isBoundHostTag(caller) || caller === MB_TAG;
|
|
67
98
|
}
|
|
68
99
|
|
|
69
|
-
export function
|
|
100
|
+
export function refuseBoundHostDoor(actor) {
|
|
70
101
|
const grantId = actor && typeof actor.grantId === 'string' && actor.grantId.trim() ? actor.grantId.trim() : 'unknown';
|
|
71
102
|
const err = new ValidationError('source', BOUND_LOGIN_MESSAGE, { code: 'EMET-AUTH-044' });
|
|
72
103
|
err.chooser = chooserBinding({ kind: 'onboarding_required', grantId, tag: CLAIM_TAG, door: 'member' });
|
|
@@ -74,24 +105,23 @@ export function refuseSophiaDoor(actor) {
|
|
|
74
105
|
}
|
|
75
106
|
|
|
76
107
|
/**
|
|
77
|
-
* Dated
|
|
78
|
-
* revise_memory and it does not supersede the row.
|
|
79
|
-
* on the live store after merge, from the
|
|
80
|
-
* pass source
|
|
108
|
+
* Dated correction note. The parent stays. This is not
|
|
109
|
+
* revise_memory and it does not supersede the row. The hub login writes it
|
|
110
|
+
* on the live store after merge, from the hub login, and does not
|
|
111
|
+
* pass source bound-host on that login.
|
|
81
112
|
*/
|
|
82
|
-
export function
|
|
113
|
+
export function boundHostCorrectionNote() {
|
|
83
114
|
return {
|
|
84
115
|
layer: 'episodic',
|
|
85
116
|
content: [
|
|
86
117
|
`Correction note dated ${CORRECTION_NOTE_DATE}.`,
|
|
87
|
-
`
|
|
118
|
+
`A row written from client ${SHARED_GROK_CLIENT} and stamped ${MB_TAG}.`,
|
|
88
119
|
`That stamp is a misattribution when the writer was BOUND (${CLAIM_TAG}).`,
|
|
89
120
|
'The original row is retained. This note does not edit it in place and does not supersede it.',
|
|
90
121
|
`A BOUND write carries ${CLAIM_TAG} from its own door.`,
|
|
91
|
-
`
|
|
122
|
+
`The hub login writes this note on the live store after merge, from the hub login, and does not pass source ${CLAIM_TAG} on that login.`
|
|
92
123
|
].join(' '),
|
|
93
124
|
metadata: {
|
|
94
|
-
corrects: EPISODIC_697_ID,
|
|
95
125
|
assertion_origin: 'assistant',
|
|
96
126
|
custom: {
|
|
97
127
|
correction: 'misattribution',
|
|
@@ -105,10 +135,10 @@ export function episodic697CorrectionNote() {
|
|
|
105
135
|
}
|
|
106
136
|
|
|
107
137
|
/**
|
|
108
|
-
* List
|
|
138
|
+
* List bound-host as a credential door. Does not remember() it onto the
|
|
109
139
|
* shared client. Idempotent for the same client, door, and grant.
|
|
110
140
|
*/
|
|
111
|
-
export async function
|
|
141
|
+
export async function recordBoundHostCredential(deps, { client_id, door, grant_id, by } = {}, now = new Date()) {
|
|
112
142
|
if (!deps || typeof deps.readDoc !== 'function' || typeof deps.writeDoc !== 'function') {
|
|
113
143
|
return { written: false, reason: 'no-approvals-io' };
|
|
114
144
|
}
|
|
@@ -120,8 +150,10 @@ export async function recordSophiaCredential(deps, { client_id, door, grant_id,
|
|
|
120
150
|
const { mutateApprovals } = await import('./attribution.js');
|
|
121
151
|
const at = (now instanceof Date ? now : new Date(now)).toISOString();
|
|
122
152
|
const out = await mutateApprovals(deps, (d) => {
|
|
123
|
-
const
|
|
124
|
-
const
|
|
153
|
+
const key = boundHostMapKey(d.approved) || CLAIM_TAG;
|
|
154
|
+
const prev = d.approved[key];
|
|
155
|
+
const pendingKey = boundHostMapKey(d.pending);
|
|
156
|
+
const pending = pendingKey ? d.pending[pendingKey] : undefined;
|
|
125
157
|
const same = prev
|
|
126
158
|
&& prev.basis === 'credential'
|
|
127
159
|
&& prev.door === doorName
|
|
@@ -129,31 +161,32 @@ export async function recordSophiaCredential(deps, { client_id, door, grant_id,
|
|
|
129
161
|
&& (prev.grant_id || null) === grant
|
|
130
162
|
&& !pending;
|
|
131
163
|
if (same) return false;
|
|
132
|
-
d.approved[
|
|
164
|
+
d.approved[key] = {
|
|
133
165
|
basis: 'credential',
|
|
134
166
|
door: doorName,
|
|
135
167
|
client_id: clientId,
|
|
136
168
|
grant_id: grant,
|
|
137
|
-
source_tag:
|
|
169
|
+
source_tag: key,
|
|
138
170
|
separate_from_client: SHARED_GROK_CLIENT,
|
|
139
171
|
separate_from_tag: MB_TAG,
|
|
140
172
|
by: by || 'owner',
|
|
141
173
|
at,
|
|
142
|
-
rule:
|
|
174
|
+
rule: `separate login, then assign ${key}, then initialize`
|
|
143
175
|
};
|
|
144
|
-
if (
|
|
176
|
+
if (pendingKey) delete d.pending[pendingKey];
|
|
145
177
|
return true;
|
|
146
178
|
});
|
|
147
|
-
|
|
179
|
+
const storedKey = boundHostMapKey(out.data.approved) || CLAIM_TAG;
|
|
180
|
+
return { written: out.written, approved: out.data.approved[storedKey] };
|
|
148
181
|
}
|
|
149
182
|
|
|
150
|
-
/** After the owner's chooser issues a
|
|
151
|
-
export async function
|
|
152
|
-
if (!recorded || recorded.claimed_tag
|
|
183
|
+
/** After the owner's chooser issues a bound-host door. The preparer's grant is not stored. */
|
|
184
|
+
export async function boundHostListingAfterWriterIssue({ recorded, issued, deps, by, now } = {}) {
|
|
185
|
+
if (!recorded || !isBoundHostTag(recorded.claimed_tag)) return { written: false, reason: 'tag' };
|
|
153
186
|
if (!issued || issued.issued !== true) return { written: false, reason: 'not-issued' };
|
|
154
187
|
if (recorded.door === 'guest') return { written: false, reason: 'guest' };
|
|
155
188
|
try {
|
|
156
|
-
return await
|
|
189
|
+
return await recordBoundHostCredential(deps, {
|
|
157
190
|
client_id: recorded.client_id,
|
|
158
191
|
door: recorded.door,
|
|
159
192
|
grant_id: null,
|
|
@@ -165,6 +198,6 @@ export async function sophiaListingAfterWriterIssue({ recorded, issued, deps, by
|
|
|
165
198
|
}
|
|
166
199
|
|
|
167
200
|
/** The actor in force, for stamp sites that do not take one. */
|
|
168
|
-
export function
|
|
201
|
+
export function boundHostActor() {
|
|
169
202
|
return rawActor();
|
|
170
203
|
}
|
package/src/break-glass.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Break-glass recovery (R4b).
|
|
3
3
|
*
|
|
4
|
-
* One stable URL on
|
|
4
|
+
* One stable URL on a hosted deployment: /owner/break-glass. The owner passphrase
|
|
5
5
|
* session is the only credential. A member or guest grant does not open it,
|
|
6
6
|
* and no AI client is required. Each authenticated use is logged and counted
|
|
7
7
|
* on emet_status.break_glass.
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import {
|
|
26
26
|
esc, sendHtml, loginForm, mountOwnerLogin, createOwnerGate
|
|
27
27
|
} from './owner-session.js';
|
|
28
|
+
import { isLegacyBoundHostSpelling } from './bound-door.js';
|
|
28
29
|
|
|
29
30
|
export { breakGlassMetric };
|
|
30
31
|
|
|
@@ -450,6 +451,11 @@ export function mountBreakGlass(app, options = {}) {
|
|
|
450
451
|
sendHtml(res, 400, '<p>A tag is required for member or guest. Nothing was issued.</p>', 'EMET break-glass');
|
|
451
452
|
return;
|
|
452
453
|
}
|
|
454
|
+
if (isLegacyBoundHostSpelling(tag)) {
|
|
455
|
+
res.locals.reason = 'legacy_bound_tag';
|
|
456
|
+
sendHtml(res, 400, '<p>use bound-host (EMET-AUTH-045). Nothing was issued.</p>', 'EMET break-glass');
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
453
459
|
let note = 'Owner door is the passphrase consent on this host. This page did not mint a token.';
|
|
454
460
|
let issued = false;
|
|
455
461
|
if (door !== 'owner') {
|