Skip to content

Commit 68d5e32

Browse files
Release v4.1.0: pip packaging, validate/doctor, limitations, case study
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6e84f26 commit 68d5e32

18 files changed

Lines changed: 2972 additions & 1277 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ jobs:
4444
with:
4545
python-version: "3.11"
4646

47-
- name: Install pytest
48-
run: python -m pip install --quiet pytest
47+
- name: Install package and pytest
48+
run: |
49+
python -m pip install --quiet pytest
50+
python -m pip install --quiet -e .
4951
5052
- name: Verify required files exist (Python)
5153
shell: python
@@ -76,6 +78,7 @@ jobs:
7678
"install.sh",
7779
"install.ps1",
7880
"requirements.txt",
81+
"pyproject.toml",
7982
"scripts/board.sh",
8083
"scripts/board.ps1",
8184
"scripts/post-commit",
@@ -88,6 +91,9 @@ jobs:
8891
"scripts/graphstack/hook.py",
8992
"scripts/graphstack/platform_utils.py",
9093
"scripts/graphstack/constants.py",
94+
"scripts/graphstack/validate.py",
95+
".graphifyignore",
96+
"docs/case-studies/graphstack-self.md",
9197
]
9298
missing = [p for p in required if not Path(p).is_file()]
9399
for p in required:
@@ -111,13 +117,15 @@ jobs:
111117
print("example-task.json schema OK")
112118
113119
- name: Run graphstack pytest suite
114-
env:
115-
PYTHONPATH: scripts
116120
run: python -m pytest scripts/graphstack/tests -v
117121

122+
- name: Validate project layout (graphstack validate)
123+
run: graphstack validate
124+
125+
- name: Fail if knowledge graph is stale vs HEAD
126+
run: graphstack validate --fail-stale-graph
127+
118128
- name: Board smoke test (Python module — cross-platform)
119-
env:
120-
PYTHONPATH: scripts
121129
shell: python
122130
run: |
123131
import os, subprocess, sys

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ __pycache__/
1717
*.pyo
1818
.venv/
1919
venv/
20+
*.egg-info/
2021

2122
# Node
2223
node_modules/

.graphifyignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# GraphStack source repo — code-focused graph (v4.1+)
2+
# Markdown workflow files inflate the graph with doc fragments; scan Python core + demo app.
3+
4+
README.md
5+
CHANGELOG.md
6+
CONTRIBUTING.md
7+
LICENSE
8+
docs/**
9+
orchestrator/**
10+
.cursor/skills/**
11+
.cursor/rules/**
12+
.cursor/commands/**
13+
handoff/**
14+
.github/**
15+
demo/DEMO_WALKTHROUGH.md
16+
install.sh
17+
install.ps1
18+
scripts/board.sh
19+
scripts/board.ps1
20+
scripts/post-commit
21+
scripts/post-commit.ps1
22+
graphify-out/**

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ All notable changes to GraphStack are documented here.
44

55
---
66

7+
## [v4.1.0] — 2026-05-17
8+
9+
### Added
10+
- **`pyproject.toml`** — install GraphStack with `pip install -e .`; console script `graphstack` points at `graphstack.cli:main`.
11+
- **`graphstack validate`** — LLM-free checks for handoff layout, board task JSON, `STATE.md`, and graph commit vs `git HEAD` (`--fail-stale-graph` for CI).
12+
- **`graphstack doctor`** — human-readable health report (same checks as validate; warnings do not fail by default).
13+
- **`.graphifyignore`** — code-focused graph profile for the GraphStack source repo (reduces markdown noise in `graphify-out/`).
14+
- **`docs/case-studies/graphstack-self.md`** — honest self-analysis: graph quality on a meta-repo, token savings confidence levels, validation workflow.
15+
- **README Limitations** section — orchestrator enforcement, token estimates, graph ROI, setup steps.
16+
- **Pytest** — 5 new tests in `test_validate.py` (28 total in suite).
17+
18+
### Changed
19+
- **CI**`pip install -e .` before tests; `graphstack validate --fail-stale-graph` step; `pyproject.toml` and `validate.py` in required-files manifest.
20+
- **Installer** — copies `validate.py` into target projects with the Python package.
21+
22+
### Fixed
23+
- N/A (quality-of-life / transparency release).
24+
25+
---
26+
727
## [v4.0.0] — 2026-05-16
828

929
GraphStack v4 is the **cross-platform release**. Windows runs natively in PowerShell (no Git Bash needed), macOS runs without `coreutils`, and the entire workflow logic lives in a single Python package. The `skills/` directory was unified with the post-install `.cursor/skills/` layout so the source repo and an installed project look identical.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The `demo/` folder shows GraphStack in action on a Node.js auth service. More de
4747
### 5. Write a case study
4848

4949
Used GraphStack on a real project? Measured token savings? Wrote about it?
50-
Open a PR adding a `docs/case-studies/` entry or link to your post in the README.
50+
Open a PR adding a `docs/case-studies/<name>.md` entry (see `docs/case-studies/graphstack-self.md` for the template style) or link to your post in the README.
5151

5252
### 6. Cursor slash-command bootstrap snippets
5353

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ One prompt starts the entire lifecycle — from blank repo to production.
77

88
[![CI](https://github.com/MertCapkin/graphstack/actions/workflows/ci.yml/badge.svg)](https://github.com/MertCapkin/graphstack/actions)
99
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
10-
[![Version](https://img.shields.io/badge/version-v4.0.0-blue)](CHANGELOG.md)
10+
[![Version](https://img.shields.io/badge/version-v4.1.0-blue)](CHANGELOG.md)
1111
[![Platforms](https://img.shields.io/badge/platforms-Windows%20%7C%20macOS%20%7C%20Linux-success)](#compatibility)
1212
[![Works with Cursor](https://img.shields.io/badge/Works%20with-Cursor-blue)](https://cursor.sh)
1313
[![Works with Claude Code](https://img.shields.io/badge/Works%20with-Claude%20Code-orange)](https://claude.ai/code)
1414

1515
</div>
1616

17-
> **v4 highlights:** native Windows PowerShell support (no Git Bash needed), single Python core for board/install/hook logic, tri-OS CI matrix, and 23-test pytest suite. See [CHANGELOG.md](CHANGELOG.md) for the full migration notes.
17+
> **v4.1 highlights:** `pip install -e .` packaging, `graphstack validate` / `graphstack doctor`, CI graph-staleness checks, code-focused `.graphifyignore`, and an honest limitations + case-study section. See [CHANGELOG.md](CHANGELOG.md).
1818
1919
---
2020

@@ -35,6 +35,11 @@ git --version # any recent version is fine
3535
pip install -r requirements.txt
3636
# or, equivalently, install Graphify directly with the same pin:
3737
pip install "graphifyy>=0.7,<0.9"
38+
39+
# Optional: install GraphStack CLI from a clone (board / validate / doctor)
40+
pip install -e /path/to/graphstack
41+
# or with Graphify in one step:
42+
pip install -e "/path/to/graphstack[graphify]"
3843
```
3944

4045
After installation, register the Cursor slash command (one-time):
@@ -290,7 +295,28 @@ GraphStack's savings come from three mechanisms:
290295
| Large (200+ files) | ~600k | ~90k | **~85%** |
291296
| Very large (500+ files) | ~1.5M | ~180k | **~88%** |
292297

293-
*Estimates based on Graphify benchmarks and TOKEN_OPTIMIZER rules. Real savings depend on query patterns.*
298+
*Estimates based on Graphify benchmarks and TOKEN_OPTIMIZER rules. Real savings depend on query patterns. See [docs/case-studies/graphstack-self.md](docs/case-studies/graphstack-self.md) for an honest self-analysis — measured community benchmarks are welcome via PR.*
299+
300+
---
301+
302+
## Limitations (read before adopting)
303+
304+
GraphStack is a **workflow protocol** (markdown + handoff files), not a runtime that enforces AI behavior.
305+
306+
| Topic | Reality |
307+
|-------|---------|
308+
| Role automation | The Orchestrator state machine lives in `ORCHESTRATOR.md`. Models can skip Activation or transitions unless you use discipline + `graphstack validate`. |
309+
| Token savings | The table above is **estimated**, not guaranteed. Small repos or undisciplined sessions may use **more** tokens than unstructured chat. |
310+
| Knowledge graph | Value appears on **20+ file** codebases with module boundaries. Meta-repos full of markdown produce noisy graphs — use `.graphifyignore` (included in this repo). |
311+
| Setup | Graphify + GraphStack install + `/graphify` + Cursor — four steps, not zero-config. |
312+
313+
**v4.1 helpers:** `graphstack doctor` (health report) and `graphstack validate` (exit code for CI). Use `--strict` before Builder handoff; use `--fail-stale-graph` in CI after code changes.
314+
315+
```bash
316+
graphstack doctor
317+
graphstack validate
318+
graphstack validate --strict --fail-stale-graph
319+
```
294320

295321
---
296322

@@ -334,7 +360,10 @@ your-project/
334360
│ ├── hook.py ← post-commit graph-update logic
335361
│ ├── platform_utils.py ← OS detection, Python finder, encoding-safe echo
336362
│ ├── cli.py ← entry point dispatcher
363+
│ ├── validate.py ← layout / brief / graph checks
337364
│ └── tests/ ← pytest suite
365+
├── pyproject.toml ← pip install -e . (v4.1+)
366+
├── .graphifyignore ← code-focused graph for this repo
338367
```
339368

340369
---
@@ -373,6 +402,8 @@ python -m graphstack board new add-oauth Add OAuth login with GitHub
373402
python -m graphstack board claim add-oauth builder
374403
python -m graphstack board complete add-oauth
375404
python -m graphstack board log
405+
python -m graphstack doctor
406+
python -m graphstack validate --fail-stale-graph
376407
```
377408

378409
Every board operation is a git commit. `git log handoff/board/` shows who did what, when.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Case Study: GraphStack Source Repository (Self-Analysis)
2+
3+
**Date:** 2026-05-17
4+
**Version:** GraphStack v4.1.0
5+
**Corpus:** GraphStack repo (workflow markdown + Python core + demo TypeScript)
6+
7+
---
8+
9+
## Context
10+
11+
GraphStack's own repository is mostly **instruction markdown** (~34 tracked source files in the first graph run). That makes it a poor benchmark for token savings on a typical app — but a good honesty check for graph quality.
12+
13+
---
14+
15+
## Graph quality (before `.graphifyignore`)
16+
17+
From `graphify-out/GRAPH_REPORT.md` (full-repo scan):
18+
19+
| Metric | Value | Interpretation |
20+
|--------|-------|----------------|
21+
| Nodes | 420 | Many are README / prompt code blocks |
22+
| Isolated nodes | 186 (~44%) | Doc fragments, not modules |
23+
| Community cohesion | 0.07–0.12 | Clusters are narrative, not architecture |
24+
| God nodes | `GraphStack 🧠⚡`, `echo()`, `ORCHESTRATOR` | Meta concepts, not code hubs |
25+
26+
**Takeaway:** Running `/graphify .` on the GraphStack repo without ignores produces a **documentation graph**, not a code topology map. Use `.graphifyignore` (shipped in v4.1) or scan only `scripts/graphstack/**/*.py` and `demo/src/**` for actionable structure.
27+
28+
---
29+
30+
## Token savings — what we can claim today
31+
32+
The README percentage table (30%–88%) is an **estimate** based on Graphify benchmarks and TOKEN_OPTIMIZER rules. This repo does not yet ship automated session token logging.
33+
34+
| Scenario | Expected effect | Confidence |
35+
|----------|-----------------|------------|
36+
| Architecture question on 50+ file API | High savings if agent reads GRAPH_REPORT first | Medium (depends on model compliance) |
37+
| Single-file bugfix | Low or negative (handoff overhead) | High |
38+
| Undisciplined session (skips graph, re-reads files) | Negative vs baseline | High |
39+
| GraphStack meta-repo (mostly .md) | Low graph value | High |
40+
41+
**Planned:** Community case studies with real `tokens/day` logs from Cursor or Claude Code exports.
42+
43+
---
44+
45+
## v4.1 validation workflow (measurable)
46+
47+
These checks do not require an LLM:
48+
49+
```bash
50+
pip install -e .
51+
graphstack doctor # human-readable health report
52+
graphstack validate # exit 1 on layout errors
53+
graphstack validate --fail-stale-graph # CI: graph must match HEAD
54+
```
55+
56+
On a fresh clone with template `handoff/BRIEF.md`, `validate` reports **warnings** (template brief). With `--strict`, template brief is an **error** — useful before Builder handoff.
57+
58+
---
59+
60+
## Recommendations for adopters
61+
62+
1. **Commit** `graphify-out/GRAPH_REPORT.md` and `graph.json`; **ignore** `graphify-out/cache/`.
63+
2. Run `graphstack validate --fail-stale-graph` in CI after code changes.
64+
3. Use GraphStack on codebases with **20+ files** and clear module boundaries (see README suitability table).
65+
4. Do not expect the orchestrator state machine to enforce itself — use `validate` + role discipline.
66+
67+
---
68+
69+
*This case study is part of GraphStack v4.1.0 transparency work. Replace estimates with measured data as contributors submit real projects.*

0 commit comments

Comments
 (0)