mcp-efficiency-engine 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODEOWNERS +40 -0
- package/.github/GITHUB_MCP_INTEGRATION.md +366 -0
- package/.github/ISSUE_TEMPLATE/bug.md +51 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +45 -0
- package/.github/ISSUE_TEMPLATE/question.md +18 -0
- package/.github/agents/backend.agent.md +18 -0
- package/.github/agents/community-manager.agent.md +18 -0
- package/.github/agents/dba.agent.md +18 -0
- package/.github/agents/frontend-agent.agent.md +18 -0
- package/.github/agents/github-repository-manager.agent.md +338 -0
- package/.github/agents/iot.agent.md +20 -0
- package/.github/agents/legacy.agent.md +18 -0
- package/.github/agents/rag-azure.agent.md +18 -0
- package/.github/agents/rag-local.agent.md +18 -0
- package/.github/agents/snapshot.agent.md +18 -0
- package/.github/agents/ux-ui.agent.md +18 -0
- package/.github/agents/wiki-agent.agent.md +23 -0
- package/.github/copilot-instructions.md +44 -0
- package/.github/instructions/always-on-optimization.instructions.md +54 -0
- package/.github/prompts/auto-route.prompt.md +33 -0
- package/.github/prompts/azure-rag.query.prompt.md +19 -0
- package/.github/prompts/backend.fix-bug.prompt.md +13 -0
- package/.github/prompts/cavecrew.prompt.md +16 -0
- package/.github/prompts/caveman-commit.prompt.md +14 -0
- package/.github/prompts/caveman-compress.prompt.md +15 -0
- package/.github/prompts/caveman-debug.prompt.md +13 -0
- package/.github/prompts/caveman-help.prompt.md +11 -0
- package/.github/prompts/caveman-review.prompt.md +15 -0
- package/.github/prompts/caveman-stats.prompt.md +11 -0
- package/.github/prompts/caveman.prompt.md +11 -0
- package/.github/prompts/community.post.prompt.md +14 -0
- package/.github/prompts/dba.query-review.prompt.md +15 -0
- package/.github/prompts/dev.fix-bug.prompt.md +13 -0
- package/.github/prompts/frontend.code.prompt.md +13 -0
- package/.github/prompts/legacy.impact-analysis.prompt.md +14 -0
- package/.github/prompts/project.kickoff-analysis.prompt.md +51 -0
- package/.github/prompts/rag.knowledge-answer.prompt.md +13 -0
- package/.github/prompts/token-saver-review.prompt.md +14 -0
- package/.github/prompts/ux-ui.review.prompt.md +14 -0
- package/.github/pull_request_template.md +71 -0
- package/.github/skills/ahorro-tokens/SKILL.md +36 -0
- package/.github/skills/azure-rag-enterprise/SKILL.md +24 -0
- package/.github/skills/backend-coding/SKILL.md +24 -0
- package/.github/skills/cavecrew/SKILL.md +17 -0
- package/.github/skills/caveman/SKILL.md +25 -0
- package/.github/skills/caveman-commit/SKILL.md +15 -0
- package/.github/skills/caveman-compress/SKILL.md +14 -0
- package/.github/skills/caveman-help/SKILL.md +19 -0
- package/.github/skills/caveman-mode/SKILL.md +43 -0
- package/.github/skills/caveman-review/SKILL.md +16 -0
- package/.github/skills/caveman-stats/SKILL.md +13 -0
- package/.github/skills/community-content/SKILL.md +22 -0
- package/.github/skills/database-analysis/SKILL.md +23 -0
- package/.github/skills/dev-coding/SKILL.md +24 -0
- package/.github/skills/frontend-coding/SKILL.md +24 -0
- package/.github/skills/human-in-the-loop/SKILL.md +47 -0
- package/.github/skills/iot-architecture/SKILL.md +22 -0
- package/.github/skills/legacy-migration/SKILL.md +22 -0
- package/.github/skills/rag-knowledge/SKILL.md +21 -0
- package/.github/skills/token-saver/SKILL.md +36 -0
- package/.github/skills/ux-ui-governance/SKILL.md +24 -0
- package/.github/skills/wiki-tools.json +24 -0
- package/.github/workflows/auto-devlog.yml +56 -0
- package/.github/workflows/auto-manage-issues.yml +64 -0
- package/.github/workflows/auto-sync.yml +54 -0
- package/.github/workflows/autodocs-sync.yml +114 -0
- package/.github/workflows/ci.yml +68 -0
- package/.github/workflows/pages.yml +59 -0
- package/.github/workflows/routing-evals.yml +59 -0
- package/.github/workflows/techriders-coverage-effective.yml +91 -0
- package/.vscode/mcp.json +44 -0
- package/AGENTS.md +160 -0
- package/ARCHITECTURE.md +57 -0
- package/FINAL_USAGE_GUIDE.md +106 -0
- package/LICENSE +21 -0
- package/README.md +385 -0
- package/README_WIKI.md +130 -0
- package/autodocs/README.md +22 -0
- package/autodocs/schema/wiki-node.schema.json +56 -0
- package/autolearning/feedback-loop.md +90 -0
- package/bin/install-host.js +326 -0
- package/bin/mcpee.js +116 -0
- package/context/repomix/repomix.config.json +20 -0
- package/memory/cross-memory-reasoning.md +17 -0
- package/memory/mempry-registry.yml +16 -0
- package/observability/evals/chat-token-usage-report.json +64 -0
- package/observability/evals/chat-token-usage-report.md +33 -0
- package/observability/evals/iteration-value-report.json +76 -0
- package/observability/evals/iteration-value-report.md +39 -0
- package/observability/evals/learning-loop-report.json +268 -0
- package/observability/evals/learning-loop-report.md +37 -0
- package/observability/evals/repo-intake-eval-cases.md +23 -0
- package/observability/evals/routing-eval-cases.json +68 -0
- package/observability/evals/routing-eval-cases.md +25 -0
- package/observability/evals/routing-eval-report.json +72 -0
- package/observability/evaluation.md +34 -0
- package/observability/logs/copilot-usage-ingest-report.json +13 -0
- package/observability/logs/iteration-metrics.jsonl +75 -0
- package/observability/logs/learning-feedback.jsonl +152 -0
- package/observability/logs/routing-decisions.jsonl +333 -0
- package/observability/logs/session/agent-pipeline-preflight-20260701-004146.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260701-005554.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260701-010351.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260704-145829.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260704-150021.log +8 -0
- package/observability/logs/session/agent-pipeline-preflight-20260704-154328.log +8 -0
- package/observability/logs/session/bye-20260629-221513.json +39 -0
- package/observability/logs/session/bye-20260629-221545.json +59 -0
- package/observability/logs/session/bye-20260629-222007.json +52 -0
- package/observability/logs/session/bye-20260629-222133.json +59 -0
- package/observability/logs/session/bye-20260629-222412.json +45 -0
- package/observability/logs/session/bye-20260629-223224.json +52 -0
- package/observability/logs/session/bye-20260629-224050.json +59 -0
- package/observability/logs/session/bye-20260630-105732.json +24 -0
- package/observability/logs/session/bye-20260630-211536.json +87 -0
- package/observability/logs/session/bye-20260630-223423.json +87 -0
- package/observability/logs/session/bye-20260630-232534.json +87 -0
- package/observability/logs/session/bye-20260701-003638.json +126 -0
- package/observability/logs/session/bye-20260701-003849.json +126 -0
- package/observability/logs/session/bye-20260701-004315.json +138 -0
- package/observability/logs/session/bye-20260701-004559.json +76 -0
- package/observability/logs/session/bye-20260701-005913.json +138 -0
- package/observability/logs/session/bye-20260701-010753.json +138 -0
- package/observability/logs/session/bye-20260703-194106.json +24 -0
- package/observability/logs/session/bye-20260703-233443.json +76 -0
- package/observability/logs/session/bye-20260703-233653.json +76 -0
- package/observability/logs/session/bye-20260704-150317.json +152 -0
- package/observability/logs/session/bye-20260704-150929.json +75 -0
- package/observability/logs/session/bye-20260704-151050.json +75 -0
- package/observability/logs/session/bye-20260705-115458.json +165 -0
- package/observability/logs/session/codegraph-status-20260701-004228.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-004310.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-005637.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-005908.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-010444.log +39 -0
- package/observability/logs/session/codegraph-status-20260701-010747.log +39 -0
- package/observability/logs/session/codegraph-status-20260704-150137.log +26 -0
- package/observability/logs/session/codegraph-status-20260704-150313.log +28 -0
- package/observability/logs/session/codegraph-status-20260704-154445.log +26 -0
- package/observability/logs/session/codegraph-status-20260705-115454.log +27 -0
- package/observability/logs/session/codegraph-sync-20260701-004211.log +88 -0
- package/observability/logs/session/codegraph-sync-20260701-004241.log +82 -0
- package/observability/logs/session/codegraph-sync-20260701-005620.log +89 -0
- package/observability/logs/session/codegraph-sync-20260701-005840.log +88 -0
- package/observability/logs/session/codegraph-sync-20260701-010419.log +93 -0
- package/observability/logs/session/codegraph-sync-20260701-010609.log +90 -0
- package/observability/logs/session/codegraph-sync-20260704-145856.log +70 -0
- package/observability/logs/session/codegraph-sync-20260704-150047.log +53 -0
- package/observability/logs/session/codegraph-sync-20260704-150204.log +44 -0
- package/observability/logs/session/codegraph-sync-20260704-154353.log +26 -0
- package/observability/logs/session/codegraph-sync-20260705-115337.log +32 -0
- package/observability/logs/session/hi-20260629-221459.json +38 -0
- package/observability/logs/session/hi-20260629-221945.json +59 -0
- package/observability/logs/session/hi-20260629-222108.json +66 -0
- package/observability/logs/session/hi-20260629-222352.json +45 -0
- package/observability/logs/session/hi-20260629-225719.json +59 -0
- package/observability/logs/session/hi-20260629-233722.json +52 -0
- package/observability/logs/session/hi-20260629-233913.json +198 -0
- package/observability/logs/session/hi-20260630-110156.json +177 -0
- package/observability/logs/session/hi-20260630-191243.json +184 -0
- package/observability/logs/session/hi-20260630-230050.json +234 -0
- package/observability/logs/session/hi-20260630-230523.json +227 -0
- package/observability/logs/session/hi-20260630-230855.json +227 -0
- package/observability/logs/session/hi-20260630-231638.json +227 -0
- package/observability/logs/session/hi-20260630-231756.json +219 -0
- package/observability/logs/session/hi-20260701-002842.json +234 -0
- package/observability/logs/session/hi-20260701-003458.json +282 -0
- package/observability/logs/session/hi-20260701-004233.json +290 -0
- package/observability/logs/session/hi-20260701-004554.json +236 -0
- package/observability/logs/session/hi-20260701-005641.json +290 -0
- package/observability/logs/session/hi-20260701-010450.json +290 -0
- package/observability/logs/session/hi-20260703-233854.json +312 -0
- package/observability/logs/session/hi-20260703-234448.json +318 -0
- package/observability/logs/session/hi-20260704-145907.json +353 -0
- package/observability/logs/session/hi-20260704-150141.json +392 -0
- package/observability/logs/session/hi-20260704-154448.json +392 -0
- package/observability/logs/session/iteration-value-refresh-20260701-004309.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260701-005907.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260701-010747.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260704-150312.log +3 -0
- package/observability/logs/session/iteration-value-refresh-20260705-115453.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260701-004309.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260701-005906.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260701-010745.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260704-150309.log +3 -0
- package/observability/logs/session/learning-loop-refresh-20260705-115450.log +3 -0
- package/observability/logs/session/project-notes-refresh-20260701-004227.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-004308.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-005636.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-005906.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-010443.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260701-010744.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260704-150133.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260704-150309.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260704-154442.log +1 -0
- package/observability/logs/session/project-notes-refresh-20260705-115449.log +1 -0
- package/observability/logs/session/repo-intake-20260701-004218.log +6 -0
- package/observability/logs/session/repo-intake-20260701-005626.log +6 -0
- package/observability/logs/session/repo-intake-20260701-010433.log +6 -0
- package/observability/logs/session/repo-intake-20260704-150053.log +6 -0
- package/observability/logs/session/repo-intake-20260704-154404.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260701-004247.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260701-005847.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260701-010615.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260704-150209.log +6 -0
- package/observability/logs/session/repo-intake-refresh-20260705-115342.log +6 -0
- package/observability/logs/session/repo-registry-validation-20260701-004234.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260701-004556.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260701-005833.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260701-010601.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260704-150155.log +2 -0
- package/observability/logs/session/repo-registry-validation-20260705-115323.log +2 -0
- package/observability/logs/session/repomix-refresh-20260701-003823.log +4236 -0
- package/observability/logs/session/repomix-refresh-20260701-004251.log +4275 -0
- package/observability/logs/session/repomix-refresh-20260701-005850.log +4248 -0
- package/observability/logs/session/repomix-refresh-20260701-010619.log +6531 -0
- package/observability/logs/session/repomix-refresh-20260704-150239.log +652 -0
- package/observability/logs/session/repomix-refresh-20260705-115419.log +178 -0
- package/observability/logs/session/routing-evals-20260701-004221.log +2 -0
- package/observability/logs/session/routing-evals-20260701-004235.log +2 -0
- package/observability/logs/session/routing-evals-20260701-005629.log +2 -0
- package/observability/logs/session/routing-evals-20260701-005834.log +2 -0
- package/observability/logs/session/routing-evals-20260701-010437.log +2 -0
- package/observability/logs/session/routing-evals-20260701-010603.log +2 -0
- package/observability/logs/session/routing-evals-20260704-150125.log +2 -0
- package/observability/logs/session/routing-evals-20260704-150157.log +2 -0
- package/observability/logs/session/routing-evals-20260704-154434.log +2 -0
- package/observability/logs/session/routing-evals-20260705-115327.log +2 -0
- package/observability/logs/session/sibling-discovery-refresh-20260701-004250.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260701-005850.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260701-010618.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260704-150238.log +3 -0
- package/observability/logs/session/sibling-discovery-refresh-20260705-115418.log +3 -0
- package/observability/logs.schema.json +95 -0
- package/observability/logs.schema.md +26 -0
- package/observability/metrics.md +35 -0
- package/observability/routing-evaluator.md +37 -0
- package/observability/scoring-rubric.md +38 -0
- package/optimization/ALWAYS_ON_OPTIMIZATION.md +98 -0
- package/optimization/caveman-mode.md +62 -0
- package/optimization/examples/login-bug.md +25 -0
- package/optimization/examples/sla-query.md +25 -0
- package/optimization/optimization-routing.md +30 -0
- package/optimization/policies/response-style.policy.md +45 -0
- package/optimization/policies/token-budget.policy.md +28 -0
- package/optimization/profiles/always-on.profile.md +19 -0
- package/optimization/profiles/architecture.profile.md +20 -0
- package/optimization/profiles/debug.profile.md +20 -0
- package/optimization/profiles/enterprise-rag.profile.md +20 -0
- package/optimization/profiles/training.profile.md +20 -0
- package/optimization/token-saver.md +58 -0
- package/orchestrator/corporate-routing.md +51 -0
- package/orchestrator/decision-matrix.md +33 -0
- package/orchestrator/fallback.md +29 -0
- package/orchestrator/repo-routing.md +58 -0
- package/orchestrator/router.md +75 -0
- package/orchestrator/wiki/__init__.py +5 -0
- package/orchestrator/wiki/graph_consolidator.py +506 -0
- package/orchestrator/wiki/incremental_engine.py +57 -0
- package/orchestrator/wiki/plugin_manager.py +40 -0
- package/package.json +70 -0
- package/policies/context-policy.md +25 -0
- package/policies/cost-policy.md +25 -0
- package/policies/repo-intake-policy.md +36 -0
- package/policies/security-policy.md +25 -0
- package/repo-intake/README.md +81 -0
- package/repo-intake/templates/agent.template.md +4 -0
- package/repo-intake/templates/context-manifest.template.md +4 -0
- package/repo-intake/templates/skill.template.md +3 -0
- package/repo-registry/repos.schema.json +102 -0
- package/repo-registry/repos.template.json +26 -0
- package/requirements.txt +1 -0
- package/scripts/README.md +109 -0
- package/scripts/__init__.py +0 -0
- package/scripts/bootstrap-portable.cmd +4 -0
- package/scripts/bootstrap-portable.ps1 +90 -0
- package/scripts/context/azure-rag-mcp-adapter.py +1 -0
- package/scripts/context/build-graphify.ps1 +1 -0
- package/scripts/context/build-repomix.ps1 +1 -0
- package/scripts/discovery/discover-boost-repos.cmd +4 -0
- package/scripts/discovery/discover-boost-repos.py +186 -0
- package/scripts/discovery/refresh-project-notes.py +179 -0
- package/scripts/github/INSTALL.md +295 -0
- package/scripts/github/README.md +455 -0
- package/scripts/github/apply-boost-templates.ps1 +163 -0
- package/scripts/github/apply-single-repo.ps1 +85 -0
- package/scripts/github/create-devlog.ps1 +380 -0
- package/scripts/github/manage-issues.ps1 +332 -0
- package/scripts/github/sync-repo.ps1 +267 -0
- package/scripts/intake/agent-pipeline-preflight.py +151 -0
- package/scripts/intake/init-template-registry.cmd +4 -0
- package/scripts/intake/init-template-registry.ps1 +258 -0
- package/scripts/intake/repo-intake.py +354 -0
- package/scripts/intake/resolve-routing.py +620 -0
- package/scripts/intake/run-repo-intake.cmd +4 -0
- package/scripts/intake/run-repo-intake.ps1 +46 -0
- package/scripts/intake/run-routing-evals.py +147 -0
- package/scripts/intake/validate-database-routing.py +91 -0
- package/scripts/intake/validate-rag-routing.py +85 -0
- package/scripts/intake/validate-repo-registry.ps1 +20 -0
- package/scripts/intake/validate-repo-registry.py +286 -0
- package/scripts/intake/validate-security.py +170 -0
- package/scripts/learning/autolearning-gate.py +71 -0
- package/scripts/learning/chat-token-usage-report.py +326 -0
- package/scripts/learning/ingest-copilot-session-usage.py +421 -0
- package/scripts/learning/iteration-value-report.py +275 -0
- package/scripts/learning/learning-loop-report.py +272 -0
- package/scripts/learning/record-iteration-metrics.py +116 -0
- package/scripts/learning/record-learning-feedback.py +91 -0
- package/scripts/ops/bye.ps1 +620 -0
- package/scripts/ops/compare-demo-results.ps1 +826 -0
- package/scripts/ops/demo1.ps1 +11 -0
- package/scripts/ops/demo2.ps1 +11 -0
- package/scripts/ops/demo3.ps1 +11 -0
- package/scripts/ops/demo4.ps1 +11 -0
- package/scripts/ops/hi.ps1 +1045 -0
- package/scripts/ops/llm-token-probe.py +164 -0
- package/scripts/ops/run-all-demos.ps1 +39 -0
- package/scripts/ops/run-demo-block.ps1 +85 -0
- package/scripts/ops/run-demo-session.ps1 +532 -0
- package/scripts/setup/optimize-engines.ps1 +183 -0
- package/scripts/setup/setup-codegraph.ps1 +3 -0
- package/scripts/setup/setup-gitnexus.ps1 +3 -0
- package/scripts/setup/setup-graphify.ps1 +2 -0
- package/scripts/setup/setup-prerequisites.ps1 +205 -0
- package/scripts/setup/start-gitnexus.ps1 +71 -0
- package/scripts/setup/validate-context.ps1 +361 -0
- package/scripts/wiki/__init__.py +0 -0
- package/scripts/wiki/compiler_main.py +189 -0
- package/scripts/wiki/normalizer.py +206 -0
- package/scripts/wiki/providers/base_provider.py +25 -0
- package/scripts/wiki/providers/codegraph_provider.py +49 -0
- package/scripts/wiki/providers/graphify_provider.py +49 -0
- package/scripts/wiki/providers/repo_content_provider.py +408 -0
- package/scripts/wiki/query_autodocs.py +60 -0
- package/scripts/wiki/validator.py +183 -0
- package/scripts/wiki/wiki_compiler.py +5 -0
- package/specs/architecture.spec.md +32 -0
- package/specs/azure-rag.spec.md +28 -0
- package/specs/coding-standards.spec.md +24 -0
- package/specs/database.spec.md +29 -0
- package/specs/migration.spec.md +26 -0
- package/specs/observability.spec.md +24 -0
- package/specs/optimization.spec.md +31 -0
- package/specs/rag.spec.md +30 -0
- package/specs/repo-intake.spec.md +25 -0
- package/specs/routing.spec.md +24 -0
- package/specs/security.spec.md +30 -0
- package/specs/wiki/provider-contract.json +33 -0
- package/specs/wiki/unified-knowledge-graph.json +25 -0
- package/templates/BOOST_README_TEMPLATE.md +96 -0
- package/templates/CODEOWNERS_TEMPLATE.txt +29 -0
- package/templates/LICENSE_MIT_TEMPLATE.txt +21 -0
- package/templates/PERSONAL_README_TEMPLATE.md +90 -0
- package/templates/README_boost_RAG_Azure.md +46 -0
- package/templates/README_boost_azure_iot_edge.md +48 -0
- package/templates/README_boost_backend.md +47 -0
- package/templates/README_boost_dba.md +57 -0
- package/templates/ci.yml.template +73 -0
- package/tooling/tooling.manifest.json +72 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[switch]$CIMode,
|
|
3
|
+
[switch]$PortableMode
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
Set-StrictMode -Version Latest
|
|
7
|
+
$ErrorActionPreference = 'Stop'
|
|
8
|
+
|
|
9
|
+
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path
|
|
10
|
+
Set-Location $repoRoot
|
|
11
|
+
$toolingManifestPath = Join-Path $repoRoot 'tooling/tooling.manifest.json'
|
|
12
|
+
$setupValidationReportPath = Join-Path $repoRoot 'repo-intake/generated/reports/setup-validation.json'
|
|
13
|
+
|
|
14
|
+
$requiredCore = @(
|
|
15
|
+
'requirements.txt',
|
|
16
|
+
'tooling/tooling.manifest.json',
|
|
17
|
+
'.vscode/mcp.json',
|
|
18
|
+
'AGENTS.md',
|
|
19
|
+
'specs/architecture.spec.md',
|
|
20
|
+
'specs/security.spec.md',
|
|
21
|
+
'specs/routing.spec.md'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
$requiredEnterprise = @(
|
|
25
|
+
'orchestrator/router.md',
|
|
26
|
+
'policies/security-policy.md',
|
|
27
|
+
'repo-registry/repos.yml'
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
function Get-ToolingManifest {
|
|
31
|
+
param([Parameter(Mandatory = $true)][string]$Path)
|
|
32
|
+
|
|
33
|
+
if (-not (Test-Path $Path)) {
|
|
34
|
+
throw "Missing tooling manifest: $Path"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return Get-Content -Raw -Path $Path | ConvertFrom-Json -Depth 20
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function Test-RequiredInMode {
|
|
41
|
+
param(
|
|
42
|
+
[Parameter(Mandatory = $true)][object]$Tool,
|
|
43
|
+
[Parameter(Mandatory = $true)][string]$Mode
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
if (-not ($Tool.PSObject.Properties.Name -contains 'required_in')) {
|
|
47
|
+
return $true
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
$requiredModes = @($Tool.required_in | ForEach-Object { [string]$_ })
|
|
51
|
+
if ($requiredModes.Count -eq 0) {
|
|
52
|
+
return $true
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return ($requiredModes -contains $Mode)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function Write-SetupValidationReport {
|
|
59
|
+
param(
|
|
60
|
+
[Parameter(Mandatory = $true)][string]$Path,
|
|
61
|
+
[Parameter(Mandatory = $true)][hashtable]$Report
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
$dir = Split-Path -Parent $Path
|
|
65
|
+
if (-not (Test-Path $dir)) {
|
|
66
|
+
New-Item -ItemType Directory -Path $dir -Force | Out-Null
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
$Report | ConvertTo-Json -Depth 20 | Set-Content -Path $Path -Encoding utf8
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
# Ensure report directory exists
|
|
73
|
+
$reportDir = Split-Path -Parent $setupValidationReportPath
|
|
74
|
+
if (-not (Test-Path $reportDir)) {
|
|
75
|
+
New-Item -ItemType Directory -Path $reportDir -Force | Out-Null
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
# ============================================
|
|
79
|
+
# CI MODE - Minimal file presence check
|
|
80
|
+
# ============================================
|
|
81
|
+
if ($CIMode) {
|
|
82
|
+
Write-Host "Validating for CI (minimal checks)..."
|
|
83
|
+
|
|
84
|
+
$requiredFiles = @(
|
|
85
|
+
"requirements.txt",
|
|
86
|
+
"AGENTS.md",
|
|
87
|
+
"specs/architecture.spec.md",
|
|
88
|
+
"specs/security.spec.md",
|
|
89
|
+
"specs/routing.spec.md"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
$errors = @()
|
|
93
|
+
foreach ($file in $requiredFiles) {
|
|
94
|
+
if (-not (Test-Path $file)) {
|
|
95
|
+
$errors += "Missing $file"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
$report = @{
|
|
100
|
+
timestamp = (Get-Date).ToUniversalTime().ToString('o')
|
|
101
|
+
mode = 'ci'
|
|
102
|
+
errors = $errors
|
|
103
|
+
overall_status = if ($errors.Count -eq 0) { 'ok' } else { 'failed' }
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
$report | ConvertTo-Json -Depth 20 | Set-Content -Path $setupValidationReportPath -Encoding utf8
|
|
107
|
+
|
|
108
|
+
if ($errors.Count -eq 0) {
|
|
109
|
+
Write-Host "✓ CI validation OK"
|
|
110
|
+
exit 0
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
$errors | ForEach-Object { Write-Host "✗ $_" }
|
|
114
|
+
exit 1
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# If we reach here, CI mode is off
|
|
119
|
+
Write-Host "Validating setup (full checks)..."
|
|
120
|
+
|
|
121
|
+
$required = @($requiredCore)
|
|
122
|
+
if (-not $PortableMode) {
|
|
123
|
+
$required += $requiredEnterprise
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
$errors=@()
|
|
127
|
+
$validationMode = if ($PortableMode) { 'portable' } else { 'enterprise' }
|
|
128
|
+
$setupValidationReport = @{
|
|
129
|
+
timestamp = (Get-Date).ToUniversalTime().ToString('o')
|
|
130
|
+
mode = $validationMode
|
|
131
|
+
manifest_path = 'tooling/tooling.manifest.json'
|
|
132
|
+
requirements_file = 'requirements.txt'
|
|
133
|
+
python_requirements_ok = $false
|
|
134
|
+
python_modules = @()
|
|
135
|
+
external_clis = @()
|
|
136
|
+
errors = @()
|
|
137
|
+
warnings = @()
|
|
138
|
+
overall_status = 'failed'
|
|
139
|
+
}
|
|
140
|
+
foreach($i in $required){ if(!(Test-Path $i)){ $errors += "Missing $i" } }
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
$toolingManifest = Get-ToolingManifest -Path $toolingManifestPath
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
$errors += $_.Exception.Message
|
|
147
|
+
$toolingManifest = $null
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (Test-Path 'requirements.txt') {
|
|
151
|
+
$requirementsRaw = Get-Content -Raw -Path 'requirements.txt'
|
|
152
|
+
if ($requirementsRaw -match 'graphifyy\[mcp\]') {
|
|
153
|
+
$setupValidationReport.python_requirements_ok = $true
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
$errors += 'requirements.txt must include graphifyy[mcp] for the Graphify MCP runtime.'
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if ($toolingManifest -and ($toolingManifest.PSObject.Properties.Name -contains 'external_clis')) {
|
|
161
|
+
foreach ($tool in @($toolingManifest.external_clis)) {
|
|
162
|
+
if (-not (Test-RequiredInMode -Tool $tool -Mode $validationMode)) {
|
|
163
|
+
continue
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
$commandName = [string]$tool.command
|
|
167
|
+
$installed = [bool](Get-Command $commandName -ErrorAction SilentlyContinue)
|
|
168
|
+
$toolPackage = ''
|
|
169
|
+
$installKind = ''
|
|
170
|
+
if (($tool.PSObject.Properties.Name -contains 'install') -and $tool.install) {
|
|
171
|
+
if ($tool.install.PSObject.Properties.Name -contains 'package') {
|
|
172
|
+
$toolPackage = [string]$tool.install.package
|
|
173
|
+
}
|
|
174
|
+
if ($tool.install.PSObject.Properties.Name -contains 'kind') {
|
|
175
|
+
$installKind = [string]$tool.install.kind
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
$setupValidationReport.external_clis += @{
|
|
180
|
+
name = [string]$tool.name
|
|
181
|
+
command = $commandName
|
|
182
|
+
install_kind = $installKind
|
|
183
|
+
package = $toolPackage
|
|
184
|
+
installed = $installed
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
if (-not $installed) {
|
|
188
|
+
$errors += "Missing command $commandName"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
$mcpRaw = Get-Content -Raw -Path '.vscode/mcp.json' | ConvertFrom-Json -Depth 20
|
|
195
|
+
if ($mcpRaw.servers.gitnexus.command -ne 'gitnexus') {
|
|
196
|
+
$errors += 'MCP gitnexus command should be local `gitnexus` (avoid npx startup latency).'
|
|
197
|
+
}
|
|
198
|
+
$scanLimit = 0
|
|
199
|
+
$gitnexusHasEnv = ($mcpRaw.servers.gitnexus.PSObject.Properties.Name -contains 'env')
|
|
200
|
+
if ($gitnexusHasEnv -and $mcpRaw.servers.gitnexus.env) {
|
|
201
|
+
$gitnexusEnv = $mcpRaw.servers.gitnexus.env
|
|
202
|
+
$hasScanProp = ($gitnexusEnv.PSObject.Properties.Name -contains 'GITNEXUS_SEMANTIC_EXACT_SCAN_LIMIT')
|
|
203
|
+
if ($hasScanProp) {
|
|
204
|
+
[void][int]::TryParse([string]$gitnexusEnv.GITNEXUS_SEMANTIC_EXACT_SCAN_LIMIT, [ref]$scanLimit)
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if ($scanLimit -lt 20000) {
|
|
208
|
+
$errors += 'MCP gitnexus env.GITNEXUS_SEMANTIC_EXACT_SCAN_LIMIT should be >= 20000 for better semantic fallback on Windows.'
|
|
209
|
+
}
|
|
210
|
+
if ($mcpRaw.servers.repomix.command -ne 'repomix') {
|
|
211
|
+
$errors += 'MCP repomix command should be local `repomix` (avoid npx startup latency).'
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
$errors += "Unable to parse .vscode/mcp.json: $($_.Exception.Message)"
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
$specFiles = @(
|
|
219
|
+
"specs/architecture.spec.md",
|
|
220
|
+
"specs/azure-rag.spec.md",
|
|
221
|
+
"specs/coding-standards.spec.md",
|
|
222
|
+
"specs/database.spec.md",
|
|
223
|
+
"specs/migration.spec.md",
|
|
224
|
+
"specs/observability.spec.md",
|
|
225
|
+
"specs/optimization.spec.md",
|
|
226
|
+
"specs/repo-intake.spec.md",
|
|
227
|
+
"specs/rag.spec.md",
|
|
228
|
+
"specs/routing.spec.md",
|
|
229
|
+
"specs/security.spec.md"
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
$specContracts = @{
|
|
233
|
+
"specs/architecture.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
234
|
+
"specs/azure-rag.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
235
|
+
"specs/coding-standards.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
236
|
+
"specs/database.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
237
|
+
"specs/migration.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
238
|
+
"specs/observability.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
239
|
+
"specs/optimization.spec.md" = @("## Routing Robustness Contract (Production)", "## Token Efficiency Contract (Ahorro de Tokens)", "## Enforcement")
|
|
240
|
+
"specs/repo-intake.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
241
|
+
"specs/rag.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
242
|
+
"specs/routing.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
243
|
+
"specs/security.spec.md" = @("## Objetivo", "## Reglas", "## Validacion minima")
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
if (-not $PortableMode) {
|
|
247
|
+
foreach ($spec in $specFiles) {
|
|
248
|
+
if (-not (Test-Path $spec)) {
|
|
249
|
+
continue
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
$raw = Get-Content -Raw -Path $spec
|
|
253
|
+
$lineCount = (Get-Content -Path $spec | Measure-Object -Line).Lines
|
|
254
|
+
|
|
255
|
+
if ($lineCount -lt 8) {
|
|
256
|
+
$errors += "Spec too short (possible placeholder): $spec"
|
|
257
|
+
continue
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if ($raw -match "Reglas base del dominio") {
|
|
261
|
+
$errors += "Spec still contains placeholder text: $spec"
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
foreach ($requiredHeading in $specContracts[$spec]) {
|
|
265
|
+
if ($raw -notmatch [regex]::Escape($requiredHeading)) {
|
|
266
|
+
$errors += "Spec missing required section '$requiredHeading': $spec"
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if ($spec -eq "specs/optimization.spec.md" -and $raw -notmatch [regex]::Escape("scripts\\intake\\run-routing-evals.py")) {
|
|
271
|
+
$errors += "Spec enforcement command drift detected: $spec"
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if ($raw -match [regex]::Escape("scripts\\learning\\run-routing-evals.py")) {
|
|
275
|
+
$errors += "Deprecated routing-evals path referenced in spec: $spec"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (-not (Get-Command codegraph -ErrorAction SilentlyContinue)) {
|
|
281
|
+
if (-not ($CIMode)) {
|
|
282
|
+
$errors += "Missing command codegraph"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
elseif (-not (Test-Path ".codegraph")) {
|
|
286
|
+
if (-not ($CIMode)) {
|
|
287
|
+
$errors += "Missing .codegraph index. Run: codegraph init -i"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (-not (Get-Command repomix -ErrorAction SilentlyContinue)) {
|
|
292
|
+
if (-not ($CIMode)) {
|
|
293
|
+
$errors += "Missing command repomix. Run: npm install -g repomix@latest"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (Get-Command codebase-memory-mcp -ErrorAction SilentlyContinue) {
|
|
298
|
+
try {
|
|
299
|
+
$cbmCfg = codebase-memory-mcp config list | Out-String
|
|
300
|
+
if ($cbmCfg -notmatch 'auto_index\s*=\s*true') {
|
|
301
|
+
$errors += 'codebase-memory-mcp auto_index must be true. Run: codebase-memory-mcp config set auto_index true'
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
$errors += "Unable to read codebase-memory-mcp config: $($_.Exception.Message)"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
if (-not (Get-Command py -ErrorAction SilentlyContinue) -and -not (Get-Command python -ErrorAction SilentlyContinue)) {
|
|
310
|
+
if (-not ($CIMode)) {
|
|
311
|
+
$errors += "Missing Python launcher (py/python) required for graphify MCP"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
$pythonCmd = "python"
|
|
316
|
+
$pythonArgs = @("-c", "import graphify.serve, mcp; print('ok')")
|
|
317
|
+
if (Get-Command py -ErrorAction SilentlyContinue) {
|
|
318
|
+
$pythonCmd = "py"
|
|
319
|
+
$pythonArgs = @("-3.14", "-c", "import graphify.serve, mcp; print('ok')")
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
& $pythonCmd @pythonArgs *> $null
|
|
323
|
+
$setupValidationReport.python_modules += @{
|
|
324
|
+
launcher = $pythonCmd
|
|
325
|
+
args = $pythonArgs
|
|
326
|
+
import_ok = ($LASTEXITCODE -eq 0)
|
|
327
|
+
}
|
|
328
|
+
if ($LASTEXITCODE -ne 0) {
|
|
329
|
+
if (-not ($CIMode)) {
|
|
330
|
+
$errors += 'Graphify MCP runtime missing. Run: py -3.14 -m pip install -r requirements.txt'
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (-not (Test-Path "context/graphify-out/graph.json")) {
|
|
336
|
+
if (-not ($CIMode)) {
|
|
337
|
+
$errors += "Missing context/graphify-out/graph.json. Run: py -3.14 -m graphify extract scripts --no-cluster --out context"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
$setupValidationReport.errors = @($errors)
|
|
342
|
+
$setupValidationReport.warnings = @()
|
|
343
|
+
$setupValidationReport.overall_status = if ($errors.Count -eq 0) { 'ok' } else { 'failed' }
|
|
344
|
+
Write-SetupValidationReport -Path $setupValidationReportPath -Report $setupValidationReport
|
|
345
|
+
|
|
346
|
+
if($errors.Count -eq 0){
|
|
347
|
+
if ($PortableMode) {
|
|
348
|
+
Write-Host "Portable validation OK. Python requirements and local MCP runtime look consistent."
|
|
349
|
+
Write-Host "Report: $setupValidationReportPath"
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
Write-Host "Validation OK. Always-on optimization documented."
|
|
353
|
+
Write-Host "Running strict repo registry validation..."
|
|
354
|
+
pwsh -NoProfile -File .\scripts\intake\validate-repo-registry.ps1 -Strict
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
$errors | ForEach-Object { Write-Host $_ }
|
|
359
|
+
Write-Host "Report: $setupValidationReportPath"
|
|
360
|
+
exit 1
|
|
361
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from datetime import datetime, timezone
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, Dict, List
|
|
6
|
+
|
|
7
|
+
from orchestrator.wiki.graph_consolidator import GraphConsolidator
|
|
8
|
+
from orchestrator.wiki.incremental_engine import IncrementalEngine
|
|
9
|
+
from orchestrator.wiki.plugin_manager import PluginManager
|
|
10
|
+
from scripts.wiki.providers.repo_content_provider import RepoContentProvider
|
|
11
|
+
from scripts.wiki.validator import WikiValidator
|
|
12
|
+
from scripts.wiki.providers.codegraph_provider import CodeGraphProvider
|
|
13
|
+
from scripts.wiki.providers.graphify_provider import GraphifyProvider
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
REPO_ROOT = Path(__file__).resolve().parents[2]
|
|
17
|
+
AUTODOCS_ROOT = REPO_ROOT / "autodocs"
|
|
18
|
+
GENERATED_OUTPUT_DIR = AUTODOCS_ROOT / "generated"
|
|
19
|
+
SCHEMA_PATH = AUTODOCS_ROOT / "schema" / "wiki-node.schema.json"
|
|
20
|
+
UNIFIED_GRAPH_PATH = GENERATED_OUTPUT_DIR / "unified-graph.json"
|
|
21
|
+
MARKDOWN_OUTPUT_DIR = AUTODOCS_ROOT / "site"
|
|
22
|
+
VALIDATION_REPORT_JSON = GENERATED_OUTPUT_DIR / "validation-report.json"
|
|
23
|
+
VALIDATION_REPORT_MD = GENERATED_OUTPUT_DIR / "validation-report.md"
|
|
24
|
+
ITERATION_LOG = REPO_ROOT / "observability" / "logs" / "iteration-metrics.jsonl"
|
|
25
|
+
ROUTING_LOG = REPO_ROOT / "observability" / "logs" / "routing-decisions.jsonl"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _append_jsonl(path: Path, payload: Dict[str, Any]) -> None:
|
|
29
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
30
|
+
with path.open("a", encoding="utf-8") as handle:
|
|
31
|
+
handle.write(json.dumps(payload, ensure_ascii=True) + "\n")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _read_session_env() -> Dict[str, str]:
|
|
35
|
+
keys = [
|
|
36
|
+
"MCP_AGENT",
|
|
37
|
+
"MCP_ENGINE",
|
|
38
|
+
"MCP_SESSION_ID",
|
|
39
|
+
"VSCODE_TARGET_SESSION_LOG",
|
|
40
|
+
"CI",
|
|
41
|
+
]
|
|
42
|
+
env_snapshot: Dict[str, str] = {}
|
|
43
|
+
for key in keys:
|
|
44
|
+
value = os.getenv(key)
|
|
45
|
+
if value:
|
|
46
|
+
env_snapshot[key] = value
|
|
47
|
+
return env_snapshot
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _write_routing_event(
|
|
51
|
+
env_snapshot: Dict[str, str],
|
|
52
|
+
dirty_count: int,
|
|
53
|
+
total_nodes: int,
|
|
54
|
+
errors: List[Dict[str, Any]],
|
|
55
|
+
elapsed_ms: int,
|
|
56
|
+
) -> None:
|
|
57
|
+
routing_event: Dict[str, Any] = {
|
|
58
|
+
"timestamp": datetime.now(timezone.utc).isoformat(),
|
|
59
|
+
"input": "autodocs compile",
|
|
60
|
+
"intent": "documentar",
|
|
61
|
+
"source_type": "technical-docs",
|
|
62
|
+
"agent": "autodocs-agent",
|
|
63
|
+
"engine": "CodeGraph",
|
|
64
|
+
"optimization_profile": "strict+full",
|
|
65
|
+
"fallback": False,
|
|
66
|
+
"grounded": True,
|
|
67
|
+
"sources": [
|
|
68
|
+
"repo-intake/generated/*/capabilities/capability.json",
|
|
69
|
+
"repo-intake/generated/*/context-manifests/manifest.json",
|
|
70
|
+
"autodocs/generated/unified-graph.json",
|
|
71
|
+
],
|
|
72
|
+
"notes": f"dirty_nodes={dirty_count}; total_nodes={total_nodes}; elapsed_ms={elapsed_ms}; errors={len(errors)}",
|
|
73
|
+
"optimization": {
|
|
74
|
+
"token_saver": "always_on",
|
|
75
|
+
"token_saver_profile": "strict",
|
|
76
|
+
"caveman": "always_on",
|
|
77
|
+
"caveman_profile": "full",
|
|
78
|
+
"sources_preserved": True,
|
|
79
|
+
"context_reduction_strategy": "manifest",
|
|
80
|
+
},
|
|
81
|
+
"memory": {
|
|
82
|
+
"selected": ["/memories/repo/ops-notes.md"],
|
|
83
|
+
"reason": "Reuse intake/telemetry conventions and fallback guidance.",
|
|
84
|
+
},
|
|
85
|
+
"learning": {
|
|
86
|
+
"used_pattern": "incremental-json-projection",
|
|
87
|
+
"success": len(errors) == 0,
|
|
88
|
+
"outcome_status": "confirmed" if len(errors) == 0 else "pending",
|
|
89
|
+
"fallback": len(errors) > 0,
|
|
90
|
+
"confidence": 0.91 if len(errors) == 0 else 0.6,
|
|
91
|
+
},
|
|
92
|
+
"hitl": {
|
|
93
|
+
"mode": "always_on_auto",
|
|
94
|
+
"required": False,
|
|
95
|
+
"action": "none",
|
|
96
|
+
"reason": "Local deterministic docs projection with no destructive operations.",
|
|
97
|
+
},
|
|
98
|
+
"execution": {
|
|
99
|
+
"env": env_snapshot,
|
|
100
|
+
"provider_errors": errors,
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
_append_jsonl(ROUTING_LOG, routing_event)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def main() -> int:
|
|
107
|
+
start = datetime.now(timezone.utc)
|
|
108
|
+
env_snapshot = _read_session_env()
|
|
109
|
+
|
|
110
|
+
manager = PluginManager()
|
|
111
|
+
include_external = str(os.getenv("AUTODOCS_INCLUDE_EXTERNAL_PROVIDERS", "")).strip().lower() in {
|
|
112
|
+
"1",
|
|
113
|
+
"true",
|
|
114
|
+
"yes",
|
|
115
|
+
"on",
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# Keep CI output deterministic: external providers depend on local intake artifacts that
|
|
119
|
+
# may not exist on clean runners.
|
|
120
|
+
if include_external:
|
|
121
|
+
manager.register_provider(CodeGraphProvider(REPO_ROOT / "repo-intake" / "generated"))
|
|
122
|
+
manager.register_provider(GraphifyProvider(REPO_ROOT / "repo-intake" / "generated"))
|
|
123
|
+
|
|
124
|
+
manager.register_provider(RepoContentProvider(REPO_ROOT))
|
|
125
|
+
|
|
126
|
+
provider_result = manager.gather_all()
|
|
127
|
+
contracts = provider_result.get("contracts", [])
|
|
128
|
+
provider_errors = provider_result.get("errors", [])
|
|
129
|
+
|
|
130
|
+
consolidator = GraphConsolidator(
|
|
131
|
+
output_graph_path=UNIFIED_GRAPH_PATH,
|
|
132
|
+
markdown_output_dir=MARKDOWN_OUTPUT_DIR,
|
|
133
|
+
)
|
|
134
|
+
unified_graph = consolidator.consolidate(contracts)
|
|
135
|
+
wiki_nodes = unified_graph.get("wiki_nodes", {})
|
|
136
|
+
|
|
137
|
+
incremental_engine = IncrementalEngine(UNIFIED_GRAPH_PATH)
|
|
138
|
+
diff = incremental_engine.diff(wiki_nodes)
|
|
139
|
+
dirty_nodes = diff.get("dirty_nodes", {})
|
|
140
|
+
deleted_nodes = diff.get("deleted_nodes", [])
|
|
141
|
+
cached_nodes = diff.get("cached_graph", {}).get("nodes", {})
|
|
142
|
+
|
|
143
|
+
validator = WikiValidator(SCHEMA_PATH)
|
|
144
|
+
validation_report = validator.validate(wiki_nodes)
|
|
145
|
+
validator.write_reports(
|
|
146
|
+
json_path=VALIDATION_REPORT_JSON,
|
|
147
|
+
markdown_path=VALIDATION_REPORT_MD,
|
|
148
|
+
report=validation_report,
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
project_stats = consolidator.project_dirty_nodes(
|
|
152
|
+
dirty_nodes=dirty_nodes,
|
|
153
|
+
deleted_nodes=deleted_nodes,
|
|
154
|
+
all_nodes=wiki_nodes,
|
|
155
|
+
cached_nodes=cached_nodes,
|
|
156
|
+
)
|
|
157
|
+
consolidator.persist_graph(unified_graph)
|
|
158
|
+
consolidator.persist_manifests(unified_graph)
|
|
159
|
+
|
|
160
|
+
elapsed_ms = int((datetime.now(timezone.utc) - start).total_seconds() * 1000)
|
|
161
|
+
iteration_event: Dict[str, Any] = {
|
|
162
|
+
"timestamp": datetime.now(timezone.utc).isoformat(),
|
|
163
|
+
"source_type": "technical-docs",
|
|
164
|
+
"module": "autodocs",
|
|
165
|
+
"total_nodes": len(wiki_nodes),
|
|
166
|
+
"dirty_nodes": len(dirty_nodes),
|
|
167
|
+
"deleted_nodes": len(deleted_nodes),
|
|
168
|
+
"rendered_markdown": int(project_stats.get("rendered", 0)),
|
|
169
|
+
"deleted_markdown": int(project_stats.get("deleted", 0)),
|
|
170
|
+
"rendered_indexes": int(project_stats.get("indexes", 0)),
|
|
171
|
+
"rendered_manifests": int(project_stats.get("manifests", 0)),
|
|
172
|
+
"provider_errors": len(provider_errors),
|
|
173
|
+
"validation_errors": int(validation_report.get("summary", {}).get("error_count", 0)),
|
|
174
|
+
"validation_warnings": int(validation_report.get("summary", {}).get("warning_count", 0)),
|
|
175
|
+
"elapsed_ms": elapsed_ms,
|
|
176
|
+
}
|
|
177
|
+
_append_jsonl(ITERATION_LOG, iteration_event)
|
|
178
|
+
_write_routing_event(
|
|
179
|
+
env_snapshot=env_snapshot,
|
|
180
|
+
dirty_count=len(dirty_nodes),
|
|
181
|
+
total_nodes=len(wiki_nodes),
|
|
182
|
+
errors=provider_errors,
|
|
183
|
+
elapsed_ms=elapsed_ms,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
if int(validation_report.get("summary", {}).get("error_count", 0)) > 0:
|
|
187
|
+
return 1
|
|
188
|
+
|
|
189
|
+
return 0
|