Skip to content

feat(team): manage and inject enabled global rules - #1284

Open
TyreeZhao wants to merge 14 commits into
chaitin:mainfrom
TyreeZhao:feat/g2-mount-001-global-rules
Open

feat(team): manage and inject enabled global rules#1284
TyreeZhao wants to merge 14 commits into
chaitin:mainfrom
TyreeZhao:feat/g2-mount-001-global-rules

Conversation

@TyreeZhao

Copy link
Copy Markdown

Summary

  • Add the global rule management path for listing, creating, updating, enabling/disabling, deleting, restoring history, and admin-only access.
  • Inject only enabled, non-deleted global rules with an active version into new Session/Agent task configuration.
  • Preserve the existing OpenCode instructions glob and keep rule content out of system prompts.
  • Redact global rule content from audit logs, provide the forbidden state in the manager UI, and hide navigation for non-admin users.
  • Constrain rule operations to the global scope and include the baseline test-stub compatibility fix required by the current main branch.

Verification

  • go test ./... under backend/
  • tsc -b && vite build --mode online under frontend/
  • Manager rule i18n test
  • git diff --check

tong.zhao added 14 commits September 12, 2026 18:18
Add agent_rules.enabled and exclude disabled rules from
ListActiveRules so later Create-path tasks are not injected.
Existing sessions stay unchanged.

G2-MOUNT-001 / AC-MOUNT-006
Lock Create-path injection of enabled rules, skip on empty or
failed reads, and keep rebuild/switch-model from refreshing
existing sessions.

G2-MOUNT-001 / AC-MOUNT-001 / AC-MOUNT-002 / AC-MOUNT-006 / AC-MOUNT-007
Add /manager global-rule CRUD so admins can stop a rule without
a new version. Disabled and soft-deleted rules stay out of
ListActiveRules, so later Create-path tasks are not injected.

G2-MOUNT-001 / AC-MOUNT-006
Add manager history/restore UI so restoring a version only switches
the active version. Existing sessions stay unchanged; later tasks use
the restored content.
Keep disabled rules out of later-task injection after restore, skip
unknown versions, and lock the manager restore routes.
Keep the /manager rules surface admin-only so ordinary members cannot
list, edit, or restore enterprise global rules.
Keep manager write audits for add/update/enable/delete/restore, but
strip rule markdown so logs retain ids and names only.
Keep /manager/rules from rendering a 403 as an empty rule list, and
lock CreateTaskReq JSON to configs with the OpenCode rule path.
Keep global rules on the ConfigFile path and out of system_prompt.
Keep the rules sidebar entry admin-only so ordinary members do not get a management link.
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