memex:steward:reconcile-orphan
Authorized fix-up of a flagged orphan. Four actions — delete-index (remove documents row), repair (backfill row_id when target exists), reindex (re-run Librarian; deferred), note (acknowledge). Raises OrphanNotFoundError when index_id is unknown or, for repair, already linked.
- License 许可
- MIT
- 所属仓库
- nitekeeper/memex
- 最近更新
- 2026-09-22
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- memex:steward:reconcile-orphan
- description
- Authorized fix-up of a flagged orphan. Four actions — delete-index (remove documents row), repair (backfill row_id when target exists), reindex (re-run Librarian; deferred), note (acknowledge). Raises OrphanNotFoundError when index_id is unknown or, for repair, already linked.
03 SKILL.md 正文
memex:steward:reconcile-orphan
When to use
After reviewing an audit report and deciding how to resolve a specific finding, or after a consumer's bootstrap sweep detects orphan-class rows in its own store and needs to either delete the dangling Index row or backfill the link.
Inputs
index_id— the orphaned row's identifieraction— one of:delete-index— remove thedocumentsrow and itsrelationsrows (use when the target store row is gone, or when no matching target row can be found by other means)repair— backfilldocuments.row_idfrom a known target PK (use when the target row exists but the link was never written — the forward-orphan class where Index committed, target committed, but therow_idwrite was lost). Requiresrepair_row_id.reindex— re-run Librarian on the target row (reverse-orphan case; deferred — raisesNotImplementedError)note— leave as-is but record acknowledgment in~/.memex/audits/reconciliation-log.md
repair_row_id(repair only) — the target store's primary-key value to bind intodocuments.row_idnote_text(note only) — free-form acknowledgment text
Errors
OrphanNotFoundError(index_id)— raised whenindex_iddoesn't exist indocuments(all actions), or when called withrepairagainst a row whoserow_idis already populated (i.e., not a link-missing orphan). Catch by class; the exception carriesindex_idandreasonattributes.ValueError— invalid action, missingrepair_row_id, unregistered target store, orrepair_row_idnot present in the target table.
Audit trail
Every action writes a row to ~/.memex/audits/reconciliation-log.md (delete-index, repair, note). Reverse-orphan reindex is deferred.
Returns
{"action": "<action>", "index_id": "<id>", "result": "<removed|linked|logged>", ...}
repair additionally returns "row_id": "<repaired_row_id>".
Implementation
scripts/agents/data_steward.py:reconcile_orphan(). Reverse-orphan reindex raises NotImplementedError until Plan 4 re-embedding tooling lands.
04 同仓库更多 Skills
run
Use to invoke any Memex v2.0 operation. Routes user-facing intents (ingest, ask, capture, lint, synthesize, dashboard) and agent-facing CRUD primitives to the right internal procedure.
memex:steward:dashboard
Launch a loopback-only, read-only HTTP dashboard over Memex — per-store summary, the federated index, knowledge communities, the code-navigation graph, and the agent registry, plus keyword search, a click-to-read content overlay, and an interactive 3D knowledge-graph view.
memex:steward:audit
Run a full integrity audit across the Memex Index and all registered stores. Detects orphans, broken relations, schema drift. Writes a structured audit report to ~/.memex/audits/. Read-only — never auto-fixes.
memex:steward:audit-store
Run an integrity audit scoped to a single registered store (reverse orphans + schema drift). Lighter than full audit.
memex:index:write
Direct write to the federated Index — the lower-level primitive that memex:brain:ingest and memex:brain:capture build on. Use when a consumer (Atelier, custom plugin) needs to add a document to its own store and have it indexed by the Librarian, without going through the Brain layer. Routes through Librarian subagent + Memex Core.
memex:index:search
Federated search across every registered Memex store via the Reference Librarian. Lower-level primitive that memex:brain:ask builds on — use directly when a consumer (Atelier, custom plugin) needs raw query results without Brain-specific formatting.