mateclaw/mateclaw-server/src/test/java/vip/mate/wiki
倪程伟 b23cc32f33
fix(wiki): make global starter-pack templates read-only
Global transformation templates (workspace_id IS NULL, e.g. the 7 built-in
starter packs made global by V165) were shared across every workspace but
not actually read-only: any workspace member could edit or delete them,
mutating/affecting all workspaces, with deletes unrecoverable (Flyway
seed runs once).

- Controller: reject update/delete of null-workspace templates with 403
  (err.wiki.global_template_readonly); read/apply paths unchanged.
- Service: defense-in-depth — update/delete also reject global templates,
  guarding non-HTTP callers (WikiTool LLM entry points). delete() now
  checks the entity before deleting instead of deleting blindly.
- findByName: add deterministic ORDER BY (workspace_id IS NULL) ASC so a
  workspace-local template wins over a same-named global one (was LIMIT 1
  with no ordering). Consistent across H2/MySQL/Kingbase.
- i18n: new err.wiki.global_template_readonly (zh + en).
- Tests: +2 controller mock tests (403 on update/delete, no service write),
  +2 E2E tests (global template stays intact; findByName prefers local).

Tests: 10/10 green (4 controller + 6 E2E).
2026-07-15 14:57:18 +08:00
..
controller fix(wiki): make global starter-pack templates read-only 2026-07-15 14:57:18 +08:00
hotcache chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
job fix(wiki): stabilize concurrent raw-material uploads and PostgreSQL-compatible IDs 2026-07-15 14:27:14 +08:00
metrics chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
model fix(wiki): stabilize concurrent raw-material uploads and PostgreSQL-compatible IDs 2026-07-15 14:27:14 +08:00
pipeline feat(wiki): pipeline definition CRUD/YAML API, run query API, page-created trigger 2026-05-31 07:59:41 +08:00
profile test(wiki): cover StageInstructions string/object deserialization 2026-06-26 14:34:32 +08:00
repository feat(wiki): KB processing-failure visibility (error-code chain + silent sub-step alerts + cross-KB failure center) 2026-06-28 13:07:34 +08:00
service fix(wiki): make global starter-pack templates read-only 2026-07-15 14:57:18 +08:00
support chore(test): backfill mateclaw-server/src/test/ that earlier PRIVATE_ITEMS pattern accidentally excluded 2026-05-12 17:38:08 +08:00
tool feat(wiki): add wiki_update_page (in-place edit) and wiki_stale_pages tools 2026-05-31 08:00:19 +08:00
WikiDomainIntegrationE2ETest.java test(wiki): cross-feature end-to-end domain scenario 2026-05-31 07:57:31 +08:00