Skip to content

Preserve deleted entity types in tombstones#681

Merged
dahlia merged 10 commits intofedify-dev:mainfrom
dahlia:former-type
Apr 16, 2026
Merged

Preserve deleted entity types in tombstones#681
dahlia merged 10 commits intofedify-dev:mainfrom
dahlia:former-type

Conversation

@dahlia
Copy link
Copy Markdown
Member

@dahlia dahlia commented Apr 16, 2026

Why this is a little unusual

The surprising part of this PR is that formerType is not implemented as a normal object-valued property. In Fedify, the ordinary object-property path is built around Object | URL, async accessors, and optional dereferencing. That would be the wrong model here, because formerType is really a reference to a vocabulary entity class, not a remote object reference.

Another surprising point is what this PR does not do. The branch no longer rewrites the ActivityStreams context semantics for formerType. I originally tried making compact JSON-LD emit bare values like "Person", but that relies on @vocab semantics and creates an interoperability risk for consumers that load the standard https://www.w3.org/ns/activitystreams context, where formerType is still @id-typed. After review, I backed that change out. The current branch keeps the standard semantics, which means compact output stays at values like "as:Person".

Another place where it would be easy to make the wrong change is the encoder. I intentionally did not add a handwritten compact encoder for entity types. The generator always emits the expanded @id form, and JSON-LD compaction is left to the active context. That keeps the context-sensitive logic in the JSON-LD layer instead of hard-coding it in a special serializer branch.

What changed

  • Added Tombstone.formerType in packages/vocab/src/tombstone.yaml as a non-functional property with a singular accessor.
  • Introduced the fedify:vocabEntityType pseudo-scalar in packages/vocab-tools/src/type.ts and wired it through code generation in packages/vocab-tools/src/class.ts, packages/vocab-tools/src/codec.ts, and packages/vocab-tools/src/schema.ts.
  • Generated code in packages/vocab/src/vocab.ts now exposes $EntityType, isEntityType(), and getEntityTypeById() so generated properties can accept Fedify entity constructors rather than arbitrary IRIs.
  • Made unknown incoming formerType values non-fatal: they are ignored with a warning instead of making the whole Tombstone fail to parse.
  • Updated examples and docs in docs/manual/actor.md and docs/manual/context.md, and recorded the new behavior in CHANGES.md.
  • Followed up on review findings by resetting LogTape state in the unknown-formerType regression test, tightening the generated entity type lookup helpers, and fixing malformed changelog references.

Notes for reviewers

The write-side API is intentionally constructor-only, for example new Tombstone({ formerType: Person }). I did not allow Person.typeId or arbitrary URL input because that weakens the type contract and makes it too easy to pass the wrong IRI by accident.

I also kept the first implementation intentionally narrow. formerType currently accepts only Fedify-known entity classes. It does not try to preserve unknown external vocabulary types on the write side yet. That felt like the right trade-off for the first pass, because the escape hatch for external types deserves its own design instead of being smuggled into this change.

The generator now rejects mixed ranges that include fedify:vocabEntityType. I was careful about that because otherwise the decoder would have to disambiguate vocabulary type IRIs from ordinary IRIs at runtime, which is exactly the sort of ambiguity that looks fine in TypeScript but gets messy on the wire.

One small but deliberate cleanup is in packages/vocab/src/vocab.test.ts: the warning-path regression test resets LogTape state in a finally block, and the assertion now checks structured LogRecord fields instead of stringifying the whole record. That looks a little fussy, but without it the temporary global logger configuration can leak into later tests, and the older assertion shape was more brittle than it needed to be.

The parts I was most careful about while implementing this were the generated decode path and the distinction between type references and object references. It is very easy to end up with a version that type-checks but either treats formerType as fetchable or accepts arbitrary IRIs at the API boundary. The regression tests are meant to pin down exactly those edges.

Testing

  • mise test

The latest mise test run on the current branch passed.

Closes #645

dahlia added 4 commits April 16, 2026 20:32
Teach the vocabulary generator about fedify:vocabEntityType so
schema-defined properties can accept generated entity constructors
instead of arbitrary IRIs. This adds the generated $EntityType
helpers, validates ambiguous schema ranges, and lets scalar decoders
skip unknown entity type references.

Also add regression tests and refresh the vocab-tools snapshots so the
generator output stays pinned across runtimes.

fedify-dev#645

Assisted-by: OpenCode:gpt-5.4
Add Tombstone.formerType as a generated vocab entity type reference
so deleted actors can advertise what kind of entity was removed.
This also patches the bundled and fixture ActivityStreams contexts so
compact JSON-LD uses plain type tokens like Person, and adds
regression tests for round-tripping and unknown remote values.

fedify-dev#645

Assisted-by: OpenCode:gpt-5.4
Update the deleted actor examples to show how applications can include
formerType information in tombstones and inspect it through
getActor(..., { tombstone: "passthrough" }). Also record the new
vocab, vocab-runtime, and vocab-tools behavior, including the
generated entity type helpers, in the changelog.

fedify-dev#645

Assisted-by: OpenCode:gpt-5.4
Restore LogTape's global state after the unknown formerType regression
test so later vocab tests do not inherit the temporary buffer logger
configuration. This keeps the test isolated and avoids order-dependent
side effects during full-suite runs.

fedify-dev#645

Assisted-by: OpenCode:gpt-5.4
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Tombstone.formerType support (typed to generated vocabulary entity constructors), emits generated entity-type helpers ($EntityType, isEntityType(), getEntityTypeById()), introduces fedify:vocabEntityType scalar with validation, and makes tombstone parsing ignore unknown formerType IRIs while logging a warning.

Changes

Cohort / File(s) Summary
Changelog & docs
CHANGES.md, docs/manual/actor.md, docs/manual/context.md
Documented formerType support, updated examples and log output to include formerType.
Vocab schema
packages/vocab/src/tombstone.yaml
Added formerType/formerTypes property with range fedify:vocabEntityType.
Vocab runtime & tests
packages/vocab/src/vocab.test.ts, packages/vocab/src/type.test.ts, packages/vocab/src/vocab.ts (generated)
Exported/used generated entity-type helpers; added tests for Tombstone serialization/parsing, unknown formerType warning capture, and entity-type helper behavior.
Generator — class output
packages/vocab-tools/src/class.ts, packages/vocab-tools/src/class.test.ts
Added generation of $EntityType union, entityTypes array, entityTypeIds map, and exported isEntityType() / getEntityTypeById(); tests for generated output and tombstone typings.
Generator — scalar/type system
packages/vocab-tools/src/type.ts, packages/vocab-tools/src/schema.ts, packages/vocab-tools/src/schema.test.ts
Added fedify:vocabEntityType scalar; decoder/guard/encoder/dataCheck behaviors; validation to reject mixed ranges containing fedify:vocabEntityType; tests for rejection.
Generator — codec behavior
packages/vocab-tools/src/codec.ts
Aligned single-range decoding to check for undefined before pushing, matching multi-range behavior.
Federation tests
packages/fedify/src/federation/handler.test.ts
Updated tests to include formerType: Person on dispatched Tombstone and adjusted expected JSON-LD.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

component/build, component/testing

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title "Preserve deleted entity types in tombstones" accurately and concisely describes the main change—adding formerType support to Tombstone to preserve the original vocabulary class of deleted entities.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, explaining the unusual implementation design choices (non-standard property handling, JSON-LD semantics, encoder behavior), changes made across multiple packages, and intentional limitations of the first implementation.
Linked Issues check ✅ Passed The PR fully implements the objective from issue #645: adds Tombstone.formerType as a typed property, accepts Fedify constructor classes (option 2), enables type-safe preservation of deleted entity classes, and follows existing patterns while avoiding ambiguous runtime decoding [#645].
Out of Scope Changes check ✅ Passed All changes are within scope of implementing formerType, including documentation updates, test additions, generator enhancements for fedify:vocabEntityType, and supporting utility functions—no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@issues-auto-labeler issues-auto-labeler bot added activitypub/compliance Specification compliance breaking change Requires backward-incompatible change component/build Build system and packaging component/federation Federation object related labels Apr 16, 2026
@dahlia dahlia requested a review from Copilot April 16, 2026 12:39
@dahlia dahlia self-assigned this Apr 16, 2026
@dahlia dahlia added type/enhancement Improvements to existing features component/vocab Activity Vocabulary related component/vocab-tools Vocabulary code generation (@fedify/vocab-tools) and removed component/federation Federation object related breaking change Requires backward-incompatible change component/build Build system and packaging labels Apr 16, 2026
@dahlia dahlia added this to the Fedify 2.2 milestone Apr 16, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Tombstone.formerType to the ActivityStreams vocabulary, enabling deleted objects to retain their original type during round-trips. It adds a new fedify:vocabEntityType pseudo-scalar to the vocabulary generator, which produces a type-safe $EntityType union and associated helper functions. The ActivityStreams context has been updated to treat formerType as a vocabulary term. Feedback indicates that the vocabulary generator needs to ensure getLogger is imported in the generated code to avoid a potential ReferenceError during decoding.

Comment thread packages/vocab-tools/src/type.ts
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vocab-tools/src/schema.test.ts`:
- Around line 233-246: Replace the manual try/catch assertion with a direct
throws assertion: call the test helper throws(() => validateTypeSchemas(types),
...) instead of capturing error in a temporary variable; assert that the thrown
error is a TypeError and that its message equals the expected string (the
current message about Tombstone.formerType). Locate the assertion around
validateTypeSchemas in schema.test.ts and update it to use throws with the same
expected error class and message to make the contract explicit.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c7a62774-7d5f-4e95-b63d-fae79a62899e

📥 Commits

Reviewing files that changed from the base of the PR and between 977bbf1 and 3d19f76.

⛔ Files ignored due to path filters (4)
  • packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap is excluded by !**/*.snap
  • packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap is excluded by !**/*.snap
  • packages/vocab-tools/src/__snapshots__/class.test.ts.snap is excluded by !**/*.snap
  • packages/vocab/src/__snapshots__/vocab.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (15)
  • CHANGES.md
  • docs/manual/actor.md
  • docs/manual/context.md
  • packages/fedify/src/federation/handler.test.ts
  • packages/fixture/src/fixtures/www.w3.org/ns/activitystreams.json
  • packages/vocab-runtime/src/contexts/activitystreams.json
  • packages/vocab-tools/src/class.test.ts
  • packages/vocab-tools/src/class.ts
  • packages/vocab-tools/src/codec.ts
  • packages/vocab-tools/src/schema.test.ts
  • packages/vocab-tools/src/schema.ts
  • packages/vocab-tools/src/type.ts
  • packages/vocab/src/tombstone.yaml
  • packages/vocab/src/type.test.ts
  • packages/vocab/src/vocab.test.ts

Comment thread packages/vocab-tools/src/schema.test.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds first-class support for ActivityStreams Tombstone.formerType in @fedify/vocab, modeling it as a reference to a known Fedify vocabulary entity constructor (not an object/URL reference), and updates JSON-LD context handling to ensure clean compact round-trips (e.g., "Person" rather than "as:Person").

Changes:

  • Added formerType/formerTypes to Tombstone schema and generated API, plus entity-type helper exports ($EntityType, isEntityType(), getEntityTypeById()).
  • Introduced fedify:vocabEntityType pseudo-scalar in the vocab generator with encode/decode support (including warning-and-ignore behavior for unknown incoming values).
  • Patched bundled + fixture ActivityStreams contexts (formerType uses @vocab) and updated docs/tests/changelog accordingly.

Reviewed changes

Copilot reviewed 16 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/vocab/src/tombstone.yaml Adds formerType property definition for Tombstone.
packages/vocab/src/vocab.test.ts Adds serialization/parse regression tests for formerType and warning behavior.
packages/vocab/src/type.test.ts Adds tests for new entity-type helper functions.
packages/vocab/src/snapshots/vocab.test.ts.snap Updates snapshots for Tombstone inspection output.
packages/vocab-tools/src/type.ts Adds fedify:vocabEntityType pseudo-scalar encode/decode/type-guard hooks.
packages/vocab-tools/src/codec.ts Adjusts generated decoders to skip undefined decoded values (supports “ignore unknown” behavior).
packages/vocab-tools/src/schema.ts Rejects mixed ranges involving fedify:vocabEntityType to avoid decoder ambiguity.
packages/vocab-tools/src/schema.test.ts Adds regression test for the new schema validation rule.
packages/vocab-tools/src/class.ts Emits $EntityType helpers and runtime lookup structures into generated vocab output.
packages/vocab-tools/src/class.test.ts Tests codegen output for $EntityType helpers and integration into generated properties.
packages/vocab-tools/src/snapshots/class.test.ts.snap Updates snapshots for new decoder structure and Tombstone formerType codegen.
packages/vocab-runtime/src/contexts/activitystreams.json Changes formerType coercion to @vocab for correct compaction behavior.
packages/fixture/src/fixtures/www.w3.org/ns/activitystreams.json Mirrors the @vocab formerType context change for fixtures.
packages/fedify/src/federation/handler.test.ts Updates actor-handler test expectations to include formerType.
docs/manual/actor.md Updates actor dispatcher example to set formerType.
docs/manual/context.md Updates tombstone-handling example to display formerType.
CHANGES.md Documents the new behavior and context patch.

Comment thread packages/vocab-tools/src/class.ts Outdated
Comment thread packages/vocab/src/vocab.test.ts Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 90.47619% with 6 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/vocab-tools/src/type.ts 75.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
packages/vocab-tools/src/class.ts 98.27% <100.00%> (+0.44%) ⬆️
packages/vocab-tools/src/codec.ts 99.61% <100.00%> (+<0.01%) ⬆️
packages/vocab-tools/src/schema.ts 73.14% <100.00%> (+3.04%) ⬆️
packages/vocab-tools/src/type.ts 84.60% <75.00%> (-0.28%) ⬇️

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Build the generated entity type lookup table from schema URI strings
instead of constructor typeId getters so vocab startup does not create
URLs eagerly. Also make the unknown-formerType log assertion check the
structured log record fields instead of stringifying the whole record.

fedify-dev#681

Assisted-by: OpenCode:gpt-5.4
@dahlia dahlia requested a review from Copilot April 16, 2026 13:45
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

/gemini review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b497540039

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/vocab-runtime/src/contexts/activitystreams.json Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the formerType property to the Tombstone class, allowing deleted objects to retain a reference to their original ActivityStreams type. Key changes include the addition of the fedify:vocabEntityType pseudo-scalar to the vocabulary generator, which enables the generation of $EntityType helpers, type guards, and lookup functions. The ActivityStreams context has been updated to treat formerType as a vocabulary term, and documentation and tests have been expanded to cover these new features. A review comment noted that the generated code for the new scalar uses a logger that may require an explicit import in the file header to avoid runtime errors.

Comment thread packages/vocab-tools/src/type.ts
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.

Comment thread packages/vocab-tools/src/codec.ts Outdated
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the formerType property to Tombstone objects, allowing deleted objects to preserve their original ActivityStreams type. To support this, a new fedify:vocabEntityType pseudo-scalar has been added to the vocabulary generator, along with generated helper utilities including the $EntityType union, isEntityType(), and getEntityTypeById(). The implementation includes updated decoding logic that handles unknown types with a warning and validation to ensure entity types are not mixed with other range types in the schema. I have no feedback to provide.

Handle malformed fedify:vocabEntityType values inside the scalar
decoder so malformed expanded JSON-LD is ignored instead of throwing.
Also add a regression test for malformed Tombstone.formerType input
and refresh the generator snapshots.

fedify-dev#681

Assisted-by: OpenCode:gpt-5.4
@dahlia dahlia requested a review from Copilot April 16, 2026 16:37
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements the formerType property for Tombstone objects, allowing deleted entities to retain their original ActivityStreams type. It introduces a fedify:vocabEntityType pseudo-scalar to the vocabulary toolchain, which generates $EntityType type definitions and utility functions (isEntityType, getEntityTypeById) for working with entity references. The changes encompass vocabulary schema updates, code generation logic, documentation, and tests. Review feedback highlights critical issues in the dataCheck and decoder implementations for the new scalar, where the use of the in operator on null values could lead to runtime TypeError exceptions.

Comment thread packages/vocab-tools/src/type.ts Outdated
Comment thread packages/vocab-tools/src/type.ts Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/vocab-tools/src/type.ts`:
- Around line 448-457: The dataCheck and decoder string builders (functions
named dataCheck and decoder) must guard against null before using the "in"
operator: update the generated checks so dataCheck uses a null-safe check (e.g.,
`${v} != null && typeof ${v} === "object" && "@id" in ${v} ...`) and decoder
returns early when `${v} == null` before the typeof/in checks; apply the same
null-guard pattern to the other scalar type blocks that emit dataCheck/decoder
(the other two occurrences) so `"@id" in ${v}` never runs on null and avoids
TypeError.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43bf7d1e-7a4f-4209-a099-5cf9069bec83

📥 Commits

Reviewing files that changed from the base of the PR and between 09ec44f and 6f3549f.

⛔ Files ignored due to path filters (3)
  • packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap is excluded by !**/*.snap
  • packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap is excluded by !**/*.snap
  • packages/vocab-tools/src/__snapshots__/class.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (2)
  • packages/vocab-tools/src/type.ts
  • packages/vocab/src/vocab.test.ts

Comment thread packages/vocab-tools/src/type.ts
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated 1 comment.

Comment thread packages/vocab-tools/src/codec.ts Outdated
Make the @id-based scalar data checks null-safe and guard
fedify:vocabEntityType against malformed object shapes before looking
up entity constructors. Also add a trailing semicolon in the
single-range decoder template and refresh the vocab-tools snapshots.

fedify-dev#681

Assisted-by: OpenCode:gpt-5.4
@dahlia dahlia requested a review from Copilot April 16, 2026 17:23
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

/gemini review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces Tombstone.formerType and generated entity type helpers to the @fedify/vocab and @fedify/vocab-tools packages, enabling applications to preserve the original ActivityStreams type of deleted objects. The changes include the addition of the fedify:vocabEntityType pseudo-scalar and supporting functions like isEntityType() and getEntityTypeById(). A review comment suggests using optional chaining in getEntityTypeById to prevent a potential TypeError when handling null or undefined identifiers.

Comment thread packages/vocab-tools/src/class.ts Outdated
Make the generated getEntityTypeById() helper return undefined for
unexpected nullish inputs instead of crashing on href access. Also add
a regression test for nullish calls and refresh the generator
snapshots.

fedify-dev#681

Assisted-by: OpenCode:gpt-5.4
@dahlia dahlia requested a review from Copilot April 16, 2026 17:42
@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

@codex review

@dahlia
Copy link
Copy Markdown
Member Author

dahlia commented Apr 16, 2026

/gemini review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 17 changed files in this pull request and generated no new comments.

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the formerType property to the Tombstone vocabulary and adds a new fedify:vocabEntityType pseudo-scalar to the vocabulary generator. This allows vocabulary properties to reference generated Fedify entity constructors, supported by new generated helpers such as $EntityType, isEntityType(), and getEntityTypeById(). The implementation includes updates to documentation, tests, and validation logic to prevent mixing entity type references with other range types, as well as improved null safety in scalar data checks. I have no feedback to provide.

@dahlia dahlia merged commit 06d31be into fedify-dev:main Apr 16, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

activitypub/compliance Specification compliance breaking change Requires backward-incompatible change component/actor Actor dispatcher related component/federation Federation object related component/vocab Activity Vocabulary related component/vocab-tools Vocabulary code generation (@fedify/vocab-tools) type/enhancement Improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add formerType property to Tombstone

2 participants