Skip to content

RSI Phase 2: segmentation-boundary audit task type - #57

Open
ronshapiro wants to merge 1 commit into
basefrom
segmentation-boundary-audit
Open

RSI Phase 2: segmentation-boundary audit task type#57
ronshapiro wants to merge 1 commit into
basefrom
segmentation-boundary-audit

Conversation

@ronshapiro

Copy link
Copy Markdown
Owner

Summary

Phase 2 of RSIAgentRedesignPlan.md: the second content-generation task type, and the first genuinely new one under the redesigned architecture (Phase 1, #56, only re-platformed the existing translation task).

  • segmentation_audit.ts: for a given page, asks Claude to review Gemara segment and Rashi/Tosafot comment boundaries for coherence issues (e.g. "this Rashi comment is really two comments merged together") using the page skeleton + context_fetch_cli for anything it needs to actually read. Deliberately an audit, not a mutation — it never changes segment boundaries itself; findings are written to precomputed/rsi_state/segmentation_suggestions/<Book Page>.json for a human to review and act on manually (no in-page review UI yet — that's Phase 3).
  • No self-critique pass, unlike translation: since nothing here is auto-applied, the human reviewer is the real judgment gate. A cheap local check (no model call) still drops any suggestion referencing a ref that isn't actually on the page, as a guard against a hallucinated ref.
  • Staleness is keyed on a boundary fingerprint (the ordered list of segment/comment refs) rather than full text — a punctuation fix elsewhere on the page shouldn't invalidate a boundary finding, but an actual boundary change always should.
  • Wired into model_routing_config.json, budget_config.json (disabled by default, given priority ahead of translation per the plan's "this task type is upstream of the others" reasoning), and schedule_runner.ts.
  • segmentation_audit_cli.ts for manual runs, matching rashi_tosafot_translation_cli.ts's conventions.

Test plan

  • npx jest — 86 suites / 838 tests pass
  • npx tsc (pre-commit check) — clean
  • npx eslint on all changed files — no errors (only pre-existing no-console warnings on CLI/scheduler scripts)
  • Smoke-tested segmentation_audit_cli.ts, schedule_runner.ts, and status_cli.ts via ts-node against real local state (new task type shows up correctly, disabled by default, no-ops safely)

🤖 Generated with Claude Code

Detects poorly-split Gemara segments and Rashi/Tosafot comments,
reports findings for human review — deliberately an audit, not a
mutation, since nothing here is auto-applied. No self-critique pass
(the human reviewer is the judgment gate); a cheap local check drops
suggestions referencing refs that don't actually exist on the page.
Staleness keys on an ordered ref-list "boundary fingerprint" rather
than full text, so unrelated text edits don't invalidate a finding.

Wired into model_routing_config.json, budget_config.json (disabled
by default, higher priority than translation per the plan's
"upstream" ordering), and schedule_runner.ts.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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