Skip to content

harden: log writers, bundle toggles, launcher probe, agent markers - #323

Merged
jothimani-rajendran merged 2 commits into
mainfrom
sr-1-engine-hardening-b
Oct 25, 2026
Merged

jothimani-rajendran merged 2 commits into
mainfrom
sr-1-engine-hardening-b

Conversation

@jothimani-rajendran

@jothimani-rajendran jothimani-rajendran commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Replaces #322: identical tree (empty diff against its head f50decd), one clean commit.

What

Engine hardening from a routine security review (SR-1):

  • Log writers: lstat the file, its lock, rotated file and parent directories before opening; refuse anything that is not a regular file or real directory; open with no-follow, non-blocking flags. Session-log scratch file is 0600.
  • chock bundle on|off and status --adopt are person-only (repo root resolved first); read-only status stays open.
  • Launcher accepts a recorded interpreter only if it answers a Python probe (a speed bump, not a boundary).
  • Agent markers named in .chock/config.yaml are read from the working tree and HEAD.

Tests

New tests/test_log_path_safety.py; additions to test_hook_launcher.py and test_person_only_commands.py. Goldens regenerated with CHOCK_REGEN_GOLDENS=1.

After merge

.chock/ is owner-only: run chock sync to re-render .chock/bin. Until then validate and the two freshness tests fail by design.

…markers

- decision log and session log: lstat the file, its lock, rotated file and
  directories before opening, never follow a symlink or wait on a FIFO
- `chock bundle on|off` and `status --adopt` are person-only; `status` stays read-only
- launcher accepts a recorded interpreter only when it answers a Python probe
- agent markers named in `.chock/config.yaml` are read from the working tree and HEAD
- runtime goldens regenerated

Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator Author

validate (3.11, 3.12, 3.13) is red on compiled_drift in .chock/bin: the runtime sources changed and .chock/ is owner-only. It clears after the owner runs chock sync --repo . and commits the result; no push from this worker can fix it. no-private-data is the check this PR replaces #322 for.


Generated by Claude Code

Signed-off-by: Jothi Mani Rajendran <250249270+jothimani-rajendran@users.noreply.github.com>
@jothimani-rajendran
jothimani-rajendran marked this pull request as ready for review October 25, 2026 03:44
@jothimani-rajendran
jothimani-rajendran merged commit 6e6252d into main Oct 25, 2026
26 checks 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.

1 participant