Memory delta triage

From Fr-e-d/GAAI-framework · View interactive version

Memory delta triage is an AI agent skill from the GitHub repository Fr-e-d/GAAI-framework. Apply three deterministic heuristics to a single memory-delta file to produce a structured verdict block; invoke memory-ingest on ACCEPTED candidates only in validate mode. Activate when Discovery processes a raw memory-delta from contexts/artefacts/memory-deltas/.

How to use this skill

Skill file

Memory Delta Triage

Purpose / When to Activate

Activate when Discovery holds a raw memory-delta file (produced by memory-alignment-check

after QA PASS) and needs a governed, auditable verdict before deciding whether to invoke

memory-ingest.

This skill applies exactly three heuristics to each candidate in the delta. It produces a

## Triage Verdict block. All judgment is attributed to the invoking Discovery agent — this

skill is a deterministic procedure, not a decision maker.

Two modes:

leaves the delta file in its original location. Does NOT invoke memory-ingest.

Use when Discovery wants to review verdicts before committing.

instructs Discovery to invoke memory-ingest. After all ACCEPTED candidates are processed,

moves the delta file to contexts/artefacts/memory-deltas/processed/.


Process

Step 0 — Single-delta scope check

Verify exactly one delta_id argument is provided.

Step 0b — Processed-delta collision check (base.rules.md §6)

Check whether a file already exists at contexts/artefacts/memory-deltas/processed/{delta_id}.memory-delta.md.

Step 0c — Schema check

Read contexts/artefacts/memory-deltas/{delta_id}.memory-delta.md.

Verify the file contains:

  1. artefact_type: memory-delta in YAML frontmatter
  2. At least one of the required structural sections: ## Confirmed Entries, ## Contradicted Entries, ## New Knowledge Candidates

On FAIL (either check fails):

On PASS: continue to Step 1.

Step 1 — Extract candidates

From the delta file, collect all items under ## New Knowledge Candidates and

## Contradicted Entries. Each item is a candidate for triage. Confirmed-only entries

with no contradiction and no new candidate are noted in the verdict as informational

but receive no heuristic evaluation.

Step 2 — Apply Heuristic 1: Invariant test

Reference: contexts/rules/memory-architecture.rules.md §1 (Content Principle — refactor test).

For each candidate, apply the test literally as stated in that section:

"If the codebase is refactored tomorrow without changing the design intent, does this

content still read correctly?"

Do NOT restate the rule content here. The rule file is the authoritative source.

Step 3 — Apply Heuristic 2: Dedup vs index check

Reference: contexts/memory/index.md (check for existing coverage) and

memory-ingest Anti-Collision Guard (.gaai/core/skills/cross/memory-ingest/SKILL.md,

Process section — Anti-Collision Guard paragraph).

For each candidate:

  1. Check contexts/memory/index.md for entries whose category and tags match the candidate
  2. If a matching entry exists, read it and assess: same topic/entity → FAIL (duplicate);

different topic/entity → PASS (new knowledge)

  1. If no matching entry exists → PASS

Do NOT restate the Anti-Collision Guard logic here. The skill file is the authoritative source.

Step 4 — Apply Heuristic 3: Scope test

Reference: contexts/rules/memory-architecture.rules.md §1 "What does NOT belong".

For each candidate, verify it is a cross-module / durable concern and NOT story-specific

transient state. Specifically:

Do NOT restate the rule content here. The rule file is the authoritative source.

Step 5 — Unanimity gate and verdict per candidate

For each candidate:

This gate is hard-coded. No partial acceptance. No override.

Step 6 — Produce Triage Verdict block

Emit the block in the schema defined in the ## Triage Verdict Block Schema section below.

contexts/artefacts/memory-deltas/ (do not move it).

Step 7 (validate mode only) — Invoke memory-ingest and move delta

For each candidate with verdict: ACCEPT:

The skill itself does NOT call memory-ingest directly — it issues an explicit

instruction to the invoking Discovery agent, including the exact candidate content

and the target memory category derived from the candidate metadata.

After all ACCEPTED candidates are processed by memory-ingest (confirmed by Discovery):

to contexts/artefacts/memory-deltas/processed/{delta_id}.memory-delta.md


Triage Verdict Block Schema

## Triage Verdict

triaged_by: "[agent identity — e.g. Discovery Agent, autonomous draft mode]"
triaged_at: "YYYY-MM-DD"
mode: draft | validate
delta_id: "{delta_id}"
schema_check: PASS | FAIL

candidates:
  - candidate_id: "{CANDIDATE-NNN or memory_id}"
    verdict: ACCEPT | ESCALATE
    heuristic_1_invariant: PASS | FAIL
    heuristic_2_dedup: PASS | FAIL
    heuristic_3_scope: PASS | FAIL
    unanimity: ALL_PASS | MIXED
    rationale: "{one sentence — specific finding, not vague}"

overall: ACCEPTED | ESCALATED | MIXED | SCHEMA_FAIL
# validate mode only — added after memory-ingest is complete:
validated_by: "[agent identity]"
validated_at: "YYYY-MM-DD"

Field rules:

memory-ingest has been invoked; absent in draft mode


Quality Checks


Outputs

No memory is written by this skill. Memory is written only by memory-ingest, invoked by

Discovery on explicit instruction from this skill in validate mode only.


Non-Goals

This skill must NOT:

verdict block and stops. Only Discovery may decide to invoke memory-ingest, and only

after the verdict is reviewed (AC8).

memory-ingest (governed by contexts/rules/memory-architecture.rules.md §2). This

skill evaluates suitability only; it does not verify code paths or populate attestation

fields (AC15).

All judgment is attributed to the invoking Discovery agent.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.