engineering-memory 1.11.9 → 1.11.11
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/dispatcher/sections.mjs +7 -2
- package/install/codex-approval.mjs +457 -0
- package/install/files.mjs +5 -1
- package/install/installer.mjs +24 -1
- package/package.json +1 -1
- package/runtime/build.json +1 -1
- package/runtime/dist/src/config.js +2 -0
- package/runtime/dist/src/git/git-inspector.js +114 -4
- package/runtime/dist/src/git/verification-gate.js +30 -17
- package/runtime/dist/src/mcp/onboarding-tools.js +110 -16
- package/runtime/dist/src/mcp/questionnaire-tools.js +99 -15
- package/runtime/dist/src/mcp/tool-annotations.js +112 -0
- package/runtime/dist/src/mcp/tool-definitions.js +150 -29
- package/runtime/dist/src/mcp/worktree-tools.js +395 -236
- package/runtime/dist/src/project/repository.js +26 -8
- package/runtime/dist/src/runtime/active-context-store.js +3 -0
- package/runtime/dist/src/runtime/api-client.js +1 -0
- package/runtime/dist/src/runtime/branch-preferences.js +0 -19
- package/runtime/dist/src/runtime/bridge-service.js +1320 -246
- package/runtime/dist/src/runtime/offline-outbox.js +33 -158
- package/runtime/dist/src/runtime/phase-timer.js +26 -0
- package/runtime/dist/src/runtime/privacy-detector.js +263 -0
- package/runtime/dist/src/runtime/questionnaire-store.js +210 -49
- package/runtime/dist/src/runtime/recovery-error.js +3 -1
- package/runtime/dist/src/runtime/runtime-entry.js +8 -0
- package/runtime/dist/src/runtime/runtime-host.js +1 -3
- package/runtime/dist/src/runtime/task-branch-store.js +17 -1
- package/runtime/dist/src/runtime/task-start.js +281 -0
- package/runtime/dist/src/runtime/worktree-pool.js +374 -26
- package/runtime/dist/src/utilities/process.js +1 -0
- package/skill/SKILL.md +3 -3
- package/skill/references/lifecycle.md +59 -19
- package/skill/references/memory-updates.md +9 -3
- package/skill/references/project-onboarding.md +19 -2
- package/skill/references/questionnaires.md +86 -15
|
@@ -10,7 +10,17 @@ export class RepositoryResolver {
|
|
|
10
10
|
this.markerSchemaVersion = markerSchemaVersion;
|
|
11
11
|
this.stateRoot = stateRoot;
|
|
12
12
|
}
|
|
13
|
+
async resolveIdentity(startPath, explicitProjectId) {
|
|
14
|
+
const bound = await this.resolveBinding(startPath, explicitProjectId);
|
|
15
|
+
const identity = await this.git.identity(bound.repoRoot);
|
|
16
|
+
return { ...bound, head: identity.head, branch: identity.branch };
|
|
17
|
+
}
|
|
13
18
|
async resolve(startPath, explicitProjectId) {
|
|
19
|
+
const bound = await this.resolveBinding(startPath, explicitProjectId);
|
|
20
|
+
const git = await this.git.manifest(bound.repoRoot);
|
|
21
|
+
return { ...bound, git };
|
|
22
|
+
}
|
|
23
|
+
async resolveBinding(startPath, explicitProjectId) {
|
|
14
24
|
const repoRoot = await this.git.findRoot(startPath);
|
|
15
25
|
const repositoryKey = await this.keyFor(repoRoot);
|
|
16
26
|
const bindingPath = this.pathFor(repositoryKey);
|
|
@@ -48,10 +58,7 @@ export class RepositoryResolver {
|
|
|
48
58
|
if (explicitProjectId && binding && explicitProjectId !== binding.projectId) {
|
|
49
59
|
throw new Error('Explicit project does not match the local repository binding');
|
|
50
60
|
}
|
|
51
|
-
const
|
|
52
|
-
binding?.repoFingerprint ?? this.git.fingerprint(repoRoot, this.markerSchemaVersion),
|
|
53
|
-
this.git.manifest(repoRoot),
|
|
54
|
-
]);
|
|
61
|
+
const repoFingerprint = binding?.repoFingerprint ?? (await this.git.fingerprint(repoRoot, this.markerSchemaVersion));
|
|
55
62
|
return {
|
|
56
63
|
repoRoot,
|
|
57
64
|
markerPath,
|
|
@@ -60,14 +67,25 @@ export class RepositoryResolver {
|
|
|
60
67
|
schemaVersion: binding?.schemaVersion ?? null,
|
|
61
68
|
repoFingerprint,
|
|
62
69
|
legacyFingerprints: binding ? [] : [await this.git.fingerprint(repoRoot, 1)],
|
|
63
|
-
git,
|
|
64
70
|
};
|
|
65
71
|
}
|
|
66
|
-
async
|
|
72
|
+
async checkoutFingerprints(repoRoot) {
|
|
73
|
+
return [
|
|
74
|
+
...new Set([
|
|
75
|
+
await this.git.fingerprint(repoRoot, 2),
|
|
76
|
+
await this.git.fingerprint(repoRoot, 1),
|
|
77
|
+
]),
|
|
78
|
+
];
|
|
79
|
+
}
|
|
80
|
+
async writeBinding(repoRoot, projectId, fingerprint, livesIn) {
|
|
67
81
|
assertProjectId(projectId);
|
|
68
|
-
const
|
|
82
|
+
const root = await this.git.findRoot(repoRoot);
|
|
83
|
+
const home = livesIn !== undefined &&
|
|
84
|
+
/^[0-9a-f]{64}$/.test(fingerprint) &&
|
|
85
|
+
(await this.checkoutFingerprints(root)).includes(livesIn);
|
|
86
|
+
const repository = await this.resolve(root, home ? undefined : projectId);
|
|
69
87
|
const older = repository.legacyFingerprints.includes(fingerprint);
|
|
70
|
-
if (fingerprint !== repository.repoFingerprint && !older) {
|
|
88
|
+
if (fingerprint !== repository.repoFingerprint && !older && !home) {
|
|
71
89
|
throw new Error('The confirmed project fingerprint does not identify this repository');
|
|
72
90
|
}
|
|
73
91
|
const repositoryKey = await this.keyFor(repository.repoRoot);
|
|
@@ -81,6 +81,9 @@ export class ActiveContextStore {
|
|
|
81
81
|
const { verificationIntent: _verificationIntent, closeIntent: _closeIntent, ...pointerInput } = input;
|
|
82
82
|
await this.writePointer({
|
|
83
83
|
...pointerInput,
|
|
84
|
+
...(!pointerInput.changeBaseline && existing?.changeBaseline
|
|
85
|
+
? { changeBaseline: existing.changeBaseline }
|
|
86
|
+
: {}),
|
|
84
87
|
...(sameSession && existing?.verificationIntent
|
|
85
88
|
? { verificationIntent: existing.verificationIntent }
|
|
86
89
|
: {}),
|
|
@@ -1,23 +1,4 @@
|
|
|
1
|
-
import { sha256, stableStringify } from '../utilities/hash.js';
|
|
2
1
|
import { BridgeRecoveryError } from './recovery-error.js';
|
|
3
|
-
export function branchDecisionId(externalTaskId, base, name, keepCurrent) {
|
|
4
|
-
return ('task-base-' +
|
|
5
|
-
sha256(stableStringify({ externalTaskId, base, name: name ?? null, keepCurrent })));
|
|
6
|
-
}
|
|
7
|
-
export function branchChoices(preferences, current) {
|
|
8
|
-
const options = [];
|
|
9
|
-
for (const role of ['development', 'production', 'test']) {
|
|
10
|
-
const choice = preferences.branches[role];
|
|
11
|
-
if (choice.answered && choice.branch)
|
|
12
|
-
options.push({ id: role, label: role + ': ' + choice.remote + '/' + choice.branch });
|
|
13
|
-
}
|
|
14
|
-
options.splice(Math.min(1, options.length), 0, {
|
|
15
|
-
id: 'current',
|
|
16
|
-
label: 'Current branch: ' + (current ?? 'detached HEAD'),
|
|
17
|
-
});
|
|
18
|
-
options.push({ id: 'other', label: 'Another branch' }, { id: 'keep', label: 'Continue on this branch without creating a new branch' });
|
|
19
|
-
return options;
|
|
20
|
-
}
|
|
21
2
|
export async function resolveTaskBase(git, repoRoot, base, preferences) {
|
|
22
3
|
if (base.kind === 'current' || base.kind === 'local') {
|
|
23
4
|
const source = await git.sourceIdentity(repoRoot, base.kind === 'current' ? (base.commit ?? 'HEAD') : base.ref);
|