You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/scan-flow.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,18 +6,17 @@ This document outlines how repository scans are transformed into AI instruction
6
6
7
7
1.**Scan the repository** (`app/api/scan-repo/route.ts`)
8
8
- Detect languages, frameworks, tooling, structure hints, and enriched metadata.
9
-
-Use stack conventions (`collectConventionValues`) to cross-check detection lists (e.g., testing tools) so any signal we add in `conventions/<stack>.json` becomes discoverable with minimal code changes.
10
-
- Reuse convention values to expand stack-specific heuristics (e.g., Python’s Behave directories, Next.js routing shapes), so each conventions file remains the source of truth for new detections.
9
+
-Load stack question metadata (`loadStackQuestionMetadata`) so detection lists (e.g., testing tools) map onto the same canonical values the wizard exposes.
10
+
- Reuse those canonical values to expand stack-specific heuristics (e.g., Python’s Behave directories, Next.js routing shapes) without hard-coding strings inside the scanner.
11
11
- Infer the primary stack using `inferStackFromScan`.
12
12
- Load stack conventions (`loadStackConventions`) to determine which structure hints matter and whether stack-specific rules exist.
13
13
- Attach `summary.conventions` so the UI knows which directories to highlight and whether a conventions file was found.
- Apply convention defaults from `conventions/<stack>.json` + `default.json`.
18
-
- Layer in detections from the scan (tooling, testing, naming signals, etc.), matching scan values against convention-provided options so stack JSON remains the single source of truth.
17
+
- Layer in detections from the scan (tooling, testing, naming signals, etc.), matching scan values against the question catalog so defaults stay in sync with the wizard.
19
18
- Run convention rules to tweak values based on detected tooling/testing.
20
-
- Pull default answers directly from the stack’s question set (`buildStepsForStack`) and fill any remaining empty responses. We track which questions were auto-defaulted (`defaultedQuestionIds`) so the summary can explain why.
19
+
- Pull default answers directly from the stack’s question set (`loadStackQuestionMetadata`) and fill any remaining empty responses. We track which questions were auto-defaulted (`defaultedQuestionIds`) so the summary can explain why.
21
20
22
21
3.**Persist and surface responses**
23
22
-`lib/scan-prefill.ts` merges the generated responses into local wizard state and stores both `autoFilledMap` and `defaultedMap` in localStorage.
@@ -34,8 +33,9 @@ This document outlines how repository scans are transformed into AI instruction
34
33
35
34
| Location | Purpose |
36
35
| --- | --- |
37
-
|`conventions/default.json` & `/conventions/<stack>.json`| Declarative defaults + rules for each stack (tooling choices, structure hints, apply-to glob, etc.). |
38
-
|`lib/convention-values.ts`| Helpers that normalize and aggregate convention values (e.g., testingUT/testingE2E) for both the scanner and the wizard. |
36
+
|`conventions/default.json` & `/conventions/<stack>.json`| Declarative rules, `applyToGlob`, and structure hints for each stack. |
37
+
|`lib/question-metadata.ts`| Caches question answers/defaults per stack so both the scanner and wizard share a single source of truth. |
38
+
|`lib/wizard-responses.ts`| Produces empty `WizardResponses` objects and guards response keys. |
39
39
|`data/stacks.json`| List of stacks exposed to the wizard; each should have a matching conventions file. |
40
40
|`data/questions/<stack>.json`| Stack-specific questions with default answers and metadata. These defaults are now honored automatically when scan data is missing. |
0 commit comments