@sanqianx/project-knowledge 5.0.19 → 5.0.20-rc.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/plugins/marketplace.json +3 -3
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +5 -0
- package/LICENSE +201 -201
- package/NOTICE +5 -5
- package/README.md +349 -349
- package/_modules/knowledge-engine/README.md +4 -0
- package/_modules/knowledge-engine/src/analysis-failures.js +39 -0
- package/_modules/knowledge-engine/src/analysis-worker.js +6 -2
- package/_modules/knowledge-engine/src/coordinator.js +7 -0
- package/_modules/knowledge-engine/src/headless-analyzer.js +2 -1
- package/_modules/knowledge-engine/src/server.js +1 -1
- package/_site/_test/agent-capture-mcp-ui-test.js +67 -67
- package/_site/_test/ai-profile-test.js +75 -75
- package/_site/_test/ai-vendor-presets-test.js +91 -91
- package/_site/_test/automatic-context-test.js +70 -70
- package/_site/_test/bin-cli-test.js +230 -230
- package/_site/_test/bridge-adapter-test.js +95 -95
- package/_site/_test/bridge-consumer-service-test.js +310 -310
- package/_site/_test/candidate-bin-content-test.js +35 -35
- package/_site/_test/candidate-product-assets-test.js +13 -13
- package/_site/_test/candidate-release-contract-test.js +14 -14
- package/_site/_test/capture-hook-dedup-test.js +158 -158
- package/_site/_test/claude-executable-discovery-test.js +28 -28
- package/_site/_test/claude-session-lifecycle-sweep-test.js +252 -252
- package/_site/_test/cli-instance-management-test.js +62 -62
- package/_site/_test/client-capture-restart-e2e-test.js +189 -189
- package/_site/_test/codex-conversation-projection-test.js +60 -60
- package/_site/_test/codex-marketplace-scoped-path-test.js +186 -186
- package/_site/_test/codex-notify-capture-e2e-test.js +101 -101
- package/_site/_test/codex-notify-fanout-test.js +134 -134
- package/_site/_test/codex-notify-upgrade-test.js +253 -253
- package/_site/_test/commit-boundary-freeze-test.js +147 -147
- package/_site/_test/commit-conversation-binding-test.js +4 -4
- package/_site/_test/configuration-generation-test.js +22 -22
- package/_site/_test/context-pack-test.js +200 -200
- package/_site/_test/conversation-api-test.js +10 -10
- package/_site/_test/conversation-origin-test.js +15 -15
- package/_site/_test/cross-repo-isolation-e2e-test.js +187 -187
- package/_site/_test/embedding-config-test.js +32 -32
- package/_site/_test/fixtures/fake-browser-exit.js +10 -10
- package/_site/_test/fixtures/fake-browser-hang.js +10 -10
- package/_site/_test/fixtures/integration-busy-worker.cjs +6 -6
- package/_site/_test/fixtures/make-git-repos.js +92 -92
- package/_site/_test/fixtures/retrieval-gold-queries.json +32 -32
- package/_site/_test/fresh-hook-reimport-test.js +53 -53
- package/_site/_test/fresh-product-data-test.js +56 -56
- package/_site/_test/git-path-compatibility-test.js +80 -80
- package/_site/_test/git-validation-test.js +81 -81
- package/_site/_test/hook-worktree-test.js +42 -42
- package/_site/_test/index-builder-test.js +41 -41
- package/_site/_test/index-error-display-contract-test.js +10 -10
- package/_site/_test/integration-adapters-test.js +67 -67
- package/_site/_test/integration-capture-setup-test.js +118 -118
- package/_site/_test/integration-runtime-binding-a2-test.js +566 -566
- package/_site/_test/integration-runtime-binding-a3-test.js +227 -227
- package/_site/_test/integration-runtime-binding-test.js +473 -473
- package/_site/_test/integration-status-scan-test.js +29 -29
- package/_site/_test/kb-framework-test.js +57 -57
- package/_site/_test/kbpath-follow-test.js +63 -63
- package/_site/_test/knowledge-db-test.js +144 -144
- package/_site/_test/knowledge-engine-client-test.js +109 -109
- package/_site/_test/knowledge-maintenance-test.js +40 -40
- package/_site/_test/knowledge-panel-ui-contract-test.js +112 -0
- package/_site/_test/knowledge-scopes-test.js +37 -37
- package/_site/_test/knowledge-storage-location-test.js +28 -28
- package/_site/_test/launcher-readiness-test.js +80 -80
- package/_site/_test/legacy-claude-session-alias-test.js +106 -106
- package/_site/_test/legacy-routes-removed-test.js +47 -47
- package/_site/_test/legacy-workbench-exclusion-test.js +92 -92
- package/_site/_test/live-gateway-test.js +48 -48
- package/_site/_test/local-marketplace-test.js +16 -16
- package/_site/_test/log-redaction-test.js +58 -58
- package/_site/_test/markdown-maintenance-test.js +11 -11
- package/_site/_test/model-context-windows-test.js +89 -89
- package/_site/_test/module-agent-start-proxy-test.js +65 -65
- package/_site/_test/module-artifact-integrity-test.js +27 -27
- package/_site/_test/module-boundary-test.js +30 -30
- package/_site/_test/module-bridge-eventbridge-test.js +202 -202
- package/_site/_test/module-dynamic-port-test.js +118 -118
- package/_site/_test/module-index-proxy-test.js +33 -33
- package/_site/_test/module-model-configuration-test.js +44 -44
- package/_site/_test/module-process-lifecycle-test.js +35 -35
- package/_site/_test/module-stream-proxy-test.js +34 -34
- package/_site/_test/module-terminal-restart-test.js +63 -63
- package/_site/_test/module-wiring-unbind-race-test.js +59 -59
- package/_site/_test/native-context-integrations-test.js +86 -86
- package/_site/_test/orphaned-claim-recovery-test.js +80 -80
- package/_site/_test/package-boundary-test.js +43 -42
- package/_site/_test/package-startup-test.js +56 -56
- package/_site/_test/packaged-ui-smoke-test.js +88 -88
- package/_site/_test/pr-consumer-contract-test.js +55 -55
- package/_site/_test/product-brand-contract-test.js +25 -25
- package/_site/_test/product-diagnostics-ui-test.js +93 -93
- package/_site/_test/product-import-ui-test.js +104 -104
- package/_site/_test/product-progress-status-test.js +12 -1
- package/_site/_test/project-remove-running-guard-test.js +79 -79
- package/_site/_test/project-store-test.js +90 -90
- package/_site/_test/registry-events-test.js +38 -38
- package/_site/_test/release-version-sync-test.js +115 -115
- package/_site/_test/requirement-binding-test.js +113 -113
- package/_site/_test/runtime-endpoint-test.js +64 -64
- package/_site/_test/scanner-test.js +83 -83
- package/_site/_test/server-security-test.js +96 -96
- package/_site/_test/sessions-stream-test.js +93 -93
- package/_site/_test/shared-scope-root-binding-test.js +67 -67
- package/_site/_test/simple-import-test.js +98 -98
- package/_site/_test/startup-analysis-disabled-test.js +6 -6
- package/_site/_test/team-knowledge-store-sparse-checkout-test.js +196 -196
- package/_site/_test/team-knowledge-store-test.js +132 -132
- package/_site/_test/test-server-cleanup-test.js +35 -35
- package/_site/_test/test-server-module-isolation-test.js +37 -37
- package/_site/_test/tracking-start-test.js +35 -35
- package/_site/_test/workbench-context-receipts-test.js +22 -22
- package/_site/_test/workspace-ui-contract-test.js +31 -31
- package/_site/_test/zcode-capture-integration-test.js +108 -108
- package/_site/lib/ai-vendor-presets.js +83 -83
- package/_site/lib/ai-workspace.js +3 -3
- package/_site/lib/atomic-file.js +204 -204
- package/_site/lib/bridge-adapter.js +260 -260
- package/_site/lib/capture-hook-config.js +108 -108
- package/_site/lib/claude-cli-runner.js +89 -89
- package/_site/lib/cli-instances.js +43 -43
- package/_site/lib/codex-context-status.js +17 -17
- package/_site/lib/codex-notify-config.js +193 -193
- package/_site/lib/commit-conversation-binder.js +12 -12
- package/_site/lib/commit-reconciler.js +38 -38
- package/_site/lib/context-pack-builder.js +299 -299
- package/_site/lib/conversation-exclusions.js +204 -204
- package/_site/lib/conversation-query-service.js +17 -17
- package/_site/lib/data-dir.js +13 -13
- package/_site/lib/embedding-service.js +85 -85
- package/_site/lib/engine-connection.js +93 -93
- package/_site/lib/engine-knowledge-client.js +72 -72
- package/_site/lib/folder-picker-output.js +3 -3
- package/_site/lib/git-path.js +14 -14
- package/_site/lib/github-team-store.js +3 -3
- package/_site/lib/index-builder.js +157 -157
- package/_site/lib/integration-status-scan.js +99 -99
- package/_site/lib/integration-status-worker.js +14 -14
- package/_site/lib/kb-framework.js +15 -15
- package/_site/lib/knowledge-db.js +363 -363
- package/_site/lib/knowledge-schema.js +121 -121
- package/_site/lib/live-gateway.js +78 -78
- package/_site/lib/llm-client.js +12 -12
- package/_site/lib/model-context-windows.js +82 -82
- package/_site/lib/module-bridge.js +874 -874
- package/_site/lib/module-port-resolver.js +57 -57
- package/_site/lib/post-commit-automation.js +54 -54
- package/_site/lib/product-data.js +35 -35
- package/_site/lib/project-lifecycle-service.js +14 -14
- package/_site/lib/project-registry-store.js +129 -129
- package/_site/lib/prompt-registry.js +148 -148
- package/_site/lib/registry-events.js +16 -16
- package/_site/lib/requirement-adapters.js +10 -10
- package/_site/lib/requirement-binder.js +112 -112
- package/_site/lib/runtime-control.js +89 -89
- package/_site/lib/runtime-endpoint.js +5 -5
- package/_site/lib/zcode-context-integration.js +60 -60
- package/_site/scripts/codex-notify-fanout.cjs +95 -95
- package/_site/scripts/install-module-candidates.js +69 -69
- package/_site/scripts/pack-module-candidates.js +89 -89
- package/_site/scripts/sync-product-content.js +28 -28
- package/_site/scripts/sync-release-version.js +164 -164
- package/_site/scripts/vendor-modules.js +49 -49
- package/_site/scripts/verify-module-runtime.js +50 -50
- package/_site/scripts/verify-product-runtime.js +36 -36
- package/_site/scripts/verify-retrieval-gold.js +83 -83
- package/_site/server.js +15 -15
- package/_site/start.bat +26 -26
- package/_site/stop.bat +11 -11
- package/bin/project-knowledge-integrations.js +254 -254
- package/bin/project-knowledge-kb.js +67 -67
- package/bin/project-knowledge-mcp.js +8 -8
- package/bin/project-knowledge.js +170 -170
- package/claude-prompts.json +21 -21
- package/docs/README.zh-CN.md +205 -205
- package/docs/assets/architecture.svg +181 -181
- package/docs/assets/logo.svg +49 -49
- package/docs/fresh-v5-start.md +42 -42
- package/docs/leader-glm-workbench-playbook.md +122 -122
- package/docs/project-registry-schema.md +11 -11
- package/docs/release-5.0.16-acceptance.md +176 -176
- package/docs/release-5.0.17-acceptance.md +117 -117
- package/docs/release-5.0.19-acceptance.md +39 -25
- package/docs/team-knowledge-mode-a-plan.md +73 -73
- package/module-runtime-manifest.json +53 -33
- package/package.json +3 -2
- package/plugins/project-knowledge/.claude-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.codex-plugin/plugin.json +1 -1
- package/plugins/project-knowledge/.mcp.json +1 -1
- package/plugins/project-knowledge/opencode/project-knowledge.md +3 -3
- package/plugins/project-knowledge/skills/project-knowledge/SKILL.md +28 -28
- package/templates/change.md +30 -30
- package/templates/project-readme.md +18 -18
- package/ui/index.html +1 -1
- package/ui/knowledge-panel.html +118 -0
- package/ui/product.css +8 -0
- package/ui/product.js +146 -4
- package/vendor-manifest.json +55 -54
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
const assert = require('assert');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const os = require('os');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { BridgeAdapter } = require('../lib/bridge-adapter');
|
|
6
|
-
const bridgeModule = require('@sanqianx/ai-coding-event-bridge-console/src/bridge');
|
|
7
|
-
|
|
8
|
-
(async () => {
|
|
9
|
-
const dataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-bridge-adapter-'));
|
|
10
|
-
const bridgeHome = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-bridge-adapter-home-'));
|
|
11
|
-
|
|
12
|
-
// Real facade: the adapter talks to createBridge() only, with an isolated
|
|
13
|
-
// bridge home — never the user's global spool and never PK's data dir.
|
|
14
|
-
const adapter = new BridgeAdapter({ dataDir, bridgeModule, bridgeHomeDir: bridgeHome });
|
|
15
|
-
assert.strictEqual(adapter.isAvailable(), true);
|
|
16
|
-
|
|
17
|
-
// v1 identity flows through the adapter into the real journal.
|
|
18
|
-
const repoTmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-bridge-adapter-repo-'));
|
|
19
|
-
require('child_process').execSync('git init -q', { cwd: repoTmp, stdio: 'ignore' });
|
|
20
|
-
const identityResult = await adapter.resolveRepoIdentity(repoTmp);
|
|
21
|
-
assert.strictEqual(identityResult.status, 'ok');
|
|
22
|
-
assert.strictEqual(identityResult.repoIdentity.schema, 'repo-identity/v1');
|
|
23
|
-
assert.match(identityResult.repoIdentity.workspaceId, /^sha256:[0-9a-f]{64}$/);
|
|
24
|
-
|
|
25
|
-
const baseline = await adapter.getHighWatermark({});
|
|
26
|
-
assert.deepStrictEqual(baseline, { status: 'captured', cursor: 0 });
|
|
27
|
-
|
|
28
|
-
await adapter.registerConsumer('project-knowledge', { notifyUrl: 'http://127.0.0.1:9/bridge' });
|
|
29
|
-
const consumer = await adapter.getHealth?.();
|
|
30
|
-
assert.strictEqual(consumer.status, 'ok');
|
|
31
|
-
assert.ok(consumer.health.consumers.some(entry => entry.name === 'project-knowledge'));
|
|
32
|
-
|
|
33
|
-
const result = await adapter.appendCommitBoundary({
|
|
34
|
-
projectId: 'project-bridge',
|
|
35
|
-
repoIdentity: identityResult.repoIdentity,
|
|
36
|
-
commitSha: 'a'.repeat(40),
|
|
37
|
-
parentShas: ['b'.repeat(40)],
|
|
38
|
-
branch: 'main',
|
|
39
|
-
committedAt: '2026-08-18T02:00:00.000Z',
|
|
40
|
-
operationId: 'op-boundary-test',
|
|
41
|
-
});
|
|
42
|
-
assert.strictEqual(result.status, 'captured');
|
|
43
|
-
assert.strictEqual(result.boundary.bridgeCursorAtCommit, 1);
|
|
44
|
-
assert.deepStrictEqual(result.boundary.repoIdentity.workspaceId, identityResult.repoIdentity.workspaceId);
|
|
45
|
-
|
|
46
|
-
// Consumer APIs through the adapter.
|
|
47
|
-
await adapter.ackConsumerCursor('project-knowledge', 1);
|
|
48
|
-
const acked = await adapter.getHealth();
|
|
49
|
-
assert.strictEqual(acked.health.minConsumerAck, 1);
|
|
50
|
-
const compacted = await adapter.compact({ throughSequence: 1 });
|
|
51
|
-
assert.strictEqual(compacted.status, 'ok');
|
|
52
|
-
|
|
53
|
-
// The old PK-only { commonDir } shape must produce a deterministic gap,
|
|
54
|
-
// never a Bridge write.
|
|
55
|
-
const legacy = await adapter.appendCommitBoundary({
|
|
56
|
-
projectId: 'project-legacy',
|
|
57
|
-
repoIdentity: { commonDir: 'D:\\repo\\.git' },
|
|
58
|
-
commitSha: 'c'.repeat(40),
|
|
59
|
-
operationId: 'op-legacy-test',
|
|
60
|
-
});
|
|
61
|
-
assert.strictEqual(legacy.status, 'unavailable');
|
|
62
|
-
assert.strictEqual(legacy.gap.reason, 'repo-identity-legacy-shape');
|
|
63
|
-
|
|
64
|
-
const missing = await adapter.appendCommitBoundary({
|
|
65
|
-
projectId: 'project-missing',
|
|
66
|
-
repoIdentity: null,
|
|
67
|
-
commitSha: 'd'.repeat(40),
|
|
68
|
-
operationId: 'op-missing-test',
|
|
69
|
-
});
|
|
70
|
-
assert.strictEqual(missing.status, 'unavailable');
|
|
71
|
-
assert.strictEqual(missing.gap.reason, 'repo-identity-missing');
|
|
72
|
-
|
|
73
|
-
// No further journal growth from rejected shapes.
|
|
74
|
-
const after = await adapter.getHighWatermark({});
|
|
75
|
-
assert.strictEqual(after.cursor, 1, 'rejected identities must not append journal records');
|
|
76
|
-
|
|
77
|
-
const unavailable = new BridgeAdapter({ dataDir, bridgeModule: {} });
|
|
78
|
-
const gapResult = await unavailable.appendCommitBoundary({
|
|
79
|
-
projectId: 'project-gap',
|
|
80
|
-
repoIdentity: null,
|
|
81
|
-
commitSha: 'e'.repeat(40),
|
|
82
|
-
operationId: 'op-gap-test',
|
|
83
|
-
});
|
|
84
|
-
assert.strictEqual(gapResult.status, 'unavailable');
|
|
85
|
-
assert.strictEqual(gapResult.gap.reason, 'bridge-unavailable');
|
|
86
|
-
const gapsPath = path.join(dataDir, 'runtime', 'conversation-capture-gaps.jsonl');
|
|
87
|
-
const gaps = fs.readFileSync(gapsPath, 'utf8').trim().split(/\r?\n/).map(JSON.parse);
|
|
88
|
-
assert(gaps.some(gap => gap.commitSha === 'e'.repeat(40) && gap.reason === 'bridge-unavailable'));
|
|
89
|
-
assert(!JSON.stringify(gaps).includes('prompt'), 'capture gap diagnostics must not contain conversation bodies');
|
|
90
|
-
|
|
91
|
-
console.log('bridge-adapter-test PASS');
|
|
92
|
-
})().catch(error => {
|
|
93
|
-
console.error(error.stack || error.message);
|
|
94
|
-
process.exitCode = 1;
|
|
95
|
-
});
|
|
1
|
+
const assert = require('assert');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const os = require('os');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { BridgeAdapter } = require('../lib/bridge-adapter');
|
|
6
|
+
const bridgeModule = require('@sanqianx/ai-coding-event-bridge-console/src/bridge');
|
|
7
|
+
|
|
8
|
+
(async () => {
|
|
9
|
+
const dataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-bridge-adapter-'));
|
|
10
|
+
const bridgeHome = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-bridge-adapter-home-'));
|
|
11
|
+
|
|
12
|
+
// Real facade: the adapter talks to createBridge() only, with an isolated
|
|
13
|
+
// bridge home — never the user's global spool and never PK's data dir.
|
|
14
|
+
const adapter = new BridgeAdapter({ dataDir, bridgeModule, bridgeHomeDir: bridgeHome });
|
|
15
|
+
assert.strictEqual(adapter.isAvailable(), true);
|
|
16
|
+
|
|
17
|
+
// v1 identity flows through the adapter into the real journal.
|
|
18
|
+
const repoTmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pk-bridge-adapter-repo-'));
|
|
19
|
+
require('child_process').execSync('git init -q', { cwd: repoTmp, stdio: 'ignore' });
|
|
20
|
+
const identityResult = await adapter.resolveRepoIdentity(repoTmp);
|
|
21
|
+
assert.strictEqual(identityResult.status, 'ok');
|
|
22
|
+
assert.strictEqual(identityResult.repoIdentity.schema, 'repo-identity/v1');
|
|
23
|
+
assert.match(identityResult.repoIdentity.workspaceId, /^sha256:[0-9a-f]{64}$/);
|
|
24
|
+
|
|
25
|
+
const baseline = await adapter.getHighWatermark({});
|
|
26
|
+
assert.deepStrictEqual(baseline, { status: 'captured', cursor: 0 });
|
|
27
|
+
|
|
28
|
+
await adapter.registerConsumer('project-knowledge', { notifyUrl: 'http://127.0.0.1:9/bridge' });
|
|
29
|
+
const consumer = await adapter.getHealth?.();
|
|
30
|
+
assert.strictEqual(consumer.status, 'ok');
|
|
31
|
+
assert.ok(consumer.health.consumers.some(entry => entry.name === 'project-knowledge'));
|
|
32
|
+
|
|
33
|
+
const result = await adapter.appendCommitBoundary({
|
|
34
|
+
projectId: 'project-bridge',
|
|
35
|
+
repoIdentity: identityResult.repoIdentity,
|
|
36
|
+
commitSha: 'a'.repeat(40),
|
|
37
|
+
parentShas: ['b'.repeat(40)],
|
|
38
|
+
branch: 'main',
|
|
39
|
+
committedAt: '2026-08-18T02:00:00.000Z',
|
|
40
|
+
operationId: 'op-boundary-test',
|
|
41
|
+
});
|
|
42
|
+
assert.strictEqual(result.status, 'captured');
|
|
43
|
+
assert.strictEqual(result.boundary.bridgeCursorAtCommit, 1);
|
|
44
|
+
assert.deepStrictEqual(result.boundary.repoIdentity.workspaceId, identityResult.repoIdentity.workspaceId);
|
|
45
|
+
|
|
46
|
+
// Consumer APIs through the adapter.
|
|
47
|
+
await adapter.ackConsumerCursor('project-knowledge', 1);
|
|
48
|
+
const acked = await adapter.getHealth();
|
|
49
|
+
assert.strictEqual(acked.health.minConsumerAck, 1);
|
|
50
|
+
const compacted = await adapter.compact({ throughSequence: 1 });
|
|
51
|
+
assert.strictEqual(compacted.status, 'ok');
|
|
52
|
+
|
|
53
|
+
// The old PK-only { commonDir } shape must produce a deterministic gap,
|
|
54
|
+
// never a Bridge write.
|
|
55
|
+
const legacy = await adapter.appendCommitBoundary({
|
|
56
|
+
projectId: 'project-legacy',
|
|
57
|
+
repoIdentity: { commonDir: 'D:\\repo\\.git' },
|
|
58
|
+
commitSha: 'c'.repeat(40),
|
|
59
|
+
operationId: 'op-legacy-test',
|
|
60
|
+
});
|
|
61
|
+
assert.strictEqual(legacy.status, 'unavailable');
|
|
62
|
+
assert.strictEqual(legacy.gap.reason, 'repo-identity-legacy-shape');
|
|
63
|
+
|
|
64
|
+
const missing = await adapter.appendCommitBoundary({
|
|
65
|
+
projectId: 'project-missing',
|
|
66
|
+
repoIdentity: null,
|
|
67
|
+
commitSha: 'd'.repeat(40),
|
|
68
|
+
operationId: 'op-missing-test',
|
|
69
|
+
});
|
|
70
|
+
assert.strictEqual(missing.status, 'unavailable');
|
|
71
|
+
assert.strictEqual(missing.gap.reason, 'repo-identity-missing');
|
|
72
|
+
|
|
73
|
+
// No further journal growth from rejected shapes.
|
|
74
|
+
const after = await adapter.getHighWatermark({});
|
|
75
|
+
assert.strictEqual(after.cursor, 1, 'rejected identities must not append journal records');
|
|
76
|
+
|
|
77
|
+
const unavailable = new BridgeAdapter({ dataDir, bridgeModule: {} });
|
|
78
|
+
const gapResult = await unavailable.appendCommitBoundary({
|
|
79
|
+
projectId: 'project-gap',
|
|
80
|
+
repoIdentity: null,
|
|
81
|
+
commitSha: 'e'.repeat(40),
|
|
82
|
+
operationId: 'op-gap-test',
|
|
83
|
+
});
|
|
84
|
+
assert.strictEqual(gapResult.status, 'unavailable');
|
|
85
|
+
assert.strictEqual(gapResult.gap.reason, 'bridge-unavailable');
|
|
86
|
+
const gapsPath = path.join(dataDir, 'runtime', 'conversation-capture-gaps.jsonl');
|
|
87
|
+
const gaps = fs.readFileSync(gapsPath, 'utf8').trim().split(/\r?\n/).map(JSON.parse);
|
|
88
|
+
assert(gaps.some(gap => gap.commitSha === 'e'.repeat(40) && gap.reason === 'bridge-unavailable'));
|
|
89
|
+
assert(!JSON.stringify(gaps).includes('prompt'), 'capture gap diagnostics must not contain conversation bodies');
|
|
90
|
+
|
|
91
|
+
console.log('bridge-adapter-test PASS');
|
|
92
|
+
})().catch(error => {
|
|
93
|
+
console.error(error.stack || error.message);
|
|
94
|
+
process.exitCode = 1;
|
|
95
|
+
});
|