Skip to content

Nothing reclaims per-repo .gstack state — browse-audit.jsonl is append-only by design and bin/ has no cleanup verb #2627

Closed

Description

@furkankoykiran

Ran a full disk audit on a box with gstack installed across seven repos and noticed there's no way to reclaim the per-repo .gstack/ state short of deleting the directory by hand.

browse/src/audit.ts:6 states the intent plainly:

restarts and is never truncated by the server

That's a reasonable default for an audit log, but nothing else rotates it either, so it's monotonic for the life of the repo:

472K  2026-08-06  /root/ArceHubBot/.gstack/browse-audit.jsonl
 28K  2026-07-12  /root/read-only/.gstack/browse-audit.jsonl
  8K  2026-07-28  /root/.claude/.gstack/browse-audit.jsonl

browse-network.log and browse-console.log sit beside it with the same shape. And .gstack/tmp/ collects codex scratch — codex-err-*.txt, codex-review-iter*.{err,out} — which is pure byproduct:

8.3M  /root/ArceHubBot/.gstack   (8.0M of it in tmp/)

I'm not going to pretend this is urgent. Busiest repo here is 8 MB after six weeks. The reason I'm filing is the structural bit: bin/ has 76 commands and the only two that remove anything are gstack-uninstall and gstack-brain-uninstall, both all-or-nothing. There's no gstack-clean, and /browse gives you no way to say "keep the audit trail, drop the console spam."

What would cover it:

A gstack-clean verb, dry-run by default, scoped to .gstack/ in the current repo. Delete tmp/codex-* past some age, truncate browse-{network,console}.log over a size threshold, and rotate browse-audit.jsonl keeping a retention window rather than truncating it — the audit log is the one file in there with a reason to survive.

Liveness gates worth having before it removes anything: no codex process, no browse daemon listening, file mtime older than an hour. Cheap to check and it makes the command safe to run from a cron.

Environment: gstack 1.60.1.0, Ubuntu 22.04, Claude Code 2.1.220.

Activity

  1. garrytan commented on Aug 22, 2026

    @garrytan
    Owner

    Keeping open as an accepted design direction. Verified the claims (browse-audit.jsonl append-only by design at browse/src/audit.ts:4-6; no rotation anywhere; the .gstack/tmp fallback at bin/gstack-paths:62; zero cleanup verbs in bin/). A new public command wants its own design pass per the PR checklist — the dry-run-by-default + liveness-gate shape sketched here looks right, and gsRotateBackups (bin/gstack-settings-hook:179) is prior art for the rotate-keep-N pattern.

  2. capy-ai commented on Oct 11, 2026

    @capy-ai
    Contributor

    Thanks @furkankoykiran for the idea. In the Oct 11 triage we grouped the open feature requests by theme so related asks get built together instead of one at a time. This one is part of the State root and project identity theme in TODOS.md (https://github.com/garrytan/gstack/blob/50d020ad9/TODOS.md#L54-L69). Closing it here so the open list stays actionable; it isn't rejected, and the theme credits every linked reporter when it's picked up.

  3. added
    parked
    on Oct 25, 2026
  4. capy-ai commented on Oct 25, 2026

    @capy-ai
    Contributor

    Reopened under the parked label: this is tracked in the State root and project identity theme in TODOS.md (https://github.com/garrytan/gstack/blob/main/TODOS.md#p3-feature-themes-from-the-wave-9-triage-filed-2026-10-11), and what fixes it is the state-root and project-identity work (docs/state-root.md), which takes the theme as a whole. Closed-but-tracked read as closed, so parked issues now stay open until they ship, are duplicates, or are declined (https://github.com/garrytan/gstack/blob/main/docs/triage.md).

  5. added
    S3
    enhancement
    on Oct 31, 2026
  6. capy-ai commented on Nov 16, 2026

    @capy-ai
    Contributor

    Thanks again for this. The design direction in the earlier comment still stands, but we're closing parked feature requests instead of keeping them open, and a cleanup command isn't scheduled. When it's planned, it will start from the shape sketched here. Closing.

  7. capy-ai commented on Nov 16, 2026

    @capy-ai
    Contributor

    Reopening: the maintainer earlier marked this as an accepted design direction, so it stays open.

  8. capy-ai commented on Nov 22, 2026

    @capy-ai
    Contributor

    Closing this as fixed. gstack-clean (added in #3858, shipped in v1.93.0.0) is the cleanup command this issue asked for. It removes old codex scratch from the repo's .gstack/tmp, trims oversized browse logs in place, and with --audit-days N drops old browse-audit.jsonl entries. It only reports what it would do unless you pass --apply. If some other per-repo state still grows without bound, reopen this with the path and we'll take another look. Thanks for the original sketch, which shaped the command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S3enhancementparked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions