Skip to content

docs: Document import key matching and per-field override semantics - #18

Open
cristidrg wants to merge 5 commits into
mainfrom
cristidrg/docs-import-field-semantics
Open

docs: Document import key matching and per-field override semantics#18
cristidrg wants to merge 5 commits into
mainfrom
cristidrg/docs-import-field-semantics

Conversation

@cristidrg

@cristidrg cristidrg commented Sep 10, 2026

Copy link
Copy Markdown

Description

Refreshes all six schema files from the monorepo generator (yarn workspace @theydo/external-format refresh).

Substantive change — only one:

  • InsightsFile.schema.json: adds the personas field (array of persona share URLs …/p/<shareKey>, nullable). Personas that do not exist in the target workspace are ignored — imports never create personas.

Everything else is generator churn, verified semantically equivalent:

  • SurveyResponsesFile / FeedbackResponsesFile: $ref/$defs indirection inlined; resolved schemas are byte-identical to the old ones.
  • MetricsFile, OpportunitiesFile, SolutionsFile: key ordering/formatting only — zero semantic changes.

Documents the per-field update semantics for the JSON entity imports (THEYDO_INSIGHTS_V1, THEYDO_OPPORTUNITIES_V1, THEYDO_SOLUTIONS_V1), shipped in theydo/theydo#26312:

  • Import Key and Overrides — records are matched by importKey (unknown creates, known updates), plus the omit / null / value table: an omitted key preserves existing data, null clears, a value sets (lists replace membership exactly).
  • Fields with special matching behaviorownerEmail and personas are matched against existing users/personas and never created; status/type and tags/tag groups are created when missing; tags+groupTags form one merged set; out-of-range empathyScore is ignored.
  • Notes that these semantics are specific to JSON (a CSV import cannot express an omitted field) and cross-references the survey/feedback persona matching, which is a different mechanism but likewise never creates personas.
  • Replaces the old "Treatment of ownerEmail property" subsection, now covered by the generic rule plus the ownerEmail row.

🤖 Generated with Claude Code

cristidrg and others added 2 commits September 10, 2026 12:42
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cristidrg
cristidrg marked this pull request as ready for review September 10, 2026 09:46
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@drye drye left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this up, Cristian. I checked it against the import behavior we just merged, and the omit / null / value table is right. Same for the special cases: unknown ownerEmail does not wipe the current owner, a persona list that matches nothing is left alone, tags and groupTags are one merged set, out of range empathyScore is ignored, and CSV cannot omit a field.

I hope I'm not getting this wrong, but this README now tells people they can send personas on insights, but schemas/InsightsFile.schema.json still does not declare that field, and extra keys are rejected. s3tcli test-format will fail a file that follows this doc. Ingest already accepts personas (array of share URLs, or null). Could you add that field to the insights schema here so the docs and the validator agree?

Smaller thing: the schema files still say to read "Treatment of ownerEmail", which this PR removes. Updating those descriptions to the new section name would keep the pointer working.

Comment thread README.md
| Field | Behavior |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ownerEmail` | Matched against existing workspace users by email. Imports **never create users**. If the email doesn't match any user, the current owner is left unchanged (a typo never wipes ownership); on create the entity simply has no owner. `null` clears the owner; omitted leaves it. |
| `personas` (insights only) | Takes full persona share URLs (`…/p/<shareKey>`), matched against **existing** personas in the workspace. Imports **never create personas**. Unknown personas are dropped from the list. If a non-empty list matches nothing at all, existing persona links are left untouched — send `[]` or `null` to explicitly unlink all. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches ingest. schemas/InsightsFile.schema.json does not declare personas though, and extra keys are rejected, so s3tcli test-format will fail a file that follows this row. Can we add the field here (array of share URL strings, or null) so the schema matches the docs?

@cristidrg cristidrg Sep 10, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, I noticed this repo is out of sync as well with master in regards to personas (and probably other things?). Was chatting with Andres about it

cristidrg and others added 2 commits September 10, 2026 15:15
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
chore: Sync generated JSON schemas (adds personas to insights)
@cristidrg
cristidrg requested a review from drye September 10, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants