Skip to content

docs(ai): write the decision-model rules where agents look #5285

Done

Description

@dan-petty

Problem or Motivation

Agents read the knowledge base to learn a subsystem, library or tool (AGENTS.md, "Where to look"). The knowledge base has no page on Jev or on decision models: git grep -inE 'jev|decision model|systemone|system one' origin/main -- src/devops_cli/ai/knowledge_base returns nothing. ADR 0019 and ADR 0020 hold the method, but not the rules for the design of a question.

The skill .agents/skills/ask-jev/SKILL.md does not name the 32,000-byte edge of the long-context mode, the option-order bias or the 0.3/0.7 band. Its score example uses degree-only levels (line 33: --level "Trivial" --level "Normal" --level "Hard"). The documents say:

The verify screen shows the cost of the gap. 7 of its 9 questions join conditions, and it gave 0 continue in 44 live decisions (#5281). New points (#5206, #4284, #4399, #5215) can make the same mistakes.

Proposed Solution & Architectural Design

  1. A knowledge base page on decision models, for example src/devops_cli/ai/knowledge_base/devops_cli/libraries/decision_models.md. List it in the knowledge base README.md, and link it from pydantic_ai.md. The page quotes each rule with its URL:
  2. Fix the score example of the skill with situation levels, in the three copies of the skill: .agents/skills/ask-jev/SKILL.md, .claude/skills/ask-jev/SKILL.md and .kilocode/skills/ask-jev/SKILL.md. Example: --level "The change touches one module and its tests" --level "The change touches several modules" --level "The change adds a new subsystem". Add a link from the skill to the knowledge base page. The skill text for --context and unsure changes with fix(ai): ask-jev refuses no context and reports unsure #5284.
  3. The decision record. docs(adr): one decision-model record supersedes ADR 0019 and ADR 0020 #5239 (one decision-model record) holds the question rules as the project decision. The knowledge base page quotes the documents and links that record. A comment on docs(adr): one decision-model record supersedes ADR 0019 and ADR 0020 #5239 asks for this.

Target Subsystem

AI & Agentic Review Pipeline (src/devops_cli/ai/knowledge_base/, .agents/skills/ask-jev/).

Existing Tool Considered

The project knowledge base and the ask-jev skill. No new tool. Cost: about 0.15M tokens and 1 hour.

Acceptance Criteria

  • git grep -il "decision model" -- src/devops_cli/ai/knowledge_base names the new page and README.md.
  • The page quotes each rule with its URL, and uv run devops ci docs passes.
  • git grep -n -- '--level "Trivial"' -- .agents/skills .claude/skills .kilocode/skills returns nothing.
  • The skill links the knowledge base page.

Related

Source: https://pydantic.dev/docs/ai/models/decision/

Alternatives check of 2026-11-16: not-applicable.
Class: docs, no search.
Tool: none found.

Proposed design

Problem statement

Write the decision-model page and fix the score example in the three skill copies. The page link waits on #5239. The knowledge base has no page on decision models, so agents miss the rules for a question. The three copies of the ask-jev skill give a score example with degree-only levels. The skill already names the 32,000-byte limit and the 0.3/0.7 band. The verify screen shows the cost: 7 of its 9 questions join conditions, and it gave 0 continue in 44 live decisions (#5281).

Acceptance criteria

Requirement: Decision-model page

The knowledge base SHALL hold the page src/devops_cli/ai/knowledge_base/devops_cli/libraries/decision_models.md.

Scenario: The page exists

  • WHEN uv run devops ci test tests/ai/test_kb.py -k decision_models_page runs on the change
  • THEN the command exits 0 and the run lists test_decision_models_page_exists as passed

Requirement: Knowledge base index row

The knowledge base README SHALL list the page in its devops_cli/libraries/ table.

Scenario: The index table names the page

  • WHEN uv run devops ci test tests/ai/test_kb.py -k decision_models_page runs on the change
  • THEN the command exits 0 and the run lists test_knowledge_base_readme_lists_decision_models_page as passed

Requirement: A source for each rule section

The page SHALL hold one section for each of the six rule groups, and each section MUST cite a source.

Scenario: Each rule section cites its source

  • WHEN uv run devops ci test tests/ai/test_kb.py -k decision_models_page runs on the change
  • THEN the command exits 0 and the run lists test_decision_models_page_has_six_sourced_sections as passed

Requirement: No dangling link

Each relative link on the page SHALL resolve to a file in the repository.

Scenario: Each relative link of the page resolves

  • WHEN uv run devops ci test tests/ai/test_kb.py -k decision_models_page runs on the change
  • THEN the command exits 0 and the run lists test_decision_models_page_relative_links_resolve as passed

Requirement: Link from the pydantic_ai page

The knowledge base page pydantic_ai.md SHALL link the decision-model page.

Scenario: The pydantic_ai page links the new page

  • WHEN uv run devops ci test tests/ai/test_kb.py -k decision_models_page runs on the change
  • THEN the command exits 0 and the run lists test_pydantic_ai_page_links_decision_models_page as passed

Requirement: Knowledge base counts

The knowledge base tests MUST pass with the new page.

Scenario: The counts include the new page

  • WHEN uv run devops ci test tests/ai/test_kb.py runs on the change
  • THEN the command exits 0

Requirement: Generated catalog

The change MUST regenerate the committed catalog docs/KNOWLEDGE_BASE.md with uv run devops docs generate.

Scenario: The catalog holds the new page

  • WHEN uv run devops docs generate runs on the change and git diff --exit-code docs/KNOWLEDGE_BASE.md runs after it
  • THEN both commands exit 0 and docs/KNOWLEDGE_BASE.md holds a row for decision_models.md

Requirement: Situation levels in the score example

Each of the three copies of the ask-jev skill SHALL give score levels that describe a situation, not a degree.

Scenario: No copy holds a degree-only level

  • WHEN uv run devops ci test tests/invariants/test_skills.py -k score_levels runs on the change
  • THEN the command exits 0 and the run lists test_ask_jev_skill_score_levels_describe_situations as passed

Requirement: Identical skill copies

The three copies of the ask-jev skill MUST hold identical text.

Scenario: The skill copies agree

  • WHEN uv run devops ci test tests/invariants/test_skills.py runs on the change
  • THEN the command exits 0

Requirement: Skill link to the page

Each copy of the ask-jev skill SHALL hold a link to the decision-model page.

Scenario: Each skill copy holds the link

  • WHEN uv run devops ci test tests/invariants/test_skills.py -k ask_jev_skill_links runs on the change
  • THEN the command exits 0 and the run lists test_ask_jev_skill_links_decision_models_page as passed

Requirement: Documentation check

The documentation check MUST pass with the new page.

Scenario: The docs check passes

  • WHEN uv run devops ci docs runs on the change
  • THEN the command exits 0

Existing Tool Considered

The alternatives check of 2026-11-16 in the issue body returned not-applicable and named no tool. The change writes the page and the skill edits by hand. Written cost: about 0.2M tokens to write, keep and fix the page and the tests until the docs check and the other checks pass, and about 1.5 hours.

Key questions

  • Where does the decision-model page live, and how does an agent reach it?: At src/devops_cli/ai/knowledge_base/devops_cli/libraries/decision_models.md. The knowledge base README adds a row to its devops_cli/libraries/ table. The pydantic_ai.md page links the new page. AGENTS.md sends an agent that learns a subsystem, a library or a tool to the knowledge base. [sources: AGENTS.md, src/devops_cli/ai/knowledge_base/README.md, src/devops_cli/ai/knowledge_base/devops_cli/libraries/pydantic_ai.md]
  • Which rules does the page state, and does each rule keep its source?: Six sections, one for each rule group that the issue body names: question design, thresholds, window, option order, score levels and several questions. Each section quotes the rule and cites the URL that states it. The page links ADR 0019 and ADR 0020 and the record that docs(adr): one decision-model record supersedes ADR 0019 and ADR 0020 #5239 files. (best practice) [sources: .agents/skills/ask-jev/SKILL.md]
    • Chosen: Six sections, each with the URL of its document. An agent can check a rule against its source. The criterion fails when a section has no source.
    • Rejected: One prose page with no section sources. A rule with no source is a claim that no reader can check.
  • Does the ask-jev skill already name the 32,000-byte limit and the 0.3/0.7 band?: Yes. The skill states that the command refuses an input larger than 32,000 UTF-8 bytes. The skill also states that a probability from 0.30 to 0.70 reports unsure. The change adds no second copy of these texts. It adds the page link and fixes the score example. [sources: .agents/skills/ask-jev/SKILL.md]
  • Which score levels does the skill example use?: Situation levels: --level "The change touches one module and its tests" --level "The change touches several modules" --level "The change adds a new subsystem". The model gets the level descriptions and not the level names. A degree word gives it no condition to match. (best practice) [sources: .agents/skills/ask-jev/SKILL.md]
    • Chosen: Situation levels. Both documents say that a level describes a situation. The model never receives the level name.
    • Rejected: Degree levels such as Trivial, Normal and Hard. A degree gives the model no condition to match. The model does not see the level name.
  • Which text of the skill does this item change, and does it collide with fix(ai): ask-jev refuses no context and reports unsure #5284?: The score example line and one link line, in each of the three copies. The --context text and the unsure text stay for fix(ai): ask-jev refuses no context and reports unsure #5284. The two changes touch no same line. [sources: .agents/skills/ask-jev/SKILL.md, .claude/skills/ask-jev/SKILL.md, .kilocode/skills/ask-jev/SKILL.md, tests/invariants/test_skills.py]
  • Does the change update the knowledge base tests and the generated catalog?: Yes. tests/ai/test_kb.py asserts the count of knowledge base articles, so the new page updates that count. docs/KNOWLEDGE_BASE.md is generated from the knowledge base folder. The change regenerates it with uv run devops docs generate. [sources: tests/ai/test_kb.py, docs/KNOWLEDGE_BASE.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5239

Activity

  1. added
    source/agent
    type/docs
    scope/ai
    status/new
    value/medium
    effort/medium
    on Nov 12, 2026
  2. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 12, 2026
  4. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: docs. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-16. A person decides what this means for the item. The check changes no label and closes no issue.

  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 73743a2 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  7. added
    status/ready
    and removed
    status/new
    on Nov 29, 2026
  8. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  9. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  10. removed
    status/in-review
    on Nov 29, 2026
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

    effort/mediumpriority/p2-mediumscope/aisource/agenttype/docsvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions