Skip to content

fix(dashboard): label API preference writes as agent, not you - #408

Open
jacklau04 wants to merge 1 commit into
TheWeiHu:mainfrom
jacklau04:fix/prefs-edit-source-label
Open

jacklau04 wants to merge 1 commit into
TheWeiHu:mainfrom
jacklau04:fix/prefs-edit-source-label

Conversation

@jacklau04

Copy link
Copy Markdown
Contributor

Why

POST /api/preferences records every write in preferences/edits.md as · you. The distill skill treats · you lines as the owner's: never reworded, never removed, and anything the owner deleted is never re-added. But agents write through this endpoint too (a curl from a session).

Observed on 2026-09-20: an agent rewrote the entire global preferences page via the API at the owner's loose request. The ledger labelled it · you, so the agent's wording became permanently protected and every later refresh stayed strictly additive — including an unconditional "put handoff files in ~/Downloads" rule that then applied in every session on the machine.

What

  • The POST accepts an optional source: "you" or "agent". Anything else is a 400 and the page is not written. The default is agent.
  • The dashboard editor sends source:"you"; it is the only hand-edit path.
  • assets/skills/distill/SKILL.md: · agent entries are agent writes, revisable like · distill lines, never the owner's. The · you rules are unchanged.

How verified

  • New TestPreferencesEditSourceLabel: default → · agent; editor → · you; unknown source → 400 with the page untouched. Failed before the change (everything · you, unknown source accepted), passes after.
  • TestPreferencesEditLedger updated to send the editor's source (it models the dashboard editor).
  • make test is green, including the dashboard node regression scripts.

🤖 Generated with Claude Code

POST /api/preferences recorded every write in preferences/edits.md as
`· you`. /distill treats `· you` lines as the owner's: never reworded, never
removed, deletions never re-added. But agents write through this endpoint
too. On 2026-09-20 an agent rewrote the whole global preferences page via
the API; the ledger called it `· you`, so the agent's wording became
permanently protected and later refreshes stayed strictly additive.

The POST now takes an optional `source` — "you" or "agent", anything else is
a 400 and the page is untouched — defaulting to "agent". The dashboard editor
sends source:"you"; it is the only hand-edit path. The distill skill defines
`· agent` entries as revisable like `· distill` lines, never the owner's.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant