Files
rea/scripts/fixtures/tokenizer-family-wrapper.py
T
YsopwnableandKaoru0822 ec394a2bdf feat(javascript): add filtered retained module reference views
Expose filtered canonical module identities, retained source-range counts and mixed support through the existing shared CLI/MCP analysis view. Preserve full-item access, source selection, provenance and partial coverage while allocating only the selected page.

Verify exact facts and CLI/MCP identity on shipped Obsidian, record complete-task BPE/resource measurements and reuse owned-process supervision for optional tokenizer cleanup.

Fixes #4092
Part of #4027; decision #4091.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
2026-10-15 21:05:00 +08:00

37 lines
1.1 KiB
Python
Executable File

#!/usr/bin/env python3
"""POSIX fault fixture for the optional module-reference token counter.
Use as --tokenizer-python with an explicit REA_TOKENIZER_PROBE_RECORD path.
It deliberately ignores the counter arguments, forks a detached helper that
ignores SIGTERM, and stalls. The production owned-command supervisor must
terminate the verified family. Recorded PIDs are observations, not authority
to signal a process; verification also checks the owned scope after exit.
"""
import json
import os
from pathlib import Path
import signal
import time
def main():
record = Path(os.environ["REA_TOKENIZER_PROBE_RECORD"])
child = os.fork()
if child == 0:
os.setsid()
signal.signal(signal.SIGTERM, signal.SIG_IGN)
record.write_text(json.dumps({
"pid": os.getpid(),
"group": os.getpgrp(),
"parent": os.getppid(),
"run_id": os.environ.get("REA_PROCESS_RUN_ID"),
"detached": True,
"ignores_sigterm": True,
}) + "\n", encoding="utf-8")
time.sleep(30)
if __name__ == "__main__":
main()