Wiki: lock scope to user-centric only; CLAUDE.md cleanup-script note#6
Merged
Wiki: lock scope to user-centric only; CLAUDE.md cleanup-script note#6
Conversation
…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
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.
=head1 SYNOPSIS
Two changes batched in one PR:
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.
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_PROMPTnow carries an explicit Scope blockbetween the wiki overview and the workflow steps:
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.
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.
buildWikiLibrarianPromptgains a matching scope block AND anexpanded 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 liststwo 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_BLOCKinchat-prompt.tsupdates the main LLM's mentalmodel 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.mduser-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.mdadds 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
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.
wiki_create. Out-of-scopecleanup uses delete-only; it cannot mint replacement
articles. That's by design.
the load-bearing rule. A reviewer suggesting "but the
conversation went deep on this" is exactly the failure mode
the prompt now defends against.
duplicates second) is deliberate. Swapping them would
consolidate two off-topic articles into one.
https://claude.ai/code/session_015XcR7xzLdij66ZbYERUdLH
Generated by Claude Code