@ikon85/agent-workflow-kit 0.35.0 → 0.36.1
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/.agents/skills/kit-update/SKILL.md +22 -9
- package/.agents/skills/retro/SKILL.md +11 -3
- package/.agents/skills/setup-workflow/SKILL.md +22 -1
- package/.agents/skills/setup-workflow/contribution-routing.md +52 -0
- package/.claude/hooks/kit-origin-edit-hint.py +18 -13
- package/.claude/skills/kit-update/SKILL.md +22 -9
- package/.claude/skills/retro/SKILL.md +11 -3
- package/.claude/skills/setup-workflow/SKILL.md +22 -1
- package/.claude/skills/setup-workflow/contribution-routing.md +52 -0
- package/README.md +63 -4
- package/agent-workflow-kit.package.json +31 -11
- package/package.json +1 -1
- package/scripts/find-by-marker.py +2 -0
- package/scripts/test_marker_lib.py +8 -0
- package/scripts/test_retro_wrapup_contract.py +6 -4
- package/src/cli.mjs +60 -3
- package/src/commands/own.mjs +10 -1
- package/src/commands/update.mjs +1 -0
- package/src/lib/contributionBridge.mjs +176 -0
- package/src/lib/contributionRouting.mjs +152 -0
- package/src/lib/manifest.mjs +15 -4
- package/src/lib/ownershipClassifier.mjs +11 -0
- package/src/lib/updateReconcile.mjs +44 -5
- package/src/lib/verifyUpdateCandidate.mjs +15 -0
- package/src/lib/verifyUpdateCandidateTransaction.mjs +10 -0
|
@@ -2,6 +2,7 @@ import { lstat, readFile } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { isDeepStrictEqual } from 'node:util';
|
|
4
4
|
import { sha256File } from './hash.mjs';
|
|
5
|
+
import { validateContributionBridge } from './contributionBridge.mjs';
|
|
5
6
|
import {
|
|
6
7
|
CONSUMER_INSTALL_ROLE, CONSUMER_MANIFEST_NAME, CONSUMER_ORIGIN, KIT_ORIGIN,
|
|
7
8
|
emptyConsumerManifest, filesForInstallRole,
|
|
@@ -192,11 +193,24 @@ function validateInstalledEntry(tracked, desired, origin) {
|
|
|
192
193
|
if (tracked.origin === KIT_ORIGIN && tracked.ownershipState !== undefined) {
|
|
193
194
|
throw new Error(`candidate invariant ownership: Kit path has Consumer lifecycle ${tracked.path}`);
|
|
194
195
|
}
|
|
196
|
+
if (tracked.origin === KIT_ORIGIN && tracked.contributionBridge !== undefined) {
|
|
197
|
+
throw new Error(`candidate invariant ownership: Kit path has contribution bridge ${tracked.path}`);
|
|
198
|
+
}
|
|
195
199
|
if (tracked.origin === CONSUMER_ORIGIN && ![
|
|
196
200
|
undefined, 'project-extension', 'contribution-bridge', 'explicit-fork',
|
|
197
201
|
].includes(tracked.ownershipState)) {
|
|
198
202
|
throw new Error(`candidate invariant ownership: invalid lifecycle ${tracked.path}`);
|
|
199
203
|
}
|
|
204
|
+
if (tracked.origin === CONSUMER_ORIGIN
|
|
205
|
+
&& tracked.ownershipState === 'contribution-bridge') {
|
|
206
|
+
try {
|
|
207
|
+
validateContributionBridge(tracked);
|
|
208
|
+
} catch {
|
|
209
|
+
throw new Error(`candidate invariant ownership: invalid contribution bridge ${tracked.path}`);
|
|
210
|
+
}
|
|
211
|
+
} else if (tracked.contributionBridge !== undefined) {
|
|
212
|
+
throw new Error(`candidate invariant ownership: unexpected contribution bridge ${tracked.path}`);
|
|
213
|
+
}
|
|
200
214
|
}
|
|
201
215
|
|
|
202
216
|
function verifyLedgerMetadata(ledger, context) {
|
|
@@ -215,6 +229,7 @@ function verifyLedgerMetadata(ledger, context) {
|
|
|
215
229
|
}
|
|
216
230
|
|
|
217
231
|
function expectedOrigin(path, priorInstalled, preview) {
|
|
232
|
+
if ((preview.bridgeRetired ?? []).includes(path)) return KIT_ORIGIN;
|
|
218
233
|
const transferredToCore = (preview.migrations ?? []).some(
|
|
219
234
|
(migration) => migration.path === path && migration.ownership === 'kit-core',
|
|
220
235
|
);
|
|
@@ -60,6 +60,16 @@ export function verifyTransactionPreview(preview, installable, installed) {
|
|
|
60
60
|
}
|
|
61
61
|
actionSets.set(key, local);
|
|
62
62
|
}
|
|
63
|
+
if (!Array.isArray(preview.bridgeRetired ?? [])) {
|
|
64
|
+
throw new Error('candidate invariant transaction: bridgeRetired must be an array');
|
|
65
|
+
}
|
|
66
|
+
const retired = new Set();
|
|
67
|
+
for (const path of preview.bridgeRetired ?? []) {
|
|
68
|
+
claimTransactionPath(path, 'bridgeRetired', retired, owners);
|
|
69
|
+
if (!installablePaths.has(path) || installed.get(path)?.origin !== KIT_ORIGIN) {
|
|
70
|
+
throw new Error(`candidate invariant transaction: invalid bridge retirement ${path}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
63
73
|
if (!Array.isArray(preview.migrations ?? [])) {
|
|
64
74
|
throw new Error('candidate invariant transaction: migrations must be an array');
|
|
65
75
|
}
|