@legioncodeinc/nectar 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +662 -0
- package/README.md +307 -0
- package/dist/api/daemon-api-wiring.d.ts +72 -0
- package/dist/api/daemon-api-wiring.d.ts.map +1 -0
- package/dist/api/daemon-api-wiring.js +150 -0
- package/dist/api/daemon-api-wiring.js.map +1 -0
- package/dist/api/hive-graph-api.d.ts +136 -0
- package/dist/api/hive-graph-api.d.ts.map +1 -0
- package/dist/api/hive-graph-api.js +234 -0
- package/dist/api/hive-graph-api.js.map +1 -0
- package/dist/api/loopback-client.d.ts +27 -0
- package/dist/api/loopback-client.d.ts.map +1 -0
- package/dist/api/loopback-client.js +87 -0
- package/dist/api/loopback-client.js.map +1 -0
- package/dist/api/router.d.ts +172 -0
- package/dist/api/router.d.ts.map +1 -0
- package/dist/api/router.js +212 -0
- package/dist/api/router.js.map +1 -0
- package/dist/api/status-query.d.ts +49 -0
- package/dist/api/status-query.d.ts.map +1 -0
- package/dist/api/status-query.js +103 -0
- package/dist/api/status-query.js.map +1 -0
- package/dist/brood-guard.d.ts +24 -0
- package/dist/brood-guard.d.ts.map +1 -0
- package/dist/brood-guard.js +19 -0
- package/dist/brood-guard.js.map +1 -0
- package/dist/brood-prereqs.d.ts +62 -0
- package/dist/brood-prereqs.d.ts.map +1 -0
- package/dist/brood-prereqs.js +87 -0
- package/dist/brood-prereqs.js.map +1 -0
- package/dist/brooding/bucketing.d.ts +68 -0
- package/dist/brooding/bucketing.d.ts.map +1 -0
- package/dist/brooding/bucketing.js +122 -0
- package/dist/brooding/bucketing.js.map +1 -0
- package/dist/brooding/cli.d.ts +78 -0
- package/dist/brooding/cli.d.ts.map +1 -0
- package/dist/brooding/cli.js +140 -0
- package/dist/brooding/cli.js.map +1 -0
- package/dist/brooding/constants.d.ts +75 -0
- package/dist/brooding/constants.d.ts.map +1 -0
- package/dist/brooding/constants.js +91 -0
- package/dist/brooding/constants.js.map +1 -0
- package/dist/brooding/cost.d.ts +110 -0
- package/dist/brooding/cost.d.ts.map +1 -0
- package/dist/brooding/cost.js +96 -0
- package/dist/brooding/cost.js.map +1 -0
- package/dist/brooding/describe.d.ts +152 -0
- package/dist/brooding/describe.d.ts.map +1 -0
- package/dist/brooding/describe.js +281 -0
- package/dist/brooding/describe.js.map +1 -0
- package/dist/brooding/discovery.d.ts +116 -0
- package/dist/brooding/discovery.d.ts.map +1 -0
- package/dist/brooding/discovery.js +179 -0
- package/dist/brooding/discovery.js.map +1 -0
- package/dist/brooding/index.d.ts +23 -0
- package/dist/brooding/index.d.ts.map +1 -0
- package/dist/brooding/index.js +33 -0
- package/dist/brooding/index.js.map +1 -0
- package/dist/brooding/pipeline-async.d.ts +97 -0
- package/dist/brooding/pipeline-async.d.ts.map +1 -0
- package/dist/brooding/pipeline-async.js +364 -0
- package/dist/brooding/pipeline-async.js.map +1 -0
- package/dist/brooding/pipeline.d.ts +198 -0
- package/dist/brooding/pipeline.d.ts.map +1 -0
- package/dist/brooding/pipeline.js +454 -0
- package/dist/brooding/pipeline.js.map +1 -0
- package/dist/brooding/precheck.d.ts +52 -0
- package/dist/brooding/precheck.d.ts.map +1 -0
- package/dist/brooding/precheck.js +143 -0
- package/dist/brooding/precheck.js.map +1 -0
- package/dist/brooding/resumability.d.ts +57 -0
- package/dist/brooding/resumability.d.ts.map +1 -0
- package/dist/brooding/resumability.js +46 -0
- package/dist/brooding/resumability.js.map +1 -0
- package/dist/cli.d.ts +139 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +912 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-file.d.ts +52 -0
- package/dist/config-file.d.ts.map +1 -0
- package/dist/config-file.js +130 -0
- package/dist/config-file.js.map +1 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +98 -0
- package/dist/config.js.map +1 -0
- package/dist/daemon.d.ts +265 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +664 -0
- package/dist/daemon.js.map +1 -0
- package/dist/doctor-registry.d.ts +134 -0
- package/dist/doctor-registry.d.ts.map +1 -0
- package/dist/doctor-registry.js +173 -0
- package/dist/doctor-registry.js.map +1 -0
- package/dist/embeddings/cohere-portkey.d.ts +67 -0
- package/dist/embeddings/cohere-portkey.d.ts.map +1 -0
- package/dist/embeddings/cohere-portkey.js +171 -0
- package/dist/embeddings/cohere-portkey.js.map +1 -0
- package/dist/embeddings/config.d.ts +74 -0
- package/dist/embeddings/config.d.ts.map +1 -0
- package/dist/embeddings/config.js +131 -0
- package/dist/embeddings/config.js.map +1 -0
- package/dist/embeddings/guard.d.ts +34 -0
- package/dist/embeddings/guard.d.ts.map +1 -0
- package/dist/embeddings/guard.js +67 -0
- package/dist/embeddings/guard.js.map +1 -0
- package/dist/embeddings/hosted-portkey.d.ts +73 -0
- package/dist/embeddings/hosted-portkey.d.ts.map +1 -0
- package/dist/embeddings/hosted-portkey.js +179 -0
- package/dist/embeddings/hosted-portkey.js.map +1 -0
- package/dist/embeddings/http.d.ts +33 -0
- package/dist/embeddings/http.d.ts.map +1 -0
- package/dist/embeddings/http.js +19 -0
- package/dist/embeddings/http.js.map +1 -0
- package/dist/embeddings/index.d.ts +17 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +17 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/embeddings/local-nomic.d.ts +78 -0
- package/dist/embeddings/local-nomic.d.ts.map +1 -0
- package/dist/embeddings/local-nomic.js +126 -0
- package/dist/embeddings/local-nomic.js.map +1 -0
- package/dist/embeddings/provider.d.ts +79 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +50 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/enricher/config.d.ts +43 -0
- package/dist/enricher/config.d.ts.map +1 -0
- package/dist/enricher/config.js +34 -0
- package/dist/enricher/config.js.map +1 -0
- package/dist/enricher/content-cache.d.ts +29 -0
- package/dist/enricher/content-cache.d.ts.map +1 -0
- package/dist/enricher/content-cache.js +24 -0
- package/dist/enricher/content-cache.js.map +1 -0
- package/dist/enricher/cycle.d.ts +71 -0
- package/dist/enricher/cycle.d.ts.map +1 -0
- package/dist/enricher/cycle.js +319 -0
- package/dist/enricher/cycle.js.map +1 -0
- package/dist/enricher/describe.d.ts +61 -0
- package/dist/enricher/describe.d.ts.map +1 -0
- package/dist/enricher/describe.js +175 -0
- package/dist/enricher/describe.js.map +1 -0
- package/dist/enricher/failure.d.ts +25 -0
- package/dist/enricher/failure.d.ts.map +1 -0
- package/dist/enricher/failure.js +46 -0
- package/dist/enricher/failure.js.map +1 -0
- package/dist/enricher/index.d.ts +22 -0
- package/dist/enricher/index.d.ts.map +1 -0
- package/dist/enricher/index.js +22 -0
- package/dist/enricher/index.js.map +1 -0
- package/dist/enricher/jaccard.d.ts +11 -0
- package/dist/enricher/jaccard.d.ts.map +1 -0
- package/dist/enricher/jaccard.js +29 -0
- package/dist/enricher/jaccard.js.map +1 -0
- package/dist/enricher/loop.d.ts +22 -0
- package/dist/enricher/loop.d.ts.map +1 -0
- package/dist/enricher/loop.js +34 -0
- package/dist/enricher/loop.js.map +1 -0
- package/dist/enricher/meaningful-change.d.ts +28 -0
- package/dist/enricher/meaningful-change.d.ts.map +1 -0
- package/dist/enricher/meaningful-change.js +41 -0
- package/dist/enricher/meaningful-change.js.map +1 -0
- package/dist/enricher/observability.d.ts +22 -0
- package/dist/enricher/observability.d.ts.map +1 -0
- package/dist/enricher/observability.js +55 -0
- package/dist/enricher/observability.js.map +1 -0
- package/dist/enricher/pending-query.d.ts +35 -0
- package/dist/enricher/pending-query.d.ts.map +1 -0
- package/dist/enricher/pending-query.js +54 -0
- package/dist/enricher/pending-query.js.map +1 -0
- package/dist/enricher/sql-update.d.ts +7 -0
- package/dist/enricher/sql-update.d.ts.map +1 -0
- package/dist/enricher/sql-update.js +22 -0
- package/dist/enricher/sql-update.js.map +1 -0
- package/dist/enricher/store-adapter.d.ts +98 -0
- package/dist/enricher/store-adapter.d.ts.map +1 -0
- package/dist/enricher/store-adapter.js +129 -0
- package/dist/enricher/store-adapter.js.map +1 -0
- package/dist/enricher/store.d.ts +58 -0
- package/dist/enricher/store.d.ts.map +1 -0
- package/dist/enricher/store.js +126 -0
- package/dist/enricher/store.js.map +1 -0
- package/dist/enricher/tokenize.d.ts +10 -0
- package/dist/enricher/tokenize.d.ts.map +1 -0
- package/dist/enricher/tokenize.js +28 -0
- package/dist/enricher/tokenize.js.map +1 -0
- package/dist/errors.d.ts +41 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +56 -0
- package/dist/errors.js.map +1 -0
- package/dist/health.d.ts +147 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +168 -0
- package/dist/health.js.map +1 -0
- package/dist/hive-graph/deeplake-credentials.d.ts +68 -0
- package/dist/hive-graph/deeplake-credentials.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-credentials.js +135 -0
- package/dist/hive-graph/deeplake-credentials.js.map +1 -0
- package/dist/hive-graph/deeplake-heal.d.ts +63 -0
- package/dist/hive-graph/deeplake-heal.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-heal.js +118 -0
- package/dist/hive-graph/deeplake-heal.js.map +1 -0
- package/dist/hive-graph/deeplake-store.d.ts +199 -0
- package/dist/hive-graph/deeplake-store.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-store.js +541 -0
- package/dist/hive-graph/deeplake-store.js.map +1 -0
- package/dist/hive-graph/deeplake-transport.d.ts +89 -0
- package/dist/hive-graph/deeplake-transport.d.ts.map +1 -0
- package/dist/hive-graph/deeplake-transport.js +145 -0
- package/dist/hive-graph/deeplake-transport.js.map +1 -0
- package/dist/hive-graph/hash.d.ts +3 -0
- package/dist/hive-graph/hash.d.ts.map +1 -0
- package/dist/hive-graph/hash.js +12 -0
- package/dist/hive-graph/hash.js.map +1 -0
- package/dist/hive-graph/memory-store.d.ts +39 -0
- package/dist/hive-graph/memory-store.d.ts.map +1 -0
- package/dist/hive-graph/memory-store.js +125 -0
- package/dist/hive-graph/memory-store.js.map +1 -0
- package/dist/hive-graph/model.d.ts +109 -0
- package/dist/hive-graph/model.d.ts.map +1 -0
- package/dist/hive-graph/model.js +36 -0
- package/dist/hive-graph/model.js.map +1 -0
- package/dist/hive-graph/paths.d.ts +7 -0
- package/dist/hive-graph/paths.d.ts.map +1 -0
- package/dist/hive-graph/paths.js +26 -0
- package/dist/hive-graph/paths.js.map +1 -0
- package/dist/hive-graph/project-scope.d.ts +99 -0
- package/dist/hive-graph/project-scope.d.ts.map +1 -0
- package/dist/hive-graph/project-scope.js +286 -0
- package/dist/hive-graph/project-scope.js.map +1 -0
- package/dist/hive-graph/schema.d.ts +53 -0
- package/dist/hive-graph/schema.d.ts.map +1 -0
- package/dist/hive-graph/schema.js +139 -0
- package/dist/hive-graph/schema.js.map +1 -0
- package/dist/hive-graph/search-types.d.ts +82 -0
- package/dist/hive-graph/search-types.d.ts.map +1 -0
- package/dist/hive-graph/search-types.js +2 -0
- package/dist/hive-graph/search-types.js.map +1 -0
- package/dist/hive-graph/search.d.ts +51 -0
- package/dist/hive-graph/search.d.ts.map +1 -0
- package/dist/hive-graph/search.js +417 -0
- package/dist/hive-graph/search.js.map +1 -0
- package/dist/hive-graph/sql-guards.d.ts +99 -0
- package/dist/hive-graph/sql-guards.d.ts.map +1 -0
- package/dist/hive-graph/sql-guards.js +129 -0
- package/dist/hive-graph/sql-guards.js.map +1 -0
- package/dist/hive-graph/store.d.ts +151 -0
- package/dist/hive-graph/store.d.ts.map +1 -0
- package/dist/hive-graph/store.js +2 -0
- package/dist/hive-graph/store.js.map +1 -0
- package/dist/hive-graph/ulid.d.ts +14 -0
- package/dist/hive-graph/ulid.d.ts.map +1 -0
- package/dist/hive-graph/ulid.js +109 -0
- package/dist/hive-graph/ulid.js.map +1 -0
- package/dist/hivedoctor-registry.d.ts +111 -0
- package/dist/hivedoctor-registry.d.ts.map +1 -0
- package/dist/hivedoctor-registry.js +143 -0
- package/dist/hivedoctor-registry.js.map +1 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +78 -0
- package/dist/index.js.map +1 -0
- package/dist/lock.d.ts +66 -0
- package/dist/lock.d.ts.map +1 -0
- package/dist/lock.js +282 -0
- package/dist/lock.js.map +1 -0
- package/dist/poll-loop.d.ts +71 -0
- package/dist/poll-loop.d.ts.map +1 -0
- package/dist/poll-loop.js +130 -0
- package/dist/poll-loop.js.map +1 -0
- package/dist/portkey/config.d.ts +46 -0
- package/dist/portkey/config.d.ts.map +1 -0
- package/dist/portkey/config.js +68 -0
- package/dist/portkey/config.js.map +1 -0
- package/dist/portkey/describe-model.d.ts +53 -0
- package/dist/portkey/describe-model.d.ts.map +1 -0
- package/dist/portkey/describe-model.js +56 -0
- package/dist/portkey/describe-model.js.map +1 -0
- package/dist/portkey/headers.d.ts +31 -0
- package/dist/portkey/headers.d.ts.map +1 -0
- package/dist/portkey/headers.js +37 -0
- package/dist/portkey/headers.js.map +1 -0
- package/dist/portkey/transport.d.ts +89 -0
- package/dist/portkey/transport.d.ts.map +1 -0
- package/dist/portkey/transport.js +167 -0
- package/dist/portkey/transport.js.map +1 -0
- package/dist/projection/format.d.ts +51 -0
- package/dist/projection/format.d.ts.map +1 -0
- package/dist/projection/format.js +81 -0
- package/dist/projection/format.js.map +1 -0
- package/dist/projection/generate.d.ts +31 -0
- package/dist/projection/generate.d.ts.map +1 -0
- package/dist/projection/generate.js +83 -0
- package/dist/projection/generate.js.map +1 -0
- package/dist/projection/inherit.d.ts +27 -0
- package/dist/projection/inherit.d.ts.map +1 -0
- package/dist/projection/inherit.js +128 -0
- package/dist/projection/inherit.js.map +1 -0
- package/dist/projection/load.d.ts +47 -0
- package/dist/projection/load.d.ts.map +1 -0
- package/dist/projection/load.js +258 -0
- package/dist/projection/load.js.map +1 -0
- package/dist/projection/store-adapter.d.ts +42 -0
- package/dist/projection/store-adapter.d.ts.map +1 -0
- package/dist/projection/store-adapter.js +42 -0
- package/dist/projection/store-adapter.js.map +1 -0
- package/dist/projection/write.d.ts +79 -0
- package/dist/projection/write.d.ts.map +1 -0
- package/dist/projection/write.js +122 -0
- package/dist/projection/write.js.map +1 -0
- package/dist/registration/classify.d.ts +33 -0
- package/dist/registration/classify.d.ts.map +1 -0
- package/dist/registration/classify.js +32 -0
- package/dist/registration/classify.js.map +1 -0
- package/dist/registration/copy-detect.d.ts +22 -0
- package/dist/registration/copy-detect.d.ts.map +1 -0
- package/dist/registration/copy-detect.js +12 -0
- package/dist/registration/copy-detect.js.map +1 -0
- package/dist/registration/disk-fs.d.ts +41 -0
- package/dist/registration/disk-fs.d.ts.map +1 -0
- package/dist/registration/disk-fs.js +175 -0
- package/dist/registration/disk-fs.js.map +1 -0
- package/dist/registration/fs-watch.d.ts +114 -0
- package/dist/registration/fs-watch.d.ts.map +1 -0
- package/dist/registration/fs-watch.js +266 -0
- package/dist/registration/fs-watch.js.map +1 -0
- package/dist/registration/ignore.d.ts +77 -0
- package/dist/registration/ignore.d.ts.map +1 -0
- package/dist/registration/ignore.js +249 -0
- package/dist/registration/ignore.js.map +1 -0
- package/dist/registration/ladder.d.ts +211 -0
- package/dist/registration/ladder.d.ts.map +1 -0
- package/dist/registration/ladder.js +378 -0
- package/dist/registration/ladder.js.map +1 -0
- package/dist/registration/paths-safe.d.ts +21 -0
- package/dist/registration/paths-safe.d.ts.map +1 -0
- package/dist/registration/paths-safe.js +88 -0
- package/dist/registration/paths-safe.js.map +1 -0
- package/dist/registration/prune-cli.d.ts +48 -0
- package/dist/registration/prune-cli.d.ts.map +1 -0
- package/dist/registration/prune-cli.js +57 -0
- package/dist/registration/prune-cli.js.map +1 -0
- package/dist/registration/review-cli.d.ts +42 -0
- package/dist/registration/review-cli.d.ts.map +1 -0
- package/dist/registration/review-cli.js +110 -0
- package/dist/registration/review-cli.js.map +1 -0
- package/dist/registration/review-store.d.ts +73 -0
- package/dist/registration/review-store.d.ts.map +1 -0
- package/dist/registration/review-store.js +243 -0
- package/dist/registration/review-store.js.map +1 -0
- package/dist/registration/service.d.ts +196 -0
- package/dist/registration/service.d.ts.map +1 -0
- package/dist/registration/service.js +384 -0
- package/dist/registration/service.js.map +1 -0
- package/dist/registration/store-bridge.d.ts +133 -0
- package/dist/registration/store-bridge.d.ts.map +1 -0
- package/dist/registration/store-bridge.js +159 -0
- package/dist/registration/store-bridge.js.map +1 -0
- package/dist/registration/tlsh.d.ts +125 -0
- package/dist/registration/tlsh.d.ts.map +1 -0
- package/dist/registration/tlsh.js +274 -0
- package/dist/registration/tlsh.js.map +1 -0
- package/dist/server.d.ts +26 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +156 -0
- package/dist/server.js.map +1 -0
- package/dist/service/argv.d.ts +52 -0
- package/dist/service/argv.d.ts.map +1 -0
- package/dist/service/argv.js +127 -0
- package/dist/service/argv.js.map +1 -0
- package/dist/service/command-runner.d.ts +54 -0
- package/dist/service/command-runner.d.ts.map +1 -0
- package/dist/service/command-runner.js +55 -0
- package/dist/service/command-runner.js.map +1 -0
- package/dist/service/index.d.ts +83 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/index.js +270 -0
- package/dist/service/index.js.map +1 -0
- package/dist/service/platform.d.ts +110 -0
- package/dist/service/platform.d.ts.map +1 -0
- package/dist/service/platform.js +157 -0
- package/dist/service/platform.js.map +1 -0
- package/dist/service/templates.d.ts +88 -0
- package/dist/service/templates.d.ts.map +1 -0
- package/dist/service/templates.js +212 -0
- package/dist/service/templates.js.map +1 -0
- package/dist/source-graph/deeplake-credentials.d.ts +57 -0
- package/dist/source-graph/deeplake-credentials.d.ts.map +1 -0
- package/dist/source-graph/deeplake-credentials.js +109 -0
- package/dist/source-graph/deeplake-credentials.js.map +1 -0
- package/dist/source-graph/deeplake-heal.d.ts +53 -0
- package/dist/source-graph/deeplake-heal.d.ts.map +1 -0
- package/dist/source-graph/deeplake-heal.js +41 -0
- package/dist/source-graph/deeplake-heal.js.map +1 -0
- package/dist/source-graph/deeplake-store.d.ts +151 -0
- package/dist/source-graph/deeplake-store.d.ts.map +1 -0
- package/dist/source-graph/deeplake-store.js +389 -0
- package/dist/source-graph/deeplake-store.js.map +1 -0
- package/dist/source-graph/deeplake-transport.d.ts +74 -0
- package/dist/source-graph/deeplake-transport.d.ts.map +1 -0
- package/dist/source-graph/deeplake-transport.js +107 -0
- package/dist/source-graph/deeplake-transport.js.map +1 -0
- package/dist/source-graph/hash.d.ts +3 -0
- package/dist/source-graph/hash.d.ts.map +1 -0
- package/dist/source-graph/hash.js +12 -0
- package/dist/source-graph/hash.js.map +1 -0
- package/dist/source-graph/memory-store.d.ts +32 -0
- package/dist/source-graph/memory-store.d.ts.map +1 -0
- package/dist/source-graph/memory-store.js +81 -0
- package/dist/source-graph/memory-store.js.map +1 -0
- package/dist/source-graph/model.d.ts +102 -0
- package/dist/source-graph/model.d.ts.map +1 -0
- package/dist/source-graph/model.js +36 -0
- package/dist/source-graph/model.js.map +1 -0
- package/dist/source-graph/paths.d.ts +7 -0
- package/dist/source-graph/paths.d.ts.map +1 -0
- package/dist/source-graph/paths.js +26 -0
- package/dist/source-graph/paths.js.map +1 -0
- package/dist/source-graph/schema.d.ts +44 -0
- package/dist/source-graph/schema.d.ts.map +1 -0
- package/dist/source-graph/schema.js +123 -0
- package/dist/source-graph/schema.js.map +1 -0
- package/dist/source-graph/sql-guards.d.ts +99 -0
- package/dist/source-graph/sql-guards.d.ts.map +1 -0
- package/dist/source-graph/sql-guards.js +129 -0
- package/dist/source-graph/sql-guards.js.map +1 -0
- package/dist/source-graph/store.d.ts +101 -0
- package/dist/source-graph/store.d.ts.map +1 -0
- package/dist/source-graph/store.js +2 -0
- package/dist/source-graph/store.js.map +1 -0
- package/dist/source-graph/ulid.d.ts +9 -0
- package/dist/source-graph/ulid.d.ts.map +1 -0
- package/dist/source-graph/ulid.js +61 -0
- package/dist/source-graph/ulid.js.map +1 -0
- package/dist/telemetry/checkin.d.ts +66 -0
- package/dist/telemetry/checkin.d.ts.map +1 -0
- package/dist/telemetry/checkin.js +142 -0
- package/dist/telemetry/checkin.js.map +1 -0
- package/dist/telemetry/db.d.ts +34 -0
- package/dist/telemetry/db.d.ts.map +1 -0
- package/dist/telemetry/db.js +122 -0
- package/dist/telemetry/db.js.map +1 -0
- package/dist/telemetry/index.d.ts +76 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +98 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/logs.d.ts +83 -0
- package/dist/telemetry/logs.d.ts.map +1 -0
- package/dist/telemetry/logs.js +110 -0
- package/dist/telemetry/logs.js.map +1 -0
- package/dist/telemetry/metrics.d.ts +82 -0
- package/dist/telemetry/metrics.d.ts.map +1 -0
- package/dist/telemetry/metrics.js +148 -0
- package/dist/telemetry/metrics.js.map +1 -0
- package/dist/telemetry-usage/emit.d.ts +105 -0
- package/dist/telemetry-usage/emit.d.ts.map +1 -0
- package/dist/telemetry-usage/emit.js +267 -0
- package/dist/telemetry-usage/emit.js.map +1 -0
- package/dist/telemetry-usage/posthog-key.d.ts +22 -0
- package/dist/telemetry-usage/posthog-key.d.ts.map +1 -0
- package/dist/telemetry-usage/posthog-key.js +22 -0
- package/dist/telemetry-usage/posthog-key.js.map +1 -0
- package/dist/worker.d.ts +69 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +91 -0
- package/dist/worker.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { type FuzzyStep } from "./ladder.js";
|
|
2
|
+
import { type WatcherState, type WatchFn } from "./fs-watch.js";
|
|
3
|
+
import type { IgnorePredicate } from "./ignore.js";
|
|
4
|
+
import type { PendingReviewStore } from "./review-store.js";
|
|
5
|
+
import type { HiveGraphStore } from "../hive-graph/store.js";
|
|
6
|
+
import type { Tenancy } from "../hive-graph/model.js";
|
|
7
|
+
import { type Timer } from "../poll-loop.js";
|
|
8
|
+
import type { PipelineMetricsSink } from "../telemetry/metrics.js";
|
|
9
|
+
/** A file's on-disk state, resolved by the injected filesystem seam. */
|
|
10
|
+
export interface StatResult {
|
|
11
|
+
readonly sizeBytes: number;
|
|
12
|
+
readonly mtimeObserved: string;
|
|
13
|
+
readContent(): string | Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
/** The filesystem seam. Injected so the service is testable without touching a real disk. */
|
|
16
|
+
export interface RegistrationFs {
|
|
17
|
+
/** Stat a repo-relative path; null if it does not exist on disk. */
|
|
18
|
+
statPath(relPath: string): StatResult | null;
|
|
19
|
+
/** Whether a repo-relative path currently exists on disk (distinguishes move from copy). */
|
|
20
|
+
existsOnDisk(relPath: string): boolean;
|
|
21
|
+
/** Every current repo-relative path on disk (for the full resync settle). */
|
|
22
|
+
listPaths(): Iterable<string>;
|
|
23
|
+
/**
|
|
24
|
+
* True when `relPath` currently exists on disk AS A DIRECTORY (PRD-018c
|
|
25
|
+
* NEC-008 / AC-018c.5). OPTIONAL and ADDITIVE: an adapter that omits it
|
|
26
|
+
* (most test fakes) simply never triggers the directory-event resync path -
|
|
27
|
+
* `stat === null` for a directory is treated as "missing", the pre-018c
|
|
28
|
+
* behavior, which the prefix-based missing-directory signal below still
|
|
29
|
+
* catches for a genuine directory rename.
|
|
30
|
+
*/
|
|
31
|
+
isDirectory?(relPath: string): boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface RegistrationServiceOptions {
|
|
34
|
+
readonly store: HiveGraphStore;
|
|
35
|
+
readonly tenancy: Tenancy;
|
|
36
|
+
readonly fs: RegistrationFs;
|
|
37
|
+
readonly root: string;
|
|
38
|
+
/** Step-4 fuzzy matcher (the concrete TLSH-family step). Omit to disable step 4. */
|
|
39
|
+
readonly fuzzy?: FuzzyStep;
|
|
40
|
+
/** Where low-confidence step-4 candidates are queued for `review-matches`. */
|
|
41
|
+
readonly pendingReviews?: PendingReviewStore;
|
|
42
|
+
/** Ignore contract; ignored paths never trigger a cycle (AC-5). */
|
|
43
|
+
readonly isIgnored?: IgnorePredicate;
|
|
44
|
+
/** Debounce window for the intake (DEFAULT 500 ms, PRD-006a). */
|
|
45
|
+
readonly debounceMs?: number;
|
|
46
|
+
/** Injected timer for the intake debounce (deterministic tests). */
|
|
47
|
+
readonly timer?: Timer;
|
|
48
|
+
/** ISO 8601 "now"; injectable for deterministic tests. */
|
|
49
|
+
now?(): string;
|
|
50
|
+
/**
|
|
51
|
+
* PRD-018c NEC-034 / AC-018c.8: force the case-sensitivity mode instead of
|
|
52
|
+
* probing. Tests use this to exercise case-fold behavior deterministically
|
|
53
|
+
* regardless of the CI host's real filesystem; production wiring omits it
|
|
54
|
+
* so the REAL probe ({@link probeCaseInsensitiveFs}, run once against
|
|
55
|
+
* `root` at construction) decides.
|
|
56
|
+
*/
|
|
57
|
+
readonly caseInsensitive?: boolean;
|
|
58
|
+
/** Fired whenever the watcher's liveness state changes (PRD-018c AC-018c.6/7: running/restarting/degraded/stopped). Defaults to a no-op. */
|
|
59
|
+
onWatcherStateChange?(state: WatcherState): void;
|
|
60
|
+
/** Backoff floor for a watcher restart-after-error (ms). Forwarded to {@link WatchIntake}. */
|
|
61
|
+
readonly watcherRestartBackoffFloorMs?: number;
|
|
62
|
+
/** Backoff ceiling for a watcher restart-after-error (ms). Forwarded to {@link WatchIntake}. */
|
|
63
|
+
readonly watcherRestartBackoffCeilingMs?: number;
|
|
64
|
+
/** Consecutive restart failures before the watcher parks degraded (PRD-018c AC-018c.7). Forwarded to {@link WatchIntake}. */
|
|
65
|
+
readonly maxWatcherRestartAttempts?: number;
|
|
66
|
+
/** The raw watch constructor (default: `node:fs`'s `watch`). Forwarded to {@link WatchIntake}; injectable for deterministic error/restart tests (AC-018c.6/7). */
|
|
67
|
+
readonly watchFn?: WatchFn;
|
|
68
|
+
/**
|
|
69
|
+
* PRD-018c AC-018c.7: a slow periodic resync tick that runs regardless of
|
|
70
|
+
* watcher health, so a permanently-degraded watcher still eventually
|
|
71
|
+
* reconciles changes. Default {@link DEFAULT_PERIODIC_RESYNC_MS}; set 0 to
|
|
72
|
+
* disable (most unit tests, which drive resync explicitly).
|
|
73
|
+
*/
|
|
74
|
+
readonly periodicResyncMs?: number;
|
|
75
|
+
/** Enrich-queue sink (PRD-016 wires the real queue later). */
|
|
76
|
+
onEnrichQueued?(nectar: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Observability seam fired at the top of {@link RegistrationService.requestResync}
|
|
79
|
+
* (PRD-018b): a pure notification (no behavior change to the ladder or the
|
|
80
|
+
* settle) so the daemon can count the single cold-catch-up resync it requests
|
|
81
|
+
* after auto-brood settles (AC-018b.5) and surface it to health. Defaults to a
|
|
82
|
+
* no-op; existing callers are unaffected.
|
|
83
|
+
*/
|
|
84
|
+
onResyncRequested?(): void;
|
|
85
|
+
/** Structured log sink; defaults to a no-op. */
|
|
86
|
+
log?(line: Record<string, unknown>): void;
|
|
87
|
+
/**
|
|
88
|
+
* The since-restart pipeline metrics sink (PRD-017b). Counts "files
|
|
89
|
+
* registered" - once per settled path actually resolved through the ladder
|
|
90
|
+
* (a NEW/CHANGED path, `resolveExisting`), regardless of the ladder's
|
|
91
|
+
* outcome. Nectar-mint and version-write counters are captured separately
|
|
92
|
+
* by wrapping `store` with `telemetry.wrapStore()` (`telemetry/metrics.ts`)
|
|
93
|
+
* before constructing this service, so this field only needs to cover the
|
|
94
|
+
* one counter with no other precise 1:1 store-level hook. Omit for a no-op
|
|
95
|
+
* (the default; existing callers are unaffected).
|
|
96
|
+
*/
|
|
97
|
+
metrics?: PipelineMetricsSink;
|
|
98
|
+
}
|
|
99
|
+
/** PRD-018c AC-018c.7: the periodic resync backstop's default cadence. Slow enough that the descent-pruned walk (AC-018c.4) makes it cheap even while running. */
|
|
100
|
+
export declare const DEFAULT_PERIODIC_RESYNC_MS: number;
|
|
101
|
+
export declare class RegistrationService {
|
|
102
|
+
private readonly store;
|
|
103
|
+
private readonly tenancy;
|
|
104
|
+
private readonly fs;
|
|
105
|
+
private readonly fuzzy;
|
|
106
|
+
private readonly pendingReviews;
|
|
107
|
+
private readonly isIgnored;
|
|
108
|
+
private readonly nowFn;
|
|
109
|
+
private readonly onEnrichQueued;
|
|
110
|
+
private readonly onResyncRequested;
|
|
111
|
+
private readonly log;
|
|
112
|
+
private readonly metrics;
|
|
113
|
+
private readonly intake;
|
|
114
|
+
private readonly timer;
|
|
115
|
+
private readonly caseInsensitive;
|
|
116
|
+
private readonly statCache;
|
|
117
|
+
private readonly periodicResyncMs;
|
|
118
|
+
private readonly pending;
|
|
119
|
+
private resyncRequested;
|
|
120
|
+
/** The in-flight (or just-settled) cycle. Tracked so tests can await idle. */
|
|
121
|
+
private currentCyclePromise;
|
|
122
|
+
private periodicResyncHandle;
|
|
123
|
+
constructor(opts: RegistrationServiceOptions);
|
|
124
|
+
/** Begin watching the workspace root. Idempotent. */
|
|
125
|
+
start(): void;
|
|
126
|
+
/** Stop watching, cancel pending debounces, and disarm the periodic resync backstop. Idempotent. */
|
|
127
|
+
stop(): void;
|
|
128
|
+
/** PRD-018c AC-018c.7: (re)arm the periodic resync backstop. A no-op when `periodicResyncMs` is 0 (disabled). */
|
|
129
|
+
private armPeriodicResync;
|
|
130
|
+
private disarmPeriodicResync;
|
|
131
|
+
/** Feed a concrete path observation into the debounced intake (test/programmatic entry). */
|
|
132
|
+
observe(relPath: string): void;
|
|
133
|
+
/** Feed a raw watch observation (null filename -> resync) into the intake. */
|
|
134
|
+
observeRaw(filename: string | null | undefined): void;
|
|
135
|
+
/** Request a debounced full-workspace resync settle. */
|
|
136
|
+
requestResync(): void;
|
|
137
|
+
/** Enqueue a settled path and kick the cycle. */
|
|
138
|
+
private enqueue;
|
|
139
|
+
/**
|
|
140
|
+
* Drain seam for tests. Resolves once no cycle is running and nothing is
|
|
141
|
+
* pending. Mirrors honeycomb's `_waitForIdle()` (`file-watcher.ts:312-314`).
|
|
142
|
+
*/
|
|
143
|
+
_waitForIdle(): Promise<void>;
|
|
144
|
+
/** Start a cycle if none is running; the finally re-kicks if work arrived during the cycle. */
|
|
145
|
+
private kick;
|
|
146
|
+
/**
|
|
147
|
+
* The settled handler. Drains the resync request and the pending-path set,
|
|
148
|
+
* classifying and resolving each path. It catches every per-path error and
|
|
149
|
+
* continues; it never throws out of the cycle.
|
|
150
|
+
*/
|
|
151
|
+
private runCycle;
|
|
152
|
+
/**
|
|
153
|
+
* PRD-018d (NEC-036): run the idempotent ladder-state repair sweep once per
|
|
154
|
+
* full resync, so cold catch-up (the moment corruption from a pre-fix or
|
|
155
|
+
* mid-crash daemon is most likely to have accumulated) is also the moment it
|
|
156
|
+
* self-heals. Never throws; a per-path cycle failure is isolated the same
|
|
157
|
+
* way `runCycle` isolates `processOne` failures, but a sweep failure is rare
|
|
158
|
+
* enough (it touches only already-persisted rows, no disk I/O) that it is
|
|
159
|
+
* logged rather than silently swallowed.
|
|
160
|
+
*/
|
|
161
|
+
private runRepairSweep;
|
|
162
|
+
/** Case-fold a path for lookup purposes only (NEC-034 / AC-018c.8); identity when the workspace is case-sensitive. Never applied to a path that gets stat'd, read, or persisted. */
|
|
163
|
+
private fold;
|
|
164
|
+
/** The set of paths currently known to the store (a nectar's latest-version path), scoped and fold-normalized for lookup. */
|
|
165
|
+
private knownPaths;
|
|
166
|
+
/**
|
|
167
|
+
* PRD-018c EX-4: the set of known (real-cased) paths currently missing from
|
|
168
|
+
* disk, computed once per batch/cycle so the ladder's step-4 candidate scan
|
|
169
|
+
* (`missingCandidates`) is an O(1) lookup instead of an `existsOnDisk` stat
|
|
170
|
+
* per candidate per new file.
|
|
171
|
+
*/
|
|
172
|
+
private missingPaths;
|
|
173
|
+
/**
|
|
174
|
+
* PRD-018c NEC-008 / AC-018c.5: true when `relPath` (case-folded) is a
|
|
175
|
+
* directory PREFIX of some known file path - the signature of a directory
|
|
176
|
+
* that was renamed/moved out from under its known children. `knownPaths` is
|
|
177
|
+
* already fold-normalized by `knownPaths()`.
|
|
178
|
+
*/
|
|
179
|
+
private isKnownPrefix;
|
|
180
|
+
/** Classify one settled path and, for NEW/CHANGED, resolve it through the ladder. */
|
|
181
|
+
private processOne;
|
|
182
|
+
private resolveExisting;
|
|
183
|
+
private ladderDeps;
|
|
184
|
+
/**
|
|
185
|
+
* Persist a low-confidence step-4 candidate for `review-matches` (AC-18).
|
|
186
|
+
*
|
|
187
|
+
* The id is derived deterministically from `(candidateNectar, newPath)`
|
|
188
|
+
* (PRD-018d NEC-036/AC-018d.7) rather than freshly minted per call: a
|
|
189
|
+
* re-observation of the same target while it is still pending review then
|
|
190
|
+
* naturally lands on the SAME id, so the store's own id-based replace (and
|
|
191
|
+
* its belt-and-suspenders tuple-based dedupe) refreshes the one candidate in
|
|
192
|
+
* place instead of accumulating a sibling per settle.
|
|
193
|
+
*/
|
|
194
|
+
private handleReview;
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/registration/service.ts"],"names":[],"mappings":"AA8BA,OAAO,EAIL,KAAK,SAAS,EAMf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAe,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,wEAAwE;AACxE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,a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006a AC-4/AC-9).
|
|
3
|
+
*
|
|
4
|
+
* This is the orchestrator that wires the whole file-registration pipeline end
|
|
5
|
+
* to end: the debounced `WatchIntake` (006a) hands settled paths here; each path
|
|
6
|
+
* is `stat`ed, classified (006b), and, for a NEW/CHANGED path, resolved through
|
|
7
|
+
* the re-association ladder (006d) and persisted via the `HiveGraphStore`
|
|
8
|
+
* (005). It mirrors honeycomb's discover -> resolve -> persist shape
|
|
9
|
+
* (`codebase/api.ts:234-261` `runGraphBuild`) and the fire-and-forget-with-intent
|
|
10
|
+
* settled handler (`file-watcher.ts:234-293` `runSyncCycle`):
|
|
11
|
+
*
|
|
12
|
+
* - a per-path failure is caught and logged, and the cycle CONTINUES with the
|
|
13
|
+
* next path (the whole cycle never throws);
|
|
14
|
+
* - the running cycle's promise is tracked (`currentCyclePromise`) so a test
|
|
15
|
+
* can await idle via {@link RegistrationService._waitForIdle};
|
|
16
|
+
* - a null-filename observation triggers a full workspace resync settle (AC-3);
|
|
17
|
+
* - observations are ignore-filtered before they reach a cycle (AC-5).
|
|
18
|
+
*
|
|
19
|
+
* Step-4 fingerprints are PERSISTED on the version row (the
|
|
20
|
+
* `hive_graph_versions.fingerprint` column, written by the ladder), not held
|
|
21
|
+
* in an in-process cache, so cold-catch-up fuzzy matching survives a daemon
|
|
22
|
+
* restart (AC-8): step 4 reads each missing candidate's fingerprint straight
|
|
23
|
+
* from the store.
|
|
24
|
+
*
|
|
25
|
+
* Move reconstruction (AC-9) falls out of this end-to-end: feed the intake two
|
|
26
|
+
* observations (old path now missing, new path new) and, at settle, the ladder's
|
|
27
|
+
* step 3 carries the nectar when the new content matches the missing file's hash.
|
|
28
|
+
*/
|
|
29
|
+
import { classifyPath } from "./classify.js";
|
|
30
|
+
import { isSafeRelPath } from "./paths-safe.js";
|
|
31
|
+
import { createInMemoryStatCache, reassociate, repairLadderState, } from "./ladder.js";
|
|
32
|
+
import { WatchIntake } from "./fs-watch.js";
|
|
33
|
+
import { probeCaseInsensitiveFs } from "./disk-fs.js";
|
|
34
|
+
import { sha256Hex } from "../hive-graph/hash.js";
|
|
35
|
+
import { realTimer } from "../poll-loop.js";
|
|
36
|
+
/** PRD-018c AC-018c.7: the periodic resync backstop's default cadence. Slow enough that the descent-pruned walk (AC-018c.4) makes it cheap even while running. */
|
|
37
|
+
export const DEFAULT_PERIODIC_RESYNC_MS = 10 * 60 * 1000;
|
|
38
|
+
export class RegistrationService {
|
|
39
|
+
store;
|
|
40
|
+
tenancy;
|
|
41
|
+
fs;
|
|
42
|
+
fuzzy;
|
|
43
|
+
pendingReviews;
|
|
44
|
+
isIgnored;
|
|
45
|
+
nowFn;
|
|
46
|
+
onEnrichQueued;
|
|
47
|
+
onResyncRequested;
|
|
48
|
+
log;
|
|
49
|
+
metrics;
|
|
50
|
+
intake;
|
|
51
|
+
timer;
|
|
52
|
+
caseInsensitive;
|
|
53
|
+
statCache;
|
|
54
|
+
periodicResyncMs;
|
|
55
|
+
pending = new Set();
|
|
56
|
+
resyncRequested = false;
|
|
57
|
+
/** The in-flight (or just-settled) cycle. Tracked so tests can await idle. */
|
|
58
|
+
currentCyclePromise = null;
|
|
59
|
+
periodicResyncHandle = null;
|
|
60
|
+
constructor(opts) {
|
|
61
|
+
this.store = opts.store;
|
|
62
|
+
this.tenancy = opts.tenancy;
|
|
63
|
+
this.fs = opts.fs;
|
|
64
|
+
this.fuzzy = opts.fuzzy;
|
|
65
|
+
this.pendingReviews = opts.pendingReviews;
|
|
66
|
+
this.isIgnored = opts.isIgnored ?? (() => false);
|
|
67
|
+
this.nowFn = opts.now ?? (() => new Date().toISOString());
|
|
68
|
+
this.onEnrichQueued = opts.onEnrichQueued ?? (() => { });
|
|
69
|
+
this.onResyncRequested = opts.onResyncRequested ?? (() => { });
|
|
70
|
+
this.log = opts.log ?? (() => { });
|
|
71
|
+
this.metrics = opts.metrics;
|
|
72
|
+
this.timer = opts.timer ?? realTimer;
|
|
73
|
+
// NEC-034 / AC-018c.8: probe ONCE per workspace (never a `process.platform`
|
|
74
|
+
// guess); a test overrides via `caseInsensitive` for determinism.
|
|
75
|
+
this.caseInsensitive = opts.caseInsensitive ?? probeCaseInsensitiveFs(opts.root);
|
|
76
|
+
this.statCache = createInMemoryStatCache();
|
|
77
|
+
this.periodicResyncMs = Math.max(0, opts.periodicResyncMs ?? DEFAULT_PERIODIC_RESYNC_MS);
|
|
78
|
+
this.intake = new WatchIntake({
|
|
79
|
+
root: opts.root,
|
|
80
|
+
debounceMs: opts.debounceMs,
|
|
81
|
+
isIgnored: this.isIgnored,
|
|
82
|
+
timer: opts.timer,
|
|
83
|
+
onPathChanged: (relPath) => this.enqueue(relPath),
|
|
84
|
+
onResync: () => this.requestResync(),
|
|
85
|
+
onError: (err) => this.log({ level: "error", scope: "registration.intake", err: String(err) }),
|
|
86
|
+
onStateChange: (state) => {
|
|
87
|
+
this.log({ level: state === "degraded" ? "warn" : "info", scope: "registration.watcher", state });
|
|
88
|
+
opts.onWatcherStateChange?.(state);
|
|
89
|
+
},
|
|
90
|
+
...(opts.watcherRestartBackoffFloorMs !== undefined
|
|
91
|
+
? { restartBackoffFloorMs: opts.watcherRestartBackoffFloorMs }
|
|
92
|
+
: {}),
|
|
93
|
+
...(opts.watcherRestartBackoffCeilingMs !== undefined
|
|
94
|
+
? { restartBackoffCeilingMs: opts.watcherRestartBackoffCeilingMs }
|
|
95
|
+
: {}),
|
|
96
|
+
...(opts.maxWatcherRestartAttempts !== undefined ? { maxRestartAttempts: opts.maxWatcherRestartAttempts } : {}),
|
|
97
|
+
...(opts.watchFn !== undefined ? { watchFn: opts.watchFn } : {}),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/** Begin watching the workspace root. Idempotent. */
|
|
101
|
+
start() {
|
|
102
|
+
this.intake.start();
|
|
103
|
+
this.armPeriodicResync();
|
|
104
|
+
}
|
|
105
|
+
/** Stop watching, cancel pending debounces, and disarm the periodic resync backstop. Idempotent. */
|
|
106
|
+
stop() {
|
|
107
|
+
this.intake.stop();
|
|
108
|
+
this.disarmPeriodicResync();
|
|
109
|
+
}
|
|
110
|
+
/** PRD-018c AC-018c.7: (re)arm the periodic resync backstop. A no-op when `periodicResyncMs` is 0 (disabled). */
|
|
111
|
+
armPeriodicResync() {
|
|
112
|
+
if (this.periodicResyncMs <= 0)
|
|
113
|
+
return;
|
|
114
|
+
this.disarmPeriodicResync();
|
|
115
|
+
this.periodicResyncHandle = this.timer.set(() => {
|
|
116
|
+
this.periodicResyncHandle = null;
|
|
117
|
+
this.requestResync();
|
|
118
|
+
this.armPeriodicResync();
|
|
119
|
+
}, this.periodicResyncMs);
|
|
120
|
+
}
|
|
121
|
+
disarmPeriodicResync() {
|
|
122
|
+
if (this.periodicResyncHandle !== null) {
|
|
123
|
+
this.timer.clear(this.periodicResyncHandle);
|
|
124
|
+
this.periodicResyncHandle = null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Feed a concrete path observation into the debounced intake (test/programmatic entry). */
|
|
128
|
+
observe(relPath) {
|
|
129
|
+
this.intake.observe(relPath);
|
|
130
|
+
}
|
|
131
|
+
/** Feed a raw watch observation (null filename -> resync) into the intake. */
|
|
132
|
+
observeRaw(filename) {
|
|
133
|
+
this.intake.observeRaw(filename);
|
|
134
|
+
}
|
|
135
|
+
/** Request a debounced full-workspace resync settle. */
|
|
136
|
+
requestResync() {
|
|
137
|
+
this.onResyncRequested();
|
|
138
|
+
this.resyncRequested = true;
|
|
139
|
+
this.kick();
|
|
140
|
+
}
|
|
141
|
+
/** Enqueue a settled path and kick the cycle. */
|
|
142
|
+
enqueue(relPath) {
|
|
143
|
+
if (this.isIgnored(relPath))
|
|
144
|
+
return;
|
|
145
|
+
this.pending.add(relPath);
|
|
146
|
+
this.kick();
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Drain seam for tests. Resolves once no cycle is running and nothing is
|
|
150
|
+
* pending. Mirrors honeycomb's `_waitForIdle()` (`file-watcher.ts:312-314`).
|
|
151
|
+
*/
|
|
152
|
+
async _waitForIdle() {
|
|
153
|
+
while (this.currentCyclePromise !== null) {
|
|
154
|
+
await this.currentCyclePromise;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** Start a cycle if none is running; the finally re-kicks if work arrived during the cycle. */
|
|
158
|
+
kick() {
|
|
159
|
+
if (this.currentCyclePromise !== null)
|
|
160
|
+
return;
|
|
161
|
+
this.currentCyclePromise = this.runCycle().finally(() => {
|
|
162
|
+
this.currentCyclePromise = null;
|
|
163
|
+
if (this.pending.size > 0 || this.resyncRequested)
|
|
164
|
+
this.kick();
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The settled handler. Drains the resync request and the pending-path set,
|
|
169
|
+
* classifying and resolving each path. It catches every per-path error and
|
|
170
|
+
* continues; it never throws out of the cycle.
|
|
171
|
+
*/
|
|
172
|
+
async runCycle() {
|
|
173
|
+
while (this.resyncRequested || this.pending.size > 0) {
|
|
174
|
+
if (this.resyncRequested) {
|
|
175
|
+
this.resyncRequested = false;
|
|
176
|
+
this.runRepairSweep();
|
|
177
|
+
for (const p of this.fs.listPaths()) {
|
|
178
|
+
const normalized = p.replace(/\\/g, "/");
|
|
179
|
+
if (!this.isIgnored(normalized))
|
|
180
|
+
this.pending.add(normalized);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (this.pending.size === 0)
|
|
184
|
+
continue;
|
|
185
|
+
const batch = [...this.pending];
|
|
186
|
+
this.pending.clear();
|
|
187
|
+
// Snapshot the known-paths set ONCE per batch (each batch path is distinct
|
|
188
|
+
// and never re-processed within the same batch), avoiding an O(N^2)
|
|
189
|
+
// listLatestVersions walk per path. PRD-018c EX-4: the missing-paths set
|
|
190
|
+
// is ALSO computed once per batch here (one `existsOnDisk` stat per known
|
|
191
|
+
// path total), rather than once per known path PER new file inside the
|
|
192
|
+
// ladder's step-4 candidate scan (`ladder.ts`'s `missingCandidates`).
|
|
193
|
+
const known = this.knownPaths();
|
|
194
|
+
const missing = this.missingPaths();
|
|
195
|
+
for (const relPath of batch) {
|
|
196
|
+
try {
|
|
197
|
+
this.processOne(relPath, known, missing);
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
this.log({ level: "error", scope: "registration.cycle", relPath, err: String(err) });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* PRD-018d (NEC-036): run the idempotent ladder-state repair sweep once per
|
|
207
|
+
* full resync, so cold catch-up (the moment corruption from a pre-fix or
|
|
208
|
+
* mid-crash daemon is most likely to have accumulated) is also the moment it
|
|
209
|
+
* self-heals. Never throws; a per-path cycle failure is isolated the same
|
|
210
|
+
* way `runCycle` isolates `processOne` failures, but a sweep failure is rare
|
|
211
|
+
* enough (it touches only already-persisted rows, no disk I/O) that it is
|
|
212
|
+
* logged rather than silently swallowed.
|
|
213
|
+
*/
|
|
214
|
+
runRepairSweep() {
|
|
215
|
+
let report;
|
|
216
|
+
try {
|
|
217
|
+
report = repairLadderState(this.store, this.tenancy);
|
|
218
|
+
}
|
|
219
|
+
catch (err) {
|
|
220
|
+
this.log({ level: "error", scope: "registration.repair", err: err instanceof Error ? err.message : String(err) });
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (report.healedOrphanIdentities > 0 ||
|
|
224
|
+
report.healedOrphanVersions > 0 ||
|
|
225
|
+
report.healedStaleLastUpdate > 0 ||
|
|
226
|
+
report.healedDuplicatePaths > 0) {
|
|
227
|
+
this.log({ level: "info", scope: "registration.repair", ...report });
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/** Case-fold a path for lookup purposes only (NEC-034 / AC-018c.8); identity when the workspace is case-sensitive. Never applied to a path that gets stat'd, read, or persisted. */
|
|
231
|
+
fold(relPath) {
|
|
232
|
+
return this.caseInsensitive ? relPath.toLowerCase() : relPath;
|
|
233
|
+
}
|
|
234
|
+
/** The set of paths currently known to the store (a nectar's latest-version path), scoped and fold-normalized for lookup. */
|
|
235
|
+
knownPaths() {
|
|
236
|
+
const set = new Set();
|
|
237
|
+
for (const lv of this.store.listLatestVersions(this.tenancy))
|
|
238
|
+
set.add(this.fold(lv.version.path));
|
|
239
|
+
return set;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* PRD-018c EX-4: the set of known (real-cased) paths currently missing from
|
|
243
|
+
* disk, computed once per batch/cycle so the ladder's step-4 candidate scan
|
|
244
|
+
* (`missingCandidates`) is an O(1) lookup instead of an `existsOnDisk` stat
|
|
245
|
+
* per candidate per new file.
|
|
246
|
+
*/
|
|
247
|
+
missingPaths() {
|
|
248
|
+
const set = new Set();
|
|
249
|
+
for (const lv of this.store.listLatestVersions(this.tenancy)) {
|
|
250
|
+
if (!this.fs.existsOnDisk(lv.version.path))
|
|
251
|
+
set.add(lv.version.path);
|
|
252
|
+
}
|
|
253
|
+
return set;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* PRD-018c NEC-008 / AC-018c.5: true when `relPath` (case-folded) is a
|
|
257
|
+
* directory PREFIX of some known file path - the signature of a directory
|
|
258
|
+
* that was renamed/moved out from under its known children. `knownPaths` is
|
|
259
|
+
* already fold-normalized by `knownPaths()`.
|
|
260
|
+
*/
|
|
261
|
+
isKnownPrefix(relPath, knownPaths) {
|
|
262
|
+
const prefix = `${this.fold(relPath)}/`;
|
|
263
|
+
for (const p of knownPaths) {
|
|
264
|
+
if (p.startsWith(prefix))
|
|
265
|
+
return true;
|
|
266
|
+
}
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
/** Classify one settled path and, for NEW/CHANGED, resolve it through the ladder. */
|
|
270
|
+
processOne(relPath, knownPaths, missingPaths) {
|
|
271
|
+
// Containment gate (CWE-22): never stat, read, classify, or persist a path
|
|
272
|
+
// that escapes the workspace (absolute or `..` traversal). This backstops the
|
|
273
|
+
// intake filter for the resync/direct-enqueue paths too.
|
|
274
|
+
if (!isSafeRelPath(relPath)) {
|
|
275
|
+
this.log({ level: "warn", scope: "registration.cycle", relPath, msg: "dropped unsafe path" });
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
// PRD-018c NEC-008 / AC-018c.5(a): the settled path itself IS a directory
|
|
279
|
+
// right now (a directory-level watch event, or a rename landing back on an
|
|
280
|
+
// existing directory name). A directory is never a registrable path; a
|
|
281
|
+
// resync reconciles every child in one scoped reconciliation instead of
|
|
282
|
+
// this event being silently dropped.
|
|
283
|
+
if (this.fs.isDirectory?.(relPath) === true) {
|
|
284
|
+
this.log({ level: "info", scope: "registration.cycle", relPath, msg: "directory event: requesting resync" });
|
|
285
|
+
this.requestResync();
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const stat = this.fs.statPath(relPath);
|
|
289
|
+
const input = classifyPath({ relPath, existsOnDisk: stat !== null }, knownPaths, (p) => this.fold(p));
|
|
290
|
+
if (input === null) {
|
|
291
|
+
// PRD-018c NEC-008 / AC-018c.5(b): the path is missing AND is a prefix of
|
|
292
|
+
// known paths - the OTHER directory-rename signature (the directory name
|
|
293
|
+
// itself is gone, only its former children are still known). A resync
|
|
294
|
+
// re-associates every child to its new location via the ladder.
|
|
295
|
+
if (stat === null && this.isKnownPrefix(relPath, knownPaths)) {
|
|
296
|
+
this.log({
|
|
297
|
+
level: "info",
|
|
298
|
+
scope: "registration.cycle",
|
|
299
|
+
relPath,
|
|
300
|
+
msg: "missing directory prefix: requesting resync",
|
|
301
|
+
});
|
|
302
|
+
this.requestResync();
|
|
303
|
+
}
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
switch (input.kind) {
|
|
307
|
+
case "new-path":
|
|
308
|
+
case "changed-path": {
|
|
309
|
+
if (stat === null)
|
|
310
|
+
return; // defensive: classify said it exists
|
|
311
|
+
this.resolveExisting(relPath, stat, missingPaths);
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
case "missing-path":
|
|
315
|
+
// A known nectar whose path is gone: it feeds the missing-files set the
|
|
316
|
+
// ladder consults for OTHER new paths (move reconstruction). No direct
|
|
317
|
+
// action here; the nectar is never deleted (only `prune --confirm` does).
|
|
318
|
+
return;
|
|
319
|
+
default: {
|
|
320
|
+
const _exhaustive = input.kind;
|
|
321
|
+
return _exhaustive;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
resolveExisting(relPath, stat, missingPaths) {
|
|
326
|
+
const file = {
|
|
327
|
+
relPath,
|
|
328
|
+
sizeBytes: stat.sizeBytes,
|
|
329
|
+
mtimeObserved: stat.mtimeObserved,
|
|
330
|
+
readContent: () => stat.readContent(),
|
|
331
|
+
};
|
|
332
|
+
// The ladder persists the content fingerprint on the appended version row, so
|
|
333
|
+
// there is nothing to cache here; step 4 reads it back from the store (AC-8).
|
|
334
|
+
const result = reassociate(file, this.ladderDeps(missingPaths));
|
|
335
|
+
// "files registered" (PRD-017b): one settled path actually resolved through
|
|
336
|
+
// the ladder, counted here at the real completion point regardless of which
|
|
337
|
+
// step fired or what action it took (noop/append/carry/mint/copy all count -
|
|
338
|
+
// each is one unit of registration work). A path that never reaches here
|
|
339
|
+
// (ignored, or classified "missing-path") is correctly never counted.
|
|
340
|
+
this.metrics?.incrementFilesRegistered();
|
|
341
|
+
this.log({ level: "debug", scope: "registration.resolve", relPath, step: result.step, action: result.action });
|
|
342
|
+
}
|
|
343
|
+
ladderDeps(missingPaths) {
|
|
344
|
+
return {
|
|
345
|
+
store: this.store,
|
|
346
|
+
tenancy: this.tenancy,
|
|
347
|
+
now: () => this.nowFn(),
|
|
348
|
+
existsOnDisk: (p) => this.fs.existsOnDisk(p),
|
|
349
|
+
fuzzy: this.fuzzy,
|
|
350
|
+
statCache: this.statCache,
|
|
351
|
+
caseInsensitive: this.caseInsensitive,
|
|
352
|
+
missingPaths,
|
|
353
|
+
onReviewNeeded: (candidate) => this.handleReview(candidate),
|
|
354
|
+
onEnrichQueued: (nectar) => this.onEnrichQueued(nectar),
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Persist a low-confidence step-4 candidate for `review-matches` (AC-18).
|
|
359
|
+
*
|
|
360
|
+
* The id is derived deterministically from `(candidateNectar, newPath)`
|
|
361
|
+
* (PRD-018d NEC-036/AC-018d.7) rather than freshly minted per call: a
|
|
362
|
+
* re-observation of the same target while it is still pending review then
|
|
363
|
+
* naturally lands on the SAME id, so the store's own id-based replace (and
|
|
364
|
+
* its belt-and-suspenders tuple-based dedupe) refreshes the one candidate in
|
|
365
|
+
* place instead of accumulating a sibling per settle.
|
|
366
|
+
*/
|
|
367
|
+
handleReview(candidate) {
|
|
368
|
+
if (this.pendingReviews === undefined)
|
|
369
|
+
return;
|
|
370
|
+
this.pendingReviews.add({
|
|
371
|
+
id: sha256Hex(`${candidate.nectar}|${candidate.relPath}`),
|
|
372
|
+
candidateNectar: candidate.nectar,
|
|
373
|
+
newPath: candidate.relPath,
|
|
374
|
+
confidence: candidate.confidence,
|
|
375
|
+
distance: candidate.distance,
|
|
376
|
+
contentHash: candidate.contentHash,
|
|
377
|
+
sizeBytes: candidate.sizeBytes,
|
|
378
|
+
mtimeObserved: candidate.mtimeObserved,
|
|
379
|
+
mintedNectar: candidate.mintedNectar,
|
|
380
|
+
createdAt: this.nowFn(),
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/registration/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,iBAAiB,GAOlB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAmC,MAAM,eAAe,CAAC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