@agfpd/iapeer-memory-core 0.2.4 → 0.2.5
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/package.json +1 -1
- package/src/frontmatter-fill.ts +19 -4
- package/src/silent-edit-detect.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agfpd/iapeer-memory-core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "iapeer-memory core — host-neutral TypeScript memory primitive: vault schema/taxonomy config, search engine, memoryd, context renderer, role contracts. Consumed by the @agfpd/iapeer-memory facade; version kept in lockstep by its release flow (docs/10-distribution.md).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/frontmatter-fill.ts
CHANGED
|
@@ -16,9 +16,14 @@
|
|
|
16
16
|
* - **identity = peer personality** (нюанс 10): `resolveAgentName` prefers
|
|
17
17
|
* `PEER_PERSONALITY`, falling back to `IAPEER_MEMORY_AGENT_NAME`.
|
|
18
18
|
*
|
|
19
|
-
* Zone behaviour (parity with the reference):
|
|
19
|
+
* Zone behaviour (parity with the reference, one deliberate deviation):
|
|
20
20
|
* - inbox: idempotent fill of the 4-field draft frontmatter +
|
|
21
|
-
* needs_review (unless curator)
|
|
21
|
+
* needs_review (unless curator) + UPSERT of the stamp pair
|
|
22
|
+
* (last_edited_by, updated) — a deviation from the reference,
|
|
23
|
+
* load-bearing for the unstamped detector: its inbox branch
|
|
24
|
+
* discriminates by «the stamp pair did not move», which is
|
|
25
|
+
* only a signal when hook edits DO move it (false-positive
|
|
26
|
+
* incident 11.06, boris's Write+Edit repro).
|
|
22
27
|
* - permanent: upsert of service fields (last_edited_by, updated,
|
|
23
28
|
* needs_review).
|
|
24
29
|
* - memory: PERMANENT service-field semantics + idempotent fill of the
|
|
@@ -162,9 +167,19 @@ export function resolveZone(
|
|
|
162
167
|
|
|
163
168
|
export function fillInbox(
|
|
164
169
|
fmBlock: string,
|
|
165
|
-
opts: { path: string; agent: string; today: string; ctx: FillContext },
|
|
170
|
+
opts: { path: string; agent: string; today: string; nowStamp: string; ctx: FillContext },
|
|
166
171
|
): string {
|
|
167
172
|
const { taxonomy } = opts.ctx;
|
|
173
|
+
// STAMP PAIR (дефект-репро boris 11.06, ложный unstamped): upsert как в
|
|
174
|
+
// fillPermanent/fillMemory. Без неё у inbox-черновиков пара тождественно
|
|
175
|
+
// (null, null) — «штамп не двинулся» детектора немых записей выполняется
|
|
176
|
+
// на ЛЮБОЙ легитимной хук-правке, и inbox-ветка вырождается в «hash
|
|
177
|
+
// двинулся → unstamped» (7 ложных ре-стампов за день 11.06). Оба поля
|
|
178
|
+
// сервисные для smart-hash → семантический hash и INBOX_NEW-диффы не
|
|
179
|
+
// двигаются, эхо невозможно. Побочный выигрыш: source-фильтр кураторов
|
|
180
|
+
// INBOX_NEW впервые получает живой last_edited_by.
|
|
181
|
+
fmBlock = upsert(fmBlock, "last_edited_by", opts.agent);
|
|
182
|
+
fmBlock = upsert(fmBlock, "updated", opts.nowStamp);
|
|
168
183
|
fmBlock = setIfMissing(fmBlock, "title", basenameNoExt(opts.path));
|
|
169
184
|
fmBlock = setIfMissing(fmBlock, "status", taxonomy.statusTokens.draft);
|
|
170
185
|
fmBlock = setIfMissing(fmBlock, "created", opts.today);
|
|
@@ -495,7 +510,7 @@ export function processFile(filePath: string, opts: ProcessOptions): boolean {
|
|
|
495
510
|
|
|
496
511
|
let newFm: string | null;
|
|
497
512
|
if (zone === "inbox") {
|
|
498
|
-
newFm = fillInbox(fmBlock, { path: filePath, agent: opts.agent, today, ctx });
|
|
513
|
+
newFm = fillInbox(fmBlock, { path: filePath, agent: opts.agent, today, nowStamp, ctx });
|
|
499
514
|
} else if (zone === "permanent") {
|
|
500
515
|
newFm = fillPermanent(fmBlock, { agent: opts.agent, nowStamp, ctx });
|
|
501
516
|
} else {
|
|
@@ -22,7 +22,11 @@
|
|
|
22
22
|
* inbox — UNCONDITIONAL: humanEditPass does not cover the agent inbox at
|
|
23
23
|
* all, human edits there are marginal, and the curator-masquerade
|
|
24
24
|
* (memoryd's 822-suppress) plus the silent author edit are both closed
|
|
25
|
-
* by one branch.
|
|
25
|
+
* by one branch. PRECONDITION (the 11.06 false-positive lesson, boris's
|
|
26
|
+
* Write+Edit repro): the rule is only a discriminator because fillInbox
|
|
27
|
+
* UPSERTS the stamp pair on every hook edit — before that fix the pair
|
|
28
|
+
* was identically (null, null) for author drafts, «stamp unmoved» held
|
|
29
|
+
* vacuously and every second legitimate edit re-stamped as unstamped.
|
|
26
30
|
*
|
|
27
31
|
* Attribution token: `unstamped` — NEUTRAL on purpose (the mechanism
|
|
28
32
|
* cannot tell a Bash agent from a human outside Obsidian; a false «agent»
|