Skip to main content

Module target

Module target 

Source
Expand description

GAP-SG-205: the resolved database target, reported on every envelope that resolved one.

§Why this is not just another knob record

The Explicit Target Designation rule asks for one thing: a verb with a side effect must name its target in the argv, and the target it actually resolved must appear in the output. The second half is what makes the first half auditable — without it, a write that landed in the wrong database leaves no trace to find.

v1.2.6 emitted the two members from super::base_meta, which sounded right and was not: base_meta runs downstream of TWO short-circuits — crate::output::envelope::emit_json skips the whole layer when super::active is false, and super::apply returns early when super::AgentSurface::is_noop is true. So the target appeared only for a caller that had already set some unrelated flag, and vanished on the default path every agent actually uses:

remember --db T                  → no agent_surface block at all
remember --db T --max-items 50   → db_path_source: "argv"

Hanging a universal contract off an optional block is the same proxy mistake this release already paid for twice in super::gate. The cure is not to move the field somewhere else; it is to stop conditioning the block on “some knob is set” and condition it on “there is something to report”. A resolved target is something to report.

§Why the members live inside agent_surface

Measured, not assumed: 66 of the 74 published schemas close their root with additionalProperties: false, and all 66 already declare agent_surface. A new root member would therefore break 66 contracts, while the existing block absorbs the record at zero schema cost.

§When nothing is reported

Absent means the process never resolved a target, which is the honest answer for config, completions and locale — they touch no database at all. It never means “resolved but omitted”; that distinction is the whole point.

Constants§

DISPENSATION_KEY
Member recording that an ambient target was accepted on purpose.
DISPENSATION_VALUE
Wire spelling of the dispensation, matching the flag that grants it.
RESOLVED_KEY
Member carrying the absolute path this process resolved.
SOURCE_KEY
Member naming which configuration layer supplied the target.

Functions§

insert_into
Writes the target record into meta, when this process resolved a target.
is_reportable
true when this process has a target worth reporting.
record
Builds the record on its own, for envelopes that carry no shaping record.