Port os-context and os-vault Python hooks to Ruby #1527

Open
opened 2026-11-03 14:42:50 +00:00 by jared · 3 comments
Owner

Problem

The journey tracer records in-process Ruby messages only. Two plugins still ship Python hooks: os-context hooks/inject.py (76 lines, SessionStart prompt composition) and os-vault's nine hook files (637 lines: session_start, session_end, vault_sync, memsearch_sync, post_tool_use_write, session_context, config, hook_io, session_state). These entry points are untraceable while Python. Neither plugin has a Ruby lib or a test runner, so each port creates a new Ruby codebase, not a file swap. The hooks work today. Deferred until the journey map needs them.

Reproduce

n/a: feature ticket; the gap is structural.

Approach

Same shape as #1522, #1524 and #1525: one lib class per hook responsibility with injected io, thin hooks/*.rb wrappers, hooks.json (or the os-vault wrapper scripts) switched to ruby, parity diffs against the Python before deletion, Python tests ported to Minitest. Each plugin first needs a lib/, tests/all.rb and tests/test_helper.rb with the use_case tag.

Required work: none beyond the acceptance criteria.

Origin

  • Trigger: #1522, #1524, #1525 shipped 2026-11-03; Jared asked to capture the remaining two plugins at P3
  • Improvised this session: none
  • Chain: hooks untraceable ← hooks are Python ← DESIGN (os-context and os-vault never gained a Ruby lib; os-vault has no hooks.json, its wiring is in tests/python-wrappers/*.sh)
  • Root candidate: none found; searched os-context, os-vault, inject.py, port, python hook, hooks to ruby
  • Where: plugins/os-context/hooks/inject.py, plugins/os-vault/hooks/*.py
  • Session: 32008a4e-5b0f-4863-94d9-7afb84ba65b6
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/32008a4e-5b0f-4863-94d9-7afb84ba65b6.jsonl

VERDICT: CREATE

## Problem The journey tracer records in-process Ruby messages only. Two plugins still ship Python hooks: os-context `hooks/inject.py` (76 lines, SessionStart prompt composition) and os-vault's nine hook files (637 lines: `session_start`, `session_end`, `vault_sync`, `memsearch_sync`, `post_tool_use_write`, `session_context`, `config`, `hook_io`, `session_state`). These entry points are untraceable while Python. Neither plugin has a Ruby lib or a test runner, so each port creates a new Ruby codebase, not a file swap. The hooks work today. Deferred until the journey map needs them. ## Reproduce n/a: feature ticket; the gap is structural. ## Approach Same shape as #1522, #1524 and #1525: one lib class per hook responsibility with injected io, thin `hooks/*.rb` wrappers, hooks.json (or the os-vault wrapper scripts) switched to `ruby`, parity diffs against the Python before deletion, Python tests ported to Minitest. Each plugin first needs a `lib/`, `tests/all.rb` and `tests/test_helper.rb` with the `use_case` tag. Required work: none beyond the acceptance criteria. ## Origin - Trigger: #1522, #1524, #1525 shipped 2026-11-03; Jared asked to capture the remaining two plugins at P3 - Improvised this session: none - Chain: hooks untraceable ← hooks are Python ← DESIGN (os-context and os-vault never gained a Ruby lib; os-vault has no hooks.json, its wiring is in tests/python-wrappers/*.sh) - Root candidate: none found; searched os-context, os-vault, inject.py, port, python hook, hooks to ruby - Where: plugins/os-context/hooks/inject.py, plugins/os-vault/hooks/*.py - Session: 32008a4e-5b0f-4863-94d9-7afb84ba65b6 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/32008a4e-5b0f-4863-94d9-7afb84ba65b6.jsonl VERDICT: CREATE
Author
Owner

Ruling 17 on #1554 (predicted, confidence 72): this ticket carries the Ruby route for os-context and os-vault. Do os-vault after #1540 and #1545 settle. No build now.

Ruling 17 on #1554 (predicted, confidence 72): this ticket carries the Ruby route for `os-context` and `os-vault`. Do `os-vault` after #1540 and #1545 settle. No build now.
Author
Owner

Correction: the Python plugin route ruling is ruling 21 in docs/decisions/rulings.tsv, not ruling 17. Ruling 17 is the #1545 order.

Correction: the Python plugin route ruling is ruling 21 in `docs/decisions/rulings.tsv`, not ruling 17. Ruling 17 is the #1545 order.
Author
Owner

Note from #1576: plugins/os-vault/tests/harness.sh stops before any scenario with 'Hook script not found: hooks/session-start.sh'. The golden files prove nothing today, and #1576 edited session-start-stale/sideeffects/graphify-shim-args.txt by hand with no run to verify it. Repair or retire the harness in this port.

Note from #1576: plugins/os-vault/tests/harness.sh stops before any scenario with 'Hook script not found: hooks/session-start.sh'. The golden files prove nothing today, and #1576 edited session-start-stale/sideeffects/graphify-shim-args.txt by hand with no run to verify it. Repair or retire the harness in this port.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1527
No description provided.