Commit Graph
36 Commits
Author SHA1 Message Date
Lum1104andClaude Opus 4.6 4d2cb32232 fix: address comprehensive code review findings for PR #51
Fix all issues from the 5-agent parallel code review of universal file
type support:

- Parser error handling: add console.warn in JSON/YAML catch blocks,
  warn on unbalanced braces in Protobuf/Terraform parsers
- Parser correctness: filter .PHONY special targets in Makefile parser,
  handle opening brace on next line in Shell parser, fix per-stage
  EXPOSE port assignment in Dockerfile parser
- Graph builder: use nodeType-based ID prefix instead of hardcoded
  "file:", warn on unknown definition kinds, detect duplicate node IDs
- Type safety: export NodeType alias, add ServiceInfo.lineRange, type
  dashboard color maps as Record<NodeType,...>, refactor
  getDirectionalLabel to Record<EdgeType,...>, consolidate NodeCategory
- Schema: add StrictLanguageConfigSchema with extensions/filenames
  refinement, fix Infrastructure/Schema-Data category comments
- Agent prompts: fix Jenkinsfile language ID (groovy → jenkinsfile),
  fix css.md edge type (configures → related), remove shell.md
  Makefile cross-reference
- Tests: 20+ new edge case tests across parsers, graph builder,
  language registry, and plugin registry
- Documentation: add JSDoc to all 12 parser classes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 21:55:20 +08:00
Lum1104andClaude Opus 4.6 71468e8082 fix: address code review findings for universal file type support
- Expand persona filter in GraphView.tsx to show all 9 file-level node
  types (file, config, document, service, table, endpoint, pipeline,
  schema, resource) instead of only "file", fixing invisible nodes
- Add serves, provisions, and routes edge types with creation criteria
  to file-analyzer-prompt.md
- Fix related edge weight from 0.3 to 0.5 to match SKILL.md default
- Add filenames to openapiConfig for proper filename-based detection
- Add TODO comments to kubernetesConfig and jsonSchemaConfig explaining
  content-based detection limitations
- Clarify that module/concept types are reserved for higher-level agents
- Update language-registry tests for 38 built-in configs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 19:14:00 +08:00
Lum1104andClaude Opus 4.6 db572231f8 feat(core): export new types and parsers from core
Export all 12 non-code parsers (MarkdownParser, YAMLConfigParser,
JSONConfigParser, TOMLParser, EnvParser, DockerfileParser, SQLParser,
GraphQLParser, ProtobufParser, TerraformParser, MakefileParser,
ShellParser) and the registerAllParsers() helper from core index.

New type exports (SectionInfo, DefinitionInfo, ServiceInfo, etc.)
are already covered by the existing `export * from "./types.js"`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:40:55 +08:00
Lum1104andClaude Opus 4.6 2bb107e2d9 feat(core): add non-code file support to GraphBuilder
Add addNonCodeFile() and addNonCodeFileWithAnalysis() methods that create
graph nodes with the appropriate non-code types (document, config, service,
table, endpoint, pipeline, schema, resource).

addNonCodeFileWithAnalysis() creates child nodes for definitions, services,
endpoints, steps, and resources with "contains" edges to the parent file.

Add mapKindToNodeType() helper for mapping definition kinds to node types.
Extend EXTENSION_LANGUAGE map with all non-code file extensions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:40:04 +08:00
Lum1104andClaude Opus 4.6 3fd688ac37 feat(core): add 12 custom parsers for non-code file types
Add regex/parser-based analyzers for: Markdown, YAML, JSON, TOML, Env,
Dockerfile, SQL, GraphQL, Protobuf, Terraform, Makefile, Shell.

Each implements AnalyzerPlugin with analyzeFile() and optional
extractReferences(). Uses `yaml` npm package for YAML parsing,
built-in JSON.parse for JSON, regex for all others.

Add registerAllParsers() helper to register all parsers at once.
Add comprehensive test suite with 35 tests covering all parsers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:38:25 +08:00
Lum1104andClaude Opus 4.6 c76b0a1f2d feat(core): add 26 non-code language configs with filename-based detection
Add LanguageConfig files for: markdown, yaml, json, toml, env, xml,
dockerfile, sql, graphql, protobuf, terraform, github-actions, makefile,
shell, html, css, openapi, kubernetes, docker-compose, json-schema, csv,
restructuredtext, powershell, batch, jenkinsfile, plaintext.

Add filenames? field to LanguageConfigSchema for filename-based detection
(Dockerfile, Makefile, Jenkinsfile, docker-compose.yml, .env variants).

Update LanguageRegistry.getForFile() to check filename matches first
(more specific) before falling back to extension-based lookup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:34:16 +08:00
Lum1104andClaude Opus 4.6 9eb220c492 feat(core): make resolveImports optional on AnalyzerPlugin
Update PluginRegistry.resolveImports() to check for plugin.resolveImports
existence before calling it. Non-code plugins (e.g., markdown, dockerfile)
don't need import resolution, so this method is now optional.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:31:00 +08:00
Lum1104andClaude Opus 4.6 1f554146c0 feat(core): extend Zod schemas and aliases for 8 new node/edge types
Update EdgeTypeSchema with 8 new edge types (deploys, serves, migrates,
documents, provisions, routes, defines_schema, triggers).

Update GraphNodeSchema with 8 new node types (config, document, service,
table, endpoint, pipeline, schema, resource).

Add NODE_TYPE_ALIASES for non-code types (container->service, doc->document,
workflow->pipeline, etc.) and EDGE_TYPE_ALIASES (describes->documents,
creates->provisions, exposes->serves, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:30:17 +08:00
Lum1104andClaude Opus 4.6 b1f763adac feat(core): extend GraphNode/EdgeType/StructuralAnalysis for non-code file types
Add 8 new node types (config, document, service, table, endpoint,
pipeline, schema, resource) and 8 new edge types (deploys, serves,
migrates, documents, provisions, routes, defines_schema, triggers).

Add StructuralAnalysis sub-interfaces: SectionInfo, DefinitionInfo,
ServiceInfo, EndpointInfo, StepInfo, ResourceInfo, ReferenceResolution.

Make resolveImports optional on AnalyzerPlugin and add extractReferences.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 18:29:01 +08:00
Yuxiang LinandGitHub 07c49fd4b0 Merge pull request #44 from fishinakleinbottle/feat/improve-dashboard-ux
Dashboard Improvement: lens-based hierarchical graph navigation
2026-03-28 16:45:24 +08:00
Lum1104 3cdc2ac71b Merge branch 'main' into pr44/improve-dashboard-ux
# Conflicts:
#	understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx
#	understand-anything-plugin/packages/dashboard/src/components/LayerLegend.tsx
#	understand-anything-plugin/packages/dashboard/src/components/NodeInfo.tsx
2026-03-28 16:20:58 +08:00
Yuxiang LinandGitHub 710f312498 Merge pull request #41 from berkcangumusisik/test/improve-coverage
Expand core tests and add vitest coverage dep
2026-03-28 15:56:19 +08:00
Lum1104 34dcf1f16b Make persistence test compatible with current main 2026-03-28 15:55:15 +08:00
Lum1104 334ac871df Align persistence test with fatal validation behavior 2026-03-28 15:53:31 +08:00
Lum1104 e7ad9d6d69 Fix ImportResolution test fixture 2026-03-28 15:46:33 +08:00
Lum1104andClaude Opus 4.6 3fad7207fb merge: resolve conflict with main and fix token auth in dashboard
- Resolve import conflict in persistence/index.ts (keep both PR's path
  utilities and main's ProjectConfig/FingerprintStore imports)
- Fix critical bug: App.tsx fetches were missing the ?token= param,
  causing 403 on all data endpoints. Extract token from URL and forward
  it via tokenUrl() helper.
- Protect /meta.json endpoint with same token auth
- Revert unnecessary saveMeta whitespace reformatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 13:17:59 +08:00
Lum1104andClaude Opus 4.6 39ee76f492 fix: address remaining Copilot review findings
- SKILL.md Phase 7: use core buildFingerprintStore instead of ad-hoc regex script
- change-classifier: accurate FULL_UPDATE reason message (count vs percentage)
- persistence: add saveConfig/loadConfig tests (round-trip, missing, corrupted)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:13:22 +08:00
Lum1104andClaude Opus 4.6 5df763fd75 fix: address review findings — sort mutation, injection, directory baseline, error handling
- C1: use [...array].sort() to avoid mutating fingerprint inputs
- C2: replace echo piping with here-string to prevent shell injection in hooks
- M1/M2: add allKnownFiles param to classifyUpdate for correct directory baseline
- M3: add try-catch to loadFingerprints for corrupted JSON resilience
- M5: add hasStructuralAnalysis flag for conservative no-tree-sitter classification
- m3: replace fragile sed with node JSON.parse in SessionStart hook
- Add 7 new tests covering all fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:11:03 +08:00
Lum1104andClaude Opus 4.6 8c525839b2 merge: resolve SKILL.md conflict — keep both --auto-update and --review flags
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:01:57 +08:00
Lum1104andClaude Opus 4.6 35732c67a1 feat(core): add optional theme field to AnalysisMeta
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 09:50:38 +08:00
Sreeram 275b9020e3 Merge branch 'main' of https://github.com/Lum1104/Understand-Anything into feat/improve-dashboard-ux 2026-03-27 02:40:21 +05:30
Lum1104 d79e3c862c fix(core): restore validation errors compatibility and reject malformed collections 2026-03-26 22:09:38 +08:00
Lum1104andClaude Opus 4.6 28e3bd1631 feat(core): permissive graph validation with tiered auto-fix pipeline
- Add sanitizeGraph (Tier 1): null cleanup, lowercase enums
- Add autoFixGraph (Tier 2): default missing fields, alias maps, weight coercion
- Rewrite validateGraph: per-item validation, drop broken items, referential integrity
- Add GraphIssue type for structured issue tracking
- Update persistence layer for new ValidationResult API
- 52 schema tests covering all tiers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 16:39:10 +08:00
Berkcan Gümüşışık 2f9b00c99c Expand core tests and add vitest coverage dep
Add several unit tests to improve robustness and coverage across the core package: plugin-discovery (handle missing/invalid plugins field and add serializePluginConfig tests), plugin-registry (unregister behavior, language detection, and import resolution delegation), persistence (invalid graph validation and option to skip validation), and tree-sitter-plugin (export aliases and arrow functions without params). Also add @vitest/coverage-v8 as a devDependency to enable V8-based coverage reporting.
2026-03-25 20:46:28 +03:00
Lum1104andClaude Opus 4.6 4b22ed7336 test: add alias chain detection guards
Ensures no alias value is itself an alias key, which would cause
single-pass normalization to produce a non-canonical value that
Zod then rejects. Catches this class of bug at test time.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 09:36:18 +08:00
Lum1104andClaude Opus 4.6 fd0df15d1c fix: remove unsafe tests→tested_by alias that inverts edge direction
The "tests" alias silently rewrites to "tested_by" without swapping
source/target, which inverts the relationship meaning and produces
incorrect edges. Direction-inverting aliases should fail validation
so the LLM gets explicit feedback to fix the edge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 09:33:47 +08:00
Lum1104andClaude Opus 4.6 1a16b0fdd6 fix: normalize LLM-generated type aliases before schema validation
LLMs systematically abbreviate node types (e.g. "func" instead of
"function") and edge types (e.g. "extends" instead of "inherits"),
causing dashboard validation failures. This combines two fixes:

Option A: Rename the ambiguous `func:` ID prefix to `function:` across
all prompts, source code, tests, and example data so LLMs see consistent
naming. Also fix `relates_to` ghost edge type in django.md.

Option B: Add NODE_TYPE_ALIASES and EDGE_TYPE_ALIASES normalization maps
in schema.ts that transparently correct common abbreviations before Zod
validation, as a runtime safety net.

Closes #36

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 09:25:42 +08:00
Sreeram 8fade58812 Merge branch 'main' of github.com:fishinakleinbottle/Understand-Anything into feat/improve-dashboard-ux
# Conflicts:
#	understand-anything-plugin/packages/dashboard/src/App.tsx
#	understand-anything-plugin/packages/dashboard/src/components/GraphView.tsx
#	understand-anything-plugin/packages/dashboard/src/utils/layout.ts
2026-03-25 01:04:41 +05:30
Sreeram 564f7e87c0 feat: lens-based graph navigation with flow view and sidebar history
Replace flat all-nodes-at-once graph with a two-level drill-down:
- Level 1: layer cluster nodes (free-form graph of architectural layers)
- Level 2: file nodes within a layer + portal nodes to adjacent layers
- Breadcrumb navigation with Escape key to go back

Add swim-lane "Flow" view showing all files in columns ordered by
request lifecycle (API → Middleware → Service → Data → etc.) using
dagre for within-lane vertical positioning.

Sidebar improvements:
- Navigation history trail (← Back + clickable breadcrumbs)
- Directional connection labels (imports/imported by, contains/contained in)
- Separate "Defined in this file" section for child classes/functions
- Fix search dropdown overlapping breadcrumbs (z-index)
- Remove redundant CodeViewer auto-open on node click

Layer detector: add External Services and Background Tasks patterns.
2026-03-24 21:19:08 +05:30
Sai Smruti Ranjan DasandGitHub f9e5f551b5 Update index.ts 2026-03-24 00:55:53 +05:30
Sreeram ae898a28b2 fix: address PR review feedback (C1-C4, I1-I5)
Critical fixes:
- C1: Remove unused treeSitter.nodeTypes from configs and schema — extraction
  logic is TS/JS-specific, nodeTypes gave false impression of generality
- C2+C3: Remove blocking temp dir prompt, default to .understand-anything/tmp/,
  update all 5 prompt templates to use project-local paths instead of /tmp/
- C4: Fix false-positive framework detection — use "next": (with quotes) for
  Next.js, remove cors/body-parser from Express keywords

Important fixes:
- I1: Change FrameworkConfig.language to languages[] array — React/Express/Vue
  now correctly listed under both typescript and javascript
- I2: Fix getByExtension case sensitivity — .TS now resolves same as .ts
- I3: languageKeyFromPath returns null instead of throwing for unknown extensions
- I4: Duplicate framework registration is now a no-op instead of corrupting array
- I5: SKILL.md now says "skip silently" when language/framework snippet not found

Also: getForLanguage returns a defensive copy, 3 new tests added (157 total).
2026-03-23 21:53:02 +05:30
Aditya fbe3cf4ee0 feat: add hooks for auto-update prompts and change classification logic
- Introduced hooks in `hooks.json` for PostToolUse and SessionStart events to prompt users about knowledge graph updates based on commit and session changes.
- Implemented `change-classifier.ts` to classify updates based on structural changes, including SKIP, PARTIAL_UPDATE, ARCHITECTURE_UPDATE, and FULL_UPDATE actions.
- Added comprehensive tests for change classification in `change-classifier.test.ts` to ensure correct behavior across various scenarios.
- Created `fingerprint.ts` to manage file fingerprints, including content hashing, structural analysis, and comparison of fingerprints to detect changes.
- Developed tests for fingerprint extraction and comparison in `fingerprint.test.ts` to validate functionality and ensure accurate change detection.
2026-03-23 15:20:10 +05:30
Sreeram b5eb2e6041 feat: language-agnostic analysis with config-driven registry and framework detection
Replace the TypeScript/JavaScript-biased analysis pipeline with a truly
language-agnostic system. The core architecture was already language-neutral
(graph schema, dashboard, search) — the bias lived in agent prompts,
tree-sitter plugin, and language-lesson system.

Core changes:
- LanguageConfig + FrameworkConfig types with Zod validation
- LanguageRegistry (12 languages) and FrameworkRegistry (10 frameworks)
- Config-driven TreeSitterPlugin replacing hardcoded TS/JS grammars
- PluginRegistry now delegates to LanguageRegistry for extension mapping
- Language-lesson system uses config for display names and concepts

Prompt system:
- SKILL.md generalized: dynamic injection of language snippets and
  framework addendums instead of hardcoded if/else conditionals
- 12 language prompt snippets (languages/*.md) with concepts, patterns,
  frameworks per language
- 10 framework addendums (frameworks/*.md) with canonical file roles,
  edge patterns, architectural layers — Django/FastAPI/Flask preserved
  and split, plus React/Next.js/Express/Vue/Spring/Rails/Gin added
- Extended entry points, directory patterns, and test patterns across
  all 12 language ecosystems in base prompts
2026-03-23 12:35:09 +05:30
Lum1104 bdf6cf6856 fix: resolve plugin installation failures for workspace resolution and missing dependencies
- Add pnpm-workspace.yaml to plugin distribution so workspace:* deps resolve on install
- Add devlop and hast-util-to-jsx-runtime as explicit dashboard dependencies (pnpm strict hoisting)
- Make tsconfig.json files self-contained to work outside monorepo root
- Add prepare script to auto-build core package after pnpm install
- Bump version to 1.0.2
2026-03-15 19:12:55 +08:00
Lum1104andClaude Opus 4.6 343e94c9a7 feat: redesign dashboard with dark luxury theme, improve agent pipeline
- Remove ChatPanel and @anthropic-ai/sdk dependency (redundant with /understand-chat)
- Replace Monaco editor with styled summary code viewer
- New graph-first layout: 75% graph + 360px right sidebar
- Dark luxury aesthetic: deep blacks, gold/amber accents, DM Serif Display typography
- Add ProjectOverview component for sidebar default state
- Learn persona now shows tour panel directly in sidebar
- Add schema validation on graph load with error banner
- Defensive null checks in store for tour methods
- Agent pipeline: write intermediate results to disk instead of context
- Agent models: sonnet for simple tasks, opus for complex (no haiku)
- Prompt-engineer all 5 agent prompts and SKILL.md
- Auto-trigger /understand-dashboard after /understand completes
- Add dashboard screenshot to README
- Bump version to 1.0.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 12:36:39 +08:00
Lum1104andClaude Opus 4.6 b75235919e refactor: restructure monorepo into Claude Code plugin layout
Move packages/{core,dashboard,skill} into understand-anything-plugin/ to
conform to the Claude Code plugin format. Add .claude-plugin/marketplace.json
for plugin discovery. Update workspace config and docs accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 11:16:43 +08:00