Skip to content

Create Object API (Note/Article only for now) - #73

Open
2chanhaeng wants to merge 5 commits into
mainfrom
feat/obj-api
Open

Create Object API (Note/Article only for now)#73
2chanhaeng wants to merge 5 commits into
mainfrom
feat/obj-api

Conversation

@2chanhaeng

Copy link
Copy Markdown
Member

Resolve #9.

Adds an objects table (Note/Article; visibility public/unlisted/followers) with its migration.

GraphQL gains a createObject mutation for authenticated instance members, a Relay Object node, and an Actor.objects connection with totalCount.

Fedify side implements an object dispatcher at /users/{identifier}/{id} (Tombstone when deleted; followers-only objects not served) and a paginated outbox of synthetic Create activities (20 per page).

Side change: ignore mise.local.toml.

Verified with mise run check, mise run test (73 GraphQL, 3 models), and mise run dev startup.

AI Disclosure: Ideas presented by a human user were refined into a plan through Claude Code (claude-fable-5-1), and the draft plan was verified and partially modified by the user. It was implemented via Codex (gpt-6-astra), and after initial verification by Claude Code (claude-fable-5-1), it was manually reviewed, verified, and partially modified by a human.

Implement the [#9](#9) with Note and Article storage, authenticated createObject, Relay object queries, ActivityPub dispatch, and paginated synthetic Create activities in local actor outboxes.

AI provenance: The human user provided Fable with the scope and ideas for the implementation and had them draft a plan. The user read the draft, corrected any problematic parts, and had Astra handle the implementation. This session verified those changes and ran Claude Code with claude-fable-5 in a read-only review loop. After that, the human user read and verified.

Automated validation: mise run check; mise run test including the full build (73 GraphQL and 3 model tests); mise run dev startup and HTTP GraphQL Object introspection.

Assisted-by: Claude Code:claude-fable-5-1
Assisted-by: Codex:gpt-6-astra
Keep the pre-existing mise.local.toml ignore rule separate from the
ActivityPub object feature.

AI provenance: The user requested a Fable review loop. Codex reviewed and
committed this existing working-tree change separately after Fable noted
that it was unrelated to the feature. Codex did not author the rule.
No human manual verification was confirmed. Repository checks passed.

Assisted-by: Codex:gpt-6
- Rename `/users/<ACTOR_ID>/objects/<OBJECT_ID>` to `/users/<ACTOR_ID>/<OBJECT_ID>`
- Rename `ASObject` to `APObject`
Brand the objects.id and objects.actorId columns with the Uuid type in
@drfed/models so that Drizzle queries on the objects table require Uuid
values instead of plain strings.  Add validateUuid to @drfed/models/uuid
as a type guard and route all UUID generation and validation in
@drfed/graphql through that module instead of importing uuid directly.

Cast the actor identifier in the outbox dispatcher and the test fixture
values to Uuid, and declare the seed actor identifiers as const so they
satisfy the branded column types.  Also clarify the description of the
GraphQL Object.uuid field.

AI provenance: The human user authored and verified every code change
in this commit.  AI assistance was limited to analyzing the error
messages emitted by mise run check and to drafting this commit message.

Assisted-by: Claude Code:claude-fable-5-1
Comment thread .gitignore Outdated
@2chanhaeng
2chanhaeng requested a review from dodok8 September 12, 2026 13:02
FOLLOWERS: { value: "followers" },
} as const,
});
const ObjectRef = builder.drizzleNode("objects", {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it intentional that Actor.objects excludes deleted objects while node/nodes still return their contents?
So the object still belongs to its actor through actorId, and Object.actor still resolved that relationship. but only excluded from the actor's object list.


function toCreate(ctx: Context<unknown>, object: ActivityPubObject): Create {
return new Create({
id: new URL(`${object.iri}/activity`),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we register a Create dispatcher for this URL? As far as i know, Fedify doesn't automatically serve activities returned by the outbox. so fetching this ID could return 404.

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.

GraphQL API for creating objects

3 participants