Skip to content

fix: bound REPL history storage and startup memory - #513

Merged
sodejm merged 2 commits into
mainfrom
bugfix/503-bounded-repl-history
Oct 15, 2026
Merged

sodejm merged 2 commits into
mainfrom
bugfix/503-bounded-repl-history

Conversation

@sodejm

@sodejm sodejm commented Oct 15, 2026

Copy link
Copy Markdown
Owner

REPL startup now reads a bounded history tail and retains at most 1,000 entries and 1 MiB, with a 16 KiB serialized-entry limit. Legacy compaction and subsequent writes use private temporary files and atomic replacement; failures preserve the original file and leave bounded session history available in memory. Sensitive-command filtering and restrictive permissions remain enforced.

The security gate also required refreshing the reviewed Python, secrets, and selected Trail of Bits registry snapshots. This is a separate signed commit with updated byte/semantic pins and contract tests; integrity failures still fail closed.

Closes #503.

Validation:

  • make pre-push: 3,520 passed, 28 skipped; 83.19% coverage; lint and type checks passed; dependency audit clean; Semgrep completed with zero findings.
  • Focused history/REPL tests cover a fictional 128 MiB legacy file, bounded reads and retention, malformed/oversized records, interrupted compaction, symlink replacement, permissions, and sensitive-command exclusion.
  • Semgrep runner contract tests: 24 passed.
  • The regression was reproduced against the baseline (50 retained entries with a configured limit of 3). This baseline check was retrospective, after the initial implementation, rather than a pre-implementation TDD run.

Architecture, threat-model, console, privacy, and CI documentation are updated. The change adds no provider calls or diagnostics containing command contents. API contracts and release artifact/provenance paths are unaffected.

Read only a bounded history tail, retain the newest entries within count and
byte limits, and compact history through private atomic replacements. Keep
in-memory history bounded when persistence fails, and reject malformed,
oversized, sensitive, or symlinked history input.

Document retention, privacy, and threat-model implications, with regressions
for legacy files, failure recovery, permissions, and replacement races.

Validation: make test (3518 passed, 28 skipped), make lint, make typecheck.
make security is blocked by an upstream Semgrep rule-bundle hash mismatch;
dependency audit passed. This commit remains local pending the security gate.

Refs #503
@github-actions github-actions Bot added documentation Improvements or additions to documentation testing labels Oct 15, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T03:30:15.303597Z 2fec00b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sodejm

sodejm commented Oct 15, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 2fec00bdca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@sodejm
sodejm merged commit fd001b7 into main Oct 15, 2026
23 checks passed
@sodejm
sodejm deleted the bugfix/503-bounded-repl-history branch October 15, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bound REPL history storage and startup memory

1 participant