Repository navigation
Conversation
…n-gate # Conflicts: # internal/database/migrations/migrations_test.go
Reject duplicate filesystem Lexicon IDs, return reliable Lexicon timestamps, and cover existing-row migration upgrades. Bound CAR error details and apply the remaining focused test, formatting, and operator-documentation fixes.
Filter endorsement closure inputs to valid records and align local API smoke checks with raw validation metadata and typed visibility.
…n-gate # Conflicts: # .agents/skills/hyperindex/references/schema-reference.md # cmd/hyperindex/main.go # internal/graphql/schema/builder.go # internal/graphql/schema/builder_test.go # internal/graphql/subscription/handler.go # internal/graphql/subscription/handler_test.go # internal/graphql/subscription/pubsub.go
validation: add record validation gate
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: GainForest/hyperindex/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| svc.validator, err = validation.NewValidatorFromLexiconBytes(savedLexicons) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to build startup Lexicon snapshot: %w", err) | ||
| } |
There was a problem hiding this comment.
Startup guidance remains stale
The fixed startup Lexicon snapshot and validation-refresh workflow change configuration and migration behavior, but AGENTS.md still omits the restart-only application model and startup refresh requirements, leaving future operational and maintenance work based on stale repository guidance.
Context Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Bundle the workscope CEL Lexicon dependency
Collections listed in RECORD_HISTORY_COLLECTIONS (exact NSIDs or prefix.* patterns, Tap mode) now keep every observed version in a new record_version table: one row per distinct CID plus delete tombstones, written before the current-state upsert so Tap redelivery keeps both consistent and repeats are no-ops. Startup seeds a baseline row per existing record without history. The root recordHistory(uri, first) GraphQL query returns versions oldest first. Off by default. Motivation: GainForest needs the label edit history of observations (app.gainforest.dwc.occurrence), meaning who changed a species name and when. Public Jetstream misses most certified.one events, so the indexer's Tap stream is the only reliable source.
- Dedupe on a version key: the CID, a sha256 of the body when Tap sends no CID, or delete:<cid> for tombstones. CID-less edits no longer collapse into one version and redelivered deletes are no-ops. - Write the delete tombstone before removing the record and fail the event if it cannot be written, so Tap retries instead of losing the tombstone. - recordHistory pages with an `after` version id; `first` must be 1-500. - Switch history on only after baseline seeding succeeds, so a failed seed never leaves records whose baseline the next seed would skip. - Docs: deletes have a null value, paging, history stays queryable after a collection is removed.
Opt-in record version history (recordHistory query)
Deleting a record now removes its stored versions (instead of adding a tombstone), and PurgeActorData removes an account's versions together with its records, so deleted, deactivated or taken-down accounts leave no queryable past versions. The purge runs on every delete delivery and even for collections no longer tracked, so history recorded earlier is never stranded. Migration 016 indexes record_version(did) for account purges.
Addresses review on #137: - RecordsRepository.Delete, DeleteReturning and DeleteByDID now delete the record's record_version rows in the same transaction as the record, so no query ever sees history for a deleted record and every delete path (Tap, legacy Jetstream, backfill resets) inherits it. The handler-level purge and RecordVersionsRepository.DeleteByURI are gone. - Migration 016 (renamed record_version_honor_deletes) removes what 015-era builds stored: delete tombstones, versions before a tombstone, and history of records that no longer exist (including purged accounts), then adds the did index.
Record history: delete versions with the record or account
No description provided.