mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-03 20:13:03 +00:00
update
This commit is contained in:
@@ -0,0 +1,433 @@
|
||||
{
|
||||
"assessments": {
|
||||
"abstraction_fitness": {
|
||||
"score": 40.7,
|
||||
"components": [
|
||||
"Abstraction Leverage",
|
||||
"Indirection Cost",
|
||||
"Interface Honesty"
|
||||
],
|
||||
"component_scores": {
|
||||
"Abstraction Leverage": 60.6,
|
||||
"Indirection Cost": 71.4,
|
||||
"Interface Honesty": 63.6
|
||||
}
|
||||
},
|
||||
"cross_module_architecture": 68.3,
|
||||
"design_coherence": 40.9,
|
||||
"error_consistency": 45.2,
|
||||
"test_strategy": 46.4
|
||||
},
|
||||
"dimension_notes": {
|
||||
"cross_module_architecture": {
|
||||
"evidence": [
|
||||
"All assigned `internal/quality/*.go` files stay within a single package boundary (`package quality`) and only import standard library packages (`time`, `testing`, `strings`), with no cross-package dependency fan-out from this slice.",
|
||||
"`pkg/rustdocs/parser_test.go` is isolated to `package rustdocs` and imports only stdlib plus `github.com/PuerkitoBio/goquery`; it does not couple into `internal/quality` types or helpers.",
|
||||
"No `init()` functions, package-level mutable singleton wiring, or import-time execution patterns were found in the reviewed files; behavior is test-function scoped and constructor-invoked (`NewParser`, `NewScorer`, `NewNarrativeGenerator`).",
|
||||
"Type declarations in `internal/quality/types.go` and `internal/quality/enhanced_types.go` are cohesive data-model definitions within one module boundary rather than cross-module shims or compatibility layers."
|
||||
],
|
||||
"impact_scope": "local",
|
||||
"fix_scope": "single_edit",
|
||||
"confidence": "high",
|
||||
"unreported_risk": "This batch covers only five files; architectural hotspots could still exist in non-assigned packages (e.g., runtime wiring or broader dependency graph) outside this evidence window."
|
||||
},
|
||||
"abstraction_fitness": {
|
||||
"evidence": [
|
||||
"Language-to-doc behavior is spread across multiple large switches: URL construction in cmd/get.go:78-173, type mapping in cmd/get.go:175-205, and term derivation in cmd/ask.go:205-260+.",
|
||||
"External scraper implementations repeat the same transport/change-detection scaffold (config+parser+http client fields, URL check, fetchPage, generateHash, DetectChanges) across multiple files, e.g. internal/scraper/external/godocs.go:17-121, internal/scraper/external/javadocs.go:16-115, internal/scraper/external/nuxtdocs.go:16-120, internal/scraper/external/cloudflaredocs.go:16-105.",
|
||||
"Vector store abstraction exposes implementations that are selected by default config but intentionally unimplemented: internal/config/config.go:121-125 defaults to chromem, while internal/vector/store.go:221-243 returns \"chromem store not implemented\" for all operations.",
|
||||
"Configuration defaults are duplicated in two representations (typed defaults and hand-written YAML template), increasing drift risk: cmd/init.go:92-149 and internal/config/config.go:104-160."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change",
|
||||
"confidence": "high",
|
||||
"unreported_risk": "",
|
||||
"sub_axes": {
|
||||
"abstraction_leverage": 62.0,
|
||||
"indirection_cost": 71.0,
|
||||
"interface_honesty": 60.0
|
||||
}
|
||||
},
|
||||
"test_strategy": {
|
||||
"evidence": [
|
||||
"`internal/quality/narrative_test.go` validates exact headline/action prose and directly tests internal helper behavior (e.g., `determinePhase`, `generateHeadline`, `classifyDimension`), creating high implementation-coupling.",
|
||||
"`internal/quality/scoring_test.go` similarly focuses on exact internal scoring details and string key literals, which makes refactors noisy and discourages safe design changes.",
|
||||
"`pkg/rustdocs/parser_test.go` is heavily happy-path: it checks successful parses and minimal field presence but has no malformed-input/error-path cases for parser resilience.",
|
||||
"`README.md` marks parts of the CLI as unstable/stubbed, but assigned tests do not provide cross-module contract/integration safety nets for those runtime boundaries."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high",
|
||||
"unreported_risk": ""
|
||||
},
|
||||
"design_coherence": {
|
||||
"evidence": [
|
||||
"Parallel implementations of the same scorecard pipeline exist in `cmd/devour_scorecard.py` and `cmd/scorecard_generator.py` with near-identical function layouts (`ScorecardData`, `score_color`, `draw_left_panel`, `draw_right_panel`, `generate_scorecard`, `main`) and only minor line-level differences.",
|
||||
"Three variants of enhanced generator (`cmd/devour_enhanced.py`, `cmd/devour_enhanced_fixed.py`, `cmd/devour_enhanced_v2.py`) repeat almost the full rendering stack (`draw_header_section`, `draw_enhanced_left_panel`, `draw_enhanced_right_panel`, `draw_trends_section`, `load_enhanced_devour_data`), creating branch-by-copy evolution.",
|
||||
"Scraper adapters across providers (`internal/scraper/external/astrodocs.go`, `internal/scraper/external/cloudflaredocs.go`, `internal/scraper/external/reactdocs.go`) duplicate fetch/hash/change-detection and document assembly patterns with provider-specific data glued inline, indicating repeated structural pattern without shared orchestration abstraction.",
|
||||
"Within `cmd/devour_lighthouse.py`, `load_font` is defined twice (once near top and again later), showing local design drift and utility ownership ambiguity."
|
||||
],
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "architectural_change",
|
||||
"confidence": "high",
|
||||
"unreported_risk": ""
|
||||
},
|
||||
"error_consistency": {
|
||||
"evidence": [
|
||||
"Raw error passthrough is common in core flows (e.g., `return nil, err` in `internal/search/engine.go:114`, `internal/search/engine.go:122`, `internal/scraper/openapi.go:45`, `internal/scraper/openapi.go:50`) while nearby code wraps with operation context (e.g., `internal/search/engine.go:111`, `internal/scraper/openapi.go:153`).",
|
||||
"Failure handling style diverges between aborting, propagating, and suppressing in similar backend paths: `panic(...)` in `internal/quality/plugins/go/plugin.go:363`, warning print-and-continue in `internal/indexer/indexer.go:239`, and plain returns in `cmd/scrape.go:90`/`cmd/get.go:59`.",
|
||||
"Some call paths lose caller context at command boundaries (`cmd/scrape.go:90`, `cmd/scrape.go:125`, `cmd/get.go:59`) despite contextual wrapping being used in other command-layer branches (`cmd/scrape.go:131`, `cmd/scrape.go:145`)."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high",
|
||||
"unreported_risk": ""
|
||||
}
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "language_catalog_scattered_switches",
|
||||
"summary": "Language routing logic is duplicated across CLI flows instead of one catalog abstraction",
|
||||
"related_files": [
|
||||
"cmd/get.go",
|
||||
"cmd/ask.go"
|
||||
],
|
||||
"evidence": [
|
||||
"cmd/get.go:78-173 defines a large language switch for URL building; cmd/get.go:175-205 defines a second switch for source type mapping.",
|
||||
"cmd/ask.go:205-260+ adds a third language switch for term heuristics, creating three independent sources of truth for one domain model."
|
||||
],
|
||||
"suggestion": "Introduce a single `LanguageSpec` registry (aliases, source type, URL builder, optional query-term strategy) in one package and have both `get` and `ask` consume it; keep per-language behavior as data/functions attached to that registry.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "external_scraper_scaffold_duplication",
|
||||
"summary": "External scraper adapters reimplement the same transport/hash lifecycle repeatedly",
|
||||
"related_files": [
|
||||
"internal/scraper/external/godocs.go",
|
||||
"internal/scraper/external/javadocs.go",
|
||||
"internal/scraper/external/nuxtdocs.go",
|
||||
"internal/scraper/external/cloudflaredocs.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Each file defines near-identical struct fields (`config`, `parser`, `client`), constructor wiring, URL-required guard, `fetchPage`, `generateHash`, and `DetectChanges` flow (e.g., godocs.go:17-121 and javadocs.go:16-115).",
|
||||
"Duplication scales linearly with each new source adapter, increasing edit surface for cross-cutting behavior (timeouts, headers, error mapping)."
|
||||
],
|
||||
"suggestion": "Extract a shared `HTTPDocScraperBase` (or composable helper functions) for request execution, status handling, hashing, and change detection; keep each adapter focused on parser invocation and domain-specific document mapping.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "default_selects_unimplemented_store",
|
||||
"summary": "Store interface contract is dishonest because default backend is not operational",
|
||||
"related_files": [
|
||||
"internal/vector/store.go",
|
||||
"internal/config/config.go"
|
||||
],
|
||||
"evidence": [
|
||||
"internal/config/config.go:121-125 sets default vector DB type to `chromem`.",
|
||||
"internal/vector/store.go:221-243 returns `chromem store not implemented` for all `Store` operations after `NewStore` can select that backend (store.go:63-72)."
|
||||
],
|
||||
"suggestion": "Either implement `ChromemStore` before exposing it as default, or switch default to a working backend and gate chromem behind explicit opt-in plus capability check at startup.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "config_defaults_double_encoded",
|
||||
"summary": "Initialization defaults are encoded twice with different abstractions",
|
||||
"related_files": [
|
||||
"cmd/init.go",
|
||||
"internal/config/config.go"
|
||||
],
|
||||
"evidence": [
|
||||
"cmd/init.go:92-149 hardcodes YAML defaults as a template string.",
|
||||
"internal/config/config.go:104-160 hardcodes defaults again in typed structs, requiring synchronized updates across two representations."
|
||||
],
|
||||
"suggestion": "Generate init YAML from `config.Default()` via marshal + small post-processing/comments, or maintain a single canonical defaults schema consumed by both loader and init command.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "cross_module_architecture",
|
||||
"identifier": "status_contract_string_map_boundary",
|
||||
"summary": "Scorecard state uses string keys instead of shared Status type, weakening module contracts.",
|
||||
"related_files": [
|
||||
"internal/quality/types.go",
|
||||
"internal/quality/scoring_test.go",
|
||||
"README.md"
|
||||
],
|
||||
"evidence": [
|
||||
"`internal/quality/types.go` defines `Status` constants but `Scorecard.StatusByType` is `map[string]int`.",
|
||||
"`internal/quality/scoring_test.go` asserts `card.StatusByType[\"open\"]` and `card.StatusByType[\"fixed\"]` directly.",
|
||||
"README promises resolution-state tracking, but this boundary is not type-safe."
|
||||
],
|
||||
"suggestion": "Change `Scorecard.StatusByType` to `map[Status]int` (or a dedicated typed struct), update serialization adapters if needed, and update tests to assert using `StatusOpen`/`StatusFixed` constants.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "test_strategy",
|
||||
"identifier": "brittle_private_and_copy_assertions_in_quality_tests",
|
||||
"summary": "Quality tests are tightly coupled to private helpers and exact copy text, reducing refactor safety.",
|
||||
"related_files": [
|
||||
"internal/quality/narrative_test.go",
|
||||
"internal/quality/scoring_test.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`narrative_test.go` directly asserts exact strings for generated headlines/actions and tests helper internals rather than stable external behavior.",
|
||||
"`scoring_test.go` anchors on specific internal weighting outputs and literal status strings, which can fail on benign internal redesigns."
|
||||
],
|
||||
"suggestion": "Shift to contract-level tests against exported APIs with invariant assertions (phase category, presence of required fields, monotonic score behavior), and keep only a small set of snapshot/copy tests for user-facing text.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "test_strategy",
|
||||
"identifier": "rust_parser_missing_negative_and_boundary_cases",
|
||||
"summary": "Rust parser tests miss malformed-input and degradation-path coverage.",
|
||||
"related_files": [
|
||||
"pkg/rustdocs/parser_test.go",
|
||||
"README.md"
|
||||
],
|
||||
"evidence": [
|
||||
"`parser_test.go` cases are successful parses with valid fixture HTML and only basic assertions.",
|
||||
"No tests verify behavior for malformed HTML, missing selectors, empty documents, or unsupported result rows.",
|
||||
"README positions docs ingestion as core functionality, so parser failure behavior is a critical path."
|
||||
],
|
||||
"suggestion": "Add table-driven negative tests for malformed/partial HTML, empty search blocks, and missing headings; assert stable fallback behavior (explicit error or safe zero-value output) for each parser entrypoint.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "single_edit"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "scorecard_variant_sprawl",
|
||||
"summary": "Scorecard generation is maintained as multiple copy-variants instead of one composable pipeline.",
|
||||
"related_files": [
|
||||
"cmd/devour_scorecard.py",
|
||||
"cmd/scorecard_generator.py",
|
||||
"cmd/devour_enhanced.py",
|
||||
"cmd/devour_enhanced_fixed.py",
|
||||
"cmd/devour_enhanced_v2.py"
|
||||
],
|
||||
"evidence": [
|
||||
"Both `cmd/devour_scorecard.py` and `cmd/scorecard_generator.py` declare the same major functions and data model in the same order with only minor stylistic deltas.",
|
||||
"Enhanced variants repeat the same section render functions and data loading flow, then diverge by ad-hoc edits, increasing change fan-out for any layout or scoring rule update."
|
||||
],
|
||||
"suggestion": "Extract a shared rendering core module (palette/fonts/layout primitives + data normalization), keep one canonical CLI entrypoint, and convert variant behavior into explicit theme/feature flags rather than duplicated files.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "external_scraper_template_duplication",
|
||||
"summary": "Provider scrapers repeat the same orchestration flow with per-provider copy/paste adapters.",
|
||||
"related_files": [
|
||||
"internal/scraper/external/astrodocs.go",
|
||||
"internal/scraper/external/cloudflaredocs.go",
|
||||
"internal/scraper/external/reactdocs.go",
|
||||
"internal/scraper/external/godocs.go",
|
||||
"internal/scraper/external/vuedocs.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Each scraper reimplements nearly identical `Scrape`, `DetectChanges`, `fetchPage`, and `generateHash` scaffolding, then inlines provider-specific conversion methods.",
|
||||
"The repeated constructor/client/parser wiring pattern appears across multiple files, indicating systemic pattern duplication rather than isolated differences."
|
||||
],
|
||||
"suggestion": "Introduce a shared `DocAdapter` contract and a generic `HTTPDocScraper` that owns fetch/hash/change-detect; keep provider files focused on mapping parsed domain objects to `Document`.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "utility_ownership_drift_in_lighthouse_script",
|
||||
"summary": "Duplicate utility definition in one file shows mixed responsibility boundaries.",
|
||||
"related_files": [
|
||||
"cmd/devour_lighthouse.py",
|
||||
"cmd/devour_enhanced.py"
|
||||
],
|
||||
"evidence": [
|
||||
"`cmd/devour_lighthouse.py` defines `load_font` twice with effectively the same fallback behavior, creating hidden override risk and unclear source of truth.",
|
||||
"Comparable font utility exists in other renderer scripts, reinforcing that shared utility concerns are spread instead of centralized."
|
||||
],
|
||||
"suggestion": "Remove the duplicate in `cmd/devour_lighthouse.py` and move font-loading helpers into a shared module imported by all renderer scripts.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "mixed_error_wrapping_in_scrape_and_search_paths",
|
||||
"summary": "Related scrape/search paths mix raw passthrough and contextual wrapping.",
|
||||
"related_files": [
|
||||
"internal/search/engine.go",
|
||||
"internal/scraper/openapi.go",
|
||||
"internal/scraper/localsearch.go",
|
||||
"cmd/scrape.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`internal/search/engine.go` frequently returns raw errors (`:114`, `:117`, `:122`, `:170`) but also uses contextual errors (`:111`, `:230`).",
|
||||
"`internal/scraper/openapi.go` propagates raw errors from `readSpec`/`parseOpenAPISpec` (`:45`, `:50`, `:123`, `:141`, `:149`, `:157`, `:164`) while also defining wrapped errors (`:135`, `:153`, `:217`).",
|
||||
"`internal/scraper/localsearch.go` returns raw errors from helper boundaries (`:79`, `:164`, `:191`, `:222`) mixed with rich wrapped messages in the same workflow (`:196`, `:203`, `:209`, `:217`)."
|
||||
],
|
||||
"suggestion": "Define a package-level rule: public methods must wrap downstream errors with operation context (using `%w`), and helper internals may return raw errors. Apply this consistently to `Rebuild/EnsureIndexed`, `OpenAPIScraper.Scrape/DetectChanges/readSpec`, and `LocalSearchScraper` methods.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "inconsistent_failure_channel_panic_vs_error_vs_warning",
|
||||
"summary": "Failure signaling varies between panic, error return, and warning-only logging.",
|
||||
"related_files": [
|
||||
"internal/quality/plugins/go/plugin.go",
|
||||
"internal/indexer/indexer.go",
|
||||
"cmd/scrape.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`internal/quality/plugins/go/plugin.go:363` panics on plugin registration failure.",
|
||||
"`internal/indexer/indexer.go:239` prints a warning and suppresses deletion errors instead of returning them.",
|
||||
"`cmd/scrape.go` is structured around returned errors (`:131`, `:145`, `:207`) and has no panic-based handling, creating inconsistent contracts across subsystems."
|
||||
],
|
||||
"suggestion": "Standardize on explicit error returns for recoverable startup/runtime failures; replace plugin `panic` with registration error propagation or controlled process-exit at the command entrypoint, and make indexer deletion behavior explicit (either aggregate and return partial-failure errors or document/encode best-effort mode).",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "command_boundary_context_loss",
|
||||
"summary": "CLI command boundaries sometimes return raw errors without command context.",
|
||||
"related_files": [
|
||||
"cmd/get.go",
|
||||
"cmd/scrape.go",
|
||||
"internal/config/config.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`cmd/get.go:59` and `cmd/scrape.go:90`/`:125` return raw errors directly from downstream calls.",
|
||||
"Other branches in the same command wrap with explicit context (`cmd/scrape.go:131`, `cmd/scrape.go:145`, `cmd/scrape.go:154`).",
|
||||
"Config layer already emits contextual wrapped errors (`internal/config/config.go:177`, `internal/config/config.go:181`), so command-layer inconsistency creates uneven user-facing diagnostics."
|
||||
],
|
||||
"suggestion": "At CLI entrypoints, wrap all returned downstream errors with command/action context (e.g., `run get`, `load config`, `scrape source`) and preserve root cause with `%w`; keep user-readable validation errors as direct messages.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "cross_module_architecture",
|
||||
"identifier": "init_side_effect_registration_coupling",
|
||||
"summary": "Scraper registration depends on import-time side effects and global mutable registry state.",
|
||||
"related_files": [
|
||||
"cmd/root.go",
|
||||
"internal/scraper/external/register.go",
|
||||
"internal/scraper/registry_simple.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Blank import in root command triggers registration implicitly rather than explicit bootstrap wiring.",
|
||||
"Registration happens in `init()` and mutates shared global registry."
|
||||
],
|
||||
"suggestion": "Replace import-time registration with explicit bootstrap registration (e.g., `RegisterExternalScrapers()` called from startup), and pass registry instances through constructors to remove hidden global coupling.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "mixed_process_termination_and_error_propagation",
|
||||
"summary": "Error handling mixes panic/log.Fatal/os.Exit with returned errors across adjacent layers.",
|
||||
"related_files": [
|
||||
"cmd/root.go",
|
||||
"cmd/scorecard.go",
|
||||
"internal/quality/plugins/go/plugin.go",
|
||||
"cleanup_unused.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`Execute()` exits process directly; scorecard helper exits inside utility flow; plugin registration panics on failure.",
|
||||
"Most other command paths return wrapped errors, creating inconsistent failure semantics."
|
||||
],
|
||||
"suggestion": "Standardize on returning errors from library/command internals and only perform process exit in one top-level entrypoint; replace panic/log.Fatal in shared code with typed/wrapped errors.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "external_scraper_boilerplate_without_shared_base",
|
||||
"summary": "External scraper implementations duplicate fetch/hash/error/document plumbing instead of sharing a base abstraction.",
|
||||
"related_files": [
|
||||
"internal/scraper/external/godocs.go",
|
||||
"internal/scraper/external/rustdocs.go",
|
||||
"internal/scraper/external/reactdocs.go",
|
||||
"internal/scraper/external/nuxtdocs.go",
|
||||
"internal/scraper/external/cloudflaredocs.go",
|
||||
"internal/scraper/external/types.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Each scraper repeats `fetchPage`, status code checks, hash generation, and near-identical scrape control flow.",
|
||||
"Alias-only types file adds indirection without behavior."
|
||||
],
|
||||
"suggestion": "Introduce a shared external-scraper base/helper for HTTP fetch, retries, hashing, and common error mapping; keep only parser-specific extraction and document shaping in each language scraper.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "test_strategy",
|
||||
"identifier": "untested_unimplemented_runtime_paths",
|
||||
"summary": "Core runtime paths are both under-tested and partially stubbed, leaving high-risk behavior unvalidated.",
|
||||
"related_files": [
|
||||
"internal/server/server.go",
|
||||
"pkg/client/client.go",
|
||||
"internal/vector/store.go",
|
||||
"internal/search/engine.go",
|
||||
"internal/indexer/indexer.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Server/client/store contain TODO or not-implemented branches without direct tests.",
|
||||
"No direct test files exist for several core modules that govern querying, indexing, and serving."
|
||||
],
|
||||
"suggestion": "Add table-driven tests for client/server/store/indexer contracts first (error behavior and non-nil results), then implement missing paths behind those tests; prioritize integration tests that exercise scrape->index->query flow.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "command_files_mix_multiple_responsibilities",
|
||||
"summary": "Large CLI command files blend orchestration, domain logic, persistence, and formatting concerns.",
|
||||
"related_files": [
|
||||
"cmd/quality.go",
|
||||
"cmd/scrape.go",
|
||||
"cmd/ask.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`cmd/quality.go` combines scan setup, scoring/status persistence, resolve/fix/review workflows.",
|
||||
"`cmd/scrape.go` combines config parsing, source detection/profiling, scrape execution, indexing, and source-state updates.",
|
||||
"`cmd/ask.go` includes query derivation, source URL heuristics, ranking, summarization, and output formatting in one command module."
|
||||
],
|
||||
"suggestion": "Split command files into focused packages (transport/CLI binding vs service layer vs persistence helpers) and keep Cobra handlers as thin adapters invoking composable use-case functions.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
}
|
||||
],
|
||||
"review_quality": {
|
||||
"batch_count": 6,
|
||||
"dimension_coverage": 0.367,
|
||||
"evidence_density": 2.167,
|
||||
"high_score_without_risk": 0,
|
||||
"finding_pressure": 49.296,
|
||||
"dimensions_with_findings": 5
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
You are a focused subagent reviewer for a single holistic investigation batch.
|
||||
|
||||
Repository root: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour
|
||||
Immutable packet: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour/.desloppify/review_packets/holistic_packet_20260223_100953.json
|
||||
Batch index: 1
|
||||
Batch name: Architecture & Coupling
|
||||
Batch dimensions: cross_module_architecture
|
||||
Batch rationale: god modules, import-time side effects
|
||||
|
||||
Files assigned:
|
||||
- internal/quality/enhanced_types.go
|
||||
- internal/quality/narrative_test.go
|
||||
- internal/quality/scoring_test.go
|
||||
- internal/quality/types.go
|
||||
- pkg/rustdocs/parser_test.go
|
||||
|
||||
Task requirements:
|
||||
1. Read the immutable packet and follow `system_prompt` constraints exactly.
|
||||
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
||||
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
||||
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
||||
5. Every finding must include `related_files` with at least 2 files when possible.
|
||||
6. Every finding must include `impact_scope` and `fix_scope`.
|
||||
7. Every scored dimension MUST include dimension_notes with concrete evidence.
|
||||
8. If a dimension score is >85, include `unreported_risk` in dimension_notes.
|
||||
9. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
||||
10. Do not edit repository files.
|
||||
11. Return ONLY valid JSON, no markdown fences.
|
||||
|
||||
Scope enums:
|
||||
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
||||
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
||||
|
||||
Output schema:
|
||||
{
|
||||
"batch": "Architecture & Coupling",
|
||||
"batch_index": 1,
|
||||
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
||||
"dimension_notes": {
|
||||
"<dimension>": {
|
||||
"evidence": ["specific code observations"],
|
||||
"impact_scope": "local|module|subsystem|codebase",
|
||||
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
||||
"confidence": "high|medium|low",
|
||||
"unreported_risk": "required when score >85",
|
||||
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
||||
}
|
||||
},
|
||||
"findings": []
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
You are a focused subagent reviewer for a single holistic investigation batch.
|
||||
|
||||
Repository root: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour
|
||||
Immutable packet: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour/.desloppify/review_packets/holistic_packet_20260223_100953.json
|
||||
Batch index: 2
|
||||
Batch name: Abstractions & Dependencies
|
||||
Batch dimensions: abstraction_fitness
|
||||
Batch rationale: abstraction hotspots (wrappers/interfaces/param bags), dep cycles
|
||||
|
||||
Files assigned:
|
||||
- cmd/scrape.go
|
||||
- internal/quality/plugins/go/analyzers/detectors.go
|
||||
- internal/quality/plugins/go/analyzers/advanced.go
|
||||
- internal/scraper/web.go
|
||||
- internal/quality/plugins/go/plugin.go
|
||||
- internal/scheduler/scheduler.go
|
||||
- cmd/init.go
|
||||
- internal/scraper/localsearch_test.go
|
||||
- internal/config/config.go
|
||||
- internal/ai/openai.go
|
||||
- cmd/get.go
|
||||
- cmd/get_test.go
|
||||
- internal/quality/analyzers/controlflow.go
|
||||
- internal/vector/store.go
|
||||
- cmd/ask.go
|
||||
- examples/demo_scrapers.go
|
||||
- internal/indexer/indexer.go
|
||||
- internal/scraper/openapi.go
|
||||
- pkg/pythondocs/parser.go
|
||||
- internal/quality/analyzers/dataflow.go
|
||||
- internal/quality/scanner_test.go
|
||||
- internal/server/server.go
|
||||
- internal/scraper/localsearch.go
|
||||
- internal/scraper/external/nuxtdocs.go
|
||||
- internal/quality/plugins/go/analyzers/test_coverage.go
|
||||
- internal/search/engine.go
|
||||
- internal/scraper/external/astrodocs.go
|
||||
- internal/scraper/external/cloudflaredocs.go
|
||||
- internal/scraper/external/dockerdocs.go
|
||||
- internal/scraper/external/godocs.go
|
||||
- internal/scraper/external/javadocs.go
|
||||
- internal/scraper/external/mcpdocs.go
|
||||
|
||||
Task requirements:
|
||||
1. Read the immutable packet and follow `system_prompt` constraints exactly.
|
||||
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
||||
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
||||
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
||||
5. Every finding must include `related_files` with at least 2 files when possible.
|
||||
6. Every finding must include `impact_scope` and `fix_scope`.
|
||||
7. Every scored dimension MUST include dimension_notes with concrete evidence.
|
||||
8. If a dimension score is >85, include `unreported_risk` in dimension_notes.
|
||||
9. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
||||
10. Do not edit repository files.
|
||||
11. Return ONLY valid JSON, no markdown fences.
|
||||
|
||||
Scope enums:
|
||||
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
||||
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
||||
|
||||
Output schema:
|
||||
{
|
||||
"batch": "Abstractions & Dependencies",
|
||||
"batch_index": 2,
|
||||
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
||||
"dimension_notes": {
|
||||
"<dimension>": {
|
||||
"evidence": ["specific code observations"],
|
||||
"impact_scope": "local|module|subsystem|codebase",
|
||||
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
||||
"confidence": "high|medium|low",
|
||||
"unreported_risk": "required when score >85",
|
||||
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
||||
}
|
||||
},
|
||||
"findings": []
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
You are a focused subagent reviewer for a single holistic investigation batch.
|
||||
|
||||
Repository root: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour
|
||||
Immutable packet: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour/.desloppify/review_packets/holistic_packet_20260223_100953.json
|
||||
Batch index: 3
|
||||
Batch name: Governance & Contracts
|
||||
Batch dimensions: cross_module_architecture, test_strategy
|
||||
Batch rationale: architecture contracts, compatibility policy, docs-vs-runtime scope, and quality-gate coverage
|
||||
|
||||
Files assigned:
|
||||
- README.md
|
||||
- internal/quality/enhanced_types.go
|
||||
- internal/quality/narrative_test.go
|
||||
- internal/quality/scoring_test.go
|
||||
- internal/quality/types.go
|
||||
- pkg/rustdocs/parser_test.go
|
||||
|
||||
Task requirements:
|
||||
1. Read the immutable packet and follow `system_prompt` constraints exactly.
|
||||
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
||||
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
||||
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
||||
5. Every finding must include `related_files` with at least 2 files when possible.
|
||||
6. Every finding must include `impact_scope` and `fix_scope`.
|
||||
7. Every scored dimension MUST include dimension_notes with concrete evidence.
|
||||
8. If a dimension score is >85, include `unreported_risk` in dimension_notes.
|
||||
9. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
||||
10. Do not edit repository files.
|
||||
11. Return ONLY valid JSON, no markdown fences.
|
||||
|
||||
Scope enums:
|
||||
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
||||
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
||||
|
||||
Output schema:
|
||||
{
|
||||
"batch": "Governance & Contracts",
|
||||
"batch_index": 3,
|
||||
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
||||
"dimension_notes": {
|
||||
"<dimension>": {
|
||||
"evidence": ["specific code observations"],
|
||||
"impact_scope": "local|module|subsystem|codebase",
|
||||
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
||||
"confidence": "high|medium|low",
|
||||
"unreported_risk": "required when score >85",
|
||||
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
||||
}
|
||||
},
|
||||
"findings": []
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
You are a focused subagent reviewer for a single holistic investigation batch.
|
||||
|
||||
Repository root: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour
|
||||
Immutable packet: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour/.desloppify/review_packets/holistic_packet_20260223_100953.json
|
||||
Batch index: 4
|
||||
Batch name: Design Coherence — Mechanical Concern Signals
|
||||
Batch dimensions: design_coherence
|
||||
Batch rationale: mechanical detectors identified structural patterns needing judgment; concern types: duplication_design, mixed_responsibilities, systemic_pattern
|
||||
|
||||
Files assigned:
|
||||
- .desloppify/query.json
|
||||
- .github/workflows/ci.yml
|
||||
- AGENTS.md
|
||||
- cmd/devour_enhanced.py
|
||||
- cmd/devour_enhanced_fixed.py
|
||||
- cmd/devour_enhanced_v2.py
|
||||
- cmd/devour_lighthouse.py
|
||||
- cmd/devour_scorecard.py
|
||||
- cmd/quality.go
|
||||
- cmd/scorecard_generator.py
|
||||
- desloppify/desloppify/desloppify/app/commands/_show_terminal.py
|
||||
- desloppify/desloppify/desloppify/app/commands/fix/apply_flow.py
|
||||
- desloppify/desloppify/desloppify/app/commands/issues_cmd.py
|
||||
- desloppify/desloppify/desloppify/app/commands/next.py
|
||||
- desloppify/desloppify/desloppify/app/commands/resolve/selection.py
|
||||
- desloppify/desloppify/desloppify/app/commands/scan/scan_reporting_llm.py
|
||||
- desloppify/desloppify/desloppify/app/commands/status_parts/render.py
|
||||
- desloppify/desloppify/desloppify/app/output/scorecard_parts/projection.py
|
||||
- desloppify/desloppify/desloppify/engine/detectors/security/rules.py
|
||||
- desloppify/desloppify/desloppify/engine/scoring_internal/subjective/core.py
|
||||
- desloppify/desloppify/desloppify/engine/state_internal/resolution.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/__init__.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/context_internal/structure.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/dimensions/data.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/importing/holistic.py
|
||||
- desloppify/desloppify/desloppify/languages/_shared/phases_common.py
|
||||
- desloppify/desloppify/desloppify/languages/_shared/review_data/dimensions.json
|
||||
- desloppify/desloppify/desloppify/languages/_shared/scaffold_detect_commands.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/_parse_helpers.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/commands.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/deps/cli.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/deps/fallback.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/detectors/deps.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/phases.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/test_coverage.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/__init__.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/commands.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/detectors/deps.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/extractors.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/move.py
|
||||
- desloppify/desloppify/desloppify/languages/framework/commands_base.py
|
||||
- desloppify/desloppify/desloppify/languages/gdscript/__init__.py
|
||||
- desloppify/desloppify/desloppify/languages/gdscript/detectors/deps.py
|
||||
- desloppify/desloppify/desloppify/languages/python/__init__.py
|
||||
- desloppify/desloppify/desloppify/languages/python/commands.py
|
||||
- desloppify/desloppify/desloppify/languages/python/detectors/security.py
|
||||
- desloppify/desloppify/desloppify/languages/python/detectors/smells.py
|
||||
- desloppify/desloppify/desloppify/languages/python/move.py
|
||||
- desloppify/desloppify/desloppify/languages/python/phases.py
|
||||
- desloppify/desloppify/desloppify/languages/python/test_coverage.py
|
||||
- desloppify/desloppify/desloppify/languages/python/tests/test_py_facade.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/detectors/_smell_detectors.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/detectors/_smell_effects.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/detectors/deps.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/detectors/exports.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/detectors/react.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/detectors/unused.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/fixers/common.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/fixers/if_chain.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/fixers/logs.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_concerns.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_deprecated.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_deps.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_exports.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_fixers.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_logs.py
|
||||
- desloppify/desloppify/desloppify/languages/typescript/tests/test_ts_react.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/fix/test_cmd_fix_review.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/test_cmd_detect.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/test_cmd_fix.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/test_cmd_next.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/test_cmd_scan.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/test_cmd_show.py
|
||||
- desloppify/desloppify/desloppify/tests/commands/test_config_cmd.py
|
||||
- desloppify/desloppify/desloppify/tests/detectors/test_architecture_boundaries.py
|
||||
- desloppify/desloppify/desloppify/tests/detectors/test_complexity.py
|
||||
- desloppify/desloppify/desloppify/tests/detectors/test_coupling.py
|
||||
- desloppify/desloppify/desloppify/tests/detectors/test_gods.py
|
||||
- desloppify/desloppify/desloppify/tests/detectors/test_naming.py
|
||||
- desloppify/desloppify/desloppify/tests/detectors/test_orphaned.py
|
||||
- desloppify/desloppify/desloppify/tests/lang/common/test_lang_contract_validation.py
|
||||
- desloppify/desloppify/desloppify/tests/lang/csharp/test_csharp_deps.py
|
||||
- desloppify/desloppify/desloppify/tests/lang/csharp/test_csharp_scan.py
|
||||
- desloppify/desloppify/desloppify/tests/lang/dart/test_dart_deps.py
|
||||
- desloppify/desloppify/desloppify/tests/review/test_review_coverage.py
|
||||
- desloppify/desloppify/desloppify/tests/review/test_review_dimensions_direct.py
|
||||
- desloppify/desloppify/desloppify/tests/review/test_work_queue.py
|
||||
- desloppify/desloppify/desloppify/tests/scan/test_flat_dirs.py
|
||||
- desloppify/desloppify/desloppify/tests/scan/test_scan_reporting_direct.py
|
||||
- desloppify/desloppify/desloppify/tests/scan/test_scan_workflow_wontfix_direct.py
|
||||
- desloppify/desloppify/desloppify/tests/scoring/test_scorecard.py
|
||||
- desloppify/desloppify/desloppify/tests/scoring/test_scorecard_draw_direct.py
|
||||
- desloppify/desloppify/desloppify/tests/snapshots/cli_smoke/state-python.json
|
||||
- desloppify/desloppify/desloppify/tests/state/test_state.py
|
||||
- desloppify/desloppify/desloppify/tests/state/test_state_internal_direct.py
|
||||
- devour_data/docs/docker_compose_-_ask_me_about_docker_1.md
|
||||
- devour_data/docs/docker_compose_-_browse_common_faqs_10.md
|
||||
- devour_data/docs/docker_compose_-_docker_compose_2.md
|
||||
- devour_data/docs/docker_compose_-_explore_the_compose_file_referenc_8.md
|
||||
- devour_data/docs/docker_compose_-_how_compose_works_4.md
|
||||
- devour_data/docs/docker_compose_-_install_compose_5.md
|
||||
- devour_data/docs/docker_compose_-_use_compose_bridge_9.md
|
||||
- internal/ai/openai.go
|
||||
- internal/quality/analyzers/dataflow.go
|
||||
- internal/quality/detector_test.go
|
||||
- internal/quality/detectors/complexity.go
|
||||
- internal/quality/languages.go
|
||||
- internal/quality/languages_test.go
|
||||
- internal/quality/narrative_test.go
|
||||
- internal/quality/plugins/go/analyzers/deadcode.go
|
||||
- internal/quality/plugins/go/analyzers/detectors.go
|
||||
- internal/quality/plugins/go/analyzers/security.go
|
||||
- internal/quality/plugins/go/analyzers/test_coverage.go
|
||||
- internal/quality/plugins/go/fixers/advanced_fixers.go
|
||||
- internal/quality/plugins/go/fixers/fixers.go
|
||||
- internal/quality/scoring_test.go
|
||||
- internal/quality/state_test.go
|
||||
- internal/scraper/external/astrodocs.go
|
||||
- internal/scraper/external/cloudflaredocs.go
|
||||
- internal/scraper/external/godocs.go
|
||||
- internal/scraper/external/javadocs.go
|
||||
- internal/scraper/external/nuxtdocs.go
|
||||
- internal/scraper/external/pythondocs.go
|
||||
- internal/scraper/external/reactdocs.go
|
||||
- internal/scraper/external/rustdocs.go
|
||||
- internal/scraper/external/springdocs.go
|
||||
- internal/scraper/external/vuedocs.go
|
||||
- internal/scraper/localsearch_test.go
|
||||
- internal/scraper/web.go
|
||||
- internal/scraper/web_integration_test.go
|
||||
- landing/dist/index.html
|
||||
- landing/src/components/sections/Footer.tsx
|
||||
- landing/src/index.css
|
||||
- pkg/astrodocs/parser.go
|
||||
- pkg/astrodocs/parser_test.go
|
||||
- pkg/cloudflaredocs/parser.go
|
||||
- pkg/cloudflaredocs/parser_test.go
|
||||
- pkg/dockerdocs/parser.go
|
||||
- pkg/godocs/parser.go
|
||||
- pkg/godocs/parser_test.go
|
||||
- pkg/javadocs/parser.go
|
||||
- pkg/javadocs/parser_test.go
|
||||
- pkg/nuxtdocs/parser.go
|
||||
- pkg/nuxtdocs/parser_test.go
|
||||
- pkg/nuxtdocs/types.go
|
||||
- pkg/pythondocs/parser.go
|
||||
- pkg/pythondocs/parser_test.go
|
||||
- pkg/reactdocs/parser.go
|
||||
- pkg/rustdocs/parser.go
|
||||
- pkg/springdocs/parser.go
|
||||
- pkg/vuedocs/parser.go
|
||||
|
||||
Task requirements:
|
||||
1. Read the immutable packet and follow `system_prompt` constraints exactly.
|
||||
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
||||
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
||||
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
||||
5. Every finding must include `related_files` with at least 2 files when possible.
|
||||
6. Every finding must include `impact_scope` and `fix_scope`.
|
||||
7. Every scored dimension MUST include dimension_notes with concrete evidence.
|
||||
8. If a dimension score is >85, include `unreported_risk` in dimension_notes.
|
||||
9. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
||||
10. Do not edit repository files.
|
||||
11. Return ONLY valid JSON, no markdown fences.
|
||||
|
||||
Scope enums:
|
||||
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
||||
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
||||
|
||||
Output schema:
|
||||
{
|
||||
"batch": "Design Coherence — Mechanical Concern Signals",
|
||||
"batch_index": 4,
|
||||
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
||||
"dimension_notes": {
|
||||
"<dimension>": {
|
||||
"evidence": ["specific code observations"],
|
||||
"impact_scope": "local|module|subsystem|codebase",
|
||||
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
||||
"confidence": "high|medium|low",
|
||||
"unreported_risk": "required when score >85",
|
||||
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
||||
}
|
||||
},
|
||||
"findings": []
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
You are a focused subagent reviewer for a single holistic investigation batch.
|
||||
|
||||
Repository root: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour
|
||||
Immutable packet: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour/.desloppify/review_packets/holistic_packet_20260223_100953.json
|
||||
Batch index: 5
|
||||
Batch name: Cross-cutting Sweep
|
||||
Batch dimensions: error_consistency
|
||||
Batch rationale: selected dimensions had no direct batch mapping; review representative cross-cutting files
|
||||
|
||||
Files assigned:
|
||||
- internal/quality/enhanced_types.go
|
||||
- internal/quality/narrative_test.go
|
||||
- internal/quality/scoring_test.go
|
||||
- internal/quality/types.go
|
||||
- pkg/rustdocs/parser_test.go
|
||||
- cmd/scrape.go
|
||||
- internal/quality/plugins/go/analyzers/detectors.go
|
||||
- internal/quality/plugins/go/analyzers/advanced.go
|
||||
- internal/scraper/web.go
|
||||
- internal/quality/plugins/go/plugin.go
|
||||
- internal/scheduler/scheduler.go
|
||||
- cmd/init.go
|
||||
- internal/scraper/localsearch_test.go
|
||||
- internal/config/config.go
|
||||
- internal/ai/openai.go
|
||||
- cmd/get.go
|
||||
- cmd/get_test.go
|
||||
- internal/quality/analyzers/controlflow.go
|
||||
- internal/vector/store.go
|
||||
- cmd/ask.go
|
||||
- examples/demo_scrapers.go
|
||||
- internal/indexer/indexer.go
|
||||
- internal/scraper/openapi.go
|
||||
- pkg/pythondocs/parser.go
|
||||
- internal/quality/analyzers/dataflow.go
|
||||
- internal/quality/scanner_test.go
|
||||
- internal/server/server.go
|
||||
- internal/scraper/localsearch.go
|
||||
- internal/scraper/external/nuxtdocs.go
|
||||
- internal/quality/plugins/go/analyzers/test_coverage.go
|
||||
- internal/search/engine.go
|
||||
- internal/scraper/external/astrodocs.go
|
||||
- internal/scraper/external/cloudflaredocs.go
|
||||
- internal/scraper/external/dockerdocs.go
|
||||
- internal/scraper/external/godocs.go
|
||||
- internal/scraper/external/javadocs.go
|
||||
- internal/scraper/external/mcpdocs.go
|
||||
- README.md
|
||||
- .desloppify/query.json
|
||||
- .github/workflows/ci.yml
|
||||
- AGENTS.md
|
||||
- cmd/devour_enhanced.py
|
||||
- cmd/devour_enhanced_fixed.py
|
||||
- cmd/devour_enhanced_v2.py
|
||||
- cmd/devour_lighthouse.py
|
||||
- cmd/devour_scorecard.py
|
||||
- cmd/quality.go
|
||||
- cmd/scorecard_generator.py
|
||||
- desloppify/desloppify/desloppify/app/commands/_show_terminal.py
|
||||
- desloppify/desloppify/desloppify/app/commands/fix/apply_flow.py
|
||||
- desloppify/desloppify/desloppify/app/commands/issues_cmd.py
|
||||
- desloppify/desloppify/desloppify/app/commands/next.py
|
||||
- desloppify/desloppify/desloppify/app/commands/resolve/selection.py
|
||||
- desloppify/desloppify/desloppify/app/commands/scan/scan_reporting_llm.py
|
||||
- desloppify/desloppify/desloppify/app/commands/status_parts/render.py
|
||||
- desloppify/desloppify/desloppify/app/output/scorecard_parts/projection.py
|
||||
- desloppify/desloppify/desloppify/engine/detectors/security/rules.py
|
||||
- desloppify/desloppify/desloppify/engine/scoring_internal/subjective/core.py
|
||||
- desloppify/desloppify/desloppify/engine/state_internal/resolution.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/__init__.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/context_internal/structure.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/dimensions/data.py
|
||||
- desloppify/desloppify/desloppify/intelligence/review/importing/holistic.py
|
||||
- desloppify/desloppify/desloppify/languages/_shared/phases_common.py
|
||||
- desloppify/desloppify/desloppify/languages/_shared/review_data/dimensions.json
|
||||
- desloppify/desloppify/desloppify/languages/_shared/scaffold_detect_commands.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/_parse_helpers.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/commands.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/deps/cli.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/deps/fallback.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/detectors/deps.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/phases.py
|
||||
- desloppify/desloppify/desloppify/languages/csharp/test_coverage.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/__init__.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/commands.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/detectors/deps.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/extractors.py
|
||||
- desloppify/desloppify/desloppify/languages/dart/move.py
|
||||
- desloppify/desloppify/desloppify/languages/framework/commands_base.py
|
||||
- desloppify/desloppify/desloppify/languages/gdscript/__init__.py
|
||||
|
||||
Task requirements:
|
||||
1. Read the immutable packet and follow `system_prompt` constraints exactly.
|
||||
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
||||
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
||||
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
||||
5. Every finding must include `related_files` with at least 2 files when possible.
|
||||
6. Every finding must include `impact_scope` and `fix_scope`.
|
||||
7. Every scored dimension MUST include dimension_notes with concrete evidence.
|
||||
8. If a dimension score is >85, include `unreported_risk` in dimension_notes.
|
||||
9. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
||||
10. Do not edit repository files.
|
||||
11. Return ONLY valid JSON, no markdown fences.
|
||||
|
||||
Scope enums:
|
||||
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
||||
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
||||
|
||||
Output schema:
|
||||
{
|
||||
"batch": "Cross-cutting Sweep",
|
||||
"batch_index": 5,
|
||||
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
||||
"dimension_notes": {
|
||||
"<dimension>": {
|
||||
"evidence": ["specific code observations"],
|
||||
"impact_scope": "local|module|subsystem|codebase",
|
||||
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
||||
"confidence": "high|medium|low",
|
||||
"unreported_risk": "required when score >85",
|
||||
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
||||
}
|
||||
},
|
||||
"findings": []
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
You are a focused subagent reviewer for a single holistic investigation batch.
|
||||
|
||||
Repository root: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour
|
||||
Immutable packet: /home/tdvorak/Desktop/PROG_projekty/GOLANG/Devour/.desloppify/review_packets/holistic_packet_20260223_100953.json
|
||||
Batch index: 6
|
||||
Batch name: Full Codebase Sweep
|
||||
Batch dimensions: cross_module_architecture, error_consistency, abstraction_fitness, test_strategy, design_coherence
|
||||
Batch rationale: thorough default: evaluate cross-cutting quality across all production files
|
||||
|
||||
Files assigned:
|
||||
- cleanup_unused.go
|
||||
- cmd/ask.go
|
||||
- cmd/demo.go
|
||||
- cmd/devour/main.go
|
||||
- cmd/generate_scorecards/main.go
|
||||
- cmd/get.go
|
||||
- cmd/init.go
|
||||
- cmd/languages.go
|
||||
- cmd/push.go
|
||||
- cmd/quality.go
|
||||
- cmd/query.go
|
||||
- cmd/realtest/main.go
|
||||
- cmd/root.go
|
||||
- cmd/runtime_helpers.go
|
||||
- cmd/scorecard.go
|
||||
- cmd/scrape.go
|
||||
- cmd/serve.go
|
||||
- cmd/status.go
|
||||
- cmd/sync.go
|
||||
- examples/demo_scrapers.go
|
||||
- internal/ai/ai.go
|
||||
- internal/ai/openai.go
|
||||
- internal/config/config.go
|
||||
- internal/indexer/indexer.go
|
||||
- internal/markdown/formatter.go
|
||||
- internal/projectstate/state.go
|
||||
- internal/quality/analyzers/controlflow.go
|
||||
- internal/quality/analyzers/dataflow.go
|
||||
- internal/quality/analyzers/practices.go
|
||||
- internal/quality/detector.go
|
||||
- internal/quality/detectors/complexity.go
|
||||
- internal/quality/detectors/duplication.go
|
||||
- internal/quality/detectors/naming.go
|
||||
- internal/quality/enhanced_types.go
|
||||
- internal/quality/languages.go
|
||||
- internal/quality/narrative.go
|
||||
- internal/quality/plugins/go/analyzers/advanced.go
|
||||
- internal/quality/plugins/go/analyzers/deadcode.go
|
||||
- internal/quality/plugins/go/analyzers/detectors.go
|
||||
- internal/quality/plugins/go/analyzers/security.go
|
||||
- internal/quality/plugins/go/analyzers/test_coverage.go
|
||||
- internal/quality/plugins/go/fixers/advanced_fixers.go
|
||||
- internal/quality/plugins/go/fixers/fixers.go
|
||||
- internal/quality/plugins/go/plugin.go
|
||||
- internal/quality/plugins/plugin.go
|
||||
- internal/quality/plugins/registry.go
|
||||
- internal/quality/review/packet.go
|
||||
- internal/quality/scanner.go
|
||||
- internal/quality/scoring.go
|
||||
- internal/quality/state.go
|
||||
- internal/quality/types.go
|
||||
- internal/scheduler/scheduler.go
|
||||
- internal/scraper/external/astrodocs.go
|
||||
- internal/scraper/external/cloudflaredocs.go
|
||||
- internal/scraper/external/dockerdocs.go
|
||||
- internal/scraper/external/godocs.go
|
||||
- internal/scraper/external/javadocs.go
|
||||
- internal/scraper/external/mcpdocs.go
|
||||
- internal/scraper/external/nuxtdocs.go
|
||||
- internal/scraper/external/pythondocs.go
|
||||
- internal/scraper/external/reactdocs.go
|
||||
- internal/scraper/external/register.go
|
||||
- internal/scraper/external/rustdocs.go
|
||||
- internal/scraper/external/springdocs.go
|
||||
- internal/scraper/external/tsdocs.go
|
||||
- internal/scraper/external/types.go
|
||||
- internal/scraper/external/vuedocs.go
|
||||
- internal/scraper/github.go
|
||||
- internal/scraper/local.go
|
||||
- internal/scraper/localsearch.go
|
||||
- internal/scraper/normalize.go
|
||||
- internal/scraper/openapi.go
|
||||
- internal/scraper/register_core.go
|
||||
- internal/scraper/registry_simple.go
|
||||
- internal/scraper/scraper.go
|
||||
- internal/scraper/web.go
|
||||
- internal/scraper/wrapper.go
|
||||
- internal/search/engine.go
|
||||
- internal/server/server.go
|
||||
- internal/storage/writer.go
|
||||
- internal/ui/banner.go
|
||||
- internal/ui/character.go
|
||||
- internal/vector/store.go
|
||||
- main.go
|
||||
- pkg/astrodocs/parser.go
|
||||
- pkg/astrodocs/types.go
|
||||
- pkg/client/client.go
|
||||
- pkg/cloudflaredocs/parser.go
|
||||
- pkg/cloudflaredocs/types.go
|
||||
- pkg/dockerdocs/parser.go
|
||||
- pkg/dockerdocs/types.go
|
||||
- pkg/godocs/parser.go
|
||||
- pkg/godocs/types.go
|
||||
- pkg/javadocs/parser.go
|
||||
- pkg/javadocs/types.go
|
||||
- pkg/mcpdocs/parser.go
|
||||
- pkg/mcpdocs/types.go
|
||||
- pkg/nuxtdocs/parser.go
|
||||
- pkg/nuxtdocs/types.go
|
||||
- pkg/parserutil/url.go
|
||||
- pkg/pythondocs/parser.go
|
||||
- pkg/pythondocs/types.go
|
||||
- pkg/reactdocs/parser.go
|
||||
- pkg/reactdocs/types.go
|
||||
- pkg/rustdocs/parser.go
|
||||
- pkg/rustdocs/types.go
|
||||
- pkg/springdocs/parser.go
|
||||
- pkg/springdocs/types.go
|
||||
- pkg/tsdocs/parser.go
|
||||
- pkg/tsdocs/types.go
|
||||
- pkg/types/types.go
|
||||
- pkg/vuedocs/parser.go
|
||||
- pkg/vuedocs/types.go
|
||||
|
||||
Task requirements:
|
||||
1. Read the immutable packet and follow `system_prompt` constraints exactly.
|
||||
2. Evaluate ONLY listed files and ONLY listed dimensions for this batch.
|
||||
3. Return 0-10 high-quality findings for this batch (empty array allowed).
|
||||
4. Score/finding consistency is required: broader or more severe findings MUST lower dimension scores.
|
||||
5. Every finding must include `related_files` with at least 2 files when possible.
|
||||
6. Every finding must include `impact_scope` and `fix_scope`.
|
||||
7. Every scored dimension MUST include dimension_notes with concrete evidence.
|
||||
8. If a dimension score is >85, include `unreported_risk` in dimension_notes.
|
||||
9. Use exactly one decimal place for every assessment and abstraction sub-axis score.
|
||||
10. Do not edit repository files.
|
||||
11. Return ONLY valid JSON, no markdown fences.
|
||||
|
||||
Scope enums:
|
||||
- impact_scope: "local" | "module" | "subsystem" | "codebase"
|
||||
- fix_scope: "single_edit" | "multi_file_refactor" | "architectural_change"
|
||||
|
||||
Output schema:
|
||||
{
|
||||
"batch": "Full Codebase Sweep",
|
||||
"batch_index": 6,
|
||||
"assessments": {"<dimension>": <0-100 with one decimal place>},
|
||||
"dimension_notes": {
|
||||
"<dimension>": {
|
||||
"evidence": ["specific code observations"],
|
||||
"impact_scope": "local|module|subsystem|codebase",
|
||||
"fix_scope": "single_edit|multi_file_refactor|architectural_change",
|
||||
"confidence": "high|medium|low",
|
||||
"unreported_risk": "required when score >85",
|
||||
"sub_axes": {"abstraction_leverage": 0-100 with one decimal place, "indirection_cost": 0-100 with one decimal place, "interface_honesty": 0-100 with one decimal place} // required for abstraction_fitness when evidence supports it
|
||||
}
|
||||
},
|
||||
"findings": []
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"batch":"Architecture & Coupling","batch_index":1,"assessments":{"cross_module_architecture":100.0},"dimension_notes":{"cross_module_architecture":{"evidence":["All assigned `internal/quality/*.go` files stay within a single package boundary (`package quality`) and only import standard library packages (`time`, `testing`, `strings`), with no cross-package dependency fan-out from this slice.","`pkg/rustdocs/parser_test.go` is isolated to `package rustdocs` and imports only stdlib plus `github.com/PuerkitoBio/goquery`; it does not couple into `internal/quality` types or helpers.","No `init()` functions, package-level mutable singleton wiring, or import-time execution patterns were found in the reviewed files; behavior is test-function scoped and constructor-invoked (`NewParser`, `NewScorer`, `NewNarrativeGenerator`).","Type declarations in `internal/quality/types.go` and `internal/quality/enhanced_types.go` are cohesive data-model definitions within one module boundary rather than cross-module shims or compatibility layers."],"impact_scope":"local","fix_scope":"single_edit","confidence":"high","unreported_risk":"This batch covers only five files; architectural hotspots could still exist in non-assigned packages (e.g., runtime wiring or broader dependency graph) outside this evidence window."}},"findings":[]}
|
||||
@@ -0,0 +1,97 @@
|
||||
{
|
||||
"batch": "Abstractions & Dependencies",
|
||||
"batch_index": 2,
|
||||
"assessments": {
|
||||
"abstraction_fitness": 68.0
|
||||
},
|
||||
"dimension_notes": {
|
||||
"abstraction_fitness": {
|
||||
"evidence": [
|
||||
"Language-to-doc behavior is spread across multiple large switches: URL construction in cmd/get.go:78-173, type mapping in cmd/get.go:175-205, and term derivation in cmd/ask.go:205-260+.",
|
||||
"External scraper implementations repeat the same transport/change-detection scaffold (config+parser+http client fields, URL check, fetchPage, generateHash, DetectChanges) across multiple files, e.g. internal/scraper/external/godocs.go:17-121, internal/scraper/external/javadocs.go:16-115, internal/scraper/external/nuxtdocs.go:16-120, internal/scraper/external/cloudflaredocs.go:16-105.",
|
||||
"Vector store abstraction exposes implementations that are selected by default config but intentionally unimplemented: internal/config/config.go:121-125 defaults to chromem, while internal/vector/store.go:221-243 returns \"chromem store not implemented\" for all operations.",
|
||||
"Configuration defaults are duplicated in two representations (typed defaults and hand-written YAML template), increasing drift risk: cmd/init.go:92-149 and internal/config/config.go:104-160."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change",
|
||||
"confidence": "high",
|
||||
"sub_axes": {
|
||||
"abstraction_leverage": 62.0,
|
||||
"indirection_cost": 71.0,
|
||||
"interface_honesty": 60.0
|
||||
}
|
||||
}
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "language_catalog_scattered_switches",
|
||||
"summary": "Language routing logic is duplicated across CLI flows instead of one catalog abstraction",
|
||||
"related_files": [
|
||||
"cmd/get.go",
|
||||
"cmd/ask.go"
|
||||
],
|
||||
"evidence": [
|
||||
"cmd/get.go:78-173 defines a large language switch for URL building; cmd/get.go:175-205 defines a second switch for source type mapping.",
|
||||
"cmd/ask.go:205-260+ adds a third language switch for term heuristics, creating three independent sources of truth for one domain model."
|
||||
],
|
||||
"suggestion": "Introduce a single `LanguageSpec` registry (aliases, source type, URL builder, optional query-term strategy) in one package and have both `get` and `ask` consume it; keep per-language behavior as data/functions attached to that registry.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "external_scraper_scaffold_duplication",
|
||||
"summary": "External scraper adapters reimplement the same transport/hash lifecycle repeatedly",
|
||||
"related_files": [
|
||||
"internal/scraper/external/godocs.go",
|
||||
"internal/scraper/external/javadocs.go",
|
||||
"internal/scraper/external/nuxtdocs.go",
|
||||
"internal/scraper/external/cloudflaredocs.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Each file defines near-identical struct fields (`config`, `parser`, `client`), constructor wiring, URL-required guard, `fetchPage`, `generateHash`, and `DetectChanges` flow (e.g., godocs.go:17-121 and javadocs.go:16-115).",
|
||||
"Duplication scales linearly with each new source adapter, increasing edit surface for cross-cutting behavior (timeouts, headers, error mapping)."
|
||||
],
|
||||
"suggestion": "Extract a shared `HTTPDocScraperBase` (or composable helper functions) for request execution, status handling, hashing, and change detection; keep each adapter focused on parser invocation and domain-specific document mapping.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "default_selects_unimplemented_store",
|
||||
"summary": "Store interface contract is dishonest because default backend is not operational",
|
||||
"related_files": [
|
||||
"internal/vector/store.go",
|
||||
"internal/config/config.go"
|
||||
],
|
||||
"evidence": [
|
||||
"internal/config/config.go:121-125 sets default vector DB type to `chromem`.",
|
||||
"internal/vector/store.go:221-243 returns `chromem store not implemented` for all `Store` operations after `NewStore` can select that backend (store.go:63-72)."
|
||||
],
|
||||
"suggestion": "Either implement `ChromemStore` before exposing it as default, or switch default to a working backend and gate chromem behind explicit opt-in plus capability check at startup.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "config_defaults_double_encoded",
|
||||
"summary": "Initialization defaults are encoded twice with different abstractions",
|
||||
"related_files": [
|
||||
"cmd/init.go",
|
||||
"internal/config/config.go"
|
||||
],
|
||||
"evidence": [
|
||||
"cmd/init.go:92-149 hardcodes YAML defaults as a template string.",
|
||||
"internal/config/config.go:104-160 hardcodes defaults again in typed structs, requiring synchronized updates across two representations."
|
||||
],
|
||||
"suggestion": "Generate init YAML from `config.Default()` via marshal + small post-processing/comments, or maintain a single canonical defaults schema consumed by both loader and init command.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
{
|
||||
"batch": "Governance & Contracts",
|
||||
"batch_index": 3,
|
||||
"assessments": {
|
||||
"cross_module_architecture": 82.0,
|
||||
"test_strategy": 74.0
|
||||
},
|
||||
"dimension_notes": {
|
||||
"cross_module_architecture": {
|
||||
"evidence": [
|
||||
"`internal/quality/types.go` defines a typed status contract (`type Status string` with constants like `StatusOpen`, `StatusFixed`, `StatusWontfix`).",
|
||||
"`internal/quality/types.go` also defines `Scorecard.StatusByType map[string]int`, which bypasses the typed status contract at the module boundary.",
|
||||
"`internal/quality/scoring_test.go` asserts raw string keys (`\"open\"`, `\"fixed\"`) instead of using `Status` constants, reinforcing stringly-typed cross-component coupling.",
|
||||
"`README.md` claims quality features include tracking resolution states, but the in-code state transport for scorecards is weakly typed."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high"
|
||||
},
|
||||
"test_strategy": {
|
||||
"evidence": [
|
||||
"`internal/quality/narrative_test.go` validates exact headline/action prose and directly tests internal helper behavior (e.g., `determinePhase`, `generateHeadline`, `classifyDimension`), creating high implementation-coupling.",
|
||||
"`internal/quality/scoring_test.go` similarly focuses on exact internal scoring details and string key literals, which makes refactors noisy and discourages safe design changes.",
|
||||
"`pkg/rustdocs/parser_test.go` is heavily happy-path: it checks successful parses and minimal field presence but has no malformed-input/error-path cases for parser resilience.",
|
||||
"`README.md` marks parts of the CLI as unstable/stubbed, but assigned tests do not provide cross-module contract/integration safety nets for those runtime boundaries."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high"
|
||||
}
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"dimension": "cross_module_architecture",
|
||||
"identifier": "status_contract_string_map_boundary",
|
||||
"summary": "Scorecard state uses string keys instead of shared Status type, weakening module contracts.",
|
||||
"related_files": [
|
||||
"internal/quality/types.go",
|
||||
"internal/quality/scoring_test.go",
|
||||
"README.md"
|
||||
],
|
||||
"evidence": [
|
||||
"`internal/quality/types.go` defines `Status` constants but `Scorecard.StatusByType` is `map[string]int`.",
|
||||
"`internal/quality/scoring_test.go` asserts `card.StatusByType[\"open\"]` and `card.StatusByType[\"fixed\"]` directly.",
|
||||
"README promises resolution-state tracking, but this boundary is not type-safe."
|
||||
],
|
||||
"suggestion": "Change `Scorecard.StatusByType` to `map[Status]int` (or a dedicated typed struct), update serialization adapters if needed, and update tests to assert using `StatusOpen`/`StatusFixed` constants.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "test_strategy",
|
||||
"identifier": "brittle_private_and_copy_assertions_in_quality_tests",
|
||||
"summary": "Quality tests are tightly coupled to private helpers and exact copy text, reducing refactor safety.",
|
||||
"related_files": [
|
||||
"internal/quality/narrative_test.go",
|
||||
"internal/quality/scoring_test.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`narrative_test.go` directly asserts exact strings for generated headlines/actions and tests helper internals rather than stable external behavior.",
|
||||
"`scoring_test.go` anchors on specific internal weighting outputs and literal status strings, which can fail on benign internal redesigns."
|
||||
],
|
||||
"suggestion": "Shift to contract-level tests against exported APIs with invariant assertions (phase category, presence of required fields, monotonic score behavior), and keep only a small set of snapshot/copy tests for user-facing text.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "test_strategy",
|
||||
"identifier": "rust_parser_missing_negative_and_boundary_cases",
|
||||
"summary": "Rust parser tests miss malformed-input and degradation-path coverage.",
|
||||
"related_files": [
|
||||
"pkg/rustdocs/parser_test.go",
|
||||
"README.md"
|
||||
],
|
||||
"evidence": [
|
||||
"`parser_test.go` cases are successful parses with valid fixture HTML and only basic assertions.",
|
||||
"No tests verify behavior for malformed HTML, missing selectors, empty documents, or unsupported result rows.",
|
||||
"README positions docs ingestion as core functionality, so parser failure behavior is a critical path."
|
||||
],
|
||||
"suggestion": "Add table-driven negative tests for malformed/partial HTML, empty search blocks, and missing headings; assert stable fallback behavior (explicit error or safe zero-value output) for each parser entrypoint.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "single_edit"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"batch": "Design Coherence — Mechanical Concern Signals",
|
||||
"batch_index": 4,
|
||||
"assessments": {
|
||||
"design_coherence": 66.0
|
||||
},
|
||||
"dimension_notes": {
|
||||
"design_coherence": {
|
||||
"evidence": [
|
||||
"Parallel implementations of the same scorecard pipeline exist in `cmd/devour_scorecard.py` and `cmd/scorecard_generator.py` with near-identical function layouts (`ScorecardData`, `score_color`, `draw_left_panel`, `draw_right_panel`, `generate_scorecard`, `main`) and only minor line-level differences.",
|
||||
"Three variants of enhanced generator (`cmd/devour_enhanced.py`, `cmd/devour_enhanced_fixed.py`, `cmd/devour_enhanced_v2.py`) repeat almost the full rendering stack (`draw_header_section`, `draw_enhanced_left_panel`, `draw_enhanced_right_panel`, `draw_trends_section`, `load_enhanced_devour_data`), creating branch-by-copy evolution.",
|
||||
"Scraper adapters across providers (`internal/scraper/external/astrodocs.go`, `internal/scraper/external/cloudflaredocs.go`, `internal/scraper/external/reactdocs.go`) duplicate fetch/hash/change-detection and document assembly patterns with provider-specific data glued inline, indicating repeated structural pattern without shared orchestration abstraction.",
|
||||
"Within `cmd/devour_lighthouse.py`, `load_font` is defined twice (once near top and again later), showing local design drift and utility ownership ambiguity."
|
||||
],
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "architectural_change",
|
||||
"confidence": "high"
|
||||
}
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "scorecard_variant_sprawl",
|
||||
"summary": "Scorecard generation is maintained as multiple copy-variants instead of one composable pipeline.",
|
||||
"related_files": [
|
||||
"cmd/devour_scorecard.py",
|
||||
"cmd/scorecard_generator.py",
|
||||
"cmd/devour_enhanced.py",
|
||||
"cmd/devour_enhanced_fixed.py",
|
||||
"cmd/devour_enhanced_v2.py"
|
||||
],
|
||||
"evidence": [
|
||||
"Both `cmd/devour_scorecard.py` and `cmd/scorecard_generator.py` declare the same major functions and data model in the same order with only minor stylistic deltas.",
|
||||
"Enhanced variants repeat the same section render functions and data loading flow, then diverge by ad-hoc edits, increasing change fan-out for any layout or scoring rule update."
|
||||
],
|
||||
"suggestion": "Extract a shared rendering core module (palette/fonts/layout primitives + data normalization), keep one canonical CLI entrypoint, and convert variant behavior into explicit theme/feature flags rather than duplicated files.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "external_scraper_template_duplication",
|
||||
"summary": "Provider scrapers repeat the same orchestration flow with per-provider copy/paste adapters.",
|
||||
"related_files": [
|
||||
"internal/scraper/external/astrodocs.go",
|
||||
"internal/scraper/external/cloudflaredocs.go",
|
||||
"internal/scraper/external/reactdocs.go",
|
||||
"internal/scraper/external/godocs.go",
|
||||
"internal/scraper/external/vuedocs.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Each scraper reimplements nearly identical `Scrape`, `DetectChanges`, `fetchPage`, and `generateHash` scaffolding, then inlines provider-specific conversion methods.",
|
||||
"The repeated constructor/client/parser wiring pattern appears across multiple files, indicating systemic pattern duplication rather than isolated differences."
|
||||
],
|
||||
"suggestion": "Introduce a shared `DocAdapter` contract and a generic `HTTPDocScraper` that owns fetch/hash/change-detect; keep provider files focused on mapping parsed domain objects to `Document`.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "utility_ownership_drift_in_lighthouse_script",
|
||||
"summary": "Duplicate utility definition in one file shows mixed responsibility boundaries.",
|
||||
"related_files": [
|
||||
"cmd/devour_lighthouse.py",
|
||||
"cmd/devour_enhanced.py"
|
||||
],
|
||||
"evidence": [
|
||||
"`cmd/devour_lighthouse.py` defines `load_font` twice with effectively the same fallback behavior, creating hidden override risk and unclear source of truth.",
|
||||
"Comparable font utility exists in other renderer scripts, reinforcing that shared utility concerns are spread instead of centralized."
|
||||
],
|
||||
"suggestion": "Remove the duplicate in `cmd/devour_lighthouse.py` and move font-loading helpers into a shared module imported by all renderer scripts.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"batch": "Cross-cutting Sweep",
|
||||
"batch_index": 5,
|
||||
"assessments": {
|
||||
"error_consistency": 71.0
|
||||
},
|
||||
"dimension_notes": {
|
||||
"error_consistency": {
|
||||
"evidence": [
|
||||
"Raw error passthrough is common in core flows (e.g., `return nil, err` in `internal/search/engine.go:114`, `internal/search/engine.go:122`, `internal/scraper/openapi.go:45`, `internal/scraper/openapi.go:50`) while nearby code wraps with operation context (e.g., `internal/search/engine.go:111`, `internal/scraper/openapi.go:153`).",
|
||||
"Failure handling style diverges between aborting, propagating, and suppressing in similar backend paths: `panic(...)` in `internal/quality/plugins/go/plugin.go:363`, warning print-and-continue in `internal/indexer/indexer.go:239`, and plain returns in `cmd/scrape.go:90`/`cmd/get.go:59`.",
|
||||
"Some call paths lose caller context at command boundaries (`cmd/scrape.go:90`, `cmd/scrape.go:125`, `cmd/get.go:59`) despite contextual wrapping being used in other command-layer branches (`cmd/scrape.go:131`, `cmd/scrape.go:145`)."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high"
|
||||
}
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "mixed_error_wrapping_in_scrape_and_search_paths",
|
||||
"summary": "Related scrape/search paths mix raw passthrough and contextual wrapping.",
|
||||
"related_files": [
|
||||
"internal/search/engine.go",
|
||||
"internal/scraper/openapi.go",
|
||||
"internal/scraper/localsearch.go",
|
||||
"cmd/scrape.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`internal/search/engine.go` frequently returns raw errors (`:114`, `:117`, `:122`, `:170`) but also uses contextual errors (`:111`, `:230`).",
|
||||
"`internal/scraper/openapi.go` propagates raw errors from `readSpec`/`parseOpenAPISpec` (`:45`, `:50`, `:123`, `:141`, `:149`, `:157`, `:164`) while also defining wrapped errors (`:135`, `:153`, `:217`).",
|
||||
"`internal/scraper/localsearch.go` returns raw errors from helper boundaries (`:79`, `:164`, `:191`, `:222`) mixed with rich wrapped messages in the same workflow (`:196`, `:203`, `:209`, `:217`)."
|
||||
],
|
||||
"suggestion": "Define a package-level rule: public methods must wrap downstream errors with operation context (using `%w`), and helper internals may return raw errors. Apply this consistently to `Rebuild/EnsureIndexed`, `OpenAPIScraper.Scrape/DetectChanges/readSpec`, and `LocalSearchScraper` methods.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "inconsistent_failure_channel_panic_vs_error_vs_warning",
|
||||
"summary": "Failure signaling varies between panic, error return, and warning-only logging.",
|
||||
"related_files": [
|
||||
"internal/quality/plugins/go/plugin.go",
|
||||
"internal/indexer/indexer.go",
|
||||
"cmd/scrape.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`internal/quality/plugins/go/plugin.go:363` panics on plugin registration failure.",
|
||||
"`internal/indexer/indexer.go:239` prints a warning and suppresses deletion errors instead of returning them.",
|
||||
"`cmd/scrape.go` is structured around returned errors (`:131`, `:145`, `:207`) and has no panic-based handling, creating inconsistent contracts across subsystems."
|
||||
],
|
||||
"suggestion": "Standardize on explicit error returns for recoverable startup/runtime failures; replace plugin `panic` with registration error propagation or controlled process-exit at the command entrypoint, and make indexer deletion behavior explicit (either aggregate and return partial-failure errors or document/encode best-effort mode).",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "command_boundary_context_loss",
|
||||
"summary": "CLI command boundaries sometimes return raw errors without command context.",
|
||||
"related_files": [
|
||||
"cmd/get.go",
|
||||
"cmd/scrape.go",
|
||||
"internal/config/config.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`cmd/get.go:59` and `cmd/scrape.go:90`/`:125` return raw errors directly from downstream calls.",
|
||||
"Other branches in the same command wrap with explicit context (`cmd/scrape.go:131`, `cmd/scrape.go:145`, `cmd/scrape.go:154`).",
|
||||
"Config layer already emits contextual wrapped errors (`internal/config/config.go:177`, `internal/config/config.go:181`), so command-layer inconsistency creates uneven user-facing diagnostics."
|
||||
],
|
||||
"suggestion": "At CLI entrypoints, wrap all returned downstream errors with command/action context (e.g., `run get`, `load config`, `scrape source`) and preserve root cause with `%w`; keep user-readable validation errors as direct messages.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"batch": "Full Codebase Sweep",
|
||||
"batch_index": 6,
|
||||
"assessments": {
|
||||
"cross_module_architecture": 74.0,
|
||||
"error_consistency": 68.0,
|
||||
"abstraction_fitness": 62.0,
|
||||
"test_strategy": 55.0,
|
||||
"design_coherence": 64.0
|
||||
},
|
||||
"dimension_notes": {
|
||||
"cross_module_architecture": {
|
||||
"evidence": [
|
||||
"`cmd/root.go` relies on blank import `_ \"github.com/yourorg/devour/internal/scraper/external\"` to activate runtime registration side effects.",
|
||||
"`internal/scraper/external/register.go` mutates global scraper registry in `init()` for all language scrapers.",
|
||||
"`internal/scraper/registry_simple.go` uses global mutable registry (`globalRegistry`) shared process-wide, increasing hidden coupling and order sensitivity."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change",
|
||||
"confidence": "high"
|
||||
},
|
||||
"error_consistency": {
|
||||
"evidence": [
|
||||
"`cmd/root.go` and `cmd/scorecard.go` terminate with `os.Exit`, while most command flows return wrapped errors.",
|
||||
"`internal/quality/plugins/go/plugin.go` panics during plugin registration (`panic(fmt.Sprintf(...))`) instead of surfacing an error contract.",
|
||||
"`cleanup_unused.go` uses `log.Fatal` and mixed logging/exit style unlike the rest of the codebase's `fmt.Errorf(...%w...)` propagation."
|
||||
],
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high"
|
||||
},
|
||||
"abstraction_fitness": {
|
||||
"evidence": [
|
||||
"Language-specific scraper implementations (`internal/scraper/external/godocs.go`, `internal/scraper/external/rustdocs.go`, `internal/scraper/external/reactdocs.go`, and peers) repeat near-identical HTTP fetch/hash/error scaffolding with only parser/document mapping differences.",
|
||||
"`internal/scraper/external/types.go` is a thin alias layer over `internal/scraper` types and does not enforce additional policy or invariants.",
|
||||
"High repeated constructor/scrape boilerplate across external scrapers indicates abstraction cost is paid repeatedly without shared leverage."
|
||||
],
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change",
|
||||
"confidence": "high",
|
||||
"sub_axes": {
|
||||
"abstraction_leverage": 58.0,
|
||||
"indirection_cost": 72.0,
|
||||
"interface_honesty": 70.0
|
||||
}
|
||||
},
|
||||
"test_strategy": {
|
||||
"evidence": [
|
||||
"Critical runtime surfaces have no direct tests: `internal/server/server.go`, `pkg/client/client.go`, `internal/vector/store.go`, `internal/search/engine.go`, `internal/indexer/indexer.go`.",
|
||||
"`pkg/client/client.go` has TODO stubs returning `nil, nil` for `Query` and `Status`, but there are no tests asserting failure behavior or contract correctness.",
|
||||
"`internal/server/server.go` Start methods are TODO/no-op `nil` returns and remain unvalidated by tests, creating false-green behavior for unimplemented paths."
|
||||
],
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high"
|
||||
},
|
||||
"design_coherence": {
|
||||
"evidence": [
|
||||
"`cmd/quality.go` (695 LOC) mixes CLI wiring, scan orchestration, status persistence, scoring output, resolution updates, fixer execution, and review import/export in one file.",
|
||||
"`cmd/scrape.go` (444 LOC) combines source parsing, source-type inference, profile heuristics, scrape orchestration, persistence, and source-state hashing.",
|
||||
"These large command files show recurring multi-responsibility patterns rather than cohesive command/use-case units."
|
||||
],
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor",
|
||||
"confidence": "high"
|
||||
}
|
||||
},
|
||||
"findings": [
|
||||
{
|
||||
"dimension": "cross_module_architecture",
|
||||
"identifier": "init_side_effect_registration_coupling",
|
||||
"summary": "Scraper registration depends on import-time side effects and global mutable registry state.",
|
||||
"related_files": [
|
||||
"cmd/root.go",
|
||||
"internal/scraper/external/register.go",
|
||||
"internal/scraper/registry_simple.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Blank import in root command triggers registration implicitly rather than explicit bootstrap wiring.",
|
||||
"Registration happens in `init()` and mutates shared global registry."
|
||||
],
|
||||
"suggestion": "Replace import-time registration with explicit bootstrap registration (e.g., `RegisterExternalScrapers()` called from startup), and pass registry instances through constructors to remove hidden global coupling.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "error_consistency",
|
||||
"identifier": "mixed_process_termination_and_error_propagation",
|
||||
"summary": "Error handling mixes panic/log.Fatal/os.Exit with returned errors across adjacent layers.",
|
||||
"related_files": [
|
||||
"cmd/root.go",
|
||||
"cmd/scorecard.go",
|
||||
"internal/quality/plugins/go/plugin.go",
|
||||
"cleanup_unused.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`Execute()` exits process directly; scorecard helper exits inside utility flow; plugin registration panics on failure.",
|
||||
"Most other command paths return wrapped errors, creating inconsistent failure semantics."
|
||||
],
|
||||
"suggestion": "Standardize on returning errors from library/command internals and only perform process exit in one top-level entrypoint; replace panic/log.Fatal in shared code with typed/wrapped errors.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "abstraction_fitness",
|
||||
"identifier": "external_scraper_boilerplate_without_shared_base",
|
||||
"summary": "External scraper implementations duplicate fetch/hash/error/document plumbing instead of sharing a base abstraction.",
|
||||
"related_files": [
|
||||
"internal/scraper/external/godocs.go",
|
||||
"internal/scraper/external/rustdocs.go",
|
||||
"internal/scraper/external/reactdocs.go",
|
||||
"internal/scraper/external/nuxtdocs.go",
|
||||
"internal/scraper/external/cloudflaredocs.go",
|
||||
"internal/scraper/external/types.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Each scraper repeats `fetchPage`, status code checks, hash generation, and near-identical scrape control flow.",
|
||||
"Alias-only types file adds indirection without behavior."
|
||||
],
|
||||
"suggestion": "Introduce a shared external-scraper base/helper for HTTP fetch, retries, hashing, and common error mapping; keep only parser-specific extraction and document shaping in each language scraper.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "subsystem",
|
||||
"fix_scope": "architectural_change"
|
||||
},
|
||||
{
|
||||
"dimension": "test_strategy",
|
||||
"identifier": "untested_unimplemented_runtime_paths",
|
||||
"summary": "Core runtime paths are both under-tested and partially stubbed, leaving high-risk behavior unvalidated.",
|
||||
"related_files": [
|
||||
"internal/server/server.go",
|
||||
"pkg/client/client.go",
|
||||
"internal/vector/store.go",
|
||||
"internal/search/engine.go",
|
||||
"internal/indexer/indexer.go"
|
||||
],
|
||||
"evidence": [
|
||||
"Server/client/store contain TODO or not-implemented branches without direct tests.",
|
||||
"No direct test files exist for several core modules that govern querying, indexing, and serving."
|
||||
],
|
||||
"suggestion": "Add table-driven tests for client/server/store/indexer contracts first (error behavior and non-nil results), then implement missing paths behind those tests; prioritize integration tests that exercise scrape->index->query flow.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "codebase",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
},
|
||||
{
|
||||
"dimension": "design_coherence",
|
||||
"identifier": "command_files_mix_multiple_responsibilities",
|
||||
"summary": "Large CLI command files blend orchestration, domain logic, persistence, and formatting concerns.",
|
||||
"related_files": [
|
||||
"cmd/quality.go",
|
||||
"cmd/scrape.go",
|
||||
"cmd/ask.go"
|
||||
],
|
||||
"evidence": [
|
||||
"`cmd/quality.go` combines scan setup, scoring/status persistence, resolve/fix/review workflows.",
|
||||
"`cmd/scrape.go` combines config parsing, source detection/profiling, scrape execution, indexing, and source-state updates.",
|
||||
"`cmd/ask.go` includes query derivation, source URL heuristics, ranking, summarization, and output formatting in one command module."
|
||||
],
|
||||
"suggestion": "Split command files into focused packages (transport/CLI binding vs service layer vs persistence helpers) and keep Cobra handlers as thin adapters invoking composable use-case functions.",
|
||||
"confidence": "high",
|
||||
"impact_scope": "module",
|
||||
"fix_scope": "multi_file_refactor"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user