Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .lattice/implementations/capture-001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: IMP-CAPTURE-001
type: implementation
title: Nomination staging inbox
body: Inbox model and persistence in src/capture.rs (Inbox, Nomination, load_inbox, save_inbox, add_nomination, remove_nomination) plus the capture add/list/show/reject CLI in src/main.rs. Inbox lives at repo root outside .lattice/.
status: active
version: 1.0.0
created_at: 2026-07-18T00:03:03.564669505+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
language: rust
files:
- path: src/capture.rs
- path: src/main.rs
test_command: 'cargo test --lib capture::'
edges:
satisfies:
- target: REQ-CAPTURE-001
version: 1.0.0
18 changes: 18 additions & 0 deletions .lattice/implementations/capture-002.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
id: IMP-CAPTURE-002
type: implementation
title: Binding-intersection relevance prefilter
body: Deterministic prefilter in src/capture.rs (prefilter, binding_map, staged_files, changed_files_since) intersecting git-changed files with implementation binding paths and resolving affected requirements via satisfies edges. No model call.
status: active
version: 1.0.0
created_at: 2026-07-18T00:03:03.616395140+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
language: rust
files:
- path: src/capture.rs
test_command: 'cargo test --lib capture::'
edges:
satisfies:
- target: REQ-CAPTURE-002
version: 1.0.0
22 changes: 22 additions & 0 deletions .lattice/implementations/capture-003.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
id: IMP-CAPTURE-003
type: implementation
title: pre-commit nominator scan and hook
body: handle_capture Scan in src/main.rs emits the deterministic nomination bundle (prefilter + affected requirements + agent instructions); install_capture_hooks writes a non-blocking pre-commit hook that runs 'lattice capture scan --staged'.
status: active
version: 1.0.0
created_at: 2026-07-18T00:03:03.674996693+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
language: rust
files:
- path: src/main.rs
test_command: 'cargo test --lib capture::'
edges:
satisfies:
- target: REQ-CAPTURE-003
version: 1.0.0
reveals_gap_in:
- target: REQ-CAPTURE-003
version: 1.0.0
rationale: 'missing_requirement: Deduplicate nominations against existing nodes before surfacing'
18 changes: 18 additions & 0 deletions .lattice/implementations/capture-004.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
id: IMP-CAPTURE-004
type: implementation
title: pre-push gate and nomination review
body: handle_capture Gate in src/main.rs surfaces pending nominations and drift; install_capture_hooks writes a pre-push hook that runs 'lattice health --check' as the hard gate then 'lattice capture gate' for review.
status: active
version: 1.0.0
created_at: 2026-07-18T00:03:03.727306612+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
language: rust
files:
- path: src/main.rs
test_command: 'cargo test --lib capture::'
edges:
satisfies:
- target: REQ-CAPTURE-004
version: 1.0.0
19 changes: 19 additions & 0 deletions .lattice/implementations/capture-005.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: IMP-CAPTURE-005
type: implementation
title: Nominate-not-commit guardrail
body: 'Guardrail enforced structurally: capture writes only to the staging inbox outside .lattice/ (src/capture.rs add_nomination/save_inbox); the graph is mutated only by the explicit ''lattice capture accept'' path in src/main.rs, which routes through the existing add_requirement/add_edge CLI. Covered by the inbox_roundtrip_and_guardrail_stays_outside_lattice test.'
status: active
version: 1.0.0
created_at: 2026-07-18T00:03:03.776112001+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
language: rust
files:
- path: src/capture.rs
- path: src/main.rs
test_command: 'cargo test --lib capture::'
edges:
satisfies:
- target: REQ-CAPTURE-005
version: 1.0.0
19 changes: 19 additions & 0 deletions .lattice/implementations/capture-006.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: IMP-CAPTURE-006
type: implementation
title: Nomination entity-resolution (dedup) at add time
body: find_duplicates in src/capture.rs scores a nomination's title+body against existing nodes by token-overlap (Jaccard) and returns likely-duplicate IDs; the capture add handler in src/main.rs attaches them to the nomination and warns, and list/show surface them for the reviewer. Deterministic first pass; semantic dedup is a future upgrade under the vector-search feature.
status: active
version: 1.0.0
created_at: 2026-07-24T22:23:40.942737785+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
language: rust
files:
- path: src/capture.rs
- path: src/main.rs
test_command: 'cargo test --lib capture::'
edges:
satisfies:
- target: REQ-CAPTURE-003-A
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: REQ-CAPTURE-001
type: requirement
title: Nomination staging surface outside the graph
body: AI-generated capture nominations are written to a staging surface outside .lattice/ (for example a lattice-inbox file), never directly into the graph. The staging surface supports review — accept, edit, or reject — and only approved nominations enter the graph through the lattice CLI. This is the foundational primitive the nominator and gate depend on.
status: active
version: 1.0.0
created_at: 2026-07-17T23:11:27.481440641+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
priority: P1
category: CAPTURE
resolution:
status: verified
resolved_at: 2026-07-18T00:03:09.265888931+00:00
resolved_by: agent:claude-2026-07-18
edges:
derives_from:
- target: THX-MILESTONE-NOMINATION
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: REQ-CAPTURE-002
type: requirement
title: Deterministic binding-intersection relevance prefilter
body: Before any model call, capture checks whether the staged diff intersects any implementation bind target (file:function). No intersection means no nomination and no LLM call. Intersection escalates to the nominator and passes the specific bound requirement and implementation IDs as context. This keeps evaluation cheap and high-precision and leverages the graph mapping that a flat memory store lacks.
status: active
version: 1.0.0
created_at: 2026-07-17T23:11:27.521456476+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
priority: P0
category: CAPTURE
resolution:
status: verified
resolved_at: 2026-07-18T00:03:09.301540877+00:00
resolved_by: agent:claude-2026-07-18
edges:
derives_from:
- target: THX-MILESTONE-NOMINATION
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: REQ-CAPTURE-003
type: requirement
title: pre-commit lattice-worthiness nominator
body: On pre-commit, when the relevance prefilter trips, an AI evaluates the staged diff and commit message against the current graph and emits typed nominations (new requirement, reveals_gap_in, challenges, validates) to the staging surface. The nominator must never block the commit and may run asynchronously if the model call is slow. Output is high-precision, capped at roughly three per commit, and returning nothing is a valid and common result.
status: active
version: 1.0.0
created_at: 2026-07-17T23:11:27.599613578+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
priority: P1
category: CAPTURE
resolution:
status: verified
resolved_at: 2026-07-18T00:03:09.336230784+00:00
resolved_by: agent:claude-2026-07-18
edges:
derives_from:
- target: THX-MILESTONE-NOMINATION
version: 1.0.0
depends_on:
- target: REQ-CAPTURE-001
version: 1.0.0
- target: REQ-CAPTURE-002
version: 1.0.0
- target: REQ-CAPTURE-003-A
version: 1.0.0
rationale: 'Refinement: missing_requirement'
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
id: REQ-CAPTURE-004
type: requirement
title: pre-push consistency gate and nomination review
body: On pre-push, run lattice health --check as an opt-in hard gate and surface the accumulated unreviewed nominations together with any unresolved drift, prompting the user to review or defer before the change is shared. Push is the last-chance-before-shared moment and tolerates a heavier check than pre-commit.
status: active
version: 1.0.0
created_at: 2026-07-17T23:11:27.654442887+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
priority: P1
category: CAPTURE
resolution:
status: verified
resolved_at: 2026-07-18T00:03:09.369924719+00:00
resolved_by: agent:claude-2026-07-18
edges:
derives_from:
- target: THX-MILESTONE-NOMINATION
version: 1.0.0
depends_on:
- target: REQ-CAPTURE-001
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
id: REQ-CAPTURE-005
type: requirement
title: Nominate-not-commit guardrail
body: The capture system may only propose. It must never create, edit, or remove graph nodes or edges unattended. Every graph mutation requires explicit human or agent approval through the lattice CLI. This invariant is what lets passive evaluation run continuously without diluting a curated graph.
status: active
version: 1.0.0
created_at: 2026-07-17T23:11:27.560755675+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
priority: P0
category: CAPTURE
resolution:
status: verified
resolved_at: 2026-07-18T00:03:09.405366856+00:00
resolved_by: agent:claude-2026-07-18
edges:
derives_from:
- target: THX-MILESTONE-NOMINATION
version: 1.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
id: REQ-CAPTURE-003-A
type: requirement
title: Deduplicate nominations against existing nodes before surfacing
body: |-
The nominator can propose a new-requirement (or edge) that restates a node already in the graph. Knowledge-graph-generation practice treats entity resolution as a required post-processing stage (Cypher equality, node-similarity, LLM dedup); the capture pipeline currently has no equivalent, so duplicate nominations reach the reviewer unflagged.

## Proposed Resolution

At 'capture add' time, score the nomination's title+body against existing nodes (deterministic token-overlap now; semantic search when vector-search is enabled) and attach likely-duplicate node IDs to the nomination so list/show surface them for the reviewer to resolve.

---
_Gap type: missing_requirement_
status: draft
version: 1.0.0
created_at: 2026-07-24T22:20:12.692347203+00:00
created_by: agent:claude-2026-07-24
requested_by: Claude <noreply@anthropic.com>
priority: P1
category: CAPTURE
tags:
- refinement
- missing_requirement
resolution:
status: verified
resolved_at: 2026-07-24T22:23:29.584189048+00:00
resolved_by: agent:claude-2026-07-24
edges:
derives_from:
- target: THX-MILESTONE-NOMINATION
version: 1.0.0
13 changes: 13 additions & 0 deletions .lattice/sources/agent-memory-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id: SRC-AGENT-MEMORY-HOOKS
type: source
title: Bratanic — Unified Agentic Memory Across Harnesses Using Hooks
body: Tomaz Bratanic (Neo4j). Argues agent memory should live below the harness so it is portable across Claude Code, Codex, and Cursor and owned by the user. Uses standardized lifecycle hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop) for passive deterministic capture into Neo4j as a linked list of session events, plus an offline dream phase where an LLM distills events into merged markdown memories at semantic paths. Injection loads profile memories at session start and fulltext-searched memories per prompt. Companion repo tomasonjo/agent-memory-hooks-neo4j implements hooks/log_event.py, hooks/inject_memory.py, and dream/dream.py.
status: active
version: 1.0.0
created_at: 2026-07-17T23:11:08.798098348+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
url: https://towardsdatascience.com/unified-agentic-memory-across-harnesses-using-hooks/
reliability: blog
retrieved_at: 2026-07-17
20 changes: 20 additions & 0 deletions .lattice/theses/milestone-nomination.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
id: THX-MILESTONE-NOMINATION
type: thesis
title: Git Milestones Are Higher-Signal Nomination Points Than Session Boundaries
body: 'Passively capturing raw agent session exhaust into the knowledge graph pollutes a curated reasoning DAG. Knowledge capture should instead trigger at semantic git milestones (pre-commit and pre-push), where a diff plus its intent-bearing message form a high-signal, self-contained unit far cleaner than a session transcript. At these milestones an AI evaluates the change against the existing graph and surfaces typed, human-reviewable nominations (new requirement, reveals_gap_in, challenges, validates) rather than writing nodes directly. This removes the cumbersome manual judgment of is-this-lattice-worthy while preserving curation discipline: the AI notices and proposes, a human commits. Lattice implementation bindings (file to requirement) give a deterministic relevance filter that keeps evaluation cheap and precise, something a flat memory store cannot do because it lacks the typed graph to diff against.'
status: draft
version: 1.0.0
created_at: 2026-07-17T23:11:08.845201457+00:00
created_by: agent:claude
requested_by: Claude <noreply@anthropic.com>
meta:
category: technical
confidence: 0.7
edges:
supported_by:
- target: SRC-AGENT-MEMORY-HOOKS
version: 1.0.0
extends:
- target: THX-CONTEXT-INFRA
version: 1.0.0
rationale: 'Applies structured-knowledge-infrastructure to the capture path: curated, typed, human-reviewed nomination instead of unstructured passive logging.'
9 changes: 9 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ lattice health --check # CI gate — exits 2 on FAIL
lattice lint # Check for structural issues
lattice diff # Show changes since a git ref
lattice plan REQ-001 REQ-002 # Plan implementation order

# Milestone Capture (nomination, not auto-commit)
lattice capture scan --staged # Prefilter staged diff against bindings; emit nomination bundle
lattice capture add --kind challenges --title ... --body ... --target THX-... # Stage a nomination
lattice capture list # Review pending nominations (inbox lives outside .lattice/)
lattice capture accept NOM-001 --from IMP-... # Materialize a nomination into the graph
lattice capture reject NOM-001 # Drop a nomination
lattice capture gate # Pre-push review — surface nominations + drift
lattice capture install-hooks # Install git pre-commit/pre-push hooks
lattice export # Export narrative (overview)
lattice export -a investor # Export for investors
lattice export -f json # Export as JSON
Expand Down
Loading
Loading