Skip to content

use overlayfs for transparent writing - #8

Merged
mslacken merged 3 commits into
didvc:masterfrom
mslacken:overlayfs
Sep 18, 2026
Merged

mslacken merged 3 commits into
didvc:masterfrom
mslacken:overlayfs

Conversation

@mslacken

@mslacken mslacken commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

What & why

With --overlay option the current directory is mounted via the overlayfs kernel functionality, so that the end of the agent run the used can decide to write the changes back or not.
This is a supercharged --branch option, with the big advantage that on startup no copy happens.

Checklist

  • shellcheck ai-bwrap is clean
  • --help text and README updated together (if the CLI surface changed)
  • Verified with --dry-run (paste relevant output below if helpful)

Notes

Mostly implemented by claude.
Originally this was inspired by wwctl image shell command from warewulf https://github.com/warewulf/warewulf but this implementation is in bash and not golang and reusing the bubblewrap overlayfs implementation.

@mslacken
mslacken force-pushed the overlayfs branch 2 times, most recently from b0b710e to 1092b46 Compare September 16, 2026 13:21
Mostly implmented by claude.
Originally this was inspired by `wwctl image shell` command from
warewulf https://github.com/warewulf/warewulf but this implementation
uses the options from bubblewrap itself.
The y/N prompt is the only gate between the changeset and the real tree,
so the summary has to show everything destructive. With the flat 60-entry
cap a changeset of 200 additions and 5 deletions displayed 0 of the 5:
the deletions fell past the cap and the user was asked to approve a
replay of deletes they had never seen.

Show every D and R entry unconditionally and apply the cap only to
additions and modifications, which are recoverable and are what makes a
large changeset unreadable in the first place.
The agent_* functions are only reached through the computed name
"agent_$AGENT_NAME". ShellCheck 0.10+ calls that SC2329 ("never
invoked"), which the directives already covered; older versions report
the same thing as SC2317 ("appears to be unreachable"), which they did
not, so CI failed on every agent function. List both codes.

@didvc didvc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed. Merge when you've confirmed --overlay behaves on your side.

@didvc

didvc commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution, and for the rebase.

You've got commit access now. I've also approved #8, so it's clear to merge whenever you're happy with it.

Two commits from me on your branch. The change summary was capping at 60 entries, so a changeset with a couple hundred additions hid every deletion behind "... and N more". With 200 additions and 5 deletions it showed 0 of the 5, and you'd be approving a replay of deletes you never saw. Deletions and replaced dirs now always print. The other is a shellcheck fix: CI runs an older version that reports the agent-function warning as SC2317 rather than SC2329, so the directives list both now.

My bubblewrap is too old for --overlay, so I can't exercise it at all. You're better placed to confirm it behaves before it lands. Merge when you're satisfied.

Master needs a PR and an approval, so nothing lands unreviewed. No obligation to review anyone else's PRs.

@mslacken
mslacken merged commit 4bdb112 into didvc:master Sep 18, 2026
1 check passed
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