@entrorove/skill 0.1.70 → 0.1.73
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 +15 -0
- package/IDE-EXECUTION.md +4 -0
- package/SKILL.md +3 -2
- package/local-budget-reads.mjs +7 -2
- package/local-budget.mjs +3 -2
- package/local-probe.mjs +16 -7
- package/local-scope-build-data.mjs +73 -0
- package/local-scope-build-facts.mjs +33 -0
- package/local-scope-build-io.mjs +57 -0
- package/local-scope-build-read.mjs +22 -0
- package/local-scope-build-readset.mjs +49 -0
- package/local-scope-files.mjs +20 -7
- package/local-scope-repository.mjs +47 -37
- package/local-scope-signature.mjs +6 -4
- package/local-scope-state.mjs +7 -5
- package/local-scope-uni-build.mjs +69 -119
- package/local-scope-uni-conditional.mjs +8 -6
- package/local-scope-uni-directives.mjs +5 -5
- package/local-scope-uni-expressions.mjs +10 -5
- package/local-scope-workspaces.mjs +3 -3
- package/manifest.json +1 -1
- package/package.json +12 -2
- package/release-source-groups.mjs +46 -0
- package/release-state.json +40 -30
- package/release.mjs +6 -40
- package/releases.json +18 -0
- package/remote-client.mjs +1 -1
- package/remote-transport.mjs +14 -0
- package/scope-amendment-client.mjs +31 -19
- package/scope-amendment-reference.mjs +22 -4
- package/scope-amendment-state.mjs +1 -1
- package/scope-context-client.mjs +17 -8
- package/scope-context-journal.mjs +5 -4
- package/scope-context-observer.mjs +3 -2
- package/scope-context-remote.mjs +5 -5
- package/scope-context-state.mjs +4 -1
- package/scope-context-wire.mjs +9 -1
- package/scope-evidence-local.mjs +52 -0
- package/scope-evidence-remote.mjs +78 -0
- package/scope-evidence-wire.mjs +120 -0
- package/scope-runner-client.mjs +65 -35
- package/scope-runner-journal.mjs +32 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { canonical, sha256 } from './local-integrity.mjs';
|
|
4
|
+
import { readMutationJson14, atomicMutationJson14, mutationFile14 } from './local-mutation-files.mjs';
|
|
5
|
+
import { evidenceFail } from './scope-evidence-wire.mjs';
|
|
6
|
+
|
|
7
|
+
export async function saveScopeRunnerJournal(location, state) {
|
|
8
|
+
if (Buffer.byteLength(canonical(state)) + 1 > 8_000_000) evidenceFail('Scope connection journal exceeds its unchanged bounded control limit');
|
|
9
|
+
await atomicMutationJson14(location.file, state, { privateFrom: location.stateRoot, replace: true });
|
|
10
|
+
}
|
|
11
|
+
export async function scopeRunnerJournal(location, identity) {
|
|
12
|
+
let state;
|
|
13
|
+
try {
|
|
14
|
+
const item = await mutationFile14(location.file);
|
|
15
|
+
if (item.stat.size > 8_000_000 || item.stat.nlink !== 1) evidenceFail('Scope connection journal is invalid');
|
|
16
|
+
state = await readMutationJson14(location.file);
|
|
17
|
+
if (state.schemaVersion !== 'entrorove.scope-connection-journal/1.0' || canonical(state.identity) !== canonical(identity)) {
|
|
18
|
+
evidenceFail('Scope connection journal replaced its original task, repository or complete input');
|
|
19
|
+
}
|
|
20
|
+
} catch (error) { if (error.code !== 'ENOENT') throw error; }
|
|
21
|
+
if (state && !state.pending && !state.evidencePending && (state.completed || state.rejection)) {
|
|
22
|
+
const archive = path.join(location.directory, `${state.attemptId}-${sha256(canonical(state))}.json`);
|
|
23
|
+
try { if (canonical(await readMutationJson14(archive)) !== canonical(state)) evidenceFail('Scope connection history changed'); }
|
|
24
|
+
catch (error) { if (error.code !== 'ENOENT') throw error; await atomicMutationJson14(archive, state, { privateFrom: location.stateRoot }); }
|
|
25
|
+
state = undefined;
|
|
26
|
+
}
|
|
27
|
+
if (!state) {
|
|
28
|
+
state = { schemaVersion: 'entrorove.scope-connection-journal/1.0', identity, attemptId: randomUUID() };
|
|
29
|
+
await saveScopeRunnerJournal(location, state);
|
|
30
|
+
}
|
|
31
|
+
return state;
|
|
32
|
+
}
|