Ocuna

Command-line reference

Version 0.2.2.

The ocura-oss command records trusted local command attempts, creates metadata branches, compares branch evidence, and verifies project-local state.

ocura-oss COMMAND [OPTIONS]

Commands run against one project root. Unless --root PATH is supplied, the root is the current working directory. State is stored below that root in .ocura-oss/.

Command summary

CommandPurpose
initCreate one den and its default pathway
runRun one command and record an atom, logs, and a chokepoint
pathwaysList pathway lineage and evidence status
chokepointsList terminal evidence boundaries
branchCreate a metadata-only child pathway
compareCompare a source run with runs on its child pathways
verifyRecheck records, relationships, and referenced logs
demoRun the complete workflow in a new retained directory

Run ocura-oss COMMAND --help for command-specific help.

Conventions

Project root

--root PATH identifies the directory that contains .ocura-oss/. Relative paths and ~ are resolved before use. The command does not change the parent process working directory.

init and demo create state. All other commands require initialized state.

Declared parameters

--param KEY=VALUE records a string label. The option is repeatable. Keys must begin with a letter or underscore and may then contain letters, digits, underscores, periods, or hyphens. Keys and values must not be empty. A key may appear only once in one invocation.

Declared parameters do not configure the child process. Pass process arguments after -- in run.

JSON output

pathways, chokepoints, branch, compare, verify, and demo accept --json. Successful JSON mode writes one JSON document to standard output. Diagnostic messages go to standard error.

init and run do not provide JSON mode.

Summary data

Default summaries and listing output omit command arguments, environment values, and log contents. run streams child output unless --quiet is present, so streamed output is separate from the final summary.

Raw atom records retain command arguments, and log files retain command output. Keep secrets out of command arguments, declared parameters, branch reasons, and output.

init

Create one den and one default pathway.

ocura-oss init [--root PATH] [--name NAME]

Options

OptionTypeDefaultDescription
--root PATHpathcurrent directoryProject root in which .ocura-oss/ is created
--name NAMEstringocura-ossNonblank name stored in the den record

Behavior

init creates .ocura-oss/, one den record, and one unbranched default pathway. Initialization fails if .ocura-oss/ already exists, including when the directory contains incomplete state.

The text response identifies the den, default pathway, and state directory.

Exit status

StatusMeaning
0State was initialized
2Input was invalid, state already existed, or a filesystem operation failed

Example

ocura-oss init --root ./experiment --name "batch study"

run

Run one trusted local command and record terminal evidence.

ocura-oss run [--root PATH] [--pathway ID] [--param KEY=VALUE] [--quiet] -- COMMAND...

The -- separator is required. Ocura OSS options belong before it. Every token after it is passed to the child command as one argument token.

Arguments and options

NameTypeDefaultDescription
--root PATHpathcurrent directoryProject root containing initialized state
--pathway IDpathway IDden defaultPathway that receives the recorded atom
--param KEY=VALUEstring pairnoneDeclared run parameter; repeatable
--quietflagfalseRetain output without mirroring it to the terminal
COMMAND...argument tokensrequiredExecutable and arguments placed after --

Execution

The command runs with shell=False and the project root as its working directory. It inherits the invoking process environment. Environment keys and values are not serialized.

Stdout and stderr are captured as separate files under .ocura-oss/logs/. Unless --quiet is present, the same bytes are also streamed to the terminal.

One run produces:

  • one atom containing timing, outcome, declared parameters, command arguments, and log metadata
  • one stdout log and one stderr log
  • one branchable terminal chokepoint

A passing command records passed. A nonzero return code records failed. A launch error records launch_failed. The first Ctrl+C records interrupted with partial output retained. A second Ctrl+C exits immediately and may leave that attempt unrecorded.

Text output

The final text summary includes the atom, chokepoint, pathway, outcome, duration, log paths, and the return code or launch category when available. It does not repeat command arguments.

Exit status

StatusMeaning
0The child command returned 0 and passed evidence was recorded
1The child returned nonzero or the attempt was interrupted; evidence was recorded
2Input or state was invalid, or evidence could not be persisted
3The child process could not be launched; launch_failed evidence was recorded

Examples

ocura-oss run -- python script.py --epochs 4
ocura-oss run --pathway pathway-<id> --param batch=4 --quiet -- python script.py

pathways

List structurally valid pathway records in creation order, oldest first.

ocura-oss pathways [--root PATH] [--json]

Options

OptionTypeDefaultDescription
--root PATHpathcurrent directoryProject root containing initialized state
--jsonflagfalseEmit one machine-readable JSON document

Output

Each entry contains:

FieldTypeDescription
idstringPathway identifier
parent_pathway_idstring or nullParent pathway for a branch
source_chokepoint_idstring or nullChokepoint from which the branch was created
created_atstringUTC ISO 8601 timestamp
reasonstringBranch reason; default pathway for the default pathway
parametersobjectEffective declared pathway parameters
has_terminal_evidencebooleanWhether any atom is recorded on the pathway

JSON mode returns {"pathways": [...]}.

The listing is fail-closed. A malformed or misnamed record causes exit status 2 instead of producing a partial list. This command does not verify pathway relationships or logs; use verify for complete state verification.

Exit status

StatusMeaning
0The validated list was emitted
2State was missing, malformed, inconsistent, or unreadable

chokepoints

List structurally valid terminal chokepoint records in reverse creation order, newest first.

ocura-oss chokepoints [--root PATH] [--json]

Options

OptionTypeDefaultDescription
--root PATHpathcurrent directoryProject root containing initialized state
--jsonflagfalseEmit one machine-readable JSON document

Output

Each entry contains:

FieldTypeDescription
idstringChokepoint identifier
pathway_idstringPathway that owns the source atom
atom_idstringRecorded command attempt
outcomestringpassed, failed, launch_failed, or interrupted
created_atstringUTC ISO 8601 timestamp
branchablebooleanWhether the chokepoint can serve as a branch source

JSON mode returns {"chokepoints": [...]}. Command arguments and log contents are not included.

The listing is fail-closed. A malformed or misnamed record causes exit status 2. This command does not verify atom relationships or logs; use verify for complete state verification.

Exit status

StatusMeaning
0The validated list was emitted
2State was missing, malformed, inconsistent, or unreadable

branch

Create a metadata-only child pathway from verified terminal evidence.

ocura-oss branch --from CHOKEPOINT_ID --reason TEXT [--param KEY=VALUE] [--root PATH] [--json]

Arguments and options

NameTypeDefaultDescription
--from CHOKEPOINT_IDchokepoint IDrequiredTerminal branchable source chokepoint
--reason TEXTstringrequiredNonblank explanation recorded on the child pathway
--param KEY=VALUEstring pairnoneOverride applied to the parent's effective parameters; repeatable
--root PATHpathcurrent directoryProject root containing the source
--jsonflagfalseEmit the child pathway summary as JSON

Verification and state effects

Before writing, branch validates the chokepoint, its atom, its pathway, their relationships, and both referenced logs. Missing, checksum-mismatched, nonterminal, nonbranchable, or otherwise unverifiable sources are rejected.

The child inherits the parent's effective parameters and applies the supplied overrides. The operation records the parent pathway, source chokepoint, reason, creation time, and effective parameters.

It does not copy a workspace, process, memory image, checkpoint, artifact, source atom, or external state. It does not run a command. Use run --pathway CHILD_ID to attach later evidence.

JSON output

JSON mode returns the fields documented for a pathway listing. has_terminal_evidence is false for the new child.

Exit status

StatusMeaning
0The child pathway was created
2Input, source records, source logs, or state were invalid

Example

ocura-oss branch --from chokepoint-<id> --reason "increase batch" --param batch=4

compare

Compare one verified source run with the newest recorded run on each child pathway created from its chokepoint.

ocura-oss compare [--from CHOKEPOINT_ID] [--root PATH] [--json]

Options

OptionTypeDefaultDescription
--from CHOKEPOINT_IDchokepoint IDnewest branched source, or newest terminal source when no branches existExplicit source for targeted verification
--root PATHpathcurrent directoryProject root containing initialized state
--jsonflagfalseEmit a structured comparison document

Source selection

With --from, comparison verifies the selected source and the child evidence used in the result.

Without --from, the complete state must pass verification before Ocura OSS selects the newest chokepoint referenced by a child pathway. A state with no child pathways selects its newest terminal chokepoint and reports no_branch. A malformed record, broken reference, unverified log, orphaned log file, or unexpected log directory anywhere in state blocks automatic selection.

Comparison state

StateMeaning
readyEvery child pathway has terminal evidence
partialAt least one child pathway lacks terminal evidence
no_branchNo child pathway was created from the source chokepoint

For a child with multiple atoms, comparison uses the newest atom by start time and identifier. It reports pathway parameter differences and, when child evidence exists, run-level declared parameter differences.

Version 0.2.2 parameter deltas contain inherited, added, and changed values. Removed parameters are outside the comparison schema.

Comparison reads stored records and logs. It does not rerun commands.

JSON output

The top-level document contains:

FieldTypeDescription
statestringready, partial, or no_branch
source_chokepoint_idstringSelected source chokepoint
source_pathway_idstringPathway containing the source run
source_runobjectReduced source atom summary
childrenarrayOne comparison for each child pathway

Each child contains its pathway ID, reason, source chokepoint, pathway parameter delta, source run, optional child run, optional run parameter delta, and missing_evidence flag.

A run summary contains id, pathway_id, outcome, started_at, duration_seconds, and return_code.

Exit status

StatusMeaning
0A comparison was emitted, including partial or no_branch
2Selection, state, source evidence, or child evidence was invalid

verify

Recheck every state record and every log referenced by a recorded run.

ocura-oss verify [--root PATH] [--json]

Options

OptionTypeDefaultDescription
--root PATHpathcurrent directoryProject root containing initialized state
--jsonflagfalseEmit counts and the complete problem list as JSON

Checks

Verification covers:

  • record envelopes, kinds, schema versions, and canonical checksums
  • payload identifiers and agreement between identifiers and filenames
  • required fields and outcome invariants
  • den, pathway, atom, and chokepoint references
  • pathway lineage cycles and source-parent agreement
  • referenced log containment, existence, byte count, and SHA-256 digest
  • unreferenced files and unexpected directories under .ocura-oss/logs/

logs_checked counts individual logs that passed verification. A valid atom normally contributes two logs.

JSON output

FieldTypeDescription
denstringDen identifier
statusstringok or failed
counts.pathwaysintegerPathway records found
counts.atomsintegerAtom records found
counts.chokepointsintegerChokepoint records found
counts.logs_checkedintegerReferenced logs that passed verification
problemsarrayObjects containing record and problem strings

Verification establishes consistency among local records and logs. It does not establish authorship or reproduce external execution conditions.

Exit status

StatusMeaning
0No verification problems were found
2State was missing, unreadable, malformed, inconsistent, or failed verification

demo

Run the complete workflow in a new retained directory.

ocura-oss demo --root PATH [--json]

Options

OptionTypeDefaultDescription
--root PATHpathrequiredDestination directory; it must not exist
--jsonflagfalseEmit completed stages and comparison as JSON

Behavior

The demonstration performs:

  • initialization
  • a passing baseline run with declared batch=1
  • selection of the resulting terminal chokepoint
  • a metadata branch with an explicit reason and effective batch=4
  • a passing run explicitly attached to the child pathway
  • complete state verification
  • a ready comparison

Both commands must pass and verification must report no problems before the demonstration reports completion.

The destination is retained on success and failure. An existing destination produces exit status 2. If a stage fails, the diagnostic names that stage.

JSON output

The document contains the resolved root, an ordered steps array, and the complete comparison object.

Exit status

StatusMeaning
0Every demonstration stage completed
2The destination existed, a stage failed, or resulting state did not verify

Exit status summary

StatusCommandsMeaning
0allRequested operation completed; for run, the child passed
1runChild failed or was interrupted and terminal evidence was recorded
2allInvalid input, missing or invalid state, verification failure, or demo failure
3runChild could not launch and launch-failed evidence was recorded

Argument parsing errors also use status 2.

Security and execution boundary

run executes command tokens directly with shell=False. Ocura OSS does not sandbox commands, restrict network access, contain hostile code, or guarantee process-tree isolation.

Use the CLI only for trusted, same-owner local workloads. See the overview boundaries and Python API reference for the corresponding programmatic contract.