@dreamforgestudiollc/emet 0.3.1 → 0.3.3
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/CHANGELOG.md +40 -0
- package/README.md +29 -6
- package/docs/BOOTSTRAP.md +2 -0
- package/docs/BOTS.md +8 -7
- package/docs/DEPLOY.md +6 -0
- package/docs/ERROR-CODES-SPEC.md +2 -2
- package/docs/ERROR-CODES.md +29 -0
- package/docs/GUIDED-SETUP.md +1 -1
- package/docs/PERMISSIONS.md +5 -5
- package/docs/SETUP.md +10 -4
- package/docs/SUBKEYS.md +4 -4
- package/package.json +2 -2
- package/server.json +8 -4
- package/src/aleph.js +34 -13
- package/src/annotations.js +6 -2
- package/src/approve-throttle.js +3 -0
- package/src/atlas-role.js +1 -1
- package/src/attribution.js +76 -28
- package/src/bound-door.js +170 -0
- package/src/break-glass.js +531 -0
- package/src/carry-forward-close.js +386 -0
- package/src/checkpoint.js +241 -0
- package/src/chooser.js +543 -0
- package/src/claimed-tag.js +140 -0
- package/src/conformance.js +269 -5
- package/src/deep-links.js +267 -0
- package/src/dispatch.js +112 -18
- package/src/error-codes.js +29 -0
- package/src/error-log.js +138 -26
- package/src/error-report.js +17 -5
- package/src/gaps.js +1 -1
- package/src/grants.js +230 -0
- package/src/http-remote.js +80 -26
- package/src/index.js +18 -2
- package/src/invites.js +47 -1
- package/src/layers.js +1 -1
- package/src/lessons-to-checks.js +1 -1
- package/src/logger.js +3 -1
- package/src/oauth-provider.js +89 -5
- package/src/owl.js +232 -0
- package/src/owner-approvals.js +24 -267
- package/src/owner-session.js +235 -0
- package/src/pages.js +1 -1
- package/src/persons.js +39 -6
- package/src/proof-run.js +70 -0
- package/src/redact.js +4 -0
- package/src/request-log.js +2 -2
- package/src/rotate.js +554 -0
- package/src/rune-dispatch.js +1 -1
- package/src/session-graph.js +44 -25
- package/src/session.js +52 -9
- package/src/setup.js +21 -12
- package/src/staged-write.js +522 -0
- package/src/startup-pages.js +2 -2
- package/src/startup-payload.js +3 -3
- package/src/subkeys.js +61 -0
- package/src/tools.js +290 -79
- package/src/transcript-session.js +23 -4
- package/src/validation.js +1 -1
- package/src/version.js +1 -1
- package/src/writer-approval.js +394 -0
- package/templates/AREA.md +1 -1
- package/templates/BOTHANDOFF.md +2 -2
- package/templates/GRANT.md +48 -0
- package/templates/INDEX.md +9 -7
- package/templates/PROCEDURE.md +1 -1
- package/templates/ROSTER.md +2 -2
- package/templates/SEED.md +2 -2
- package/templates/SESSIONDISPOSITION.md +59 -0
- package/templates/STAGING.md +1 -1
- package/templates/STANDARD.md +1 -1
- package/templates/THREAD.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,46 @@ All notable changes to EMET are listed here, newest first. The format follows
|
|
|
5
5
|
[Semantic Versioning](https://semver.org/). EMET is still 0.x: the stored data shapes may
|
|
6
6
|
change before 1.0.
|
|
7
7
|
|
|
8
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
Nothing is waiting above 0.3.3.
|
|
11
|
+
|
|
12
|
+
## 0.3.3 - 2026-11-03
|
|
13
|
+
|
|
14
|
+
Listing text from public pull request #24, plus the public parts of private #97 and #98. Private #95 (session disposition) and #96 (the 0.3.2 public sync) are already in 0.3.2. Stored data shapes are unchanged. This change does not publish to npm or the MCP Registry. Filled disposition inventories stay in the private repository.
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
- Carry-forward close. `emet_session_close` takes `carry_forward` with `disposition_doc`, `disposition_version`, and `citations` when a later session already advanced HANDOFF or STATE. The owner door, or the credential that wrote the session, cites a current conforming session disposition (`CARRIED_FORWARD`, `SUPERSEDED_BY_LATER_SESSION`, or `ABANDONED_NO_TRANSCRIPT`) and those later versions. `RETAINED_OPEN_CRITICAL` stays open. A declared source is not authority. Transcripts stay. A refused call is not counted. A receipt close blocked only because a later session holds HANDOFF or STATE stays blocked and is not counted. From private #97. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
18
|
+
- Owner page portrait. `/owner/chooser` and `/owner/break-glass` use `site/assets/portrait.webp` as the page background, served at `/owner/assets/portrait.webp`. The sheet is a scrim. A missing file leaves the page without a portrait and does not stop startup. The npm package does not ship `site/`. The deploy image copies the portrait. From private #98. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- Version 0.3.3. `server.json`, `package.json`, and `glama.json` descriptions lead with ISO 9001 7.5.3 / ISO 13485 4.2.5 document control. The registry description stays within 100 characters. It says "Nothing is deleted.", which is `CHARTER.md` §3 commitment 2. `.cursor-plugin/plugin.json` leads with the same line. The wording landed in public pull request #24 at version 0.3.2 and was not published. `CHARTER.md` §7, `templates/STANDARD.md`, and the README document-control section are unchanged. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
22
|
+
|
|
23
|
+
## 0.3.2 - 2026-10-28
|
|
24
|
+
|
|
25
|
+
Release notes for the access ladder and the work after 0.3.1. npm is not published from this change. Older release sections below are historical and are not rewritten. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- Door grants. The grant id is the OAuth token family minted at consent. `verifyAccessToken` returns that id and the door (`owner`, `member`, or `guest`). A new passphrase consent stores `issued_via: owner`. A legacy token with no marker stays unmarked, and its door on the stamp is null, not a guessed owner. A legacy member token stays a member for freeze checks, and that stamp still records door null. New writes stamp `grant_id` and `door` from the login. A caller-supplied grant id or door is not stored. Stdio stamps `grant_id: null` and `door: stdio`. An error with no transport stores door `unknown`. `emet_initialize` and `emet_status` return `grant_id` and `door` beside the effective tag and basis. Tag memory stays keyed by `client_id`. The error log, the owner error report, and the tool-call audit store `client_id`, `grant_id`, and `door`. A grant id longer than a family, including a bearer, is stored as `none`. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
29
|
+
- Claimed-tag close date. `EMET_CLAIMED_TAG_KILL_DATE` is `YYYY-MM-DD` in UTC. Unset, or a value that is not that shape, uses `2026-12-15`. Before that day, an HTTP write whose source is only a caller claim and whose door has no grant is kept, and the receipt warns. On that day and after, the write is refused (`EMET-AUTH-040`), nothing is written, and the refusal carries a one-time link to `/owner/chooser`. Opening the link grants nothing. Stdio, a tag bound at approval, a sub-key, and any write that already has a grant stay open. `emet_status` reports `claimed_tag_traffic` for this process.
|
|
30
|
+
- Owner chooser and break-glass. `/owner/chooser` is where the owner sets a door. Guest is the least-privilege default. Only the owner session can grant owner or member. A refusal can include `chooser_url`. `/owner/approvals` answers with a pointer to the chooser. Sub-key requests are listed on the chooser. `/owner/break-glass` is the recovery page, with no AI client. The owner passphrase session lasts 15 minutes. A wrong passphrase counts toward the same lockout as the OAuth consent page. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
31
|
+
- Household rotate-all and one-member revoke. The owner confirms from `/owner/chooser` or `/owner/break-glass`. Confirm is exactly `rotate-all`. There is no MCP tool and no grace window. Access tokens, refresh tokens, authorization codes, sub-keys, live session handles, and unused invites are superseded, retired, and retained. Rows are not deleted. One new single-use invite is issued per known bot or member. Revoking one member (`revoke-member`) does not rotate the household. A refused call after commit is `EMET-AUTH-041` and names the chooser. `emet_status` reports `rotate_all`. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
32
|
+
- Writer approval. A new writer is prepared, checked by the server, and decided by the owner on `/owner/chooser`. An AI cannot grant a writer (`EMET-AUTH-043`). The earlier second-client approval account is retired and retained. Its tokens and new issues are refused (`EMET-AUTH-042`). Nothing on that account is deleted. The owner non-AI login can still approve a pending client tag and a sub-key. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
33
|
+
- Staged document write. `write_doc_begin`, `write_doc_append`, `write_doc_commit`, and `write_doc_abort` send a record in parts when a host truncates tool arguments. Commit checks the sha256 of the assembled text and `part_count`, then writes one whole revision through `write_doc`. A wrong digest, a missing part, an abort, or an expiry leaves the current document unchanged. A second commit of the same digest returns the first receipt. Limits: 16,000 characters per part, 128 parts, 2,000,000 characters, 30 minutes, and 4 open stages per writer. Stages live in `doc_stages` and are not documents. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
34
|
+
- Checkpoint reminder. `emet_status` reports `checkpoint` on every call. A tool result for an open session carries the same reminder when the last verbatim save, or the open when no transcript is saved, is at least 24 hours old. The reminder names `emet_transcript_append`, `save_transcript`, and `emet_session_close`, and the daily `YYYY-MM-DD_chat-daily` session in America/New_York. A fresh save clears it. A store that cannot be read sets `checkpoint.unread` and does not claim the save is current. The reminder only reads.
|
|
35
|
+
- Session disposition. `templates/SESSIONDISPOSITION.md` is the controlled form. A current conforming session-level row covers that session, so `emet_status` does not list it as checkpoint-due. The session stays open. A row that names one inserted transcript covers that transcript only and does not cover the session. A nonconforming or retired record covers nothing. `emet_session_close` is unchanged: omitted or mismatched receipts still block, and a disposition is not a receipt. A filled inventory stays out of the npm package. Nothing is deleted. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
36
|
+
- Technical-writing skill. `skills/technical-writing/SKILL.md` is the writing standard for controlled documents, pull request text, and release notes. `skills/technical-writing/README.md` says when to use it. The skill points at `CHARTER.md` §7 and `templates/STANDARD.md`. It does not change them. `package.json` `files` does not list `skills/`. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
37
|
+
- Proof pack. The cross-host proof harness and proof pack stay out of this release. They are not published and they are not an npm package file. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
38
|
+
- Best practices. README Best practices cites `docs/BOTS.md` §4 without dropping the standing rule: append the new tag to the end of `EMET_SOURCE_TAGS`, keep every existing tag in order, add `bots/<tag>/HANDOFF.md` to `EMET_RECORD_DOCS` before the first write, redeploy, then check `/health` and `emet_status`. The owner approves a new writer. A bot that shares the owner login holds its own key. A sub-key session passes `session_handle` on every later write. `docs/BOTS.md`, `docs/SUBKEYS.md`, `docs/BOOTSTRAP.md`, `docs/DEPLOY.md`, `docs/PERMISSIONS.md`, and `docs/SETUP.md` say the same. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- A login bound to one tag stays that tag. A claim of a different tag on that credential is refused (`EMET-AUTH-044`) and is not stamped as the bound tag. A credential whose bound tag is the claimed tag, including a sub-key for that tag, stamps the bound tag. A guest door is not that writer credential. One server. The owner assigns the tag on `/owner/chooser` or at consent. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
42
|
+
- A slug that already begins with a well-formed `YYYY-MM-DD_` prefix is not dated again when a session id is minted. A slug with no such prefix still receives the local day (`EMET_TIMEZONE`, default America/New_York). A well-formed prefix whose date is not the local day is kept. The grammar is month 01–12 and day 01–31. It is not a calendar check. The text after the prefix is still cleaned. A closed id still opens as `-2` through `-99`. Parts are still `_verbatim_partN`. ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
43
|
+
- A refused or failed `emet_session_close` is written to the error log with the session id, plus `client_id`, `grant_id`, and `door`. Blocked and escalated closes are logged (`EMET-SESS-006`, `EMET-SESS-007`). A thrown refusal, including a validation error, is logged the same way. The session id is kept only when it is a minted session id. A bearer, a JWT, a URI, or any other shape is `unknown`. Other tools store `none`. `emet_status` with `session_id` returns `session.state`: `open`, `closed`, `absent`, or `unreadable`. A part id is read as its base session. The asked id is not echoed when the read fails.
|
|
44
|
+
- `EMET-DOC-025` tells the caller to write the full revision: the whole content in one `write_doc`, or `write_doc_begin`, `write_doc_append`, and `write_doc_commit`. A condensed or header-only substitute is refused. The floor that raises the code is unchanged.
|
|
45
|
+
- Refused tool calls log the actor's `client_id` from the credential, read before the log write awaits. Stdio with no client id is `stdio`. No actor, or a value that is not a client id, is `unknown`. A caller-supplied client id is not read. Daily summaries keep that client id, one row per client, when the summary index can include it. An older unique index is left in place if this process cannot replace it. The owner error report lists the client id on each recent line. Rows already stored are not rewritten.
|
|
46
|
+
- A caller-supplied `grant_id` or `door`, including one nested under `custom`, is not stored on a memory row or a transcript exchange. `emet_transcript_append` stamps through the same exchange function as `save_transcript`. The HTTP tool actor copies `grantId` and `door` only from the verified token. Tool-call audit on both transports and the owner error report keep the sanitized `client_id`, `grant_id`, and `door`. A bearer-shaped grant id is `none`.
|
|
47
|
+
|
|
8
48
|
## 0.3.1 - 2026-10-21
|
|
9
49
|
|
|
10
50
|
- Changed: `EMET_REPORT_EMAIL` defaults to `dreamforgestudio@mail.grokbot.com`.
|
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ See also: [CHANGELOG](CHANGELOG.md) · [CONTRIBUTING](CONTRIBUTING.md) · [SECUR
|
|
|
26
26
|
- **Per-client attribution and approvals.** Every write is attributed to the client that made it. A new client is read-limited until it is approved. The approval is recorded.
|
|
27
27
|
- **Error codes and problem reports.** Every error carries a stable `EMET-<AREA>-<NNN>` code. An operational error log keeps 10,000 entries or 90 days, plus daily summaries. The owner-only `emet_error_report` returns the report and an email draft that you send yourself. See [Reporting a problem](#reporting-a-problem).
|
|
28
28
|
- **verify-emet and the feature map.** `npm run verify` runs `scripts/verify-emet.mjs` from a checkout. It starts EMET in a temporary directory on the in-memory test database, with no `.env`, and drives every registered tool. A tool that needs a service a plain install does not have is reported as a gap. A run whose only problems are gaps exits 3. A failed tool exits 1. The map is [docs/features/README.md](docs/features/README.md).
|
|
29
|
-
- **MIT.** Version 0.3.
|
|
29
|
+
- **MIT.** Version 0.3.3. EMET is still 0.x: stored document shapes may change before 1.0. Pin a version if you depend on them.
|
|
30
30
|
|
|
31
31
|
The store has one owner, and other people can join only through the optional Guest
|
|
32
32
|
(read-only) and Member (read and write) access, both off by default.
|
|
@@ -49,6 +49,10 @@ EMET is built for document control in environments that work under ISO 9001 and
|
|
|
49
49
|
- **Setup:** [docs/SETUP.md](docs/SETUP.md) — the manual walkthrough: MongoDB, both transports, and the first-run interview.
|
|
50
50
|
- **Deploy:** [docs/DEPLOY.md](docs/DEPLOY.md) — remote HTTP with OAuth, so a phone, a browser, or another vendor's agent reaches the same store.
|
|
51
51
|
|
|
52
|
+
> **npm lags the repo.** `npx -y @dreamforgestudiollc/emet` installs 0.3.2 until 0.3.3 is
|
|
53
|
+
> published. For 0.3.3, clone this repo and run `npm ci && npm start`, or deploy the
|
|
54
|
+
> repository itself.
|
|
55
|
+
|
|
52
56
|
> **Status: 0.x. The stored document shapes are not frozen yet.** Breaking changes to the
|
|
53
57
|
> schema may land before 1.0. Pin a version if you depend on it.
|
|
54
58
|
|
|
@@ -234,11 +238,26 @@ you reconnect the connector there. New tools stay invisible until the host sees
|
|
|
234
238
|
and the host may ask again for approvals you had already given. See
|
|
235
239
|
[docs/DEPLOY.md](docs/DEPLOY.md).
|
|
236
240
|
|
|
237
|
-
**Register a bot before its first write, and set both lists in one change.** One bot, one tag
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
**Register a bot before its first write, and set both lists in one change.** One bot, one tag,
|
|
242
|
+
`<prefix>-<bot>` (for example `bot-reviewer`). When a bot joins the roster, append its tag to
|
|
243
|
+
the end of `EMET_SOURCE_TAGS`, keep every existing tag in order, and add
|
|
244
|
+
`bots/<tag>/HANDOFF.md` to `EMET_RECORD_DOCS` before its first write. Set both in one
|
|
245
|
+
deployment. Setting either variable redeploys the server; afterwards, check `/health` and
|
|
246
|
+
`emet_status`. A registered tag that is not listed as a bot can still write the main records.
|
|
247
|
+
The hub's tag is registered as a host and is never listed as a bot. That standing rule is
|
|
248
|
+
[docs/BOTS.md](docs/BOTS.md) §4.
|
|
249
|
+
|
|
250
|
+
**Approve a writer yourself, and give a bot that shares your login its own key.** The owner
|
|
251
|
+
decides a new writer on `/owner/chooser`. An AI does not grant a writer. When `EMET_SUBKEYS=1`,
|
|
252
|
+
each bot that can keep a key file holds its own `emk_` key. The owner approves that key on the
|
|
253
|
+
same page. The bot presents the key once at `emet_session_open`. See
|
|
254
|
+
[docs/SUBKEYS.md](docs/SUBKEYS.md) and [docs/BOTS.md](docs/BOTS.md) §4.
|
|
255
|
+
|
|
256
|
+
**Pass `session_handle` on every write in a sub-key session.** `emet_session_open` returns
|
|
257
|
+
`session_handle` once. Later writes in that session pass `session_handle`. A write that names
|
|
258
|
+
the session and omits the handle, or sends a different one, is refused, and nothing is written.
|
|
259
|
+
The handle is not a receipt and is not written into a document. With sub-keys off, the field is
|
|
260
|
+
absent. See [docs/SUBKEYS.md](docs/SUBKEYS.md) and [docs/PERMISSIONS.md](docs/PERMISSIONS.md).
|
|
242
261
|
|
|
243
262
|
**Prove the write path before you trust a new deploy.** Run `emet_status` with `probe: true`.
|
|
244
263
|
It writes a test document, reads the same value back and removes it; a read alone cannot show
|
|
@@ -712,6 +731,10 @@ save_transcript
|
|
|
712
731
|
semantic_recall
|
|
713
732
|
validate_doc
|
|
714
733
|
write_doc
|
|
734
|
+
write_doc_abort
|
|
735
|
+
write_doc_append
|
|
736
|
+
write_doc_begin
|
|
737
|
+
write_doc_commit
|
|
715
738
|
```
|
|
716
739
|
<!-- /emet-tools -->
|
|
717
740
|
|
package/docs/BOOTSTRAP.md
CHANGED
|
@@ -73,6 +73,8 @@ the session is saved until it returns state "complete".
|
|
|
73
73
|
That is the whole thing. The disciplines it alludes to arrive in full from
|
|
74
74
|
`emet_initialize`; repeating them here would create two copies to keep in agreement.
|
|
75
75
|
|
|
76
|
+
When more than one bot shares the owner login, the owner approves a new writer and each bot's own key on `/owner/chooser`. An AI does not grant a writer. A bot that can keep a key file presents that key at `emet_session_open`. The open returns `session_handle` once. Every later write in that session passes `session_handle`. A write that omits it, or sends a different one, is refused, and nothing is written. The handle is not a receipt. With sub-keys off, the field is absent. See [SUBKEYS.md](SUBKEYS.md) and [BOTS.md](BOTS.md) §4.
|
|
77
|
+
|
|
76
78
|
---
|
|
77
79
|
|
|
78
80
|
## Hosts differ, and EMET degrades gracefully
|
package/docs/BOTS.md
CHANGED
|
@@ -29,7 +29,7 @@ Do these in order. Each step names what to read back. Steps 2 and 3 are **one ch
|
|
|
29
29
|
|
|
30
30
|
**Standing rule.** Every bot on the roster writes under its own source tag, `<prefix>-<bot>` (e.g. `bot-reviewer`). When a new bot joins the roster, register its tag in `EMET_SOURCE_TAGS` at the same time, before its first write. Append it to the end of the comma-separated list and keep every existing tag in order. Also add `bots/<tag>/HANDOFF.md` to `EMET_RECORD_DOCS` so the server treats it as a bot. Setting either variable redeploys the server; afterwards, check `/health` and `emet_status`.
|
|
31
31
|
|
|
32
|
-
When `EMET_SUBKEYS=1`, bots that share the owner's login each hold a sub-key as a local secret. First use, in plain language, is [SUBKEYS.md](SUBKEYS.md). The key is never stored in an EMET document. The bot presents it at `emet_session_open` and passes the returned session handle on later writes in that session. The server stamps the key's tag. The owner approves a pending sub-key at `/owner/
|
|
32
|
+
When `EMET_SUBKEYS=1`, bots that share the owner's login each hold a sub-key as a local secret. First use, in plain language, is [SUBKEYS.md](SUBKEYS.md). The key is never stored in an EMET document. The bot presents it at `emet_session_open` and passes the returned session handle on later writes in that session. The server stamps the key's tag. The owner approves a pending sub-key at `/owner/chooser` on this host (the same host as `/mcp`). `/owner/approvals` was retired by R4: it answers with a pointer to the chooser, and the sub-key records stay listed there. The chooser asks for the existing owner passphrase (`EMET_OAUTH_PASSPHRASE`, the same check as the OAuth consent page). A wrong passphrase counts toward the same per-address lockout as `/oauth/approve`. A correct passphrase opens a session that lasts 15 minutes. The page lists each pending request by tag, key id prefix and requested time. Approve or Deny may include a reason; the decision is recorded as the owner. Break-glass recovery, with no AI client, is `/owner/break-glass`. Revoke stays on the owner's own login. A key expires after 30 days; the owner can reissue it. Sub-key records live in their own collection; `read_doc` cannot return them, and only the owner and the chief of staff can read the list or its history. Turning `EMET_SUBKEYS` off ends every live sub-key session once, in the background at startup, when that collection already exists. The history event is written before the status change, and the row is kept. If the collection does not exist, startup does not create it. The sweep tries once, then a few times with backoff. With the flag off, a write that presents an `emh_` handle is refused without opening the store. A write that names a sub-key session is refused the same way only when that session was live at this process's sweep. That refusal lasts until the next restart, by which time those sessions are already ended. A store that ran the first build, which kept these rows in `emet/CLIENT_APPROVALS.md`, still has them in that document's history. Production did not run that build. See `docs/proposals/EMET-0001-delegated-client-sub-keys.md`.
|
|
33
33
|
|
|
34
34
|
1. **Roster row.** Add the bot to `bots/ROSTER.md`, filled from `templates/ROSTER.md`: tag, name, role, host, machine, handoff doc, tool profile, owner, status. The hub keeps the roster. Read back: `read_doc bots/ROSTER.md`.
|
|
35
35
|
2. **Register the tag as a source.** Append the tag to `EMET_SOURCE_TAGS` (comma list) on the deployment. Without it, the bot's transcript appends are refused (`src/dispatch.js` `requireRegisteredSource`). The operator reads the variable back from the deployment (a bot cannot read deployment settings from a session).
|
|
@@ -39,8 +39,9 @@ When `EMET_SUBKEYS=1`, bots that share the owner's login each hold a sub-key as
|
|
|
39
39
|
- If your install still uses the legacy `CASCADE_RECORD_DOCS`, edit that one, or move its entries into `EMET_RECORD_DOCS`: once the `EMET_` name is set, the `CASCADE_` one is ignored.
|
|
40
40
|
- The ids are a deploy setting rather than code defaults on purpose: they name your bots, which differ per install, and removing one id puts that tag back on host rules without a release.
|
|
41
41
|
- Changing a variable redeploys the service. Note the new deployment id.
|
|
42
|
-
4. **
|
|
43
|
-
5. **
|
|
42
|
+
4. **Owner approval and the bot's own key.** When more than one bot shares the owner login and `EMET_SUBKEYS=1` is on, the owner approves the bot's own key at `/owner/chooser`. An AI does not grant a writer and does not approve that key. The bot presents the `emk_` key once at `emet_session_open` and keeps the returned `session_handle` for later writes. Read back: the chooser lists the request before the decision, and the bot's first successful open returns `session_handle`. With sub-keys off, skip this step. See [SUBKEYS.md](SUBKEYS.md).
|
|
43
|
+
5. **Fill §3 of the roster** with the bot entries of both variables as read back, the date and the deployment id.
|
|
44
|
+
6. **Verify with one refused write — only once `HANDOFF.md` exists** (`list_docs HANDOFF.md` shows a version). On a new install with no handoff yet, skip this step until there is one: if the tag is not configured — the very case this step catches — the write would *create* the user's handoff. Then, under the bot's tag, `write_doc HANDOFF.md` with no `supersedes`. Expected reply: "HANDOFF.md is a main record and `<tag>` is a bot tag ... Nothing was written." If the reply says instead that HANDOFF.md "is a record and vN is in force", the tag is not a bot tag yet: check the id in step 3. If it says `<tag>` "is not a registered source tag", the tag is unregistered (step 2) and not yet a bot tag (step 3).
|
|
44
45
|
|
|
45
46
|
**Templates.** A bot's handoff is filled from `templates/BOTHANDOFF.md`. Do not map bot handoffs to `templates/HANDOFF.md`: that template asks for a board a bot does not keep, so every bot close would be marked nonconforming. While `templates/BOTHANDOFF.md` is DRAFT it is not mapped; once it is IN FORCE, map each bot with `bots/<tag>/HANDOFF.md=templates/BOTHANDOFF.md` in `EMET_TEMPLATE_MAP` (additive; append to any existing entries). Conformance marks a record and never rejects a write.
|
|
46
47
|
|
|
@@ -57,8 +58,8 @@ A bot tag is also refused any write under `bots/` outside `bots/<tag>/`: other b
|
|
|
57
58
|
One session per run, opened and closed by the bot itself.
|
|
58
59
|
|
|
59
60
|
1. `emet_initialize {}` and fetch every page it names (each page gives the exact call for the next); `{"page": "all"}` only on a host known to read long results whole, since the server counts a whole serve as fetched even if the host's connector cut it short. Keep `startup_page.load_id`. A read: nothing is written.
|
|
60
|
-
2. `emet_session_open` — a slug that names the bot and the job, and `load_id` from step 1. Keep the returned `session_id` and the start time (`session_start`). An open without `load_id`, before every page is fetched, or more than 60 minutes after the startup's last page (or after a server restart) is refused, and the refusal says what to call instead; nothing is written.
|
|
61
|
-
3. `emet_transcript_append` — exchange 1, `source: <tag>`.
|
|
61
|
+
2. `emet_session_open` — a slug that names the bot and the job, and `load_id` from step 1. Keep the returned `session_id` and the start time (`session_start`). When `EMET_SUBKEYS=1`, present the bot's `emk_` key on this call and keep the returned `session_handle`. An open without `load_id`, before every page is fetched, or more than 60 minutes after the startup's last page (or after a server restart) is refused, and the refusal says what to call instead; nothing is written.
|
|
62
|
+
3. `emet_transcript_append` — exchange 1, `source: <tag>`. When this session was opened with a sub-key, pass `session_handle` on this call and on every later write in the loop. The handle is not a receipt and is not written into the handoff.
|
|
62
63
|
4. `save_to_layer` — the session record on the episodic layer, with **`session_id`** and **`metadata.source: <tag>`**. The server stamps `derived_from` with the exchange *in progress*: the highest stored exchange plus one (`src/tools.js`, the A5 provenance stamp). Read it back.
|
|
63
64
|
5. `emet_transcript_append` — exchange 2, the one the save was stamped with. **Do not skip this:** without it the close reports that a layer entry cites an exchange that was never saved, and the close is `incomplete`.
|
|
64
65
|
6. `write_doc bots/<tag>/HANDOFF.md` — filled from `templates/BOTHANDOFF.md`, `source: <tag>`, written last. Revision 1 is written plain. **Every later revision is supersede-only:** pass `supersedes` set to the revision in force; `patch_doc` is refused on it, because it is a record.
|
|
@@ -66,14 +67,14 @@ One session per run, opened and closed by the bot itself.
|
|
|
66
67
|
|
|
67
68
|
A bot with more exchanges appends after every reply as usual; the rule that matters is that the last append comes after the last layer save and before the handoff.
|
|
68
69
|
|
|
69
|
-
**Name every write attempt.** The user's approval of a bot's writes names each write call it covers, one per line: the tool, the document id or layer, and what it writes (for the loop above: `emet_session_open` with its `load_id
|
|
70
|
+
**Name every write attempt.** The user's approval of a bot's writes names each write call it covers, one per line: the tool, the document id or layer, and what it writes (for the loop above: `emet_session_open` with its `load_id` and, when sub-keys are on, the `emk_` key; `emet_transcript_append` exchange 1 with `session_handle` when that open returned one; `save_to_layer` episodic; `emet_transcript_append` exchange 2; `write_doc bots/<tag>/HANDOFF.md`; `emet_session_close`), including any deliberate negative test. A sub-key session passes `session_handle` on every write after the open. The hub relays that list verbatim in the bot's brief, and the bot's report lists every write it attempted, from the raw replies. The second reader checks each attempted write against the approved list: a write not on it, a retry, or a write after the close is a finding. Reads (`emet_initialize` included) and dry runs (`validate_doc`) need no listing. This is what lets the second reader confirm that nothing was written beyond what the user approved.
|
|
70
71
|
|
|
71
72
|
## 7. Corrections
|
|
72
73
|
|
|
73
74
|
Nothing is edited in place and nothing is deleted.
|
|
74
75
|
|
|
75
76
|
- **The bot's handoff:** the next revision corrects it, with `supersedes`, and names the correction in its §4.
|
|
76
|
-
- **Episodic entries** are events and are never revised: a correction is a later entry that says what it corrects.
|
|
77
|
+
- **Episodic entries** are events and are never revised: a correction is a later entry that says what it corrects. The entry sets `metadata.corrects` to the parent's id. The parent gains `corrected_by`. Its content stays, and it is not superseded. `revise_memory` refuses episodic.
|
|
77
78
|
- **Semantic and procedural entries:** `revise_memory` writes a new entry that supersedes the old one; both stay readable.
|
|
78
79
|
- **Transcripts:** `revise_transcript` writes a corrected part that points at the one it replaces.
|
|
79
80
|
- **The roster:** a new revision with a §4 change-log row; a retired bot's row stays, marked RETIRED, and its handoff id is removed from `EMET_RECORD_DOCS` only when it will never write again.
|
package/docs/DEPLOY.md
CHANGED
|
@@ -13,6 +13,12 @@ scoped user, and Atlas Network Access set to `0.0.0.0/0` — a hosted platform's
|
|
|
13
13
|
dynamic, so it cannot be allowlisted. Security rests on the scoped user plus the OAuth
|
|
14
14
|
passphrase; both are required.
|
|
15
15
|
|
|
16
|
+
## Upgrading to 0.3.2
|
|
17
|
+
|
|
18
|
+
0.3.2 adds door grants, the owner chooser, household rotation, and writer approval. Records already stored stay. After the deploy, reconnect each host so it loads the staged-write tools. The owner approves a new writer on `/owner/chooser`. An AI does not grant a writer. When `EMET_SUBKEYS=1`, a bot that shares the owner login uses its own key, `emet_session_open` returns `session_handle` once, and every later write in that session passes `session_handle`. A missing or different handle is refused, and nothing is written.
|
|
19
|
+
|
|
20
|
+
ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged.
|
|
21
|
+
|
|
16
22
|
## Upgrading to 0.3.0
|
|
17
23
|
|
|
18
24
|
Error-log rotation deletes from `error_log` (10,000 entries or 90 days; daily summaries are
|
package/docs/ERROR-CODES-SPEC.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Error codes and the error report
|
|
2
2
|
|
|
3
|
-
This is the behavior EMET 0.3.
|
|
3
|
+
This is the behavior EMET 0.3.0 ships. The code table is generated from the registry: [ERROR-CODES.md](ERROR-CODES.md). A code’s meaning does not change. A removed code is added to the retired list, stays in that table, and its number is not reused.
|
|
4
4
|
|
|
5
5
|
## Where the code goes
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ The result is, in order:
|
|
|
30
30
|
2. A `mailto:` draft, when an address is set.
|
|
31
31
|
3. A structured email `{to, subject, body_text, short_id, version}`, plus the mailto link, so a calling assistant can pass it to its own email tool.
|
|
32
32
|
|
|
33
|
-
`to` is `EMET_REPORT_EMAIL`. When the variable is unset, the address is `dreamforgestudio@mail.
|
|
33
|
+
`to` is `EMET_REPORT_EMAIL`. When the variable is unset, the address is `dreamforgestudio@mail.hubbot.com`. An empty string means no email: the tool returns the report and `email: null`. Any other value is treated the same way unless it is one plain address: exactly one `@`, a local part of letters, digits, and `. _ + -` that does not start or end with a dot and does not contain `..`, and a domain of at least two labels separated by dots. A label is letters, digits, and `-`, does not start or end with `-`, and is not empty.
|
|
34
34
|
|
|
35
35
|
The subject is `EMET error report <version> <6 hex characters>`. `body_text` is the full report shown above. The mailto body is that same text when it fits, and a shorter draft when it does not. The link is at most 1,800 characters. Totals stay when they fit. Recent lines are cut to the newest that fit, and the draft says so. The report in the tool output stays complete.
|
|
36
36
|
|
package/docs/ERROR-CODES.md
CHANGED
|
@@ -45,6 +45,11 @@ Internal codes are raised inside a check that catches them before a caller sees
|
|
|
45
45
|
| EMET-AUTH-037 | Only the owner can create member access | active |
|
|
46
46
|
| EMET-AUTH-038 | The error report is owner-only | active |
|
|
47
47
|
| EMET-AUTH-039 | HTTP attribution preflight was refused | active |
|
|
48
|
+
| EMET-AUTH-040 | A claimed source tag cannot write after the kill date | active |
|
|
49
|
+
| EMET-AUTH-041 | A credential was revoked by rotation | active |
|
|
50
|
+
| EMET-AUTH-042 | A retired owl credential was refused | active |
|
|
51
|
+
| EMET-AUTH-043 | A writer approval step was refused | active |
|
|
52
|
+
| EMET-AUTH-044 | A bound login cannot stamp another tag | active |
|
|
48
53
|
| EMET-CFG-001 | Database name must be a plain name | active, internal |
|
|
49
54
|
| EMET-CFG-002 | Collection prefix must be a plain name | active, internal |
|
|
50
55
|
| EMET-CFG-004 | Hosted setup cannot turn sub-keys on from here | active |
|
|
@@ -91,6 +96,7 @@ Internal codes are raised inside a check that catches them before a caller sees
|
|
|
91
96
|
| EMET-DB-034 | Failed to patch a document | active |
|
|
92
97
|
| EMET-DB-035 | Failed semantic recall | active |
|
|
93
98
|
| EMET-DB-036 | Failed corpus recall | active |
|
|
99
|
+
| EMET-DB-037 | Failed to stage a document write | active |
|
|
94
100
|
| EMET-DOC-001 | doc_id must be a non-empty string | active |
|
|
95
101
|
| EMET-DOC-002 | Document not found | active |
|
|
96
102
|
| EMET-DOC-003 | No retained revision | active |
|
|
@@ -150,6 +156,27 @@ Internal codes are raised inside a check that catches them before a caller sees
|
|
|
150
156
|
| EMET-DOC-057 | old_str must be a non-empty string | active |
|
|
151
157
|
| EMET-DOC-058 | new_str must be a string | active |
|
|
152
158
|
| EMET-DOC-059 | Patch edits overlap | active |
|
|
159
|
+
| EMET-DOC-060 | Stage not found for this writer | active |
|
|
160
|
+
| EMET-DOC-061 | Stage has expired | active |
|
|
161
|
+
| EMET-DOC-062 | Stage was aborted | active |
|
|
162
|
+
| EMET-DOC-063 | Stage is already committed | active |
|
|
163
|
+
| EMET-DOC-064 | A staged chunk exceeds the part limit | active |
|
|
164
|
+
| EMET-DOC-065 | A staged append is out of order | active |
|
|
165
|
+
| EMET-DOC-066 | A staged part was already stored with different bytes | active |
|
|
166
|
+
| EMET-DOC-067 | Staged content would exceed the 2MB limit | active |
|
|
167
|
+
| EMET-DOC-068 | A staged write has too many parts | active |
|
|
168
|
+
| EMET-DOC-069 | Commit digest does not match the assembled content | active |
|
|
169
|
+
| EMET-DOC-070 | Commit part count does not match the stage | active |
|
|
170
|
+
| EMET-DOC-071 | A staged chunk must be a non-empty string | active |
|
|
171
|
+
| EMET-DOC-072 | A staged part index must be a whole number | active |
|
|
172
|
+
| EMET-DOC-073 | Commit sha256 must be a hex digest | active |
|
|
173
|
+
| EMET-DOC-074 | Too many open stages for this writer | active |
|
|
174
|
+
| EMET-DOC-075 | Commit names a different document than the stage | active |
|
|
175
|
+
| EMET-DOC-076 | This stage is already being committed | active |
|
|
176
|
+
| EMET-DOC-077 | Commit supersedes does not match the stage | active |
|
|
177
|
+
| EMET-DOC-078 | Commit reason does not match the stage | active |
|
|
178
|
+
| EMET-DOC-079 | This call's source does not match the stage | active |
|
|
179
|
+
| EMET-DOC-080 | This call's session does not match the stage | active |
|
|
153
180
|
| EMET-GEM-001 | Read-back found no document | active |
|
|
154
181
|
| EMET-GEM-002 | Read-back content digest differs | active |
|
|
155
182
|
| EMET-GEM-003 | Read-back version differs | active |
|
|
@@ -248,6 +275,8 @@ Internal codes are raised inside a check that catches them before a caller sees
|
|
|
248
275
|
| EMET-SESS-003 | timestamp_start must be before timestamp_end | active |
|
|
249
276
|
| EMET-SESS-004 | session_id must be a string | active |
|
|
250
277
|
| EMET-SESS-005 | Session graph is unavailable | active |
|
|
278
|
+
| EMET-SESS-006 | Session close was blocked | active |
|
|
279
|
+
| EMET-SESS-007 | Session close escalated | active |
|
|
251
280
|
| EMET-TOOL-001 | A tool has no annotation entry | active, internal |
|
|
252
281
|
| EMET-TOOL-002 | A source tag is required | active |
|
|
253
282
|
| EMET-TOOL-003 | A source tag is required and none are registered | active |
|
package/docs/GUIDED-SETUP.md
CHANGED
|
@@ -290,7 +290,7 @@ and this host's tag. Then
|
|
|
290
290
|
`emet_setup_complete`. It refuses partial answers rather than inventing an identity; that is
|
|
291
291
|
correct behaviour. Bot-team backup does not copy prompts or settings, and secret values are never stored.
|
|
292
292
|
|
|
293
|
-
If they answer **no**, or they skip it, leave sub-keys off. If they answer **yes** on the local server that reads `.env`, `emet_setup_complete` writes the flag, a generated pepper, and version 1 into that file after the store writes succeed. The result does not contain the pepper. Do not paste it into the chat. Tell them to restart (or redeploy) the server once. If they answer **yes** against the hosted server, the call refuses before it saves anything. No pepper or .env was written. Tell them to run setup again without yes to finish the rest, and to follow the platform-variable steps in [SUBKEYS.md](SUBKEYS.md): set `EMET_SUBKEYS=1`, an `EMET_SUBKEY_PEPPER` they generate (at least 32 bytes), and `EMET_SUBKEY_PEPPER_VERSION=1`, then redeploy. Do not copy a pepper out of the server. Each bot's tag must be listed in `EMET_SOURCE_TAGS`. The rest is [SUBKEYS.md](SUBKEYS.md).
|
|
293
|
+
If they answer **no**, or they skip it, leave sub-keys off. If they answer **yes** on the local server that reads `.env`, `emet_setup_complete` writes the flag, a generated pepper, and version 1 into that file after the store writes succeed. The result does not contain the pepper. Do not paste it into the chat. Tell them to restart (or redeploy) the server once. If they answer **yes** against the hosted server, the call refuses before it saves anything. No pepper or .env was written. Tell them to run setup again without yes to finish the rest, and to follow the platform-variable steps in [SUBKEYS.md](SUBKEYS.md): set `EMET_SUBKEYS=1`, an `EMET_SUBKEY_PEPPER` they generate (at least 32 bytes), and `EMET_SUBKEY_PEPPER_VERSION=1`, then redeploy. Do not copy a pepper out of the server. Each bot's tag must be listed in `EMET_SOURCE_TAGS`. The owner approves a new writer and each bot's own key on `/owner/chooser`. An AI does not grant a writer. After the bot opens with its key, every later write passes `session_handle`. The rest is [SUBKEYS.md](SUBKEYS.md).
|
|
294
294
|
|
|
295
295
|
Then hand the person the short instruction block from [BOOTSTRAP.md](BOOTSTRAP.md) to paste
|
|
296
296
|
into their project instructions, so future sessions consult the memory without being told.
|
package/docs/PERMISSIONS.md
CHANGED
|
@@ -40,17 +40,17 @@ Every tool carries MCP annotations, declared in one table in `src/annotations.js
|
|
|
40
40
|
| `idempotentHint` | Calling it again with the same arguments changes nothing further. |
|
|
41
41
|
| `openWorldHint` | It reaches systems outside this server's own store. |
|
|
42
42
|
|
|
43
|
-
Of the
|
|
43
|
+
Of the 38 tools (`EMET_SUBKEYS=1` adds the four sub-key tools below; with the flag off they are not registered):
|
|
44
44
|
|
|
45
45
|
- **15 are read-only.** `emet_gaps`, `emet_page`, `emet_pages`, `emet_page_lint`, `emet_error_report`, `emet_floor`, `recall`, `semantic_recall`,
|
|
46
46
|
`corpus_recall`, `query_layer`, `query_transcripts`, `read_doc`, `read_doc_history`, `list_docs`,
|
|
47
47
|
`validate_doc`. These cannot change the store under any arguments. `emet_page`, `emet_pages`, and `emet_page_lint` are owner-only views: they compute a topic page and never write it back. `emet_error_report` is owner-only and reads the operational error log. It sends nothing.
|
|
48
|
-
- **
|
|
48
|
+
- **13 are additive writes.** `emet_initialize` (it provisions a missing board), `save_to_layer`, `revise_memory`, `save_transcript`,
|
|
49
49
|
`revise_transcript`, `emet_session_open`, `emet_transcript_append`, `emet_session_close` (it
|
|
50
|
-
records blocked attempts), `rename_doc`, `accept_nonconformance`. They add; they do not remove or replace.
|
|
50
|
+
records blocked attempts), `rename_doc`, `accept_nonconformance`, `write_doc_begin`, `write_doc_append`, `write_doc_abort`. They add; they do not remove or replace. A staged begin or append changes only the server's own stage, not the current document.
|
|
51
51
|
`emet_session_open` still needs the `emet.write` scope, because it stamps the drop list a board edit trusts.
|
|
52
52
|
`emet_initialize` stays a read.
|
|
53
|
-
- **
|
|
53
|
+
- **8 can replace what is already there, or hand out access.** `write_doc`, `write_doc_commit`, `patch_doc`, `restore_doc`, `emet_setup_complete`,
|
|
54
54
|
`emet_invite_create`, `emet_member_access_create`, `emet_client_approve` (it admits or refuses a new client).
|
|
55
55
|
Prior versions of a document are archived to the history
|
|
56
56
|
collection first, but the visible content a person may be relying on is replaced. A code that grants access
|
|
@@ -65,7 +65,7 @@ Of the 34 tools (`EMET_SUBKEYS=1` adds the four sub-key tools below; with the fl
|
|
|
65
65
|
detect a broken write path. A read-scoped token may call it without `probe`. With `probe: true` it needs
|
|
66
66
|
`emet.write`. The probe deletes only that document. It does not drop the collection.
|
|
67
67
|
|
|
68
|
-
With `EMET_SUBKEYS=1` the host also receives four tools: `emet_subkey_request`, `emet_subkey_claim`, and `emet_subkey_end_session` (additive), and `emet_subkey_revoke` (it retires a key's authority; the record stays). Write tools gain `session_handle`. `emet_session_open` and `emet_session_close` gain `subkey`. With the flag off those names and fields are absent. First-use setup turns the flag on only when the owner says yes and the server reads `.env`. A hosted server refuses that yes. A single client stays on the flag-off list. See [SUBKEYS.md](SUBKEYS.md).
|
|
68
|
+
With `EMET_SUBKEYS=1` the host also receives four tools: `emet_subkey_request`, `emet_subkey_claim`, and `emet_subkey_end_session` (additive), and `emet_subkey_revoke` (it retires a key's authority; the record stays). Write tools gain `session_handle`. `emet_session_open` and `emet_session_close` gain `subkey`. With the flag off those names and fields are absent. First-use setup turns the flag on only when the owner says yes and the server reads `.env`. A hosted server refuses that yes. A single client stays on the flag-off list. The owner approves a new writer, and a bot's own key, on `/owner/chooser`. An AI does not grant a writer. In a session opened with a sub-key, every later write passes the `session_handle` that `emet_session_open` returned once. A missing or different handle is refused, and nothing is written. The handle is not a receipt. See [SUBKEYS.md](SUBKEYS.md).
|
|
69
69
|
|
|
70
70
|
**`openWorldHint` is false on every tool.** The tools talk to this server's configured database
|
|
71
71
|
and nothing else: no filesystem and no shell. The sign-in server fetches a client's metadata
|
package/docs/SETUP.md
CHANGED
|
@@ -248,6 +248,16 @@ it should come back `ready` with your existing identity, not `setup_required`. I
|
|
|
248
248
|
`setup_required`, one of the four variables above is wrong; **do not run the setup interview,
|
|
249
249
|
which would write a new identity over your existing one.**
|
|
250
250
|
|
|
251
|
+
## Upgrading to 0.3.2
|
|
252
|
+
|
|
253
|
+
0.3.2 adds door grants, the owner chooser, household rotation, and writer approval. An existing store keeps its records. After you deploy:
|
|
254
|
+
|
|
255
|
+
- Reconnect each host so it sees `write_doc_begin`, `write_doc_append`, `write_doc_commit`, and `write_doc_abort`.
|
|
256
|
+
- The owner approves a new writer on `/owner/chooser`. An AI does not grant a writer.
|
|
257
|
+
- When `EMET_SUBKEYS=1`, a bot that shares the owner login uses its own key. `emet_session_open` returns `session_handle` once, and every later write in that session passes `session_handle`.
|
|
258
|
+
|
|
259
|
+
ISO 9001 7.5.3 / ISO 13485 4.2.5 document-control wording is unchanged. The 0.3.0 error-log role note below is unchanged.
|
|
260
|
+
|
|
251
261
|
## Upgrading to 0.3.0
|
|
252
262
|
|
|
253
263
|
0.3.0 rotates `error_log`. The log is capped at 10,000 entries or 90 days, and the daily summaries are kept in `error_log_summary`. Rotation deletes from `error_log`, so an existing `emetRecordKeeper`
|
|
@@ -347,10 +357,6 @@ the thing is doing its job.
|
|
|
347
357
|
|
|
348
358
|
---
|
|
349
359
|
|
|
350
|
-
## Error reports
|
|
351
|
-
|
|
352
|
-
`emet_error_report` is owner-only and read-only. It returns the report and a draft. EMET does not send mail. The draft address is `EMET_REPORT_EMAIL`. When that variable is unset, the address is `dreamforgestudio@mail.grokbot.com`, the project's report inbox. Set it to your own address to keep reports in house. Set it to an empty string, or to anything other than one plain address, and the tool returns the report and no email.
|
|
353
|
-
|
|
354
360
|
## When it does not work
|
|
355
361
|
|
|
356
362
|
| Symptom | Cause |
|
package/docs/SUBKEYS.md
CHANGED
|
@@ -11,7 +11,7 @@ The Charter and the floor are unchanged. This supports ISO 9001:2015 clause 7.5.
|
|
|
11
11
|
Say **initialize**. Your assistant asks whether more than one bot or AI will use this memory. Answer in your own words. Leaving it out is the same as no.
|
|
12
12
|
|
|
13
13
|
- **No.** Sub-keys stay off. That one client uses its own source tag. The tool list does not grow.
|
|
14
|
-
- **Yes, and this server reads a `.env` file.** Setup writes three settings into that file after your identity is saved: sub-keys on, a pepper the server generates, and version 1. You do not type the pepper, and it is not repeated. Restart (or redeploy) the server once. The tools and `/owner/
|
|
14
|
+
- **Yes, and this server reads a `.env` file.** Setup writes three settings into that file after your identity is saved: sub-keys on, a pepper the server generates, and version 1. You do not type the pepper, and it is not repeated. Restart (or redeploy) the server once. The tools and `/owner/chooser` appear together after that restart. They do not turn on in the server that is already running. `/owner/approvals` stays as a retired pointer.
|
|
15
15
|
- **Yes, and the server takes its settings from the platform** (Railway or anything else that injects environment variables). Setup refuses before it saves anything. No pepper or .env was written. Run setup again without yes to finish the rest. Then set these in the platform's variables and redeploy:
|
|
16
16
|
1. `EMET_SUBKEYS=1`
|
|
17
17
|
2. `EMET_SUBKEY_PEPPER` — generate it yourself, at least 32 bytes, for example with `openssl rand -hex 32`
|
|
@@ -27,12 +27,12 @@ If this memory is already set up and you later add bots, say so. Your assistant
|
|
|
27
27
|
|
|
28
28
|
List each bot's tag in `EMET_SOURCE_TAGS` before it asks for a key. An empty list refuses every request.
|
|
29
29
|
|
|
30
|
-
1. Open `/owner/
|
|
30
|
+
1. Open `/owner/chooser` on the same host you already use for this memory. Enter the passphrase you already use when you connect a device. A correct passphrase opens a short session. A wrong one is counted with the other passphrase attempts. `/owner/approvals` was retired by R4 and answers with a pointer here. The sub-key records stay listed on the chooser. If every AI client is locked out, open `/owner/break-glass` in your own browser.
|
|
31
31
|
2. Each bot that can keep a key file asks for a key with its own tag.
|
|
32
|
-
3. On the
|
|
32
|
+
3. On the chooser, approve that request. Deny applies only to a pending request.
|
|
33
33
|
4. The bot claims the key within 24 hours. It keeps the key where the other bots cannot read it. The key is never written into EMET.
|
|
34
34
|
|
|
35
|
-
A bot
|
|
35
|
+
A bot opens a session with that key. `emet_session_open` returns `session_handle` once. Every later write in that session passes `session_handle`. A write that names the session and omits the handle, or sends a different one, is refused, and nothing is written. The handle is not a receipt and is not written into a document.
|
|
36
36
|
|
|
37
37
|
## A key lasts 30 days
|
|
38
38
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamforgestudiollc/emet",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "EMET 0.3.
|
|
3
|
+
"version": "0.3.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 — 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",
|
package/server.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.dreamforgestudiollc/emet",
|
|
4
4
|
"title": "EMET",
|
|
5
|
-
"description": "
|
|
6
|
-
"version": "0.3.
|
|
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.3",
|
|
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.3",
|
|
26
26
|
"transport": {
|
|
27
27
|
"type": "stdio"
|
|
28
28
|
},
|
|
@@ -76,7 +76,11 @@
|
|
|
76
76
|
"save_transcript",
|
|
77
77
|
"semantic_recall",
|
|
78
78
|
"validate_doc",
|
|
79
|
-
"write_doc"
|
|
79
|
+
"write_doc",
|
|
80
|
+
"write_doc_abort",
|
|
81
|
+
"write_doc_append",
|
|
82
|
+
"write_doc_begin",
|
|
83
|
+
"write_doc_commit"
|
|
80
84
|
]
|
|
81
85
|
}
|
|
82
86
|
}
|
package/src/aleph.js
CHANGED
|
@@ -350,7 +350,7 @@ export function signatureIntegrityOf(row, key) {
|
|
|
350
350
|
|
|
351
351
|
/**
|
|
352
352
|
* May a row be RE-SIGNED after one of the sanctioned metadata marks? (2026-10-02,
|
|
353
|
-
*
|
|
353
|
+
* Reviewer's finding: the marks re-attested metadata_sha256 but left the
|
|
354
354
|
* signature over the old metadata digest, so every superseded or corrected
|
|
355
355
|
* row read signed:false.)
|
|
356
356
|
*
|
|
@@ -360,13 +360,25 @@ export function signatureIntegrityOf(row, key) {
|
|
|
360
360
|
* metadata with only the back-pointers the server itself manages rolled back:
|
|
361
361
|
* - superseded_by / superseded_at: as stored, or absent;
|
|
362
362
|
* - corrected_by: as stored, or any shorter prefix of it, or absent
|
|
363
|
-
* ($addToSet appends, so every earlier list is a prefix of the current one)
|
|
363
|
+
* ($addToSet appends, so every earlier list is a prefix of the current one);
|
|
364
|
+
* - corrected_grant_id: omitted only while corrected_by is being rolled
|
|
365
|
+
* back. It is the latest door that marked the parent (last-writer-wins),
|
|
366
|
+
* not a prefix list. A grant key with no corrected_by is not rolled back.
|
|
367
|
+
* - superseded_grant_id: omitted only together with superseded_by or
|
|
368
|
+
* superseded_at. A grant key with neither pointer is not rolled back.
|
|
364
369
|
* Anything else (no key, no signature, a signature from another key, or any
|
|
365
370
|
* other metadata field changed since it was signed) returns false, and the
|
|
366
371
|
* caller leaves the signature alone, so the row keeps reading signed:false
|
|
367
372
|
* and the change stays visible.
|
|
368
373
|
*/
|
|
369
|
-
export const SANCTIONED_MARK_FIELDS = ['superseded_by', 'superseded_at', 'corrected_by'];
|
|
374
|
+
export const SANCTIONED_MARK_FIELDS = ['superseded_by', 'superseded_at', 'corrected_by', 'corrected_grant_id', 'superseded_grant_id'];
|
|
375
|
+
|
|
376
|
+
function omitMark(obj, keys) {
|
|
377
|
+
const out = {};
|
|
378
|
+
for (const [k, v] of Object.entries(obj)) if (!keys.includes(k)) out[k] = v;
|
|
379
|
+
return out;
|
|
380
|
+
}
|
|
381
|
+
|
|
370
382
|
export function signatureCoversPriorMetadata(row, key) {
|
|
371
383
|
if (!key || !row || typeof row !== 'object') return false;
|
|
372
384
|
const sig = row.signature;
|
|
@@ -379,20 +391,29 @@ export function signatureCoversPriorMetadata(row, key) {
|
|
|
379
391
|
if (typeof row.metadata_sha256 === 'string' && signDigests(row.sha256, row.metadata_sha256, key) === sig
|
|
380
392
|
&& metadataIntegrityOf(row) === true) return true;
|
|
381
393
|
if (!md || typeof md !== 'object' || Array.isArray(md)) return false;
|
|
382
|
-
|
|
394
|
+
// A grant key rolls back only with its pointer. Stripping it alone would
|
|
395
|
+
// re-sign a row whose only change was the grant field.
|
|
396
|
+
const bases = [md];
|
|
383
397
|
if ('superseded_by' in md || 'superseded_at' in md) {
|
|
384
|
-
const
|
|
385
|
-
|
|
398
|
+
const withoutPointers = omitMark(md, ['superseded_by', 'superseded_at']);
|
|
399
|
+
bases.push(withoutPointers);
|
|
400
|
+
if ('superseded_grant_id' in md) bases.push(omitMark(withoutPointers, ['superseded_grant_id']));
|
|
386
401
|
}
|
|
387
|
-
for (const base of
|
|
402
|
+
for (const base of bases) {
|
|
388
403
|
if (ok(base)) return true;
|
|
389
|
-
if (Array.isArray(base.corrected_by))
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
404
|
+
if (!Array.isArray(base.corrected_by)) continue;
|
|
405
|
+
const list = base.corrected_by;
|
|
406
|
+
const grantPresent = Object.prototype.hasOwnProperty.call(base, 'corrected_grant_id');
|
|
407
|
+
const candidates = [];
|
|
408
|
+
for (let k = list.length - 1; k >= 0; k--) candidates.push({ ...base, corrected_by: list.slice(0, k) });
|
|
409
|
+
const { corrected_by, ...withoutCorrected } = base;
|
|
410
|
+
candidates.push(withoutCorrected);
|
|
411
|
+
for (const candidate of candidates) {
|
|
412
|
+
if (ok(candidate)) return true;
|
|
413
|
+
if (grantPresent && Object.prototype.hasOwnProperty.call(candidate, 'corrected_grant_id')) {
|
|
414
|
+
const { corrected_grant_id, ...withoutGrant } = candidate;
|
|
415
|
+
if (ok(withoutGrant)) return true;
|
|
393
416
|
}
|
|
394
|
-
const { corrected_by, ...withoutCorrected } = base;
|
|
395
|
-
if (ok(withoutCorrected)) return true;
|
|
396
417
|
}
|
|
397
418
|
}
|
|
398
419
|
return false;
|
package/src/annotations.js
CHANGED
|
@@ -81,7 +81,7 @@ const ANNOTATION_TABLE = {
|
|
|
81
81
|
|
|
82
82
|
// --- Additive writes. These add; they do not remove or replace. -----------
|
|
83
83
|
// Was READ until 2026-09-27: "it does not write anything itself". Since the
|
|
84
|
-
// blocked-close cap
|
|
84
|
+
// blocked-close cap (thatcommit) it records each blocked attempt in
|
|
85
85
|
// close_attempts, so a read-only hint would be untrue (code audit, 1.3).
|
|
86
86
|
emet_session_close: { title: 'Check session is saved', ...ADD },
|
|
87
87
|
emet_client_approve: { title: 'Approve a new client', ...REPLACE },
|
|
@@ -101,6 +101,10 @@ const ANNOTATION_TABLE = {
|
|
|
101
101
|
// --- Replacing writes. Prior versions are archived, but the visible
|
|
102
102
|
// content of an existing document is replaced. -------------------------
|
|
103
103
|
write_doc: { title: 'Write a document', ...REPLACE },
|
|
104
|
+
write_doc_begin: { title: 'Begin a staged document write', ...ADD },
|
|
105
|
+
write_doc_append: { title: 'Append a staged document chunk', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
106
|
+
write_doc_commit: { title: 'Commit a staged document write', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
|
|
107
|
+
write_doc_abort: { title: 'Abort a staged document write', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
104
108
|
patch_doc: { title: 'Edit a document', ...REPLACE },
|
|
105
109
|
emet_setup_complete: { title: 'Complete setup', ...REPLACE },
|
|
106
110
|
|
|
@@ -123,7 +127,7 @@ const ANNOTATION_TABLE = {
|
|
|
123
127
|
// probe document and removes it again, so it is not declared read-only -
|
|
124
128
|
// a health check that only reads cannot detect a broken write path.
|
|
125
129
|
// Replaced emet_setup_status, get_status and emet_verify_connection on
|
|
126
|
-
// 2026-09-27 (
|
|
130
|
+
// 2026-09-27 (the owner: consolidate overlapping tools). -----------------------
|
|
127
131
|
emet_status: { title: 'Store status and write-path probe', readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false }
|
|
128
132
|
};
|
|
129
133
|
|
package/src/approve-throttle.js
CHANGED
package/src/atlas-role.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodedError } from './error-codes.js';
|
|
2
2
|
/**
|
|
3
3
|
* EMET - the least-privilege MongoDB Atlas role for the server's own login
|
|
4
|
-
* (2026-09-29; security audit question 9, staging
|
|
4
|
+
* (2026-09-29; security audit question 9, the staging note).
|
|
5
5
|
*
|
|
6
6
|
* The record is retained, never deleted (the owner's rule, 2026-09-08). Until
|
|
7
7
|
* this role existed that rule lived only in the code: the server's login held
|