Skip to content

Pass strut's STRUT_RETENTION to repo2graph - #797

Merged
Evanfeenstra merged 1 commit into
masterfrom
feature/strut-retention-env
Nov 17, 2026
Merged

Evanfeenstra merged 1 commit into
masterfrom
feature/strut-retention-env

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Collaborator

Strut's retention sweep decides how long a finished run's log stays on the disk. Its fleet default is STRUT_RETENTION, for every workflow that sets no retain: of its own (stakwork/strut#705, plans/retention.md). Strut runs inside repo2graph, and repo2graph's env is built here, so a swarm could not set that window: #794 passes the archive's STRUT_ARCHIVE_S3_* and nothing else. This passes STRUT_RETENTION from the host's .env to repo2graph when it is set, like STRUT_CHAT_MODEL.

What a host sets

STRUT_RETENTION Meaning
unset 7 days with the archive on (STRUT_ARCHIVE_S3_BUCKET); with no archive, nothing is evicted
3d, 12h (units s m h d w) a finished run's log stays this long
20 the newest 20 finished runs of each workflow keep their logs

Past the window, with the archive on, a log is uploaded and then dropped from the disk, and a read brings it back. With no archive it is deleted, and the run's summary stays. A workflow's own retain: wins. An invalid value is warned about by strut and ignored.

Getting it onto a host and into repo2graph is the same as for the archive's vars (#794): the host .env, then a stack restart and a repo2graph recreate (super's "Update Env" does both).

When it takes effect

Only once a swarm's stakgraph-mcp image carries a strut that reads STRUT_RETENTION: stakwork/strut#705 must merge and stakgraph must bump mcp's strut pin (it pins eb4beae6, stakwork/strut#693, which reads only the first name, STRUT_RUN_RETENTION, never passed here). Until then the var reaches the container and nothing reads it. Safe to merge first.

Tests

cargo test --lib images::repo2graph (below). No new test: the other getenv passthroughs in repo2graph (STRUT_CHAT_MODEL, STRUT_LLM_MODEL) have none, and one here would have to set the process env, which the archive tests avoid.

PROTOC=/opt/homebrew/bin/protoc cargo test --lib images::repo2graph
test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 155 filtered out

Strut's fleet retention window (stakwork/strut#705, plans/retention.md):
how long a finished run's log stays on the disk when its workflow sets
no retain:. Passed from the host's .env when set, like STRUT_CHAT_MODEL.
Takes effect once mcp's strut pin carries #705.
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.

1 participant