@remnic/core 9.26.0 → 9.28.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/dist/access-admin-ops-surface.d.ts +13 -10
- package/dist/access-admin-ops-surface.js +43 -38
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +13 -10
- package/dist/access-authorization-probe.js +44 -39
- package/dist/access-boundary.d.ts +13 -10
- package/dist/access-boundary.js +43 -38
- package/dist/access-cli.js +100 -94
- package/dist/access-cli.js.map +1 -1
- package/dist/access-health-types.d.ts +10 -1
- package/dist/access-http-lcm-compaction.d.ts +13 -10
- package/dist/access-http.d.ts +13 -10
- package/dist/access-http.js +53 -48
- package/dist/access-identity-continuity-surface.d.ts +9 -8
- package/dist/access-identity-continuity-surface.js +43 -38
- package/dist/access-lcm-surface.d.ts +13 -10
- package/dist/access-lcm-surface.js +43 -38
- package/dist/access-mcp.d.ts +13 -10
- package/dist/access-mcp.js +48 -43
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-wRSZEO5V.d.ts → access-namespace-preflight-BiQ_-iUJ.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +43 -38
- package/dist/access-observe-write-surface.d.ts +13 -10
- package/dist/access-observe-write-surface.js +43 -38
- package/dist/access-operations-batch.js +45 -40
- package/dist/access-operations.d.ts +16 -13
- package/dist/access-operations.js +47 -42
- package/dist/access-recall-concurrency.d.ts +13 -10
- package/dist/access-recall-concurrency.js +43 -38
- package/dist/access-recall-response.d.ts +13 -10
- package/dist/access-recall-response.js +43 -38
- package/dist/access-recall-surface.d.ts +13 -10
- package/dist/access-recall-surface.js +43 -38
- package/dist/access-schema.d.ts +80 -80
- package/dist/access-schema.js +4 -4
- package/dist/{access-service-DL8FJnTj.d.ts → access-service-CXkIgcGh.d.ts} +12 -8
- package/dist/access-service.d.ts +13 -10
- package/dist/access-service.js +43 -38
- package/dist/access-surface-catalog.d.ts +13 -10
- package/dist/access-wearables-meetings-surface.d.ts +4 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -8
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +12 -10
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-YO5QJ6L3.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-BLLxZ5L5.d.ts → catalog-Bouj8Gfg.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +13 -11
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-7RZJWZ46.js → chunk-227UFSEQ.js} +5 -5
- package/dist/{chunk-VGEH3STZ.js → chunk-2BEJ4XCF.js} +2 -2
- package/dist/{chunk-LIIQPDFN.js → chunk-2FYNLDKJ.js} +24 -3
- package/dist/chunk-2FYNLDKJ.js.map +1 -0
- package/dist/{chunk-BXLOS5AJ.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-6NNNURLK.js → chunk-2PHX3I5C.js} +8 -8
- package/dist/{chunk-YN4AUGNF.js → chunk-2TQ2UFKH.js} +65 -60
- package/dist/chunk-2TQ2UFKH.js.map +1 -0
- package/dist/{chunk-XAAIUXJO.js → chunk-3BSJBIZ3.js} +2 -2
- package/dist/{chunk-JCVQV6QX.js → chunk-3UOSVTFR.js} +11 -11
- package/dist/{chunk-AJ7QCSIS.js → chunk-7CPOZH6Y.js} +2 -2
- package/dist/{chunk-EXM2Q555.js → chunk-AHFZXUZM.js} +7 -5
- package/dist/chunk-AHFZXUZM.js.map +1 -0
- package/dist/{chunk-M2KGXXTL.js → chunk-ALTP3MFS.js} +2 -2
- package/dist/{chunk-77CNV7DY.js → chunk-BLAKS3CP.js} +4 -4
- package/dist/{chunk-FE5FKTCI.js → chunk-BR4UFMLO.js} +2 -2
- package/dist/chunk-CVILPI77.js +432 -0
- package/dist/chunk-CVILPI77.js.map +1 -0
- package/dist/{chunk-H2PBM562.js → chunk-DKQM5Q6Q.js} +2 -2
- package/dist/{chunk-CSXHRAJJ.js → chunk-EG64LXKL.js} +3 -3
- package/dist/{chunk-PTN6UAUA.js → chunk-ES36HTSC.js} +4 -4
- package/dist/{chunk-WMDRLTNA.js → chunk-EZWWCN7I.js} +2 -2
- package/dist/{chunk-XKGPIWGI.js → chunk-FBZTWUK5.js} +5 -5
- package/dist/{chunk-GJJBPI6I.js → chunk-FOCEI3TN.js} +6 -3
- package/dist/chunk-FOCEI3TN.js.map +1 -0
- package/dist/{chunk-Y6E37WRG.js → chunk-GJPCP5CA.js} +2 -2
- package/dist/{chunk-IHMXPG4P.js → chunk-GQSMYXKL.js} +6 -4
- package/dist/{chunk-IHMXPG4P.js.map → chunk-GQSMYXKL.js.map} +1 -1
- package/dist/{chunk-TGQ2NTWH.js → chunk-IJ6WHMFB.js} +16 -2
- package/dist/{chunk-TGQ2NTWH.js.map → chunk-IJ6WHMFB.js.map} +1 -1
- package/dist/{chunk-VDX2J7OX.js → chunk-IPLYGWQF.js} +6 -6
- package/dist/{chunk-XNUBF6RF.js → chunk-IYT632D5.js} +3 -3
- package/dist/{chunk-2QSZNTDO.js → chunk-JBPKEARU.js} +7 -7
- package/dist/{chunk-67DSDRUB.js → chunk-JIF3VRKQ.js} +8 -8
- package/dist/{chunk-V25OWXAC.js → chunk-JQ7T5VDC.js} +1 -1
- package/dist/chunk-JQ7T5VDC.js.map +1 -0
- package/dist/{chunk-MIFF37NN.js → chunk-KKBTBUVT.js} +2 -2
- package/dist/{chunk-ZHP4SUPB.js → chunk-LIHC3T43.js} +2 -2
- package/dist/{chunk-PX7VDW7R.js → chunk-MJPV4LBH.js} +79 -79
- package/dist/{chunk-PX7VDW7R.js.map → chunk-MJPV4LBH.js.map} +1 -1
- package/dist/{chunk-UGH6VPPO.js → chunk-MWTMTW2T.js} +2 -2
- package/dist/{chunk-F6LSNPPB.js → chunk-MXJ3VP6S.js} +6 -6
- package/dist/{chunk-KPWLZBXZ.js → chunk-NBNDVNJ2.js} +186 -25
- package/dist/chunk-NBNDVNJ2.js.map +1 -0
- package/dist/{chunk-M5EPMNS4.js → chunk-P2CLYN6H.js} +2 -2
- package/dist/{chunk-7XXCIO6X.js → chunk-PXQM2HOG.js} +13 -6
- package/dist/{chunk-7XXCIO6X.js.map → chunk-PXQM2HOG.js.map} +1 -1
- package/dist/{chunk-UZK7VVPD.js → chunk-Q5VJUNXA.js} +1858 -272
- package/dist/chunk-Q5VJUNXA.js.map +1 -0
- package/dist/{chunk-KGTD2KZJ.js → chunk-Q6YJW6KE.js} +2 -2
- package/dist/{chunk-X3SQYAPP.js → chunk-R372P2EH.js} +2 -2
- package/dist/{chunk-HBVOJNV4.js → chunk-RKXZ7P4V.js} +3 -3
- package/dist/chunk-RMMVQQA6.js +70 -0
- package/dist/chunk-RMMVQQA6.js.map +1 -0
- package/dist/{chunk-E6EAB4J6.js → chunk-S24E4MBQ.js} +14 -14
- package/dist/chunk-S24E4MBQ.js.map +1 -0
- package/dist/{chunk-RYHWZ52A.js → chunk-S2BBISHU.js} +4 -4
- package/dist/{chunk-LLISELSY.js → chunk-TBMRQZDY.js} +2 -2
- package/dist/{chunk-FMLKOL2Z.js → chunk-TC3VNKGX.js} +4 -4
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-2XP3PWL3.js → chunk-UR5SIN7H.js} +53 -35
- package/dist/chunk-UR5SIN7H.js.map +1 -0
- package/dist/{chunk-NKDVXEFU.js → chunk-VFNI3RPT.js} +2 -2
- package/dist/chunk-VNA7W7QF.js +134 -0
- package/dist/chunk-VNA7W7QF.js.map +1 -0
- package/dist/{chunk-PQPSZICJ.js → chunk-VYYNBJXH.js} +5 -5
- package/dist/chunk-WNIUPHWV.js +152 -0
- package/dist/chunk-WNIUPHWV.js.map +1 -0
- package/dist/chunk-WRJVB3C2.js +118 -0
- package/dist/chunk-WRJVB3C2.js.map +1 -0
- package/dist/{chunk-SN3ZESWQ.js → chunk-WVVK2RFM.js} +6 -6
- package/dist/{chunk-DQEMWVMT.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-4KKV7W62.js → chunk-YOBNCD3Z.js} +6 -6
- package/dist/chunk-YXZG5TVN.js +40 -0
- package/dist/chunk-YXZG5TVN.js.map +1 -0
- package/dist/{chunk-4DJQYKMN.js → chunk-ZIKENA2C.js} +2 -2
- package/dist/chunk-ZIKENA2C.js.map +1 -0
- package/dist/{chunk-SK3EYPKC.js → chunk-ZN4UZWMT.js} +2 -2
- package/dist/{cli-BoouX6LX.d.ts → cli-DJbkaZBU.d.ts} +5 -5
- package/dist/cli.d.ts +14 -12
- package/dist/cli.js +79 -74
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +12 -10
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +12 -10
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +12 -10
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/contradiction/index.d.ts +3 -2
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +15 -2
- package/dist/corpus-watermark.js +25 -21
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-id-normalization.d.ts +4 -0
- package/dist/entity-id-normalization.js +10 -0
- package/dist/entity-id-normalization.js.map +1 -0
- package/dist/entity-retrieval-boundaries.d.ts +3 -0
- package/dist/entity-retrieval-boundaries.js +8 -0
- package/dist/entity-retrieval-boundaries.js.map +1 -0
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +13 -10
- package/dist/entity-schema.d.ts +1 -1
- package/dist/entity-schema.js +1 -1
- package/dist/explicit-capture.d.ts +9 -8
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-LEXL3XYL.js → first-start-migration-BKNGOFED.js} +4 -4
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +409 -407
- package/dist/index.js +147 -141
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +9 -9
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +12 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +12 -10
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +13 -11
- package/dist/{maintenance-DD22oIx9.d.ts → maintenance-DveW6azo.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +13 -10
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-mutations.d.ts +4 -0
- package/dist/memory-projection-mutations.js +15 -0
- package/dist/memory-projection-mutations.js.map +1 -0
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +22 -20
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +12 -10
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/offline-sync-impression-drain.js +3 -3
- package/dist/operator-doctor-corpus.d.ts +22 -3
- package/dist/operator-doctor-corpus.js +32 -22
- package/dist/operator-doctor-replica.d.ts +52 -0
- package/dist/operator-doctor-replica.js +15 -0
- package/dist/operator-doctor-replica.js.map +1 -0
- package/dist/operator-toolkit.d.ts +7 -3
- package/dist/operator-toolkit.js +33 -27
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +17 -15
- package/dist/{orchestrator-CFJ_TG6D.d.ts → orchestrator-Cvlgpe6I.d.ts} +7 -7
- package/dist/orchestrator.d.ts +9 -8
- package/dist/orchestrator.js +99 -93
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-Bq5zU6Bp.d.ts → pipeline-BveYVaz7.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{qmd-3ILJkC70.d.ts → qmd-CLWDsbYR.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-state.js +2 -2
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +279 -0
- package/dist/replica-divergence.js +28 -0
- package/dist/replica-divergence.js.map +1 -0
- package/dist/replica-peers-config.d.ts +5 -0
- package/dist/replica-peers-config.js +13 -0
- package/dist/replica-peers-config.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +21 -2
- package/dist/resolve-auth-token.js +5 -1
- package/dist/resume-bundles.js +5 -3
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/schemas.d.ts +76 -76
- package/dist/{scope-profiles-D0-ff4xT.d.ts → scope-profiles-BVf3DZ7z.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-4Tfh7c1g.d.ts → semantic-consolidation-DXLV47y2.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +13 -11
- package/dist/semantic-rule-promotion.js +12 -10
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +12 -10
- package/dist/{service-Z8uzoAST.d.ts → service-DbgPTeMJ.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +9 -9
- package/dist/signal.d.ts +1 -1
- package/dist/{storage-BZVMn8yJ.d.ts → storage-DOzTm8wG.d.ts} +13 -22
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +13 -10
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +3 -3
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/types.d.ts +66 -66
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-DHBxIF0s.d.ts → types-BA7W-_xy.d.ts} +53 -4
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +12 -10
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/access-health-types.ts +8 -0
- package/src/access-http.test.ts +4 -0
- package/src/access-service-health.test.ts +23 -0
- package/src/access-service.ts +27 -4
- package/src/cli.ts +9 -7
- package/src/config.ts +2 -1
- package/src/corpus-watermark.test.ts +21 -0
- package/src/corpus-watermark.ts +25 -3
- package/src/entity-id-normalization.ts +55 -0
- package/src/entity-retrieval-boundaries.ts +134 -0
- package/src/entity-retrieval.ts +253 -27
- package/src/entity-schema.ts +2 -1
- package/src/memory-projection-mutations.ts +132 -0
- package/src/namespaces/storage.ts +5 -3
- package/src/operator-doctor-corpus.ts +41 -0
- package/src/operator-doctor-replica.test.ts +261 -0
- package/src/operator-doctor-replica.ts +129 -0
- package/src/operator-toolkit.ts +5 -4
- package/src/orchestration/orchestrator-init.ts +2 -2
- package/src/replica-divergence.test.ts +1475 -0
- package/src/replica-divergence.ts +910 -0
- package/src/replica-peers-config.ts +250 -0
- package/src/resolve-auth-token.ts +38 -0
- package/src/storage/entity-canonical-id-migration-adapter.ts +72 -0
- package/src/storage/entity-canonical-id-migration-runner.ts +68 -0
- package/src/storage/entity-canonical-id-migration.ts +904 -0
- package/src/storage/entity-store.ts +44 -0
- package/src/storage/memory-frontmatter-metadata.ts +17 -0
- package/src/storage/memory-migration-serialization.ts +37 -0
- package/src/storage/memory-read-store.ts +3 -2
- package/src/storage/profile-header.ts +898 -0
- package/src/storage-profile-timestamp.test.ts +3358 -0
- package/src/storage.ts +73 -77
- package/src/testing/subjects/profile-header-write.test.ts +71 -0
- package/src/types.ts +3 -3
- package/dist/chunk-2XP3PWL3.js.map +0 -1
- package/dist/chunk-4DJQYKMN.js.map +0 -1
- package/dist/chunk-E6EAB4J6.js.map +0 -1
- package/dist/chunk-EXM2Q555.js.map +0 -1
- package/dist/chunk-GJJBPI6I.js.map +0 -1
- package/dist/chunk-KPWLZBXZ.js.map +0 -1
- package/dist/chunk-LIIQPDFN.js.map +0 -1
- package/dist/chunk-UZK7VVPD.js.map +0 -1
- package/dist/chunk-V25OWXAC.js.map +0 -1
- package/dist/chunk-YN4AUGNF.js.map +0 -1
- /package/dist/{capsule-crypto-YO5QJ6L3.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-7RZJWZ46.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-VGEH3STZ.js.map → chunk-2BEJ4XCF.js.map} +0 -0
- /package/dist/{chunk-BXLOS5AJ.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-6NNNURLK.js.map → chunk-2PHX3I5C.js.map} +0 -0
- /package/dist/{chunk-XAAIUXJO.js.map → chunk-3BSJBIZ3.js.map} +0 -0
- /package/dist/{chunk-JCVQV6QX.js.map → chunk-3UOSVTFR.js.map} +0 -0
- /package/dist/{chunk-AJ7QCSIS.js.map → chunk-7CPOZH6Y.js.map} +0 -0
- /package/dist/{chunk-M2KGXXTL.js.map → chunk-ALTP3MFS.js.map} +0 -0
- /package/dist/{chunk-77CNV7DY.js.map → chunk-BLAKS3CP.js.map} +0 -0
- /package/dist/{chunk-FE5FKTCI.js.map → chunk-BR4UFMLO.js.map} +0 -0
- /package/dist/{chunk-H2PBM562.js.map → chunk-DKQM5Q6Q.js.map} +0 -0
- /package/dist/{chunk-CSXHRAJJ.js.map → chunk-EG64LXKL.js.map} +0 -0
- /package/dist/{chunk-PTN6UAUA.js.map → chunk-ES36HTSC.js.map} +0 -0
- /package/dist/{chunk-WMDRLTNA.js.map → chunk-EZWWCN7I.js.map} +0 -0
- /package/dist/{chunk-XKGPIWGI.js.map → chunk-FBZTWUK5.js.map} +0 -0
- /package/dist/{chunk-Y6E37WRG.js.map → chunk-GJPCP5CA.js.map} +0 -0
- /package/dist/{chunk-VDX2J7OX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-XNUBF6RF.js.map → chunk-IYT632D5.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-67DSDRUB.js.map → chunk-JIF3VRKQ.js.map} +0 -0
- /package/dist/{chunk-MIFF37NN.js.map → chunk-KKBTBUVT.js.map} +0 -0
- /package/dist/{chunk-ZHP4SUPB.js.map → chunk-LIHC3T43.js.map} +0 -0
- /package/dist/{chunk-UGH6VPPO.js.map → chunk-MWTMTW2T.js.map} +0 -0
- /package/dist/{chunk-F6LSNPPB.js.map → chunk-MXJ3VP6S.js.map} +0 -0
- /package/dist/{chunk-M5EPMNS4.js.map → chunk-P2CLYN6H.js.map} +0 -0
- /package/dist/{chunk-KGTD2KZJ.js.map → chunk-Q6YJW6KE.js.map} +0 -0
- /package/dist/{chunk-X3SQYAPP.js.map → chunk-R372P2EH.js.map} +0 -0
- /package/dist/{chunk-HBVOJNV4.js.map → chunk-RKXZ7P4V.js.map} +0 -0
- /package/dist/{chunk-RYHWZ52A.js.map → chunk-S2BBISHU.js.map} +0 -0
- /package/dist/{chunk-LLISELSY.js.map → chunk-TBMRQZDY.js.map} +0 -0
- /package/dist/{chunk-FMLKOL2Z.js.map → chunk-TC3VNKGX.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-NKDVXEFU.js.map → chunk-VFNI3RPT.js.map} +0 -0
- /package/dist/{chunk-PQPSZICJ.js.map → chunk-VYYNBJXH.js.map} +0 -0
- /package/dist/{chunk-SN3ZESWQ.js.map → chunk-WVVK2RFM.js.map} +0 -0
- /package/dist/{chunk-DQEMWVMT.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-4KKV7W62.js.map → chunk-YOBNCD3Z.js.map} +0 -0
- /package/dist/{chunk-SK3EYPKC.js.map → chunk-ZN4UZWMT.js.map} +0 -0
- /package/dist/{first-start-migration-LEXL3XYL.js.map → first-start-migration-BKNGOFED.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReplayNormalizer } from '../types.js';
|
|
2
2
|
import '../../message-parts/index.js';
|
|
3
|
-
import '../../types-
|
|
3
|
+
import '../../types-BA7W-_xy.js';
|
|
4
4
|
import '../../bounded-jsonl-state.js';
|
|
5
5
|
import '../../operator-doctor-types.js';
|
|
6
6
|
import '../../types-continuity.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReplayNormalizer } from '../types.js';
|
|
2
2
|
import '../../message-parts/index.js';
|
|
3
|
-
import '../../types-
|
|
3
|
+
import '../../types-BA7W-_xy.js';
|
|
4
4
|
import '../../bounded-jsonl-state.js';
|
|
5
5
|
import '../../operator-doctor-types.js';
|
|
6
6
|
import '../../types-continuity.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReplayRole } from '../types.js';
|
|
2
2
|
import '../../message-parts/index.js';
|
|
3
|
-
import '../../types-
|
|
3
|
+
import '../../types-BA7W-_xy.js';
|
|
4
4
|
import '../../bounded-jsonl-state.js';
|
|
5
5
|
import '../../operator-doctor-types.js';
|
|
6
6
|
import '../../types-continuity.js';
|
package/dist/replay/runner.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReplaySource, ReplayWarning, ReplayNormalizer, ReplayTurn, ReplayParseOptions } from './types.js';
|
|
2
2
|
import '../message-parts/index.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-BA7W-_xy.js';
|
|
4
4
|
import '../bounded-jsonl-state.js';
|
|
5
5
|
import '../operator-doctor-types.js';
|
|
6
6
|
import '../types-continuity.js';
|
package/dist/replay/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LcmMessagePartInput, MessagePartSourceFormat } from '../message-parts/index.js';
|
|
2
|
-
import { n as SourceConnectorProvenance } from '../types-
|
|
2
|
+
import { n as SourceConnectorProvenance } from '../types-BA7W-_xy.js';
|
|
3
3
|
import '../bounded-jsonl-state.js';
|
|
4
4
|
import '../operator-doctor-types.js';
|
|
5
5
|
import '../types-continuity.js';
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { TokenCapabilities } from './access-token-capabilities.js';
|
|
2
|
+
import { CorpusWatermark } from './corpus-watermark.js';
|
|
3
|
+
import { Y as ReplicaPeersConfig, Z as ReplicaPeerConfig } from './types-BA7W-_xy.js';
|
|
4
|
+
import { ResolveSecretRefFn } from './resolve-auth-token.js';
|
|
5
|
+
import 'node:async_hooks';
|
|
6
|
+
import './message-parts/index.js';
|
|
7
|
+
import './bounded-jsonl-state.js';
|
|
8
|
+
import './operator-doctor-types.js';
|
|
9
|
+
import './types-continuity.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Replica divergence detection (issue #2149).
|
|
13
|
+
*
|
|
14
|
+
* The corpus-watermark primitive (corpus-watermark.ts, PR #2156) gives each
|
|
15
|
+
* daemon a cheap, comparable fingerprint of its own memory corpus. This module
|
|
16
|
+
* is the OTHER half the issue asks for: a daemon configured with peer URLs polls
|
|
17
|
+
* each peer's authenticated `/health`, compares the peer's watermark set against
|
|
18
|
+
* the local one PER NAMESPACE, and reports drift (file-count delta, watermark
|
|
19
|
+
* age delta, digest mismatch) so a months-long silent split-brain becomes a
|
|
20
|
+
* same-day alert. Detection ONLY — reconciliation is issue #2150.
|
|
21
|
+
*
|
|
22
|
+
* Design invariants (from AGENTS.md review-prevention patterns):
|
|
23
|
+
* - §22 error-result conflation: a peer that times out / refuses / returns
|
|
24
|
+
* non-2xx / omits `corpus` is a DISTINCT `unreachable`/`unknown` state, never
|
|
25
|
+
* folded into `converged`. A monitor must tell "peer agrees" from "we could
|
|
26
|
+
* not ask". The outcome is a discriminated union, not a boolean + empty array.
|
|
27
|
+
* - §5 state scoping: poll state lives on a per-instance {@link
|
|
28
|
+
* ReplicaDivergenceMonitor}, never a bare module global.
|
|
29
|
+
* - §1/§17/§24/§39 input validation: {@link parseReplicaPeersConfig} rejects
|
|
30
|
+
* invalid input (bad url, non-array peers, fractional/non-positive intervals)
|
|
31
|
+
* rather than silently defaulting, and coerces string booleans/numbers.
|
|
32
|
+
* - Peer tokens are secrets: resolved through the SAME `resolveAgentAccessAuthToken`
|
|
33
|
+
* indirection as `agentAccessHttp.authToken`, NEVER logged, NEVER echoed into a
|
|
34
|
+
* report/health/doctor payload. Peer identity is redacted to `host:port`
|
|
35
|
+
* (userinfo/path/query stripped) so a credential embedded in a URL cannot leak.
|
|
36
|
+
* - Polling never runs inline on the health request path: it reuses the corpus
|
|
37
|
+
* stale-while-revalidate / single-flight idiom, serving the last result with
|
|
38
|
+
* its timestamp and refreshing in the background.
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/** Per-peer verdict. `unreachable`/`unknown` are NEVER conflated with `converged` (§22). */
|
|
42
|
+
type ReplicaPeerState = "converged" | "diverged" | "unreachable" | "unknown";
|
|
43
|
+
/** Whether a namespace is present on both sides, or only one (its own divergence outcome). */
|
|
44
|
+
type ReplicaNamespacePresence = "both" | "local_only" | "peer_only";
|
|
45
|
+
interface ReplicaNamespaceDelta {
|
|
46
|
+
namespace: string;
|
|
47
|
+
presence: ReplicaNamespacePresence;
|
|
48
|
+
localFileCount: number | null;
|
|
49
|
+
peerFileCount: number | null;
|
|
50
|
+
/** |local - peer| when present on both sides, else null. */
|
|
51
|
+
fileCountDelta: number | null;
|
|
52
|
+
localNewestWriteAt: string | null;
|
|
53
|
+
peerNewestWriteAt: string | null;
|
|
54
|
+
/** |local.newestWriteAt - peer.newestWriteAt| in ms when both are dated, else null. */
|
|
55
|
+
writeAgeDeltaMs: number | null;
|
|
56
|
+
/** local.digest === peer.digest when present on both sides, else null. */
|
|
57
|
+
digestMatch: boolean | null;
|
|
58
|
+
diverged: boolean;
|
|
59
|
+
/** Concrete, token-free reasons a namespace diverged (numbers included for the operator). */
|
|
60
|
+
reasons: string[];
|
|
61
|
+
}
|
|
62
|
+
interface ReplicaPeerReport {
|
|
63
|
+
/** Redacted `host:port` — never the token, never userinfo/path/query. */
|
|
64
|
+
peer: string;
|
|
65
|
+
state: ReplicaPeerState;
|
|
66
|
+
polledAt: string;
|
|
67
|
+
/**
|
|
68
|
+
* Per-namespace deltas. Empty only for a fetch-level `unreachable`/`unknown`
|
|
69
|
+
* (no comparison ran); a comparison that resolves to `unknown` (an ambiguous
|
|
70
|
+
* local-only namespace) still carries its deltas.
|
|
71
|
+
*/
|
|
72
|
+
namespaces: ReplicaNamespaceDelta[];
|
|
73
|
+
divergedNamespaceCount: number;
|
|
74
|
+
/** Stable reason code for a non-comparison state (e.g. "timeout", "http_500", "missing_corpus"). */
|
|
75
|
+
reason?: string;
|
|
76
|
+
}
|
|
77
|
+
/** Local watermark set plus whether every configured namespace was scanned. */
|
|
78
|
+
interface LocalCensus {
|
|
79
|
+
watermarks: CorpusWatermark[];
|
|
80
|
+
complete: boolean;
|
|
81
|
+
}
|
|
82
|
+
interface ReplicaDivergenceStatus {
|
|
83
|
+
enabled: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* False when the local corpus census dropped namespaces (a per-namespace scan
|
|
86
|
+
* failed, or enumeration was still warming). A peer can only be certified
|
|
87
|
+
* `converged` against a COMPLETE local set — otherwise an unscanned tenant
|
|
88
|
+
* never enters the comparison and its divergence is invisible. Mirrors the
|
|
89
|
+
* doctor check's `localCensusComplete` gate (round 4, cursor).
|
|
90
|
+
*/
|
|
91
|
+
censusComplete?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* True when the feature is enabled with peers configured but no poll has
|
|
94
|
+
* completed yet (warming, or a persistently failing local-watermark scan).
|
|
95
|
+
* Distinguishes that in-progress/failed state from the "enabled but no peers
|
|
96
|
+
* configured" case, which reports `pending: false` with an empty `peers` list
|
|
97
|
+
* (review round 1).
|
|
98
|
+
*/
|
|
99
|
+
pending: boolean;
|
|
100
|
+
/** ISO timestamp of the last completed poll cycle, or null when never polled / disabled. */
|
|
101
|
+
polledAt: string | null;
|
|
102
|
+
peers: ReplicaPeerReport[];
|
|
103
|
+
}
|
|
104
|
+
/** Discriminated fetch outcome — the heart of the §22 empty-vs-failed distinction. */
|
|
105
|
+
type PeerFetchOutcome = {
|
|
106
|
+
readonly kind: "ok";
|
|
107
|
+
readonly corpus: CorpusWatermark[];
|
|
108
|
+
} | {
|
|
109
|
+
readonly kind: "unreachable";
|
|
110
|
+
readonly reason: string;
|
|
111
|
+
} | {
|
|
112
|
+
readonly kind: "unknown";
|
|
113
|
+
readonly reason: string;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Compare a local watermark set against a peer's, per namespace. A namespace on
|
|
117
|
+
* only one side is its own outcome (never silently skipped):
|
|
118
|
+
* - `peer_only` is divergence — the peer holds data we lack.
|
|
119
|
+
* - `local_only` is AMBIGUOUS — a namespace-restricted peer token hides
|
|
120
|
+
* namespaces it cannot see (not divergence), but an unrestricted peer that
|
|
121
|
+
* genuinely lost the namespace omits it the SAME way, so it cannot be
|
|
122
|
+
* certified converged either. It resolves the peer to `unknown` (codex P1).
|
|
123
|
+
* Digest mismatch flags divergence ONLY at EQUAL total file counts — the same
|
|
124
|
+
* number of files distributed differently across `<tier>:<category>/<day>`
|
|
125
|
+
* buckets (a distribution split-brain). The digest hashes per-bucket COUNTS, so
|
|
126
|
+
* it does NOT catch two replicas whose buckets hold equal counts but different
|
|
127
|
+
* file contents. Any nonzero count delta already perturbs the digest, so
|
|
128
|
+
* flagging digest there too would make `maxFileCountDelta` unreachable (codex
|
|
129
|
+
* P2); within tolerance the count delta is the sole signal.
|
|
130
|
+
*/
|
|
131
|
+
declare function compareReplicaWatermarks(local: readonly CorpusWatermark[], peer: readonly CorpusWatermark[], thresholds: Pick<ReplicaPeersConfig, "maxFileCountDelta" | "maxWatermarkAgeDeltaMs">): {
|
|
132
|
+
state: "converged" | "diverged" | "unknown";
|
|
133
|
+
reason?: string;
|
|
134
|
+
namespaces: ReplicaNamespaceDelta[];
|
|
135
|
+
divergedNamespaceCount: number;
|
|
136
|
+
};
|
|
137
|
+
type FetchLike = (input: string, init?: {
|
|
138
|
+
headers?: Record<string, string>;
|
|
139
|
+
signal?: AbortSignal;
|
|
140
|
+
}) => Promise<{
|
|
141
|
+
ok: boolean;
|
|
142
|
+
status: number;
|
|
143
|
+
json(): Promise<unknown>;
|
|
144
|
+
/**
|
|
145
|
+
* Raw body stream when the transport exposes one (the global `fetch`
|
|
146
|
+
* Response does). Present so a peer payload can be size-bounded while it is
|
|
147
|
+
* read; a test double that omits it falls back to `json()`.
|
|
148
|
+
*/
|
|
149
|
+
body?: unknown;
|
|
150
|
+
}>;
|
|
151
|
+
/**
|
|
152
|
+
* Cap on a peer's `/health` payload. A configured peer is a trust boundary: a
|
|
153
|
+
* compromised or malfunctioning one could otherwise stream an unbounded corpus
|
|
154
|
+
* that `json()` buffers whole, and up to `maxConcurrent` peers are polled at
|
|
155
|
+
* once, so the exposure multiplies (round 7, codex P2). Generous enough for a
|
|
156
|
+
* fleet-sized namespace census, small enough that four of them cannot exhaust
|
|
157
|
+
* the daemon.
|
|
158
|
+
*/
|
|
159
|
+
declare const MAX_PEER_RESPONSE_BYTES: number;
|
|
160
|
+
interface FetchPeerOptions {
|
|
161
|
+
timeoutMs: number;
|
|
162
|
+
resolveSecretRef?: ResolveSecretRefFn | null;
|
|
163
|
+
/** Injectable for tests; defaults to global fetch. */
|
|
164
|
+
fetchImpl?: FetchLike;
|
|
165
|
+
/**
|
|
166
|
+
* Max age (ms) a peer census `computedAt` may reach before the peer is treated
|
|
167
|
+
* as `unknown`/`peer_census_stale` — a snapshot older than this predates
|
|
168
|
+
* changes it may not reflect, so it cannot certify convergence (round 6, codex
|
|
169
|
+
* P1). Reuses the caller's `maxWatermarkAgeDeltaMs`; when unset OR non-positive,
|
|
170
|
+
* no staleness gate is applied (a 0 bound is the strictest DIVERGENCE mode, not
|
|
171
|
+
* a 0ms freshness gate — round 6, cursor).
|
|
172
|
+
*/
|
|
173
|
+
maxCensusAgeMs?: number;
|
|
174
|
+
/** Wall clock (ms) the staleness gate measures `computedAt` against; defaults to now. */
|
|
175
|
+
nowMs?: number;
|
|
176
|
+
}
|
|
177
|
+
/** Redact a peer URL to `host:port` — strips userinfo/path/query so a credential in a URL cannot leak. */
|
|
178
|
+
declare function redactPeerUrl(url: string): string;
|
|
179
|
+
/**
|
|
180
|
+
* Fetch a peer's authenticated `/health` corpus with a bounded timeout, trying
|
|
181
|
+
* the remnic prefix then the legacy engram prefix. Never throws — every failure
|
|
182
|
+
* mode maps to a discriminated `unreachable`/`unknown` outcome (§22).
|
|
183
|
+
*/
|
|
184
|
+
declare function fetchPeerWatermarks(peer: ReplicaPeerConfig, options: FetchPeerOptions): Promise<PeerFetchOutcome>;
|
|
185
|
+
interface PollReplicaPeersOptions {
|
|
186
|
+
config: ReplicaPeersConfig;
|
|
187
|
+
localWatermarks: readonly CorpusWatermark[];
|
|
188
|
+
now?: Date;
|
|
189
|
+
resolveSecretRef?: ResolveSecretRefFn | null;
|
|
190
|
+
fetchImpl?: FetchLike;
|
|
191
|
+
maxConcurrent?: number;
|
|
192
|
+
/** Optional sink for a single deduped warn line per non-converged poll cycle (never contains tokens). */
|
|
193
|
+
log?: (line: string) => void;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Poll every configured peer once, compare each against the local watermark set,
|
|
197
|
+
* and assemble a report. Disabled or peerless → no network at all (returns an
|
|
198
|
+
* empty report). Never throws: a single peer failure degrades only that peer.
|
|
199
|
+
*/
|
|
200
|
+
declare function pollReplicaPeers(options: PollReplicaPeersOptions): Promise<ReplicaDivergenceStatus>;
|
|
201
|
+
/**
|
|
202
|
+
* Filter a full report to a presenting token's namespace capabilities, exactly
|
|
203
|
+
* as the corpus `/health` field is filtered (issue #2156 finding B): a
|
|
204
|
+
* namespace-restricted token must not learn about namespaces it cannot see. A
|
|
205
|
+
* peer's reachability state carries no namespace data and is preserved; a
|
|
206
|
+
* comparison peer's visible state is recomputed from its visible deltas so
|
|
207
|
+
* divergence in a hidden namespace never leaks as a "diverged" verdict. The
|
|
208
|
+
* census gate is then re-applied to the FILTERED view: filtering can hide a real
|
|
209
|
+
* shared divergence and leave a peer_only delta that must not read as a false
|
|
210
|
+
* split-brain to a restricted caller under an incomplete census (round 6, codex).
|
|
211
|
+
*/
|
|
212
|
+
declare function filterReplicaReportByCaps(report: ReplicaDivergenceStatus, caps: TokenCapabilities | null | undefined): ReplicaDivergenceStatus;
|
|
213
|
+
/**
|
|
214
|
+
* Overlay the LOCAL-census half of the certification rule onto a whole report:
|
|
215
|
+
* a peer is `converged` only when the local census scanned EVERY configured
|
|
216
|
+
* namespace — a dropped local tenant never enters the comparison, so its
|
|
217
|
+
* divergence would be invisible (round 4). Applied identically by the
|
|
218
|
+
* background monitor (/health) and `summarizeReplicaDivergence` (doctor) so the
|
|
219
|
+
* two surfaces cannot disagree about an incomplete census (round 6). Under an
|
|
220
|
+
* incomplete census every `peer_only` delta is NEUTRALIZED (an incomplete local
|
|
221
|
+
* scan cannot tell a namespace we genuinely lack from one we merely failed to
|
|
222
|
+
* read — a false split-brain), so it stops counting as divergence. A peer then
|
|
223
|
+
* stays `diverged` ONLY if a REAL shared-namespace divergence remains; otherwise
|
|
224
|
+
* (converged, or peer_only-only) it is `unknown`/`local_census_incomplete`.
|
|
225
|
+
* unreachable/unknown already carry a truthful state and stand.
|
|
226
|
+
*/
|
|
227
|
+
declare function gateReportByCensus(report: ReplicaDivergenceStatus, censusComplete: boolean): ReplicaDivergenceStatus;
|
|
228
|
+
interface ReplicaDivergenceMonitorOptions {
|
|
229
|
+
clock?: () => number;
|
|
230
|
+
resolveSecretRef?: ResolveSecretRefFn | null;
|
|
231
|
+
fetchImpl?: FetchLike;
|
|
232
|
+
maxConcurrent?: number;
|
|
233
|
+
log?: (line: string) => void;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Instance-scoped (§5) stale-while-revalidate monitor of peer divergence. {@link
|
|
237
|
+
* getReport} NEVER awaits the poll: it returns the last completed report (stale
|
|
238
|
+
* allowed, or a never-polled placeholder) and single-flights a background poll
|
|
239
|
+
* when the entry is missing or older than `pollIntervalMs`. So a `/health` probe
|
|
240
|
+
* is always O(1) and polling never runs inline on the request path. Disabled or
|
|
241
|
+
* peerless config short-circuits with zero network work.
|
|
242
|
+
*/
|
|
243
|
+
declare class ReplicaDivergenceMonitor {
|
|
244
|
+
private cached;
|
|
245
|
+
/** Earliest clock() at which a failed poll may retry — enforces backoff (round 6). */
|
|
246
|
+
private nextAttemptAt;
|
|
247
|
+
private inFlight;
|
|
248
|
+
private readonly clock;
|
|
249
|
+
private readonly resolveSecretRef;
|
|
250
|
+
private readonly fetchImpl;
|
|
251
|
+
private readonly maxConcurrent;
|
|
252
|
+
private readonly log;
|
|
253
|
+
constructor(options?: ReplicaDivergenceMonitorOptions);
|
|
254
|
+
getReport(input: {
|
|
255
|
+
/**
|
|
256
|
+
* Raw `replicaPeers` block. An absent/partial/loosely-typed block (a host
|
|
257
|
+
* adapter or an older persisted config that bypassed `parseConfig`) resolves
|
|
258
|
+
* to the documented default — disabled, no peers, no polling — so `/health`
|
|
259
|
+
* stays answerable instead of throwing (issue #2155 read-boundary pattern).
|
|
260
|
+
*/
|
|
261
|
+
config: ReplicaPeersConfig | undefined;
|
|
262
|
+
/** Fresh local watermark set for comparison; invoked only during a background refresh. */
|
|
263
|
+
computeLocalWatermarks: () => Promise<LocalCensus>;
|
|
264
|
+
caps?: TokenCapabilities | null;
|
|
265
|
+
/**
|
|
266
|
+
* Completeness of the census THIS request is presenting alongside the
|
|
267
|
+
* report. A cached poll was gated by the census that existed when it ran,
|
|
268
|
+
* so a since-degraded scan could ship `converged` peers next to an
|
|
269
|
+
* incomplete corpus (round 9, cursor). Gating on the way out keeps the one
|
|
270
|
+
* response self-consistent without poisoning the shared cache.
|
|
271
|
+
*/
|
|
272
|
+
localCensusComplete?: boolean;
|
|
273
|
+
}): ReplicaDivergenceStatus;
|
|
274
|
+
private refresh;
|
|
275
|
+
/** Await any in-flight background poll (deterministic tests / shutdown). */
|
|
276
|
+
whenIdle(): Promise<void>;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export { type FetchLike, type FetchPeerOptions, type LocalCensus, MAX_PEER_RESPONSE_BYTES, type PeerFetchOutcome, type PollReplicaPeersOptions, ReplicaDivergenceMonitor, type ReplicaDivergenceMonitorOptions, type ReplicaDivergenceStatus, type ReplicaNamespaceDelta, type ReplicaNamespacePresence, type ReplicaPeerReport, type ReplicaPeerState, compareReplicaWatermarks, fetchPeerWatermarks, filterReplicaReportByCaps, gateReportByCensus, pollReplicaPeers, redactPeerUrl };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAX_PEER_RESPONSE_BYTES,
|
|
3
|
+
ReplicaDivergenceMonitor,
|
|
4
|
+
compareReplicaWatermarks,
|
|
5
|
+
fetchPeerWatermarks,
|
|
6
|
+
filterReplicaReportByCaps,
|
|
7
|
+
gateReportByCensus,
|
|
8
|
+
pollReplicaPeers,
|
|
9
|
+
redactPeerUrl
|
|
10
|
+
} from "./chunk-CVILPI77.js";
|
|
11
|
+
import "./chunk-WNIUPHWV.js";
|
|
12
|
+
import "./chunk-IJ6WHMFB.js";
|
|
13
|
+
import "./chunk-PQVCH2AE.js";
|
|
14
|
+
import "./chunk-MZWSOLMT.js";
|
|
15
|
+
import "./chunk-2Z24E5W2.js";
|
|
16
|
+
import "./chunk-3WCASNQZ.js";
|
|
17
|
+
import "./chunk-PZ5AY32C.js";
|
|
18
|
+
export {
|
|
19
|
+
MAX_PEER_RESPONSE_BYTES,
|
|
20
|
+
ReplicaDivergenceMonitor,
|
|
21
|
+
compareReplicaWatermarks,
|
|
22
|
+
fetchPeerWatermarks,
|
|
23
|
+
filterReplicaReportByCaps,
|
|
24
|
+
gateReportByCensus,
|
|
25
|
+
pollReplicaPeers,
|
|
26
|
+
redactPeerUrl
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=replica-divergence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Z as ReplicaPeerConfig, Y as ReplicaPeersConfig, c7 as parseReplicaPeersConfig, c8 as resolveReplicaPeersConfig } from './types-BA7W-_xy.js';
|
|
2
|
+
import './message-parts/index.js';
|
|
3
|
+
import './bounded-jsonl-state.js';
|
|
4
|
+
import './operator-doctor-types.js';
|
|
5
|
+
import './types-continuity.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseReplicaPeersConfig,
|
|
3
|
+
resolveReplicaPeersConfig
|
|
4
|
+
} from "./chunk-WNIUPHWV.js";
|
|
5
|
+
import "./chunk-IJ6WHMFB.js";
|
|
6
|
+
import "./chunk-PQVCH2AE.js";
|
|
7
|
+
import "./chunk-3WCASNQZ.js";
|
|
8
|
+
import "./chunk-PZ5AY32C.js";
|
|
9
|
+
export {
|
|
10
|
+
parseReplicaPeersConfig,
|
|
11
|
+
resolveReplicaPeersConfig
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=replica-peers-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as SecretRef, t as AgentAccessAuthToken } from './types-BA7W-_xy.js';
|
|
2
2
|
import './message-parts/index.js';
|
|
3
3
|
import './bounded-jsonl-state.js';
|
|
4
4
|
import './operator-doctor-types.js';
|
|
@@ -51,5 +51,24 @@ declare function resolveAgentAccessAuthToken(value: AgentAccessAuthToken | undef
|
|
|
51
51
|
declare function isAgentAccessSecretRef(value: unknown): value is SecretRef;
|
|
52
52
|
/** Test/operations hook: drop the cache and force resolver rediscovery. */
|
|
53
53
|
declare function clearAuthTokenSecretCache(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve a host SecretRef resolver, preferring an explicitly supplied one over
|
|
56
|
+
* the lazy loader.
|
|
57
|
+
*
|
|
58
|
+
* Shared by every CLI command that authenticates with a SecretRef — `access
|
|
59
|
+
* serve` and `doctor` (replica peer tokens, issue #2149) — so the two cannot
|
|
60
|
+
* drift. Structurally typed rather than importing the CLI's options type, which
|
|
61
|
+
* would invert the dependency.
|
|
62
|
+
*/
|
|
63
|
+
declare function loadHostSecretRefResolver(options: {
|
|
64
|
+
resolveSecretRef?: ResolveSecretRefFn | null;
|
|
65
|
+
loadResolveSecretRef?: () => Promise<ResolveSecretRefFn | null | undefined> | ResolveSecretRefFn | null | undefined;
|
|
66
|
+
}): Promise<ResolveSecretRefFn | null | undefined>;
|
|
67
|
+
/**
|
|
68
|
+
* Adapt a host's lazily-loaded SecretRef resolver into the eager
|
|
69
|
+
* `ResolveSecretRefFn` that `EngramAccessService` expects, so replica peer
|
|
70
|
+
* tokens resolve at poll time (issue #2149).
|
|
71
|
+
*/
|
|
72
|
+
declare function hostSecretRefResolver(options: Parameters<typeof loadHostSecretRefResolver>[0]): ResolveSecretRefFn;
|
|
54
73
|
|
|
55
|
-
export { type ResolveSecretRefFn, clearAuthTokenSecretCache, isAgentAccessSecretRef, resolveAgentAccessAuthToken };
|
|
74
|
+
export { type ResolveSecretRefFn, clearAuthTokenSecretCache, hostSecretRefResolver, isAgentAccessSecretRef, loadHostSecretRefResolver, resolveAgentAccessAuthToken };
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clearAuthTokenSecretCache,
|
|
3
|
+
hostSecretRefResolver,
|
|
3
4
|
isAgentAccessSecretRef,
|
|
5
|
+
loadHostSecretRefResolver,
|
|
4
6
|
resolveAgentAccessAuthToken
|
|
5
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IJ6WHMFB.js";
|
|
6
8
|
import "./chunk-PZ5AY32C.js";
|
|
7
9
|
export {
|
|
8
10
|
clearAuthTokenSecretCache,
|
|
11
|
+
hostSecretRefResolver,
|
|
9
12
|
isAgentAccessSecretRef,
|
|
13
|
+
loadHostSecretRefResolver,
|
|
10
14
|
resolveAgentAccessAuthToken
|
|
11
15
|
};
|
|
12
16
|
//# sourceMappingURL=resolve-auth-token.js.map
|
package/dist/resume-bundles.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
recordResumeBundle,
|
|
5
5
|
resolveResumeBundleDir,
|
|
6
6
|
validateResumeBundle
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TBMRQZDY.js";
|
|
8
8
|
import "./chunk-ZRWB5D4H.js";
|
|
9
9
|
import "./chunk-HYQJQGD3.js";
|
|
10
10
|
import "./chunk-KFY3SGN7.js";
|
|
11
11
|
import "./chunk-LMDRGRJ2.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FOCEI3TN.js";
|
|
13
13
|
import "./chunk-NDAH7BJ5.js";
|
|
14
14
|
import "./chunk-7RAJ3GXO.js";
|
|
15
15
|
import "./chunk-Z5LAYHGJ.js";
|
|
@@ -22,10 +22,12 @@ import "./chunk-KFZY2OFH.js";
|
|
|
22
22
|
import "./chunk-S4DDLTPX.js";
|
|
23
23
|
import "./chunk-6HMYUWXR.js";
|
|
24
24
|
import "./chunk-P32IDSHD.js";
|
|
25
|
+
import "./chunk-WNIUPHWV.js";
|
|
26
|
+
import "./chunk-IJ6WHMFB.js";
|
|
25
27
|
import "./chunk-443XCR34.js";
|
|
26
28
|
import "./chunk-5I4M26Q7.js";
|
|
29
|
+
import "./chunk-ZIKENA2C.js";
|
|
27
30
|
import "./chunk-5GKPFL3S.js";
|
|
28
|
-
import "./chunk-4DJQYKMN.js";
|
|
29
31
|
import "./chunk-PQVCH2AE.js";
|
|
30
32
|
import "./chunk-EYIEWJNI.js";
|
|
31
33
|
import "./chunk-JUC24CTX.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Q as QmdSearchResult } from './types-
|
|
2
|
-
import { Q as QmdClient } from './qmd-
|
|
1
|
+
import { Q as QmdSearchResult } from './types-BA7W-_xy.js';
|
|
2
|
+
import { Q as QmdClient } from './qmd-CLWDsbYR.js';
|
|
3
3
|
import './message-parts/index.js';
|
|
4
4
|
import './bounded-jsonl-state.js';
|
|
5
5
|
import './operator-doctor-types.js';
|
package/dist/routing/engine.d.ts
CHANGED
package/dist/routing/store.d.ts
CHANGED