Skip to content

See which rules apply here and what enforces them

List the effective rule set, read one rule as the tool reads it, and see which of them the tool enforces and from where.

guaranteed Policy and enforcementbasicmaintainerrevieweragentwrites state

Situation

A reviewer asks which rules hold in this repository and whether anything actually checks them. The answer is scattered across a wiki, a CI file and somebody's memory.

Scenario

setup: installed
given:
  - "the vendored baseline plus this repository's own rules"
steps:
  - id: list
    run: ['rules', 'list']
    note: 'every active rule, its version, class and origin, in one deterministic order'
    expect:
      exit: 0
      stdout_contains: ['^majordomus\.scope-integrity +v1 +blocking +vendor:majordomus']
  - id: read-one
    run: ['rules', 'show', 'majordomus.scope-integrity']
    note: 'the rule as the tool reads it: identity, class, dependencies, enforcement'
    expect:
      exit: 0
      stdout_contains: ['^id: majordomus\.scope-integrity$', '^class: blocking$']
  - id: refuse-unknown
    run: ['rules', 'show', 'nosuch.rule']
    note: 'a rule that does not exist is named, not guessed'
    expect:
      exit: 12
      stdout_contains: ["no rule 'nosuch.rule'"]
  - id: what-is-enforced
    run: ['doctrine', 'list']
    note: 'the rules with an x-majordomus block, and the commands that run them'
    expect:
      exit: 0
      stdout_contains: ['majordomus.scope-integrity', 'blocking']
then:
  - "the effective set is the baseline plus the repository's rules, with no override"
  - 'a rule without an enforcing block is normative for whoever reads it and says so'

Outcome

rules list is the effective set, rules show is one rule as the tool reads it, and doctrine list is the subset the tool enforces with the command that runs each one.

The scenario

Executed against the real tool, in a repository prepared by installed, every time this site is generated. What follows is not a description of what should happen; it is what happened.

given

  • the vendored baseline plus this repository's own rules

when

  1. 1majordomus rules list
  2. 2majordomus rules show majordomus.scope-integrity
  3. 3majordomus rules show nosuch.rule
  4. 4majordomus doctrine list

then

  • the effective set is the baseline plus the repository's rules, with no override
  • a rule without an enforcing block is normative for whoever reads it and says so

What the tool did

Evidence of the run this page was generated from: pass, 4 step(s). Output is normalised: the repository's path, timestamps, ids and durations are placeholders; nothing else is edited.

Tested by test/cases/94_use_cases.sh, which runs every scenario and refuses a step whose recorded output is not what it produced.

  1. every active rule, its version, class and origin, in one deterministic order

    majordomus.knowledge-graph                 v1  advisory  vendor:majordomus enforced by doctor,watch
    majordomus.knowledge-integrity             v1  blocking  vendor:majordomus enforced by check,doctor
    majordomus.candidates-reviewed             v1  advisory  vendor:majordomus enforced by doctor
    majordomus.sessions-are-workers            v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.ai-layout-integrity             v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.checkpoint-freshness            v1  advisory  vendor:majordomus enforced by check,watch
    majordomus.layout-integrity                v1  advisory  vendor:majordomus enforced by doctor
    majordomus.ledger-integrity                v1  blocking  vendor:majordomus enforced by check,doctor,watch
    majordomus.policy-completeness             v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.minimum-sufficient-context      v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.bootstrap-integrity             v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.catalogue-integrity             v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.context-integrity               v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.policy-integrity                v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.externalise-decisions           v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.adr-integrity                   v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.blocker-resolution              v1  blocking  vendor:majordomus enforced by check,finish
    majordomus.decision-records                v1  advisory  vendor:majordomus enforced by check,doctor,watch
    majordomus.decision-threshold              v1  blocking  vendor:majordomus proven by test/cases/99_adr.sh
    majordomus.one-worker-one-scope            v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.dag-integrity                   v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.justified-escalation            v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.depth-is-not-verbosity          v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.define-done-first               v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.command-surface                 v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.doctrine-wiring-integrity       v1  blocking  vendor:majordomus enforced by doctor
    majordomus.enforcement-wiring              v1  blocking  vendor:majordomus enforced by doctor
    majordomus.verify-outcomes                 v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.command-coverage                v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.isolated-parallelism            v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.handovers-carry-state           v1  advisory  vendor:majordomus no validator; see the rule
    majordomus.handover-integrity              v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.lifecycle-observed              v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.knowledge-observed              v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.note-integrity                  v1  blocking  vendor:majordomus enforced by finish
    majordomus.profile-requirements            v1  blocking  vendor:majordomus enforced by finish
    majordomus.project-integrity               v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.projection-integrity            v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.context-budget                  v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.deployment-contract             v2  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.prompt-capture                  v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.prompt-continuity               v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.prompt-integrity                v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.questions-store-integrity       v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.retention-caps                  v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.roadmap-integrity               v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.rule-package-integrity          v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.schema-integrity                v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.scope-integrity                 v1  blocking  vendor:majordomus enforced by check,finish,watch
    majordomus.session-records                 v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.record-changed-files            v1  advisory  vendor:majordomus enforced by doctor
    majordomus.session-lifecycle               v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.skill-integrity                 v1  blocking  vendor:majordomus enforced by doctor,watch
    majordomus.state-consistency               v1  blocking  vendor:majordomus enforced by check,finish,watch
    majordomus.task-continuity                 v1  advisory  vendor:majordomus enforced by finish
    majordomus.task-on-the-mesh                v1  blocking  vendor:majordomus enforced by check,finish
    majordomus.use-case-coverage               v1  blocking  vendor:majordomus enforced by doctor,check,finish
    majordomus.verification-integrity          v1  blocking  vendor:majordomus enforced by finish
    majordomus.obligation-closure              v1  blocking  vendor:majordomus enforced by check,finish
    majordomus.completion-gates                v1  blocking  vendor:majordomus enforced by check,finish
    majordomus.publication-currency            v1  blocking  vendor:majordomus enforced by finish
    • exit 0
    • stdout_contains /^majordomus\.scope-integrity +v1 +blocking +vendor:majordomus/
  2. the rule as the tool reads it: identity, class, dependencies, enforcement

    # .ai/repo/rules/vendor/majordomus/rules/scope-integrity.v1.md
    
    ---
    id: majordomus.scope-integrity
    version: 1
    kind: rule
    title: Scope integrity
    description: A task touches only the paths it claimed; work found elsewhere is not accepted as done.
    statement: Work outside the paths a task claimed is not accepted as that task's work.
    status: active
    class: blocking
    depends_on: [majordomus.one-worker-one-scope@1]
    tags: [scope, verification]
    
    x-majordomus:
      validator: scope
      category: scope
      enforced_by: [check, finish, watch]
      policy_key: scope_respected
      exit_code: 10
      claims: [scope-enforcement, scoped-task]
      tests: [test/cases/04_start_check.sh]
    ---
    
    # Rationale
    
    A task touches only the paths it claimed; work found elsewhere is not accepted as done.
    
    # Required behaviour
    
    Work outside the paths a task claimed is not accepted as that task's work.
    
    # Failure behaviour
    
    A violation is a `FAIL` finding under the category `scope`, and the command that found it exits 10. Under `watch` the same violation is reported as drift and the command exits 11.
    
    # Verification
    
    `mj_validate_scope` decides it, dispatched from `check, finish, watch`. The behavioural case `test/cases/04_start_check.sh` proves it, and CI runs that case.
    • exit 0
    • stdout_contains /^id: majordomus\.scope-integrity$/
    • stdout_contains /^class: blocking$/
  3. a rule that does not exist is named, not guessed

    majordomus: no rule 'nosuch.rule' in the effective set (see: majordomus rules list)
    • exit 12
    • stdout_contains /no rule 'nosuch.rule'/
  4. the rules with an x-majordomus block, and the commands that run them

    majordomus.knowledge-graph             advisory  mj_validate_knowledge_graph doctor,watch
    majordomus.knowledge-integrity         blocking  mj_validate_knowledge_integrity check,doctor
    majordomus.candidates-reviewed         advisory  mj_validate_knowledge_accumulation doctor
    majordomus.ai-layout-integrity         blocking  mj_validate_ai_layout    doctor,watch
    majordomus.checkpoint-freshness        advisory  mj_validate_checkpoint   check,watch
    majordomus.layout-integrity            advisory  mj_validate_layout       doctor
    majordomus.ledger-integrity            blocking  mj_validate_ledger       check,doctor,watch
    majordomus.policy-completeness         blocking  mj_validate_policy_defaults doctor,watch
    majordomus.bootstrap-integrity         blocking  mj_validate_bootstrap    doctor,watch
    majordomus.catalogue-integrity         blocking  mj_validate_catalogue    doctor,watch
    majordomus.context-integrity           blocking  mj_validate_context      doctor,watch
    majordomus.policy-integrity            blocking  mj_validate_policy       doctor,watch
    majordomus.adr-integrity               blocking  mj_validate_adr          doctor,watch
    majordomus.blocker-resolution          blocking  mj_validate_blockers     check,finish
    majordomus.decision-records            advisory  mj_validate_decisions    check,doctor,watch
    majordomus.dag-integrity               blocking  mj_validate_dag          doctor,watch
    majordomus.command-surface             blocking  mj_validate_command_surface doctor,watch
    majordomus.doctrine-wiring-integrity   blocking  mj_validate_doctrine_wiring doctor
    majordomus.enforcement-wiring          blocking  mj_validate_wiring       doctor
    majordomus.command-coverage            blocking  mj_validate_command_coverage doctor,watch
    majordomus.handover-integrity          blocking  mj_validate_resolver     doctor,watch
    majordomus.lifecycle-observed          blocking  mj_validate_lifecycle    doctor,watch
    majordomus.knowledge-observed          blocking  mj_validate_knowledge_lifecycle doctor,watch
    majordomus.note-integrity              blocking  mj_validate_note         finish
    majordomus.profile-requirements        blocking  mj_validate_profile_requirements finish
    majordomus.project-integrity           blocking  mj_validate_project      doctor,watch
    majordomus.projection-integrity        blocking  mj_validate_projection   doctor,watch
    majordomus.context-budget              blocking  mj_validate_budget       doctor,watch
    majordomus.deployment-contract         blocking  mj_validate_deployments  doctor,watch
    majordomus.prompt-capture              blocking  mj_validate_prompt_capture doctor,watch
    majordomus.prompt-continuity           blocking  mj_validate_prompt_continuity doctor,watch
    majordomus.prompt-integrity            blocking  mj_validate_prompts      doctor,watch
    majordomus.questions-store-integrity   blocking  mj_validate_questions_store doctor,watch
    majordomus.retention-caps              blocking  mj_validate_retention    doctor,watch
    majordomus.roadmap-integrity           blocking  mj_validate_roadmap      doctor,watch
    majordomus.rule-package-integrity      blocking  mj_validate_rule_package doctor,watch
    majordomus.schema-integrity            blocking  mj_validate_schema_integrity doctor,watch
    majordomus.scope-integrity             blocking  mj_validate_scope        check,finish,watch
    majordomus.session-records             blocking  mj_validate_session_records doctor,watch
    majordomus.record-changed-files        advisory  mj_validate_record_changed_files doctor
    majordomus.session-lifecycle           blocking  mj_validate_session_lifecycle doctor,watch
    majordomus.skill-integrity             blocking  mj_validate_skills       doctor,watch
    majordomus.state-consistency           blocking  mj_validate_state        check,finish,watch
    majordomus.task-continuity             advisory  mj_validate_continuity   finish
    majordomus.task-on-the-mesh            blocking  mj_validate_task_on_the_mesh check,finish
    majordomus.use-case-coverage           blocking  mj_validate_use_case_coverage doctor,check,finish
    majordomus.verification-integrity      blocking  mj_validate_verification finish
    majordomus.obligation-closure          blocking  mj_validate_obligations  check,finish
    majordomus.completion-gates            blocking  mj_validate_completion_gates check,finish
    majordomus.publication-currency        blocking  mj_validate_publication_currency finish
    • exit 0
    • stdout_contains /majordomus.scope-integrity/
    • stdout_contains /blocking/

Why the tool knows this

The chain from this page to the code: the use case names commands, rules and claims; each rule is dispatched from the registry and each claim names the test that proves it; the scenario above executed the commands. Nothing in this chain is prose about intent.

The rules that make it hold

Guarantees exercised

Related use cases

Computed from what they share: claims, rules, commands, category, applications. Nobody maintains this list.

The moments this answers

Searches the titles and descriptions of every page this site publishes.