@runeditrun/rer 0.2.94 → 0.2.96
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/README.md +16 -2
- package/cli/README.md +5 -1
- package/cli/agent-door.mjs +4 -0
- package/cli/agent-journey-fixtures.mjs +1 -1
- package/cli/authoring.mjs +1 -1
- package/cli/business/carry-files.mjs +142 -0
- package/cli/business/carry.mjs +37 -83
- package/cli/business/choices.mjs +17 -8
- package/cli/business/connect.mjs +6 -5
- package/cli/business/invocation.mjs +3 -2
- package/cli/business/local-commands.mjs +6 -6
- package/cli/business/questions.mjs +4 -1
- package/cli/business/state.mjs +4 -1
- package/cli/checkout-folders.mjs +14 -0
- package/cli/checkout-preparation.mjs +83 -0
- package/cli/contract.mjs +1 -1
- package/cli/door-clauses.mjs +29 -2
- package/cli/hosted-output.mjs +14 -3
- package/cli/hosted-queue-producers.mjs +43 -0
- package/cli/jsonc.mjs +1 -115
- package/cli/parse.mjs +1 -1
- package/cli/portability-migrations.mjs +2 -12
- package/edition-authoring/archive-source.mjs +86 -1
- package/edition-authoring/base-copies.mjs +15 -45
- package/edition-authoring/cli.mjs +1 -1
- package/edition-authoring/edition-migrations.mjs +2 -2
- package/edition-authoring/module-closure.mjs +119 -50
- package/edition-authoring/module-packages.mjs +12 -5
- package/edition-authoring/module-syntax.mjs +13 -50
- package/edition-authoring/runtime-dependencies.mjs +4 -4
- package/foundation/runtime/contract-docs.mjs +1 -1
- package/global/CHANGELOG.md +70 -0
- package/global/README.md +16 -2
- package/global/cli/layout.mjs +3 -0
- package/global/launch/facts.mjs +1 -29
- package/global/launch/state.mjs +3 -6
- package/global/list.mjs +9 -15
- package/modules/agent-door/CLAUSES.md +12 -0
- package/modules/agent-door/conformance/audit.mjs +22 -4
- package/modules/agent-door/conformance/discovery.mjs +32 -1
- package/modules/agent-door/conformance/erasure.mjs +103 -0
- package/modules/agent-door/conformance/index.mjs +13 -4
- package/modules/agent-door/conformance/journey.mjs +19 -1
- package/modules/agent-door/conformance/policy-phases.mjs +34 -1
- package/modules/agent-door/conformance/protocol.mjs +13 -3
- package/modules/agent-door/conformance/relay.mjs +63 -0
- package/modules/agent-door/conformance/unpair.mjs +47 -0
- package/modules/deploy-kit/jsonc.mjs +115 -0
- package/modules/deploy-kit/migration-directory.mjs +16 -0
- package/modules/deploy-kit/prepare.mjs +1 -1
- package/modules/deploy-kit/templates.mjs +9 -4
- package/modules/erasure/cascade.mjs +4 -4
- package/modules/erasure/index.d.mts +1 -1
- package/modules/erasure/index.mjs +1 -1
- package/modules/import-kit/src/d1/README.md +16 -1
- package/modules/import-kit/src/d1/preserved-reverse.ts +5 -2
- package/modules/import-kit/src/d1/read-fence.ts +14 -2
- package/modules/import-kit/src/d1/reverse.ts +4 -1
- package/modules/import-kit/src/d1/sets.ts +8 -0
- package/modules/import-kit/src/d1/snapshot-text.ts +68 -0
- package/modules/import-kit/src/d1/undo-report.ts +4 -1
- package/modules/import-kit/src/door/ADOPTING.md +9 -4
- package/modules/portability/README.md +28 -2
- package/modules/portability/bookkeeping.mjs +8 -4
- package/modules/portability/checkout-history.mjs +12 -6
- package/modules/portability/import.mjs +1 -1
- package/modules/portability/storage.mjs +7 -1
- package/modules/portability/worker-history.d.mts +1 -1
- package/modules/portability/worker-history.mjs +1 -1
- package/onboarding/operator-migrations.mjs +5 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import {safe} from './files.mjs';
|
|
|
3
3
|
import {fileURLToPath} from 'node:url';
|
|
4
4
|
const dataPath = 'foundation/edition-migrations.json';
|
|
5
5
|
const quote = value => "'" + value.replaceAll("'", "'\\''") + "'";
|
|
6
|
-
export function editionMigrations(record, {tree, read, revision, base, recordPath, offline, consent = []}) {
|
|
6
|
+
export function editionMigrations(record, {tree, read, revision, base, recordPath, offline, fromApi, consent = []}) {
|
|
7
7
|
let migrations = [];
|
|
8
8
|
const fail = reason => { throw Error(`Base edition migration data error: ${reason}. Repair ${dataPath} in Base and commit it, then refresh to that commit; no files were refreshed.`); };
|
|
9
9
|
if (tree.has(dataPath)) {
|
|
@@ -38,7 +38,7 @@ export function editionMigrations(record, {tree, read, revision, base, recordPat
|
|
|
38
38
|
if (missing.length) {
|
|
39
39
|
const cli = fileURLToPath(new URL('./cli.mjs', import.meta.url));
|
|
40
40
|
// Keep automatic acquisition automatic: its temporary checkout closes on refusal.
|
|
41
|
-
const command = `${quote(process.execPath)} ${quote(cli)} refresh-base ${revision}${base ? ' --base ' + quote(base) : ''} --record ${quote(recordPath)}${offline ? ' --offline' : ''}${applicable.map(step => ' --edition-migration ' + step.id).join('')}`;
|
|
41
|
+
const command = `${quote(process.execPath)} ${quote(cli)} refresh-base ${revision}${base ? ' --base ' + quote(base) : ''} --record ${quote(recordPath)}${offline ? ' --offline' : ''}${fromApi ? ' --from-api' : ''}${applicable.map(step => ' --edition-migration ' + step.id).join('')}`;
|
|
42
42
|
throw Error(`Edition migrations require consent before planning:\n${missing.map(step => `${step.id}: ${step.copies.join(', ')}; ${step.guide}: ${step.edit}`).join('\n')}\nReview the guides and repeat exactly: ${command}\nRefresh will leave these edition-owned edits owed; no files were refreshed.`);
|
|
43
43
|
}
|
|
44
44
|
return applicable;
|
|
@@ -5,6 +5,7 @@ import {raw, safe, requirePhysical, testSource, freedEntries, toolFile} from './
|
|
|
5
5
|
import {dependencies, resolve, external, bindings, lexicalExports} from './runtime-dependencies.mjs';
|
|
6
6
|
import {relocateDependencies} from './module-edges.mjs';
|
|
7
7
|
import {sharedNamespaces} from './copy-namespaces.mjs';
|
|
8
|
+
import {fileURLToPath} from 'node:url';
|
|
8
9
|
import {acknowledgementCommand} from './base-acknowledgements.mjs';
|
|
9
10
|
import {checkModulePackages} from './module-packages.mjs';
|
|
10
11
|
const code = name => /\.(?:[cm]?[jt]s|[jt]sx)$/.test(name) && !testSource(name);
|
|
@@ -18,6 +19,7 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
18
19
|
const mappings = plans.filter(plan => !plan.retired).map(({copy}) => ({copy, ...namespace(copy)})).filter(mapping => mapping.from);
|
|
19
20
|
const shared = sharedNamespaces(mappings);
|
|
20
21
|
const cache = new Map(), planned = new Map(), recorded = new Map(), queue = [], withheld = [];
|
|
22
|
+
const retainedTargets = new Set();
|
|
21
23
|
const disk = {has: name => {
|
|
22
24
|
try { return fs.lstatSync(path.join(root, name)).isFile(); }
|
|
23
25
|
catch (error) { if (['ENOENT', 'ENOTDIR'].includes(error.code)) return false; throw error; }
|
|
@@ -32,10 +34,11 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
32
34
|
if (stat) removedObjects.add(target, stat);
|
|
33
35
|
}
|
|
34
36
|
const inspect = target => requirePhysical(root, safe(target), {cache, freed: removedObjects.has});
|
|
35
|
-
function enqueue(plan, source, entry,
|
|
37
|
+
function enqueue(plan, source, entry, retained = false) {
|
|
36
38
|
const target = mapped(source, plan.copy);
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
+
if (retained) retainedTargets.add(target);
|
|
40
|
+
else planned.set(target, {plan, source, entry});
|
|
41
|
+
if (code(source)) queue.push({plan, source, target, entry, retained});
|
|
39
42
|
}
|
|
40
43
|
for (const plan of plans) {
|
|
41
44
|
for (const target of Object.keys(plan.copy.files)) recorded.set(target, plan);
|
|
@@ -44,7 +47,7 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
44
47
|
}
|
|
45
48
|
const directoryAdditions = new Set([...planned].filter(([target, {plan}]) => !Object.hasOwn(plan.copy.files, target) && !tree.has(plan.copy.originPath)).map(([target]) => target));
|
|
46
49
|
const packageRoots = new Set([...planned.keys()].filter(target => !directoryAdditions.has(target)));
|
|
47
|
-
for (const {target,
|
|
50
|
+
for (const {target, retained} of queue) if (retained) packageRoots.add(target);
|
|
48
51
|
function namespace(copy) {
|
|
49
52
|
const file = Object.hasOwn(copy.files, copy.path) || tree.has(copy.originPath);
|
|
50
53
|
if (file && path.posix.basename(copy.path) !== path.posix.basename(copy.originPath)) return {};
|
|
@@ -82,7 +85,15 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
82
85
|
if (index.has(target)) {
|
|
83
86
|
if (!physical.stat) refuse(target, 'tracked edition source is missing', `git restore -- ${quote(target)}`);
|
|
84
87
|
ownerSources.set(target, source);
|
|
85
|
-
|
|
88
|
+
// Retain ownership and bytes, but close Base edges introduced by seed
|
|
89
|
+
// reconciliation just as for an acknowledged adaptation. Seed-only
|
|
90
|
+
// helpers have no Base source and do not acquire a guessed origin.
|
|
91
|
+
if (tree.has(source) && code(source) && !retainedTargets.has(target)) {
|
|
92
|
+
retainedTargets.add(target);
|
|
93
|
+
packageRoots.add(target);
|
|
94
|
+
queue.push({source, target, retained: true});
|
|
95
|
+
}
|
|
96
|
+
return;
|
|
86
97
|
}
|
|
87
98
|
if (physical.stat && !index.has(target)) refuse(target, 'existing file has no Base copy record or Git index entry', `git add -f -- ${quote(target)}`);
|
|
88
99
|
let plan = plans.find(plan => inside(target, plan.copy.path));
|
|
@@ -110,7 +121,7 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
110
121
|
// records and plans satisfy that local edge before looking for a new source.
|
|
111
122
|
const view = {
|
|
112
123
|
has: name => planned.has(name) || recorded.has(name) || index.has(name) && disk.has(name),
|
|
113
|
-
read: name => planned.has(name) ? blob(planned.get(name).entry) : local(name),
|
|
124
|
+
read: name => planned.has(name) ? relocations.get(name)?.toString('utf8') ?? blob(planned.get(name).entry) : local(name),
|
|
114
125
|
};
|
|
115
126
|
function requests(bytes, source, target) {
|
|
116
127
|
return dependencies(bytes, source).filter(request => {
|
|
@@ -125,6 +136,9 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
125
136
|
const originScope = {}, targetScope = {}, manifests = new Set();
|
|
126
137
|
const dependency = resolve(tree, source, specifier, {...request, manifests, package: originScope});
|
|
127
138
|
const destination = resolve(view, target, specifier, {...request, package: targetScope});
|
|
139
|
+
// A retained file's own relative imports without a Base counterpart stay
|
|
140
|
+
// seed-owned. Only Base dependencies participate in copy delivery.
|
|
141
|
+
if (retainedTargets.has(target) && specifier.startsWith('.') && !dependency) return {...request, external: true};
|
|
128
142
|
if (!specifier.startsWith('.')) {
|
|
129
143
|
if (originScope.external && targetScope.external && originScope.value === targetScope.value) return {...request, external: true};
|
|
130
144
|
if (!targetScope.managed || originScope.external || targetScope.external) return {...request, reason: 'runtime package scope differs from its Base source'};
|
|
@@ -140,9 +154,9 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
140
154
|
return {...request, dependency: source, destination, satisfied: true};
|
|
141
155
|
}
|
|
142
156
|
const expected = dependency && path.posix.join(path.posix.dirname(target), path.posix.relative(path.posix.dirname(source), dependency));
|
|
143
|
-
// Relocate only new deliveries.
|
|
144
|
-
//
|
|
145
|
-
if (specifier.startsWith('.') && dependency && !recorded.has(target) && !witness(expected, dependency)) {
|
|
157
|
+
// Relocate only new deliveries. Retained files keep their seed-owned
|
|
158
|
+
// imports; a missing Base edge must have a witness at that exact path.
|
|
159
|
+
if (specifier.startsWith('.') && dependency && !recorded.has(target) && !retainedTargets.has(target) && !witness(expected, dependency)) {
|
|
146
160
|
const destinations = recordedDestination(dependency);
|
|
147
161
|
if (destinations.length > 1) return {...request, manifests, dependency, destination: expected,
|
|
148
162
|
reason: `ambiguous Base copy mappings for ${dependency}: ${destinations.join(', ')}`};
|
|
@@ -164,16 +178,16 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
164
178
|
// Preserve these edges during traversal; required planned files may still
|
|
165
179
|
// complete a sparse historical copy by satisfying them.
|
|
166
180
|
const baseline = new Set();
|
|
167
|
-
for (const {plan, source, target} of queue) {
|
|
168
|
-
if (!Object.hasOwn(plan.copy.files, target) || !disk.has(target) || bootstrap(source)) continue;
|
|
181
|
+
for (const {plan, source, target, retained} of queue) {
|
|
182
|
+
if (retained || !Object.hasOwn(plan.copy.files, target) || !disk.has(target) || bootstrap(source)) continue;
|
|
169
183
|
for (const request of requests(local(target), source, target)) {
|
|
170
184
|
const candidate = edge(source, target, request);
|
|
171
185
|
if (!resolve(disk, target, request.specifier, request) && !recorded.has(candidate.destination)) baseline.add(key(target, request));
|
|
172
186
|
}
|
|
173
187
|
}
|
|
174
188
|
// Do not let an optional directory addition incidentally fill an old edge.
|
|
175
|
-
for (const {plan, source, target} of queue) {
|
|
176
|
-
if (!Object.hasOwn(plan.copy.files, target) || !disk.has(target)) continue;
|
|
189
|
+
for (const {plan, source, target, retained} of queue) {
|
|
190
|
+
if (retained || !Object.hasOwn(plan.copy.files, target) || !disk.has(target)) continue;
|
|
177
191
|
for (const request of requests(local(target), source, target)) if (baseline.has(key(target, request))) {
|
|
178
192
|
const destination = resolve(view, target, request.specifier, request);
|
|
179
193
|
if (!directoryAdditions.has(destination)) continue;
|
|
@@ -183,40 +197,51 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
183
197
|
withheld.push({path: destination, originPath: addition.source, dependency: request.specifier});
|
|
184
198
|
}
|
|
185
199
|
}
|
|
186
|
-
const incoming = new Set();
|
|
187
|
-
for (const item of queue) for (const request of requests(item.
|
|
200
|
+
const incoming = new Set(), newlyRequired = new Set();
|
|
201
|
+
for (const item of queue) for (const request of requests(item.retained ? local(item.target) : blob(item.entry), item.source, item.target)) {
|
|
188
202
|
if (baseline.has(key(item.target, request))) continue;
|
|
189
203
|
const {destination} = edge(item.source, item.target, request);
|
|
190
|
-
if (destination)
|
|
204
|
+
if (destination) {
|
|
205
|
+
incoming.add(destination);
|
|
206
|
+
if (!item.retained) {
|
|
207
|
+
const before = disk.has(item.target) ? local(item.target) : '';
|
|
208
|
+
const previous = dependencies(before, item.source);
|
|
209
|
+
const oldNames = bindings(before, request.types, item.source).get(request.specifier);
|
|
210
|
+
const names = bindings(blob(item.entry), request.types, item.source).get(request.specifier);
|
|
211
|
+
if (!previous.some(old => key(item.target, old) === key(item.target, request)) ||
|
|
212
|
+
[...names ?? []].some(name => !oldNames?.has(name))) newlyRequired.add(destination);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
191
215
|
}
|
|
192
216
|
function exportsAt(target, types = false, seen = new Set()) {
|
|
193
217
|
if (seen.has(target)) return new Set();
|
|
194
218
|
seen.add(target); inspect(target);
|
|
195
|
-
if (!
|
|
219
|
+
if (!view.has(target)) return null;
|
|
196
220
|
if (!types && /\.d\.[cm]?ts$/.test(target)) return new Set();
|
|
197
221
|
if (target.endsWith('.json')) return new Set(['default']);
|
|
198
|
-
const result = lexicalExports(
|
|
199
|
-
const next = resolve(
|
|
222
|
+
const result = lexicalExports(view.read(target), specifier => {
|
|
223
|
+
const next = resolve(view, target, specifier, {types});
|
|
200
224
|
return next ? exportsAt(next, types, seen) : null;
|
|
201
|
-
}, types);
|
|
225
|
+
}, types, target);
|
|
202
226
|
if (result === null) return null;
|
|
203
227
|
const declaration = target.replace(/\.mjs$/, '.d.mts').replace(/\.js$/, '.d.ts');
|
|
204
|
-
if (types && declaration !== target &&
|
|
228
|
+
if (types && declaration !== target && view.has(declaration)) {
|
|
205
229
|
const declared = exportsAt(declaration, true, seen);
|
|
206
230
|
if (declared === null) return null;
|
|
207
231
|
for (const name of declared) result.add(name);
|
|
208
232
|
}
|
|
209
233
|
return result;
|
|
210
234
|
}
|
|
235
|
+
const missingExports = new Map(), exportChecks = [];
|
|
211
236
|
const seen = new Set();
|
|
212
237
|
for (let i = 0; i < queue.length; i++) {
|
|
213
|
-
const item = queue[i], {plan, source, target, entry,
|
|
214
|
-
if (seen.has(target) || !
|
|
238
|
+
const item = queue[i], {plan, source, target, entry, retained} = item;
|
|
239
|
+
if (seen.has(target) || !retained && !plan.sources.some(([name]) => name === source)) continue;
|
|
215
240
|
seen.add(target);
|
|
216
|
-
const bytes =
|
|
217
|
-
const before = Object.hasOwn(plan.copy.files, target) && disk.has(target) ? local(target) : '';
|
|
218
|
-
const imports = bindings(bytes), oldBindings = bindings(before);
|
|
219
|
-
const typeImports = bindings(bytes, true), oldTypes = bindings(before, true);
|
|
241
|
+
const bytes = retained ? local(target) : blob(entry);
|
|
242
|
+
const before = !retained && Object.hasOwn(plan.copy.files, target) && disk.has(target) ? local(target) : '';
|
|
243
|
+
const imports = bindings(bytes, false, source), oldBindings = bindings(before, false, source);
|
|
244
|
+
const typeImports = bindings(bytes, true, source), oldTypes = bindings(before, true, source);
|
|
220
245
|
const edges = requests(bytes, source, target).map(request => edge(source, target, request));
|
|
221
246
|
// lock.mjs reads the whole tool dynamically to identify it. Deliver that
|
|
222
247
|
// same file set, including parser notices and modules outside its imports.
|
|
@@ -232,7 +257,13 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
232
257
|
const declaration = source.replace(/\.mjs$/, '.d.mts').replace(/\.cjs$/, '.d.cts');
|
|
233
258
|
if (declaration !== source && tree.has(declaration)) edges.push({dependency: declaration, destination: target.replace(/\.mjs$/, '.d.mts').replace(/\.cjs$/, '.d.cts')});
|
|
234
259
|
const novel = directoryAdditions.has(target) && !required.has(target) && !incoming.has(target);
|
|
235
|
-
|
|
260
|
+
// An incoming importer can newly require a file which the seed has just
|
|
261
|
+
// restored and recorded at this target pin. Close that pristine Base file
|
|
262
|
+
// now; its unresolved siblings are the recovery refresh's deliveries.
|
|
263
|
+
// Ordinary older copies retain their historical edges. Seed-owned roots
|
|
264
|
+
// instead close the Base dependencies of their current local bytes.
|
|
265
|
+
const restored = !retained && plan.copy.revision === revision && newlyRequired.has(target);
|
|
266
|
+
const preserved = request => !restored && baseline.has(key(target, request));
|
|
236
267
|
let hold;
|
|
237
268
|
for (const edge of edges) {
|
|
238
269
|
const {specifier, dependency, destination, satisfied} = edge;
|
|
@@ -253,38 +284,76 @@ export function completeModuleCopies(root, plans, {tree, read, revision, base, b
|
|
|
253
284
|
if (edge.external || preserved(edge)) continue;
|
|
254
285
|
include(dependency, destination);
|
|
255
286
|
const owner = recorded.get(destination);
|
|
256
|
-
if (
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
287
|
+
if (dependency && (retained || !planned.has(destination) && (index.has(destination) || owner?.copy.adapted?.[destination]))) {
|
|
288
|
+
exportChecks.push({target, destination, dependency, specifier, imports, oldBindings, typeImports, oldTypes,
|
|
289
|
+
ancestor: owner?.copy.adapted?.[destination] ?? owner?.copy.revision ?? plan?.copy.revision ?? revision});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (!retained && edges.some(edge => edge.relocation)) relocations.set(target, Buffer.from(relocateDependencies(bytes, edges)));
|
|
293
|
+
}
|
|
294
|
+
// Validate against the complete effective graph, including dependencies just
|
|
295
|
+
// planned through a retained file's re-exports. Unknown exports must not mask
|
|
296
|
+
// a genuinely absent name merely because those dependencies were missing.
|
|
297
|
+
for (const {target, destination, dependency, specifier, imports, oldBindings, typeImports, oldTypes, ancestor} of exportChecks) {
|
|
298
|
+
for (const [types, current, previous] of [[false, imports, oldBindings], [true, typeImports, oldTypes]]) {
|
|
299
|
+
const exported = exportsAt(destination, types);
|
|
300
|
+
for (const name of current.get(specifier) ?? []) if (exported && !exported.has(name) && !previous.get(specifier)?.has(name)) {
|
|
301
|
+
const key = JSON.stringify([target, destination, name, types]);
|
|
302
|
+
missingExports.set(key, {target, destination, dependency, name, ancestor});
|
|
272
303
|
}
|
|
273
304
|
}
|
|
274
|
-
if (!adapted && edges.some(edge => edge.relocation)) relocations.set(target, Buffer.from(relocateDependencies(bytes, edges)));
|
|
275
305
|
}
|
|
276
306
|
const modules = new Map();
|
|
277
307
|
for (const [target, {source, entry}] of planned) if (/\.(?:[cm]?[jt]s|[jt]sx)$/.test(source)) {
|
|
278
308
|
const bytes = blob(entry);
|
|
279
309
|
modules.set(target, {source, bytes, dependencies: requests(bytes, source, target).map(request => edge(source, target, request).destination).filter(Boolean)});
|
|
280
310
|
}
|
|
281
|
-
for (const {source, target,
|
|
311
|
+
for (const {source, target, retained} of queue) if (retained) {
|
|
282
312
|
const bytes = local(target);
|
|
283
|
-
//
|
|
284
|
-
//
|
|
285
|
-
|
|
313
|
+
// Only Base imports still used by the retained file participate in package
|
|
314
|
+
// adoption. Seed-only package choices remain outside refresh's ownership.
|
|
315
|
+
const baseRequests = tree.has(source) ? dependencies(tree.read(source), source) : [];
|
|
316
|
+
const packageRequests = dependencies(bytes, source).filter(request => baseRequests.some(incoming => key(target, incoming) === key(target, request)));
|
|
317
|
+
modules.set(target, {source, bytes, packageRequests,
|
|
318
|
+
dependencies: requests(bytes, source, target).map(request => edge(source, target, request).destination).filter(Boolean)});
|
|
319
|
+
}
|
|
320
|
+
const refusals = [...missingExports.values()].map(({target, destination, dependency, name}) =>
|
|
321
|
+
`Cannot refresh module ${target}: ${destination} does not export ${name} required by Base ${dependency} at ${revision}.`);
|
|
322
|
+
let packages;
|
|
323
|
+
try { packages = checkModulePackages(root, modules, packageRoots, tree); }
|
|
324
|
+
catch (error) { refusals.push(error.message); }
|
|
325
|
+
if (missingExports.size) {
|
|
326
|
+
refusals.push('No files were refreshed. Reconcile each retained dependency in this order:');
|
|
327
|
+
const retained = new Map([...missingExports.values()].map(item => [item.destination, item]));
|
|
328
|
+
for (const {destination, dependency, ancestor} of retained.values()) {
|
|
329
|
+
const comparison = destination + '.base', saved = destination + '.seed', original = destination + '.ancestor';
|
|
330
|
+
const extract = baseArchive ? `cp ${quote(path.join(baseArchive, dependency))} ${quote(comparison)}` :
|
|
331
|
+
`git -C ${quote(base)} show ${quote(revision + ':' + dependency)} > ${quote(comparison)}`;
|
|
332
|
+
const acquisition = baseArchive ? `--base-archive ${quote(baseArchive)}` : `--base ${quote(base)}`;
|
|
333
|
+
const record = recordPath === 'base-copies.json' ? '' : ` --record ${quote(recordPath)}`;
|
|
334
|
+
refusals.push(
|
|
335
|
+
`Save seed edits and the original Base version used as the merge ancestor for ${quote(destination)} (use unused backup paths):`,
|
|
336
|
+
`cp ${quote(destination)} ${quote(saved)}`,
|
|
337
|
+
...(baseArchive ? ['Obtain the original Base version from the recorded pin for the merge ancestor.'] :
|
|
338
|
+
[`git -C ${quote(base)} show ${quote(ancestor + ':' + dependency)} > ${quote(original)}`]),
|
|
339
|
+
'Save the incoming dependency for comparison:', extract,
|
|
340
|
+
'Install and record the incoming Base file before refreshing:',
|
|
341
|
+
`cp ${quote(comparison)} ${quote(destination)}`,
|
|
342
|
+
`node ${quote(fileURLToPath(new URL('./cli.mjs', import.meta.url)))} record-base ${quote(destination)} ${quote(dependency)} ${quote(revision)} ${acquisition}${record}`,
|
|
343
|
+
"Add all named packages at Base's listed versions with the seed's package manager.",
|
|
344
|
+
`rer refresh-base --ref ${quote(revision)} ${acquisition}${record}`,
|
|
345
|
+
'After refresh delivers the new Base dependencies, merge the saved seed edits onto the new Base file; resolve any conflicts:',
|
|
346
|
+
`git merge-file ${quote(destination)} ${quote(original)} ${quote(saved)}`,
|
|
347
|
+
'If the seed source has no Base ancestor, reconcile its edits explicitly instead of guessing an ancestor.',
|
|
348
|
+
'Review the reconciled bytes and mode, then acknowledge this adaptation:',
|
|
349
|
+
acknowledgementCommand(root, destination, recordPath),
|
|
350
|
+
`rer refresh-base --ref ${quote(revision)} ${acquisition}${record}`,
|
|
351
|
+
`Remove ${quote(comparison)}, ${quote(original)} and ${quote(saved)} after reconciliation.`,
|
|
352
|
+
);
|
|
353
|
+
}
|
|
286
354
|
}
|
|
287
|
-
|
|
355
|
+
if (refusals.length) throw Error(refusals.join('\n'));
|
|
356
|
+
|
|
288
357
|
for (const [target, item] of packages.withheld) {
|
|
289
358
|
const {plan, source} = planned.get(target);
|
|
290
359
|
plan.sources = plan.sources.filter(([name]) => name !== source);
|
|
@@ -36,7 +36,7 @@ export function checkModulePackages(root, modules, roots, tree) {
|
|
|
36
36
|
if (!manifests.has(reference)) manifests.set(reference, JSON.parse(tree.read(reference)));
|
|
37
37
|
return version(manifests.get(reference), name);
|
|
38
38
|
}
|
|
39
|
-
for (const [target, module] of modules) for (const request of dependencies(module.bytes, module.source)) {
|
|
39
|
+
for (const [target, module] of modules) for (const request of module.packageRequests ?? dependencies(module.bytes, module.source)) {
|
|
40
40
|
const name = packageName(request.specifier);
|
|
41
41
|
if (!name) continue;
|
|
42
42
|
const scope = {};
|
|
@@ -47,7 +47,10 @@ export function checkModulePackages(root, modules, roots, tree) {
|
|
|
47
47
|
if (!packages.has(key)) packages.set(key, {package: name, version: declared ?? null, baseVersion: pinned ?? null,
|
|
48
48
|
conflict: Boolean(declared && pinned && declared !== pinned), files: []});
|
|
49
49
|
packages.get(key).files.push(target);
|
|
50
|
-
if (!declared)
|
|
50
|
+
if (!declared) {
|
|
51
|
+
if (!missing.has(target)) missing.set(target, new Map());
|
|
52
|
+
missing.get(target).set(name, {package: name, baseVersion: pinned ?? null});
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
55
|
const required = new Set();
|
|
53
56
|
function retain(target) {
|
|
@@ -56,9 +59,13 @@ export function checkModulePackages(root, modules, roots, tree) {
|
|
|
56
59
|
for (const dependency of modules.get(target).dependencies) retain(dependency);
|
|
57
60
|
}
|
|
58
61
|
roots.forEach(retain);
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
const refusals = [];
|
|
63
|
+
for (const [target, items] of missing) if (required.has(target)) for (const item of items.values()) {
|
|
64
|
+
refusals.push(`Cannot refresh module ${target}: package ${item.package} is not declared in the seed's package.json${item.baseVersion ? ` (Base uses ${item.baseVersion})` : ''}. This module is required by retained source.`);
|
|
61
65
|
}
|
|
66
|
+
if (refusals.length) throw Error([...refusals,
|
|
67
|
+
"Review their adoption, declare and install all named dependencies at Base's listed versions with the seed's package manager, then repeat refresh-base; no files were refreshed.",
|
|
68
|
+
].join('\n'));
|
|
62
69
|
// Withhold the whole connected optional addition, including its importers
|
|
63
70
|
// and exclusive siblings, rather than leaving half of a feature behind.
|
|
64
71
|
const neighbours = new Map([...modules.keys()].map(target => [target, new Set()]));
|
|
@@ -71,6 +78,6 @@ export function checkModulePackages(root, modules, roots, tree) {
|
|
|
71
78
|
withheld.set(target, {...reason, path: target, originPath: modules.get(target).source, reason: 'undeclared-package'});
|
|
72
79
|
for (const neighbour of neighbours.get(target)) hold(neighbour, reason);
|
|
73
80
|
}
|
|
74
|
-
for (const [target,
|
|
81
|
+
for (const [target, items] of missing) hold(target, items.values().next().value);
|
|
75
82
|
return {withheld, packageDependencies: [...packages.values()].map(item => ({...item, files: [...new Set(item.files)].sort()}))};
|
|
76
83
|
}
|
|
@@ -1,53 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function template() {
|
|
15
|
-
const start = i++;
|
|
16
|
-
let interpolated = false;
|
|
17
|
-
while (i < source.length) {
|
|
18
|
-
if (source[i] === '\\') { i += 2; continue; }
|
|
19
|
-
if (source[i] === '`') { i++; break; }
|
|
20
|
-
if (source[i] === '$' && source[i + 1] === '{') {
|
|
21
|
-
interpolated = true; i += 2; result.push(';'); scan(true); result.push(';');
|
|
22
|
-
} else i++;
|
|
23
|
-
}
|
|
24
|
-
if (!interpolated) result.push(source.slice(start, i));
|
|
25
|
-
}
|
|
26
|
-
function scan(interpolation = false) {
|
|
27
|
-
let braces = 0;
|
|
28
|
-
while (i < source.length) {
|
|
29
|
-
const c = source[i];
|
|
30
|
-
if (/\s/.test(c)) { i++; continue; }
|
|
31
|
-
if (source.startsWith('//', i)) {
|
|
32
|
-
while (i < source.length && source[i] !== '\n') i++;
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
if (source.startsWith('/*', i)) {
|
|
36
|
-
const end = source.indexOf('*/', i + 2); i = end < 0 ? source.length : end + 2; continue;
|
|
37
|
-
}
|
|
38
|
-
if (c === "'" || c === '"') { result.push(quoted(c)); continue; }
|
|
39
|
-
if (c === '`') { template(); continue; }
|
|
40
|
-
if (interpolation && c === '}' && !braces) { i++; return; }
|
|
41
|
-
if (c === '{') braces++;
|
|
42
|
-
if (c === '}') braces--;
|
|
43
|
-
if (/[\w$]/.test(c)) {
|
|
44
|
-
const start = i++;
|
|
45
|
-
while (i < source.length && /[\w$]/.test(source[i])) i++;
|
|
46
|
-
result.push(source.slice(start, i));
|
|
47
|
-
} else { result.push(c); i++; }
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
scan(); return result;
|
|
1
|
+
import {parse} from './vendor/babel-parser/babel-parser/index.mjs';
|
|
2
|
+
|
|
3
|
+
// Let the maintained parser distinguish strings, regex literals and template
|
|
4
|
+
// text. Keep raw token spelling for the conservative binding/export checks.
|
|
5
|
+
export function tokens(source, filename = 'module.ts') {
|
|
6
|
+
const plugins = ['decorators-legacy', 'deprecatedImportAssert'];
|
|
7
|
+
if (/\.[cm]?tsx?$/.test(filename)) plugins.push(['typescript', {dts: /\.d\.[cm]?ts$/.test(filename)}]);
|
|
8
|
+
if (/\.[jt]sx$/.test(filename)) plugins.push('jsx');
|
|
9
|
+
const ast = parse(source, {sourceFilename: filename, sourceType: 'unambiguous', tokens: true,
|
|
10
|
+
allowReturnOutsideFunction: true, allowUndeclaredExports: true, plugins});
|
|
11
|
+
return ast.tokens.filter(token => typeof token.type !== 'string' &&
|
|
12
|
+
!['eof', 'template', '`'].includes(token.type.label)).map(token =>
|
|
13
|
+
token.type.label === '${' ? ';' : source.slice(token.start, token.end));
|
|
51
14
|
}
|
|
52
15
|
|
|
53
16
|
export function unquote(value) {
|
|
@@ -5,8 +5,8 @@ export {resolve, external} from './module-resolution.mjs';
|
|
|
5
5
|
export {dependencies} from './module-edges.mjs';
|
|
6
6
|
|
|
7
7
|
// Binding checks are lexical: unknown export forms remain unknown, never absent.
|
|
8
|
-
export function bindings(source, types = false) {
|
|
9
|
-
const t = tokens(source), result = new Map();
|
|
8
|
+
export function bindings(source, types = false, filename = 'module.ts') {
|
|
9
|
+
const t = tokens(source, filename), result = new Map();
|
|
10
10
|
for (let i = 0; i < t.length; i++) {
|
|
11
11
|
if (!['import', 'export'].includes(t[i]) || ['.', '('].includes(t[i + 1])) continue;
|
|
12
12
|
let end = i + 1;
|
|
@@ -31,8 +31,8 @@ export function bindings(source, types = false) {
|
|
|
31
31
|
}
|
|
32
32
|
return result;
|
|
33
33
|
}
|
|
34
|
-
export function lexicalExports(source, star, types = false) {
|
|
35
|
-
const t = tokens(source), names = new Set();
|
|
34
|
+
export function lexicalExports(source, star, types = false, filename = 'module.ts') {
|
|
35
|
+
const t = tokens(source, filename), names = new Set();
|
|
36
36
|
for (let i = 0; i < t.length; i++) {
|
|
37
37
|
if (t[i] !== 'export') continue;
|
|
38
38
|
let j = i + 1;
|
|
@@ -555,7 +555,7 @@ const covId = new RegExp(`^${clauseIdSource}$`);
|
|
|
555
555
|
const covHeading = /^(#{1,6})\s+(.+?)\s*#*\s*$/;
|
|
556
556
|
const covDefinition = new RegExp(`^(?:#{1,6}\\s+|(?:[-*+]\\s+)?\\*\\*)(${clauseIdSource})\\s+[—–-]\\s+`);
|
|
557
557
|
const covSplit = text => text.replace(/\r\n?/g, '\n').split('\n');
|
|
558
|
-
const covGenerated = text => /^\uFEFF?<!-- Generated from CONTRACT\.md by contract-docs\./.test(covSplit(text)[0]);
|
|
558
|
+
const covGenerated = text => /^\uFEFF?<!-- Generated from CONTRACT\.md by (?:scripts\/)?contract-docs\./.test(covSplit(text)[0]);
|
|
559
559
|
const covNormalize = text => typeof text === 'string' ? withoutQuoteMarkers(text).replace(/^\s*(?:[-*+]\s+|\d+[.)]\s+)/, '').replace(/[`*_]/g, '').replace(/\s+/gu, '') : '';
|
|
560
560
|
const covKey = entry => JSON.stringify([entry.file, entry.line, entry.cell ?? '']);
|
|
561
561
|
const covLabel = entry => `${entry.file}:${entry.line}${entry.cell ? ` (${entry.cell})` : ''}`;
|
package/global/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.96
|
|
4
|
+
|
|
5
|
+
### Business stop
|
|
6
|
+
|
|
7
|
+
- A stopped or detached Business (signed `detached:true` or the owner's stop) ends every Business-derived authority in the agent door. No Business access token is admitted for any subject, and calls a Business token held for approval or left waiting for admission are refused as `sponsor_unavailable` without a native effect, so approvals held before the stop do not execute after it. `person:` and `role:` approver and reviewer refs match nobody. Seed credentials, native sessions, embedded invocation, `sponsor` refs and the subject mapping are unchanged, so signed policy naming Business people is still adopted and its Pause and revoked lists apply.
|
|
8
|
+
- `PeopleAdapter` gains an optional `businessStopped()` that custom adapters should implement; `Principal` records its admission `source`. Agent conformance proves `BASE-AGENT-004.6` on the seed side (`004.6.seed-*`) and, when the driver can unpair, `BASE-AGENT-004.7`; `rer verify` unpairs by re-serving the same installation without its owner-claim and Business trust bindings.
|
|
9
|
+
|
|
10
|
+
### Business carry and scan
|
|
11
|
+
|
|
12
|
+
- `rer business` connect, next and run carry the Business profile into the first-party checkouts that `rer list` shows in the current or original pairing folder, including stopped apps, as well as running and previously carried apps. A checkout that `rer list` shows as not set up is not written to; it is named with its reason, and a folder with no apps gets a next step.
|
|
13
|
+
- A scan that failed on this computer is told apart from a wait for the owner's consent: run and next point to **Retry** on **Your tools** instead of asking for consent again, and report an allowed scan that is still running or finished.
|
|
14
|
+
- Commands that Business output suggests echo how `rer` was invoked: the installed `rer`, `npx -y @runeditrun/rer`, or the launcher path `install.sh` ran.
|
|
15
|
+
- Each Business on an origin keeps its own device credential, so a second Business no longer overwrites the first and disconnect revokes each one. An older per-origin credential is found through its original pairing record and revoked once.
|
|
16
|
+
- The carry summary prints once for an unchanged result instead of repeating at each check-in of a long-running `rer business run`; skipped-checkout reasons print with it.
|
|
17
|
+
|
|
18
|
+
### Setup output
|
|
19
|
+
|
|
20
|
+
- `rer setup` prints the local D1 migrations it applied once, from the durable ledger, instead of repeating Wrangler's full migration table after each migration.
|
|
21
|
+
|
|
22
|
+
### Shared duties clause check
|
|
23
|
+
|
|
24
|
+
- `rer door clauses --check` skips the same inherited duties as `--write` when the seed's `## Shared duties (Base)` table lists them, and names only missing or stale unlisted clauses. Without that table it still checks all thirteen duties. `--write` still requires the table.
|
|
25
|
+
- Contract-document coverage treats a generated view headed by a seed's `scripts/contract-docs` generator as generated.
|
|
26
|
+
|
|
27
|
+
### Run page
|
|
28
|
+
|
|
29
|
+
- The "Run it yourself" path on the /run page is badged "On your computer" instead of "100% free".
|
|
30
|
+
|
|
31
|
+
### Seed-door decision relay
|
|
32
|
+
|
|
33
|
+
- Add the signed Business decision pull at `/api/rer/agent-decisions`, with bounded public audit projections, erasure-aware feed triggers and default-seed migration 0040. Business stop and pairing checks refuse with empty 404s. Seeds that refresh to 0.2.96 must land the relay migration (copy `0040_agent_door_relay.sql`), the `POST /api/rer/agent-decisions` route line and the `agent_door_relay` erasure-map entry in the same commit: until they do, `rer verify` fails `BASE-AGENT-009.relay`. Recipe: `modules/agent-door/ADOPTING.md`. The route ships dark: the Business sees nothing until it starts pulling, but the migration's table and triggers record decisions from adoption.
|
|
34
|
+
|
|
35
|
+
## 0.2.95
|
|
36
|
+
|
|
37
|
+
### Native agent erasure and safe replay
|
|
38
|
+
|
|
39
|
+
- Native subject erasure now covers mapped agent-door payloads together with the subject, including identifier-linked proposals and recorded-name and colon mentions. Value-free decision custody and secret-keyed replay refusal aliases are retained only for the fixed 30-day completion window, and replay aliases are excluded from archives.
|
|
40
|
+
- Known limit, accepted 30 Oct 2026: a numeric-only recorded name such as `1` also redacts unrelated text such as `1:30 PM`. Erasure fails closed rather than leaving the name behind.
|
|
41
|
+
- Adopters append the custody and window schema in their own new migrations (Base's reference migrations are `0038_agent_erasure_custody.sql` and `0039_agent_replay_window.sql`), map every installed agent table and column into their existing native erasure transaction, reuse the installation secret and fence, and schedule `expireReplayCalls`. Recipe: `modules/agent-door/ADOPTING.md`. Seed acceptance is not promoted automatically.
|
|
42
|
+
|
|
43
|
+
### MCP clients and native admission
|
|
44
|
+
|
|
45
|
+
- The agent door accepts the June 2025 MCP protocol alongside November 2025 and July 2026. It authenticates before validating the protocol, accepts a body-only `initialize`, and treats headerless stateless requests as June 2025. Modern clients keep consistent version, method and name metadata.
|
|
46
|
+
- Concurrent native admissions wait for the bounded policy slot and recheck current authority and policy before any effect.
|
|
47
|
+
- Narrowing injection conformance requires `invalid_arguments`. Declared disposable queue producers can be failed and restored before enqueue. Refresh the complete shared door and conformance dependency set. Sources: `modules/agent-door/README.md`, `modules/agent-door/ADOPTING.md`, `cli/hosted-queue-producers.mjs`.
|
|
48
|
+
|
|
49
|
+
### Preserved data import and undo
|
|
50
|
+
|
|
51
|
+
- Large preserved-data undo and undo-report resume operations (tens of thousands of effects) now complete within the D1 transport limit with their atomic guarantees unchanged. The complete atomic snapshot for `readD1PersistedImport` exports retains its existing 2 MiB transport cap; oversized exports still refuse with `ImportSizeLimitError` naming `targetKinds`.
|
|
52
|
+
|
|
53
|
+
### Spool native-Wrangler history restore
|
|
54
|
+
|
|
55
|
+
- Optional seed-owned build evidence now supports a plain `d1_migrations` ledger only when its names select an exact ordered file prefix whose replay reproduces the complete live schema. Unknown, gapped or reordered history and schema drift refuse before any restore write. Archive history still needs its own authenticated proof, and no historical hashes are invented or backfilled.
|
|
56
|
+
- Adopt `legacyMigrationEvidence()` from `@runeditrun/rer/portability-evidence` in existing Vite plugins, import `virtual:rer-legacy-migration-evidence` in the archive server adapter, and pass `migrations: () => workerMigrations(db, policy, evidence)` to `createPortability`. Retain the reviewed applied migration files, refresh helpers and copied portability runtime together, and retain one service through the initial upload. Recipe: `modules/portability/README.md`. This is Base support; Spool's published-package restore proof is reported separately.
|
|
57
|
+
|
|
58
|
+
### Source refresh and recovery
|
|
59
|
+
|
|
60
|
+
- `rer refresh-base` closes the dependencies imported by retained seed modules, includes the deploy-kit JSONC and migration-directory helpers, and refuses undeclared retained dependencies before any write.
|
|
61
|
+
- Refresh from a full immutable commit SHA, an extracted `--base-archive DIR`, or authenticated `--from-api` reads. A tag name is not accepted as `--ref`; resolve it first with `git rev-parse 'rer-v0.2.95^{commit}'`. Archive source identity is caller-supplied and cannot prove missing historical ancestry; API reads use checked immutable objects. See `edition-authoring/ADOPTING.md` and `edition-authoring/README.md`.
|
|
62
|
+
|
|
63
|
+
### Shared duties clause handling
|
|
64
|
+
|
|
65
|
+
- `rer door clauses --write` requires a `## Shared duties (Base)` table with a `Base duty` column and skips the inherited duties listed there, preserving existing status, evidence, gap and judgment. Read-only `--check` still inspects clause definitions, including listed duties.
|
|
66
|
+
- Review the generated contract views and regenerate the seed's source lock last. A seed's rows have not passed merely because Base delivered the duties. Commands and behavior: `modules/agent-door/ADOPTING.md`.
|
|
67
|
+
|
|
68
|
+
### Previously carried local checkouts
|
|
69
|
+
|
|
70
|
+
- Business check-in refreshes the existing carry in stopped checkouts as well as live ones, keeping the identity and private-file checks and the prior carry when a refresh is refused. Update the installed CLI and use the existing supervisor check-in; there is no new connect authority and no claim that an app has applied the carry.
|
|
71
|
+
- Follow-up: N-07's four minor follow-ups remain later work and are not part of this release.
|
|
72
|
+
|
|
3
73
|
## 0.2.94
|
|
4
74
|
|
|
5
75
|
- Include the shared checkout-history validator in the documented portability runtime copy, preserving self-contained Worker and CLI adoption.
|
package/global/README.md
CHANGED
|
@@ -23,6 +23,10 @@ for adoption, refusal behavior, JSON fields and the original Base-checkout form.
|
|
|
23
23
|
contract, preserving its judgments and its own specialist clauses, then runs
|
|
24
24
|
contract document generation and checking. `rer door clauses --check` reports
|
|
25
25
|
missing or stale requirements without writing; use `--cwd DIR` to select a seed.
|
|
26
|
+
Writing requires a `Shared duties (Base)` table and skips duties listed in its
|
|
27
|
+
`Base duty` column. Unlisted duties are synchronized as clauses; a missing table
|
|
28
|
+
refuses the write. The read-only check skips the same listed duties; without a
|
|
29
|
+
table it checks all thirteen clause definitions.
|
|
26
30
|
The CLI can sync a contract before runtime adoption; regenerate the seed's source lock last.
|
|
27
31
|
See [agent door adoption](https://github.com/runeditrun/base/blob/main/modules/agent-door/ADOPTING.md#contract-clauses).
|
|
28
32
|
|
|
@@ -554,7 +558,10 @@ a headers helper. That output is a short-lived credential: connect it directly
|
|
|
554
558
|
to the MCP client and do not paste it into an agent transcript.
|
|
555
559
|
|
|
556
560
|
`rer business status` shows local pairing, service state and progress without
|
|
557
|
-
printing checkpoints or vendor data.
|
|
561
|
+
printing checkpoints or vendor data. Device credentials are stored separately
|
|
562
|
+
for each Business on an origin; disconnect also finds an older per-origin
|
|
563
|
+
credential through its original pairing record and revokes it once.
|
|
564
|
+
`rer business disconnect` revokes this
|
|
558
565
|
device through device-authenticated `DELETE /api/business/executors/self` before
|
|
559
566
|
removing its service, device and vendor credentials, state and introduced Claude
|
|
560
567
|
rules, preserving preexisting settings and unrelated edits. It says "Device
|
|
@@ -580,7 +587,14 @@ an explicit error. Revocation stops the supervisor on its next 401; it then
|
|
|
580
587
|
removes the device credential if it may and `status` says revoked. While it
|
|
581
588
|
waits, `run` says what for: the owner's permission to scan the folder connect
|
|
582
589
|
ran in (with the Your tools link) until this computer's scan is done, then the
|
|
583
|
-
owner's next step.
|
|
590
|
+
owner's next step.
|
|
591
|
+
If the server reports that this computer's scan failed, run and next instead
|
|
592
|
+
point the owner to **Retry** on **Your tools**, without asking for consent again.
|
|
593
|
+
Connect, next and run carry the Business profile into first-party checkouts
|
|
594
|
+
shown by `rer list` in the current or original pairing folder, including stopped
|
|
595
|
+
apps, as well as running and previously carried apps. Each skipped checkout
|
|
596
|
+
is named with its cause; a folder with no apps gets a next step.
|
|
597
|
+
It removes `run.lock` on every exit, including Ctrl-C,
|
|
584
598
|
SIGTERM and a closed terminal (SIGHUP); a lock whose process is gone, or that
|
|
585
599
|
has not been refreshed for two minutes, is cleared on the next start.
|
|
586
600
|
|
package/global/cli/layout.mjs
CHANGED
|
@@ -32,6 +32,9 @@ if [ -z "$node" ]; then
|
|
|
32
32
|
echo "rer: Node is missing. Run: curl -fsSL https://runeditrun.com/install.sh | sh" >&2
|
|
33
33
|
exit 127
|
|
34
34
|
fi
|
|
35
|
+
RER_INVOKED_AS=rer
|
|
36
|
+
if [ "$(command -v rer 2>/dev/null || true)" != "$0" ]; then RER_INVOKED_AS="$0"; fi
|
|
37
|
+
export RER_INVOKED_AS
|
|
35
38
|
exec "$node" "$root/current/global/rer.mjs" "$@"
|
|
36
39
|
`;
|
|
37
40
|
}
|