@jungjaehoon/mama-core 1.8.1 → 2.0.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/agent-graph/alias-write.js +3 -0
- package/dist/agent-graph/entity-resolve.js +3 -7
- package/dist/agent-graph/graph-query.js +5 -4
- package/dist/agent-graph/types.d.ts +30 -0
- package/dist/cases/store.d.ts +0 -4
- package/dist/cases/store.js +0 -66
- package/dist/cases/wiki-page-index.d.ts +0 -13
- package/dist/cases/wiki-page-index.js +0 -153
- package/dist/connectors/event-index.d.ts +1 -22
- package/dist/connectors/event-index.js +0 -157
- package/dist/context-compile/channel-grant.d.ts +46 -0
- package/dist/context-compile/channel-grant.js +66 -0
- package/dist/context-compile/compiler.js +5 -2
- package/dist/context-compile/index.d.ts +1 -0
- package/dist/context-compile/index.js +1 -0
- package/dist/context-compile/packet-store.d.ts +0 -1
- package/dist/context-compile/packet-store.js +0 -16
- package/dist/context-compile/source-readers.d.ts +1 -0
- package/dist/context-compile/source-readers.js +156 -23
- package/dist/context-compile/types.d.ts +17 -0
- package/dist/context-compile/visibility.js +28 -4
- package/dist/db-adapter/node-sqlite-adapter.js +4 -0
- package/dist/db-manager.d.ts +0 -13
- package/dist/db-manager.js +0 -66
- package/dist/decision-formatter.d.ts +0 -11
- package/dist/decision-formatter.js +0 -122
- package/dist/decision-tracker.d.ts +0 -12
- package/dist/decision-tracker.js +0 -50
- package/dist/edges/ref-validation.d.ts +1 -2
- package/dist/edges/ref-validation.js +33 -13
- package/dist/edges/store.d.ts +1 -3
- package/dist/edges/store.js +0 -214
- package/dist/edges/types.d.ts +10 -0
- package/dist/embedding-client.d.ts +0 -17
- package/dist/embedding-client.js +0 -80
- package/dist/embedding-server/mobile/auth.d.ts +1 -10
- package/dist/embedding-server/mobile/auth.js +0 -15
- package/dist/embeddings.d.ts +0 -12
- package/dist/embeddings.js +0 -68
- package/dist/entities/audit-metrics.d.ts +0 -5
- package/dist/entities/audit-metrics.js +0 -4
- package/dist/entities/candidate-generator.d.ts +1 -2
- package/dist/entities/candidate-generator.js +0 -412
- package/dist/entities/entity-list.d.ts +0 -1
- package/dist/entities/entity-list.js +0 -96
- package/dist/entities/entity-orphan-list.d.ts +0 -9
- package/dist/entities/entity-orphan-list.js +0 -88
- package/dist/entities/entity-search.d.ts +0 -1
- package/dist/entities/entity-search.js +0 -147
- package/dist/entities/errors.d.ts +0 -10
- package/dist/entities/errors.js +1 -25
- package/dist/entities/lineage-store.d.ts +0 -23
- package/dist/entities/lineage-store.js +0 -104
- package/dist/entities/policy-store.d.ts +0 -9
- package/dist/entities/policy-store.js +0 -188
- package/dist/entities/provenance-query.d.ts +0 -1
- package/dist/entities/provenance-query.js +0 -164
- package/dist/entities/resolution-engine.d.ts +1 -8
- package/dist/entities/resolution-engine.js +0 -66
- package/dist/entities/rollback-preview.d.ts +0 -4
- package/dist/entities/rollback-preview.js +0 -232
- package/dist/entities/store.d.ts +1 -10
- package/dist/entities/store.js +0 -49
- package/dist/index.d.ts +15 -31
- package/dist/index.js +4 -46
- package/dist/mama-api.d.ts +19 -1
- package/dist/mama-api.js +97 -2
- package/dist/memory/api.d.ts +9 -0
- package/dist/memory/api.js +68 -4
- package/dist/memory/event-store.d.ts +0 -1
- package/dist/memory/event-store.js +0 -15
- package/dist/memory/finding-store.d.ts +0 -1
- package/dist/memory/finding-store.js +0 -12
- package/dist/memory/scope-backfill.d.ts +0 -3
- package/dist/memory/scope-backfill.js +0 -74
- package/dist/memory/scope-store.d.ts +0 -1
- package/dist/memory/scope-store.js +0 -4
- package/dist/memory/truth-store.d.ts +0 -3
- package/dist/memory/truth-store.js +0 -22
- package/dist/memory/types.d.ts +0 -1
- package/dist/memory/types.js +0 -13
- package/dist/memory-store.d.ts +0 -16
- package/dist/memory-store.js +0 -51
- package/dist/ollama-client.d.ts +0 -9
- package/dist/ollama-client.js +0 -125
- package/dist/outcome-tracker.d.ts +0 -14
- package/dist/outcome-tracker.js +0 -44
- package/dist/progress-indicator.d.ts +0 -4
- package/dist/progress-indicator.js +0 -7
- package/dist/provenance/source-ref.d.ts +0 -9
- package/dist/provenance/source-ref.js +0 -145
- package/dist/query-intent.d.ts +0 -4
- package/dist/query-intent.js +0 -30
- package/dist/relevance-scorer.d.ts +0 -9
- package/dist/relevance-scorer.js +0 -81
- package/dist/search/feedback-store.d.ts +0 -1
- package/dist/search/feedback-store.js +0 -4
- package/dist/search/ranker-rescore.d.ts +0 -3
- package/dist/search/ranker-rescore.js +0 -27
- package/dist/search/ranker-trainer.d.ts +0 -8
- package/dist/search/ranker-trainer.js +0 -376
- package/dist/tier-validator.d.ts +0 -12
- package/dist/tier-validator.js +0 -56
- package/package.json +1 -10
- package/dist/cases/case-links.d.ts +0 -116
- package/dist/cases/case-links.js +0 -794
- package/dist/cases/composition-overrides.d.ts +0 -90
- package/dist/cases/composition-overrides.js +0 -724
- package/dist/cases/corrections.d.ts +0 -156
- package/dist/cases/corrections.js +0 -1045
- package/dist/cases/freshness.d.ts +0 -57
- package/dist/cases/freshness.js +0 -283
- package/dist/cases/live-state.d.ts +0 -48
- package/dist/cases/live-state.js +0 -256
- package/dist/cases/membership-explain.d.ts +0 -56
- package/dist/cases/membership-explain.js +0 -140
- package/dist/cases/membership-matcher.d.ts +0 -23
- package/dist/cases/membership-matcher.js +0 -193
- package/dist/cases/merge-split.d.ts +0 -61
- package/dist/cases/merge-split.js +0 -368
- package/dist/cases/role-inference.d.ts +0 -10
- package/dist/cases/role-inference.js +0 -85
- package/dist/cases/sqlite-transaction.d.ts +0 -10
- package/dist/cases/sqlite-transaction.js +0 -62
- package/dist/cases/target-ref.d.ts +0 -25
- package/dist/cases/target-ref.js +0 -22
- package/dist/cases/tombstone-sweeper.d.ts +0 -13
- package/dist/cases/tombstone-sweeper.js +0 -128
- package/dist/entities/entity-impact.d.ts +0 -41
- package/dist/entities/entity-impact.js +0 -140
- package/dist/entities/exact-merge-backfill.d.ts +0 -11
- package/dist/entities/exact-merge-backfill.js +0 -161
- package/dist/entities/lineage-backfill.d.ts +0 -12
- package/dist/entities/lineage-backfill.js +0 -101
- package/dist/memory-inject.d.ts +0 -24
- package/dist/memory-inject.js +0 -116
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import type { DatabaseAdapter } from '../db-manager.js';
|
|
2
|
-
import { type CaseTargetRef } from './target-ref.js';
|
|
3
|
-
import type { CaseCorrectionRequiresReconfirmResult } from './types.js';
|
|
4
|
-
export type CaseCorrectionErrorCode = 'case.precompile_gap' | 'case.correction_requires_reconfirm' | 'case.correction_active_conflict' | 'case.correction_not_found' | 'case.correction_reverted' | 'case.correction_inactive' | 'case.correction_already_superseded' | 'case.supersede_target_mismatch' | 'case.reconfirm_token_invalid' | 'case.reconfirm_token_replayed' | 'case.terminal_status' | 'case.lock_held';
|
|
5
|
-
export interface ApplyCorrectionInput {
|
|
6
|
-
case_id: string;
|
|
7
|
-
target_kind: 'case_field' | 'membership' | 'wiki_section';
|
|
8
|
-
target_ref: CaseTargetRef;
|
|
9
|
-
field_name?: 'status' | 'status_reason' | 'primary_actors' | 'blockers' | 'confidence';
|
|
10
|
-
old_value_json?: string | null;
|
|
11
|
-
reconfirm_token?: string | null;
|
|
12
|
-
session_id?: string | null;
|
|
13
|
-
new_value_json: string;
|
|
14
|
-
reason: string;
|
|
15
|
-
confirmed: true;
|
|
16
|
-
confirmed_by: string;
|
|
17
|
-
confirmation_summary: string;
|
|
18
|
-
now?: string;
|
|
19
|
-
}
|
|
20
|
-
export type CorrectionApplyResult = {
|
|
21
|
-
kind: 'applied';
|
|
22
|
-
correction_id: string;
|
|
23
|
-
case_id: string;
|
|
24
|
-
target_ref_json: string;
|
|
25
|
-
canonical_hash_hex: string;
|
|
26
|
-
} | CaseCorrectionRequiresReconfirmResult | {
|
|
27
|
-
kind: 'precompile_gap';
|
|
28
|
-
code: 'case.precompile_gap';
|
|
29
|
-
case_id: string;
|
|
30
|
-
} | {
|
|
31
|
-
kind: 'rejected';
|
|
32
|
-
code: CaseCorrectionErrorCode;
|
|
33
|
-
message: string;
|
|
34
|
-
case_id: string;
|
|
35
|
-
};
|
|
36
|
-
export interface RevertCorrectionInput {
|
|
37
|
-
correction_id: string;
|
|
38
|
-
confirmed: true;
|
|
39
|
-
confirmed_by: string;
|
|
40
|
-
confirmation_summary: string;
|
|
41
|
-
now?: string;
|
|
42
|
-
}
|
|
43
|
-
export type CorrectionRevertResult = {
|
|
44
|
-
kind: 'reverted';
|
|
45
|
-
correction_id: string;
|
|
46
|
-
case_id: string;
|
|
47
|
-
} | {
|
|
48
|
-
kind: 'precompile_gap';
|
|
49
|
-
code: 'case.precompile_gap';
|
|
50
|
-
case_id: string;
|
|
51
|
-
} | {
|
|
52
|
-
kind: 'rejected';
|
|
53
|
-
code: CaseCorrectionErrorCode;
|
|
54
|
-
message: string;
|
|
55
|
-
correction_id?: string;
|
|
56
|
-
};
|
|
57
|
-
export interface SupersedeCorrectionInput {
|
|
58
|
-
old_correction_id: string;
|
|
59
|
-
new_value_json: string;
|
|
60
|
-
reason: string;
|
|
61
|
-
confirmed: true;
|
|
62
|
-
confirmed_by: string;
|
|
63
|
-
confirmation_summary: string;
|
|
64
|
-
/**
|
|
65
|
-
* The current value the user saw in the drawer when they chose to
|
|
66
|
-
* supersede. When provided and it disagrees with the live value, the
|
|
67
|
-
* helper returns `case.correction_requires_reconfirm`. Omit to skip
|
|
68
|
-
* CAS — in that case the caller trusts the active correction as the
|
|
69
|
-
* sole source of truth.
|
|
70
|
-
*/
|
|
71
|
-
expected_current_value_json?: string | null;
|
|
72
|
-
reconfirm_token?: string | null;
|
|
73
|
-
session_id?: string | null;
|
|
74
|
-
now?: string;
|
|
75
|
-
}
|
|
76
|
-
export type CorrectionSupersedeResult = {
|
|
77
|
-
kind: 'superseded';
|
|
78
|
-
old_correction_id: string;
|
|
79
|
-
new_correction_id: string;
|
|
80
|
-
case_id: string;
|
|
81
|
-
target_ref_json: string;
|
|
82
|
-
canonical_hash_hex: string;
|
|
83
|
-
} | CaseCorrectionRequiresReconfirmResult | {
|
|
84
|
-
kind: 'precompile_gap';
|
|
85
|
-
code: 'case.precompile_gap';
|
|
86
|
-
case_id: string;
|
|
87
|
-
} | {
|
|
88
|
-
kind: 'rejected';
|
|
89
|
-
code: CaseCorrectionErrorCode;
|
|
90
|
-
message: string;
|
|
91
|
-
correction_id?: string;
|
|
92
|
-
case_id?: string;
|
|
93
|
-
};
|
|
94
|
-
export interface ReconfirmTokenPayload {
|
|
95
|
-
v: 1;
|
|
96
|
-
kid: string;
|
|
97
|
-
nonce: string;
|
|
98
|
-
case_id: string;
|
|
99
|
-
target_kind: ApplyCorrectionInput['target_kind'];
|
|
100
|
-
target_ref_hash_hex: string;
|
|
101
|
-
current_value_hash_hex: string;
|
|
102
|
-
proposed_value_hash_hex: string;
|
|
103
|
-
confirmed_by: string;
|
|
104
|
-
session_id: string | null;
|
|
105
|
-
expires_at: string;
|
|
106
|
-
}
|
|
107
|
-
export interface ReconfirmTokenEnvelope {
|
|
108
|
-
kid: string;
|
|
109
|
-
payload: ReconfirmTokenPayload;
|
|
110
|
-
signature_hex: string;
|
|
111
|
-
}
|
|
112
|
-
export interface InsertCaseCorrectionLockInput {
|
|
113
|
-
correction_id?: string;
|
|
114
|
-
case_id: string;
|
|
115
|
-
target_kind: ApplyCorrectionInput['target_kind'];
|
|
116
|
-
target_ref: CaseTargetRef;
|
|
117
|
-
field_name?: ApplyCorrectionInput['field_name'] | null;
|
|
118
|
-
old_value_json: string | null;
|
|
119
|
-
new_value_json: string;
|
|
120
|
-
reason: string;
|
|
121
|
-
applied_by: string;
|
|
122
|
-
applied_at: string;
|
|
123
|
-
is_lock_active?: 0 | 1;
|
|
124
|
-
superseded_by?: string | null;
|
|
125
|
-
}
|
|
126
|
-
export interface InsertCaseCorrectionLockResult {
|
|
127
|
-
correction_id: string;
|
|
128
|
-
case_id: string;
|
|
129
|
-
target_kind: ApplyCorrectionInput['target_kind'];
|
|
130
|
-
target_ref_json: string;
|
|
131
|
-
target_ref_hash: Uint8Array;
|
|
132
|
-
canonical_hash_hex: string;
|
|
133
|
-
applied_at: string;
|
|
134
|
-
is_lock_active: 0 | 1;
|
|
135
|
-
}
|
|
136
|
-
export declare function insertCaseCorrectionLock(adapter: DatabaseAdapter, input: InsertCaseCorrectionLockInput): InsertCaseCorrectionLockResult;
|
|
137
|
-
export declare function applyCorrection(adapter: DatabaseAdapter, input: ApplyCorrectionInput): CorrectionApplyResult;
|
|
138
|
-
export declare function revertCorrection(adapter: DatabaseAdapter, input: RevertCorrectionInput): CorrectionRevertResult;
|
|
139
|
-
/**
|
|
140
|
-
* supersedeCorrection — Phase 2b. Unblocked by spec amendment-8 (2026-04-18)
|
|
141
|
-
* which added `superseded_by` to the mutable-column set in §5.4.
|
|
142
|
-
*
|
|
143
|
-
* Semantics: user changes their mind on an active correction. Inside a single
|
|
144
|
-
* transaction:
|
|
145
|
-
* 1. Read OLD row; reject if not found / reverted / already superseded / inactive.
|
|
146
|
-
* 2. INSERT new correction row referencing the same (case_id, target_kind,
|
|
147
|
-
* target_ref_hash) with new_value_json and is_lock_active=1.
|
|
148
|
-
* 3. UPDATE OLD row: superseded_by = new.correction_id, is_lock_active = 0.
|
|
149
|
-
* 4. Emit case.correction_superseded memory_event.
|
|
150
|
-
*
|
|
151
|
-
* Per spec §5.4 invariant (amendment-8), the three mutable columns are
|
|
152
|
-
* is_lock_active + reverted_at + superseded_by. superseded_by is written
|
|
153
|
-
* ONLY inside this transition.
|
|
154
|
-
*/
|
|
155
|
-
export declare function supersedeCorrection(adapter: DatabaseAdapter, input: SupersedeCorrectionInput): CorrectionSupersedeResult;
|
|
156
|
-
//# sourceMappingURL=corrections.d.ts.map
|