@runeditrun/rer 0.2.96 → 0.2.97
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/global/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.97
|
|
4
|
+
|
|
5
|
+
### Seed-door decision relay
|
|
6
|
+
|
|
7
|
+
- The relay's page sizing work is now bounded: each page is sized from the decisions it holds without rebuilding the whole page for every candidate, and page edges, cursor and `more` stay identical to before.
|
|
8
|
+
- Business custody is documented where adopters read it. For each relayed decision the Business holds only the 17-key public projection, including raw resource URIs for records the decision touched, readable only by the owner of the Business. Erasing the record purges the live projection through the next tombstone pull; unpairing, re-pairing or stopping the seed purges that installation's Business copy. The seed keeps no additional copy beyond its own audit and the bounded relay feed (one row per decision). Adopters record this external custody store in their erasure reporting.
|
|
9
|
+
|
|
10
|
+
### Upgrading a seed that already adopted the agent door
|
|
11
|
+
|
|
12
|
+
- `modules/agent-door/ADOPTING.md` has a documented upgrade path for a copy at an earlier schema, from `rer-v0.2.93`, `rer-v0.2.94`, `rer-v0.2.95` or `rer-v0.2.96`: a table of the additive SQL each starting release needs, checked with `PRAGMA table_info` before it is written, and put in one new numbered migration. A seed that applied only the relay migration on an older schema fails `BASE-AGENT-009.relay.count`, because tool admission reads `agent_door_calls.expires_at`. A frozen-schema upgrade test executes the documented SQL against the tagged 0.2.93, 0.2.95 and 0.2.96 schemas and compares the result with the schema applied fresh.
|
|
13
|
+
|
|
14
|
+
### Conformance
|
|
15
|
+
|
|
16
|
+
- Agent-door conformance accepts completed native continuation replays linked to their original work. Before, a replayed delivery step was refused, which kept seeds with native delivery steps failing `rer verify`. A replay must link an earlier completed original with the same agent, sponsor, consent, client, operation, tool, native item, public key, classes and target; changed identities, item keys, effect facts or policy evidence are still rejected. Its current policy is checked independently, and erased evidence still needs the verifier's pre-erasure snapshot.
|
|
17
|
+
|
|
18
|
+
### Erasing an operator
|
|
19
|
+
|
|
20
|
+
- Erasing an operator now retires the policy person references to them instead of editing the signed policy. Each exact reference in unsigned local policy and in stored copies becomes the marker `person:erased:<erasure_id>`, which matches nobody; a concurrent write by a peer can never store the raw reference. Required approvals stay pending until they expire, and retirement never drops an approver or changes the local revision.
|
|
21
|
+
- The one signed Business policy envelope is kept as delivered, because the seed cannot edit or re-sign it, only until the Business delivers a policy that no longer names the reference. The seed also keeps a value-free, domain-separated SHA-256 suppression digest and the erasure marker so the retirement holds across later deliveries and archive restore; no name, email or phone is stored. Later deliveries that still name the retired person do not darken the door. Report both retained items under `BASE-DATA-006`.
|
|
22
|
+
- Agents shows a replacement notice when a retired approver or reviewer is still in force (`policy.pending_retirement` in `GET /agents/api/state`), linking to the Business policy when paired or to the local editor. The Business must deliver a policy without the reference; in local policy the marker stays until the owner chooses a replacement.
|
|
23
|
+
- Every seed that refreshes to 0.2.97 must land migration `0041_agent_retired_refs.sql` (the `agent_door_retired_refs` table; it travels in installation archives, so do not add it to portability exclusions) and list that table in the native artifact map as the reference seed does; without both, writes naming `person:` references and person erasure fail. Retirement itself is automatic for the declared tables. A seed that erases operators must also declare `agent_door_state` with `retire: { refs: 'policyRefs' }`, pass `subject.policyRefs` from `operatorPolicyRefs`, and put `agentErasureStatements` (which includes the portability checkpoint, even for retirement alone) in the same native erasure batch. Recipe: `modules/agent-door/ADOPTING.md`.
|
|
24
|
+
|
|
3
25
|
## 0.2.96
|
|
4
26
|
|
|
5
27
|
### Business stop
|
|
@@ -17,6 +17,12 @@ completion where no horizon exists. Delete aliases with their call at expiry.
|
|
|
17
17
|
An old key after expiry is a new request under current authorization and cannot
|
|
18
18
|
recover the erased value. Aliases never enter archives, exports or restore.
|
|
19
19
|
The adoption guide defines the map, native transaction and restore custody.
|
|
20
|
+
When an operator is erased, each reference to them in the owner's policy and
|
|
21
|
+
in every stored copy is retired to an erasure marker that matches nobody; the
|
|
22
|
+
one signed envelope as delivered, and a one-way digest of the opaque person
|
|
23
|
+
reference alone (never a name, email or phone), are kept only until the
|
|
24
|
+
Business delivers a policy that no longer names the reference, so the door
|
|
25
|
+
stays live and the retirement survives a restore.
|
|
20
26
|
This clarification does not promote any clause judgment.
|
|
21
27
|
|
|
22
28
|
## Target clauses
|
|
@@ -36,11 +36,24 @@ function reviewProblem(c, calls, index, row, reviews) {
|
|
|
36
36
|
if (!reviews.some(review => review.id === row.review.id && review.decision_id === (row.replay_of ?? row.id))) return 'the review row is not linked to the completed call';
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
function continuationReplay(row, original) {
|
|
40
|
+
// The public key is scoped internally by agent, operation, tool and native
|
|
41
|
+
// item. Replaying a completed mutation returns its saved result, but records
|
|
42
|
+
// a new decision and a replay_of link rather than another completed effect.
|
|
43
|
+
return original?.outcome === 'done' && original.code === null && original.replay_of === null
|
|
44
|
+
&& typeof row.idempotency_key === 'string' && row.idempotency_key.length > 0 && row.idempotency_key.length <= 200 && !row.idempotency_key.includes('\0')
|
|
45
|
+
&& ['operation_id', 'tool', 'continuation_item_id', 'idempotency_key', 'consent', 'client_id'].every(key => row[key] === original[key])
|
|
46
|
+
&& isDeepStrictEqual(row.agent, original.agent) && isDeepStrictEqual(row.sponsor, original.sponsor)
|
|
47
|
+
&& isDeepStrictEqual(row.classes, original.classes) && isDeepStrictEqual(row.resource, original.resource)
|
|
48
|
+
&& row.decision_id === null && row.approval?.id === original.approval?.id && row.review?.id === original.review?.id
|
|
49
|
+
&& !Object.hasOwn(row, 'resources') && !Object.hasOwn(row, 'resource_count');
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
// Only an earlier harness row can establish the origin of native work. A
|
|
40
53
|
// marker alone never exempts an embedded call from the ordered expectations.
|
|
41
54
|
function continuationRows(c, rows, differs, report = () => {}) {
|
|
42
55
|
const recorded = new Map(c.calls.filter(call => call.kind !== 'approval/execute' && call.decision?.id).map(call => [call.decision.id, call]));
|
|
43
|
-
const origins = new Map(), accepted = new Set(); let index = 0;
|
|
56
|
+
const origins = new Map(), earlier = new Map(), accepted = new Set(); let index = 0;
|
|
44
57
|
for (const row of rows) {
|
|
45
58
|
const call = recorded.get(row.id);
|
|
46
59
|
if (call) {
|
|
@@ -48,6 +61,7 @@ function continuationRows(c, rows, differs, report = () => {}) {
|
|
|
48
61
|
if (row.tool === call.name && row.agent?.id === principal.agent.id && row.agent?.name === principal.agent.name && row.agent?.specialist === principal.agent.specialist && row.sponsor?.id === principal.sponsor && row.consent === principal.consent && row.client_id === principal.clientId && typeof row.operation_id === 'string' && row.operation_id) {
|
|
49
62
|
if (!origins.has(row.operation_id)) origins.set(row.operation_id, []);
|
|
50
63
|
origins.get(row.operation_id).push(row);
|
|
64
|
+
earlier.set(row.id, row);
|
|
51
65
|
}
|
|
52
66
|
continue;
|
|
53
67
|
}
|
|
@@ -56,12 +70,15 @@ function continuationRows(c, rows, differs, report = () => {}) {
|
|
|
56
70
|
const dispositions = ['autonomous', 'review', 'approval', 'blocked', 'unset', 'unavailable', 'paused'];
|
|
57
71
|
const classes = Array.isArray(row.classes) && row.classes.length > 0 && new Set(classIds(row.classes)).size === row.classes.length && row.classes.every(item => AGENT_CLASSES.includes(item.class) && item.facts && typeof item.facts === 'object');
|
|
58
72
|
const rules = classes && Array.isArray(row.rules) && isDeepStrictEqual(classIds(row.rules), classIds(row.classes)) && row.rules.every(rule => dispositions.includes(rule.do) && (['unset', 'unavailable', 'paused'].includes(rule.do) ? rule.rule === null : typeof rule.rule === 'string' && rule.rule.length > 0));
|
|
73
|
+
const completed = (row.outcome === 'done' && row.replay_of === null || row.outcome === 'replayed' && continuationReplay(row, earlier.get(row.replay_of)))
|
|
74
|
+
&& ['autonomous', 'review', 'approval'].includes(row.decision) && row.code === null;
|
|
75
|
+
const refused = row.outcome === 'refused' && row.replay_of === null && typeof row.code === 'string' && row.code.length > 0;
|
|
59
76
|
const valid = Boolean(origin) && row.door === 'embedded' && typeof row.continuation_item_id === 'string' && row.continuation_item_id.trim().length > 0
|
|
60
77
|
&& typeof row.label === 'string' && row.label.includes(' for ') && Number.isFinite(Date.parse(row.at))
|
|
61
78
|
&& Number.isSafeInteger(row.revision) && row.revision > 0 && rules && row.decision === dispositions[Math.max(...row.rules.map(rule => dispositions.indexOf(rule.do)))]
|
|
62
|
-
&& (
|
|
63
|
-
report(`BASE-AGENT-009.1.continuation.${index++}`, valid, 'Native continuation must link an earlier harness operation with the same agent, sponsor, consent and client, a recorded policy decision and a completed or coded refused outcome.');
|
|
64
|
-
if (valid) accepted.add(row);
|
|
79
|
+
&& (completed || refused) && differs === 0;
|
|
80
|
+
report(`BASE-AGENT-009.1.continuation.${index++}`, valid, 'Native continuation must link an earlier harness operation with the same agent, sponsor, consent and client, a recorded policy decision and a completed, linked replayed or coded refused outcome.');
|
|
81
|
+
if (valid) { accepted.add(row); earlier.set(row.id, row); }
|
|
65
82
|
}
|
|
66
83
|
return accepted;
|
|
67
84
|
}
|