Skip to main content

Module dream_proposal

Module dream_proposal 

Source
Expand description

What a Dreams pass’s model answer becomes: a checked list of file operations (SPEC_DREAMS §2.5, §4, §6).

The model has no tools and one turn; its answer is data. This module is where that data is held to the rules before anything is recorded or shown: the schema, the names it may touch, the size of what it writes, and whether each claim is backed by a quote that really is in a source the prompt carried. It runs no model, reads no file and writes nothing: the caller hands it the answer, the memory’s files and the trusted sources, and gets the operations back (or the reason an operation was dropped).

What it decides, so the model’s behaviour is never relied on:

  • an operation on a name that is not a plain .md file, on a protected file, or on a file twice, is dropped;
  • a claim (an added, rewritten or merged text) with no quote that is a literal substring of a trusted source is flagged unsupported; a quote of the model’s own invention counts for nothing;
  • text the pass adds that looks like a command, a URL, a credential, a marker block, a rule that widens what an agent may do, or a change to an identity or permission note, is flagged risky:*.

A flagged operation is still recorded, so a person sees it with its label; it never applies on its own.

Modules§

flag
What an operation is marked with (the strings the Dreams pane shows).
label
Where a quote came from. Only these are trusted: untrusted text is never in the prompt (§6.1), so nothing can be cited from it.

Structs§

Context
What the answer is held against.
Dropped
An operation that was dropped, and why. index is its place in the model’s list.
MemoryFile
One file of the memory as the pass read it. hash is the version the pass saw, which apply checks again.
Outcome
Source
Text the prompt carried, under the label srv gave it. name is what a quote cites it by: a memory file’s name, or a session’s id.

Constants§

MIN_QUOTE_CHARS
A quote shorter than this (trimmed, in characters) proves nothing: it would be found in any text.

Functions§

needs_person
Whether an operation can only be applied by a person: it carries any flag.
valid_name
A memory file name the pass may touch: a plain .md name, no folder, no dot-file, no traversal.
validate
The model’s answer, checked. Err when it is not the schema at all or carries more operations than allowed: the whole answer is discarded. Otherwise each operation is kept (with its flags) or dropped (with why).