docs: precheck msglib message source

This commit is contained in:
zhaoyilun
2026-07-10 08:30:46 +08:00
parent 78f0e47547
commit 1a21a01184
4 changed files with 169 additions and 12 deletions

View File

@@ -2560,17 +2560,57 @@ MsgLib enrichment operator runbook result:
- Map candidate message tables/columns to the `isphere_receive_messages` contract fields.
- Do not print or commit message bodies, file paths, entity values, raw rows, or copied DB contents.
- [ ] **Step 1: Collect message-table schema evidence**
- [x] **Step 1: Collect message-table schema evidence**
Review existing schema extraction docs and optional sidecar metadata for `tblPersonMsg`, `tblMsgGroupPersonMsg`, `tblRecent`, and related file/message tables.
Reviewed committed C26 schema extraction docs and the ignored C26 schema-only x86 JSON for table/column names and row counts only. Confirmed `tblPersonMsg`, `tblMsgGroupPersonMsg`, `TD_SystemMessageRecord`, `TD_GroupReceiptMessage`, `TD_ReceiveFileRecord`, `TD_SendFileRecord`, and `tblRecent` are the relevant message-source candidates.
- [ ] **Step 2: Map candidate fields to receive-message contract**
- [x] **Step 2: Map candidate fields to receive-message contract**
Document which fields may map to message id, conversation id/type, sender/receiver, timestamp, body/text, subject, receipt/read state, and attachment metadata; mark gaps explicitly.
Created `docs/source-discovery/2026-07-10-msglib-message-source-precheck.md` with direct/group/system field mapping hypotheses. It marks `MsgText`/`MessageBody`, `FilePath`, receipt semantics, subject gaps, pagination/order, and PacketReader-vs-DB completeness as explicit unresolved gaps.
- [ ] **Step 3: Decide next implementation slice**
- [x] **Step 3: Decide next implementation slice**
Choose between a metadata-only sidecar extension, a bounded DB-backed receive source, or keeping PacketReader as primary until more evidence exists.
Decision: do not jump directly to body-returning DB message listing. C36 should add a metadata-only MsgLib sidecar operation such as `message_sources`, returning table availability, required/present columns, and row counts only. Verification passed: `git diff --check`, `go test ./...`, and evidence-backed `scripts\verify-msglib-sidecar.ps1`.
---
## Loop C35 Result
MsgLib message-table source precheck result:
- Created `docs/source-discovery/2026-07-10-msglib-message-source-precheck.md`.
- `tblPersonMsg` is a strong direct-message candidate; `tblMsgGroupPersonMsg` is a strong group-message candidate; `TD_SystemMessageRecord`, `TD_GroupReceiptMessage`, and file-record tables are secondary/join candidates.
- C35 mapped candidate columns to the `isphere_receive_messages` contract without reading row values.
- Decision: next implementation should be metadata-only `message_sources`, not DB message body listing yet.
---
## Loop C36: MsgLib message-source metadata sidecar
**Goal:** Add a bounded metadata-only sidecar operation that reports MsgLib message-source readiness for future DB-backed receive-message work.
**Planned files:**
- Modify: `native/MsgLibReadSidecar/Program.cs` and/or protocol files.
- Modify: `internal/msglib/sidecar_client.go` and tests.
- Modify: `scripts/verify-msglib-sidecar.ps1`.
- Modify: `docs/msglib-read-sidecar-contract.md`, matrix/status/plan.
**Planned behavior:**
- Add op such as `message_sources`.
- Return table availability, required/present columns, safe row counts, and source role metadata only.
- Do not return `MsgText`, `MessageBody`, `FilePath`, entity values, raw rows, sends, downloads, hooks, injection, or DB writes.
- [ ] **Step 1: Write failing Go client/sidecar tests for message-source metadata**
Test request/response decoding and bounded metadata shape with a fake sidecar before implementation.
- [ ] **Step 2: Implement sidecar metadata operation**
Expose message-source readiness using existing read-only schema/count helpers and allowlisted table/column maps.
- [ ] **Step 3: Verify default and evidence-backed smokes**
Update `scripts\verify-msglib-sidecar.ps1` to assert sanitized message-source metadata when copied DB env is configured, then run the full gate.
---