Expand description
Capture quality gate (Cloud v4 V1, SPEC-ENGINE §3.1).
Every item that leaves the machine for a vault is one typed claim:
a single complete sentence of 24–300 characters, a node type, at least
one valid reference, an evidence level, deduplicated against what the
place holds, admitted and screened. The gate is rule-based: it rejects
with a stable ReasonCode, it never rewrites or splits (E1). A fact
that fails stays in the local knowledge store unchanged.
Modules§
- conflicts
- Concurrent edits of one shared fact across Instances (#286).
- dedupe
- Dedupe of the capture gate (SPEC-ENGINE §3.1.5): an exact key over the
normalised statement and a MinHash near-duplicate check, both keyed with
the place id key
pk_id, so two engines of a place reach the same verdict and nobody without the key can confirm a guessed statement. - derived
- Provenance of captured claims (Cloud v5 CHECKLIST 2.2.2, 2.6.1): a claim
that names a vault node itself (
node:<id>reference) builds on it, and itsnode.addis followed by aderived_fromedge to that node. The edge is ordinary vault content: signed, queued with the claim (offline too) and pushed by the next sync. - emit
- Capture step 6 (SPEC-ENGINE §3.1.2): what the gate let through becomes
signed
node.addevents in the place’s replica — queued as pending (the offline queue the sync driver pushes), with the keyed dedupe key, the encrypted MinHash signature and anown_sourcesrow, so a later run never sends the same claim twice and a purge can find the local text. - episode
- Episodes (SPEC-ENGINE §3.2.3): one node per ended session, built from
its record — the goal (last task), the outcome (final progress or an
explicit keyword), dead ends (
ctx_session finding tag=dead_endand revert commits of the session window), the files it changed and the commits it made. An episode that fails the episode rules (§3.1.4) is not captured (episode_shape, orno_referencewithout files and commits); nothing of it leaves the machine then. - lifecycle
- The lifecycle of captured knowledge after its
node.add: what an agent does to a fact later reaches the vault, so other engines never keep receiving knowledge its author has withdrawn. - refs
- Reference grammar of the capture gate (SPEC-ENGINE §3.1.3, rule G10):
file:,sym:,test:,commit:,node:andhttps://, each checked against the checkout bound to the vault. An invalid reference counts as absent; a commit that is on no remote-tracking branch yet is pending. - rules
- Text rules of the capture gate (SPEC-ENGINE §3.1.4, G2–G9): one complete, single-line claim of 24–300 characters that is not log output, not truncated and not a list. Rules reject; they never rewrite.
- sharing
- Whether a fact just remembered goes to the team, decided when it is
remembered (3.12.3):
ctx_knowledge rememberandlean-ctx knowledge remembersay"local only: <reason>"with how to fix it, instead of a plain OK that the capture gate later turns into a silent rejection.
Structs§
- Capture
Candidate - A local fact shaped for the gate.
- Capture
Counts - Counts of capture runs (SPEC-ENGINE §3.1.2 step 7): never any text.
- Capture
Run - One capture run for one place: the gate’s inputs and what it counted.
- Captured
Fact - A fact the gate let through, with its valid references and where it
came from in the local store (for
own_sources, never shared). - Pending
- A candidate waiting for its commit to reach a remote-tracking branch.
Enums§
- Reason
Code - Why the gate refused a candidate. Stable snake_case strings: counted,
shown in
cloud status, reported to the place as counts only.
Constants§
- GATE_
VERSION - Version of the gate rules, carried with every count and event.
- MAX_
REFERENCES - References a claim may carry (G10).
- PENDING_
DAYS - A candidate whose only reference is an unpublished commit waits this long before it is rejected finally (G10).
Functions§
- evidence_
of - Evidence level of a fact: explicit;
importedfor imports and provider or derived origins;observedfor a local fact with an anchor; elsestated. - fact_
key_ hash hex(blake3_keyed(pk_id, category || 0x00 || key)): names a local fact in the pending file without its slug.- finish_
run - Keep what a run found: its counts and the candidates still pending.
- gate
- The rules G2–G11 on a shaped candidate. Returns the valid references.
- load_
counts - load_
pending - local_
pk_ id - The place id key of a vault until the replica delivers the server’s
id_salt(SPEC-ENGINE §3.1.5). - node_
type_ of - Node type of a fact (SPEC-ENGINE §3.1.3),
Err(NoType)for a category in the deny map. - open_
run - Open a capture run for the project
stableatroot: the vault it is bound to (or the project itself before it is), its pending candidates. Returns the run and the place name its counts are kept under. - record_
counts - Add one run’s counts to the vault’s unsent counts.
- save_
pending - shape
- Shape a fact into a candidate (G1).
import_refis the reference its import source names (file:<path>orcommit:<sha>).
Type Aliases§
- Counts
File - Unsent counts per vault,
<data>/cloud/capture/counts.json.