Skip to content

Move a wiki page through the CLI and MCP, with a skill for renaming entities #227

Open

Description

@LukasGold

Add a CLI command and MCP operation to move a wiki page, and a skill that documents how to rename or retitle an entity.

Problem

Since #226, an entity of a Category:Property subclass is stored at Property:<name>. An update is refused when the uuid already exists on another Property: page. This happens in two cases:

  • The update changes name of a property.
  • The property lives on an old page Property:OSW<uuid> and its name differs from that title. On wiki-dev.open-semantic-lab.org a title search finds 40 pages titled Property:OSW....

The error tells the user to move the old page to the new title and then repeat the update. The CLI and the MCP server have no way to do that. WtPage.move exists in https://github.com/OpenSemanticLab/osw-python/blob/main/src/osw/wtsite.py, but no command or operation calls it, so an agent cannot follow the error message.

Proposal

  1. A move operation in osw.service.ops, exposed as a CLI command (for example osw page move <from> <to>) and as an MCP tool.

    • Keep a redirect at the old title by default.
    • Guard it with the provenance ledger in the same way as delete_entity, so pages this server did not write need an explicit confirmation.
    • Refuse when the target title already exists. On wiki-dev, Property:HasDirectoryTree and Property:HasComponentRole exist next to old OSW-id pages with the same name.
    • Report the SMW error smw-change-propagation-protection clearly. In a live test in feat: title Property entities by name and refuse a rename on update #226, SMW locked a property page for about 27 minutes after an update.
  2. A skill for creating and changing entities, shipped with the package next to osl-tasks. It documents the procedure an agent follows when a store is refused because the uuid exists under another title:

    1. Read the entity and confirm that the rename is intended.
    2. Move the page to the new title with the move operation, keeping the redirect.
    3. Repeat the update with the new name, without meta.wiki_page.title.

    The skill should warn against writing the old title into meta.wiki_page.title before a move. get_title prefers that field, so after the move the next update would target the old title again.

Open point

It is not verified whether the redirect left by a move keeps HasUuid in SMW. If it does, the check from #226 refuses the update after the move. The move operation would then need to handle the redirect, or the check would need to ignore redirect pages.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions