Skip to content

Commit 651c822

Browse files
authored
feat: SigMap v2.0.0 — v2 pipeline, new extractors, docs alignment (#2)
* feat: add FastAPI router, Zustand store, and API object extraction - python.js: detect @router.METHOD decorators → produce GET/POST/... → fn() sigs - typescript.js: detect create<State>() stores with field listing - typescript.js: detect xxxApi = { method: async => } objects - Both: raise sigs slice limit (python 25→30, ts 25→35) - gen-context.js: sync bundle with same changes * feat: SigMap v2.0.0 — v2 pipeline, new extractors, docs alignment Major release featuring: Pipeline: - New v2 context sections: TODOs, Recent changes, Coverage gaps, PR diff - Dependency extractors for Python (import/from) and TypeScript (import/require) Extractor fixes: - Python: BaseModel field bleed across classes - TypeScript: union type truncation (slice 35) - TypeScript: function-style hook shape detection Docs & release prep: - All version surfaces bumped to 2.0.0 - README: v2 What's New section, updated project structure, 262 test badge - CHANGELOG: consolidated beta entries into single 2.0.0 entry - All 6 HTML docs pages updated (footers, meta, badges) - Roadmap: added v2.0 timeline entry - Branding: ContextForge → SigMap across .npmignore, config example, CI guide - Removed 8 stale files (TIMELINE.md, standalone bundle, scripts, examples) Tests: 21/21 extractors + 17/17 integration suites (262 total) * fix: address all 9 Copilot review comments - Fix bundled BaseModel field bleed (add foundFirst boundary logic) - Fix bundled TS interface property slice(0,20) → slice(0,35) - Fix command injection in --diff: validate baseRef, use execFileSync - Add buildReverseDepMap to bundled deps.js exports - Tighten coverage heuristic: min token length, exact match only - Remove unused enrichSignatures/schemaFields from defaults + config example - Fix README: v2 features are default-on, not opt-in - Fix roadmap.html og:description: 17 versions, 262 tests - Regenerate copilot-instructions.md with v2.0.0 header
1 parent 8904c97 commit 651c822

69 files changed

Lines changed: 1944 additions & 2491 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 147 additions & 71 deletions
Large diffs are not rendered by default.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CLAUDE.md
2-
TIMELINE.md
32
PROJECT_MAP.md
43
gen-context.standalone.js
54
package.json.bak
5+
node_modules/
6+
.context/

.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ContextForge — files excluded from npm publish
1+
# SigMap — files excluded from npm publish
22
# Only gen-context.js, gen-project-map.js, src/, README.md, LICENSE, CHANGELOG.md,
33
# .contextignore.example, and gen-context.config.json.example are published.
44

CHANGELOG.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,39 @@ Format: [Semantic Versioning](https://semver.org/)
66

77
---
88

9+
## [2.0.0] — 2026-04-04
10+
11+
### Added
12+
- **v2 output enrichment pipeline** — compact `deps`, `todos`, `changes` sections auto-generated in context output.
13+
- **Structural diff mode**`--diff <base-ref>` writes a signature-level diff section comparing current signatures against a base branch.
14+
- **Test coverage markers** — opt-in per-function ``/`` hints by scanning test directories (`testCoverage: true`).
15+
- **Impact radius hints** — opt-in reverse dependency annotations (`impactRadius: true`).
16+
- **New helper extractors**:
17+
- `src/extractors/deps.js` — Python and TS/JS dependency extraction + reverse dep map.
18+
- `src/extractors/todos.js` — TODO/FIXME/HACK/XXX harvesting (max 20 entries).
19+
- `src/extractors/coverage.js` — lightweight function/test correlation.
20+
- `src/extractors/prdiff.js` — signature-level base-ref diffs.
21+
- **New config keys**: `enrichSignatures`, `depMap`, `schemaFields`, `todos`, `changes`, `changesCommits`, `testCoverage`, `testDirs`, `impactRadius`.
22+
- `test/integration/v2plus.test.js` — 3 integration tests for todos, coverage markers, and structural diff.
23+
- `test/integration/all.js` — unified integration runner and `test:integration:all` npm script.
24+
25+
### Changed
26+
- **Enriched multi-language extractors** — return-type hints (`→ Type`) and richer signatures across C++, C#, Dart, Go, Java, JavaScript, Kotlin, PHP, Python, Ruby, Rust, Scala, Svelte, Swift, TypeScript, and Vue.
27+
- **Python extractor** — dataclass/BaseModel field collapse, top-level docstring hints, fixed field bleed across class boundaries.
28+
- **TypeScript extractor** — interface property types, class method return hints, compact hook return shapes for `export function useX()`, union type truncation extended to 35 chars.
29+
- Removed stale development files: `TIMELINE.md`, `scripts/bundle.js`, `scripts/make-icon.py`, `scripts/inject-search.py`, `scripts/backfill-npm.sh`, `examples/slack-context-bot.js`, `examples/copilot-prompts.code-snippets`.
30+
31+
### Fixed
32+
- Python `tryExtractBaseModelFields` no longer bleeds fields into subsequent classes.
33+
- TypeScript interface member type previews preserve longer union strings (20 → 35 chars).
34+
- TypeScript function-style hooks (`export function useX`) now include compact return object shapes.
35+
36+
### Validation gate
37+
- 21/21 extractor tests passed
38+
- 17/17 integration suites passed (262 individual tests)
39+
- `node gen-context.js --report`~93.5% reduction
40+
41+
942
## [1.5.0] — 2026-04-04
1043

1144
### Added
@@ -32,7 +65,6 @@ Format: [Semantic Versioning](https://semver.org/)
3265

3366
### Notes
3467
- The VS Code extension requires the `vscode` peer dependency at runtime (provided by the editor). It has no npm runtime dependencies of its own.
35-
- `scripts/inject-search.py` is the one-time migration script used to add search to existing HTML pages; it is idempotent (skip if already patched).
3668

3769
### Validation gate
3870
- `node gen-context.js --version``1.5.0`*(note: version bumped separately if desired)*

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
2. Create `test/fixtures/{language}.{ext}` with representative code
77
3. Run `node test/run.js --update {language}` to generate expected output
88
4. Review the expected output — it should contain only signatures, no bodies
9-
5. Run `node test/run.js` — must be 177/177 PASS (21 extractor + 156 integration) before opening a PR
9+
5. Run `node test/run.js` — must be 21/21 PASS before opening a PR
10+
6. Run `node test/integration/all.js` — 17/17 integration suites must pass
1011

1112
## Extractor contract
1213

README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<!-- Status -->
1313
[![npm version](https://img.shields.io/npm/v/sigmap?color=7c6af7&label=latest&logo=npm)](https://www.npmjs.com/package/sigmap)
14-
[![Tests](https://img.shields.io/badge/tests-274%20passing-22c55e)](https://github.com/manojmallick/sigmap/tree/main/test)
14+
[![Tests](https://img.shields.io/badge/tests-262%20passing-22c55e)](https://github.com/manojmallick/sigmap/tree/main/test)
1515
[![Zero deps](https://img.shields.io/badge/dependencies-zero-22c55e)](package.json)
1616
[![Last commit](https://img.shields.io/github/last-commit/manojmallick/sigmap?color=7c6af7)](https://github.com/manojmallick/sigmap/commits/main)
1717

@@ -82,6 +82,23 @@ AI agent session starts with full context
8282
8383
---
8484

85+
## 🆕 What's new in 2.0
86+
87+
| Feature | Description |
88+
|---|---|
89+
| **Enriched signatures** | Return types, type hints, and schema field collapse (Python `@dataclass` / `BaseModel`) |
90+
| **Dependency map** | Compact import dependency section at the top of output (~50–100 extra tokens) |
91+
| **TODO/FIXME section** | Auto-harvested TODO/FIXME/HACK/XXX comments (max 20 entries) |
92+
| **Recent changes section** | Git-based recent changes summary in output |
93+
| **Test coverage markers** | Per-function ``/`` hints by scanning test directories |
94+
| **Structural diff mode** | `--diff <base-ref>` writes a signature-level diff section |
95+
| **Impact radius hints** | Reverse dependency annotations (used by: ...) |
96+
| **New helper extractors** | `deps.js`, `todos.js`, `coverage.js`, `prdiff.js` |
97+
98+
Several v2 enhancements (deps map, TODOs, recent changes) are enabled by default. All v2 sections can be tuned or disabled via `gen-context.config.json`.
99+
100+
---
101+
85102
## 🚀 Quick start
86103

87104
**No install required — just Node.js 18+.**
@@ -147,7 +164,7 @@ The `vscode-extension/` directory contains a first-party VS Code extension that
147164
| **Stale notification** | Warns when `copilot-instructions.md` is > 24 h old; one-click regeneration |
148165
| **Regenerate command** | `SigMap: Regenerate Context` — runs `node gen-context.js` in the integrated terminal |
149166
| **Open context command** | `SigMap: Open Context File` — opens `.github/copilot-instructions.md` |
150-
| **Script path setting** | `contextforge.scriptPath` — override when `gen-context.js` is not at the project root |
167+
| **Script path setting** | `sigmap.scriptPath` — override when `gen-context.js` is not at the project root |
151168

152169
Activate on startup (`onStartupFinished`) — loads within 3 s, never blocks editor startup.
153170

@@ -380,7 +397,7 @@ node gen-context.js --track
380397

381398
# Structured JSON report for CI (exits 1 if over budget)
382399
node gen-context.js --report --json
383-
# { "version": "1.5.0", "finalTokens": 3200, "reductionPct": 92.4, "overBudget": false }
400+
# { "version": "2.0.0", "finalTokens": 3200, "reductionPct": 92.4, "overBudget": false }
384401

385402
# Composite health score
386403
node gen-context.js --health
@@ -426,8 +443,8 @@ node test/run.js typescript
426443
# Regenerate expected outputs after extractor changes
427444
node test/run.js --update
428445

429-
# Full integration suite (253 tests across 16 test files)
430-
for f in test/integration/*.test.js; do node "$f"; done
446+
# Full integration suite
447+
node test/integration/all.js
431448
```
432449

433450
### Validation gates
@@ -478,7 +495,7 @@ sigmap/
478495
│ ├── fixtures/ ← one source file per language
479496
│ ├── expected/ ← expected extractor output
480497
│ ├── run.js ← zero-dep test runner
481-
│ └── integration/ ← 16 integration test files (253 tests)
498+
│ └── integration/ ← 17 integration test files (241 tests)
482499
483500
├── docs/ ← documentation site (GitHub Pages)
484501
│ ├── index.html ← homepage
@@ -490,11 +507,12 @@ sigmap/
490507
491508
├── scripts/
492509
│ ├── ci-update.sh ← CI pipeline helper
493-
│ └── inject-search.py ← one-time: add search to docs HTML pages
510+
│ └── release.sh ← version bump + npm publish helper
494511
495512
├── examples/
496513
│ ├── self-healing-github-action.yml
497-
│ └── gen-context.config.json ← full annotated config
514+
│ ├── github-action.yml ← ready-to-use CI workflow
515+
│ └── claude-code-settings.json ← MCP server config example
498516
499517
├── .npmignore ← excludes docs/, test/, vscode-extension/ from publish
500518
├── .contextignore.example ← exclusion template

0 commit comments

Comments
 (0)