Skip to content

Pre-flight check of a draft without opening a change set #2554

Closed

Description

@pournasserian

Part of #2420 (F-CHK). The pre-flight slice (CHK-04): an agent runs the active checks on a draft without storing it or opening a change set. It uses the MCP tool conventions (#2508) and the check types from #2518, #2527 and #2547.

This is the epic's sixth slice, built before the fifth (the check run on every change set). The fifth needs a decision on who the check engine acts as in the audit log, since agents may not move a set out of checks running. The runner this slice adds is the one the change set run will use.

Scope

  • Core (FluentCMS.Core.Checks):
    • ICheckRunner runs every active check whose scope applies to a piece of content, at its active version and in name order. Each check sees the fields its scope names.
    • Calls are charged to the caller. CheckSelection.Deterministic leaves out LLM-judged checks, so no model is asked.
    • CheckResult: the check, version, type, kind, severity, description, status, findings and model call. CheckStatus is pass, warn (a failing check of warn severity), fail or needs review. The overall status is fail if any check fails, then needs review, then warn, then pass.
  • Built-in tool check_draft (FluentCMS.Core.Builtin.Tools.CheckTools):
    • Arguments: content_type, fields, optional sources, checks (all or deterministic), and id for a draft of an update, so checks that ask about changes see only the fields that differ.
    • It returns the overall status, each check's result with its findings, the checks the selection left out, and the field errors the content type would give the draft (as create_entry would). A draft with field errors fails. It stores nothing and opens no set.
    • It is not marked read-only, since an LLM-judged check spends the agent's model budget.
    • An unknown content type is refused, with a hint to call list_content_types.
    • The MCP-01 coverage test gains its row.
  • CONTRIBUTING.md: the runner and the tool.

Out of scope

Acceptance

  • S2 over MCP: an agent checks a product page draft with "best in class", an image without alt text and an unsourced price. It gets fail, with three failing checks whose findings say what to change. After it fixes all three and cites a source, the draft passes.
  • A check scoped to other content types or fields does not see the draft, a warn check that fails warns, and a check that is not active does not run.
  • checks: "deterministic" asks no model. Without a model, an LLM-judged check needs review and the run does too, unless something fails.
  • The draft's field errors are listed. An unknown content type, an unknown argument or an unknown selection is refused with what to change.
  • A check stores no entry and opens no change set.
  • Everything above passes on SQLite and PostgreSQL. No new package and no migration.
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

    area:checksChecks (CHK)type:featureNew capabilityv2FluentCMS v2 (v2 branch)

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions