@remnic/core 9.3.716 → 9.3.718
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-boundary.d.ts +5 -5
- package/dist/access-boundary.js +10 -9
- package/dist/access-cli.js +26 -25
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +14 -13
- package/dist/access-mcp.d.ts +5 -5
- package/dist/access-mcp.js +13 -12
- package/dist/access-operations-batch.js +11 -10
- package/dist/access-operations.d.ts +5 -5
- package/dist/access-operations.js +12 -11
- package/dist/{access-service-BW8cm_uU.d.ts → access-service-CZbnt0t2.d.ts} +4 -4
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +9 -8
- package/dist/access-surface-catalog.d.ts +5 -5
- 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 +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing.d.ts +3 -1
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-CbR0CsUw.d.ts → catalog-CEYlMs9X.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 +4 -4
- package/dist/{chunk-JEIROMLX.js → chunk-2COL35PK.js} +95 -9
- package/dist/chunk-2COL35PK.js.map +1 -0
- package/dist/{chunk-XZTUMWKQ.js → chunk-2PTBLS2S.js} +2 -2
- package/dist/{chunk-2Y6LMOQQ.js → chunk-2VHMVWPU.js} +2 -2
- package/dist/{chunk-6UU43ZGD.js → chunk-4KZGLDJJ.js} +2 -2
- package/dist/{chunk-K44MIN6D.js → chunk-5RHM43BJ.js} +3 -3
- package/dist/{chunk-MECU6WSH.js → chunk-72VDBALG.js} +18 -18
- package/dist/{chunk-UY4JMEAK.js → chunk-7EEVXW7X.js} +2 -2
- package/dist/{chunk-XCTDHF7U.js → chunk-A5TUPZ3N.js} +33 -1
- package/dist/chunk-A5TUPZ3N.js.map +1 -0
- package/dist/{chunk-WI4QX7GH.js → chunk-A66YRSOS.js} +2 -2
- package/dist/{chunk-CTAHKIG6.js → chunk-ANI5DUAE.js} +10 -8
- package/dist/{chunk-CTAHKIG6.js.map → chunk-ANI5DUAE.js.map} +1 -1
- package/dist/{chunk-O62P2LFL.js → chunk-APUJIMDM.js} +2 -2
- package/dist/{chunk-MPHDVHIB.js → chunk-DIFU33GU.js} +2 -2
- package/dist/{chunk-DXGS5YOQ.js → chunk-EH27LHML.js} +2 -2
- package/dist/{chunk-BNOAB5HH.js → chunk-F3PVXKHP.js} +78 -1442
- package/dist/chunk-F3PVXKHP.js.map +1 -0
- package/dist/{chunk-6QUPUTT7.js → chunk-HLIR3RJ7.js} +6 -10
- package/dist/{chunk-6QUPUTT7.js.map → chunk-HLIR3RJ7.js.map} +1 -1
- package/dist/{chunk-SHRRWOVY.js → chunk-J6BH2OBA.js} +64 -21
- package/dist/chunk-J6BH2OBA.js.map +1 -0
- package/dist/{chunk-6FUJ2VYY.js → chunk-JAKYZGV4.js} +3 -3
- package/dist/{chunk-3VUPWDSE.js → chunk-JIZGYQYH.js} +4 -4
- package/dist/{chunk-QOIONSOI.js → chunk-KRGC4EDX.js} +2 -2
- package/dist/{chunk-AJOIM6UR.js → chunk-L5ASZA2F.js} +2 -2
- package/dist/{chunk-I56LKMF7.js → chunk-LXSG4L55.js} +2 -2
- package/dist/{chunk-MSVSP5VO.js → chunk-N3DUH6OO.js} +1 -1
- package/dist/chunk-N3DUH6OO.js.map +1 -0
- package/dist/{chunk-SQ4LU27I.js → chunk-NFRBADNR.js} +195 -80
- package/dist/chunk-NFRBADNR.js.map +1 -0
- package/dist/chunk-OJU73BUX.js +1688 -0
- package/dist/chunk-OJU73BUX.js.map +1 -0
- package/dist/{chunk-JVEMUX6L.js → chunk-OZ2KQ7HF.js} +2 -2
- package/dist/{chunk-SYDHFFAW.js → chunk-P5IPFZVH.js} +5 -5
- package/dist/{chunk-GM3BMWKR.js → chunk-REWQAFSA.js} +2 -2
- package/dist/{chunk-V7GDTQ6I.js → chunk-S35FX6MU.js} +2 -2
- package/dist/{chunk-MTHNJCOJ.js → chunk-S3OPGGZB.js} +2 -2
- package/dist/{chunk-IHMT6XTY.js → chunk-U5H7WHTS.js} +6 -4
- package/dist/{chunk-IHMT6XTY.js.map → chunk-U5H7WHTS.js.map} +1 -1
- package/dist/{chunk-RBHANGVX.js → chunk-UCJ5CDTK.js} +6 -6
- package/dist/{chunk-HHLWSWWF.js → chunk-URM3HW2R.js} +2 -2
- package/dist/{chunk-VO4UICII.js → chunk-YTZLBBEB.js} +2 -2
- package/dist/{chunk-OC56UWV5.js → chunk-YYOK4GVF.js} +2 -2
- package/dist/{cli-Dpivy32W.d.ts → cli-1orcdXOY.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +28 -27
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +3 -3
- 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 +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +3 -3
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- 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/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-retrieval.d.ts +1 -1
- package/dist/entity-retrieval.js +3 -3
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +4 -4
- 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.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +42 -41
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- 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/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- 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-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +2 -2
- package/dist/namespaces/migrate.js +4 -4
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +3 -3
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +11 -9
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +8 -5
- package/dist/{orchestrator-vygo2YIM.d.ts → orchestrator-kOxredSr.d.ts} +22 -5
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +17 -16
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.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-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.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/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +2 -2
- package/dist/retrieval-agents.d.ts +1 -1
- 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/schemas.d.ts +22 -22
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-DSjMDZ1u.d.ts → semantic-consolidation-B58v3S-a.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +3 -3
- 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 +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +2 -2
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.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 +1 -1
- 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/types.d.ts +12 -12
- package/dist/{types-D9dwzU_x.d.ts → types-ACmDOScJ.d.ts} +36 -0
- 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 +3 -3
- package/package.json +2 -2
- package/src/access-service.ts +56 -41
- package/src/briefing.ts +32 -0
- package/src/config.ts +32 -0
- package/src/correction/index.ts +24 -0
- package/src/correction/passive-capture.test.ts +500 -0
- package/src/correction/passive-capture.ts +335 -0
- package/src/correction/passive-correction-detector.test.ts +263 -0
- package/src/correction/passive-correction-detector.ts +325 -0
- package/src/correction/passive-correction-notifications.ts +123 -0
- package/src/maintenance/namespace-planner.ts +3 -10
- package/src/orchestrator.ts +231 -73
- package/src/scopes/scope-plan.test.ts +168 -1
- package/src/scopes/scope-plan.ts +163 -0
- package/src/types.ts +36 -0
- package/dist/chunk-BNOAB5HH.js.map +0 -1
- package/dist/chunk-JEIROMLX.js.map +0 -1
- package/dist/chunk-MSVSP5VO.js.map +0 -1
- package/dist/chunk-SHRRWOVY.js.map +0 -1
- package/dist/chunk-SQ4LU27I.js.map +0 -1
- package/dist/chunk-XCTDHF7U.js.map +0 -1
- /package/dist/{chunk-XZTUMWKQ.js.map → chunk-2PTBLS2S.js.map} +0 -0
- /package/dist/{chunk-2Y6LMOQQ.js.map → chunk-2VHMVWPU.js.map} +0 -0
- /package/dist/{chunk-6UU43ZGD.js.map → chunk-4KZGLDJJ.js.map} +0 -0
- /package/dist/{chunk-K44MIN6D.js.map → chunk-5RHM43BJ.js.map} +0 -0
- /package/dist/{chunk-MECU6WSH.js.map → chunk-72VDBALG.js.map} +0 -0
- /package/dist/{chunk-UY4JMEAK.js.map → chunk-7EEVXW7X.js.map} +0 -0
- /package/dist/{chunk-WI4QX7GH.js.map → chunk-A66YRSOS.js.map} +0 -0
- /package/dist/{chunk-O62P2LFL.js.map → chunk-APUJIMDM.js.map} +0 -0
- /package/dist/{chunk-MPHDVHIB.js.map → chunk-DIFU33GU.js.map} +0 -0
- /package/dist/{chunk-DXGS5YOQ.js.map → chunk-EH27LHML.js.map} +0 -0
- /package/dist/{chunk-6FUJ2VYY.js.map → chunk-JAKYZGV4.js.map} +0 -0
- /package/dist/{chunk-3VUPWDSE.js.map → chunk-JIZGYQYH.js.map} +0 -0
- /package/dist/{chunk-QOIONSOI.js.map → chunk-KRGC4EDX.js.map} +0 -0
- /package/dist/{chunk-AJOIM6UR.js.map → chunk-L5ASZA2F.js.map} +0 -0
- /package/dist/{chunk-I56LKMF7.js.map → chunk-LXSG4L55.js.map} +0 -0
- /package/dist/{chunk-JVEMUX6L.js.map → chunk-OZ2KQ7HF.js.map} +0 -0
- /package/dist/{chunk-SYDHFFAW.js.map → chunk-P5IPFZVH.js.map} +0 -0
- /package/dist/{chunk-GM3BMWKR.js.map → chunk-REWQAFSA.js.map} +0 -0
- /package/dist/{chunk-V7GDTQ6I.js.map → chunk-S35FX6MU.js.map} +0 -0
- /package/dist/{chunk-MTHNJCOJ.js.map → chunk-S3OPGGZB.js.map} +0 -0
- /package/dist/{chunk-RBHANGVX.js.map → chunk-UCJ5CDTK.js.map} +0 -0
- /package/dist/{chunk-HHLWSWWF.js.map → chunk-URM3HW2R.js.map} +0 -0
- /package/dist/{chunk-VO4UICII.js.map → chunk-YTZLBBEB.js.map} +0 -0
- /package/dist/{chunk-OC56UWV5.js.map → chunk-YYOK4GVF.js.map} +0 -0
package/src/access-service.ts
CHANGED
|
@@ -109,7 +109,11 @@ import {
|
|
|
109
109
|
type ScopeProfileLayerResolution,
|
|
110
110
|
type ScopeProfilePromotionResolution,
|
|
111
111
|
} from "./namespaces/scope-profiles.js";
|
|
112
|
-
import {
|
|
112
|
+
import {
|
|
113
|
+
type ScopePlan,
|
|
114
|
+
resolveScopePlan,
|
|
115
|
+
resolveWritableNamespaceValue,
|
|
116
|
+
} from "./scopes/scope-plan.js";
|
|
113
117
|
import { namespaceIdentityFromToken } from "./namespaces/identity.js";
|
|
114
118
|
import { namespaceCollectionName } from "./namespaces/search.js";
|
|
115
119
|
import { SecureStoreLockedError } from "./secure-store/index.js";
|
|
@@ -1367,17 +1371,28 @@ export class EngramAccessService {
|
|
|
1367
1371
|
return resolvePrincipal(sessionKey, this.orchestrator.config);
|
|
1368
1372
|
}
|
|
1369
1373
|
|
|
1370
|
-
private
|
|
1374
|
+
private writableNamespaceFor(
|
|
1371
1375
|
namespace: string | undefined,
|
|
1372
1376
|
sessionKey: string | undefined,
|
|
1373
1377
|
authenticatedPrincipal?: string,
|
|
1374
1378
|
): string {
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
+
// #1521: delegates to the scope-module resolver. The inline
|
|
1380
|
+
// namespace/principal resolution + writability check is retired so the
|
|
1381
|
+
// adHocNamespaceResolutions ratchet no longer counts this site.
|
|
1382
|
+
const result = resolveWritableNamespaceValue(
|
|
1383
|
+
namespace,
|
|
1384
|
+
sessionKey,
|
|
1385
|
+
authenticatedPrincipal,
|
|
1386
|
+
this.orchestrator.config,
|
|
1387
|
+
);
|
|
1388
|
+
if (!result.ok) {
|
|
1389
|
+
throw new EngramAccessInputError(
|
|
1390
|
+
result.reason === "unsupported"
|
|
1391
|
+
? `unsupported namespace: ${result.namespace}`
|
|
1392
|
+
: `namespace is not writable: ${result.namespace}`,
|
|
1393
|
+
);
|
|
1379
1394
|
}
|
|
1380
|
-
return
|
|
1395
|
+
return result.namespace;
|
|
1381
1396
|
}
|
|
1382
1397
|
|
|
1383
1398
|
/**
|
|
@@ -1487,7 +1502,7 @@ export class EngramAccessService {
|
|
|
1487
1502
|
const hasExplicitNamespace =
|
|
1488
1503
|
typeof request.namespace === "string" && request.namespace.trim().length > 0;
|
|
1489
1504
|
if (hasExplicitNamespace) {
|
|
1490
|
-
return this.
|
|
1505
|
+
return this.writableNamespaceFor(
|
|
1491
1506
|
request.namespace,
|
|
1492
1507
|
request.sessionKey,
|
|
1493
1508
|
request.authenticatedPrincipal,
|
|
@@ -1509,7 +1524,7 @@ export class EngramAccessService {
|
|
|
1509
1524
|
if (!overlay) {
|
|
1510
1525
|
// No coding overlay → unqualified write stays on config.defaultNamespace,
|
|
1511
1526
|
// exactly the pre-#1434 behavior (auth-checked, like the legacy path).
|
|
1512
|
-
return this.
|
|
1527
|
+
return this.writableNamespaceFor(
|
|
1513
1528
|
undefined,
|
|
1514
1529
|
request.sessionKey,
|
|
1515
1530
|
request.authenticatedPrincipal,
|
|
@@ -1624,7 +1639,7 @@ export class EngramAccessService {
|
|
|
1624
1639
|
// The overlay never applies, so base == write == the explicit namespace.
|
|
1625
1640
|
// Objective-state converges on the same explicit target (the stricter
|
|
1626
1641
|
// principal-self contract only governs the IMPLICIT path).
|
|
1627
|
-
const writeNamespace = this.
|
|
1642
|
+
const writeNamespace = this.writableNamespaceFor(
|
|
1628
1643
|
request.namespace,
|
|
1629
1644
|
request.sessionKey,
|
|
1630
1645
|
request.authenticatedPrincipal,
|
|
@@ -1779,7 +1794,7 @@ export class EngramAccessService {
|
|
|
1779
1794
|
// namespace), collapsing the namespaces-disabled / no-session /
|
|
1780
1795
|
// projectScope-off cases to config.defaultNamespace exactly as before
|
|
1781
1796
|
// (rule 39 parity with resolveCodingScopedWriteNamespace).
|
|
1782
|
-
const writeNamespace = this.
|
|
1797
|
+
const writeNamespace = this.writableNamespaceFor(
|
|
1783
1798
|
undefined,
|
|
1784
1799
|
request.sessionKey,
|
|
1785
1800
|
request.authenticatedPrincipal,
|
|
@@ -4757,7 +4772,7 @@ export class EngramAccessService {
|
|
|
4757
4772
|
const service = createCorrectionService({
|
|
4758
4773
|
orchestrator: this.orchestrator,
|
|
4759
4774
|
resolveAuthorizedNamespace: async (req) =>
|
|
4760
|
-
this.
|
|
4775
|
+
this.writableNamespaceFor(req.namespace, req.sessionKey, req.principal),
|
|
4761
4776
|
resolveReadableNamespaces: (req) => {
|
|
4762
4777
|
const principal = this.resolveRequestPrincipal(req.sessionKey, req.principal);
|
|
4763
4778
|
return recallNamespacesForPrincipal(principal, this.orchestrator.config);
|
|
@@ -4766,7 +4781,7 @@ export class EngramAccessService {
|
|
|
4766
4781
|
// resolveWritableNamespace resolves + checks writability in one step;
|
|
4767
4782
|
// reusing it avoids a second ad-hoc namespace-resolution call site.
|
|
4768
4783
|
try {
|
|
4769
|
-
this.
|
|
4784
|
+
this.writableNamespaceFor(req.namespace, req.sessionKey, req.principal);
|
|
4770
4785
|
return Promise.resolve(true);
|
|
4771
4786
|
} catch {
|
|
4772
4787
|
return Promise.resolve(false);
|
|
@@ -5176,7 +5191,7 @@ export class EngramAccessService {
|
|
|
5176
5191
|
if (deepSleep.enabled === false && deepSleep.enabledExplicitlySet === true) {
|
|
5177
5192
|
throw new Error("memory governance is disabled by dreams.phases.deepSleep.enabled=false");
|
|
5178
5193
|
}
|
|
5179
|
-
const resolvedNamespace = this.
|
|
5194
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
5180
5195
|
request.namespace,
|
|
5181
5196
|
undefined,
|
|
5182
5197
|
request.authenticatedPrincipal ?? principal,
|
|
@@ -5236,7 +5251,7 @@ export class EngramAccessService {
|
|
|
5236
5251
|
proceduresWritten: number;
|
|
5237
5252
|
skippedReason?: string;
|
|
5238
5253
|
}> {
|
|
5239
|
-
const resolvedNamespace = this.
|
|
5254
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
5240
5255
|
request.namespace,
|
|
5241
5256
|
undefined,
|
|
5242
5257
|
request.authenticatedPrincipal ?? principal,
|
|
@@ -5262,7 +5277,7 @@ export class EngramAccessService {
|
|
|
5262
5277
|
} = {},
|
|
5263
5278
|
principal?: string,
|
|
5264
5279
|
): Promise<LiveConnectorsRunSummary> {
|
|
5265
|
-
this.
|
|
5280
|
+
this.writableNamespaceFor(
|
|
5266
5281
|
undefined,
|
|
5267
5282
|
undefined,
|
|
5268
5283
|
request.authenticatedPrincipal ?? principal,
|
|
@@ -5308,7 +5323,7 @@ export class EngramAccessService {
|
|
|
5308
5323
|
duplicatesSuperseded: number;
|
|
5309
5324
|
result?: PatternReinforcementResult;
|
|
5310
5325
|
}> {
|
|
5311
|
-
const resolvedNamespace = this.
|
|
5326
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
5312
5327
|
request.namespace,
|
|
5313
5328
|
undefined,
|
|
5314
5329
|
request.authenticatedPrincipal ?? principal,
|
|
@@ -5598,7 +5613,7 @@ export class EngramAccessService {
|
|
|
5598
5613
|
if (!isTrustZoneName(request.targetZone)) {
|
|
5599
5614
|
throw new EngramAccessInputError(`unsupported trust-zone target: ${String(request.targetZone)}`);
|
|
5600
5615
|
}
|
|
5601
|
-
const resolvedNamespace = this.
|
|
5616
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
5602
5617
|
request.namespace,
|
|
5603
5618
|
undefined,
|
|
5604
5619
|
request.authenticatedPrincipal,
|
|
@@ -5632,7 +5647,7 @@ export class EngramAccessService {
|
|
|
5632
5647
|
async trustZoneDemoSeed(
|
|
5633
5648
|
request: EngramAccessTrustZoneDemoSeedRequest,
|
|
5634
5649
|
): Promise<EngramAccessTrustZoneDemoSeedResponse> {
|
|
5635
|
-
const resolvedNamespace = this.
|
|
5650
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
5636
5651
|
request.namespace,
|
|
5637
5652
|
undefined,
|
|
5638
5653
|
request.authenticatedPrincipal,
|
|
@@ -5669,7 +5684,7 @@ export class EngramAccessService {
|
|
|
5669
5684
|
throw new EngramAccessInputError("reasonCode is required");
|
|
5670
5685
|
}
|
|
5671
5686
|
|
|
5672
|
-
const resolvedNamespace = this.
|
|
5687
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
5673
5688
|
request.namespace,
|
|
5674
5689
|
undefined,
|
|
5675
5690
|
request.authenticatedPrincipal,
|
|
@@ -5835,7 +5850,7 @@ export class EngramAccessService {
|
|
|
5835
5850
|
|
|
5836
5851
|
// Backward-compatible BASE writable namespace (pre-#1495 response semantics)
|
|
5837
5852
|
// for the legacy `namespace` response field. DERIVED from the already-resolved
|
|
5838
|
-
// scope plan — NOT a second
|
|
5853
|
+
// scope plan — NOT a second writable-namespace resolution call
|
|
5839
5854
|
// call (#1505 thread jvO). The fresh call re-authorized `undefined ⇒
|
|
5840
5855
|
// config.defaultNamespace` a SECOND time; under a restrictive default-namespace
|
|
5841
5856
|
// write policy that re-auth could REJECT an otherwise valid project-scoped
|
|
@@ -5845,7 +5860,7 @@ export class EngramAccessService {
|
|
|
5845
5860
|
// the coding context, leaving an orphaned session binding behind. The plan is
|
|
5846
5861
|
// the single authorization point (rule 22 / 39); the legacy field must reuse it
|
|
5847
5862
|
// and never re-authorize. Pre-#1495 semantics were exactly
|
|
5848
|
-
//
|
|
5863
|
+
// the writable-namespace resolver (overlay-agnostic): the explicit
|
|
5849
5864
|
// namespace when supplied, else `config.defaultNamespace` for user-project
|
|
5850
5865
|
// coding overlays. Hosted scope-profile layers such as `teamProject` report
|
|
5851
5866
|
// their effective profile write namespace because there is no legacy
|
|
@@ -6680,7 +6695,7 @@ export class EngramAccessService {
|
|
|
6680
6695
|
|
|
6681
6696
|
// Authorize compaction against the SCOPED WRITE TARGET — the SAME effective
|
|
6682
6697
|
// write namespace `observe` archived the LCM queue under — NOT a premature
|
|
6683
|
-
//
|
|
6698
|
+
// the writable-namespace resolver (undefined ⇒ config.defaultNamespace) (#1505
|
|
6684
6699
|
// thread NBHWs). Under a restrictive `default` WRITE policy where the
|
|
6685
6700
|
// principal can still write its self/project overlay, that premature default
|
|
6686
6701
|
// write-auth threw `namespace is not writable: default` BEFORE the scoped key
|
|
@@ -6692,7 +6707,7 @@ export class EngramAccessService {
|
|
|
6692
6707
|
// default` for a validly scoped observe's queue.
|
|
6693
6708
|
const scope = await this.resolveMemoryScopePlan(request);
|
|
6694
6709
|
// Legacy `namespace` response field: pre-#1505 semantics were exactly
|
|
6695
|
-
//
|
|
6710
|
+
// the writable-namespace resolver (overlay-agnostic) — the
|
|
6696
6711
|
// authorized explicit namespace when supplied, else `config.defaultNamespace`.
|
|
6697
6712
|
// DERIVED from the scope plan (NOT a second auth pass, #1505 thread jvO):
|
|
6698
6713
|
// explicit ⇒ writeNamespace; user-project coding overlay ⇒ defaultNamespace;
|
|
@@ -6747,7 +6762,7 @@ export class EngramAccessService {
|
|
|
6747
6762
|
|
|
6748
6763
|
// Authorize compaction against the SCOPED WRITE TARGET — the SAME effective
|
|
6749
6764
|
// write namespace `observe` archived the LCM queue under — NOT a premature
|
|
6750
|
-
//
|
|
6765
|
+
// the writable-namespace resolver (undefined ⇒ config.defaultNamespace) (#1505
|
|
6751
6766
|
// thread NBHWs). See `lcmCompactionFlush` for the full rationale: under a
|
|
6752
6767
|
// restrictive `default` WRITE policy where the principal can still write its
|
|
6753
6768
|
// self/project overlay, the old premature default write-auth threw `namespace
|
|
@@ -6832,7 +6847,7 @@ export class EngramAccessService {
|
|
|
6832
6847
|
}
|
|
6833
6848
|
const symptom = request.symptom?.trim();
|
|
6834
6849
|
if (!symptom) throw new EngramAccessInputError("symptom is required");
|
|
6835
|
-
const resolvedNs = this.
|
|
6850
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, undefined, request.principal);
|
|
6836
6851
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
6837
6852
|
const created = await storage.appendContinuityIncident({
|
|
6838
6853
|
symptom,
|
|
@@ -6862,7 +6877,7 @@ export class EngramAccessService {
|
|
|
6862
6877
|
if (!fixApplied) throw new EngramAccessInputError("fixApplied is required");
|
|
6863
6878
|
const verificationResult = request.verificationResult?.trim();
|
|
6864
6879
|
if (!verificationResult) throw new EngramAccessInputError("verificationResult is required");
|
|
6865
|
-
const resolvedNs = this.
|
|
6880
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, undefined, request.principal);
|
|
6866
6881
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
6867
6882
|
const closed = await storage.closeContinuityIncident(id, {
|
|
6868
6883
|
fixApplied,
|
|
@@ -6904,7 +6919,7 @@ export class EngramAccessService {
|
|
|
6904
6919
|
if (!this.orchestrator.config.identityContinuityEnabled) {
|
|
6905
6920
|
return { enabled: false, reason: "Identity continuity is disabled." };
|
|
6906
6921
|
}
|
|
6907
|
-
const resolvedNs = this.
|
|
6922
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, undefined, request.principal);
|
|
6908
6923
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
6909
6924
|
const loop = await storage.upsertIdentityImprovementLoop({
|
|
6910
6925
|
id: request.id?.trim() || "",
|
|
@@ -6931,7 +6946,7 @@ export class EngramAccessService {
|
|
|
6931
6946
|
}
|
|
6932
6947
|
const id = request.id?.trim();
|
|
6933
6948
|
if (!id) throw new EngramAccessInputError("id is required");
|
|
6934
|
-
const resolvedNs = this.
|
|
6949
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, undefined, request.principal);
|
|
6935
6950
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
6936
6951
|
const reviewed = await storage.reviewIdentityImprovementLoop(id, {
|
|
6937
6952
|
status: request.status,
|
|
@@ -6985,7 +7000,7 @@ export class EngramAccessService {
|
|
|
6985
7000
|
const hasUpdate = Object.values(updates).some((v) => typeof v === "string" && v.length > 0);
|
|
6986
7001
|
if (!hasUpdate) throw new EngramAccessInputError("At least one section field is required.");
|
|
6987
7002
|
|
|
6988
|
-
const resolvedNs = this.
|
|
7003
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, undefined, request.principal);
|
|
6989
7004
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
6990
7005
|
const existing = await storage.readIdentityAnchor();
|
|
6991
7006
|
|
|
@@ -7654,7 +7669,7 @@ export class EngramAccessService {
|
|
|
7654
7669
|
"memoryId must not contain path separators",
|
|
7655
7670
|
);
|
|
7656
7671
|
}
|
|
7657
|
-
const resolvedNs = this.
|
|
7672
|
+
const resolvedNs = this.writableNamespaceFor(
|
|
7658
7673
|
request.namespace,
|
|
7659
7674
|
request.sessionKey,
|
|
7660
7675
|
request.principal,
|
|
@@ -7678,7 +7693,7 @@ export class EngramAccessService {
|
|
|
7678
7693
|
principal?: string;
|
|
7679
7694
|
sessionKey?: string;
|
|
7680
7695
|
}): Promise<unknown> {
|
|
7681
|
-
const resolvedNs = this.
|
|
7696
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, request.sessionKey, request.principal);
|
|
7682
7697
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
7683
7698
|
// Update frontmatter to active status (promote from pending/draft)
|
|
7684
7699
|
await storage.updateMemoryFrontmatter(request.memoryId, {
|
|
@@ -7734,7 +7749,7 @@ export class EngramAccessService {
|
|
|
7734
7749
|
);
|
|
7735
7750
|
}
|
|
7736
7751
|
|
|
7737
|
-
const resolvedNs = this.
|
|
7752
|
+
const resolvedNs = this.writableNamespaceFor(
|
|
7738
7753
|
request.namespace,
|
|
7739
7754
|
request.sessionKey,
|
|
7740
7755
|
request.principal,
|
|
@@ -7784,7 +7799,7 @@ export class EngramAccessService {
|
|
|
7784
7799
|
namespace?: string;
|
|
7785
7800
|
principal?: string;
|
|
7786
7801
|
}): Promise<{ saved: boolean }> {
|
|
7787
|
-
const resolvedNs = this.
|
|
7802
|
+
const resolvedNs = this.writableNamespaceFor(request.namespace, request.sessionKey, request.principal);
|
|
7788
7803
|
const storage = await this.orchestrator.getStorage(resolvedNs);
|
|
7789
7804
|
const storageDir = storage.dir;
|
|
7790
7805
|
const { writeFile, mkdir } = await import("node:fs/promises");
|
|
@@ -7842,7 +7857,7 @@ export class EngramAccessService {
|
|
|
7842
7857
|
// Pass authenticatedPrincipal so the principal resolution matches other
|
|
7843
7858
|
// write endpoints (gotcha #42: read and write paths must resolve through
|
|
7844
7859
|
// the same namespace layer).
|
|
7845
|
-
const resolvedNamespace = this.
|
|
7860
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
7846
7861
|
request.namespace,
|
|
7847
7862
|
request.sessionId,
|
|
7848
7863
|
request.authenticatedPrincipal,
|
|
@@ -8144,7 +8159,7 @@ export class EngramAccessService {
|
|
|
8144
8159
|
"authentication required: namespaces are enabled and no principal was supplied",
|
|
8145
8160
|
);
|
|
8146
8161
|
}
|
|
8147
|
-
const resolved = this.
|
|
8162
|
+
const resolved = this.writableNamespaceFor(namespace, undefined, principal);
|
|
8148
8163
|
const storage = await this.orchestrator.getStorage(resolved);
|
|
8149
8164
|
return { namespace: resolved, storage };
|
|
8150
8165
|
}
|
|
@@ -8201,7 +8216,7 @@ export class EngramAccessService {
|
|
|
8201
8216
|
},
|
|
8202
8217
|
): Promise<ImportCapsuleResult> {
|
|
8203
8218
|
const { namespace, principal, root: explicitRoot, memoryDir: explicitMemoryDir, ...importOptions } = opts;
|
|
8204
|
-
const resolvedNamespace = this.
|
|
8219
|
+
const resolvedNamespace = this.writableNamespaceFor(namespace, undefined, principal);
|
|
8205
8220
|
const storage = await this.orchestrator.getStorage(resolvedNamespace);
|
|
8206
8221
|
const root = explicitRoot ?? storage.dir;
|
|
8207
8222
|
const memoryDir = explicitMemoryDir ?? this.orchestrator.config.memoryDir;
|
|
@@ -8288,7 +8303,7 @@ export class EngramAccessService {
|
|
|
8288
8303
|
},
|
|
8289
8304
|
): Promise<ExportCapsuleResult> {
|
|
8290
8305
|
const { namespace, principal, root: explicitRoot, memoryDir: explicitMemoryDir, ...exportOptions } = opts;
|
|
8291
|
-
const resolvedNamespace = this.
|
|
8306
|
+
const resolvedNamespace = this.writableNamespaceFor(namespace, undefined, principal);
|
|
8292
8307
|
const storage = await this.orchestrator.getStorage(resolvedNamespace);
|
|
8293
8308
|
const root = explicitRoot ?? storage.dir;
|
|
8294
8309
|
const memoryDir = explicitMemoryDir ?? this.orchestrator.config.memoryDir;
|
|
@@ -8522,7 +8537,7 @@ export class EngramAccessService {
|
|
|
8522
8537
|
async offlineSyncApplyFileContent(
|
|
8523
8538
|
options: EngramAccessOfflineSyncApplyFileContentRequest,
|
|
8524
8539
|
): Promise<EngramAccessOfflineSyncApplyFileContentResponse> {
|
|
8525
|
-
const resolvedNamespace = this.
|
|
8540
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
8526
8541
|
options.namespace,
|
|
8527
8542
|
undefined,
|
|
8528
8543
|
options.principal,
|
|
@@ -8573,7 +8588,7 @@ export class EngramAccessService {
|
|
|
8573
8588
|
async offlineSyncApply(
|
|
8574
8589
|
options: EngramAccessOfflineSyncApplyRequest,
|
|
8575
8590
|
): Promise<EngramAccessOfflineSyncApplyResponse> {
|
|
8576
|
-
const resolvedNamespace = this.
|
|
8591
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
8577
8592
|
options.namespace,
|
|
8578
8593
|
undefined,
|
|
8579
8594
|
options.principal,
|
|
@@ -8655,7 +8670,7 @@ export class EngramAccessService {
|
|
|
8655
8670
|
);
|
|
8656
8671
|
}
|
|
8657
8672
|
const dryRun = options.dryRun === true;
|
|
8658
|
-
const resolvedNamespace = this.
|
|
8673
|
+
const resolvedNamespace = this.writableNamespaceFor(
|
|
8659
8674
|
options.namespace,
|
|
8660
8675
|
undefined,
|
|
8661
8676
|
options.authenticatedPrincipal,
|
package/src/briefing.ts
CHANGED
|
@@ -20,6 +20,7 @@ import os from "node:os";
|
|
|
20
20
|
import path from "node:path";
|
|
21
21
|
import { log } from "./logger.js";
|
|
22
22
|
import { extractJsonCandidates } from "./json-extract.js";
|
|
23
|
+
import { drainPassiveCorrectionNotifications } from "./correction/passive-correction-notifications.js";
|
|
23
24
|
import { normalizeEntityName, StorageManager } from "./storage.js";
|
|
24
25
|
import { readEnvVar, resolveHomeDir } from "./runtime/env.js";
|
|
25
26
|
import type {
|
|
@@ -908,6 +909,24 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
908
909
|
suggestedFollowups: followups,
|
|
909
910
|
};
|
|
910
911
|
|
|
912
|
+
// Drain auto-applied passive-correction notifications (issue #1581). The
|
|
913
|
+
// queue is cleared on read, so each notification surfaces in exactly one
|
|
914
|
+
// briefing. Fail-open: a drain error never blocks the briefing.
|
|
915
|
+
let correctionNotifications: BriefingResult["correctionNotifications"];
|
|
916
|
+
try {
|
|
917
|
+
const drained = await drainPassiveCorrectionNotifications(options.storage.dir);
|
|
918
|
+
if (drained.length > 0) {
|
|
919
|
+
correctionNotifications = drained.map((n) => ({
|
|
920
|
+
planId: n.planId,
|
|
921
|
+
summary: n.summary,
|
|
922
|
+
undoCommand: n.undoCommand,
|
|
923
|
+
createdAt: n.createdAt,
|
|
924
|
+
}));
|
|
925
|
+
}
|
|
926
|
+
} catch (err) {
|
|
927
|
+
log.debug(`briefing: correction notification drain failed (non-fatal): ${err instanceof Error ? err.message : String(err)}`);
|
|
928
|
+
}
|
|
929
|
+
|
|
911
930
|
const windowIso = { from: window.from.toISOString(), to: window.to.toISOString() };
|
|
912
931
|
const markdown = renderBriefingMarkdown({
|
|
913
932
|
sections,
|
|
@@ -916,6 +935,7 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
916
935
|
followupsUnavailableReason,
|
|
917
936
|
generatedAt: now,
|
|
918
937
|
namespace: options.namespace,
|
|
938
|
+
correctionNotifications,
|
|
919
939
|
});
|
|
920
940
|
|
|
921
941
|
const json: Record<string, unknown> = {
|
|
@@ -923,6 +943,7 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
923
943
|
window: windowIso,
|
|
924
944
|
focus,
|
|
925
945
|
namespace: options.namespace ?? null,
|
|
946
|
+
correctionNotifications: correctionNotifications ?? null,
|
|
926
947
|
sections,
|
|
927
948
|
followupsUnavailableReason: followupsUnavailableReason ?? null,
|
|
928
949
|
calendarSourceErrors: calendarSourceErrors.length > 0 ? calendarSourceErrors : null,
|
|
@@ -934,6 +955,7 @@ export async function buildBriefing(options: BuildBriefingOptions): Promise<Brie
|
|
|
934
955
|
sections,
|
|
935
956
|
followupsUnavailableReason,
|
|
936
957
|
window: windowIso,
|
|
958
|
+
...(correctionNotifications ? { correctionNotifications } : {}),
|
|
937
959
|
};
|
|
938
960
|
|
|
939
961
|
if (calendarSourceErrors.length > 0) {
|
|
@@ -1351,6 +1373,8 @@ interface RenderContext {
|
|
|
1351
1373
|
followupsUnavailableReason?: string;
|
|
1352
1374
|
generatedAt: Date;
|
|
1353
1375
|
namespace?: string;
|
|
1376
|
+
/** Auto-applied passive corrections drained for this briefing (#1581). */
|
|
1377
|
+
correctionNotifications?: BriefingResult["correctionNotifications"];
|
|
1354
1378
|
}
|
|
1355
1379
|
|
|
1356
1380
|
export function renderBriefingMarkdown(ctx: RenderContext): string {
|
|
@@ -1366,6 +1390,14 @@ export function renderBriefingMarkdown(ctx: RenderContext): string {
|
|
|
1366
1390
|
}
|
|
1367
1391
|
lines.push("");
|
|
1368
1392
|
|
|
1393
|
+
if (ctx.correctionNotifications && ctx.correctionNotifications.length > 0) {
|
|
1394
|
+
lines.push(`## Memory updates`);
|
|
1395
|
+
for (const n of ctx.correctionNotifications) {
|
|
1396
|
+
lines.push(`- ✎ ${n.summary} (undo: ${n.undoCommand})`);
|
|
1397
|
+
}
|
|
1398
|
+
lines.push("");
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1369
1401
|
lines.push(`## Active threads`);
|
|
1370
1402
|
if (ctx.sections.activeThreads.length === 0) {
|
|
1371
1403
|
lines.push(`_No active threads in window._`);
|
package/src/config.ts
CHANGED
|
@@ -2141,6 +2141,38 @@ export function parseConfig(
|
|
|
2141
2141
|
if (fromFlat !== undefined && fromFlat > 0) return fromFlat;
|
|
2142
2142
|
return 24;
|
|
2143
2143
|
})(),
|
|
2144
|
+
// Passive correction capture (issue #1581). Parsed from
|
|
2145
|
+
// `correctionCapture.<key>` (nested) or flat legacy keys. Default "off" —
|
|
2146
|
+
// operators opt in (rule 48). Invalid mode → rejected listing options (rule 51).
|
|
2147
|
+
correctionCaptureMode: (() => {
|
|
2148
|
+
const nested = (cfg.correctionCapture as Record<string, unknown> | undefined)?.mode;
|
|
2149
|
+
const raw = nested !== undefined ? nested : cfg.correctionCaptureMode;
|
|
2150
|
+
if (raw === undefined || raw === null) return "off" as const;
|
|
2151
|
+
if (raw === "off" || raw === "queue" || raw === "auto") return raw;
|
|
2152
|
+
throw new Error(
|
|
2153
|
+
`Invalid correctionCapture.mode: expected one of "off", "queue", "auto", got ${JSON.stringify(raw)}`,
|
|
2154
|
+
);
|
|
2155
|
+
})(),
|
|
2156
|
+
correctionCaptureConfidenceFloor: (() => {
|
|
2157
|
+
const nested = (cfg.correctionCapture as Record<string, unknown> | undefined)?.confidenceFloor;
|
|
2158
|
+
const raw = nested !== undefined ? nested : cfg.correctionCaptureConfidenceFloor;
|
|
2159
|
+
if (raw === undefined || raw === null) return 0.85;
|
|
2160
|
+
const n = coerceNumber(raw);
|
|
2161
|
+
if (n === undefined || !Number.isFinite(n) || n < 0 || n > 1) {
|
|
2162
|
+
throw new Error(`Invalid correctionCapture.confidenceFloor: expected a number in [0, 1], got ${JSON.stringify(raw)}`);
|
|
2163
|
+
}
|
|
2164
|
+
return n;
|
|
2165
|
+
})(),
|
|
2166
|
+
correctionCaptureAutoApplyMaxAffected: (() => {
|
|
2167
|
+
const nested = (cfg.correctionCapture as Record<string, unknown> | undefined)?.autoApplyMaxAffected;
|
|
2168
|
+
const raw = nested !== undefined ? nested : cfg.correctionCaptureAutoApplyMaxAffected;
|
|
2169
|
+
if (raw === undefined || raw === null) return 2;
|
|
2170
|
+
const n = coerceNumber(raw);
|
|
2171
|
+
if (n === undefined || !Number.isFinite(n) || n < 1) {
|
|
2172
|
+
throw new Error(`Invalid correctionCapture.autoApplyMaxAffected: expected an integer >= 1, got ${JSON.stringify(raw)}`);
|
|
2173
|
+
}
|
|
2174
|
+
return Math.floor(n);
|
|
2175
|
+
})(),
|
|
2144
2176
|
// Tombstones — non-resurrection invariant (issue #1579). The invariant is
|
|
2145
2177
|
// the point, so it ships ON by default; `false` restores pre-feature
|
|
2146
2178
|
// behavior for rollback safety (rule 30). Uses coerceBool so CLI string
|
package/src/correction/index.ts
CHANGED
|
@@ -41,3 +41,27 @@ export type { CorrectionNamespacePolicy, CorrectionServiceDeps } from "./correct
|
|
|
41
41
|
|
|
42
42
|
export { createCorrectionService, isCorrectionFeatureEnabled } from "./correction-access-wiring.js";
|
|
43
43
|
export type { CorrectionAccessWiring } from "./correction-access-wiring.js";
|
|
44
|
+
|
|
45
|
+
export { detectPassiveCorrections, extractHandles } from "./passive-correction-detector.js";
|
|
46
|
+
export type { PassiveCorrection, PassiveCorrectionPolarity, DetectorTurn } from "./passive-correction-detector.js";
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
capturePassiveCorrections,
|
|
50
|
+
evaluateAutoApplyGuards,
|
|
51
|
+
emptyTelemetry,
|
|
52
|
+
} from "./passive-capture.js";
|
|
53
|
+
export type {
|
|
54
|
+
CorrectionCaptureMode,
|
|
55
|
+
PassiveCaptureConfig,
|
|
56
|
+
PassiveCaptureContext,
|
|
57
|
+
PassiveCaptureDeps,
|
|
58
|
+
PassiveCaptureResult,
|
|
59
|
+
PassiveCaptureTelemetry,
|
|
60
|
+
AutoApplySuppressionReason,
|
|
61
|
+
} from "./passive-capture.js";
|
|
62
|
+
|
|
63
|
+
export {
|
|
64
|
+
enqueuePassiveCorrectionNotification,
|
|
65
|
+
drainPassiveCorrectionNotifications,
|
|
66
|
+
} from "./passive-correction-notifications.js";
|
|
67
|
+
export type { PassiveCorrectionNotification } from "./passive-correction-notifications.js";
|