Repository navigation
feat: collection permalinks, step 3 — Studio settings, MCP tool, approver scopes - #74
Merged
Merged
Conversation
…over scopes
RFC-0038 / ADR-0040, step 3:
- Studio: a Collections section in Site settings (CollectionSettings.tsx,
lib/collection-permalinks.ts): one row per collection with the prefix
before /{slug}, a real entry's address, client-side validation, and
path conflicts shown on the row. ConflictBanner moved out of
SiteSettingsPage. English strings plus drafts for the other 18 languages.
- MCP `set_collection_permalink` (site:write): always waits for a person
(classify person), dryRun returns the plan, precheck runs the store's
checks without writing (`updateSite(site, { dryRun: true })`), and the
prompt lists old/new URLs and the redirects.
- `ToolPolicy.approverScopes`: the approver of a URL move must hold
site:settings (as in Studio), so an Editor cannot approve it; checked in
`canDecide`.
- API suite on sqlite and D1: /blog/{slug} writes the redirect; overlaps
are 409.
- Menus link a collection to a published page at its prefix first.
Closes #50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC-0038 / ADR-0040, step 3 of 3. Closes #50.
Studio
CollectionSettings.tsx, logic inlib/collection-permalinks.ts), gated onsettings.write.site.collectionsplus the collections its entries use. TheInputGroupholds the prefix before/{slug}, and the preview shows a real entry's address (and its old address once it changes, with a note that it redirects).PUT /api/sites/:id. Empty, or the collection's own name, means the default.path_conflict/reserved_path409 shows on that row.ConflictBannermoved to its own component (SiteSettingsPage881 → 859 lines)..i18n+i18n:import. These are not marked reviewed.MCP:
set_collection_permalink { siteId, collection, permalink | null, dryRun? }site:write.requiresApproval+classify: person, so it waits for a person in every mode, bypass included.dryRun: trueis classifiedreadand returns the plan only.SiteGraphStore.updateSite(site, { dryRun: true }).get_sitedocumentscollections; the server instructions and the README list the tool.Who may approve (added in review)
New optional
ToolPolicy.approverScopes(@cloudhal/agent-runtime), checked in the API'scanDecide. This tool sets["site:settings"]: the person approving must be able to change site settings, as in Studio, so an Editor cannot approve an agent's URL move. Person-only scopes can't be a tool's ownscopes(they never satisfy a tool), which is why this is a separate field.Other changes
Checks (one package at a time)
testing-permalinks.tson sqlite + D1, andapprover-scopes.test.tsAlso passing: typecheck, size ratchet (baseline tightened), design lint (340 files), i18n import checks.
Studio was checked through the API on a local server:
/blog/{slug}gave rev 6 plus the 301, and/about/{slug}gave 409. It was not checked visually, because the local Studio needs a signed-in account.Open questions (follow-ups)
indexPath, or allow a page at the prefix itself?🤖 Generated with Claude Code