Skip to content

use jsonl format for appending logs in track cmd + toolpath crate convenience methods#6

Closed
benbaarber wants to merge 2 commits intomainfrom
ben/jsonl
Closed

use jsonl format for appending logs in track cmd + toolpath crate convenience methods#6
benbaarber wants to merge 2 commits intomainfrom
ben/jsonl

Conversation

@benbaarber
Copy link
Copy Markdown
Collaborator

  • added Path::load_jsonl and Path::steps_to_jsonl in toolpath crate
  • update the track command to use an appendable jsonl log instead of expensive full read/write

@benbaarber benbaarber requested a review from akesling February 26, 2026 22:39
@github-actions
Copy link
Copy Markdown

🔍 Preview deployed: https://579ab1fb.toolpath.pages.dev

Copy link
Copy Markdown
Contributor

@akesling akesling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

TBH with all this being a vibe-slop base my standards are fairly low right now. As long as this works as advertised and users of the track command can contentedly still use this, that's good enough.

That being said, if you're open to tidying this up and making it better, I'm happy to give more suggestions / guidance ;). I've made a couple comments that you can optionally follow to that end. Choose your own adventure.

}

/// Append a single step as one JSONL line (no rewrite).
fn append_step(session: &std::path::Path, step: &v1::Step) -> Result<()> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to care about it being a step? Maybe just s/append_step/append/ and take an impl Serialize?

// ============================================================================

/// Derive the `.jsonl` steps file path from the `.json` session path.
fn jsonl_path(session: &std::path::Path) -> PathBuf {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any interest in refactoring this to be an on-disk manager that owns the two file management and abstracts away json/jsonl, etc. It could have an impl with rewrite/read/etc. methods and a clean constructor. I feel like the state machine for all of this would be better handled with something like that.

@benbaarber
Copy link
Copy Markdown
Collaborator Author

Will revisit in toolpath log implementation

@benbaarber benbaarber closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants