Skip to content

fix(enrichment): reject generated titles for superseded content - #205

Merged
johnny4young merged 5 commits into
mainfrom
fix/content-bound-titles
Oct 8, 2026
Merged

johnny4young merged 5 commits into
mainfrom
fix/content-bound-titles

Conversation

@johnny4young

@johnny4young johnny4young commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Finding

A generated title can complete after its captured body has been edited. The existing empty-title predicate protects manual titles but permits an annotation for the old body to label the new body.

Correction

  • Add optional ContentBoundTitleStoring without removing existing ClipEnriching requirements.
  • Apply one guarded GRDB UPDATE: exact full body, still-empty title, live/unarchived/non-sensitive text-backed row and known eligible kind.
  • Route generated-title persistence through that capability. A custom store without it skips generated titles rather than falling back to an unsafe write; production GRDB implements it.
  • Invoke the title callback only after an accepted write. Rejected results do not dirty upload state or consume the free title taste.
  • Inject the annotator for continuation-controlled tests. OCR, embedding behavior, prompts, model choice and manual-title editing are unchanged.
  • Document body identity, compatibility and content-equal ABA behavior.

Dependency and exact source

Stacked on #204, base branch fix/content-bound-embeddings at 919acb3.
Exclusive title diff: seven files, 279 additions, six deletions. The parent embedding fix and its one-comma formatter correction are inherited, not repeated independent findings.
Head: 3635b10
Verified local/remote tree: 563196a31ebb4f6e568141507c8a5a21c112c1c9

The earlier draft tree was refreshed to remove the analogous trailing comma in the title test before publication. No assertion or gate was relaxed. Review/integrate #204 before this child; no merge has been performed.

Regression evidence

  • Portable extracted-SQL red/green reproduction: the old predicate writes the stale title after a body edit; the guarded predicate rejects it without dirtying, and accepts matching current text.
  • Four native persistence tests cover changed body/upload bookkeeping, manual-title precedence, missing/recreated identities and privacy/expiry/kind eligibility.
  • A deterministic annotator-barrier test covers changed and unchanged body, accepted callback count and absence of unsafe fallback; no sleeps or model downloads.
  • Existing enrichment and ingestion test doubles implement the new guarded capability.
  • git diff --check passes, and reconstructed local staged tree equals the published tree.
  • This Linux executor lacks Swift/Xcode; make format, make lint and make test are blocked locally, not passed. Exact-head hosted CI 37691238311 supplies native qualification: strict swift-format, SwiftLint and build-warning checks pass; 1,512 package tests in 236 suites pass; production-source coverage is 83.8%, above the unchanged 80% floor. All four new persistence tests and both parameterized annotator-barrier cases pass, along with inherited embedding regressions. StoreKit entitlement tests and both macOS/iOS app builds pass. GitGuardian passes; the non-blocking beta canary was skipped as expected. Scoped exact-head gates are complete; ready for review. No UI layout or interaction flow changed, and the separate full UI workflow was not dispatched.

Limits and reviewer focus

Review the transaction predicate, optional-capability compatibility and callback/upload semantics. Content-equal ABA is valid if the current row remains eligible and untitled; different replacement text is rejected. This does not retroactively repair existing titles or add a new enrichment scheduler.
No UI layout, schema, dependency, threshold, workflow, license, permission, live clipboard, merge, release or deployment changes. No combined qualification of other open repairs is claimed.

@johnny4young
johnny4young marked this pull request as ready for review October 7, 2026 21:59
claude added 2 commits October 8, 2026 04:44
- Exclude only kinds without a text body from the guarded title write, so
  masked and newer kinds keep the generated titles capture planned for them
- Use the shared read visibility rule, so an expired pinned, boarded or
  snippet row stays titleable
- Cover both rules and describe the eligibility in the titles notes
Base automatically changed from fix/content-bound-embeddings to main October 8, 2026 12:28
@johnny4young
johnny4young merged commit d72cd09 into main Oct 8, 2026
4 checks passed
@johnny4young
johnny4young deleted the fix/content-bound-titles branch October 8, 2026 15:28
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