SourceReadHandler
`source:read` — returns a raw slice of one source file inside the app root, by line range. The debt this pays (measured on a live cattle run): the agent said, literally, «I don't have a read file tool». Without one, `edit`'s find/replace contract is unusable — a find must match the file VERBATIM, and text remembered or deduced rarely does — so every change fell back to `implement` reconstructing the whole file from memory. Read first, then find/replace exactly what was read. The path discipline is {@see TestHandler}'s: a path that resolves outside the root is refused before anything is opened, because once this is an operation the input no longer comes only from a person typing on their own machine. Truncation is declared, never silent, and the default slice is small on purpose — ask again with `from` rather than paging a whole file into the context. Not found is `ok:false` with a reason, never an exception (same contract as {@see ValidateHandler}).
SourceReadHandler::__construct()
public function __construct(Milpa\DevTools\Support\RootResolver $roots = new RootResolver()):Parameters
| Name | Type | Description |
|---|---|---|
| $roots | Milpa\DevTools\Support\RootResolver |
SourceReadHandler::handle()
public function handle(array $input): arrayReads up to `lines` lines starting at 1-based `from`, with honest accounting: how many lines the file has, how many came back, and whether anything after the slice was left out.
Parameters
| Name | Type | Description |
|---|---|---|
| $input | array<string, mixed> |