Skip to content

darnit run has no --framework option although cmd_run reads one #507

Description

@mlieberman85

Summary

darnit run has no --framework option, but cmd_run reads one (getattr(args, "framework", None)) and falls back to resolving the framework from repository configuration. Other subcommands (audit, harness, serve) accept -f/--framework. The run subcommand should accept it too, so the framework can be chosen explicitly.

Where

  • Parser:
    run_parser = subparsers.add_parser(
    "run",
    help="Run full agentic workflow (LLM-powered)",
    description="Run the full autonomous compliance pipeline. "
    "Loads project context, runs all checks, collects context, "
    "and remediates failures. Requires an LLM API key.",
    )
    run_parser.add_argument(
    "repo_path",
    nargs="?",
    default=".",
    help="Path to repository (default: current directory)",
    )
    run_parser.add_argument(
    "--feedback",
    dest="feedback_mode",
    choices=["interactive", "noninteractive", "auto"],
    default="auto",
    help="Human feedback mode: interactive (prompts in terminal), "
    "noninteractive (collects questions for later), "
    "auto (interactive if terminal, noninteractive in CI)",
    )
    run_parser.set_defaults(func=cmd_run)
    # harness command (feature 026)
    harness_parser = subparsers.add_parser(
    (the run subparser)
  • Consumer:
    def cmd_run(args: argparse.Namespace) -> int:
    """Run the audit workflow with human feedback.
    Runs the audit -> collect_context -> remediate pipeline. Checks that
    require LLM judgement halt for an external agent (e.g. Claude Code);
    questions needing a human are handled per --feedback mode. Automated
    in-process LLM backends are not wired into this command yet.
    """
    from darnit.agent.feedback import get_feedback_handler
    from darnit.agent.graph import audit, collect_context, remediate, route
    from darnit.agent.state import AuditState
    repo_path = str(Path(args.repo_path).resolve())
    # Feedback mode — default to interactive if terminal, noninteractive if not
    feedback_mode = args.feedback_mode
    if feedback_mode == "auto":
    feedback_mode = "interactive" if sys.stdin.isatty() else "noninteractive"
    print("\nDarnit run")
    print(f" Repository : {repo_path}")
    print(f" Feedback : {feedback_mode}")
    print()
    # framework_name=None auto-resolves from .baseline.toml inside audit().
    state = AuditState(
    local_path=repo_path,
    framework_name=getattr(args, "framework", None),
    level=getattr(args, "level", 3),
    )
    (cmd_run)
  • Pattern to copy: the -f/--framework argument on the audit or harness subparsers in the same file.

Getting started

  • Add -f/--framework to the run subparser with the same help text style as audit.
  • Add a test in tests/darnit/cli/ that darnit run --framework testchecks <fixture> passes the name through (the existing test_cmd_run_e2e.py fixtures are a good starting point).
  • Run uv run pytest tests/darnit/cli -q and uv run ruff check .; sign off your commit (git commit -s).

Note: darnit run and darnit audit are development and testing tools (see #505), so this is about making them consistent, not about a user-facing workflow.

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions