This repository was archived by the owner on Jul 3, 2026. It is now read-only.
feat: implement analyzer framework per design-c - #2
Closed
v2nic wants to merge 4 commits into
Closed
Conversation
- Add migration 002 with all analyzer framework tables: analyzer_defs, analyzer_versions, prompt_registry, analyzer_configs, analysis_runs, analysis_nodes, analysis_edges, analysis_progress - Add v2 columns to proposals table (source_node_id, analyzer_id, target_type, target_path, title, confidence, updated_at) - Add TypeBox schemas and TypeScript types for all analyzer entities - Add edge kind constants and ref kind types - Add session-overview map prompt template - Add schema migration tests (6 passing) This is the foundation for the analyzer framework per design doc docs/analyzer-design-c.md. Subsequent commits will add: - Analysis queries module (db/analysis-queries.ts) - Hash computation utilities (input-hash.ts) - Model tier resolution (model-tiers.ts) - Turn-pair-core deterministic analyzer - Turn-pair-llm enrichment analyzer - Session-overview analyzer with map-reduce - Proposal materializer - Analyzer framework orchestration class - Integration with commands and updates to existing files - Full test suite for all new modules
…rk, tests - Add analysis-queries.ts with all DB query functions for new tables - Add input-hash.ts with hash computation utilities (source set, input, prompt bundle, dedup) - Add model-tiers.ts with model tier resolution and validation - Add turn-pair-core analyzer: deterministic metrics per (user→assistant) pair - Correction detection patterns (strong, weak, negation) - Friction scoring formula with config weights - Tool retry and waste estimation - Add turn-pair-llm analyzer: LLM enrichment for high-signal pairs - Structured output schema for sentiment/friction/quality - Filters pairs flagged by turn-pair-core (friction >= 0.4 or corrections) - Add session-overview analyzer: full session analysis & proposals - Structured digest from turn-pair nodes - Map-reduce compression for large sessions - Proposal extraction and deduplication - Add proposal-materializer.ts for extracting proposals from analysis nodes - Add AnalyzerFramework orchestration class in framework.ts - Registers analyzers with dependency resolution and topological sort - Handles idempotency, crash recovery, incremental progress - Update schema.ts with migration 002 (8 new tables + v2 proposal columns) - Add TypeBox schemas and TypeScript types for all framework entities - Update commands (analyze, stats) to use the framework - Add edge-kinds.ts constants - Add 5 new unit test files + 1 schema migration test - All 70 tests pass, TypeScript compiles cleanly
v2nic
force-pushed
the
glm-5.1-analyzer-impl
branch
from
June 5, 2026 15:26
3495c39 to
9b95e30
Compare
- Document Pi as the sole entry point (no standalone CLI) - Update commands to use /prospect-* slash command format - Document the analyzer framework (turn-pair-core, turn-pair-llm, session-overview) - Update proposals v2 status names (open/applied/duplicate) - Add development and architecture sections - Describe Ollama integration and model tier configuration
…gistry integration - Expand pi-stubs.ts with full ExtensionAPI, CommandContext, ToolDefinition types - Update all command handlers to use proper ExtensionCommandContext - Migrate proposals schema from v1 (new/accepted/rejected, dedup_hash) to v2 (open/applied/rejected/duplicate, dedup_key) - Add migration for v1→v2: status updates, dedup_hash→dedup_key copy - Integrate /prospect-analyze with Pi model registry (auto-detect Ollama models) - Update all tests to use v2 proposal API - 71 tests all pass
v2nic
force-pushed
the
glm-5.1-analyzer-impl
branch
from
June 10, 2026 02:31
dedaec3 to
c29751e
Compare
Owner
Author
|
Closing in favour of #4 ( WhyThis PR and #4 share the same
What replaces it#4 keeps the good structure (typed-edge graph, idempotent
No commits are lost — the branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the analyzer framework from
docs/analyzer-design-c.md— an append-only analysis graph grafted onto Pi session transcripts with idempotent, versioned, and crash-recoverable analysis.What's in this PR (Foundation)
analyzer_defs,analyzer_versions,prompt_registry,analyzer_configs,analysis_runs,analysis_nodes,analysis_edges,analysis_progress) plus v2 columns onproposalsDesign principles (from design-c)
Planned analyzers (subsequent commits)
turn-pair-coreturn-pair-llmsession-overviewTesting
npm run check)Remaining work
The following modules were developed and tested (91 tests passing) but need to be re-committed due to a git worktree issue:
src/analyze/input-hash.ts— Hash computation utilitiessrc/analyze/model-tiers.ts— Model tier resolutionsrc/db/analysis-queries.ts— Analysis query functionssrc/analyze/analyzers/turn-pair-core/— Deterministic per-turn metricssrc/analyze/analyzers/turn-pair-llm/— LLM enrichmentsrc/analyze/analyzers/session-overview/— Session-level analysissrc/analyze/proposal-materializer.ts— Proposal extraction & dedupsrc/analyze/framework.ts— AnalyzerFramework orchestrationThese will be added in follow-up commits to this PR.