woods 1.6.1 → 2.0.0.beta2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2035 -0
- data/CONTRIBUTING.md +253 -87
- data/README.md +161 -513
- data/SECURITY.md +92 -0
- data/assets/woods-wordmark-white-with-bg.png +0 -0
- data/docs/AGENT_GUIDE.md +204 -0
- data/docs/AGENT_SETUP.md +205 -0
- data/docs/BACKEND_MATRIX.md +470 -0
- data/docs/CONFIGURATION_REFERENCE.md +655 -0
- data/docs/CONSOLE_MCP_SETUP.md +829 -0
- data/docs/DOCKER_SETUP.md +454 -0
- data/docs/EMBEDDING_MODELS.md +136 -0
- data/docs/EVALUATION.md +91 -0
- data/docs/EXTRACTOR_REFERENCE.md +765 -0
- data/docs/FAQ.md +544 -0
- data/docs/GETTING_STARTED.md +183 -0
- data/docs/INCREMENTAL_EXTRACTION.md +455 -0
- data/docs/INTERNALS.md +418 -0
- data/docs/MCP_HTTP_TRANSPORT.md +144 -0
- data/docs/MCP_SERVERS.md +231 -0
- data/docs/MCP_TOOL_COOKBOOK.md +987 -0
- data/docs/MCP_WORKTREE_SETUP.md +127 -0
- data/docs/NOTION_INTEGRATION.md +283 -0
- data/docs/OBSIDIAN_INTEGRATION.md +170 -0
- data/docs/PUBLISHED_INDEX.md +213 -0
- data/docs/README.md +94 -0
- data/docs/RETRIEVAL_GUIDE.md +267 -0
- data/docs/TOKEN_BENCHMARK.md +68 -0
- data/docs/TROUBLESHOOTING.md +841 -0
- data/docs/UNBLOCKED_INTEGRATION.md +279 -0
- data/docs/UPGRADING_TO_2.md +321 -0
- data/docs/WATCH_DAEMON.md +667 -0
- data/docs/WHY_WOODS.md +219 -0
- data/exe/woods-console +40 -4
- data/exe/woods-console-mcp +21 -35
- data/exe/woods-mcp +20 -7
- data/exe/woods-mcp-http +80 -11
- data/exe/woods-mcp-start +57 -52
- data/lib/generators/woods/install_generator.rb +6 -5
- data/lib/generators/woods/pgvector_generator.rb +6 -3
- data/lib/generators/woods/templates/add_pgvector_to_woods.rb.erb +29 -9
- data/lib/generators/woods/templates/create_woods_tables.rb.erb +5 -1
- data/lib/generators/woods/templates/woods.rb.tt +49 -28
- data/lib/tasks/woods.rake +622 -168
- data/lib/tasks/woods_checks.rake +107 -0
- data/lib/tasks/woods_evaluation.rake +164 -80
- data/lib/woods/ast/call_site_extractor.rb +6 -15
- data/lib/woods/ast/method_extractor.rb +19 -9
- data/lib/woods/ast/parser.rb +54 -8
- data/lib/woods/atomic_file.rb +171 -2
- data/lib/woods/builder.rb +310 -22
- data/lib/woods/cache/cache_middleware.rb +7 -2
- data/lib/woods/cache/cache_store.rb +9 -1
- data/lib/woods/cache/solid_cache_store.rb +6 -4
- data/lib/woods/change_set.rb +88 -0
- data/lib/woods/checks/generation_resolution.rb +34 -0
- data/lib/woods/checks/moved_messages.rb +186 -0
- data/lib/woods/chunking/semantic_chunker.rb +160 -18
- data/lib/woods/console/audit_logger.rb +12 -3
- data/lib/woods/console/bridge_protocol.rb +3 -16
- data/lib/woods/console/connection_manager.rb +51 -136
- data/lib/woods/console/dispatch_pipeline.rb +42 -12
- data/lib/woods/console/embedded_executor.rb +806 -149
- data/lib/woods/console/eval_guard.rb +27 -20
- data/lib/woods/console/input_contract.rb +78 -0
- data/lib/woods/console/model_validator.rb +29 -1
- data/lib/woods/console/rack_middleware.rb +65 -42
- data/lib/woods/console/redactor.rb +26 -8
- data/lib/woods/console/safe_context.rb +58 -10
- data/lib/woods/console/scope_predicate_parser.rb +41 -0
- data/lib/woods/console/server.rb +119 -247
- data/lib/woods/console/sql_noise_stripper.rb +125 -16
- data/lib/woods/console/sql_table_scanner.rb +82 -22
- data/lib/woods/console/sql_validator.rb +459 -29
- data/lib/woods/console/table_gate.rb +2 -2
- data/lib/woods/console/tool_specs.rb +463 -90
- data/lib/woods/console/tools/tier1.rb +1 -5
- data/lib/woods/console/tools/tier4.rb +18 -9
- data/lib/woods/coordination/lock_heartbeat.rb +103 -0
- data/lib/woods/coordination/pipeline_lock.rb +263 -53
- data/lib/woods/db/migrations/007_typed_snapshot_units.rb +45 -0
- data/lib/woods/db/migrator.rb +3 -9
- data/lib/woods/db/schema_version.rb +47 -2
- data/lib/woods/dependency_graph.rb +898 -64
- data/lib/woods/embedding/fake.rb +138 -0
- data/lib/woods/embedding/indexer.rb +832 -40
- data/lib/woods/embedding/openai.rb +77 -19
- data/lib/woods/embedding/provider.rb +189 -11
- data/lib/woods/embedding/text_preparer.rb +1 -1
- data/lib/woods/embedding/token_counter.rb +0 -7
- data/lib/woods/evaluation/ablation_agent_payload.rb +38 -0
- data/lib/woods/evaluation/ablation_executor.rb +67 -0
- data/lib/woods/evaluation/ablation_provenance.rb +38 -0
- data/lib/woods/evaluation/ablation_report_writer.rb +43 -0
- data/lib/woods/evaluation/ablation_runner.rb +173 -0
- data/lib/woods/evaluation/ablation_summary.rb +65 -0
- data/lib/woods/evaluation/ablation_task.rb +66 -0
- data/lib/woods/evaluation/ablation_task_set.rb +77 -0
- data/lib/woods/evaluation/ablation_timed_executor.rb +91 -0
- data/lib/woods/evaluation/ablation_worktree.rb +71 -0
- data/lib/woods/evaluation/baseline.rb +60 -0
- data/lib/woods/evaluation/baseline_runner.rb +11 -3
- data/lib/woods/evaluation/evaluator.rb +41 -8
- data/lib/woods/evaluation/query_set.rb +79 -13
- data/lib/woods/evaluation/report_generator.rb +20 -1
- data/lib/woods/export/unit_facts.rb +0 -11
- data/lib/woods/extracted_unit.rb +22 -63
- data/lib/woods/extractor.rb +2783 -238
- data/lib/woods/extractors/action_cable_extractor.rb +9 -4
- data/lib/woods/extractors/ast_source_extraction.rb +20 -2
- data/lib/woods/extractors/caching_extractor.rb +46 -12
- data/lib/woods/extractors/callback_analyzer.rb +39 -9
- data/lib/woods/extractors/component_discovery.rb +123 -0
- data/lib/woods/extractors/concern_extractor.rb +17 -3
- data/lib/woods/extractors/controller_extractor.rb +389 -29
- data/lib/woods/extractors/decorator_extractor.rb +7 -14
- data/lib/woods/extractors/engine_extractor.rb +53 -8
- data/lib/woods/extractors/event_extractor.rb +55 -4
- data/lib/woods/extractors/factory_extractor.rb +49 -11
- data/lib/woods/extractors/graphql_extractor.rb +162 -66
- data/lib/woods/extractors/i18n_extractor.rb +6 -1
- data/lib/woods/extractors/job_extractor.rb +51 -21
- data/lib/woods/extractors/lib_extractor.rb +23 -17
- data/lib/woods/extractors/line_neutralizer.rb +171 -0
- data/lib/woods/extractors/mailer_extractor.rb +9 -1
- data/lib/woods/extractors/manager_extractor.rb +19 -2
- data/lib/woods/extractors/migration_extractor.rb +22 -11
- data/lib/woods/extractors/model_extractor.rb +292 -57
- data/lib/woods/extractors/package_extractor.rb +154 -0
- data/lib/woods/extractors/phlex_extractor.rb +18 -3
- data/lib/woods/extractors/policy_extractor.rb +6 -5
- data/lib/woods/extractors/poro_extractor.rb +13 -14
- data/lib/woods/extractors/pundit_extractor.rb +3 -3
- data/lib/woods/extractors/rails_source_extractor.rb +24 -7
- data/lib/woods/extractors/rake_task_extractor.rb +158 -30
- data/lib/woods/extractors/reference_patterns.rb +38 -0
- data/lib/woods/extractors/route_extractor.rb +58 -2
- data/lib/woods/extractors/scheduled_job_extractor.rb +51 -35
- data/lib/woods/extractors/serializer_extractor.rb +3 -4
- data/lib/woods/extractors/service_extractor.rb +11 -1
- data/lib/woods/extractors/shared_dependency_scanner.rb +24 -34
- data/lib/woods/extractors/shared_utility_methods.rb +36 -6
- data/lib/woods/extractors/source_nesting.rb +560 -0
- data/lib/woods/extractors/state_machine_extractor.rb +30 -18
- data/lib/woods/extractors/test_mapping_extractor.rb +26 -9
- data/lib/woods/extractors/view_component_extractor.rb +28 -3
- data/lib/woods/extractors/view_engines/erb.rb +17 -3
- data/lib/woods/feedback/gap_detector.rb +9 -3
- data/lib/woods/feedback/store.rb +7 -1
- data/lib/woods/filename_utils.rb +29 -1
- data/lib/woods/flow_analysis/operation_extractor.rb +22 -10
- data/lib/woods/flow_assembler.rb +147 -26
- data/lib/woods/flow_document.rb +1 -0
- data/lib/woods/flow_precomputer.rb +175 -22
- data/lib/woods/gem_mapper.rb +285 -0
- data/lib/woods/generation.rb +185 -0
- data/lib/woods/git_command.rb +38 -0
- data/lib/woods/git_provenance.rb +16 -2
- data/lib/woods/graph_analyzer.rb +564 -87
- data/lib/woods/index_artifact.rb +93 -23
- data/lib/woods/mcp/bearer_auth.rb +102 -13
- data/lib/woods/mcp/bootstrap_state.rb +77 -0
- data/lib/woods/mcp/bootstrapper.rb +582 -77
- data/lib/woods/mcp/config_resolver.rb +66 -6
- data/lib/woods/mcp/errors.rb +60 -0
- data/lib/woods/mcp/index_reader.rb +836 -117
- data/lib/woods/mcp/index_reader_pinning.rb +78 -0
- data/lib/woods/mcp/origin_guard.rb +66 -7
- data/lib/woods/mcp/protocol_policy.rb +98 -0
- data/lib/woods/mcp/provider_probe.rb +45 -6
- data/lib/woods/mcp/renderers/markdown_renderer.rb +72 -4
- data/lib/woods/mcp/renderers/plain_renderer.rb +54 -6
- data/lib/woods/mcp/server.rb +898 -152
- data/lib/woods/mcp/tasks/extension.rb +196 -0
- data/lib/woods/mcp/tasks/request_capture.rb +45 -0
- data/lib/woods/mcp/tasks/store.rb +518 -0
- data/lib/woods/mcp/tool_contract.rb +171 -0
- data/lib/woods/mcp/tool_response_renderer.rb +7 -0
- data/lib/woods/model_name_cache.rb +19 -1
- data/lib/woods/notion/client.rb +132 -36
- data/lib/woods/notion/exporter.rb +456 -61
- data/lib/woods/notion/mappers/column_mapper.rb +34 -5
- data/lib/woods/notion/mappers/migration_mapper.rb +32 -8
- data/lib/woods/notion/mappers/model_mapper.rb +21 -6
- data/lib/woods/notion/mappers/shared.rb +45 -3
- data/lib/woods/notion/sync_manifest.rb +258 -0
- data/lib/woods/obsidian/errors.rb +6 -0
- data/lib/woods/obsidian/name_mapper.rb +40 -24
- data/lib/woods/obsidian/vault_exporter.rb +103 -36
- data/lib/woods/operator/pipeline_guard.rb +118 -21
- data/lib/woods/operator/status_reporter.rb +20 -3
- data/lib/woods/path_dispatcher.rb +276 -0
- data/lib/woods/payload_store.rb +236 -0
- data/lib/woods/published_index/edge_shaper.rb +61 -0
- data/lib/woods/published_index/generation_catalog.rb +72 -0
- data/lib/woods/published_index/typed_unit_reader.rb +48 -0
- data/lib/woods/published_index.rb +287 -0
- data/lib/woods/railtie.rb +69 -30
- data/lib/woods/railtie_support.rb +167 -0
- data/lib/woods/release.rb +12 -0
- data/lib/woods/reload_policy.rb +206 -0
- data/lib/woods/resilience/circuit_breaker.rb +47 -8
- data/lib/woods/resilience/index_validator.rb +296 -10
- data/lib/woods/resilience/retryable_provider.rb +71 -6
- data/lib/woods/resolved_config.rb +55 -11
- data/lib/woods/retrieval/context_assembler.rb +132 -40
- data/lib/woods/retrieval/query_classifier.rb +26 -8
- data/lib/woods/retrieval/ranker.rb +193 -28
- data/lib/woods/retrieval/search_executor.rb +206 -39
- data/lib/woods/retriever.rb +317 -71
- data/lib/woods/retry_after.rb +22 -2
- data/lib/woods/ruby_analyzer/class_analyzer.rb +10 -14
- data/lib/woods/ruby_analyzer/fqn_builder.rb +2 -0
- data/lib/woods/ruby_analyzer/mermaid_renderer.rb +14 -4
- data/lib/woods/ruby_analyzer/method_analyzer.rb +1 -1
- data/lib/woods/ruby_analyzer/trace_enricher.rb +3 -0
- data/lib/woods/ruby_analyzer.rb +21 -5
- data/lib/woods/session_tracer/file_store.rb +138 -19
- data/lib/woods/session_tracer/middleware.rb +1 -2
- data/lib/woods/session_tracer/redis_store.rb +122 -12
- data/lib/woods/session_tracer/session_flow_assembler.rb +57 -17
- data/lib/woods/session_tracer/session_flow_document.rb +56 -14
- data/lib/woods/session_tracer/solid_cache_coordination.rb +192 -0
- data/lib/woods/session_tracer/solid_cache_store.rb +560 -91
- data/lib/woods/session_tracer/store.rb +14 -1
- data/lib/woods/storage/metadata_store.rb +230 -26
- data/lib/woods/storage/pgvector.rb +180 -22
- data/lib/woods/storage/qdrant.rb +367 -41
- data/lib/woods/storage/snapshotter/metadata.rb +79 -16
- data/lib/woods/storage/snapshotter/vector.rb +128 -17
- data/lib/woods/storage/snapshotter.rb +23 -5
- data/lib/woods/storage/vector_store.rb +49 -8
- data/lib/woods/storage_identity.rb +28 -0
- data/lib/woods/tasks.rb +53 -2
- data/lib/woods/temporal/json_snapshot_store.rb +112 -42
- data/lib/woods/temporal/snapshot_store.rb +139 -42
- data/lib/woods/unblocked/client.rb +119 -17
- data/lib/woods/unblocked/document_builder.rb +34 -2
- data/lib/woods/unblocked/exporter.rb +63 -27
- data/lib/woods/unblocked/rate_limiter.rb +23 -9
- data/lib/woods/unblocked/sync_manifest.rb +16 -8
- data/lib/woods/update_check.rb +24 -1
- data/lib/woods/util/uuid5.rb +124 -0
- data/lib/woods/version.rb +1 -1
- data/lib/woods/watch/daemon.rb +1345 -0
- data/lib/woods/watch/listen_watcher.rb +81 -0
- data/lib/woods/watch/polling_watcher.rb +137 -0
- data/lib/woods/watch/status.rb +169 -0
- data/lib/woods/watch/tree_scan.rb +163 -0
- data/lib/woods/watch/watcher.rb +100 -0
- data/lib/woods.rb +138 -9
- data/plugin/.claude-plugin/plugin.json +18 -0
- data/plugin/hooks/hooks.json +29 -0
- data/plugin/hooks/woods-post-edit.sh +226 -0
- data/plugin/hooks/woods-session-start.sh +77 -0
- data/plugin/skills/woods-agent-enable/SKILL.md +51 -0
- data/plugin/skills/woods-diagnose/SKILL.md +75 -0
- data/plugin/skills/woods-investigate/SKILL.md +39 -0
- data/plugin/skills/woods-mcp-config/SKILL.md +101 -0
- data/plugin/skills/woods-setup/SKILL.md +99 -0
- metadata +134 -23
- data/lib/woods/console/adapters/cache_adapter.rb +0 -58
- data/lib/woods/console/adapters/good_job_adapter.rb +0 -33
- data/lib/woods/console/adapters/job_adapter.rb +0 -74
- data/lib/woods/console/adapters/sidekiq_adapter.rb +0 -33
- data/lib/woods/console/adapters/solid_queue_adapter.rb +0 -33
- data/lib/woods/console/bridge.rb +0 -210
- data/lib/woods/formatting/claude_adapter.rb +0 -98
- data/lib/woods/formatting/generic_adapter.rb +0 -56
- data/lib/woods/formatting/gpt_adapter.rb +0 -64
- data/lib/woods/notion/mapper.rb +0 -40
- data/lib/woods/observability/health_check.rb +0 -79
- data/lib/woods/observability/instrumentation.rb +0 -34
|
@@ -11,18 +11,19 @@ module Woods
|
|
|
11
11
|
# rails generate woods:install
|
|
12
12
|
#
|
|
13
13
|
# Creates:
|
|
14
|
-
# config/initializers/woods.rb
|
|
15
|
-
# db/migrate/<ts>_create_woods_tables.rb —
|
|
14
|
+
# config/initializers/woods.rb — annotated configuration file
|
|
15
|
+
# db/migrate/<ts>_create_woods_tables.rb — legacy compatibility migration
|
|
16
16
|
#
|
|
17
|
-
#
|
|
18
|
-
#
|
|
17
|
+
# Shipped v2 paths do not use the migration's application tables. New
|
|
18
|
+
# default installs should remove it; retain it only for an older/custom
|
|
19
|
+
# integration that deliberately uses woods_units/edges/embeddings.
|
|
19
20
|
#
|
|
20
21
|
class InstallGenerator < Rails::Generators::Base
|
|
21
22
|
include ActiveRecord::Generators::Migration
|
|
22
23
|
|
|
23
24
|
source_root File.expand_path('templates', __dir__)
|
|
24
25
|
|
|
25
|
-
desc 'Creates a Woods initializer and
|
|
26
|
+
desc 'Creates a Woods initializer and a legacy compatibility migration'
|
|
26
27
|
|
|
27
28
|
# @return [void]
|
|
28
29
|
def create_initializer_file
|
|
@@ -7,8 +7,11 @@ module Woods
|
|
|
7
7
|
module Generators
|
|
8
8
|
# Rails generator that adds pgvector support to Woods.
|
|
9
9
|
#
|
|
10
|
-
# Requires the pgvector PostgreSQL extension.
|
|
11
|
-
#
|
|
10
|
+
# Requires the pgvector PostgreSQL extension. Creates the `woods_vectors`
|
|
11
|
+
# table (id, native vector column, JSONB metadata) plus an HNSW index —
|
|
12
|
+
# the schema read and written by Woods::Storage::VectorStore::Pgvector.
|
|
13
|
+
# The migration mirrors the adapter's idempotent ensure_schema! DDL, so
|
|
14
|
+
# it coexists with schema creation at embed time.
|
|
12
15
|
#
|
|
13
16
|
# Usage:
|
|
14
17
|
# rails generate woods:pgvector
|
|
@@ -19,7 +22,7 @@ module Woods
|
|
|
19
22
|
|
|
20
23
|
source_root File.expand_path('templates', __dir__)
|
|
21
24
|
|
|
22
|
-
desc '
|
|
25
|
+
desc 'Creates the woods_vectors table (pgvector column + HNSW index) used by the Woods vector store'
|
|
23
26
|
|
|
24
27
|
class_option :dimensions, type: :numeric, default: 1536,
|
|
25
28
|
desc: 'Vector dimensions (1536 for text-embedding-3-small, 3072 for large)'
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
class AddPgvectorToWoods < ActiveRecord::Migration[
|
|
2
|
-
|
|
1
|
+
class AddPgvectorToWoods < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
|
2
|
+
# Creates the `woods_vectors` table read and written by
|
|
3
|
+
# Woods::Storage::VectorStore::Pgvector. The DDL mirrors the adapter's own
|
|
4
|
+
# idempotent ensure_schema! (CREATE ... IF NOT EXISTS), so it is safe to run
|
|
5
|
+
# whether or not Woods has already created the table at embed time.
|
|
6
|
+
#
|
|
7
|
+
# Raw SQL is used deliberately: the pgvector `vector` column type is not a
|
|
8
|
+
# native Rails column type, and this keeps the migration byte-for-byte in
|
|
9
|
+
# agreement with the adapter. Note: the `vector` type does not round-trip
|
|
10
|
+
# through schema.rb; use `config.active_record.schema_format = :sql`
|
|
11
|
+
# (structure.sql) if you need the dump to reproduce this table.
|
|
12
|
+
def up
|
|
3
13
|
enable_extension 'vector' unless extension_enabled?('vector')
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
|
|
15
|
+
execute <<~SQL
|
|
16
|
+
CREATE TABLE IF NOT EXISTS woods_vectors (
|
|
17
|
+
id TEXT PRIMARY KEY,
|
|
18
|
+
embedding vector(<%= @dimensions || 1536 %>),
|
|
19
|
+
metadata JSONB DEFAULT '{}',
|
|
20
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
21
|
+
)
|
|
22
|
+
SQL
|
|
7
23
|
|
|
8
24
|
# HNSW index for fast approximate nearest neighbor search
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
# using the cosine distance operator (vector_cosine_ops).
|
|
26
|
+
execute <<~SQL
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_woods_vectors_embedding_hnsw
|
|
28
|
+
ON woods_vectors USING hnsw (embedding vector_cosine_ops)
|
|
29
|
+
SQL
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def down
|
|
33
|
+
drop_table :woods_vectors, if_exists: true
|
|
14
34
|
end
|
|
15
35
|
end
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
# Legacy compatibility migration. Woods 2's shipped extraction, storage, and
|
|
2
|
+
# retrieval paths do not use these application tables. New default installs
|
|
3
|
+
# should remove this file without running it; keep it only for an older/custom
|
|
4
|
+
# integration that deliberately uses the tables.
|
|
5
|
+
class CreateWoodsTables < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
|
|
2
6
|
def change
|
|
3
7
|
create_table :woods_units do |t|
|
|
4
8
|
t.string :unit_type, null: false
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Woods configuration
|
|
4
|
-
# Full reference: https://github.com/lost-in-the/woods/blob/
|
|
4
|
+
# Full reference: https://github.com/lost-in-the/woods/blob/v<%= Woods::VERSION %>/docs/CONFIGURATION_REFERENCE.md
|
|
5
5
|
#
|
|
6
6
|
# Quick-start presets (uncomment one instead of the full block below):
|
|
7
|
-
# Woods.configure_with_preset(:local) #
|
|
8
|
-
# Woods.configure_with_preset(:
|
|
9
|
-
#
|
|
7
|
+
# Woods.configure_with_preset(:local) # SQLite metadata + local Ollama (sqlite3 gem required)
|
|
8
|
+
# Woods.configure_with_preset(:shared_filesystem) # persisted files + local Ollama; no sqlite3
|
|
9
|
+
# :postgresql # pgvector + OpenAI; requires sqlite3, API key, and connection options
|
|
10
|
+
# :production # Qdrant + OpenAI; requires sqlite3, API key, URL, and collection
|
|
11
|
+
# Copy the complete hosted-preset blocks from CONFIGURATION_REFERENCE.md;
|
|
12
|
+
# the preset name alone cannot supply credentials or backend connection details.
|
|
10
13
|
#
|
|
11
14
|
# Presets accept a block for overrides:
|
|
12
15
|
# Woods.configure_with_preset(:local) { |c| c.max_context_tokens = 16_000 }
|
|
@@ -32,13 +35,8 @@ Woods.configure do |config|
|
|
|
32
35
|
|
|
33
36
|
# ── Extractors ──────────────────────────────────────────────────────────
|
|
34
37
|
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
# config.extractors = %i[
|
|
38
|
-
# models controllers services components view_components
|
|
39
|
-
# jobs mailers graphql serializers managers policies validators
|
|
40
|
-
# rails_source
|
|
41
|
-
# ]
|
|
38
|
+
# All built-in extractors run. `config.extractors` is accepted for forward
|
|
39
|
+
# compatibility but does not select a subset; non-default values warn.
|
|
42
40
|
|
|
43
41
|
# Include Rails / gem source in the index (increases extraction time).
|
|
44
42
|
# config.include_framework_sources = true
|
|
@@ -48,7 +46,8 @@ Woods.configure do |config|
|
|
|
48
46
|
|
|
49
47
|
# ── Embedding ───────────────────────────────────────────────────────────
|
|
50
48
|
|
|
51
|
-
# Embedding provider: :openai or :
|
|
49
|
+
# Embedding provider: :openai, :ollama, or :fake. `:fake` is deterministic
|
|
50
|
+
# and offline for tests/CI; it does not provide meaningful semantic ranking.
|
|
52
51
|
# config.embedding_provider = :openai
|
|
53
52
|
# config.embedding_model = 'text-embedding-3-small'
|
|
54
53
|
# config.embedding_options = { api_key: ENV['OPENAI_API_KEY'] }
|
|
@@ -56,7 +55,8 @@ Woods.configure do |config|
|
|
|
56
55
|
# Ollama (local, no API key needed). `num_ctx` is auto-selected per model
|
|
57
56
|
# (nomic-embed-text → 2048, bge-m3 → 8192). Install `gem "tokenizers"` for
|
|
58
57
|
# exact BERT WordPiece token counting on dense Ruby source. See
|
|
59
|
-
# docs/EMBEDDING_MODELS.md
|
|
58
|
+
# https://github.com/lost-in-the/woods/blob/v<%= Woods::VERSION %>/docs/EMBEDDING_MODELS.md
|
|
59
|
+
# has the full model comparison.
|
|
60
60
|
# config.embedding_provider = :ollama
|
|
61
61
|
# config.embedding_options = {
|
|
62
62
|
# model: 'nomic-embed-text',
|
|
@@ -68,7 +68,9 @@ Woods.configure do |config|
|
|
|
68
68
|
# Vector store: :in_memory, :pgvector (PostgreSQL), :qdrant
|
|
69
69
|
# config.vector_store = :in_memory
|
|
70
70
|
|
|
71
|
-
# pgvector —
|
|
71
|
+
# pgvector — Woods creates its `woods_vectors` table automatically on first
|
|
72
|
+
# use (idempotent DDL). To manage the schema through your app's migrations
|
|
73
|
+
# instead, run `rails generate woods:pgvector && rails db:migrate`.
|
|
72
74
|
# config.vector_store = :pgvector
|
|
73
75
|
# config.vector_store_options = {
|
|
74
76
|
# connection: ActiveRecord::Base.connection,
|
|
@@ -80,7 +82,8 @@ Woods.configure do |config|
|
|
|
80
82
|
# config.vector_store_options = {
|
|
81
83
|
# url: ENV.fetch('QDRANT_URL', 'http://localhost:6333'),
|
|
82
84
|
# collection: 'woods',
|
|
83
|
-
# dimensions: 1_536
|
|
85
|
+
# dimensions: 1_536,
|
|
86
|
+
# allow_private_hosts: true # required for trusted localhost/RFC1918 URLs
|
|
84
87
|
# }
|
|
85
88
|
|
|
86
89
|
# Metadata store: :in_memory, :sqlite
|
|
@@ -97,41 +100,59 @@ Woods.configure do |config|
|
|
|
97
100
|
# Extract link_to / redirect_to / form_action navigation edges.
|
|
98
101
|
# config.extract_navigation_edges = true
|
|
99
102
|
|
|
100
|
-
# Temporal snapshots
|
|
103
|
+
# Temporal snapshots prefer Woods' output-directory SQLite database and fall
|
|
104
|
+
# back to JSON when the sqlite3 gem is unavailable. Internal migrations run
|
|
105
|
+
# automatically; this does not require `rails db:migrate`.
|
|
101
106
|
# config.enable_snapshots = false
|
|
102
107
|
|
|
103
108
|
# ── Console MCP ─────────────────────────────────────────────────────────
|
|
104
109
|
#
|
|
105
110
|
# The Console MCP server lets AI tools query your live Rails app.
|
|
106
111
|
# It is DISABLED by default. Enable only after reviewing the security
|
|
107
|
-
# documentation
|
|
112
|
+
# documentation:
|
|
113
|
+
# https://github.com/lost-in-the/woods/blob/v<%= Woods::VERSION %>/docs/CONSOLE_MCP_SETUP.md
|
|
108
114
|
#
|
|
109
115
|
# Defense layers (all active by default when the server is on):
|
|
110
|
-
# Layer 1 —
|
|
111
|
-
# Layer 2 —
|
|
112
|
-
#
|
|
113
|
-
# Layer 3 — Column redaction: credential columns
|
|
114
|
-
#
|
|
116
|
+
# Layer 1 — Table gate: rejects tool calls that touch a blocked table.
|
|
117
|
+
# Layer 2 — Credential scanner: redacts credential-shaped content (API
|
|
118
|
+
# keys, JWTs, etc.) from the response, by shape, not by name.
|
|
119
|
+
# Layer 3 — Column + EAV redaction: named credential columns and
|
|
120
|
+
# key/value pairs are replaced with [REDACTED].
|
|
121
|
+
# Layer 4 — SqlValidator + SafeContext (always on, no config): rejects
|
|
122
|
+
# DML/DDL before any DB interaction, and rolls back work on the
|
|
123
|
+
# current database connection. It cannot contain jobs, mail,
|
|
124
|
+
# HTTP calls, callbacks, threads, or other connections/shards.
|
|
115
125
|
|
|
116
126
|
# config.console_mcp_enabled = false
|
|
117
127
|
# config.console_mcp_path = '/mcp/console'
|
|
118
128
|
|
|
129
|
+
# Console HTTP requires a strong bearer token. Its Origin/Host guard is
|
|
130
|
+
# loopback-only by default; list the public MCP host and any browser client
|
|
131
|
+
# origin for a deliberate non-loopback deployment.
|
|
132
|
+
# config.console_mcp_token = ENV.fetch('WOODS_CONSOLE_MCP_TOKEN')
|
|
133
|
+
# config.console_mcp_allowed_origins = ['https://rails.internal.example']
|
|
134
|
+
|
|
119
135
|
# Credential-column redaction (Layer 3).
|
|
120
136
|
# Starts from a safe default list (passwords, tokens, secrets).
|
|
121
|
-
#
|
|
122
|
-
#
|
|
123
|
-
#
|
|
137
|
+
# config.console_redacted_columns =
|
|
138
|
+
# Woods::DEFAULT_CONSOLE_REDACTED_COLUMNS + %w[my_secret_col]
|
|
139
|
+
# Replace the defaults only after auditing the full list against your schema.
|
|
124
140
|
|
|
125
141
|
# Key-value pairs where the value should be redacted (e.g., env var names).
|
|
126
142
|
# config.console_redacted_key_values = []
|
|
127
143
|
|
|
128
|
-
# Tables completely blocked from queries.
|
|
129
|
-
#
|
|
144
|
+
# Tables completely blocked from queries (Layer 1).
|
|
145
|
+
# Starts from a safe default list (sessions, api_keys, credentials, ...).
|
|
146
|
+
# Extend: Woods::DEFAULT_CONSOLE_BLOCKED_TABLES + %w[my_secret_table]
|
|
147
|
+
# An empty array DISABLES this layer entirely — it does not mean "add
|
|
148
|
+
# nothing to the defaults". Override entirely only if you mean that:
|
|
149
|
+
# config.console_blocked_tables = %w[only_this_table]
|
|
130
150
|
|
|
131
151
|
# Disable specific scanner patterns (rare — prefer blocked_tables).
|
|
132
152
|
# config.console_disabled_scanner_patterns = []
|
|
133
153
|
|
|
134
|
-
#
|
|
154
|
+
# Legacy unsafe-eval flag. `console_eval` is unavailable in supported modes;
|
|
155
|
+
# setting this to true fails closed at Console Server construction.
|
|
135
156
|
# config.console_unsafe_eval_enabled = false
|
|
136
157
|
|
|
137
158
|
# Expose SQL/query read tools inside embedded console (adds read-only DB
|