Skip to content

Design community rule packs without weakening safety #163

Description

@Muawiya-contact

Goal

Design a community rule-pack architecture.

Diskern should eventually make it easy for contributors to add rules for tools they know, without every rule needing to ship directly in the core database.

Why this is super advanced

Rules affect user trust and safety. Community rules need validation, provenance, protected-rule precedence, versioning, and a clear review path.

Existing safety invariant

External rules already cannot shadow embedded protected rules:

pub fn with_embedded_protected_rules(self) -> Self {
    let mut rules = RulesDb::embedded()
        .rules
        .into_iter()
        .filter(|rule| rule.verdict == Verdict::Protected)
        .collect::<Vec<_>>();
    rules.extend(self.rules);
    Self::new(self.version, rules)
}

That invariant must stay true.

Suggested deliverable

Start with a design document before code:

  • rule pack format
  • pack metadata and versioning
  • how packs are enabled/disabled
  • how protected rules always win
  • how CI validates packs

Acceptance criteria

  • No code is required for the first PR if the design is strong.
  • The design keeps protected rules authoritative.
  • The design explains review and trust boundaries in simple language.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureWorkspace layout and engine designenhancementNew feature or requesthelp wantedExtra attention is neededlevel: super advancedDeep architecture work; needs design discussion firstpriority: mediumWorth doing, not urgentrulesThe safety rules databasesafetyTouches the read-only / quarantine guarantees

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions