commands

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

review_admin.go adds the R5 admin surface under the existing `da review` group (r5-review-labeling-access, admin-cli task): `da review users {add,list,remove,set-role}` for RBAC user management (spec D5.3 / R9) and `da review audit {view,verify,repair}` for the hash-chained audit log (spec D5.4 / R7). The naming decision from the plan is pinned here: the admin subtree nests under the existing `da review` group because users/audit do not collide with the proposal subcommands show/approve/reject.

Every mutating action (user create, user delete, role change) writes one audit record with the same FAIL-CLOSED discipline as internal/review/http's mutation guard (spec R6): the whole [load → mutate → save → audit] section runs under the agentslock file lock on the users file — the same lock the HTTP handlers take, so CLI processes and a running review service serialize their read-modify-write cycles — with the users file's pre-image captured up front. If the audit append fails, the users file is rolled back and the command fails; the mutation does not survive unaudited.

Token issuance is print-once (spec OQ1): the plaintext token appears exactly once in the `users add` output; only its argon2id hash persists.

Package commands hosts the `da` subcommands. score.go provides the outcome-scoring command tree: `da score run` to score every iteration in the active log dir and write sidecars, and `da score iteration|session` to render a persisted score back. The scoring rubric and persistence live in internal/scoring; this file is presentation and CLI wiring only.

Index

Constants

This section is empty.

Variables

View Source
var Commit = ""
View Source
var Describe = ""
View Source
var Version = "dev"

Version, Commit, and Describe are set at build time via ldflags.

Functions

func ConfigureRootCommandUX

func ConfigureRootCommandUX(root *cobra.Command)

func ErrorWithHints

func ErrorWithHints(message string, hints ...string) error

func ExactArgsWithHints

func ExactArgsWithHints(n int, hints ...string) cobra.PositionalArgs

func ExampleBlock

func ExampleBlock(lines ...string) string

func MaximumNArgsWithHints

func MaximumNArgsWithHints(n int, hints ...string) cobra.PositionalArgs

func NewAddCmd

func NewAddCmd() *cobra.Command

func NewAgentsCmd

func NewAgentsCmd() *cobra.Command

NewAgentsCmd wires the agents subcommand tree.

func NewExplainCmd

func NewExplainCmd() *cobra.Command

func NewHooksCmd

func NewHooksCmd() *cobra.Command

func NewImportCmd

func NewImportCmd() *cobra.Command

func NewKGCmd

func NewKGCmd() *cobra.Command

NewKGCmd wires the kg subcommand tree with root-level flags and UX helpers.

func NewRefreshCmd

func NewRefreshCmd() *cobra.Command

NewRefreshCmd is the root-package shim that wires the lifecycle subpackage constructor with closures over the still-in-root runRefresh body and package-var seams. Follows SHAPE.md §6 (root shim preserved until t13 deletes it and switches root.go to lifecycle.NewRefreshCmd directly). See .agents/active/fold-back/t07-refresh-body-deferred.md for why the run body cannot move atomically with this PR (t04/t06 still own addDeps / importDeps in the root package).

func NewRemoveCmd

func NewRemoveCmd() *cobra.Command

func NewReviewCmd

func NewReviewCmd() *cobra.Command

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand builds the root cobra command with persistent global flags and all subcommands. It mirrors cmd/da/main.go so tooling (e.g. global flag coverage) can inspect the live command tree without importing package main.

func NewRunCmd added in v0.5.0

func NewRunCmd() *cobra.Command

NewRunCmd builds the public `da run <file>` command using the production dispatcher. It is registered in the root command tree in root.go.

func NewScoreCmd

func NewScoreCmd() *cobra.Command

NewScoreCmd builds the `da score` command group.

func NewSessionCmd

func NewSessionCmd() *cobra.Command

NewSessionCmd builds the `da session` command group.

func NewSkillsCmd

func NewSkillsCmd() *cobra.Command

NewSkillsCmd wires the skills subcommand tree. Thin shim preserved for source-compat with root.go and external callers.

func NewSyncCmd

func NewSyncCmd() *cobra.Command

func NewWorkflowCmd

func NewWorkflowCmd() *cobra.Command

NewWorkflowCmd builds the `da workflow` command tree.

func NoArgsWithHints

func NoArgsWithHints(hints ...string) cobra.PositionalArgs

func RangeArgsWithHints

func RangeArgsWithHints(min, max int, hints ...string) cobra.PositionalArgs

func RenderCommandError

func RenderCommandError(w io.Writer, root *cobra.Command, argv []string, err error)

func UsageError

func UsageError(message string, hints ...string) error

func WorkflowBridgeDeps

func WorkflowBridgeDeps() wf.Deps

WorkflowBridgeDeps wires workflow CLI handlers to commands UX helpers and global flags (also used by workflow package tests).

Types

type CLIError

type CLIError struct {
	Message   string
	Hints     []string
	ShowUsage bool
	Cause     error
}

CLIError carries actionable hints for user-facing command failures.

func (*CLIError) Error

func (e *CLIError) Error() string

func (*CLIError) Unwrap

func (e *CLIError) Unwrap() error

type GlobalFlags

type GlobalFlags struct {
	DryRun  bool
	Force   bool
	Verbose bool
	Yes     bool
	JSON    bool
}

GlobalFlags holds flags shared across commands.

var Flags GlobalFlags

Directories

Path Synopsis
Package config implements the `da config` command subtree.
Package config implements the `da config` command subtree.
Package eval implements the `da eval` command tree: the operator surface over the R4 agent-evaluation harness.
Package eval implements the `da eval` command tree: the operator surface over the R4 agent-evaluation harness.
internal
cmdutil
Package cmdutil holds shared helpers for the commands/* CLI tree.
Package cmdutil holds shared helpers for the commands/* CLI tree.
lifecycle
Package lifecycle hosts the project-lifecycle command cluster extracted from the root commands package as part of the root-command-decomposition plan (SHAPE.md §1, §4a).
Package lifecycle hosts the project-lifecycle command cluster extracted from the root commands package as part of the root-command-decomposition plan (SHAPE.md §1, §4a).
mcp
Package mcp owns the `da mcp` subcommand tree.
Package mcp owns the `da mcp` subcommand tree.
settings
Package settings hosts the `da settings` command tree.
Package settings hosts the `da settings` command tree.
Package observability implements the `da observability` command subtree.
Package observability implements the `da observability` command subtree.
close_task.go wires `da workflow close-task`, the T1-molecule client command that composes the end-of-iteration primitive chain:
close_task.go wires `da workflow close-task`, the T1-molecule client command that composes the end-of-iteration primitive chain:
Package worktree implements the `da worktree` command tree: first-class create / merge-back of managed sub-branch worktrees.
Package worktree implements the `da worktree` command tree: first-class create / merge-back of managed sub-branch worktrees.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL