## Review Packet local HTML export

The runnable packet exercise uses only the downloaded Harbor Notes journals\.&#32;It does not require a running model session\.

### Milestone\:&#32;Export the fictional saved history

**Need\.**&#32;Noor wants a local review packet containing the saved history\.

**Obstacle\.**&#32;Exporting from a running session and exporting from a file have different metadata boundaries\.

Prerequisites\:&#32;an already installed OMP compatible with this journal format\/export implementation\,&#32;a disposable extracted examples directory\,&#32;and&#32;`jq`\/`shasum`&#32;for the inspections below\.&#32;No login or provider request is part of this exercise\.

Verify the known input before using it\:

**Terminal shell — read\-only input check\,&#32;from extracted&#32;`examples/`\:**

~~~sh
jq -s 'map(select(.type == "session") | {id,cwd,title})' review-packet/harbor-review.jsonl
shasum -a 256 review-packet/harbor-review.jsonl review-packet/harbor-review/Scout.jsonl review-packet/harbor-review/Scout/Checklist.jsonl
~~~

Use a fresh copy of the examples so the output filename does not replace a useful earlier packet\.

**Terminal shell — supplied native local export recipe\:**

~~~sh
omp --export review-packet/harbor-review.jsonl review-packet/harbor-review.html
~~~

**Expected observation\.**&#32;OMP prints&#32;`Exported to: review-packet/harbor-review.html`&#32;and writes that local file\.

The source handles terminal export before normal session startup\.&#32;It opens a manager with breadcrumb suppression\,&#32;reads the valid journal\,&#32;gathers adjacent nested transcripts\,&#32;generates HTML\,&#32;and exits\.&#32;It does not construct a running&#32;`AgentSession`\.

The file export does not reconstruct a current live system prompt or tool inventory\.&#32;Saved entries themselves can still contain system\,&#32;tool\,&#32;file\,&#32;or other sensitive data\;&#32;absence of top\-level live fields is not a privacy guarantee\.

**What changes\?**&#32;A local HTML output is created\.

**What does not change in the checked valid\-input case\?**&#32;The journal remains unchanged\;&#32;no active conversation is switched\.

Repeat the byte inspection\:

**Terminal shell — read\-only post\-export comparison\:**

~~~sh
shasum -a 256 review-packet/harbor-review.jsonl review-packet/harbor-review/Scout.jsonl review-packet/harbor-review/Scout/Checklist.jsonl
~~~

**Recorded check\.**&#32;Valid fictional exports retained journal bytes and embedded the expected older and nested history\.&#32;A real source\-CLI export completed successfully\,&#32;including a filename containing spaces\.

**Failure and recovery\.**&#32;If writing fails\,&#32;inspect the target path and output before retrying\.&#32;Do not assume an automatic retry\,&#32;a transactional output\,&#32;or a particular missing\-directory creation policy\.&#32;Never choose a journal or useful workspace file as the output path\:&#32;the implementation writes to the requested output path\.

**Self\-check\.**&#32;Does creating HTML also publish it through&#32;`/share`\?

**Answer\:**&#32;No\.&#32;Local file generation and sharing are separate operations\.

### Milestone\:&#32;Keep shell quoting separate from slash parsing

**Need\.**&#32;Noor wants a filename containing a space\.

**Obstacle\.**&#32;Terminal shell quoting and human slash\-command parsing are not the same parser\.

The supplied terminal recipe preserves the spaced filename as one argument\:

**Terminal shell — supplied quoted\-output recipe\,&#32;from extracted&#32;`examples/`\:**

~~~sh
omp --export review-packet/harbor-review.jsonl 'review-packet/harbor review.html'
~~~

**Recorded check\.**&#32;The actual source CLI exported successfully to a spaced output filename\.&#32;This is not a claim that interactive slash quoting works\.

The following table is a&#32;**non\-runnable human slash\-command reference**\:

| Reference | Current behavior |
| --- | --- |
| `/export packet.html` | Write local HTML with current live prompt\/tool descriptions and all manager entries\;&#32;TUI requests OS opening\. |
| `/export --themes packet.html` | Use the selected TUI dark\/light themes rather than the default web palettes\. |
| `/export packet.html --themes` | The parser also accepts this ordering\. |
| `/export "packet review.html"` | Rejected as multiple whitespace\-delimited path tokens\.&#32;Quotes do not preserve the space\. |
| `/export one.html two.html` | Rejected with usage\. |
| `/export --copy` | Warns to use&#32;`/dump`\;&#32;no HTML export\. |
| `/export copy`&#32;or&#32;`/export clipboard` | Same copy\-alias warning\. |

`parseExportArgs`&#32;recognizes&#32;`--themes`\,&#32;removes that token\,&#32;and accepts at most one remaining whitespace\-delimited path\.&#32;It does not implement shell expansion\,&#32;quote interpretation\,&#32;or general option validation\.&#32;An unrecognized single token can become a literal filename\.

Use a no\-space filename for interactive export\.&#32;Do not assume&#32;`~`&#32;or shell variables will be expanded there\.

Terminal&#32;`--export`&#32;instead consumes its input as a flag value and uses the first positional message as output path\.&#32;It does not use&#32;`parseExportArgs`&#32;or expose the slash command’s&#32;`--themes`&#32;syntax\.&#32;Keep the terminal recipe to its documented input and optional output\.

**What changes\?**&#32;The terminal recipe creates a second local HTML output\.

**What does not change\?**&#32;Quoting changes argument grouping\,&#32;not snapshot scope or disclosure policy\.

**Failure and recovery\.**&#32;For an interactive path error\,&#32;choose a no\-space path\.&#32;Do not switch to&#32;`/dump`&#32;merely because a warning mentions it unless you also want the dump’s broader current\-state and sidecar behavior\.

**Self\-check\.**&#32;Why does terminal quoting work while slash quoting fails\?

**Answer\:**&#32;The shell passes one argv element\;&#32;the slash parser splits the command text on whitespace\.

### Persistence and missing\-input limits

An in\-memory manager without a session file is rejected by HTML export with\:

`Cannot export in-memory session to HTML`

A successful dump is not proof that HTML export is available\.

For existing saved inputs\,&#32;the recorded export path did not mutate the journal\.&#32;Do not generalize that into “this command can never create or alter an input file under any path condition\.”

`exportFromFile`&#32;translates an&#32;`ENOENT`&#32;that reaches it into&#32;`File not found: …`\.&#32;But its delegated&#32;`SessionManager.open`&#32;path also has fresh\-session behavior for empty\/missing explicit files\.&#32;The supplied reports did not exercise a missing\-input terminal export\.

**Validate the input first\.**&#32;Do not use export as a file\-existence test\,&#32;and do not promise that every missing\-input case is a harmless not\-found failure\.

**Source anchors\:**&#32;`packages/coding-agent/src/export/html/args.ts`&#32;—&#32;`parseExportArgs`\;&#32;`packages/coding-agent/src/export/html/index.ts`&#32;—&#32;`exportSessionToHtml`\,&#32;`exportFromFile`\,&#32;`buildSessionData`\;&#32;`packages/coding-agent/src/main.ts`&#32;—&#32;`runRootCommand`&#32;export fast\-path\;&#32;`packages/coding-agent/src/cli/flag-tables.ts`&#32;—&#32;`--export`\;&#32;`packages/coding-agent/src/modes/controllers/command-controller.ts`&#32;—&#32;`handleExportCommand`\.
