Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6486568
Add GraphQL reads of resource revisions
2chanhaeng Nov 10, 2026
b59a4d6
Record the sources of embedded documents
2chanhaeng Nov 13, 2026
5078db4
Add a seed script of resource revisions for UI work
2chanhaeng Nov 13, 2026
8916f56
Read revisions without regard to their sources
2chanhaeng Nov 15, 2026
01fa1fb
Check declared sources and never guess them
2chanhaeng Nov 15, 2026
e9df248
Add a space to split the login link and the last \n
2chanhaeng Nov 16, 2026
b0a6205
Show resource revisions on a resource page
2chanhaeng Nov 17, 2026
b5aca17
Open resource histories from existing pages
2chanhaeng Nov 17, 2026
03a000f
Add modern-web-guidance and taste-skill skills
2chanhaeng Nov 17, 2026
8c21474
Refine the resource views and raise border contrast
2chanhaeng Nov 17, 2026
8e34c3a
Credit #182 in the revision changelog entries
dodok8 Nov 18, 2026
57744cf
Generate random session tokens in the revision seed
dodok8 Nov 19, 2026
d38c7bd
Stop the revision seed on refused workspace mutations
dodok8 Nov 19, 2026
8800cf1
Keep the actor page's deleted object filter in the URL
dodok8 Nov 19, 2026
5888975
Refuse an edit that declares its own object as a source
dodok8 Nov 19, 2026
fa1c0cf
State that DrFed is a debugging tool, not an SNS
2chanhaeng Nov 18, 2026
d1fd94b
Credit #182 in the resource revisions changelog
2chanhaeng Nov 20, 2026
5c01a52
State all revision access rules in the changelog
2chanhaeng Nov 20, 2026
67415ae
Render resource and actor pages anew per ID
2chanhaeng Nov 20, 2026
a23dd84
Expose the embedded value of a document recipient
2chanhaeng Nov 20, 2026
144ca9c
Correct revision docs and document the seed task
2chanhaeng Nov 20, 2026
fcf5b0f
Take generated activities' sources from what they carry
2chanhaeng Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .agents/skills/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ tarball integrity are recorded in *pnpm-lock.yaml*. There are no checked-in
skill copies. *.claude/skills* points to this directory; pnpm also links the
same dependency skills into *.crush/skills/*.

| Git development dependency | Skills | Source |
| --------------------------- | ------------------------------------------- | -------------------------- |
| `@open-circle/agent-skills` | `formisch`, `valibot` | [open-circle/agent-skills] |
| `@chillicream/agent-skills` | `graphql-schema-design` | [ChilliCream/agent-skills] |
| `relay-github-root` | `relay-best-practices`, `relay-performance` | [facebook/relay] |
| `@dahlia/sacho` | `sacho` | [dahlia/sacho] |
| Git development dependency | Skills | Source |
| --------------------------- | ------------------------------------------- | ---------------------------------- |
| `@open-circle/agent-skills` | `formisch`, `valibot` | [open-circle/agent-skills] |
| `@chillicream/agent-skills` | `graphql-schema-design` | [ChilliCream/agent-skills] |
| `relay-github-root` | `relay-best-practices`, `relay-performance` | [facebook/relay] |
| `@dahlia/sacho` | `sacho` | [dahlia/sacho] |
| `modern-web-guidance` | `modern-web-guidance`, `chrome-extensions` | [GoogleChrome/modern-web-guidance] |
| `@leonxlnx/taste-skill` | `design-taste-frontend` | [leonxlnx/taste-skill] |

The pinned skill contents match the latest upstream versions checked during
this migration. ChilliCream is pinned to the last change to its GraphQL schema
Expand All @@ -38,3 +40,5 @@ updated source approval in *pnpm-workspace.yaml* together.
[ChilliCream/agent-skills]: https://github.com/ChilliCream/agent-skills
[facebook/relay]: https://github.com/facebook/relay
[dahlia/sacho]: https://github.com/dahlia/sacho
[GoogleChrome/modern-web-guidance]: https://github.com/GoogleChrome/modern-web-guidance
[leonxlnx/taste-skill]: https://github.com/leonxlnx/taste-skill
50 changes: 50 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,39 @@ To be released.

### GraphQL APIs

- Added `Resource.currentRevision`, `Resource.revisions`, newest first,
`Resource.revision(sequence:)`, and the `ResourceRevision` node, which
return the saved revisions of a resource, including those of resources
saved without legacy details.
Each revision returns its saved JSON, whiteout deletion details, and what
the current validator finds in it. When the validator reads the
document, `root` describes it by meaning, whatever keys spell its
properties: the relations and recipients of the root and of every
document it embeds, with the resource currently registered under each
IRI, and its custom extension properties. Each revision is read by
evidence of its own: local revisions by anyone, revisions addressed to the
public by anyone, and received revisions by members of the instance that
received them. Administrators read every revision, and the current
revision of a resource with legacy details is also readable to whoever
may read those details. `DocumentNode.source` tells which revision an
embedded document came from, whether it keeps that revision's contents or
was derived from it, and whether that revision is still current,
superseded, or deleted; it is null when the viewer may not read that
revision, and the embedded document itself stays readable. Deleting a
resource or its author hides none of its revisions by itself. A `Resource`
is returned by `node`, `Activity.object`, and relations and recipients
whenever the viewer may read one of its revisions, even after its current
state was restricted, while `Resource.detail` and the typed node stay
hidden. `Actor.objects` takes a `filter` whose `includeDeleted` lists
deleted objects too, and `Object.deleted` tells when one was deleted.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim\]
- Fixed `Resource.detail` to return `null` without a field error when the
resource has no corresponding detail record.
[[#150], [#164] by Hong Minhee\]

[#154]: https://github.com/fedify-dev/drfed/issues/154
[#182]: https://github.com/fedify-dev/drfed/pull/182

### JavaScript/TypeScript APIs

- Added `@drfed/federation/local-write`, the common write operations for
Expand Down Expand Up @@ -95,6 +124,15 @@ To be released.
revision ID is stale, and object histories can end with a whiteout deletion
marker.
[[#150], [#164] by Hong Minhee\]
- Added the `@drfed/federation/document` subpath. Its
`interpretDocument()` returns every vocabulary document of a saved
document with its relations, recipients, and custom extension
properties, read by meaning as the validator reads them.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim\]
- Added `extensionProperties` to the nodes `describeDocument()` in
`@drfed/models/document` returns: the source keys of each document's
custom extension properties.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim\]
- Added the `@drfed/federation/serving` subpath. It exports
`publicDocument()`, the serialization federation reads use for saved
documents, `parseVocab()`, which parses such a document into a Fedify
Expand Down Expand Up @@ -126,6 +164,18 @@ To be released.
poll-specific rules remain separate work. The supported properties and
representation limits are documented in *packages/models/README.md*.
[[#151], [#166] by Jiwon Kwon\]
- `appendResourceRevision()` and `writeTypedResourceRevision()` in
`@drfed/models/resource-revision` accept `embeddings`, which record the
revision each embedded document came from and whether it keeps that
revision's contents or was derived from it. `commitLocalWrite()` in
`@drfed/federation/local-write` records them for every document it saves,
and `create` and `edit` requests accept `sources` to declare the revision
an embedded document was loaded from. Declaring sources requires the
`unreadableRevisions` option of `previewLocalWrite()` and
`commitLocalWrite()`, such as `unreadableRevisions()` of the new
`@drfed/graphql/readable`; a source that is missing or that the member
may not read fails alike with `source_unavailable`.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim\]

[#151]: https://github.com/fedify-dev/drfed/issues/151
[#152]: https://github.com/fedify-dev/drfed/issues/152
Expand Down
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ This document is also the coding-agent guide for the repository. *AGENTS.md*
and *CLAUDE.md* point here on purpose.


Debugging tool, not SNS
-----------------------

DrFed is a debugging tool for building social network services, not a social
network service itself. Reading its code as an SNS leads to a wrong
understanding, wrong code, and wrong reviews. For example, an SNS hides
content once it is deleted, but DrFed may need to show it after deletion,
because tracing how a resource changed and was deleted is what a debugging
tool is for. Read and write the code with this purpose in mind, and never
confuse DrFed with an SNS.


AI policy
---------

Expand Down Expand Up @@ -150,6 +162,11 @@ runs the Relay compiler and the SolidStart frontend build.
`tsdown --watch` builds, then runs `drfed-server` with a PGlite data directory
at *.pgdata*.

`mise run seed:revisions` adds resource revisions for UI work to that store,
then prints the accounts and what each viewer reads of every resource. Stop
`mise run dev` first, since only one process can open the store. A store is
seeded once: remove it to seed again, or seed another one with `--data-path`.


Runtime and packaging expectations
----------------------------------
Expand Down Expand Up @@ -715,6 +732,14 @@ The GraphQL types for activity deliveries live in
*src/activity-delivery/entry.ts*. Delivery contents are private to local
instance members and administrators, including Relay node lookups.

The GraphQL types for resource revisions live in *src/revision.ts*. Each
revision is read by evidence of its own, through `readableRevision()` in
*src/readable.ts*, never by the current state of its resource nor by where
its embedded documents came from; only `DocumentNode.source` checks a source
revision. Filter revisions by it before paging, and use
`unreadableRevisions()` wherever another layer, such as a local write's
`sources`, must apply the same rule.


CLI and server changes
----------------------
Expand Down
31 changes: 31 additions & 0 deletions changes.d/graphql/resource-revisions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
links:
'#154': https://github.com/fedify-dev/drfed/issues/154
'#182': https://github.com/fedify-dev/drfed/pull/182
---
- Added `Resource.currentRevision`, `Resource.revisions`, newest first,
`Resource.revision(sequence:)`, and the `ResourceRevision` node, which
return the saved revisions of a resource, including those of resources
saved without legacy details.
Each revision returns its saved JSON, whiteout deletion details, and what
the current validator finds in it. When the validator reads the
document, `root` describes it by meaning, whatever keys spell its
properties: the relations and recipients of the root and of every
document it embeds, with the resource currently registered under each
IRI, and its custom extension properties. Each revision is read by
evidence of its own: local revisions by anyone, revisions addressed to the
public by anyone, and received revisions by members of the instance that
received them. Administrators read every revision, and the current
revision of a resource with legacy details is also readable to whoever
may read those details. `DocumentNode.source` tells which revision an
embedded document came from, whether it keeps that revision's contents or
was derived from it, and whether that revision is still current,
superseded, or deleted; it is null when the viewer may not read that
revision, and the embedded document itself stays readable. Deleting a
resource or its author hides none of its revisions by itself. A `Resource`
is returned by `node`, `Activity.object`, and relations and recipients
whenever the viewer may read one of its revisions, even after its current
state was restricted, while `Resource.detail` and the typed node stay
hidden. `Actor.objects` takes a `filter` whose `includeDeleted` lists
deleted objects too, and `Object.deleted` tells when one was deleted.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim]
15 changes: 15 additions & 0 deletions changes.d/javascript/document-interpretation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
links:
'#154': https://github.com/fedify-dev/drfed/issues/154
'#182': https://github.com/fedify-dev/drfed/pull/182
---
- Added the `@drfed/federation/document` subpath. Its
`interpretDocument()` returns every vocabulary document of a saved
document with its relations, recipients, and custom extension
properties, read by meaning as the validator reads them.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim]

- Added `extensionProperties` to the nodes `describeDocument()` in
`@drfed/models/document` returns: the source keys of each document's
custom extension properties.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim]
17 changes: 17 additions & 0 deletions changes.d/javascript/embedded-sources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
links:
'#154': https://github.com/fedify-dev/drfed/issues/154
'#182': https://github.com/fedify-dev/drfed/pull/182
---
- `appendResourceRevision()` and `writeTypedResourceRevision()` in
`@drfed/models/resource-revision` accept `embeddings`, which record the
revision each embedded document came from and whether it keeps that
revision's contents or was derived from it. `commitLocalWrite()` in
`@drfed/federation/local-write` records them for every document it saves,
and `create` and `edit` requests accept `sources` to declare the revision
an embedded document was loaded from. Declaring sources requires the
`unreadableRevisions` option of `previewLocalWrite()` and
`commitLocalWrite()`, such as `unreadableRevisions()` of the new
`@drfed/graphql/readable`; a source that is missing or that the member
may not read fails alike with `source_unavailable`.
[[#154], [#182] by Chanhaeng Lee, Hyeonseo Kim]
Loading
Loading