Skip to content

Wiki: lock scope to user-centric only; CLAUDE.md cleanup-script note#6

Merged
sysread merged 2 commits intomainfrom
claude/clarify-remote-branch-cleanup
May 10, 2026
Merged

Wiki: lock scope to user-centric only; CLAUDE.md cleanup-script note#6
sysread merged 2 commits intomainfrom
claude/clarify-remote-branch-cleanup

Conversation

@sysread
Copy link
Copy Markdown
Owner

@sysread sysread commented May 10, 2026

=head1 SYNOPSIS

Two changes batched in one PR:

  • Lock the wiki's scope to user-centric subjects only. The
    per-conversation agent and the librarian both now refuse to
    create / accept articles about generic world-knowledge topics
    that merely came up in conversation. The librarian deletes
    any that exist on its next sweep.
  • CLAUDE.md doc tweak: drop the delete_ref 403 explanation in
    favour of just "leave the remote feature branch alone; the
    user runs a cleanup script."

=head1 PURPOSE

After the wiki shipped, the per-conversation agent started
writing standalone articles about generic topics that came up in
conversation. The concrete case from production: a brainstorm
about app naming mentioned that the app's name was inspired by
the 1980s "Kermit" file-transfer protocol; the agent then
created a standalone "Kermit protocol" article. The wiki was
meant to be ABOUT the user - their projects, people in their
life, things they're learning, their work - not a general
encyclopedia of topics that came up.

The earlier prompt language ("a project, a person in their life,
a place, an interest, a recurring situation") didn't draw the
line firmly enough; "an interest" was reading as "any topic the
user was interested in for the purposes of one conversation".

=head1 DESCRIPTION

=head2 Layer 1: how the existing wiki agents framed scope

The autonomous agent's prompt named some kinds of things
articles are about (project / person / place / interest /
situation) but did not specify what is NOT about the user, and
did not explicitly forbid creating standalone articles for
external topics that came up in conversation. The librarian's
prompt was scoped only to consolidate duplicates, fact-check,
and tighten boundaries - it had no notion of "this article
shouldn't exist at all".

=head2 Layer 2: what this PR changes, parallel to layer 1

WIKI_AUTONOMOUS_PROMPT now carries an explicit Scope block
between the wiki overview and the workflow steps:

  • IN scope (article-worthy when discussed): projects, people in
    their life, places they care about, things they're learning or
    reading, habits and experiments they're tracking, their
    career, hobbies, and the user themselves.
  • OUT of scope (do NOT create articles for these): generic
    technical concepts, world-knowledge topics, public people the
    user does not know personally, news, tutorials, debug
    sessions, generic Q&A.

When an OUT-of-scope reference shows up inside a user-centric
article (e.g. the conversation noted that the app being built is
named after a 1980s file-transfer protocol), the agent is told
to add a Markdown link inside the user-centric article rather
than creating a separate page. The Kermit case is baked in as
the concrete example. It also explicitly cautions against
fabricating URLs.

buildWikiLibrarianPrompt gains a matching scope block AND an
expanded workflow step 1: "Scan for out-of-scope articles
first." The librarian must wiki_search the full body before
deleting (some titles look generic but are about a specific
project), and if a related user-centric article exists,
optionally edit a Markdown link into it before deleting the
out-of-scope article. Critically, this scope-cleanup pass runs
BEFORE the duplicate-consolidation pass so the librarian doesn't
tidy two off-topic articles into one off-topic article.

wiki_delete's description in the librarian prompt now lists
two legitimate cases: (a) consolidation as before, plus (b)
out-of-scope cleanup with no merge required.

WIKI_MANUAL_PROMPT (the per-article "ask agent to update"
flow) gets a brief scope note - the user is in control here so
the rule is softer, but it still tells the agent to prefer a
noop with a one-sentence reason over silently drifting an
article away from being about the user (e.g. into a generic
explainer of an external topic).

WIKI_BLOCK in chat-prompt.ts updates the main LLM's mental
model of the wiki to match: it now describes the wiki as
articles ABOUT THE USER and explicitly "not a general
encyclopedia of topics that came up".

The docs/user/wiki.md user-facing manual gains a "Scope:
about you, not about the world" section that mirrors the
prompt's IN/OUT lists in plain language. docs/dev/wiki.md
adds a Gotcha that records the failure mode and the rationale
behind workflow ordering on the librarian.

The CLAUDE.md edit (already pushed in commit 1) just drops the
delete_ref 403 explanation - the user has a cleanup script.

=head2 Layer 3: how that resolves PURPOSE

The per-conversation agent now has an explicit IN/OUT list and
a concrete example (Kermit) baked into the prompt, making the
"is this about the user?" decision much harder to slip on. The
chat assistant's WIKI_BLOCK matches the same scope so it
doesn't over-eagerly suggest articles for things outside that
scope. And critically, the librarian's first workflow pass
deletes any out-of-scope articles that already exist, so the
existing wiki should self-heal over the next 12-24 hours
without manual intervention.

=head1 Notes for AI reviewers

  • The librarian's "delete on out-of-scope" path is intentional
    and reviewed. wiki_delete's contract has been deliberately
    widened from "consolidation only" to also include "out-of-
    scope cleanup with no merge required". If you suggest
    reverting this to consolidation-only, you'd leave the
    existing off-topic articles in place.
  • The librarian still has no wiki_create. Out-of-scope
    cleanup uses delete-only; it cannot mint replacement
    articles. That's by design.
  • "External topics get linked, not given their own pages" is
    the load-bearing rule. A reviewer suggesting "but the
    conversation went deep on this" is exactly the failure mode
    the prompt now defends against.
  • Workflow ordering in the librarian (scope cleanup first,
    duplicates second) is deliberate. Swapping them would
    consolidate two off-topic articles into one.

https://claude.ai/code/session_015XcR7xzLdij66ZbYERUdLH


Generated by Claude Code

claude added 2 commits May 10, 2026 12:46
…nches alone

The note told future sessions not to try --delete because the
GitHub app's installation token returns 403 on delete_ref. The
user has a periodic cleanup script that handles stale remote
branches, so the right instruction is just "leave the remote
feature branch alone" without the failed-attempt explanation. The
shorter wording also avoids inviting a future session to test the
behaviour.

https://claude.ai/code/session_015XcR7xzLdij66ZbYERUdLH
… articles

Production traffic showed the per-conversation agent writing standalone
articles about generic world-knowledge topics that came up in
conversation. The concrete case: a brainstorm about app naming
mentioned the 1980s "Kermit" file-transfer protocol, and the agent
created a "Kermit protocol" article. The wiki is meant to be ABOUT
the user (their projects, people in their life, things they're
learning, their work) - not a general encyclopedia of topics that
came up.

Both the per-conversation prompt and the librarian prompt now carry
an explicit scope block:

  IN scope: projects, people, places, learning, work, hobbies,
            experiments, the user themselves.
  OUT of scope: generic technical concepts, world history, public
                figures the user does not know personally,
                tutorials, news.

External topics that come up INSIDE a user-centric article get a
Markdown link to a public source (Wikipedia conventionally), not
their own article. Concrete example baked into the prompt: instead
of writing a standalone "Kermit protocol" article, link to
[Kermit](https://en.wikipedia.org/wiki/Kermit_(protocol)) inside the
user-centric article about the app being built.

The librarian's workflow now starts with scope cleanup
(workflow step 1, ahead of duplicate consolidation) so existing
out-of-scope articles get removed on the next 12h cycle. Step 1
deliberately runs before consolidation so the librarian doesn't
tidy two off-topic articles into one tidier-but-still-off-topic
article. wiki_delete now has an explicit second case for out-of-
scope removal that doesn't require a merge target.

The chat-prompt's WIKI_BLOCK and the user docs now reflect the
user-centric scope so the chat assistant's mental model of the
wiki matches what the agents actually maintain.

Rationale comments at the top of both prompts record the historical
failure mode so a future revisit doesn't quietly re-relax the
scope rule.

Also includes the previously-pushed CLAUDE.md edit dropping the
delete_ref 403 explanation in favour of "leave the remote feature
branch alone; the user has a cleanup script."

https://claude.ai/code/session_015XcR7xzLdij66ZbYERUdLH
@sysread sysread merged commit 4a602dd into main May 10, 2026
1 check passed
@sysread sysread deleted the claude/clarify-remote-branch-cleanup branch May 10, 2026 13:00
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.

2 participants