contact-data-fidelity
Use when changing contact fields, the neutral Card model, vCard/JSContact/CSV conversion, sanitization, or loss handling.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 4
- Forks
- 2
01 前言 Front Matter
- name
- contact-data-fidelity
- license
- MIT
- description
- Use when changing contact fields, the neutral Card model, vCard/JSContact/CSV conversion, sanitization, or loss handling.
02 资源文件 2
- 参考文档references/data-flow.md2.8 KB
- 参考文档references/fidelity-test-matrix.md2.3 KB
03 SKILL.md 正文
Contact data fidelity
Outcome: a contact change that survives every representation without silently
dropping data. Read backend/AGENTS.md (traps #2 and #3) and
docs/adrs/0001-neutral-hub-and-spoke-contact-model.md first.
The canonical flow is: request/import → neutral contactmodel.Card → flat
contacts columns → projections (RecordForContact) → exporters. The e2e
setup in frontend/e2e/global-setup.ts hardcodes http://localhost:7300; it is
test infrastructure, not a production default.
Steps
- Open data-flow and identify every hop your field
touches. A field with no flat-column home must still round-trip through
RecordForContact;RecordFromContactrebuilds from flat fields and drops it. - Write through
ApplyRecordToContact(never setContact.Card/CRMdirectly). On update, merge throughbackend/models/contact_card_merge.go; preserve itsmergeMediaremote-photo rule. - Decide sensitivity (
normal|private|secret). Anything abovenormalis filtered in the query for sync/shares/neutral-Cardexports and re-included only through that surface's explicit include flag; CSV export, account bundle, and contact map are the three deliberate full-fidelity exceptions. - Update the correspondence oracle (
backend/correspondence/testdata/correspondence.tsv) when the field's cross-format mapping changes, then regenerate the DATA-01 matrix withgo run ./cmd/gencompatmatrix. - Open fidelity test matrix to choose the owning test rather than duplicating round-trip assertions in a new package.
- Keep the web and Android clients on the same generated contract; run the frontend type check even when you only touched Go.
DoD
cd backend && go test ./correspondence/... ./vcard3/... ./vcard4/... ./jscontact/... ./internal/rfctest/...
cd backend && go run ./cmd/gencompatmatrix
cd frontend && npx tsc --noEmit
Report any check you could not run; never imply it passed.
Stop and ask
- The field has no neutral-model or flat-column home and the proposal is to expose it only in one exporter.
- A conversion would be lossy in a way the compatibility matrix cannot express.
- The change would weaken the sensitivity filter on a leaving copy.
Canonical detail: docs/data-model.md, backend/AGENTS.md (Domain notes),
docs/data-01-field-compatibility-matrix.md.
04 同仓库更多 Skills
valid
Use when exercising a well-formed skill fixture in the agent-context tests.
unregistered-dod
Use when a fixture must carry a DoD command no Suite registers.
orphan-reference
Use when a fixture must exercise an unlinked reference file.
missing-reference
Use when a fixture must link to a reference file that does not exist.
missing-description
暂无简介
long-reference
Use when a fixture must exceed the reference line maximum.