Skip to content

D55 — A research run starts from one prompt and leaves what it learnt for the next

  • Status: Accepted — amends D46, D46b, D46c, D49 and D39; amended by D56 (a report is checked before it is recorded, and every URL it cites is accounted for) and D60 (the prompt asks what the run used)
  • Date: 2026-09-24
  • Origin: slice 30, from asking how far kg is from a research run that picks up where the last one stopped
  • Area: surfaces

Decision

A research run on a scope is done by whatever researches best: a hosted deep-research agent, a Claude subagent, a person. It does not use kg. kg writes the prompt that starts the run, and records the report that comes back. No new command: kg sweep brief and kg sweep record take on the job.

  • One prompt: kg sweep brief <scope> with no --channel.
  • --channel C still gives one channel's brief, and --due --out DIR one per due channel, for work split by channel (D46b).
  • The prompt, in order:
    • the topic: kg.yaml title/about, else the pack's first sentence, then the scope's criteria and exclusions;
    • what we hold: each member with its place, status, party and the scope's props, and the stated count;
    • settled: candidates decided and members held out;
    • what to find, ranked: the refresh tasks (D49), each with what we hold, the findings behind it (the new value one source gave, the dispute, the age) and a plain question, with no field names; then what an earlier run found that is waiting for review (its gap is held back: a person decides it, not another run), open candidates, leads and open questions;
    • where to look: each shared channel, with its playbook and traps, the lessons runs have added, when it was last looked at and what the last run said of it. An importer is marked as the recorder's to run;
    • already tried: searches that found nothing newer or could not read a page, per entity and property;
    • how to answer: a normal report, a URL and the exact words for every fact, and a closing WHERE I LOOKED. No JSON.
  • Each list is capped with a "+N more" line (--limit for the tasks, default 15). On a real scope [redacted — D65] it is about 160 lines, and 200 after one recorded run.
  • --out FILE writes it; MCP read op=sweep_brief gives it with no channel.
  • Nothing local is in a prompt. A prompt leaves this machine as surely as a bundle does (D47f).
  • The prompt, a shared channel's brief, and the refresh and support briefs leave out:
    • rows kept local, and what depends on them;
    • local-only channels, and the candidates they turned up.
  • The finished prompt is scanned for the person's private_terms and refused on a hit, naming the term and line.
  • A local-only channel's own brief keeps its rows and is headed LOCAL ONLY.
  • --claim never sends a local channel's name to a hosted peer; its lease stays in the graph.
  • The report comes back through kg sweep record, which gains optional keys; old results still record.
  • report / report_file: the report, kept verbatim on the sweep. It points at things and is never evidence, like a tracker.
  • documents may come without text. Under fetch: record in kg.yaml, the recorder fetches each cited page and checks the quote against the page, never against the report's words.
    • fetch: record allows fetching only while a run is recorded (sweep record, refresh record); on still allows everything.
    • A page that cannot be read becomes an unreachable search for each entity and property it was cited for.
  • outcomes: nothing_newer and unreachable searches, logged as a refresh's are (D49). The gap is held back for retry_days, and the entity brief shows it as tried.
  • leads: what the run saw and did not follow, deferred as unread_source, on the entity when one is named. A lead waiting on review is shown in the next prompt too.
  • lessons: {channel, kind: playbook | trap, text}.
    • They are kept on the channel, dated and signed, with the same text kept once.
    • They are shown after the pack's own playbook and traps.
    • A shared scope's file carries them; a local channel's stay here.
    • They survive channels_from_pack refreshing the template.
  • new_channels: added as channels of the scope.
  • The whole record is checked before anything is written. A lesson about a channel that is not there refuses it.
  • Schema 14: sweeps.report, channels.lessons and attempts.sweep_id. A search made in a sweep stays local wherever that sweep does.

Why

The goal is a research run that starts where the last one stopped, with no chat history. Most of what that needs was already stored, but none of it reached the next run.

  • Two briefs, per channel and per gap. On a real scope [redacted — D65] that was 970 lines of sweep briefs and 338 of refresh tasks. --due returned nothing when no channel was due, while the gaps waited.
  • A format that taxes the researcher. The briefs asked for strict JSON with a saved text file per page, which a hosted research agent cannot give. The effort goes into our format instead of the question.
  • What was learnt, lost. A sweep's notes ("paywalled", "403", "page 11 is the last") were stored and never shown again. attempts had no rows on the real graph, because only refresh wrote it. A trap reached the playbook only when someone edited pack.yaml.
  • A leak. sweep brief listed the local-only candidates from a private list under ALREADY DECIDED, in text meant for a researcher.

Keeping kg on either side of the run lets the researcher work as deeply as its own setup allows, and keeps the six hard rules where they were: the recorder reads every cited page, and a quote is checked against the page.

Alternatives

  • A kg resume or kg task command with a research-task record. A second place to look, beside scopes, sweeps and briefs, that people would have to learn and agents would have to remember to update. The scope already is the research question; its sweeps are the checkpoints.
  • Give the researcher kg's tools. A hosted research agent cannot run them, and one that can spends its effort on our format.
  • Ask for JSON back. It is the part hosted agents do worst. One closing section, WHERE I LOOKED, is the only structure the next run needs.
  • Trust the report's quotes. A report is a summary. Checking against the page is hard rule 6, and the reason recording fetches.
  • Write lessons into pack.yaml. A pack is versioned and shared across scopes, and a lesson is usually about one scope's channel. The scope file carries it to others working the same scope.

Open questions

  • A report's facts are turned into mentions by the recorder, an agent. Nothing checks that a report's fact reached a mention: a dropped fact is simply not recorded. kg check --extract (BACKLOG) would be the engine's side of that.
  • Lessons accumulate. When one goes stale, it is corrected by hand for now.