Skip to content

[Factory Experiment] Create run directory on startup with clear error context - #162

Closed
timanglade wants to merge 3 commits into
NetSys:mainfrom
timanglade:tpa/im-198-create-required-run-directory-on-startup
Closed

[Factory Experiment] Create run directory on startup with clear error context#162
timanglade wants to merge 3 commits into
NetSys:mainfrom
timanglade:tpa/im-198-create-required-run-directory-on-startup

Conversation

@timanglade

Copy link
Copy Markdown
Collaborator

Part of an experiment with setting up an automated software factory. Authored by Gas Town on Kilo, using DeepSeek V4 Pro / DeepSeek V4 Flash running on Fireworks. The factory was only fed the content of IM-198, then left completely unsupervised.

Summary

  • Adds .with_context() to create_dir_all calls in State::new() and write_state_file() so directory creation failures produce actionable error messages instead of raw I/O errors
  • Removes pre-creation of /var/run/ and /var/lib/intermesh/ from the e2e test Dockerfile since the daemon now creates these at runtime
  • The admin socket directory (/var/run/intermesh/) was already created with proper error context via AdminServer::bind()

Changes

  • src/state/mod.rs: Add error context wrapping two create_dir_all calls
  • docker/Dockerfile: Remove two directories from test rootfs mkdir

@timanglade
timanglade force-pushed the tpa/im-198-create-required-run-directory-on-startup branch 2 times, most recently from b22db3b to bdc2df1 Compare June 19, 2026 08:06
@timanglade

Copy link
Copy Markdown
Collaborator Author

Similar to #164, the factory was unable to see CI failures but I solved it by just prompting it manually instead, which I'm confident the factory would have done automatically if it had access to this github repo (and hence the CI activity on the PR) — or if we had a beefier factory setup that could run cargo local directly. Ready for review @ejj-agent / @ejj.

@ejj
ejj requested review from ejj and ejj-agent June 20, 2026 22:12
@timanglade
timanglade force-pushed the tpa/im-198-create-required-run-directory-on-startup branch from 3b05cab to dc3ae88 Compare June 20, 2026 22:18

@ejj-agent ejj-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI-generated review draft. This has not been reviewed by a human. Any comments made are non-binding; feel free to ignore them by resolving. This uses the same AI-review process Ethan uses to review his own code.

I found one test coverage gap around the behavior this PR is relying on.

AI-PR-Review: #162 dc3ae88

Comment thread src/state/mod.rs
@@ -137,7 +137,9 @@ impl State {
/// If a field isn't provided via args/env, we fall back to the state file.
pub(crate) async fn new(args: Args) -> Result<Self> {
if let Some(parent) = args.state_file.parent() {
fs::create_dir_all(parent).await?;
fs::create_dir_all(parent).await.with_context(|| {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

AI-generated review draft. This has not been reviewed by a human. Any comments made are non-binding; feel free to ignore them by resolving. This uses the same AI-review process Ethan uses to review his own code.

Can we add a regression test where state_file lives under a missing nested directory? The existing state tests use tmpdir.path().join("state.toml"), so they would still pass if the startup path stopped creating /var/lib/intermesh; now that the Docker rootfs no longer pre-creates that directory, the runtime creation is the core behavior this PR depends on.

Timothée Chatlamet and others added 3 commits June 23, 2026 07:10
- Add  to  calls in State::new() and
  write_state_file() so directory creation failures produce actionable
  error messages instead of raw I/O errors
- Remove pre-creation of /var/run/ and /var/lib/intermesh/ from the
  e2e test Dockerfile since the daemon now creates these at runtime
@kilo-code-bot
kilo-code-bot Bot force-pushed the tpa/im-198-create-required-run-directory-on-startup branch from dc3ae88 to 6e77291 Compare June 23, 2026 07:17
@timanglade

Copy link
Copy Markdown
Collaborator Author

Ditto, not sure why Gas Town decided to do more work on this PR all of a sudden, and the commits don't seem related to the review comments…

@timanglade timanglade closed this Jun 25, 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