show-me-the-env 0.96.1 → 0.96.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenv",
3
- "version": "0.96.1",
3
+ "version": "0.96.2",
4
4
  "description": "Save and restore your whole agent and coding environment as one versioned .agenv repository.",
5
5
  "skills": [
6
6
  "./skills/init",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "show-me-the-env",
3
- "version": "0.96.1",
3
+ "version": "0.96.2",
4
4
  "description": "Save and restore your whole agent and coding environment as one versioned .agenv repository.",
5
5
  "type": "module",
6
6
  "keywords": [
package/src/load.mjs CHANGED
@@ -112,7 +112,10 @@ export function planLoad({ dataRoot, profile, home, platform = process.platform,
112
112
  if (fresh) unchecked.add(key);
113
113
  observed[key] = { digest: fresh ? null : have };
114
114
  files.set(key, { target, bytes: w.bytes });
115
- desired.push({ id: w.repo, adapterId: 'files', operation: 'configure', inputs: { repo: w.repo, live: w.live, sha256: want }, writes: [key], soft: [...softAfterTools, ...ownLists(w.repo)], permissions: ['write-home'] });
115
+ // The live file is a second resource key: two profile files may name one live file, and sharing
116
+ // it keeps the executor from running both writes at once, so the later one in plan order finds
117
+ // the file changed and stops as a conflict whatever --jobs is (scripts/benchmark.mjs plants this).
118
+ desired.push({ id: w.repo, adapterId: 'files', operation: 'configure', inputs: { repo: w.repo, live: w.live, sha256: want }, writes: [key], reads: ['file:' + target], soft: [...softAfterTools, ...ownLists(w.repo)], permissions: ['write-home'] });
116
119
  }
117
120
  // Signing keys the profile names and gpg here does not list as secret keys are imported once
118
121
  // every secrets/ file of this load is written, since their secret key files are among them.
@@ -158,7 +161,7 @@ export async function applyLoad({ planned, approval, stateRoot, journal, jobs =
158
161
  const filesAdapter = {
159
162
  async observe(keys) { return Object.fromEntries(keys.map((k) => [k, planned.files.has(k) && !planned.unchecked?.has(k) ? fileDigest(planned.files.get(k).target) : null])); },
160
163
  async apply(action) {
161
- const key = action.resourceKeys[0];
164
+ const key = action.resourceKeys.find((k) => planned.files.has(k));
162
165
  const { target, bytes } = planned.files.get(key);
163
166
  const out = ownedWrite({ journal, stateRoot, runId: id, actionId: action.actionId, resourceKey: key, file: target, bytes });
164
167
  return { status: out.status, summary: 'wrote ' + action.inputs.repo, changedResources: out.status === 'changed' ? [key] : [], rollbackCapability: 'reversible' };