wendkeep 0.78.0 → 0.79.0
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 +41 -0
- package/README.en.md +57 -2
- package/README.md +57 -2
- package/docs/en/commands/changes-and-verification.md +66 -1
- package/docs/en/commands/operating-profiles.md +49 -5
- package/docs/en/commands/verify.md +45 -0
- package/docs/en/commands/worktrees.md +39 -4
- package/docs/pt-BR/commands/changes-and-verification.md +65 -1
- package/docs/pt-BR/commands/operating-profiles.md +51 -5
- package/docs/pt-BR/commands/verify.md +45 -0
- package/docs/pt-BR/commands/worktrees.md +38 -3
- package/hooks/active-context-store.mjs +530 -2
- package/hooks/change-core.mjs +201 -122
- package/hooks/obsidian-common.mjs +175 -9
- package/hooks/spec-core.mjs +93 -29
- package/package.json +2 -2
- package/schema/wendkeep.provenance-receipt-v2.schema.json +66 -0
- package/src/archive-operation-lock.mjs +235 -0
- package/src/change.mjs +1780 -79
- package/src/delivery.mjs +724 -67
- package/src/memory.mjs +2 -1
- package/src/provenance-gate.mjs +575 -0
- package/src/provenance-sources.mjs +547 -0
- package/src/receipt-ledger.mjs +841 -0
- package/src/release-provenance.mjs +48 -0
- package/src/worktree-cleanup.mjs +1733 -118
- package/src/worktree.mjs +94 -5
|
@@ -2,6 +2,7 @@ import { execFileSync } from 'node:child_process';
|
|
|
2
2
|
import { cpSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
4
|
import { basename, join } from 'node:path';
|
|
5
|
+
import { evaluateReleaseChain } from './provenance-gate.mjs';
|
|
5
6
|
|
|
6
7
|
const DEPENDENCY_FIELDS = Object.freeze([
|
|
7
8
|
'dependencies',
|
|
@@ -52,6 +53,50 @@ export function packIntegrityInIsolatedCopy(root, { execute = execFileSync } = {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Calculate the publishable tarball from an immutable target commit. A local,
|
|
58
|
+
* detached clone keeps lifecycle mutations and an incidental worktree out of
|
|
59
|
+
* the observation.
|
|
60
|
+
*/
|
|
61
|
+
export function collectArtifactAtCommit({
|
|
62
|
+
repoRoot,
|
|
63
|
+
targetCommit,
|
|
64
|
+
execute = execFileSync,
|
|
65
|
+
} = {}) {
|
|
66
|
+
if (!repoRoot || !/^[0-9a-f]{40}$/i.test(String(targetCommit || ''))) {
|
|
67
|
+
return { ok: false, state: 'unproven', reasonCodes: ['PROVENANCE_COMMIT_MISSING'] };
|
|
68
|
+
}
|
|
69
|
+
const tempRoot = mkdtempSync(join(tmpdir(), 'wendkeep-release-target-'));
|
|
70
|
+
const targetRoot = join(tempRoot, 'target');
|
|
71
|
+
try {
|
|
72
|
+
execute('git', ['clone', '--quiet', '--no-checkout', '--local', repoRoot, targetRoot], {
|
|
73
|
+
encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], shell: false,
|
|
74
|
+
});
|
|
75
|
+
execute('git', ['checkout', '--quiet', '--detach', targetCommit], {
|
|
76
|
+
cwd: targetRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], shell: false,
|
|
77
|
+
});
|
|
78
|
+
const integrity = packIntegrityInIsolatedCopy(targetRoot, { execute });
|
|
79
|
+
if (!integrity) return {
|
|
80
|
+
ok: false, state: 'unproven', commit: targetCommit,
|
|
81
|
+
reasonCodes: ['PROVENANCE_INTEGRITY_UNOBSERVED'],
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
ok: true,
|
|
85
|
+
state: 'verified',
|
|
86
|
+
commit: targetCommit,
|
|
87
|
+
integrity,
|
|
88
|
+
reasonCodes: [],
|
|
89
|
+
};
|
|
90
|
+
} catch {
|
|
91
|
+
return {
|
|
92
|
+
ok: false, state: 'reported', commit: targetCommit,
|
|
93
|
+
reasonCodes: ['PROVENANCE_SOURCE_UNAVAILABLE'],
|
|
94
|
+
};
|
|
95
|
+
} finally {
|
|
96
|
+
rmSync(tempRoot, { recursive: true, force: true });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
55
100
|
export function packageHasSelfDependency(pkg = {}) {
|
|
56
101
|
const name = String(pkg.name || '');
|
|
57
102
|
if (!name) return false;
|
|
@@ -66,7 +111,10 @@ export function evaluateReleaseProvenance({
|
|
|
66
111
|
publishedIntegrity = '',
|
|
67
112
|
localIntegrity = '',
|
|
68
113
|
requirePublished = false,
|
|
114
|
+
chain = null,
|
|
115
|
+
context = null,
|
|
69
116
|
} = {}) {
|
|
117
|
+
if (chain) return evaluateReleaseChain({ chain, context: context || {} });
|
|
70
118
|
const tag = `v${version}`;
|
|
71
119
|
if (tagCommit && tagCommit !== headCommit) {
|
|
72
120
|
return {
|