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.
Summary
darnit runhas no--frameworkoption, butcmd_runreads 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
darnit/packages/darnit/src/darnit/cli.py
Lines 1199 to 1224 in bbe1bb4
runsubparser)darnit/packages/darnit/src/darnit/cli.py
Lines 665 to 695 in bbe1bb4
cmd_run)-f/--frameworkargument on theauditorharnesssubparsers in the same file.Getting started
-f/--frameworkto therunsubparser with the same help text style asaudit.tests/darnit/cli/thatdarnit run --framework testchecks <fixture>passes the name through (the existingtest_cmd_run_e2e.pyfixtures are a good starting point).uv run pytest tests/darnit/cli -qanduv run ruff check .; sign off your commit (git commit -s).Note:
darnit runanddarnit auditare development and testing tools (see #505), so this is about making them consistent, not about a user-facing workflow.