feat(spec-analyze): MCP knowledge-graph cache in front of discovery (FASE 1)#3
Draft
GorlemZ wants to merge 3 commits into
Draft
feat(spec-analyze): MCP knowledge-graph cache in front of discovery (FASE 1)#3GorlemZ wants to merge 3 commits into
GorlemZ wants to merge 3 commits into
Conversation
…FASE 1) - Context lookup phase: reuse indexed repo-map/+comments.md on a fresh (commit_sha==HEAD) hit and skip discovery; miss => original flow unchanged - Index write-back phase: ingest cartographer/crawler output (non-blocking) - repo_map_to_bundle.py: deterministic md/JSON -> ingest bundle transform - machine-readable sidecars (repo-map/index.json, comments.index.json) - useIndex/workspace args; workspace sanitized to [a-z0-9-] - docs in workflows/MCP-CACHE.md; FASE 2 (per-area staleness) deferred Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- repo_map_to_bundle.py: fix crash when writing the --out summary with 0 or 1 bundles (regression from omitting empty bundles); the indexer always uses --out, so an empty/partial discovery would have crashed - workspace: fall back to sanitized repo if a caller passes a workspace that sanitizes to empty (never send an empty workspace to the MCP) - context-broker prompt: make purpose->card.summary mapping explicit for fresh-hit index.md materialization Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- workflows/check_mcp.py (stdlib): single-source-of-truth root .env for MCP_URL/MCP_API_KEY (never hardcoded in the workflow). Missing .env -> create template + .gitignore and stop (like the Atlassian preflight); present -> idempotently (re)register the MCP server from .env and ping it (JSON-RPC initialize). Unreachable = warning (workflow degrades to no-cache via useIndex), never blocking. Prints resolved SPEC_OUTPUT_DIR. - default outputDir -> ./output[-goals]; launcher passes SPEC_OUTPUT_DIR (absolute) as args.outputDir so output always lands in this repo. - .gitignore + .env.example; README + MCP-CACHE.md preflight docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cosa
Aggancia il workflow
spec-analyze(workflows/spec-analyze.js) alla knowledge-graph MCP vibingwithclaude come cache davanti alla fase di discovery.Context lookupinterroga l'MCP; su fresh hit (bundlecommit_sha == HEAD) il broker materializzarepo-map/+comments.mddal grafo e la discovery viene saltata.useIndex=false: discovery come sempre, poiIndex write-backpopola il grafo (non-bloccante). Zero regressioni quando l'MCP non c'è.Modifiche
workflows/spec-analyze.js— fasiContext lookup+Index write-back, agentcontext-broker/indexer,argsuseIndex/workspace(sanitizzato a[a-z0-9-]), sidecar JSON machine-readable nei prompt cartographer/crawler.workflows/repo_map_to_bundle.py— transform deterministico md/JSON → ingest bundle (stdlib), con test offline.workflows/MCP-CACHE.md— documentazione feature + contratto nodi/workspace + backlog FASE 2.Vincoli / invarianti
ingest_bundle(schema_version: "1.0", validato) con fallbackupsert_node/add_link.replace_edgessolo su bundle con i nodi da rilinkare; bundle vuoti omessi → niente wipe di edge.wc/lssui target) prima di dichiarare fresh (il body JS non ha filesystem).Validazione
ingest_bundleaccettaschema_version:"1.0",body_md/extra/linksround-trip ✅.Non incluso (deferred)
index.md).run_cost.py(ROLE_PHASE/PHASE_ORDER) — separato.🤖 Generated with Claude Code