noteconnection 1.7.0 → 1.9.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/LICENSE +674 -21
- package/README.md +260 -1626
- package/dist/src/agent_workspace.contract.parity.test.js +159 -0
- package/dist/src/agent_workspace.frontend.test.js +10388 -0
- package/dist/src/agent_workspace.locale.contract.test.js +95 -0
- package/dist/src/agent_workspace.runtime.behavior.test.js +5072 -0
- package/dist/src/android.knowledgebase.picker.contract.test.js +102 -0
- package/dist/src/appimage.patchelf.test.js +113 -0
- package/dist/src/appimage.portability.test.js +156 -0
- package/dist/src/backend/FileLoader.js +18 -4
- package/dist/src/backend/FileLoader.test.js +125 -0
- package/dist/src/backend/GraphBuilder.identity.test.js +86 -0
- package/dist/src/backend/GraphBuilder.js +66 -18
- package/dist/src/backend/GraphBuilder.matching.test.js +127 -0
- package/dist/src/backend/GraphMetrics.js +0 -3
- package/dist/src/backend/ResourceIdentity.js +155 -0
- package/dist/src/backend/ResourceIdentity.test.js +113 -0
- package/dist/src/backend/algorithms/CycleDetection.js +0 -1
- package/dist/src/backend/algorithms/HybridEngine.js +0 -3
- package/dist/src/backend/algorithms/LayoutEngine.js +0 -1
- package/dist/src/backend/algorithms/StatisticalAnalyzer.js +0 -4
- package/dist/src/backend/algorithms/TopologicalSort.js +0 -2
- package/dist/src/backend/build_dag.js +0 -1
- package/dist/src/capacitor.bridge.serialization.contract.test.js +3 -0
- package/dist/src/capacitor.runtime.contract.test.js +11 -2
- package/dist/src/copy.assets.contract.test.js +130 -0
- package/dist/src/core/Graph.js +138 -42
- package/dist/src/core/Graph.test.js +74 -0
- package/dist/src/core/NoteConnection.js +2 -2
- package/dist/src/core/PathBridge.js +293 -5
- package/dist/src/core/ResourceReference.js +17 -0
- package/dist/src/desktop.godot.pack.test.js +142 -0
- package/dist/src/desktop.runtime.graph.test.js +66 -0
- package/dist/src/export/WorkspaceExportBundle.js +1174 -0
- package/dist/src/export/WorkspaceExportBundle.test.js +1541 -0
- package/dist/src/export/index.js +18 -0
- package/dist/src/export/types.js +2 -0
- package/dist/src/fixrisk.issue.verifier.contract.test.js +3 -1
- package/dist/src/foundation.ann.runtime.contract.test.js +81 -0
- package/dist/src/foundation.release.evidence.contract.test.js +524 -0
- package/dist/src/foundation.sqlite.runtime.contract.test.js +88 -0
- package/dist/src/frontend/README.md +260 -1626
- package/dist/src/frontend/agent_workspace.js +6011 -0
- package/dist/src/frontend/agent_workspace_runtime.js +4434 -0
- package/dist/src/frontend/analysis.js +31 -4
- package/dist/src/frontend/app.js +2178 -62
- package/dist/src/frontend/focus_mode_interactions.js +33 -0
- package/dist/src/frontend/godot_future_path_renderer.js +540 -0
- package/dist/src/frontend/godot_tree_interactions.js +178 -0
- package/dist/src/frontend/graph_state.mjs +105 -0
- package/dist/src/frontend/hosted_future_path_runtime.js +157 -0
- package/dist/src/frontend/i18n.mjs +186 -0
- package/dist/src/frontend/index.html +672 -268
- package/dist/src/frontend/knowledge_projection_contract.js +230 -0
- package/dist/src/frontend/knowledge_projection_store.js +214 -0
- package/dist/src/frontend/layout_gpu.js +12 -4
- package/dist/src/frontend/libs/path_core.js +158 -42
- package/dist/src/frontend/locales/en.json +753 -5
- package/dist/src/frontend/locales/zh.json +753 -5
- package/dist/src/frontend/main.mjs +60 -0
- package/dist/src/frontend/markdown_runtime.js +827 -0
- package/dist/src/frontend/mobile_budget_runtime.js +33 -0
- package/dist/src/frontend/mobile_exact_analyzer.js +393 -0
- package/dist/src/frontend/mobile_identity_contract.js +221 -0
- package/dist/src/frontend/mobile_semantic_comparator.js +264 -0
- package/dist/src/frontend/notemd.css +49 -0
- package/dist/src/frontend/notemd.html +7 -1
- package/dist/src/frontend/notemd.js +64 -0
- package/dist/src/frontend/path.html +113 -2
- package/dist/src/frontend/path_app.js +2108 -130
- package/dist/src/frontend/path_layout.mjs +143 -0
- package/dist/src/frontend/path_mermaid_utils.mjs +108 -0
- package/dist/src/frontend/path_modules_bridge.js +486 -0
- package/dist/src/frontend/path_state.mjs +118 -0
- package/dist/src/frontend/path_styles.css +146 -0
- package/dist/src/frontend/path_worker_bridge.mjs +85 -0
- package/dist/src/frontend/reader.js +393 -33
- package/dist/src/frontend/runtime_bridge.js +67 -54
- package/dist/src/frontend/runtime_bridge.mjs +279 -0
- package/dist/src/frontend/settings.js +130 -12
- package/dist/src/frontend/simulationWorker.js +1 -1
- package/dist/src/frontend/source_manager.js +297 -22
- package/dist/src/frontend/storage_provider.js +661 -71
- package/dist/src/frontend/styles.css +2814 -72
- package/dist/src/frontend/workbench_state.mjs +101 -0
- package/dist/src/frontend/workspace_panes.js +10272 -0
- package/dist/src/frontend.locale.contract.test.js +62 -0
- package/dist/src/frontend.runtime.assets.contract.test.js +81 -0
- package/dist/src/godot.sidecar.bootstrap.contract.test.js +244 -0
- package/dist/src/graph.answer.operator.contract.test.js +72 -0
- package/dist/src/index.js +6 -2
- package/dist/src/index.knowledge-root.test.js +118 -0
- package/dist/src/indexing/IndexLifecycle.js +217 -0
- package/dist/src/indexing/IndexLifecycle.test.js +73 -0
- package/dist/src/indexing/SegmentBuilder.js +64 -0
- package/dist/src/indexing/UnitBuilder.js +48 -0
- package/dist/src/indexing/types.js +2 -0
- package/dist/src/knowledge.api.contract.test.js +172 -0
- package/dist/src/knowledge_projection.contract.test.js +134 -0
- package/dist/src/knowledge_projection_store.test.js +200 -0
- package/dist/src/learning/AnswerQualityEvaluation.js +153 -0
- package/dist/src/learning/AnswerQualityEvaluation.test.js +118 -0
- package/dist/src/learning/KnowledgeLearningPlatform.js +11181 -0
- package/dist/src/learning/KnowledgeLearningPlatform.persistence.test.js +745 -0
- package/dist/src/learning/KnowledgeLearningPlatform.program-f.test.js +99 -0
- package/dist/src/learning/KnowledgeLearningPlatform.test.js +3208 -0
- package/dist/src/learning/KnowledgeWorkspaceConversationRegression.js +2998 -0
- package/dist/src/learning/KnowledgeWorkspaceConversationRegression.test.js +3936 -0
- package/dist/src/learning/MeasurementEvidenceConflicts.test.js +78 -0
- package/dist/src/learning/PublicAnswerContract.test.js +85 -0
- package/dist/src/learning/PublicEvidenceSelection.test.js +94 -0
- package/dist/src/learning/PublicMeasurementDisclosure.test.js +54 -0
- package/dist/src/learning/agentConversationExecution.js +211 -0
- package/dist/src/learning/agentConversationExecution.test.js +209 -0
- package/dist/src/learning/agentConversationSerialization.js +266 -0
- package/dist/src/learning/agentConversationSerialization.test.js +165 -0
- package/dist/src/learning/agentResponseBudget.js +179 -0
- package/dist/src/learning/agentResponseBudget.test.js +97 -0
- package/dist/src/learning/agentWorkspaceCapabilityContracts.js +65 -0
- package/dist/src/learning/answerReleaseReview.js +5260 -0
- package/dist/src/learning/answerReleaseReview.test.js +4174 -0
- package/dist/src/learning/answerTaskPlan.js +473 -0
- package/dist/src/learning/api.js +2 -0
- package/dist/src/learning/conversationComposer.js +1721 -0
- package/dist/src/learning/conversationComposer.test.js +3220 -0
- package/dist/src/learning/domains/ConversationManager.js +53 -0
- package/dist/src/learning/domains/KnowledgeIngestor.js +238 -0
- package/dist/src/learning/domains/KnowledgeQuerier.js +187 -0
- package/dist/src/learning/domains/MasteryEngine.js +387 -0
- package/dist/src/learning/domains/MemoryPolicyManager.js +408 -0
- package/dist/src/learning/domains/QualityEvaluator.js +307 -0
- package/dist/src/learning/domains/TutorRouter.js +313 -0
- package/dist/src/learning/domains/index.js +33 -0
- package/dist/src/learning/domains/types.js +7 -0
- package/dist/src/learning/errors.js +29 -0
- package/dist/src/learning/evidenceContextAssembler.js +1368 -0
- package/dist/src/learning/evidenceContextAssembler.test.js +6332 -0
- package/dist/src/learning/graphAnswerCoverage.js +37 -0
- package/dist/src/learning/graphAnswerCoverage.test.js +93 -0
- package/dist/src/learning/graphAnswerCoverageCalibration.js +59 -0
- package/dist/src/learning/graphAnswerCoverageCalibration.test.js +46 -0
- package/dist/src/learning/graphAnswerFacts.js +94 -0
- package/dist/src/learning/graphAnswerFacts.test.js +39 -0
- package/dist/src/learning/graphAnswerPlan.js +908 -0
- package/dist/src/learning/graphAnswerPlan.test.js +907 -0
- package/dist/src/learning/graphAnswerQualityCalibration.js +255 -0
- package/dist/src/learning/graphAnswerQualityCalibration.test.js +72 -0
- package/dist/src/learning/graphAnswerQualityPolicy.js +30 -0
- package/dist/src/learning/graphClaimMatcher.js +104 -0
- package/dist/src/learning/graphConditionedContext.js +109 -0
- package/dist/src/learning/graphConditionedContext.test.js +99 -0
- package/dist/src/learning/graphContextAssembler.js +860 -0
- package/dist/src/learning/graphContextAssembler.test.js +1033 -0
- package/dist/src/learning/graphExpansionPolicy.js +22 -0
- package/dist/src/learning/graphExpansionPolicy.test.js +33 -0
- package/dist/src/learning/identityMetadata.test.js +26 -0
- package/dist/src/learning/index.js +29 -0
- package/dist/src/learning/mobileAnswerProjection.js +104 -0
- package/dist/src/learning/mobileAnswerProjection.test.js +102 -0
- package/dist/src/learning/queryBackend.js +1922 -0
- package/dist/src/learning/queryBackend.test.js +976 -0
- package/dist/src/learning/ragContextPack.js +356 -0
- package/dist/src/learning/ragContextPack.test.js +311 -0
- package/dist/src/learning/ragEvidenceQuality.js +96 -0
- package/dist/src/learning/ragEvidenceQuality.test.js +29 -0
- package/dist/src/learning/ragPublicText.js +101 -0
- package/dist/src/learning/ragPublicText.test.js +57 -0
- package/dist/src/learning/ragSufficiencyJudge.js +171 -0
- package/dist/src/learning/ragSufficiencyJudge.test.js +177 -0
- package/dist/src/learning/ragSufficiencyProviderJudge.js +217 -0
- package/dist/src/learning/ragSufficiencyProviderJudge.test.js +207 -0
- package/dist/src/learning/requestNormalization.js +304 -0
- package/dist/src/learning/requestNormalization.test.js +101 -0
- package/dist/src/learning/runtimeCapability.js +4677 -0
- package/dist/src/learning/runtimeCapability.test.js +3635 -0
- package/dist/src/learning/store.js +1344 -0
- package/dist/src/learning/store.test.js +1425 -0
- package/dist/src/learning/tutorAdapter.js +2 -0
- package/dist/src/learning/types.js +2 -0
- package/dist/src/learning/vectorAccelerationAdapter.js +958 -0
- package/dist/src/learning/vectorAccelerationAdapter.test.js +412 -0
- package/dist/src/learning/workspaceHydration.js +168 -0
- package/dist/src/learning/workspaceHydration.test.js +30 -0
- package/dist/src/lfs.asset.policy.contract.test.js +153 -0
- package/dist/src/license.policy.contract.test.js +71 -0
- package/dist/src/markdown/MarkdownGateway.js +4 -0
- package/dist/src/markdown/MarkdownGateway.test.js +59 -0
- package/dist/src/memory/MemoryGovernance.js +74 -0
- package/dist/src/memory/MemoryGovernance.test.js +46 -0
- package/dist/src/memory/types.js +2 -0
- package/dist/src/mermaid.frontend.guard.contract.test.js +77 -0
- package/dist/src/middleware/SseResponseWriter.js +122 -0
- package/dist/src/middleware/SseResponseWriter.test.js +54 -0
- package/dist/src/middleware/auth.js +38 -0
- package/dist/src/middleware/auth.test.js +33 -0
- package/dist/src/middleware/body-parser.js +45 -0
- package/dist/src/middleware/cors.js +44 -0
- package/dist/src/middleware/index.js +22 -0
- package/dist/src/middleware/request-trace.js +96 -0
- package/dist/src/mobile.android.evidence.contract.test.js +146 -0
- package/dist/src/mobile.android.signing.contract.test.js +66 -0
- package/dist/src/mobile.artifact.contract.test.js +144 -0
- package/dist/src/mobile.budget.contract.test.js +90 -0
- package/dist/src/mobile.canonical-id.readiness.test.js +54 -0
- package/dist/src/mobile.graph.parity.contract.test.js +207 -0
- package/dist/src/mobile.identity.contract.test.js +66 -0
- package/dist/src/mobile.identity.corpus.manifest.test.js +72 -0
- package/dist/src/mobile.identity.corpus.test.js +40 -0
- package/dist/src/mobile.native.recovery.contract.test.js +64 -0
- package/dist/src/mobile.pipeline.test.js +11 -1
- package/dist/src/mobile.profile.contract.test.js +225 -0
- package/dist/src/mobile.semantic.parity.test.js +92 -0
- package/dist/src/mobile_exact_analyzer.test.js +113 -0
- package/dist/src/notemd/AppConfigToml.js +6 -4
- package/dist/src/notemd/ContentGenerator.js +4 -9
- package/dist/src/notemd/FileProcessor.js +4 -9
- package/dist/src/notemd/MermaidProcessor.js +400 -50
- package/dist/src/notemd/NotemdService.js +506 -26
- package/dist/src/notemd/PromptManager.js +15 -0
- package/dist/src/notemd/Translator.js +4 -9
- package/dist/src/notemd/cli/commands.js +357 -0
- package/dist/src/notemd/cli/dispatcher.js +225 -0
- package/dist/src/notemd/cli/index.js +169 -0
- package/dist/src/notemd/cli/parser.js +68 -0
- package/dist/src/notemd/cli/types.js +2 -0
- package/dist/src/notemd/constants.js +43 -0
- package/dist/src/notemd/diagram/diagramGenerationService.js +78 -0
- package/dist/src/notemd/diagram/diagramSpec.js +79 -0
- package/dist/src/notemd/diagram/diagramSpecResponseParser.js +131 -0
- package/dist/src/notemd/diagram/intent.js +95 -0
- package/dist/src/notemd/diagram/planner.js +71 -0
- package/dist/src/notemd/diagram/prompts/diagramSpecPrompt.js +42 -0
- package/dist/src/notemd/diagram/types.js +18 -0
- package/dist/src/notemd/index.js +26 -0
- package/dist/src/notemd/operations/capabilityManifest.js +23 -0
- package/dist/src/notemd/operations/cliContracts.js +17 -0
- package/dist/src/notemd/operations/configProfileCommands.js +85 -0
- package/dist/src/notemd/operations/registry.contract.test.js +95 -0
- package/dist/src/notemd/operations/registry.js +991 -0
- package/dist/src/notemd/operations/types.js +2 -0
- package/dist/src/notemd/progressReporter.js +9 -0
- package/dist/src/notemd/providerDiagnostics.js +220 -0
- package/dist/src/notemd/providerProfiles.js +42 -0
- package/dist/src/notemd/providerTemplates.js +231 -0
- package/dist/src/notemd/search/DuckDuckGoProvider.js +39 -0
- package/dist/src/notemd/search/SearchManager.js +13 -0
- package/dist/src/notemd/search/SearchProvider.js +2 -0
- package/dist/src/notemd/search/TavilyProvider.js +44 -0
- package/dist/src/notemd.agent.manifest.test.js +85 -0
- package/dist/src/notemd.api.contract.test.js +14 -1
- package/dist/src/notemd.app_config_toml.test.js +2 -1
- package/dist/src/notemd.batch.workflow.test.js +117 -0
- package/dist/src/notemd.cli.e2e.test.js +136 -0
- package/dist/src/notemd.core.test.js +51 -0
- package/dist/src/notemd.diagram.pipeline.test.js +233 -0
- package/dist/src/notemd.providerTemplates.test.js +34 -0
- package/dist/src/notemd.server.integration.test.js +262 -39
- package/dist/src/notemd.workflow.pipeline.test.js +162 -0
- package/dist/src/pathbridge.handshake.contract.test.js +45 -2
- package/dist/src/pathbridge.host-adapter.contract.test.js +133 -0
- package/dist/src/pathcore.bundle.contract.test.js +8 -0
- package/dist/src/pathmode.background.contract.test.js +69 -0
- package/dist/src/pathmode.settings.api.contract.test.js +9 -0
- package/dist/src/pkg.sidecar.contract.test.js +9 -3
- package/dist/src/platform/ExportProfile.js +86 -0
- package/dist/src/platform/MobileBudget.js +11 -0
- package/dist/src/platform/PlatformCapabilities.js +59 -0
- package/dist/src/platform/PlatformCapabilities.test.js +36 -0
- package/dist/src/platform/RenderMaterializer.js +33 -0
- package/dist/src/platform/RenderMaterializer.test.js +32 -0
- package/dist/src/query_backend.external_http.integration.test.js +410 -0
- package/dist/src/reader_renderer.js +404 -3
- package/dist/src/reader_renderer.test.js +87 -0
- package/dist/src/release.godot.mirror.contract.test.js +97 -0
- package/dist/src/resources/ResourceRegistry.js +263 -0
- package/dist/src/resources/ResourceRegistry.test.js +97 -0
- package/dist/src/resources/types.js +2 -0
- package/dist/src/routes/agentWorkspaceDiagnostics.js +173 -0
- package/dist/src/routes/index.js +19 -0
- package/dist/src/routes/knowledge.js +981 -0
- package/dist/src/routes/knowledgePayload.js +185 -0
- package/dist/src/routes/knowledgePayload.test.js +53 -0
- package/dist/src/routes/markdown.js +295 -0
- package/dist/src/routes/notemd.js +1321 -0
- package/dist/src/routes/registry.contract.test.js +133 -0
- package/dist/src/routes/registry.shadow.contract.test.js +22 -0
- package/dist/src/routes/render.js +248 -0
- package/dist/src/routes/runtimeRunbookRouteOps.js +149 -0
- package/dist/src/routes/runtimeRunbookRouteOps.test.js +194 -0
- package/dist/src/routes/settings.js +6 -0
- package/dist/src/routes/staticFiles.js +94 -0
- package/dist/src/routes/types.js +2 -0
- package/dist/src/runtime.capabilities.test.js +18 -2
- package/dist/src/runtime.transport.adapter.contract.test.js +81 -0
- package/dist/src/server.js +10342 -1325
- package/dist/src/server.migration.test.js +584 -10
- package/dist/src/server.port.fallback.contract.test.js +63 -0
- package/dist/src/session/SessionStateStore.js +81 -0
- package/dist/src/session/SessionStateStore.test.js +58 -0
- package/dist/src/session/types.js +2 -0
- package/dist/src/settings.runtime.contract.test.js +50 -0
- package/dist/src/shared/types.contract.test.js +107 -0
- package/dist/src/shared/types.js +22 -0
- package/dist/src/sidecar.build.lock.contract.test.js +201 -0
- package/dist/src/sidecar.freshness.contract.test.js +184 -0
- package/dist/src/sidecar.replacement.boundary.contract.test.js +131 -0
- package/dist/src/sidecar.supply.readiness.contract.test.js +155 -0
- package/dist/src/simulation.worker.offline.test.js +104 -0
- package/dist/src/source_manager.loadflow.test.js +46 -0
- package/dist/src/startup.layout.snapshot.contract.test.js +57 -0
- package/dist/src/storage.provider.capacitor.content.contract.test.js +4 -1
- package/dist/src/storage.provider.contract.test.js +152 -1
- package/dist/src/tauri.frontend.build.contract.test.js +68 -0
- package/dist/src/tauri.sidecar.cleanup.contract.test.js +21 -0
- package/dist/src/tauri.window.evidence.execution.test.js +68 -0
- package/dist/src/utils/RuntimePaths.js +10 -13
- package/dist/src/utils/RuntimePaths.test.js +27 -0
- package/dist/src/utils/platform.js +153 -0
- package/dist/src/windows.installer.build.test.js +109 -0
- package/dist/src/windows.installer.payload.test.js +76 -0
- package/dist/src/windows.installer.runtime.test.js +69 -0
- package/dist/src/workflows/WorkflowArtifactStore.js +96 -0
- package/dist/src/workflows/WorkflowArtifactStore.test.js +80 -0
- package/dist/src/workflows/types.js +2 -0
- package/dist/src/workspace/WorkspaceRegistry.js +135 -0
- package/dist/src/workspace/WorkspaceRegistry.test.js +29 -0
- package/dist/src/workspace/types.js +2 -0
- package/package.json +80 -15
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./types"), exports);
|
|
18
|
+
__exportStar(require("./WorkspaceExportBundle"), exports);
|
|
@@ -57,8 +57,10 @@ describe('fixrisk issue verifier contract', () => {
|
|
|
57
57
|
expect(script).toContain("'FR-013'");
|
|
58
58
|
expect(script).toContain("'FR-014'");
|
|
59
59
|
expect(script).toContain("'FR-015'");
|
|
60
|
-
expect(script).toContain('actions/setup-java@
|
|
60
|
+
expect(script).toContain('actions/setup-java@v4');
|
|
61
61
|
expect(script).toContain('java-version');
|
|
62
|
+
expect(script).toContain('setup-node pins Node 24 baseline');
|
|
63
|
+
expect(script).toContain('no FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 transition override');
|
|
62
64
|
expect(script).toContain('verify-capacitor-evidence-freshness.js');
|
|
63
65
|
expect(script).toContain('NOTE_CONNECTION_REQUIRE_LARGE_GRAPH_EVIDENCE');
|
|
64
66
|
expect(script).toContain('NOTE_CONNECTION_MIN_EVIDENCE_NODE_COUNT');
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const fs = __importStar(require("fs"));
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
describe('foundation ann runtime verification contract', () => {
|
|
39
|
+
const repoRoot = path.resolve(__dirname, '..');
|
|
40
|
+
const packageJsonPath = path.join(repoRoot, 'package.json');
|
|
41
|
+
const scriptPath = path.join(repoRoot, 'scripts', 'verify-foundation-ann-runtime.js');
|
|
42
|
+
function readJson(filePath) {
|
|
43
|
+
const raw = fs.readFileSync(filePath, 'utf8');
|
|
44
|
+
return JSON.parse(raw);
|
|
45
|
+
}
|
|
46
|
+
test('keeps the host-level ann runtime verifier wired in package scripts', () => {
|
|
47
|
+
const packageJson = readJson(packageJsonPath);
|
|
48
|
+
expect(packageJson.scripts?.['verify:foundation:ann-runtime']).toBe('npm run build && node scripts/ensure-sidecar-ready.js && node scripts/verify-foundation-ann-runtime.js');
|
|
49
|
+
expect(packageJson.scripts?.['verify:foundation:ann-runtime:matrix']).toBe('npm run build && node scripts/ensure-sidecar-ready.js && node scripts/verify-foundation-ann-runtime.js --matrix');
|
|
50
|
+
expect(packageJson.scripts?.['verify:foundation:ann-runtime:release']).toBe('npm run build && node scripts/ensure-sidecar-ready.js && node scripts/verify-foundation-ann-runtime.js --matrix --release-gates');
|
|
51
|
+
});
|
|
52
|
+
test('verifier script covers smoke/medium/heavy ann profiles, report evidence, release gates, and restart continuity', () => {
|
|
53
|
+
const source = fs.readFileSync(scriptPath, 'utf8');
|
|
54
|
+
expect(source).toContain('WORKLOAD_PROFILES');
|
|
55
|
+
expect(source).toContain("profileId: 'medium'");
|
|
56
|
+
expect(source).toContain("profileId: 'heavy'");
|
|
57
|
+
expect(source).toContain("options.suiteKind = 'matrix'");
|
|
58
|
+
expect(source).toContain("arg === '--release-gates'");
|
|
59
|
+
expect(source).toContain('startReferenceAnnService');
|
|
60
|
+
expect(source).toContain('/sync-index');
|
|
61
|
+
expect(source).toContain('/select-candidates');
|
|
62
|
+
expect(source).toContain('dist_node_runtime');
|
|
63
|
+
expect(source).toContain('packaged_sidecar');
|
|
64
|
+
expect(source).toContain('/api/knowledge/ingest');
|
|
65
|
+
expect(source).toContain('/api/knowledge/query');
|
|
66
|
+
expect(source).toContain('/api/knowledge/query-backend-diagnostics');
|
|
67
|
+
expect(source).toContain("configuredBackend || '') === 'local_vector'");
|
|
68
|
+
expect(source).toContain("String(runtime.backendId || '') === 'local-vector-v1'");
|
|
69
|
+
expect(source).toContain("String(acceleration.mode || '') === 'ann_prefilter'");
|
|
70
|
+
expect(source).toContain("String(acceleration.adapterId || '') === 'external-http-vector-acceleration-v1'");
|
|
71
|
+
expect(source).toContain("String(acceleration.representationStatus || '') === 'aligned'");
|
|
72
|
+
expect(source).toContain('anchorkey');
|
|
73
|
+
expect(source).toContain('foundation-ann-runtime-report-latest.json');
|
|
74
|
+
expect(source).toContain('writeStructuredReport');
|
|
75
|
+
expect(source).toContain('collectScenarioPerformance');
|
|
76
|
+
expect(source).toContain('buildReleaseGateSummary');
|
|
77
|
+
expect(source).toContain('minExpectedRecall');
|
|
78
|
+
expect(source).toContain('maxQueryP95Ms');
|
|
79
|
+
expect(source).toContain('queryDurationMs');
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const fs = __importStar(require("fs"));
|
|
37
|
+
const os = __importStar(require("os"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
describe('foundation release evidence freshness contract', () => {
|
|
40
|
+
const repoRoot = path.resolve(__dirname, '..');
|
|
41
|
+
const packageJsonPath = path.join(repoRoot, 'package.json');
|
|
42
|
+
const scriptPath = path.join(repoRoot, 'scripts', 'verify-foundation-release-evidence.js');
|
|
43
|
+
const provenance = require('../scripts/foundation-evidence-provenance');
|
|
44
|
+
const fingerprints = require('../scripts/sidecar-build-fingerprint');
|
|
45
|
+
let fixtureIdentity;
|
|
46
|
+
function readJson(filePath) {
|
|
47
|
+
const raw = fs.readFileSync(filePath, 'utf8');
|
|
48
|
+
return JSON.parse(raw);
|
|
49
|
+
}
|
|
50
|
+
function createTempReportRoot() {
|
|
51
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), 'noteconnection-foundation-release-evidence-'));
|
|
52
|
+
fs.mkdirSync(path.join(root, 'dist', 'src'), { recursive: true });
|
|
53
|
+
fs.mkdirSync(path.join(root, 'src-tauri', 'bin'), { recursive: true });
|
|
54
|
+
fs.writeFileSync(path.join(root, 'dist', 'src', 'server.js'), 'fixture runtime');
|
|
55
|
+
const sidecar = path.join(root, 'src-tauri', 'bin', 'fixture-sidecar');
|
|
56
|
+
fs.writeFileSync(sidecar, 'fixture packaged runtime');
|
|
57
|
+
fixtureIdentity = { ...provenance.readFoundationRuntimeIdentity(root, sidecar), sourceTreeHash: fingerprints.computeSidecarSourceFingerprint(repoRoot).digest };
|
|
58
|
+
return root;
|
|
59
|
+
}
|
|
60
|
+
function writeJson(filePath, value) {
|
|
61
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
62
|
+
const report = structuredClone(value);
|
|
63
|
+
if (report.profileRuns) {
|
|
64
|
+
report.host = { nodeVersion: process.version, ...report.host };
|
|
65
|
+
report.provenance = {
|
|
66
|
+
schemaVersion: 1, runId: `${report.host.evidenceHostId}-${report.verifiedAt}`,
|
|
67
|
+
sourceRevision: 'a'.repeat(40), ...fixtureIdentity, workloadHash: provenance.foundationWorkloadHash(report),
|
|
68
|
+
};
|
|
69
|
+
for (const profile of report.profileRuns)
|
|
70
|
+
for (const mode of profile.modes) {
|
|
71
|
+
mode.runtime = { ...report.host };
|
|
72
|
+
if (mode.soak) {
|
|
73
|
+
const provided = new Map(mode.soak.gates.map((gate) => [gate.gateId, gate]));
|
|
74
|
+
mode.soak.gates = ['startup_p95', 'startup_max', 'ingest_p95', 'ingest_max', 'readiness_p95', 'diagnostics_p95', 'query_p95', 'query_max'].map(gateId => ({
|
|
75
|
+
observedMs: 100, maxAllowedMs: 2500, sampleCount: 8, passed: true, gateId, ...provided.get(gateId),
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
if (mode.releaseGates) {
|
|
79
|
+
const provided = new Map(mode.releaseGates.gates.map((gate) => [gate.gateId, gate]));
|
|
80
|
+
mode.releaseGates.gates = ['startup_p95', 'ingest_p95', 'diagnostics_p95', 'query_p95', 'query_max', 'expected_recall'].map(gateId => ({
|
|
81
|
+
observed: gateId === 'expected_recall' ? 1 : 100, required: gateId === 'expected_recall' ? 1 : 2500,
|
|
82
|
+
comparison: gateId === 'expected_recall' ? 'gte' : 'lte', sampleCount: 8, passed: true, gateId, ...provided.get(gateId),
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
fs.writeFileSync(filePath, `${JSON.stringify(report, null, 2)}\n`, 'utf8');
|
|
88
|
+
}
|
|
89
|
+
function buildPassingSqliteReport(verifiedAt, host = { platform: 'win32', arch: 'x64', evidenceHostId: 'windows-ci-a' }) {
|
|
90
|
+
return {
|
|
91
|
+
verifiedAt,
|
|
92
|
+
host,
|
|
93
|
+
suiteKind: 'soak',
|
|
94
|
+
soakCycles: 5,
|
|
95
|
+
profileRuns: [
|
|
96
|
+
{
|
|
97
|
+
workloadProfile: {
|
|
98
|
+
profileId: 'heavy',
|
|
99
|
+
documentCount: 180,
|
|
100
|
+
},
|
|
101
|
+
modes: [
|
|
102
|
+
{
|
|
103
|
+
mode: 'dist_node_runtime',
|
|
104
|
+
suiteKind: 'soak',
|
|
105
|
+
profileId: 'heavy',
|
|
106
|
+
restartCycleCount: 5,
|
|
107
|
+
performance: {
|
|
108
|
+
queryDurationMs: { count: 8, p95Ms: 120 },
|
|
109
|
+
},
|
|
110
|
+
soak: {
|
|
111
|
+
pass: true,
|
|
112
|
+
gates: [
|
|
113
|
+
{ gateId: 'startup_p95', passed: true },
|
|
114
|
+
{ gateId: 'query_p95', passed: true },
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
mode: 'packaged_sidecar',
|
|
120
|
+
suiteKind: 'soak',
|
|
121
|
+
profileId: 'heavy',
|
|
122
|
+
restartCycleCount: 5,
|
|
123
|
+
performance: {
|
|
124
|
+
queryDurationMs: { count: 8, p95Ms: 180 },
|
|
125
|
+
},
|
|
126
|
+
soak: {
|
|
127
|
+
pass: true,
|
|
128
|
+
gates: [
|
|
129
|
+
{ gateId: 'startup_p95', passed: true },
|
|
130
|
+
{ gateId: 'query_p95', passed: true },
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function buildPassingAnnReport(verifiedAt, host = { platform: 'win32', arch: 'x64', evidenceHostId: 'windows-ci-a' }) {
|
|
140
|
+
return {
|
|
141
|
+
verifiedAt,
|
|
142
|
+
host,
|
|
143
|
+
suiteKind: 'matrix',
|
|
144
|
+
releaseGatesEnabled: true,
|
|
145
|
+
releaseThresholds: {
|
|
146
|
+
minExpectedRecall: 1,
|
|
147
|
+
},
|
|
148
|
+
profileRuns: ['smoke', 'medium', 'heavy'].map((profileId) => ({
|
|
149
|
+
workloadProfile: {
|
|
150
|
+
profileId,
|
|
151
|
+
documentCount: profileId === 'heavy' ? 260 : profileId === 'medium' ? 140 : 40,
|
|
152
|
+
},
|
|
153
|
+
modes: ['dist_node_runtime', 'packaged_sidecar'].map((mode) => ({
|
|
154
|
+
mode,
|
|
155
|
+
profileId,
|
|
156
|
+
performance: {
|
|
157
|
+
queryDurationMs: { count: 8, p95Ms: 240 },
|
|
158
|
+
},
|
|
159
|
+
expectedRecall: {
|
|
160
|
+
expectedQueryCount: 6,
|
|
161
|
+
matchedQueryCount: 6,
|
|
162
|
+
ratio: 1,
|
|
163
|
+
},
|
|
164
|
+
releaseGates: {
|
|
165
|
+
pass: true,
|
|
166
|
+
expectedRecall: {
|
|
167
|
+
expectedQueryCount: 6,
|
|
168
|
+
matchedQueryCount: 6,
|
|
169
|
+
ratio: 1,
|
|
170
|
+
},
|
|
171
|
+
gates: [
|
|
172
|
+
{ gateId: 'startup_p95', passed: true },
|
|
173
|
+
{ gateId: 'query_p95', passed: true },
|
|
174
|
+
{ gateId: 'expected_recall', passed: true },
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
})),
|
|
178
|
+
})),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function buildNonReleaseAnnReport(verifiedAt) {
|
|
182
|
+
return {
|
|
183
|
+
verifiedAt,
|
|
184
|
+
suiteKind: 'single',
|
|
185
|
+
releaseGatesEnabled: false,
|
|
186
|
+
profileRuns: [
|
|
187
|
+
{
|
|
188
|
+
workloadProfile: {
|
|
189
|
+
profileId: 'smoke',
|
|
190
|
+
documentCount: 40,
|
|
191
|
+
},
|
|
192
|
+
modes: [],
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
test('keeps the release evidence verifier wired in package scripts and migration contracts', () => {
|
|
198
|
+
const packageJson = readJson(packageJsonPath);
|
|
199
|
+
expect(packageJson.scripts?.['verify:foundation:release-evidence']).toBe('node scripts/verify-foundation-release-evidence.js');
|
|
200
|
+
expect(packageJson.scripts?.['verify:foundation:release-evidence:strict']).toBe('node scripts/verify-foundation-release-evidence.js --min-report-count 3');
|
|
201
|
+
expect(packageJson.scripts?.['verify:foundation:release-evidence:multi-host']).toBe('node scripts/verify-foundation-release-evidence.js --min-report-count 3 --min-host-count 2');
|
|
202
|
+
expect(packageJson.scripts?.['test:migration']).toContain('src/foundation.release.evidence.contract.test.ts');
|
|
203
|
+
});
|
|
204
|
+
test('verifier script validates latest sqlite soak and ANN release-gate reports with bounded freshness', () => {
|
|
205
|
+
const source = fs.readFileSync(scriptPath, 'utf8');
|
|
206
|
+
expect(source).toContain('foundation-sqlite-runtime-report-latest.json');
|
|
207
|
+
expect(source).toContain('foundation-ann-runtime-report-latest.json');
|
|
208
|
+
expect(source).toContain('foundation-release-evidence-report-latest.json');
|
|
209
|
+
expect(source).toContain('NOTE_CONNECTION_FOUNDATION_RELEASE_EVIDENCE_MAX_AGE_HOURS');
|
|
210
|
+
expect(source).toContain('NOTE_CONNECTION_FOUNDATION_RELEASE_EVIDENCE_MIN_REPORT_COUNT');
|
|
211
|
+
expect(source).toContain('NOTE_CONNECTION_FOUNDATION_RELEASE_EVIDENCE_MIN_HOST_COUNT');
|
|
212
|
+
expect(source).toContain('--min-report-count');
|
|
213
|
+
expect(source).toContain('--min-host-count');
|
|
214
|
+
expect(source).toContain('foundation-sqlite-runtime-report-');
|
|
215
|
+
expect(source).toContain('foundation-ann-runtime-report-');
|
|
216
|
+
expect(source).toContain('verify:foundation:sqlite-runtime:release');
|
|
217
|
+
expect(source).toContain('verify:foundation:ann-runtime:release');
|
|
218
|
+
expect(source).toContain("suiteKind === 'soak'");
|
|
219
|
+
expect(source).toContain("suiteKind === 'matrix'");
|
|
220
|
+
expect(source).toContain('releaseGatesEnabled');
|
|
221
|
+
expect(source).toContain('expectedRecall');
|
|
222
|
+
expect(source).toContain('minimumReportCount');
|
|
223
|
+
expect(source).toContain('minimumHostCount');
|
|
224
|
+
expect(source).toContain('dist_node_runtime');
|
|
225
|
+
expect(source).toContain('packaged_sidecar');
|
|
226
|
+
});
|
|
227
|
+
test('bounded integer parsing uses defaults for missing environment values', () => {
|
|
228
|
+
const verifier = require(scriptPath);
|
|
229
|
+
expect(verifier.parseBoundedInteger('', { min: 1, max: 10, default: 7 })).toBe(7);
|
|
230
|
+
expect(verifier.parseBoundedInteger(undefined, { min: 1, max: 10, default: 7 })).toBe(7);
|
|
231
|
+
});
|
|
232
|
+
test('accepts fresh passing sqlite soak and ANN release-gate reports', () => {
|
|
233
|
+
const verifier = require(scriptPath);
|
|
234
|
+
const tempRoot = createTempReportRoot();
|
|
235
|
+
const sqliteReportPath = path.join(tempRoot, 'foundation-sqlite-runtime-report-latest.json');
|
|
236
|
+
const annReportPath = path.join(tempRoot, 'foundation-ann-runtime-report-latest.json');
|
|
237
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
238
|
+
try {
|
|
239
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00.000Z'));
|
|
240
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z'));
|
|
241
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
242
|
+
sqliteReportPath,
|
|
243
|
+
annReportPath,
|
|
244
|
+
now,
|
|
245
|
+
maxAgeHours: 24,
|
|
246
|
+
});
|
|
247
|
+
expect(result.ok).toBe(true);
|
|
248
|
+
expect(result.errors).toEqual([]);
|
|
249
|
+
expect(result.summary.sqlite).toMatchObject({
|
|
250
|
+
suiteKind: 'soak',
|
|
251
|
+
requiredProfiles: ['heavy'],
|
|
252
|
+
});
|
|
253
|
+
expect(result.summary.ann).toMatchObject({
|
|
254
|
+
suiteKind: 'matrix',
|
|
255
|
+
requiredProfiles: ['smoke', 'medium', 'heavy'],
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
finally {
|
|
259
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
test('rejects stale release evidence even when runtime gates passed', () => {
|
|
263
|
+
const verifier = require(scriptPath);
|
|
264
|
+
const tempRoot = createTempReportRoot();
|
|
265
|
+
const sqliteReportPath = path.join(tempRoot, 'foundation-sqlite-runtime-report-latest.json');
|
|
266
|
+
const annReportPath = path.join(tempRoot, 'foundation-ann-runtime-report-latest.json');
|
|
267
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
268
|
+
try {
|
|
269
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-01T00:00:00.000Z'));
|
|
270
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z'));
|
|
271
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
272
|
+
sqliteReportPath,
|
|
273
|
+
annReportPath,
|
|
274
|
+
now,
|
|
275
|
+
maxAgeHours: 24,
|
|
276
|
+
});
|
|
277
|
+
expect(result.ok).toBe(false);
|
|
278
|
+
expect(result.errors.join('\n')).toContain('sqlite release evidence is stale');
|
|
279
|
+
}
|
|
280
|
+
finally {
|
|
281
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
test('a later matrix run does not hide a fresh dated SQLite soak', () => {
|
|
285
|
+
const verifier = require(scriptPath);
|
|
286
|
+
const tempRoot = createTempReportRoot();
|
|
287
|
+
const sqliteReportPath = path.join(tempRoot, 'foundation-sqlite-runtime-report-latest.json');
|
|
288
|
+
const annReportPath = path.join(tempRoot, 'foundation-ann-runtime-report-latest.json');
|
|
289
|
+
try {
|
|
290
|
+
writeJson(sqliteReportPath, { ...buildPassingSqliteReport('2026-06-05T23:30:00.000Z'), suiteKind: 'matrix' });
|
|
291
|
+
writeJson(path.join(tempRoot, 'foundation-sqlite-runtime-report-2026-06-05T23-00-00.json'), buildPassingSqliteReport('2026-06-05T23:00:00.000Z'));
|
|
292
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T23:00:00.000Z'));
|
|
293
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot, sqliteReportPath, annReportPath, now: new Date('2026-06-06T00:00:00Z') });
|
|
294
|
+
expect(result.ok).toBe(true);
|
|
295
|
+
expect(result.summary.sqlite.reportPath).toContain('2026-06-05T23-00-00');
|
|
296
|
+
}
|
|
297
|
+
finally {
|
|
298
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
test('latest and dated copies of one run do not count as repeated evidence', () => {
|
|
302
|
+
const verifier = require(scriptPath);
|
|
303
|
+
const tempRoot = createTempReportRoot();
|
|
304
|
+
const sqliteReportPath = path.join(tempRoot, 'foundation-sqlite-runtime-report-latest.json');
|
|
305
|
+
const annReportPath = path.join(tempRoot, 'foundation-ann-runtime-report-latest.json');
|
|
306
|
+
try {
|
|
307
|
+
const sqlite = buildPassingSqliteReport('2026-06-05T23:00:00.000Z');
|
|
308
|
+
const ann = buildPassingAnnReport('2026-06-05T23:00:00.000Z');
|
|
309
|
+
writeJson(sqliteReportPath, sqlite);
|
|
310
|
+
writeJson(annReportPath, ann);
|
|
311
|
+
writeJson(path.join(tempRoot, 'foundation-sqlite-runtime-report-copy.json'), sqlite);
|
|
312
|
+
writeJson(path.join(tempRoot, 'foundation-ann-runtime-report-copy.json'), ann);
|
|
313
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot, sqliteReportPath, annReportPath, minReportCount: 2, now: new Date('2026-06-06T00:00:00Z') });
|
|
314
|
+
expect(result.ok).toBe(false);
|
|
315
|
+
expect(result.summary.sqlite.reportCount).toBe(1);
|
|
316
|
+
expect(result.summary.ann.reportCount).toBe(1);
|
|
317
|
+
}
|
|
318
|
+
finally {
|
|
319
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
test.each([
|
|
323
|
+
['missing provenance', (report) => { delete report.provenance; }],
|
|
324
|
+
['wrong source', (report) => { report.provenance.sourceTreeHash = 'f'.repeat(64); }],
|
|
325
|
+
['wrong artifact', (report) => { report.provenance.artifacts.packaged_sidecar.sha256 = 'f'.repeat(64); }],
|
|
326
|
+
['changed workload', (report) => { report.profileRuns[0].workloadProfile.documentCount++; }],
|
|
327
|
+
['unsupported runtime', (report) => { report.profileRuns[0].modes[0].runtime.nodeVersion = 'v20.19.0'; }],
|
|
328
|
+
['future report', (report) => { report.verifiedAt = '2026-06-07T00:00:00Z'; }],
|
|
329
|
+
['missing gate', (report) => { report.profileRuns[0].modes[0].soak.gates.pop(); }],
|
|
330
|
+
['unsubstantiated pass', (report) => { report.profileRuns[0].modes[0].soak.gates[0].observedMs = 999999; }],
|
|
331
|
+
])('rejects %s even if the report declares passing gates', (_name, mutate) => {
|
|
332
|
+
const verifier = require(scriptPath);
|
|
333
|
+
const tempRoot = createTempReportRoot();
|
|
334
|
+
const sqliteReportPath = path.join(tempRoot, 'foundation-sqlite-runtime-report-latest.json');
|
|
335
|
+
const annReportPath = path.join(tempRoot, 'foundation-ann-runtime-report-latest.json');
|
|
336
|
+
try {
|
|
337
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00Z'));
|
|
338
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T23:00:00Z'));
|
|
339
|
+
const report = readJson(sqliteReportPath);
|
|
340
|
+
mutate(report);
|
|
341
|
+
fs.writeFileSync(sqliteReportPath, JSON.stringify(report));
|
|
342
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot, sqliteReportPath, annReportPath, now: new Date('2026-06-06T00:00:00Z') });
|
|
343
|
+
expect(result.ok).toBe(false);
|
|
344
|
+
expect(result.errors.length).toBeGreaterThan(0);
|
|
345
|
+
}
|
|
346
|
+
finally {
|
|
347
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
test('an eligible recent failure is not masked by an older passing soak', () => {
|
|
351
|
+
const verifier = require(scriptPath);
|
|
352
|
+
const tempRoot = createTempReportRoot();
|
|
353
|
+
const sqliteReportPath = path.join(tempRoot, 'foundation-sqlite-runtime-report-latest.json');
|
|
354
|
+
const annReportPath = path.join(tempRoot, 'foundation-ann-runtime-report-latest.json');
|
|
355
|
+
try {
|
|
356
|
+
const failed = buildPassingSqliteReport('2026-06-05T23:30:00.000Z');
|
|
357
|
+
failed.profileRuns[0].modes[0].soak.pass = false;
|
|
358
|
+
writeJson(sqliteReportPath, failed);
|
|
359
|
+
writeJson(path.join(tempRoot, 'foundation-sqlite-runtime-report-earlier.json'), buildPassingSqliteReport('2026-06-05T23:00:00.000Z'));
|
|
360
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T23:00:00.000Z'));
|
|
361
|
+
expect(verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot, sqliteReportPath, annReportPath, now: new Date('2026-06-06T00:00:00Z') }).ok).toBe(false);
|
|
362
|
+
}
|
|
363
|
+
finally {
|
|
364
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
test('accepts repeated sqlite and ANN release evidence when enough fresh history reports exist', () => {
|
|
368
|
+
const verifier = require(scriptPath);
|
|
369
|
+
const tempRoot = createTempReportRoot();
|
|
370
|
+
const sqliteReportPath = path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-latest.json');
|
|
371
|
+
const annReportPath = path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-latest.json');
|
|
372
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
373
|
+
try {
|
|
374
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00.000Z'));
|
|
375
|
+
writeJson(path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-2026-06-05T22-30-00-000Z.json'), buildPassingSqliteReport('2026-06-05T22:30:00.000Z'));
|
|
376
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z'));
|
|
377
|
+
writeJson(path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-2026-06-05T21-30-00-000Z.json'), buildPassingAnnReport('2026-06-05T21:30:00.000Z'));
|
|
378
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
379
|
+
sqliteReportPath,
|
|
380
|
+
annReportPath,
|
|
381
|
+
now,
|
|
382
|
+
maxAgeHours: 24,
|
|
383
|
+
minReportCount: 2,
|
|
384
|
+
});
|
|
385
|
+
expect(result.ok).toBe(true);
|
|
386
|
+
expect(result.errors).toEqual([]);
|
|
387
|
+
expect(result.summary.sqlite).toMatchObject({
|
|
388
|
+
minimumReportCount: 2,
|
|
389
|
+
reportCount: 2,
|
|
390
|
+
});
|
|
391
|
+
expect(result.summary.ann).toMatchObject({
|
|
392
|
+
minimumReportCount: 2,
|
|
393
|
+
reportCount: 2,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
finally {
|
|
397
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
test('accepts multi-host release evidence when enough fresh reports cover distinct hosts', () => {
|
|
401
|
+
const verifier = require(scriptPath);
|
|
402
|
+
const tempRoot = createTempReportRoot();
|
|
403
|
+
const sqliteReportPath = path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-latest.json');
|
|
404
|
+
const annReportPath = path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-latest.json');
|
|
405
|
+
const windowsHost = { platform: 'win32', arch: 'x64', evidenceHostId: 'windows-ci-a' };
|
|
406
|
+
const linuxHost = { platform: 'linux', arch: 'x64', evidenceHostId: 'linux-ci-b' };
|
|
407
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
408
|
+
try {
|
|
409
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00.000Z', windowsHost));
|
|
410
|
+
writeJson(path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-2026-06-05T22-30-00-000Z.json'), buildPassingSqliteReport('2026-06-05T22:30:00.000Z', linuxHost));
|
|
411
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z', windowsHost));
|
|
412
|
+
writeJson(path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-2026-06-05T21-30-00-000Z.json'), buildPassingAnnReport('2026-06-05T21:30:00.000Z', linuxHost));
|
|
413
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
414
|
+
sqliteReportPath,
|
|
415
|
+
annReportPath,
|
|
416
|
+
now,
|
|
417
|
+
maxAgeHours: 24,
|
|
418
|
+
minReportCount: 2,
|
|
419
|
+
minHostCount: 2,
|
|
420
|
+
});
|
|
421
|
+
expect(result.ok).toBe(true);
|
|
422
|
+
expect(result.errors).toEqual([]);
|
|
423
|
+
expect(result.summary.sqlite).toMatchObject({
|
|
424
|
+
minimumReportCount: 2,
|
|
425
|
+
reportCount: 2,
|
|
426
|
+
minimumHostCount: 2,
|
|
427
|
+
hostCount: 2,
|
|
428
|
+
});
|
|
429
|
+
expect(result.summary.ann).toMatchObject({
|
|
430
|
+
minimumReportCount: 2,
|
|
431
|
+
reportCount: 2,
|
|
432
|
+
minimumHostCount: 2,
|
|
433
|
+
hostCount: 2,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
finally {
|
|
437
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
test('rejects multi-host release evidence when repeated reports come from one host', () => {
|
|
441
|
+
const verifier = require(scriptPath);
|
|
442
|
+
const tempRoot = createTempReportRoot();
|
|
443
|
+
const sqliteReportPath = path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-latest.json');
|
|
444
|
+
const annReportPath = path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-latest.json');
|
|
445
|
+
const windowsHost = { platform: 'win32', arch: 'x64', evidenceHostId: 'windows-ci-a' };
|
|
446
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
447
|
+
try {
|
|
448
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00.000Z', windowsHost));
|
|
449
|
+
writeJson(path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-2026-06-05T22-30-00-000Z.json'), buildPassingSqliteReport('2026-06-05T22:30:00.000Z', windowsHost));
|
|
450
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z', windowsHost));
|
|
451
|
+
writeJson(path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-2026-06-05T21-30-00-000Z.json'), buildPassingAnnReport('2026-06-05T21:30:00.000Z', windowsHost));
|
|
452
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
453
|
+
sqliteReportPath,
|
|
454
|
+
annReportPath,
|
|
455
|
+
now,
|
|
456
|
+
maxAgeHours: 24,
|
|
457
|
+
minReportCount: 2,
|
|
458
|
+
minHostCount: 2,
|
|
459
|
+
});
|
|
460
|
+
expect(result.ok).toBe(false);
|
|
461
|
+
expect(result.errors.join('\n')).toContain('sqlite release evidence history covers 1 host(s), expected at least 2');
|
|
462
|
+
expect(result.errors.join('\n')).toContain('ann release evidence history covers 1 host(s), expected at least 2');
|
|
463
|
+
}
|
|
464
|
+
finally {
|
|
465
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
test('rejects strict repeated evidence when only latest reports exist', () => {
|
|
469
|
+
const verifier = require(scriptPath);
|
|
470
|
+
const tempRoot = createTempReportRoot();
|
|
471
|
+
const sqliteReportPath = path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-latest.json');
|
|
472
|
+
const annReportPath = path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-latest.json');
|
|
473
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
474
|
+
try {
|
|
475
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00.000Z'));
|
|
476
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z'));
|
|
477
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
478
|
+
sqliteReportPath,
|
|
479
|
+
annReportPath,
|
|
480
|
+
now,
|
|
481
|
+
maxAgeHours: 24,
|
|
482
|
+
minReportCount: 2,
|
|
483
|
+
});
|
|
484
|
+
expect(result.ok).toBe(false);
|
|
485
|
+
expect(result.errors.join('\n')).toContain('sqlite release evidence history has 1 report(s), expected at least 2');
|
|
486
|
+
expect(result.errors.join('\n')).toContain('ann release evidence history has 1 report(s), expected at least 2');
|
|
487
|
+
}
|
|
488
|
+
finally {
|
|
489
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
test('does not fail default freshness verification because older non-release history reports exist', () => {
|
|
493
|
+
const verifier = require(scriptPath);
|
|
494
|
+
const tempRoot = createTempReportRoot();
|
|
495
|
+
const sqliteReportPath = path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-latest.json');
|
|
496
|
+
const annReportPath = path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-latest.json');
|
|
497
|
+
const now = new Date('2026-06-06T00:00:00.000Z');
|
|
498
|
+
try {
|
|
499
|
+
writeJson(sqliteReportPath, buildPassingSqliteReport('2026-06-05T23:00:00.000Z'));
|
|
500
|
+
writeJson(path.join(tempRoot, 'sqlite', 'foundation-sqlite-runtime-report-2026-05-30T00-00-00-000Z.json'), buildPassingSqliteReport('2026-05-30T00:00:00.000Z'));
|
|
501
|
+
writeJson(annReportPath, buildPassingAnnReport('2026-06-05T22:00:00.000Z'));
|
|
502
|
+
writeJson(path.join(tempRoot, 'ann', 'foundation-ann-runtime-report-2026-06-05T21-00-00-000Z.json'), buildNonReleaseAnnReport('2026-06-05T21:00:00.000Z'));
|
|
503
|
+
const result = verifier.verifyFoundationReleaseEvidence({ artifactRoot: tempRoot,
|
|
504
|
+
sqliteReportPath,
|
|
505
|
+
annReportPath,
|
|
506
|
+
now,
|
|
507
|
+
maxAgeHours: 24,
|
|
508
|
+
});
|
|
509
|
+
expect(result.ok).toBe(true);
|
|
510
|
+
expect(result.summary.sqlite).toMatchObject({
|
|
511
|
+
minimumReportCount: 1,
|
|
512
|
+
reportCount: 1,
|
|
513
|
+
});
|
|
514
|
+
expect(result.summary.ann).toMatchObject({
|
|
515
|
+
minimumReportCount: 1,
|
|
516
|
+
reportCount: 1,
|
|
517
|
+
});
|
|
518
|
+
expect(result.warnings.join('\n')).toContain('ann release evidence history report ignored');
|
|
519
|
+
}
|
|
520
|
+
finally {
|
|
521
|
+
fs.rmSync(tempRoot, { recursive: true, force: true });
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
});
|