clew-hook — main (clew_hook.py)¶
Overview · 23 steps, 1 lane
All 23 steps
| # | caller | callee | what it does | frames | call site |
|---|---|---|---|---|---|
| 1 | main | _drain_stdin | Drain stdin fully while keeping only the first _MAX_EVENT bytes. | try (line 1016) | clew_hook.py:1016 |
| 2 | main | _clear | Clear a tally, so pressure can fall as well as rise. | if (line 1028) | clew_hook.py:1028 |
| 3 | _clear | _marker_path | The once-per-session marker path for this hook invocation. | try (line 777) | clew_hook.py:777 |
| 4 | main | _quiet | On a call that says nothing else, say the comment count if it changed. | if (line 1028) | clew_hook.py:1029 |
| 5 | _quiet | _comment_note | The comment note when the waiting count changed since it was last said, else None. | try (line 958) | clew_hook.py:958 |
| 6 | _quiet | _emit | Write a reply, flushing inside the guard; on failure point stdout at the null device. | try (line 958), if (line 960) | clew_hook.py:960 |
| 7 | main | _outside_repo | Whether the inspected path is PROVABLY outside the repository. | — | clew_hook.py:1042 |
| 8 | _outside_repo | _input_value | The raw inspected-path value for one modality, before any sanitising. | try (line 670) | clew_hook.py:670 |
| 9 | main | _quiet | On a call that says nothing else, say the comment count if it changed. | if (line 1043) | clew_hook.py:1043 |
| 10 | main | _event_command | The raw command a Bash event carries, without trusting anything else in it. | — | clew_hook.py:1044 |
| 11 | main | _is_inspection | Whether a shell command inspected a file at all — the question _bash_target does not ask. | — | clew_hook.py:1044 |
| 12 | _is_inspection | _segment_verb | The command word a shell segment runs, with env assignments skipped and the path stripped. | — | clew_hook.py:471 |
| 13 | main | _quiet | On a call that says nothing else, say the comment count if it changed. | if (line 1049) | clew_hook.py:1049 |
| 14 | main | _record | Record one event of a kind for this session. | — | clew_hook.py:1051 |
| 15 | _record | _marker_path | The once-per-session marker path for this hook invocation. | try (line 750) | clew_hook.py:750 |
| 16 | main | _tally | Count of recorded events of one kind for this session. | — | clew_hook.py:1052 |
| 17 | _tally | _marker_path | The once-per-session marker path for this hook invocation. | try (line 733) | clew_hook.py:733 |
| 18 | main | _is_due | Whether this search should carry a note, given the session's pressure. | — | clew_hook.py:1053 |
| 19 | main | _quiet | On a call that says nothing else, say the comment count if it changed. | if (line 1056) | clew_hook.py:1056 |
| 20 | main | _target_name | The basename the agent just looked at, from the event, or None. | try (line 1059) | clew_hook.py:1059 |
| 21 | _target_name | _input_value | The raw inspected-path value for one modality, before any sanitising. | — | clew_hook.py:605 |
| 22 | _target_name | _safe_token | The basename of a path, reduced to the safe alphabet, or None if anything is off. | — | clew_hook.py:605 |
| 23 | main | _payload_for | The complete reply for this pressure, tier chosen by count. | try (line 1059) | clew_hook.py:1060 |
Functions¶
18 functions
_clearclew_hook.py_comment_noteclew_hook.py_drain_stdinclew_hook.py_emitclew_hook.py_event_commandclew_hook.py_input_valueclew_hook.py_is_dueclew_hook.py_is_inspectionclew_hook.py_marker_pathclew_hook.py_outside_repoclew_hook.py_payload_forclew_hook.py_quietclew_hook.py_recordclew_hook.py_safe_tokenclew_hook.py_segment_verbclew_hook.py_tallyclew_hook.py_target_nameclew_hook.pymainclew_hook.py
This diagram as Mermaid · PlantUML · Graphviz DOT
Quick views¶
18 functions, each with its quick view
- _clear
Clear a tally, so pressure can fall as well as rise.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _comment_note
The comment note when the waiting count changed since it was last said, else None.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _drain_stdin
Drain stdin fully while keeping only the first _MAX_EVENT bytes.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _emit
Write a reply, flushing inside the guard; on failure point stdout at the null device.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _event_command
The raw command a Bash event carries, without trusting anything else in it.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _input_value
The raw inspected-path value for one modality, before any sanitising.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _is_due
Whether this search should carry a note, given the session's pressure.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
No requirement names this function as an implementer.
- _is_inspection
Whether a shell command inspected a file at all — the question _bash_target does not ask.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
No requirement names this function as an implementer.
- _marker_path
The once-per-session marker path for this hook invocation.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
No requirement names this function as an implementer.
- _outside_repo
Whether the inspected path is PROVABLY outside the repository.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _payload_for
The complete reply for this pressure, tier chosen by count.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
No requirement names this function as an implementer.
- _quiet
On a call that says nothing else, say the comment count if it changed.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _record
Record one event of a kind for this session.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _safe_token
The basename of a path, reduced to the safe alphabet, or None if anything is off.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs
No requirement names this function as an implementer.
- _segment_verb
The command word a shell segment runs, with env assignments skipped and the path stripped.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _tally
Count of recorded events of one kind for this session.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- _target_name
The basename the agent just looked at, from the event, or None.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
No test calls this function directly.
Reqs
No requirement names this function as an implementer.
- main
Record the call and emit the constant note when one is due; never fail, never block.
Map
Show it on the map, in its block's wedge.
Block
Unassigned is the block holding
clew_hook.py.Flow
Replay
No recorded run reaches this function.
Source
Its page: signature, body, callers and callees. Its activity diagram.
Tests
Reqs