Skip to content

Commit 9b5006c

Browse files
committed
docs: address graph model review findings (#322)
1 parent c5cf956 commit 9b5006c

10 files changed

Lines changed: 176 additions & 67 deletions

GRAPH_SCHEMA.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
> Ref: #180 (BDK-001)
66
>
77
> This document is the graph contract, not the canonical product narrative.
8-
> Some prefixes and examples reflect legacy manual-authoring and roadmap-oriented workflows that remain supported, but they are not the current center of the product story.
9-
> The product-level node and edge vocabulary lives in [docs/design/graph-data-model.md](docs/design/graph-data-model.md).
8+
> Some prefixes and examples reflect legacy manual-authoring and roadmap-oriented
9+
> workflows that remain supported, but they are not the current center of the
10+
> product story.
11+
> The product-level node and edge vocabulary lives in
12+
> [docs/design/graph-data-model.md](docs/design/graph-data-model.md).
1013
1114
---
1215

ROADMAP.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ Goal:
124124

125125
Deliverables:
126126

127-
- git-warp audit / upgrade cycle before major Hill 1 implementation (issue [#312](https://github.com/flyingrobots/git-mind/issues/312))
128127
- bootstrap command contract with default write behavior and `--dry-run`
129128
- canonical repo fixture substrate for repository-shaped bootstrap scenarios (issue [#311](https://github.com/flyingrobots/git-mind/issues/311))
130129
- repo-local artifact inventory and scan boundaries
@@ -135,6 +134,12 @@ Deliverables:
135134
- acceptance criteria translated into failing executable tests (issue [#310](https://github.com/flyingrobots/git-mind/issues/310))
136135
- implementation issues `#304` through `#307`, plus enabling test issues [#310](https://github.com/flyingrobots/git-mind/issues/310) and [#311](https://github.com/flyingrobots/git-mind/issues/311), moved into merged runnable behavior
137136

137+
Completed enabling work:
138+
139+
- git-warp audit and upgrade cycle completed in issue [#312](https://github.com/flyingrobots/git-mind/issues/312)
140+
- isolated git-warp v17 upgrade fixture harness completed in issue
141+
[#320](https://github.com/flyingrobots/git-mind/issues/320)
142+
138143
Exit criteria:
139144

140145
- `git mind bootstrap` runs end-to-end on a representative unfamiliar repository

docs/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ These describe what Git Mind is now and how work should be judged:
1313
- [Git Mind Product Frame](./design/git-mind.md) — IBM Design Thinking style product frame
1414
- [Hill 1 Semantic Bootstrap Spec](./design/h1-semantic-bootstrap.md) — first executable Hill 1 slice
1515
- [Graph Data Model](./design/graph-data-model.md) — canonical product node and edge vocabulary
16-
- [Feature Profiles](./design/feature-profiles/README.md) — per-feature IBM Design Thinking profiles with executable test plans
17-
- [git-warp Upgrade Audit](./design/git-warp-upgrade-audit.md) — next enabling cycle before major Hill 1 implementation
16+
- [Feature Profiles](./design/feature-profiles/README.md) — per-feature IBM
17+
Design Thinking profiles with executable test plans
18+
- [git-warp Upgrade Audit](./design/git-warp-upgrade-audit.md) — completed
19+
enabling cycle before major Hill 1 implementation
1820
- [Git Mind North Star](./VISION_NORTH_STAR.md) — longer-form strategic articulation
1921
- [ADR-0005](./adr/ADR-0005.md) — official planning and governance model
2022
- [ADR-0006](./adr/ADR-0006.md) — official delivery cycle and tests-as-spec model

docs/design/feature-profiles/doctor-integrity.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ as actionable diagnostics.
6262
flowchart LR
6363
Doctor["tool:git-mind-doctor"] -->|references| Graph["module:graph"]
6464
Graph -->|groups| File["file:src/graph.js"]
65-
Edge["file:missing.js implements spec:bootstrap-json"] -->|references| Problem["event:dangling-edge"]
65+
Missing["file:missing.js"] -->|implements| Spec["spec:bootstrap-json"]
66+
Problem["event:dangling-edge"] -->|references| Missing
67+
Problem -->|references| Spec
68+
Doctor -->|references| Problem
6669
Problem -->|blocks| Healthy["metric:graph-health"]
6770
```
6871

docs/design/feature-profiles/entity-extraction.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ Hill:
2626
Playback evidence:
2727

2828
- Bootstrap creates useful `file:`, `doc:`, `adr:`, conservative `module:`,
29-
`commit:`, `issue:`, and `pr:` nodes from repo-local evidence.
29+
`issue:`, and `pr:` nodes from repo-local evidence. History-aware bootstrap
30+
may also create system-owned `commit:` nodes through Git Mind's system writer.
3031

3132
## User Stories
3233

@@ -75,11 +76,11 @@ properties before relationship inference adds semantic edges.
7576

7677
```mermaid
7778
flowchart LR
78-
PathA["README.md"] --> Readme["doc:README"]
79-
PathB["docs/adr/ADR-0006.md"] --> Adr["adr:0006"]
80-
PathC["src/graph.js"] --> File["file:src/graph.js"]
81-
PackageJson["package.json"] --> Package["pkg:@git-stunts/git-warp"]
82-
Heading["Semantic Bootstrap"] --> Concept["concept:semantic-bootstrap"]
79+
Readme["doc:README"]
80+
Adr["adr:0006"]
81+
File["file:src/graph.js"]
82+
Package["pkg:@git-stunts/git-warp"]
83+
Concept["concept:semantic-bootstrap"]
8384
```
8485

8586
## Test Plan
@@ -97,7 +98,8 @@ Golden path:
9798
- Markdown docs become `doc:` nodes.
9899
- ADR files become `adr:` nodes.
99100
- Package boundaries become conservative `module:` nodes.
100-
- Commit metadata produces `commit:` nodes when bootstrap includes history.
101+
- Commit metadata produces system-owned `commit:` nodes when bootstrap includes
102+
history.
101103
- `#123` and `PR #45` references create placeholder `issue:` and `pr:` nodes.
102104

103105
Edge cases:
@@ -113,6 +115,8 @@ Known failures:
113115
- Invalid node IDs must fail or be normalized with explicit reason.
114116
- Collisions must be reported and deterministic.
115117
- Missing package metadata must prevent module inference rather than guessing.
118+
- YAML/frontmatter imports that try to author `commit:` or `epoch:` nodes must
119+
remain rejected by the graph schema.
116120

117121
Fuzz:
118122

docs/design/feature-profiles/import-export-interchange.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ portable model.
6363
```mermaid
6464
flowchart LR
6565
Export["doc:graph-export"] -->|references| Node["module:bootstrap"]
66-
Export -->|references| Edge["file:src/bootstrap.js implements spec:bootstrap-json"]
6766
File["file:src/bootstrap.js"] -->|implements| Spec["spec:bootstrap-json"]
67+
Export -->|references| File
68+
Export -->|references| Spec
6869
Import["tool:import"] -->|references| Export
6970
```
7071

docs/design/feature-profiles/query-receipts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ Playback evidence:
7070

7171
Query receipts read the canonical nodes and edges from
7272
[Graph Data Model](../graph-data-model.md) and return answer payloads that cite
73-
the exact assertions used. A receipt should identify the answer node, the edge
74-
path, confidence, and the evidence behind each inferred step.
73+
the exact assertions used. A receipt should identify the answer node, the
74+
`(source, target, type)` assertion key, confidence, and the evidence behind each
75+
inferred step.
7576

7677
```mermaid
7778
flowchart LR
@@ -93,7 +94,7 @@ Fixtures:
9394

9495
Golden path:
9596

96-
- Query returns direct answer with receipt edge IDs and provenance.
97+
- Query returns direct answer with assertion keys and provenance.
9798
- Query returns inferred answer with confidence and evidence.
9899
- Query returns no-answer result with suggested follow-up.
99100
- JSON validates against a query-answer schema.

docs/design/feature-profiles/views-lenses.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ and edge types without creating alternate semantics.
6161

6262
```mermaid
6363
flowchart LR
64-
Architecture["feature:architecture-view"] --> Module["module:graph"]
64+
Architecture["feature:architecture-view"] -->|references| Module["module:graph"]
6565
Module -->|groups| Source["file:src/graph.js"]
6666
Doc["doc:GRAPH_SCHEMA"] -->|documents| Spec["spec:graph-schema-v1"]
6767
Module -->|depends-on| Package["pkg:@git-stunts/git-warp"]

docs/design/graph-data-model.md

Lines changed: 135 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ flowchart LR
6060
Artifact["Artifact nodes"] -->|documents| Subject["Subject nodes"]
6161
Work["Work nodes"] -->|touches| Artifact
6262
Subject -->|depends-on| Dependency["Dependency nodes"]
63-
Assertion["Edge assertion"] -->|references| Evidence["Evidence artifact"]
63+
Evidence["doc:evidence"] -->|references| Artifact
6464
Reviewer["person:reviewer"] -->|references| Decision["decision:review"]
65-
Decision -->|documents| Assertion
65+
Decision -->|references| Subject
6666
```
6767

6868
The local Git repository is the graph scope. In v1, the local repository itself
@@ -86,68 +86,154 @@ stable, human-readable, and derived from repo artifacts whenever possible.
8686

8787
### Artifact Nodes
8888

89-
| Prefix | Use | Example | Typical properties |
90-
|--------|-----|---------|--------------------|
91-
| `file:` | Repo file path | `file:src/graph.js` | `path`, `language`, `artifactKind`, `hash` |
92-
| `doc:` | General documentation artifact | `doc:README` | `path`, `title`, `heading`, `artifactKind` |
93-
| `adr:` | Architecture decision record | `adr:0006` | `path`, `title`, `status`, `date` |
94-
| `spec:` | Product, API, schema, or behavior spec | `spec:bootstrap-json` | `path`, `title`, `schemaVersion` |
95-
| `commit:` | Git commit discovered by history scan | `commit:34636d3` | `sha`, `author`, `date`, `summary` |
96-
| `epoch:` | System temporal marker for historical views | `epoch:34636d3` | `ref`, `tick`, `createdAt` |
89+
- `file:` identifies a repo file path.
90+
Example: `file:src/graph.js`.
91+
Typical properties: `path`, `language`, `artifactKind`, `hash`.
92+
- `doc:` identifies a general documentation artifact.
93+
Example: `doc:README`.
94+
Typical properties: `path`, `title`, `heading`, `artifactKind`.
95+
- `adr:` identifies an architecture decision record.
96+
Example: `adr:0006`.
97+
Typical properties: `path`, `title`, `status`, `date`.
98+
- `spec:` identifies a product, API, schema, or behavior spec.
99+
Example: `spec:bootstrap-json`.
100+
Typical properties: `path`, `title`, `schemaVersion`.
97101

98102
### Subject Nodes
99103

100-
| Prefix | Use | Example | Typical properties |
101-
|--------|-----|---------|--------------------|
102-
| `module:` | Internal module or subsystem | `module:bootstrap` | `name`, `path`, `package`, `owner` |
103-
| `crate:` | Internal package when the repo uses crate language | `crate:git-mind-core` | `name`, `path`, `language` |
104-
| `pkg:` | External package or dependency | `pkg:@git-stunts/git-warp` | `name`, `version`, `ecosystem` |
105-
| `concept:` | Named idea that appears across artifacts | `concept:semantic-bootstrap` | `name`, `aliases` |
106-
| `decision:` | Review or architecture decision event | `decision:bootstrap-contract` | `action`, `reviewer`, `timestamp` |
104+
- `module:` identifies an internal module or subsystem.
105+
Example: `module:bootstrap`.
106+
Typical properties: `name`, `path`, `package`, `owner`.
107+
- `crate:` identifies an internal package when the repo uses crate language.
108+
Example: `crate:git-mind-core`.
109+
Typical properties: `name`, `path`, `language`.
110+
- `pkg:` identifies an external package or dependency.
111+
Example: `pkg:@git-stunts/git-warp`.
112+
Typical properties: `name`, `version`, `ecosystem`.
113+
- `concept:` identifies a named idea that appears across artifacts.
114+
Example: `concept:semantic-bootstrap`.
115+
Typical properties: `name`, `aliases`.
116+
- `decision:` identifies a review or architecture decision event.
117+
Example: `decision:bootstrap-contract`.
118+
Typical properties: `action`, `reviewer`, `timestamp`.
107119

108120
### Work Nodes
109121

110-
| Prefix | Use | Example | Typical properties |
111-
|--------|-----|---------|--------------------|
112-
| `issue:` | GitHub or tracker issue | `issue:322` | `number`, `title`, `state`, `url` |
113-
| `pr:` | Pull request | `pr:323` | `number`, `title`, `state`, `url` |
114-
| `task:` | Local work item or actionable unit | `task:h1-bootstrap-tests` | `title`, `status`, `owner` |
115-
| `feature:` | Product feature grouping | `feature:query-receipts` | `title`, `hill`, `status` |
116-
| `milestone:` | Historical or release grouping | `milestone:h1` | `title`, `status` |
117-
| `phase:` | Phase alias used by legacy views | `phase:stabilize` | `title`, `status` |
122+
- `issue:` identifies a GitHub or tracker issue.
123+
Example: `issue:322`.
124+
Typical properties: `number`, `title`, `state`, `url`.
125+
- `pr:` identifies a pull request.
126+
Example: `pr:323`.
127+
Typical properties: `number`, `title`, `state`, `url`.
128+
- `task:` identifies a local work item or actionable unit.
129+
Example: `task:h1-bootstrap-tests`.
130+
Typical properties: `title`, `status`, `owner`.
131+
- `feature:` identifies a product feature grouping.
132+
Example: `feature:query-receipts`.
133+
Typical properties: `title`, `hill`, `status`.
134+
- `milestone:` identifies a historical or release grouping.
135+
Example: `milestone:h1`.
136+
Typical properties: `title`, `status`.
137+
- `phase:` identifies a phase alias used by legacy views.
138+
Example: `phase:stabilize`.
139+
Typical properties: `title`, `status`.
118140

119141
### Actor And Tool Nodes
120142

121-
| Prefix | Use | Example | Typical properties |
122-
|--------|-----|---------|--------------------|
123-
| `person:` | Human actor or reviewer | `person:james` | `handle`, `displayName` |
124-
| `tool:` | Tool, agent, service, or local integration | `tool:codex` | `name`, `version`, `capabilities` |
125-
| `event:` | Named event in repo history | `event:bootstrap-playback` | `date`, `summary` |
126-
| `metric:` | Measured value or health indicator | `metric:graph-density` | `name`, `unit`, `value` |
143+
- `person:` identifies a human actor or reviewer.
144+
Example: `person:james`.
145+
Typical properties: `handle`, `displayName`.
146+
- `tool:` identifies a tool, agent, service, or local integration.
147+
Example: `tool:codex`.
148+
Typical properties: `name`, `version`, `capabilities`.
149+
- `event:` identifies a named event in repo history.
150+
Example: `event:bootstrap-playback`.
151+
Typical properties: `date`, `summary`.
152+
- `metric:` identifies a measured value or health indicator.
153+
Example: `metric:graph-density`.
154+
Typical properties: `name`, `unit`, `value`.
155+
156+
### System-Owned Nodes
157+
158+
The schema reserves some prefixes for Git Mind system writers:
159+
160+
- `commit:` identifies a Git commit discovered through repository history.
161+
Example: `commit:34636d3`.
162+
Typical properties: `sha`, `author`, `date`, `summary`.
163+
- `epoch:` identifies a system temporal marker for historical views.
164+
Example: `epoch:34636d3`.
165+
Typical properties: `ref`, `tick`, `createdAt`.
166+
167+
Users and import files must not author `commit:` or `epoch:` nodes directly.
168+
Bootstrap and history-aware features may create them only through Git Mind's
169+
system-owned writers, with tests that also prove YAML/frontmatter import still
170+
rejects those prefixes where the schema requires rejection.
127171

128172
## Canonical Edges
129173

130174
Edges are directed. Direction matters because query receipts, views, and
131175
review flows rely on it.
132176

133-
| Edge | Direction | Use | Example |
134-
|------|-----------|-----|---------|
135-
| `documents` | explainer -> subject | Artifact explains a subject | `doc:README -> module:cli` |
136-
| `references` | source -> referenced | Explicit citation or mention | `doc:README -> issue:322` |
137-
| `implements` | implementation -> spec or feature | Code or work realizes behavior | `file:src/bootstrap.js -> spec:bootstrap-json` |
138-
| `touches` | change -> artifact | Commit, PR, or issue modifies or affects artifact | `commit:34636d3 -> file:README.md` |
139-
| `groups` | parent -> child | Structural containment | `module:cli -> file:bin/git-mind.js` |
140-
| `belongs-to` | member -> group | Planning membership | `task:h1-bootstrap-tests -> feature:bootstrap` |
141-
| `depends-on` | dependent -> dependency | Requires dependency first | `module:query -> module:graph` |
142-
| `blocks` | blocker -> blocked | Work cannot proceed until blocker changes | `issue:310 -> issue:304` |
143-
| `consumed-by` | resource -> consumer | Dependency is consumed by a module | `pkg:@git-stunts/git-warp -> module:graph` |
144-
| `augments` | extension -> base | Adds capability to subject | `tool:extension -> module:git-mind` |
145-
| `relates-to` | source -> related | Low-specificity association | `concept:receipts -> concept:provenance` |
177+
- `documents`: explainer -> subject.
178+
Use when an artifact explains a subject.
179+
Example: `doc:README -> module:cli`.
180+
- `references`: source -> referenced.
181+
Use for explicit citation, mention, or receipt evidence.
182+
Example: `doc:README -> issue:322`.
183+
- `implements`: implementation -> spec or feature.
184+
Use when code or work realizes behavior.
185+
Example: `file:src/bootstrap.js -> spec:bootstrap-json`.
186+
- `touches`: change -> artifact.
187+
Use when a commit, PR, or issue modifies or affects an artifact.
188+
Example: `commit:34636d3 -> file:README.md`.
189+
- `groups`: parent -> child.
190+
Use for structural containment.
191+
Example: `module:cli -> file:bin/git-mind.js`.
192+
- `belongs-to`: member -> group.
193+
Use for planning membership.
194+
Example: `task:h1-bootstrap-tests -> feature:bootstrap`.
195+
- `depends-on`: dependent -> dependency.
196+
Use when one subject requires another first.
197+
Example: `module:query -> module:graph`.
198+
- `blocks`: blocker -> blocked.
199+
Use when work cannot proceed until blocker changes.
200+
Example: `issue:310 -> issue:304`.
201+
- `consumed-by`: resource -> consumer.
202+
Use when a dependency is consumed by a module.
203+
Example: `pkg:@git-stunts/git-warp -> module:graph`.
204+
- `augments`: extension -> base.
205+
Use when one subject adds capability to another.
206+
Example: `tool:extension -> module:git-mind`.
207+
- `relates-to`: source -> related.
208+
Use only for low-specificity associations.
209+
Example: `concept:receipts -> concept:provenance`.
146210

147211
Use `relates-to` only when a stronger edge would be dishonest. If the evidence
148212
can justify `documents`, `references`, `implements`, `groups`, or `touches`,
149213
prefer the stronger type.
150214

215+
## Assertion Identity
216+
217+
Git Mind does not currently model edges as first-class `edge:` nodes. The
218+
canonical identity for an assertion is the edge tuple:
219+
220+
```text
221+
(source, target, type)
222+
```
223+
224+
Examples:
225+
226+
```text
227+
(file:src/bootstrap.js, spec:bootstrap-json, implements)
228+
(doc:README, issue:322, references)
229+
```
230+
231+
Query receipts, import/export contracts, diagnostics, and review decisions
232+
should cite this tuple key unless a future schema version deliberately adds
233+
first-class assertion IDs. Do not invent synthetic graph nodes such as
234+
`edge:abc123` or `assertion:xyz` without updating this model, the validators,
235+
and the affected feature profiles.
236+
151237
## Assertion Properties
152238

153239
The current runtime already uses these edge properties:
@@ -165,7 +251,7 @@ Feature work should converge on these additional conventions:
165251
|----------|---------|
166252
| `origin` | `manual`, `import`, `bootstrap`, `inference`, `review`, or `extension` |
167253
| `detector` | Rule, parser, importer, or tool that produced the assertion |
168-
| `evidence` | Stable evidence references such as paths, headings, line spans, commits, or URLs |
254+
| `evidence` | Stable paths, headings, line spans, commits, or URLs |
169255
| `observer` | Trust or observer context used when the edge was read or written |
170256
| `schemaVersion` | Machine contract version for structured edge metadata |
171257

@@ -202,8 +288,9 @@ flowchart LR
202288
```mermaid
203289
flowchart LR
204290
Question["spec:query-question"] -->|references| Target["module:bootstrap"]
205-
Answer["doc:answer-json"] -->|references| EdgeA["doc:README documents module:bootstrap"]
206-
EdgeA -->|references| Evidence["file:README.md"]
291+
Doc["doc:README"] -->|documents| Target
292+
Answer["doc:answer-json"] -->|references| Doc
293+
Answer -->|references| Target
207294
Reviewer["person:maintainer"] -->|references| Answer
208295
```
209296

@@ -212,7 +299,7 @@ flowchart LR
212299
```mermaid
213300
flowchart LR
214301
Suggestion["file:src/bootstrap.js"] -->|implements| Contract["spec:bootstrap-json"]
215-
Decision["decision:accept-bootstrap-edge"] -->|documents| Contract
302+
Decision["decision:accept-bootstrap-edge"] -->|references| Contract
216303
Decision -->|references| Suggestion
217304
Reviewer["person:reviewer"] -->|references| Decision
218305
```

0 commit comments

Comments
 (0)