What happens
PATCH /workspaces/:workspaceId/sources/:sourceId accepts only description and sync. A loader's own config, such as a Google Drive source's include / exclude filter, cannot be changed through the API at all.
The route says so deliberately:
Structural fields (id, kind, path, role) are immutable, to keep cross-references and on-disk layout stable. A rename or loader-change flow would need its own migration story.
id, kind, path, and role being immutable is right. loader.config is a different thing: it decides which documents the mirror holds, and changing it is an ordinary act rather than a migration.
Why it matters
Narrowing a source is a normal thing to want. A source registered to trial one PRD had no include, so its whole Drive folder mirrored down and every document in it became a card on the board. Adding a filter is the obvious fix and there is no supported way to do it.
The two workarounds both cost something:
- Edit
PRODUCT.md by hand. The WorkspaceService cache is not invalidated, so the next sync reports unchanged and appears to do nothing until the server restarts. It also writes no config commit, so a later restore silently drops the change.
- Delete the source and register it again.
DELETE removes the mirror directory with rm -rf, so every document is re-fetched and every SourceUnitObservation for that source is lost.
What it should do
Let PATCH take loader.config, validated against the loader plugin's own config schema, then do what the existing route already does for the fields it accepts: write the manifest, commit it as a config change, and reload the workspace so the cache is not stale.
Removing documents from the mirror is already handled. A sync after the filter narrowed correctly reported removed: 2.
Steps
- Register a
gdrive source whose folder holds several documents, with no include.
- Try to add
include through PATCH /workspaces/:id/sources/:id. The body is rejected.
- Edit
PRODUCT.md by hand instead and sync. It reports unchanged.
- Restart the server and sync again. Only now does it report
removed.
What happens
PATCH /workspaces/:workspaceId/sources/:sourceIdaccepts onlydescriptionandsync. A loader's own config, such as a Google Drive source'sinclude/excludefilter, cannot be changed through the API at all.The route says so deliberately:
id,kind,path, androlebeing immutable is right.loader.configis a different thing: it decides which documents the mirror holds, and changing it is an ordinary act rather than a migration.Why it matters
Narrowing a source is a normal thing to want. A source registered to trial one PRD had no
include, so its whole Drive folder mirrored down and every document in it became a card on the board. Adding a filter is the obvious fix and there is no supported way to do it.The two workarounds both cost something:
PRODUCT.mdby hand. TheWorkspaceServicecache is not invalidated, so the next sync reportsunchangedand appears to do nothing until the server restarts. It also writes noconfigcommit, so a later restore silently drops the change.DELETEremoves the mirror directory withrm -rf, so every document is re-fetched and everySourceUnitObservationfor that source is lost.What it should do
Let
PATCHtakeloader.config, validated against the loader plugin's own config schema, then do what the existing route already does for the fields it accepts: write the manifest, commit it as aconfigchange, and reload the workspace so the cache is not stale.Removing documents from the mirror is already handled. A sync after the filter narrowed correctly reported
removed: 2.Steps
gdrivesource whose folder holds several documents, with noinclude.includethroughPATCH /workspaces/:id/sources/:id. The body is rejected.PRODUCT.mdby hand instead and sync. It reportsunchanged.removed.