lookup
Search THOR's memory across all projects, scopes, and kinds to find existing rules, reports, or chunks before saving, so near-duplicates become revisions.
Instructions
Code lane: searches THOR's memory - every project, archive kinds (Report, Chunk) included - never scoped to only the current project. Call this before remember, so an existing near-duplicate becomes a revise instead. No arguments returns the catalogue of scopes; scope alone lists everything filed there; scope with query narrows a search to it; query alone searches everywhere; key answers only a Lookup item's own exact key (query, scope and kind are then ignored); kind narrows a search to rule, orientation, report or chunk - several at once with a comma, and 'fires' as shorthand for every kind that can fire at a moment, which is what you want when the fact has to steer an action (case-insensitive, an obvious plural such as 'rules' accepted) - without it, Report hits tend to dominate a plain search since their own text runs long, and asking for kind lookup is refused rather than silently answered empty, since a Lookup register only ever answers to its own key. Read-only, and never an injection surface - nothing here reaches you unprompted. Replies with up to 25 matching lines (id, kind, text) and how many more exist, the catalogue, or a plain 'no matches'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | An exact Lookup key. When given, this is the ONLY parameter used - `query`, `scope` and `kind` are all ignored - and only a real Lookup item can ever answer it. | |
| kind | No | Narrow a search to one kind: rule, orientation, report or chunk - case-insensitive, and an obvious plural ("rules") is accepted too. Applied AFTER the search has already run and AFTER `scope`, so it only ever removes hits, never adds or reorders any. `lookup` (the Lookup kind) is refused outright rather than silently answered empty - see `key` above for the door that actually answers one. | |
| query | No | Free-text search over every live item's text and tags, any project, archive kinds (Report/Chunk) included - never a Lookup item (those answer only to their own `key`, see below). | |
| scope | No | One scope, by name, as the catalogue lists it. On its own it opens that scope: every item filed under it, one line each, complete. Together with `query` it narrows that search to this scope alone. |