flagon-io/g1t

public

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t/services/work/migrations/0019_memory_capture.sql

26 lines1,510 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Agents get guardrails, run credentials, an audit log, a context hub, repository instructions and mentions; security upkeep; snake_case API1-- Memory that fills itself: what agents report learning at the end of a
2-- run, corrections people make in review, decisions summed up on merge and
3-- what a project's own docs say arrive as candidates. A candidate is given
4-- to no agent until it is kept: by a person in the Review queue, or by g1t
5-- when two independent sources say the same thing, or a doc says it with
6-- high confidence. Everything kept before this change stays kept.
7
8-- candidate, kept or dismissed.
9ALTER TABLE memories ADD COLUMN status TEXT NOT NULL DEFAULT 'kept';
10-- 0 to 1: how sure the source was. Null for what people wrote.
11ALTER TABLE memories ADD COLUMN confidence REAL;
12-- What it came from, beside source_kind (person, agent, run, review, pr,
13-- doc): "run:<id>", "comment:<id>", "pull:<repo id>#<n>", "doc:<path>".
14ALTER TABLE memories ADD COLUMN source_ref TEXT;
15-- What it was learned from, quoted: a line of a doc, a review comment.
16ALTER TABLE memories ADD COLUMN evidence TEXT;
17-- The text folded to compare candidates: lowercase words only.
18ALTER TABLE memories ADD COLUMN fingerprint TEXT;
19-- JSON array of the distinct source_refs that said it.
20ALTER TABLE memories ADD COLUMN sources TEXT NOT NULL DEFAULT '[]';
21-- Who kept or dismissed it, and when.
22ALTER TABLE memories ADD COLUMN reviewed_by TEXT;
23ALTER TABLE memories ADD COLUMN reviewed_at TEXT;
24
25CREATE INDEX memories_by_status ON memories (workspace, status, updated_at);
26CREATE INDEX memories_by_fingerprint ON memories (scope, scope_key, fingerprint);