@oscharko-dev/keiko 0.3.14 → 0.3.15
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/dist/ui/csp-hashes.json +6 -6
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/__next.__PAGE__.txt +1 -1
- package/dist/ui/static/__next._full.txt +1 -1
- package/dist/ui/static/__next._head.txt +1 -1
- package/dist/ui/static/__next._index.txt +1 -1
- package/dist/ui/static/__next._tree.txt +1 -1
- package/dist/ui/static/_not-found/__next._full.txt +1 -1
- package/dist/ui/static/_not-found/__next._head.txt +1 -1
- package/dist/ui/static/_not-found/__next._index.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/ui/static/_not-found/__next._not-found.txt +1 -1
- package/dist/ui/static/_not-found/__next._tree.txt +1 -1
- package/dist/ui/static/_not-found.html +1 -1
- package/dist/ui/static/_not-found.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._full.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._head.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._index.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.txt +1 -1
- package/dist/ui/static/atlassian-connectors.html +1 -1
- package/dist/ui/static/atlassian-connectors.txt +1 -1
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +1 -1
- package/dist/ui/static/launch/__next._full.txt +1 -1
- package/dist/ui/static/launch/__next._head.txt +1 -1
- package/dist/ui/static/launch/__next._index.txt +1 -1
- package/dist/ui/static/launch/__next._tree.txt +1 -1
- package/dist/ui/static/launch/__next.launch.__PAGE__.txt +1 -1
- package/dist/ui/static/launch/__next.launch.txt +1 -1
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._full.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._index.txt +1 -1
- package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +1 -1
- package/dist/ui/static/local-knowledge/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._full.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._head.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._index.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +1 -1
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.js +25 -6
- package/node_modules/@oscharko-dev/keiko-cli/package.json +13 -13
- package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.js +2 -2
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +6 -6
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/connector-pod.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/index.js +3 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/embedding-batcher.js +341 -62
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/orchestrator.js +586 -132
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/indexing/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts +20 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/knowledge-log.js +154 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod-refresh.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/manual-pod.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/repository-pod.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/store.js +43 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +15 -2
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +147 -15
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +188 -23
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts +27 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +180 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-embedding-adapter.js +286 -68
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +18 -5
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +141 -26
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncService.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/atlassian/syncService.js +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/bounded-request-body.js +51 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +77 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-instance-cache.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-instance-cache.js +71 -11
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +9 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.js +37 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/index.js +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-handlers.js +158 -36
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.js +9 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation.js +10 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-store-open.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-store-open.js +8 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/manual/manual-pod-service.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/manual/manual-pod-service.js +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/memory-embedding.js +135 -36
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/index.js +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-level.js +57 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts +20 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/log-redaction.js +499 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.js +340 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts +49 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-log.js +449 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts +36 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/server-logger.js +190 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/process-log-sink.js +48 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/server.js +22 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/store-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store-handlers.js +7 -2
- package/node_modules/@oscharko-dev/keiko-server/package.json +21 -21
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +3 -3
- package/package.json +25 -25
- package/release-impact.catalog.json +55 -0
- package/vendor/{oscharko-dev-keiko-cli-0.3.14.tgz → oscharko-dev-keiko-cli-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-connectors-0.3.14.tgz → oscharko-dev-keiko-connectors-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-contracts-0.3.14.tgz → oscharko-dev-keiko-contracts-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-evaluations-0.3.14.tgz → oscharko-dev-keiko-evaluations-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-evidence-0.3.14.tgz → oscharko-dev-keiko-evidence-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-git-0.3.14.tgz → oscharko-dev-keiko-git-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-harness-0.3.14.tgz → oscharko-dev-keiko-harness-0.3.15.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-0.3.15.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-memory-capture-0.3.14.tgz → oscharko-dev-keiko-memory-capture-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-consolidation-0.3.14.tgz → oscharko-dev-keiko-memory-consolidation-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-governance-0.3.14.tgz → oscharko-dev-keiko-memory-governance-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-retrieval-0.3.14.tgz → oscharko-dev-keiko-memory-retrieval-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-vault-0.3.14.tgz → oscharko-dev-keiko-memory-vault-0.3.15.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-0.3.15.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-quality-intelligence-0.3.14.tgz → oscharko-dev-keiko-quality-intelligence-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-sandbox-0.3.14.tgz → oscharko-dev-keiko-sandbox-0.3.15.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-sdk-0.3.15.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-security-0.3.14.tgz → oscharko-dev-keiko-security-0.3.15.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-server-0.3.15.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-tools-0.3.14.tgz → oscharko-dev-keiko-tools-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-verification-0.3.14.tgz → oscharko-dev-keiko-verification-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workflows-0.3.14.tgz → oscharko-dev-keiko-workflows-0.3.15.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-workspace-0.3.14.tgz → oscharko-dev-keiko-workspace-0.3.15.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-sdk-0.3.14.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-0.3.14.tgz +0 -0
- /package/dist/ui/static/_next/static/{y54UtqSyUZo4acoo_2Vb4 → 4j3JDaPBERRu_ZIgeR1VQ}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{y54UtqSyUZo4acoo_2Vb4 → 4j3JDaPBERRu_ZIgeR1VQ}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/static/_next/static/{y54UtqSyUZo4acoo_2Vb4 → 4j3JDaPBERRu_ZIgeR1VQ}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,64 @@
|
|
|
1
1
|
import { Gateway } from "@oscharko-dev/keiko-model-gateway";
|
|
2
|
+
import { getServerLogger } from "./observability/index.js";
|
|
3
|
+
import { processServerLogSink } from "./process-log-sink.js";
|
|
4
|
+
// Every Gateway this cache hands out logs into the process activity log. Constructed without it,
|
|
5
|
+
// `GatewayDeps.log` resolves to the frozen no-op and the whole retry / circuit-breaker /
|
|
6
|
+
// route-rejection lane is unreachable — the instance lines below would then describe which
|
|
7
|
+
// gateway was selected while saying nothing about what it did.
|
|
8
|
+
const GATEWAY_LOG_DEPS = { log: processServerLogSink() };
|
|
9
|
+
function newGateway(config) {
|
|
10
|
+
return new Gateway(config, GATEWAY_LOG_DEPS);
|
|
11
|
+
}
|
|
12
|
+
// The two reasons that DISCARD live circuit-breaker and in-flight request state. A Set rather than
|
|
13
|
+
// an array membership test (SonarJS S7776).
|
|
14
|
+
const LIFECYCLE_RESET_REASONS = new Set([
|
|
15
|
+
"recovered",
|
|
16
|
+
"generation-changed",
|
|
17
|
+
]);
|
|
18
|
+
function runtimeSelectionReason(existing, generation, config) {
|
|
19
|
+
if (existing === undefined)
|
|
20
|
+
return "created";
|
|
21
|
+
if (existing.kind === "unavailable")
|
|
22
|
+
return "recovered";
|
|
23
|
+
if (existing.generation !== generation)
|
|
24
|
+
return "generation-changed";
|
|
25
|
+
return existing.config === config ? "reused" : "rebound";
|
|
26
|
+
}
|
|
27
|
+
function logRuntimeSelection(reason, generation) {
|
|
28
|
+
const log = getServerLogger();
|
|
29
|
+
if (reason === "reused") {
|
|
30
|
+
// The steady state, once per gateway-touching request. Deferred so it costs nothing at `info`.
|
|
31
|
+
log.debug(() => ({
|
|
32
|
+
category: "gateway",
|
|
33
|
+
op: "gateway.instance.reused",
|
|
34
|
+
extra: { generation },
|
|
35
|
+
}));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const lifecycleReset = LIFECYCLE_RESET_REASONS.has(reason);
|
|
39
|
+
log.info({
|
|
40
|
+
category: "gateway",
|
|
41
|
+
op: lifecycleReset ? "gateway.instance.reset" : "gateway.instance.bound",
|
|
42
|
+
extra: { generation, reason, lifecycleReset },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function logRuntimeUnavailable(existing, generation) {
|
|
46
|
+
const log = getServerLogger();
|
|
47
|
+
if (existing?.kind === "unavailable") {
|
|
48
|
+
// Already known unavailable: an unconfigured install would otherwise warn on every request.
|
|
49
|
+
log.debug(() => ({
|
|
50
|
+
category: "gateway",
|
|
51
|
+
op: "gateway.instance.unavailable",
|
|
52
|
+
extra: { generation, reason: "still-unconfigured" },
|
|
53
|
+
}));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
log.warn({
|
|
57
|
+
category: "gateway",
|
|
58
|
+
op: "gateway.instance.unavailable",
|
|
59
|
+
extra: { generation, reason: existing === undefined ? "unconfigured" : "config-withdrawn" },
|
|
60
|
+
});
|
|
61
|
+
}
|
|
2
62
|
class GatewayInstanceCache {
|
|
3
63
|
byConfig = new WeakMap();
|
|
4
64
|
byRuntimeConfig = new WeakMap();
|
|
@@ -6,29 +66,29 @@ class GatewayInstanceCache {
|
|
|
6
66
|
const existing = this.byConfig.get(config);
|
|
7
67
|
if (existing !== undefined)
|
|
8
68
|
return existing;
|
|
9
|
-
const gateway =
|
|
69
|
+
const gateway = newGateway(config);
|
|
10
70
|
this.byConfig.set(config, gateway);
|
|
11
71
|
return gateway;
|
|
12
72
|
}
|
|
13
73
|
forRuntimeConfig(source) {
|
|
14
74
|
const config = source.current();
|
|
75
|
+
const generation = source.generation();
|
|
76
|
+
const existing = this.byRuntimeConfig.get(source);
|
|
15
77
|
if (config === undefined) {
|
|
16
|
-
|
|
78
|
+
logRuntimeUnavailable(existing, generation);
|
|
79
|
+
this.byRuntimeConfig.set(source, { kind: "unavailable", generation });
|
|
17
80
|
return undefined;
|
|
18
81
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
if (existing?.kind === "available"
|
|
22
|
-
existing.generation === generation &&
|
|
23
|
-
existing.config === config) {
|
|
82
|
+
const reason = runtimeSelectionReason(existing, generation, config);
|
|
83
|
+
logRuntimeSelection(reason, generation);
|
|
84
|
+
if (reason === "reused" && existing?.kind === "available")
|
|
24
85
|
return existing.gateway;
|
|
25
|
-
}
|
|
26
86
|
// A runtime generation change invalidates circuit-breaker and request state even when a caller
|
|
27
87
|
// reused the same parsed config object. A config change inside the SAME generation is not an
|
|
28
88
|
// invalidation, so it must still converge with direct callers on the config-keyed instance.
|
|
29
|
-
const
|
|
30
|
-
(
|
|
31
|
-
|
|
89
|
+
const gateway = LIFECYCLE_RESET_REASONS.has(reason)
|
|
90
|
+
? newGateway(config)
|
|
91
|
+
: this.forConfig(config);
|
|
32
92
|
this.byRuntimeConfig.set(source, { kind: "available", config, gateway, generation });
|
|
33
93
|
return gateway;
|
|
34
94
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway-setup.d.ts","sourceRoot":"","sources":["../src/gateway-setup.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAIV,uBAAuB,EAExB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAEV,aAAa,EAOd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAEV,uBAAuB,EAIvB,aAAa,EAEd,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"gateway-setup.d.ts","sourceRoot":"","sources":["../src/gateway-setup.ts"],"names":[],"mappings":"AA6CA,OAAO,KAAK,EAIV,uBAAuB,EAExB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAEV,aAAa,EAOd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE7D,OAAO,KAAK,EAEV,uBAAuB,EAIvB,aAAa,EAEd,MAAM,WAAW,CAAC;AAyBnB,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAqFzC,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM1D;AAm0BD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,aAAa,EACrB,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBzB;AAwLD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAO/E;AAmGD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAG1E;AAKD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,CAqD7E;AAwBD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAElE;AAOD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAE7E;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,CAE3F;AAkWD,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACzC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAO5B;AAw8FD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,CAuBhF;AAisBD,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CAmBtB;AAuMD,oGAAoG;AACpG,wBAAsB,sCAAsC,CAC1D,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CA2BtB"}
|
|
@@ -12,6 +12,7 @@ import { errorBody } from "./routes.js";
|
|
|
12
12
|
import { currentGatewayConfig, currentGatewayEgressConfig } from "./deps.js";
|
|
13
13
|
import { emitServerDiagnostic, serverDiagnosticFromError, } from "./diagnostics-log.js";
|
|
14
14
|
import { CONVERSATION_SYSTEM_PROMPT } from "./conversation-prompt.js";
|
|
15
|
+
import { processServerLogSink } from "./process-log-sink.js";
|
|
15
16
|
import { classifyFigmaTransportError, FigmaConnectorError, } from "./qualityIntelligence/figma/figmaConnectorErrors.js";
|
|
16
17
|
import { classifyTokenFailure } from "./qualityIntelligence/figma/figmaTokenSource.js";
|
|
17
18
|
import { buildQiJudgePreflightRequest, tryParseJudgeVerdict, } from "./qualityIntelligence/judgePort.js";
|
|
@@ -1342,7 +1343,10 @@ export async function smokeTestCandidates(candidates, probe, concurrency) {
|
|
|
1342
1343
|
return accepted;
|
|
1343
1344
|
}
|
|
1344
1345
|
async function defaultGatewaySetupTester(config, candidateModelIds) {
|
|
1345
|
-
|
|
1346
|
+
// Wired to the process activity log: first-run setup is where an operator's endpoint is wrong
|
|
1347
|
+
// in a way no UI message can name (a proxy that blocks CONNECT, a provider that answers 404 for
|
|
1348
|
+
// every model). Without the sink the smoke loop's retries and rejections are invisible.
|
|
1349
|
+
const gateway = new Gateway(config, { log: processServerLogSink() });
|
|
1346
1350
|
const testedModelIds = await smokeTestCandidates(candidateModelIds, async (modelId) => {
|
|
1347
1351
|
await gateway.chat({
|
|
1348
1352
|
modelId,
|
|
@@ -1383,6 +1387,10 @@ async function embedOnceForProbe(provider, modelId) {
|
|
|
1383
1387
|
modelId,
|
|
1384
1388
|
input: EMBEDDING_PROBE_INPUT,
|
|
1385
1389
|
timeoutMs: provider.timeoutMs,
|
|
1390
|
+
// The probe exists because an embedding model used to be persisted on a classification alone.
|
|
1391
|
+
// The sink is what turns a rejected probe into a line naming the status and the error kind,
|
|
1392
|
+
// rather than a model that silently fails to make the candidate list.
|
|
1393
|
+
log: processServerLogSink(),
|
|
1386
1394
|
});
|
|
1387
1395
|
}
|
|
1388
1396
|
// Transient kinds get exactly ONE retry, matching the chat lane's `maxRetries: 1`: a single
|
|
@@ -975,7 +975,7 @@ async function runGroundedRunner(workerCtx, query) {
|
|
|
975
975
|
async function prepareGroundedAsk(ctx, deps, signal) {
|
|
976
976
|
let raw;
|
|
977
977
|
try {
|
|
978
|
-
raw = await readBoundedRequestBody(ctx.req, MAX_BODY_BYTES, signal);
|
|
978
|
+
raw = await readBoundedRequestBody(ctx.req, MAX_BODY_BYTES, signal, ctx.correlationId);
|
|
979
979
|
}
|
|
980
980
|
catch (error) {
|
|
981
981
|
if (error instanceof RequestBodyTooLargeError)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grounded-rerank-facade.d.ts","sourceRoot":"","sources":["../src/grounded-rerank-facade.ts"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AC9C,QAAQ,CAAC,MAAM,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC;IAC9E,QAAQ,CAAC,YAAY,EAAE,kBAAkB,CAAC;IAC1C;;;;;;OAMG;IAEH,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;CAC3D;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,2BAA2B,CAAC;CACnD;AAkBD,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,kBAAkB,GACvB,SAAS,CAAC,EAAE,CAGd;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,YAAY,KAAK,CAAC,GACrD,SAAS,CAAC,EAAE,GAAG,SAAS,CAW1B;AAsPD,wBAAsB,eAAe,CAAC,CAAC,EACrC,KAAK,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAK7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requestLiteLLMRerank, resolveOutboundHttpEgressConfig, } from "@oscharko-dev/keiko-model-gateway";
|
|
2
2
|
import { currentGatewayConfig } from "./deps.js";
|
|
3
|
+
import { getServerLogger, startLogTimer } from "./observability/index.js";
|
|
3
4
|
export function fallbackRerankSelection(candidates, topN, mode) {
|
|
4
5
|
if (mode === "identity")
|
|
5
6
|
return candidates;
|
|
@@ -167,7 +168,43 @@ async function configuredSelection(input, providerCandidates, fallback, reranker
|
|
|
167
168
|
? { selected: fallback, diagnostics: invalidMappingDiagnostics(diagnostics, fallback.length) }
|
|
168
169
|
: { selected, diagnostics: withKeptCount(diagnostics, selected.length) };
|
|
169
170
|
}
|
|
171
|
+
// Every non-applied outcome below is a SILENT degradation from the caller's point of view: the
|
|
172
|
+
// caller still receives a usable selection, so nothing upstream can tell that the provider was
|
|
173
|
+
// never asked, refused, timed out, or answered with an unusable mapping. The activity row carries
|
|
174
|
+
// the diagnostics for one query in the UI; this line is the same decision in the operator's log.
|
|
175
|
+
// `denied`, `unavailable` and `invalid-response` warn — those are a policy rejection and two
|
|
176
|
+
// provider faults. `applied` and `disabled` stay at debug: the first is the happy path and the
|
|
177
|
+
// second is the steady state of a default install with no reranker configured.
|
|
178
|
+
function rerankLogLevel(diagnostics) {
|
|
179
|
+
return diagnostics.status === "applied" || diagnostics.status === "disabled" ? "debug" : "warn";
|
|
180
|
+
}
|
|
181
|
+
function logRerankOutcome(diagnostics, fallbackMode, topN, durationMs) {
|
|
182
|
+
getServerLogger().log(rerankLogLevel(diagnostics), {
|
|
183
|
+
category: "search",
|
|
184
|
+
op: "search.rerank.completed",
|
|
185
|
+
durationMs,
|
|
186
|
+
...(diagnostics.failureKind === undefined ? {} : { errorKind: diagnostics.failureKind }),
|
|
187
|
+
extra: {
|
|
188
|
+
// `outcome`, not `status`: the envelope's `status` is an HTTP code, and the reranker's is a
|
|
189
|
+
// word. Sharing the name would put a string where every operator query expects a number.
|
|
190
|
+
outcome: diagnostics.status,
|
|
191
|
+
mode: diagnostics.mode,
|
|
192
|
+
candidateCount: diagnostics.candidateCount,
|
|
193
|
+
documentCount: diagnostics.documentCount,
|
|
194
|
+
keptCount: diagnostics.keptCount,
|
|
195
|
+
transportLatencyMs: diagnostics.latencyMs,
|
|
196
|
+
fallbackMode,
|
|
197
|
+
topN,
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
}
|
|
170
201
|
export async function rerankSelection(input) {
|
|
202
|
+
const elapsed = startLogTimer();
|
|
203
|
+
const selection = await resolveRerankSelection(input);
|
|
204
|
+
logRerankOutcome(selection.diagnostics, input.fallbackMode, input.topN, elapsed());
|
|
205
|
+
return selection;
|
|
206
|
+
}
|
|
207
|
+
async function resolveRerankSelection(input) {
|
|
171
208
|
const fallback = fallbackRerankSelection(input.candidates, input.topN, input.fallbackMode);
|
|
172
209
|
if (input.policy?.externalReranking === "deny") {
|
|
173
210
|
return {
|
|
@@ -47,4 +47,5 @@ export { rerankSelection, type RerankFallbackMode, type RerankSelection, type Re
|
|
|
47
47
|
export { runGroundedFaithfulnessEval, evaluateGroundedFaithfulnessBudget, DEFAULT_GROUNDED_FAITHFULNESS_BUDGET, type GroundedFaithfulnessScorecard, type GroundedFaithfulnessBudget, } from "./grounded-faithfulness-eval.js";
|
|
48
48
|
export { runGroundedEntailmentEval, evaluateGroundedEntailmentBudget, DEFAULT_GROUNDED_ENTAILMENT_BUDGET, type GroundedEntailmentScorecard, type GroundedEntailmentBudget, } from "./grounded-entailment-eval.js";
|
|
49
49
|
export { SESSION_PAIRING_LAUNCHER_SECRET_ENV, computeLauncherPairingClaim, mintLauncherPairingAttestation, } from "./coding-app-session/launcherSessionPairingPort.js";
|
|
50
|
+
export { createFileServerLogSink, nullServerLogSink, type ServerLogSink, type ServerLogEvent, } from "./observability/server-log.js";
|
|
50
51
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AACrE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,iCAAiC,CAAC;AAMzC,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,kCAAkC,EAClC,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,GAC9B,MAAM,+BAA+B,CAAC;AAKvC,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,oDAAoD,CAAC;AAQ5D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,+BAA+B,CAAC"}
|
|
@@ -83,3 +83,10 @@ export { runGroundedEntailmentEval, evaluateGroundedEntailmentBudget, DEFAULT_GR
|
|
|
83
83
|
// the keiko-cli launcher (`keiko start --open`) mints the single-use attestation with the SAME claim
|
|
84
84
|
// construction the server-side pairing port verifies; the claim formula stays single-source here.
|
|
85
85
|
export { SESSION_PAIRING_LAUNCHER_SECRET_ENV, computeLauncherPairingClaim, mintLauncherPairingAttestation, } from "./coding-app-session/launcherSessionPairingPort.js";
|
|
86
|
+
// ADR-0018 D8 (observability): file-backed activity log sink for the BFF. The CLI wires it into
|
|
87
|
+
// createUiServer so every HTTP request produces one JSON line in `<stateDir>/logs/server.log`,
|
|
88
|
+
// giving operators diagnosable evidence without an env-var opt-in.
|
|
89
|
+
// `createBufferedServerLogSink` is deliberately absent: it is a test-only helper, every consumer
|
|
90
|
+
// is an in-package test importing it from `./observability/index.js`, and a packaged export is a
|
|
91
|
+
// promise this package would then have to keep.
|
|
92
|
+
export { createFileServerLogSink, nullServerLogSink, } from "./observability/server-log.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-knowledge-handlers.d.ts","sourceRoot":"","sources":["../src/local-knowledge-handlers.ts"],"names":[],"mappings":"AAIA,OAAO,EAsBL,kBAAkB,EAUnB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAYV,gBAAgB,EAcjB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"local-knowledge-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AkHD,wBAAsB,wCAAwC,CAC5D,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CA6CtB;AAED,wBAAsB,yCAAyC,CAC7D,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CA6CtB;AAsKD,wBAAsB,kCAAkC,CACtD,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CA4CtB;AAED,wBAAsB,qCAAqC,CACzD,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CAgBtB;AAED,wBAAsB,uCAAuC,CAC3D,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CA0CtB;AAED,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED,wBAAsB,kCAAkC,CACtD,GAAG,EAAE,YAAY,EACjB,IAAI,EAAE,aAAa,GAClB,OAAO,CAAC,WAAW,CAAC,CA2CtB"}
|
|
@@ -7,6 +7,8 @@ import { findIndexingRecoveryCandidate, openKnowledgeStoreForDeps, } from "./loc
|
|
|
7
7
|
import { runLocalTesseractCommand } from "./local-knowledge-ocr-runtime.js";
|
|
8
8
|
import { emitServerDiagnostic, serverDiagnosticFromError } from "./diagnostics-log.js";
|
|
9
9
|
import { newCorrelationId } from "./correlation.js";
|
|
10
|
+
import { errorKindOf, getServerLogger } from "./observability/index.js";
|
|
11
|
+
import { processServerLogSink } from "./process-log-sink.js";
|
|
10
12
|
import { CAPSULE_SET_MAX_MEMBERS, electConversationDefault, DEFAULT_LARGE_DOCUMENT_RESOURCE_POLICY, isKnowledgePodEvidenceSafeText, MODEL_COST_RANK, isSafeQualityWarning, standardPodModelUsePolicy, stripUnsafeFormatChars, validateCapsuleContextualRetrievalSettings, validateCapsuleReindexRequest, validateKnowledgePodModelUsePolicy, validateKnowledgePodSummary, validateKnowledgeSourceScope, } from "@oscharko-dev/keiko-contracts";
|
|
11
13
|
import { currentConversationReadinessObservation, currentGateway, currentGatewayConfig, currentGatewayEgressConfig, } from "./deps.js";
|
|
12
14
|
import { errorBody } from "./routes.js";
|
|
@@ -765,16 +767,22 @@ function createEmbeddingAdapter(provider, requestImpl, batchImpl, fallbackEgress
|
|
|
765
767
|
// the readiness probes honoured the configured value — raising timeoutMs visibly fixed the
|
|
766
768
|
// probe and silently did nothing for indexing, sending the operator's diagnosis in circles.
|
|
767
769
|
// Spread FIRST so an explicit per-request timeout (e.g. a preflight quick check) still wins.
|
|
768
|
-
|
|
770
|
+
//
|
|
771
|
+
// `log` rides the same defaults object, and it is what makes the whole model-gateway embedding
|
|
772
|
+
// ladder — batch dispatch, the per-item degradation, every retry and every endpoint rejection —
|
|
773
|
+
// visible for indexing, capability verification and connector sync alike. Without it those call
|
|
774
|
+
// sites resolve the frozen no-op sink and the six-minute wall this log exists to explain leaves
|
|
775
|
+
// no trace at all.
|
|
776
|
+
const requestDefaults = { timeoutMs: provider.timeoutMs, log: processServerLogSink() };
|
|
769
777
|
return {
|
|
770
778
|
...providerCreds,
|
|
771
|
-
request: (request) => requestImpl({ ...
|
|
779
|
+
request: (request) => requestImpl({ ...requestDefaults, ...request, ...providerCreds }),
|
|
772
780
|
// #189 GRD-004: the indexing batcher prefers this array-batch port when present, turning
|
|
773
781
|
// up to batchSize per-chunk HTTPS round-trips into a single array call. Omitted when no
|
|
774
782
|
// batch impl is wired (scalar-stub tests) so those keep the one-request-per-chunk path.
|
|
775
783
|
...(batchImpl !== undefined
|
|
776
784
|
? {
|
|
777
|
-
requestBatch: (request) => batchImpl({ ...
|
|
785
|
+
requestBatch: (request) => batchImpl({ ...requestDefaults, ...request, ...providerCreds }),
|
|
778
786
|
}
|
|
779
787
|
: {}),
|
|
780
788
|
};
|
|
@@ -1326,6 +1334,11 @@ function buildIndexingOptions(input) {
|
|
|
1326
1334
|
embeddingAdapter: adapter,
|
|
1327
1335
|
embeddingPreflightCacheScope,
|
|
1328
1336
|
auditSink: createSqliteAuditSink(store),
|
|
1337
|
+
// The orchestrator's own activity log. The `IndexingEvent` stream this route already consumes
|
|
1338
|
+
// reports STATE changes ("document 0 of 1"); it cannot report why a state stopped changing.
|
|
1339
|
+
// The sink carries exactly that: which embedding transport was chosen, every retry and
|
|
1340
|
+
// backoff, an absorbed partial batch, a fail-closed identity rejection.
|
|
1341
|
+
logSink: processServerLogSink(),
|
|
1329
1342
|
store,
|
|
1330
1343
|
force: options.force,
|
|
1331
1344
|
...(options.jobId !== undefined ? { idSource: firstCallIdSource(options.jobId) } : {}),
|
|
@@ -1382,6 +1395,10 @@ async function runRepositoryPodIndexingJob(input) {
|
|
|
1382
1395
|
embeddingPreflightCacheScope,
|
|
1383
1396
|
workspaceFs: nodeWorkspaceFs,
|
|
1384
1397
|
auditSink: createSqliteAuditSink(store),
|
|
1398
|
+
// Same sink the folder lane gets from buildIndexingOptions. Without it a repository pod
|
|
1399
|
+
// indexes through the identical orchestrator and writes not one line — the exact shape of
|
|
1400
|
+
// the field incident this instrumentation exists for.
|
|
1401
|
+
logSink: processServerLogSink(),
|
|
1385
1402
|
signal,
|
|
1386
1403
|
...(contextualRetrieval === undefined ? {} : { contextualRetrieval }),
|
|
1387
1404
|
onIndexEvent: (event) => {
|
|
@@ -1831,6 +1848,42 @@ export async function handleGetLocalKnowledgeCapsule(ctx, deps) {
|
|
|
1831
1848
|
}
|
|
1832
1849
|
});
|
|
1833
1850
|
}
|
|
1851
|
+
// ─── The indexing routes' own activity-log spine ──────────────────────────────
|
|
1852
|
+
//
|
|
1853
|
+
// The field incident: a Knowledge Pod run sits at "0 of 1 documents, 0 of 36 vectors" for six
|
|
1854
|
+
// minutes and is then cancelled, and `server.log` holds nothing at all between the operator's
|
|
1855
|
+
// click and the silence. `keiko-local-knowledge` instruments the run itself, but every one of its
|
|
1856
|
+
// lines exists only once a run REACHES the orchestrator, so their absence is ambiguous in exactly
|
|
1857
|
+
// the way that cost four releases of guesswork: it reads identically whether the POST was refused
|
|
1858
|
+
// at the route, whether the detached run died before opening the store, or whether the run started
|
|
1859
|
+
// and hung. These routes therefore write one line at every exit, so absence means one thing only.
|
|
1860
|
+
//
|
|
1861
|
+
// CORRELATION. The orchestrator puts the job uuid verbatim in `correlationId` and the capsule as a
|
|
1862
|
+
// truncated sha-256 in `extra.capsuleIdDigest` (`writeKnowledgeLog`). These lines use the same two
|
|
1863
|
+
// fields computed the same way — that identity is the whole of item 1: the minted job id otherwise
|
|
1864
|
+
// exists only in the 202 response body, and the operator's request joins to no later line at all.
|
|
1865
|
+
const INDEXING_LOG_DIGEST_LENGTH = 16;
|
|
1866
|
+
// The raw capsule id is a customer-chosen handle, so it is never written; the digest is one-way,
|
|
1867
|
+
// stable across every line of a run, and exempt from the opaque-token guard for exactly this use.
|
|
1868
|
+
function capsuleLogDigest(capsuleId) {
|
|
1869
|
+
return createHash("sha256")
|
|
1870
|
+
.update(String(capsuleId))
|
|
1871
|
+
.digest("hex")
|
|
1872
|
+
.slice(0, INDEXING_LOG_DIGEST_LENGTH);
|
|
1873
|
+
}
|
|
1874
|
+
function indexingRouteLog(capsuleId, jobId) {
|
|
1875
|
+
return getServerLogger().child({
|
|
1876
|
+
category: "indexing",
|
|
1877
|
+
capsuleIdDigest: capsuleLogDigest(capsuleId),
|
|
1878
|
+
...(jobId !== undefined ? { correlationId: jobId } : {}),
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
// Warn, not info: a refused index is the operator's own click coming back rejected, and it must
|
|
1882
|
+
// survive the level an operator filters to when a pod will not build.
|
|
1883
|
+
function refuseIndexingStart(log, reason, response) {
|
|
1884
|
+
log.warn({ op: "indexing.start.refused", status: response.status, extra: { reason } });
|
|
1885
|
+
return response;
|
|
1886
|
+
}
|
|
1834
1887
|
// ─── Detached indexing runs (2026-08 field review) ───────────────────────────
|
|
1835
1888
|
// The start route used to await the WHOLE indexing job inside one HTTP POST — a multi-hour
|
|
1836
1889
|
// pending response with zero bytes written. Any transport blip (laptop sleep, BFF restart,
|
|
@@ -1848,8 +1901,40 @@ export async function awaitDetachedCapsuleIndexing(capsuleId) {
|
|
|
1848
1901
|
if (pending !== undefined)
|
|
1849
1902
|
await pending;
|
|
1850
1903
|
}
|
|
1904
|
+
function reportDetachedIndexingFailure(deps, log, correlationId, error) {
|
|
1905
|
+
// The activity log first. The diagnostic below has always existed, but it lands in a different
|
|
1906
|
+
// file: an operator reading the ONE log this instrumentation exists for otherwise sees the
|
|
1907
|
+
// launch line and then nothing, forever, for a run that died before the orchestrator ever wrote
|
|
1908
|
+
// `indexing.job.started`. `errorKindOf` reads only a coded `code`/`name` — never the message,
|
|
1909
|
+
// which can carry a path or a body fragment.
|
|
1910
|
+
log.error({
|
|
1911
|
+
op: "indexing.detached-run.failed",
|
|
1912
|
+
errorKind: errorKindOf(error),
|
|
1913
|
+
extra: { stage: "pre-orchestrator" },
|
|
1914
|
+
});
|
|
1915
|
+
// The job row already carries the terminal state for orchestrated failures; this is the backstop
|
|
1916
|
+
// for failures BEFORE the orchestrator owns the run. Never silent.
|
|
1917
|
+
emitServerDiagnostic(deps.diagnostics, serverDiagnosticFromError({
|
|
1918
|
+
correlationId,
|
|
1919
|
+
operation: "local-knowledge.indexing",
|
|
1920
|
+
source: "local-knowledge.detached-indexing",
|
|
1921
|
+
error,
|
|
1922
|
+
summary: "A detached capsule indexing run failed before reaching a terminal state.",
|
|
1923
|
+
redact: (message) => String(deps.redactor(message)),
|
|
1924
|
+
}));
|
|
1925
|
+
}
|
|
1851
1926
|
function launchDetachedCapsuleIndexing(deps, resolved, jobId) {
|
|
1852
1927
|
const key = String(resolved.capsule.id);
|
|
1928
|
+
// One id across both evidence surfaces. When the route minted a job id, the launch line, every
|
|
1929
|
+
// orchestrator line for the run and the failure diagnostic all carry it, so the operator reads
|
|
1930
|
+
// one thread instead of three unrelated records; the repository-pod path mints its id deeper in,
|
|
1931
|
+
// so a fresh correlation id stands in and `jobIdMinted: false` says so on the line.
|
|
1932
|
+
const correlationId = jobId ?? newCorrelationId();
|
|
1933
|
+
const log = indexingRouteLog(resolved.capsule.id, correlationId);
|
|
1934
|
+
// Item 3: the launch itself. Everything between the 202 and the orchestrator's first line — the
|
|
1935
|
+
// store open and its migrations — used to be unwitnessed, so a throw there surfaced as a
|
|
1936
|
+
// context-free diagnostic and a HANG there was indistinguishable from a run never launched.
|
|
1937
|
+
log.info({ op: "indexing.detached-run.launched", extra: { jobIdMinted: jobId !== undefined } });
|
|
1853
1938
|
const run = (async () => {
|
|
1854
1939
|
// The store open lives INSIDE the try: openKnowledgeStore throws on open/migration failure,
|
|
1855
1940
|
// and a throw before the handler would leave the rejection unhandled (production never awaits
|
|
@@ -1865,16 +1950,7 @@ function launchDetachedCapsuleIndexing(deps, resolved, jobId) {
|
|
|
1865
1950
|
});
|
|
1866
1951
|
}
|
|
1867
1952
|
catch (error) {
|
|
1868
|
-
|
|
1869
|
-
// is the backstop for failures BEFORE the orchestrator owns the run. Never silent.
|
|
1870
|
-
emitServerDiagnostic(deps.diagnostics, serverDiagnosticFromError({
|
|
1871
|
-
correlationId: newCorrelationId(),
|
|
1872
|
-
operation: "local-knowledge.indexing",
|
|
1873
|
-
source: "local-knowledge.detached-indexing",
|
|
1874
|
-
error,
|
|
1875
|
-
summary: "A detached capsule indexing run failed before reaching a terminal state.",
|
|
1876
|
-
redact: (message) => String(deps.redactor(message)),
|
|
1877
|
-
}));
|
|
1953
|
+
reportDetachedIndexingFailure(deps, log, correlationId, error);
|
|
1878
1954
|
}
|
|
1879
1955
|
finally {
|
|
1880
1956
|
env?.close();
|
|
@@ -1883,22 +1959,55 @@ function launchDetachedCapsuleIndexing(deps, resolved, jobId) {
|
|
|
1883
1959
|
})();
|
|
1884
1960
|
detachedIndexingRuns.set(key, run);
|
|
1885
1961
|
}
|
|
1962
|
+
function acceptDetachedIndexingStart(deps, store, resolved, log) {
|
|
1963
|
+
// Trust-boundary validation stays SYNCHRONOUS, before the 202: the deny-list is
|
|
1964
|
+
// re-validated against the canonical (realpath-resolved) roots at index time, and a
|
|
1965
|
+
// violation must answer this request as a 400 — detaching it would demote a refused
|
|
1966
|
+
// credential-directory walk to a buried diagnostic. The detached run repeats the
|
|
1967
|
+
// (idempotent) canonicalization harmlessly.
|
|
1968
|
+
canonicalizeCapsuleSourceRoots(store, resolved.capsule);
|
|
1969
|
+
// Repository pods mint their job id inside their own refresh flow; the standard path
|
|
1970
|
+
// pins the id up front so the 202 names the job the caller can poll.
|
|
1971
|
+
const jobId = repositoryPodSourceId(store, resolved.capsule) === undefined ? randomUUID() : undefined;
|
|
1972
|
+
// Item 1. Written BEFORE the launch so the file reads in causal order — accepted, launched,
|
|
1973
|
+
// indexing.job.started — and carrying the minted id in `correlationId`, which is the single
|
|
1974
|
+
// field that lets an operator grep the six blank minutes back to the request that opened them.
|
|
1975
|
+
// `sourceCount` is the shape the run was admitted with: "0 of 1 documents" is only diagnosable
|
|
1976
|
+
// against what the route believed it was starting.
|
|
1977
|
+
(jobId === undefined ? log : log.child({ correlationId: jobId })).info({
|
|
1978
|
+
op: "indexing.start.accepted",
|
|
1979
|
+
status: 202,
|
|
1980
|
+
extra: { jobIdMinted: jobId !== undefined, sourceCount: resolved.capsule.sourceIds.length },
|
|
1981
|
+
});
|
|
1982
|
+
launchDetachedCapsuleIndexing(deps, resolved, jobId);
|
|
1983
|
+
return {
|
|
1984
|
+
status: 202,
|
|
1985
|
+
body: {
|
|
1986
|
+
ok: true,
|
|
1987
|
+
capsuleId: resolved.capsule.id,
|
|
1988
|
+
...(jobId !== undefined ? { jobId } : {}),
|
|
1989
|
+
},
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1886
1992
|
export async function handleStartLocalKnowledgeCapsuleIndexing(ctx, deps) {
|
|
1887
1993
|
return runHandler(async () => {
|
|
1888
1994
|
const capsuleId = parseCapsuleId(ctx);
|
|
1889
1995
|
await readJsonObject(ctx.req);
|
|
1996
|
+
const log = indexingRouteLog(capsuleId);
|
|
1890
1997
|
const env = openStoreForDeps(deps);
|
|
1891
1998
|
try {
|
|
1892
1999
|
const capsule = getCapsule(env.store, capsuleId);
|
|
1893
2000
|
if (capsule === undefined) {
|
|
1894
|
-
|
|
2001
|
+
const response = notFound(`Capsule not found: ${capsuleId}`);
|
|
2002
|
+
return refuseIndexingStart(log, "capsule-not-found", response);
|
|
1895
2003
|
}
|
|
1896
2004
|
if (capsule.sourceIds.length === 0) {
|
|
1897
|
-
return emptyCapsuleIndexingConflict();
|
|
2005
|
+
return refuseIndexingStart(log, "capsule-has-no-sources", emptyCapsuleIndexingConflict());
|
|
1898
2006
|
}
|
|
1899
2007
|
const resolved = await resolveIndexingProviderForCapsule(deps, env.store, capsule);
|
|
1900
2008
|
if (resolved === undefined) {
|
|
1901
|
-
|
|
2009
|
+
const response = conflict("No configured embedding-capable model matches this capsule. Update the Model Gateway configuration before indexing it.");
|
|
2010
|
+
return refuseIndexingStart(log, "no-embedding-capable-model", response);
|
|
1902
2011
|
}
|
|
1903
2012
|
// LK-003 (Epic #189): refuse to start a second concurrent indexer for the same
|
|
1904
2013
|
// capsule — the orchestrator persists running jobs, so a duplicate POST would
|
|
@@ -1906,29 +2015,15 @@ export async function handleStartLocalKnowledgeCapsuleIndexing(ctx, deps) {
|
|
|
1906
2015
|
// the window between answering 202 and the detached run persisting its job row.
|
|
1907
2016
|
const runningJobId = latestRunningJobId(env.store, resolved.capsule.id);
|
|
1908
2017
|
if (runningJobId !== undefined) {
|
|
1909
|
-
|
|
2018
|
+
// Correlated to the job that is BLOCKING this request, not to the refused one: "which run
|
|
2019
|
+
// is holding the capsule" is the only useful next question after this 409.
|
|
2020
|
+
return refuseIndexingStart(log.child({ correlationId: runningJobId }), "job-already-running", runningIndexingJobConflict(resolved.capsule.id, runningJobId));
|
|
1910
2021
|
}
|
|
1911
2022
|
if (detachedIndexingRuns.has(String(resolved.capsule.id))) {
|
|
1912
|
-
|
|
2023
|
+
const response = conflict("An indexing job for this capsule is already starting.");
|
|
2024
|
+
return refuseIndexingStart(log, "run-already-starting", response);
|
|
1913
2025
|
}
|
|
1914
|
-
|
|
1915
|
-
// re-validated against the canonical (realpath-resolved) roots at index time, and a
|
|
1916
|
-
// violation must answer this request as a 400 — detaching it would demote a refused
|
|
1917
|
-
// credential-directory walk to a buried diagnostic. The detached run repeats the
|
|
1918
|
-
// (idempotent) canonicalization harmlessly.
|
|
1919
|
-
canonicalizeCapsuleSourceRoots(env.store, resolved.capsule);
|
|
1920
|
-
// Repository pods mint their job id inside their own refresh flow; the standard path
|
|
1921
|
-
// pins the id up front so the 202 names the job the caller can poll.
|
|
1922
|
-
const jobId = repositoryPodSourceId(env.store, resolved.capsule) === undefined ? randomUUID() : undefined;
|
|
1923
|
-
launchDetachedCapsuleIndexing(deps, resolved, jobId);
|
|
1924
|
-
return {
|
|
1925
|
-
status: 202,
|
|
1926
|
-
body: {
|
|
1927
|
-
ok: true,
|
|
1928
|
-
capsuleId: resolved.capsule.id,
|
|
1929
|
-
...(jobId !== undefined ? { jobId } : {}),
|
|
1930
|
-
},
|
|
1931
|
-
};
|
|
2026
|
+
return acceptDetachedIndexingStart(deps, env.store, resolved, log);
|
|
1932
2027
|
}
|
|
1933
2028
|
finally {
|
|
1934
2029
|
env.close();
|
|
@@ -1939,15 +2034,42 @@ export async function handleCancelLocalKnowledgeCapsuleIndexing(ctx, deps) {
|
|
|
1939
2034
|
return runHandler(async () => {
|
|
1940
2035
|
const capsuleId = parseCapsuleId(ctx);
|
|
1941
2036
|
await readJsonObject(ctx.req);
|
|
2037
|
+
const log = indexingRouteLog(capsuleId);
|
|
2038
|
+
// Item 4, and the reason it matters: the customer in the field incident CANCELLED after six
|
|
2039
|
+
// minutes. The orchestrator writes `indexing.job.finished` with status cancelled once the run
|
|
2040
|
+
// observes the flag — but a run wedged BEFORE that observation never does, which is precisely
|
|
2041
|
+
// the state under investigation. This line is written on arrival, so the operator's action is
|
|
2042
|
+
// on the record even when the run it targets never reacts to it.
|
|
2043
|
+
log.info({ op: "indexing.cancel.requested" });
|
|
1942
2044
|
const env = openStoreForDeps(deps);
|
|
1943
2045
|
try {
|
|
1944
2046
|
const capsule = getCapsule(env.store, capsuleId);
|
|
1945
2047
|
if (capsule === undefined) {
|
|
2048
|
+
log.warn({
|
|
2049
|
+
op: "indexing.cancel.refused",
|
|
2050
|
+
status: 404,
|
|
2051
|
+
extra: { reason: "capsule-not-found" },
|
|
2052
|
+
});
|
|
1946
2053
|
return notFound(`Capsule not found: ${capsuleId}`);
|
|
1947
2054
|
}
|
|
2055
|
+
// Read before requesting: `requestRunningJobCancellation` answers only yes/no, and the id of
|
|
2056
|
+
// the job the flag was set on is what joins this line to the run's own lines.
|
|
2057
|
+
const runningJobId = latestRunningJobId(env.store, capsule.id);
|
|
1948
2058
|
if (!requestRunningJobCancellation(env.store, capsule.id)) {
|
|
2059
|
+
log.warn({
|
|
2060
|
+
op: "indexing.cancel.refused",
|
|
2061
|
+
status: 409,
|
|
2062
|
+
extra: { reason: "no-running-job" },
|
|
2063
|
+
});
|
|
1949
2064
|
return conflict("No running indexing job was found for this capsule.");
|
|
1950
2065
|
}
|
|
2066
|
+
// Warn, matching the orchestrator's own level for a cancelled job: a cancellation is a run
|
|
2067
|
+
// that did not deliver, and the two lines must survive the same operator filter.
|
|
2068
|
+
log.child({ correlationId: runningJobId }).warn({
|
|
2069
|
+
op: "indexing.cancel.accepted",
|
|
2070
|
+
status: 200,
|
|
2071
|
+
extra: { cancellationRequested: true },
|
|
2072
|
+
});
|
|
1951
2073
|
return actionResponse(capsule.id);
|
|
1952
2074
|
}
|
|
1953
2075
|
finally {
|
package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-remediation-store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-knowledge-remediation-store.d.ts","sourceRoot":"","sources":["../src/local-knowledge-remediation-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"local-knowledge-remediation-store.d.ts","sourceRoot":"","sources":["../src/local-knowledge-remediation-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAU7C,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,UAAU,2BAA2B;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,yBAAyB,GAAG,SAAS,CAAC;CAC9D;AA2CD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,QAAQ,CAuBnF;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,GAAG,8BAA8B,CAK7F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { listCapsules, openKnowledgeStore, resolveKnowledgeStorePath, } from "@oscharko-dev/keiko-local-knowledge";
|
|
2
2
|
import { recoverAbandonedIndexingJobs } from "./local-knowledge-store-open.js";
|
|
3
3
|
import { localKnowledgeProtectionOptions } from "./localKnowledgeKeyProvider.js";
|
|
4
|
+
import { processServerLogSink } from "./process-log-sink.js";
|
|
4
5
|
function emptyScope() {
|
|
5
6
|
return { capsules: 0, sources: 0, documents: 0, chunks: 0, vectors: 0 };
|
|
6
7
|
}
|
|
@@ -34,7 +35,14 @@ export function openRemediationStore(options) {
|
|
|
34
35
|
}
|
|
35
36
|
const dbPath = resolveKnowledgeStorePath({ runtimeStateDir: options.runtimeStateDir });
|
|
36
37
|
const protection = localKnowledgeProtectionOptions(options.keyProvider);
|
|
37
|
-
|
|
38
|
+
// Both open shapes carry the sink. Remediation is the tool an operator reaches for AFTER the
|
|
39
|
+
// Knowledge Pod has already misbehaved, and opening the store is where the two failures that
|
|
40
|
+
// brought them here are decided: a confirmed-corruption quarantine trades the database for an
|
|
41
|
+
// empty one, and a wrong-key rejection refuses to open it at all. Unwired, the recovery tool
|
|
42
|
+
// performed the data-losing decision in silence and the operator learned about it from the
|
|
43
|
+
// missing capsules — which is the same "no error, no evidence" shape as the field incident.
|
|
44
|
+
const logSink = processServerLogSink();
|
|
45
|
+
const store = openKnowledgeStore(protection === undefined ? { dbPath, logSink } : { dbPath, protection, logSink });
|
|
38
46
|
recoverAbandonedIndexingJobs(store);
|
|
39
47
|
return {
|
|
40
48
|
store,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-knowledge-remediation.d.ts","sourceRoot":"","sources":["../src/local-knowledge-remediation.ts"],"names":[],"mappings":"AAQA,OAAO,EASL,KAAK,yBAAyB,EAC/B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAKL,KAAK,aAAa,EAGlB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"local-knowledge-remediation.d.ts","sourceRoot":"","sources":["../src/local-knowledge-remediation.ts"],"names":[],"mappings":"AAQA,OAAO,EASL,KAAK,yBAAyB,EAC/B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAKL,KAAK,aAAa,EAGlB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,K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