fm2web 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fm2web-0.0.1/.gitignore +11 -0
- fm2web-0.0.1/PKG-INFO +274 -0
- fm2web-0.0.1/README.md +253 -0
- fm2web-0.0.1/docs/architecture.md +149 -0
- fm2web-0.0.1/docs/commands.md +215 -0
- fm2web-0.0.1/docs/data-model.md +249 -0
- fm2web-0.0.1/docs/implementation-plan.md +103 -0
- fm2web-0.0.1/pyproject.toml +57 -0
- fm2web-0.0.1/src/fm2web_cli/__init__.py +3 -0
- fm2web-0.0.1/src/fm2web_cli/analyse/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/analyse/service.py +1012 -0
- fm2web-0.0.1/src/fm2web_cli/cli/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/cli/app.py +337 -0
- fm2web-0.0.1/src/fm2web_cli/core/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/core/models.py +111 -0
- fm2web-0.0.1/src/fm2web_cli/core/paths.py +35 -0
- fm2web-0.0.1/src/fm2web_cli/extract/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/extract/ddr_parser.py +329 -0
- fm2web-0.0.1/src/fm2web_cli/extract/service.py +304 -0
- fm2web-0.0.1/src/fm2web_cli/llm/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/llm/service.py +37 -0
- fm2web-0.0.1/src/fm2web_cli/retrieval/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/retrieval/service.py +365 -0
- fm2web-0.0.1/src/fm2web_cli/store/__init__.py +0 -0
- fm2web-0.0.1/src/fm2web_cli/store/db.py +47 -0
- fm2web-0.0.1/src/fm2web_cli/store/schema.py +156 -0
- fm2web-0.0.1/tests/test_cli_contract.py +210 -0
fm2web-0.0.1/.gitignore
ADDED
fm2web-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fm2web
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: CLI-first FileMaker DDR extraction, analysis, and LLM context engine
|
|
5
|
+
Author: Marcus Swift
|
|
6
|
+
License: Proprietary
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: pydantic-settings>=2.2
|
|
9
|
+
Requires-Dist: pydantic>=2.6
|
|
10
|
+
Requires-Dist: rich>=13.7
|
|
11
|
+
Requires-Dist: typer>=0.12
|
|
12
|
+
Provides-Extra: dev
|
|
13
|
+
Requires-Dist: mypy>=1.8; extra == 'dev'
|
|
14
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
15
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
16
|
+
Provides-Extra: qdrant
|
|
17
|
+
Requires-Dist: qdrant-client>=1.9.0; extra == 'qdrant'
|
|
18
|
+
Provides-Extra: vector
|
|
19
|
+
Requires-Dist: sqlite-vec>=0.1.0; extra == 'vector'
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
|
|
22
|
+
# FM2Web
|
|
23
|
+
|
|
24
|
+
FM2Web is a CLI-first FileMaker DDR extraction, analysis, and LLM-context engine.
|
|
25
|
+
|
|
26
|
+
It turns FileMaker DDR XML exports into a local SQLite knowledge store containing normalized entities, relationships, evidence, retrieval chunks, and deterministic analysis findings. FM2Web does **not** call an internal LLM. Instead, it gives external agents and LLM tools grounded commands for retrieval, inspection, tracing, evidence lookup, and context-pack creation.
|
|
27
|
+
|
|
28
|
+
## Install with uv
|
|
29
|
+
|
|
30
|
+
Install from PyPI:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uv tool install fm2web
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Confirm the command is on your `PATH`:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
fm2web --version
|
|
40
|
+
fm2web --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Upgrade later with:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uv tool upgrade fm2web
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
If `uv` is not installed yet:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Quick start
|
|
56
|
+
|
|
57
|
+
Extract a single DDR XML file:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
fm2web extract \
|
|
61
|
+
--ddr /path/to/FileMaker_DDR.xml \
|
|
62
|
+
--project clean-sweep
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Extract a multi-file DDR directory containing `Summary.xml`:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
fm2web extract \
|
|
69
|
+
--ddr /path/to/DDR-directory \
|
|
70
|
+
--project clean-sweep
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Run deterministic analysis:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
fm2web analyse --project clean-sweep --refresh
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`analyse` is canonical Canadian spelling. `analyze` is also available as an alias.
|
|
80
|
+
|
|
81
|
+
Ask for an LLM-ready context pack without calling an internal LLM:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
fm2web ask \
|
|
85
|
+
--project clean-sweep \
|
|
86
|
+
"How does invoice creation work? Cite evidence." \
|
|
87
|
+
--json
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Core commands
|
|
91
|
+
|
|
92
|
+
### `extract`
|
|
93
|
+
|
|
94
|
+
Parses FileMaker DDR XML and writes normalized facts into SQLite.
|
|
95
|
+
|
|
96
|
+
Supported inputs:
|
|
97
|
+
|
|
98
|
+
- single DDR XML report
|
|
99
|
+
- `Summary.xml`
|
|
100
|
+
- directory containing `Summary.xml`
|
|
101
|
+
|
|
102
|
+
Extracted domains include:
|
|
103
|
+
|
|
104
|
+
- schema tables and fields
|
|
105
|
+
- relationship graph/table occurrences
|
|
106
|
+
- scripts and script steps
|
|
107
|
+
- script-call relationships
|
|
108
|
+
- layouts, layout objects, buttons, field references
|
|
109
|
+
- button-to-script activations
|
|
110
|
+
- custom functions
|
|
111
|
+
- value lists
|
|
112
|
+
- accounts and privilege sets
|
|
113
|
+
- evidence records
|
|
114
|
+
- retrieval chunks and FTS index
|
|
115
|
+
|
|
116
|
+
### `analyse` / `analyze`
|
|
117
|
+
|
|
118
|
+
Writes deterministic findings over the extracted facts.
|
|
119
|
+
|
|
120
|
+
Current finding layers include:
|
|
121
|
+
|
|
122
|
+
- `schema_quality`
|
|
123
|
+
- `script_call_graph`
|
|
124
|
+
- `script_data_access`
|
|
125
|
+
- `script_semantics`
|
|
126
|
+
- `layout_implementation`
|
|
127
|
+
- `feature_flow`
|
|
128
|
+
- `workflow_candidate`
|
|
129
|
+
- `business_feature`
|
|
130
|
+
- `security_mapping`
|
|
131
|
+
- `migration_risk`
|
|
132
|
+
|
|
133
|
+
Semantic analysis uses extracted script-step entities to classify action, intent, mutation, control-flow, integration, and UI/reporting behavior. These semantics roll up into layout feature flows and business feature findings.
|
|
134
|
+
|
|
135
|
+
### `retrieve`
|
|
136
|
+
|
|
137
|
+
Returns citation-bearing context chunks for a query:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
fm2web retrieve --project clean-sweep "square foot quoting" --json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### `ask`
|
|
144
|
+
|
|
145
|
+
Builds an LLM-ready context packet and answer contract. FM2Web does not answer internally:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
fm2web ask --project clean-sweep "How does square foot quoting work?" --json
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### `findings`
|
|
152
|
+
|
|
153
|
+
Lists persisted analysis findings with explicit pagination:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
fm2web findings \
|
|
157
|
+
--project clean-sweep \
|
|
158
|
+
--type business_feature \
|
|
159
|
+
--limit 50 \
|
|
160
|
+
--offset 0 \
|
|
161
|
+
--json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Analysis writes complete persisted findings. Output volume controls belong to read commands like `findings --limit/--offset`, not to the analyser.
|
|
165
|
+
|
|
166
|
+
### `inspect`
|
|
167
|
+
|
|
168
|
+
Inspects exact stored facts:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
fm2web inspect schema --project clean-sweep --table Contacts --json
|
|
172
|
+
fm2web inspect script --project clean-sweep --name "Save Invoice" --json
|
|
173
|
+
fm2web inspect layout --project clean-sweep --name "Invoice Detail" --json
|
|
174
|
+
fm2web inspect security --project clean-sweep --json
|
|
175
|
+
fm2web inspect entity --project clean-sweep --name Contacts --json
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### `trace`
|
|
179
|
+
|
|
180
|
+
Traverses dependencies and impacts in the stored relationship graph:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
fm2web trace \
|
|
184
|
+
--project clean-sweep \
|
|
185
|
+
--entity script:clean-sweep:save-invoice \
|
|
186
|
+
--direction both \
|
|
187
|
+
--depth 3 \
|
|
188
|
+
--json
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Directions:
|
|
192
|
+
|
|
193
|
+
- `upstream`
|
|
194
|
+
- `downstream`
|
|
195
|
+
- `both`
|
|
196
|
+
|
|
197
|
+
### `evidence`
|
|
198
|
+
|
|
199
|
+
Dereferences raw evidence by ID:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
fm2web evidence --project clean-sweep --id evidence:abc123 --json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### `export context`
|
|
206
|
+
|
|
207
|
+
Writes a reusable Markdown context pack:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
fm2web export context \
|
|
211
|
+
--project clean-sweep \
|
|
212
|
+
--question "How does invoicing work?" \
|
|
213
|
+
--out invoicing-context.md
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### `doctor`
|
|
217
|
+
|
|
218
|
+
Checks local readiness:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
fm2web doctor --json
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Store location
|
|
225
|
+
|
|
226
|
+
By default FM2Web uses project-local state under:
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
.fm2web/fm2web.sqlite
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Override with:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
fm2web extract --store /path/to/fm2web.sqlite --ddr /path/to/ddr.xml --project clean-sweep
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Use the same `--store` path for follow-up commands.
|
|
239
|
+
|
|
240
|
+
## Optional extras
|
|
241
|
+
|
|
242
|
+
Install optional vector dependencies:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
uv tool install 'fm2web[vector]'
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Install optional Qdrant dependencies:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
uv tool install 'fm2web[qdrant]'
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
SQLite/FTS works without these extras.
|
|
255
|
+
|
|
256
|
+
## Development
|
|
257
|
+
|
|
258
|
+
From a source checkout:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
uv sync --extra dev
|
|
262
|
+
uv run pytest
|
|
263
|
+
uv run fm2web --help
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Build locally:
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
uv build
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## License
|
|
273
|
+
|
|
274
|
+
Proprietary.
|
fm2web-0.0.1/README.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# FM2Web
|
|
2
|
+
|
|
3
|
+
FM2Web is a CLI-first FileMaker DDR extraction, analysis, and LLM-context engine.
|
|
4
|
+
|
|
5
|
+
It turns FileMaker DDR XML exports into a local SQLite knowledge store containing normalized entities, relationships, evidence, retrieval chunks, and deterministic analysis findings. FM2Web does **not** call an internal LLM. Instead, it gives external agents and LLM tools grounded commands for retrieval, inspection, tracing, evidence lookup, and context-pack creation.
|
|
6
|
+
|
|
7
|
+
## Install with uv
|
|
8
|
+
|
|
9
|
+
Install from PyPI:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv tool install fm2web
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Confirm the command is on your `PATH`:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
fm2web --version
|
|
19
|
+
fm2web --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Upgrade later with:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv tool upgrade fm2web
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
If `uv` is not installed yet:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
Extract a single DDR XML file:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
fm2web extract \
|
|
40
|
+
--ddr /path/to/FileMaker_DDR.xml \
|
|
41
|
+
--project clean-sweep
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Extract a multi-file DDR directory containing `Summary.xml`:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
fm2web extract \
|
|
48
|
+
--ddr /path/to/DDR-directory \
|
|
49
|
+
--project clean-sweep
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Run deterministic analysis:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
fm2web analyse --project clean-sweep --refresh
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`analyse` is canonical Canadian spelling. `analyze` is also available as an alias.
|
|
59
|
+
|
|
60
|
+
Ask for an LLM-ready context pack without calling an internal LLM:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
fm2web ask \
|
|
64
|
+
--project clean-sweep \
|
|
65
|
+
"How does invoice creation work? Cite evidence." \
|
|
66
|
+
--json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Core commands
|
|
70
|
+
|
|
71
|
+
### `extract`
|
|
72
|
+
|
|
73
|
+
Parses FileMaker DDR XML and writes normalized facts into SQLite.
|
|
74
|
+
|
|
75
|
+
Supported inputs:
|
|
76
|
+
|
|
77
|
+
- single DDR XML report
|
|
78
|
+
- `Summary.xml`
|
|
79
|
+
- directory containing `Summary.xml`
|
|
80
|
+
|
|
81
|
+
Extracted domains include:
|
|
82
|
+
|
|
83
|
+
- schema tables and fields
|
|
84
|
+
- relationship graph/table occurrences
|
|
85
|
+
- scripts and script steps
|
|
86
|
+
- script-call relationships
|
|
87
|
+
- layouts, layout objects, buttons, field references
|
|
88
|
+
- button-to-script activations
|
|
89
|
+
- custom functions
|
|
90
|
+
- value lists
|
|
91
|
+
- accounts and privilege sets
|
|
92
|
+
- evidence records
|
|
93
|
+
- retrieval chunks and FTS index
|
|
94
|
+
|
|
95
|
+
### `analyse` / `analyze`
|
|
96
|
+
|
|
97
|
+
Writes deterministic findings over the extracted facts.
|
|
98
|
+
|
|
99
|
+
Current finding layers include:
|
|
100
|
+
|
|
101
|
+
- `schema_quality`
|
|
102
|
+
- `script_call_graph`
|
|
103
|
+
- `script_data_access`
|
|
104
|
+
- `script_semantics`
|
|
105
|
+
- `layout_implementation`
|
|
106
|
+
- `feature_flow`
|
|
107
|
+
- `workflow_candidate`
|
|
108
|
+
- `business_feature`
|
|
109
|
+
- `security_mapping`
|
|
110
|
+
- `migration_risk`
|
|
111
|
+
|
|
112
|
+
Semantic analysis uses extracted script-step entities to classify action, intent, mutation, control-flow, integration, and UI/reporting behavior. These semantics roll up into layout feature flows and business feature findings.
|
|
113
|
+
|
|
114
|
+
### `retrieve`
|
|
115
|
+
|
|
116
|
+
Returns citation-bearing context chunks for a query:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
fm2web retrieve --project clean-sweep "square foot quoting" --json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### `ask`
|
|
123
|
+
|
|
124
|
+
Builds an LLM-ready context packet and answer contract. FM2Web does not answer internally:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
fm2web ask --project clean-sweep "How does square foot quoting work?" --json
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### `findings`
|
|
131
|
+
|
|
132
|
+
Lists persisted analysis findings with explicit pagination:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
fm2web findings \
|
|
136
|
+
--project clean-sweep \
|
|
137
|
+
--type business_feature \
|
|
138
|
+
--limit 50 \
|
|
139
|
+
--offset 0 \
|
|
140
|
+
--json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Analysis writes complete persisted findings. Output volume controls belong to read commands like `findings --limit/--offset`, not to the analyser.
|
|
144
|
+
|
|
145
|
+
### `inspect`
|
|
146
|
+
|
|
147
|
+
Inspects exact stored facts:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
fm2web inspect schema --project clean-sweep --table Contacts --json
|
|
151
|
+
fm2web inspect script --project clean-sweep --name "Save Invoice" --json
|
|
152
|
+
fm2web inspect layout --project clean-sweep --name "Invoice Detail" --json
|
|
153
|
+
fm2web inspect security --project clean-sweep --json
|
|
154
|
+
fm2web inspect entity --project clean-sweep --name Contacts --json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### `trace`
|
|
158
|
+
|
|
159
|
+
Traverses dependencies and impacts in the stored relationship graph:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
fm2web trace \
|
|
163
|
+
--project clean-sweep \
|
|
164
|
+
--entity script:clean-sweep:save-invoice \
|
|
165
|
+
--direction both \
|
|
166
|
+
--depth 3 \
|
|
167
|
+
--json
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Directions:
|
|
171
|
+
|
|
172
|
+
- `upstream`
|
|
173
|
+
- `downstream`
|
|
174
|
+
- `both`
|
|
175
|
+
|
|
176
|
+
### `evidence`
|
|
177
|
+
|
|
178
|
+
Dereferences raw evidence by ID:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
fm2web evidence --project clean-sweep --id evidence:abc123 --json
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### `export context`
|
|
185
|
+
|
|
186
|
+
Writes a reusable Markdown context pack:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
fm2web export context \
|
|
190
|
+
--project clean-sweep \
|
|
191
|
+
--question "How does invoicing work?" \
|
|
192
|
+
--out invoicing-context.md
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### `doctor`
|
|
196
|
+
|
|
197
|
+
Checks local readiness:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
fm2web doctor --json
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Store location
|
|
204
|
+
|
|
205
|
+
By default FM2Web uses project-local state under:
|
|
206
|
+
|
|
207
|
+
```text
|
|
208
|
+
.fm2web/fm2web.sqlite
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Override with:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
fm2web extract --store /path/to/fm2web.sqlite --ddr /path/to/ddr.xml --project clean-sweep
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Use the same `--store` path for follow-up commands.
|
|
218
|
+
|
|
219
|
+
## Optional extras
|
|
220
|
+
|
|
221
|
+
Install optional vector dependencies:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
uv tool install 'fm2web[vector]'
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Install optional Qdrant dependencies:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
uv tool install 'fm2web[qdrant]'
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
SQLite/FTS works without these extras.
|
|
234
|
+
|
|
235
|
+
## Development
|
|
236
|
+
|
|
237
|
+
From a source checkout:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
uv sync --extra dev
|
|
241
|
+
uv run pytest
|
|
242
|
+
uv run fm2web --help
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Build locally:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
uv build
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## License
|
|
252
|
+
|
|
253
|
+
Proprietary.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# FM2Web CLI Architecture
|
|
2
|
+
|
|
3
|
+
## Design stance
|
|
4
|
+
|
|
5
|
+
`fm2web` is not just a file converter. It is a local knowledge engine for FileMaker projects.
|
|
6
|
+
|
|
7
|
+
The CLI owns four durable responsibilities:
|
|
8
|
+
|
|
9
|
+
1. Extract DDR facts into a normalized local store.
|
|
10
|
+
2. Analyse those facts into higher-level findings.
|
|
11
|
+
3. Retrieve grounded context packs for LLMs.
|
|
12
|
+
4. Answer or export answers with citations back to DDR evidence.
|
|
13
|
+
|
|
14
|
+
## Control surfaces
|
|
15
|
+
|
|
16
|
+
### CLI plane
|
|
17
|
+
|
|
18
|
+
Primary human and automation surface.
|
|
19
|
+
|
|
20
|
+
- stable commands
|
|
21
|
+
- deterministic JSON output when `--json` is passed
|
|
22
|
+
- no hidden desktop/workspace coupling
|
|
23
|
+
- project-local defaults
|
|
24
|
+
|
|
25
|
+
### Store plane
|
|
26
|
+
|
|
27
|
+
SQLite owns durable truth.
|
|
28
|
+
|
|
29
|
+
- extracted entities
|
|
30
|
+
- entity relationships
|
|
31
|
+
- source evidence spans
|
|
32
|
+
- chunks and FTS rows
|
|
33
|
+
- optional embeddings
|
|
34
|
+
- analysis findings
|
|
35
|
+
- answer traces
|
|
36
|
+
|
|
37
|
+
### Analysis plane
|
|
38
|
+
|
|
39
|
+
Analysis is a repeatable pipeline over stored facts. It writes findings, never hidden prompt-only knowledge.
|
|
40
|
+
|
|
41
|
+
### LLM plane
|
|
42
|
+
|
|
43
|
+
LLMs consume retrieved context packs. They do not directly read the entire DDR or infer without citations.
|
|
44
|
+
|
|
45
|
+
## Package layout
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
src/fm2web_cli/
|
|
49
|
+
cli/ Typer command surface
|
|
50
|
+
core/ config, paths, typed command inputs
|
|
51
|
+
store/ SQLite schema, migrations, repositories
|
|
52
|
+
extract/ DDR parser/extractor adapters and normalization
|
|
53
|
+
analyse/ deterministic analyzers that write reusable findings
|
|
54
|
+
retrieval/ FTS/vector retrieval and context-pack assembly
|
|
55
|
+
llm/ LLM-ready context-pack contract helpers; no internal provider calls
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Pipeline
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
DDR XML
|
|
62
|
+
-> extract
|
|
63
|
+
-> parse structure
|
|
64
|
+
-> extract entities
|
|
65
|
+
-> normalize ids
|
|
66
|
+
-> persist entities/relationships/evidence
|
|
67
|
+
-> chunk evidence
|
|
68
|
+
-> build FTS/vector index
|
|
69
|
+
-> analyse
|
|
70
|
+
-> schema quality
|
|
71
|
+
-> relationship graph
|
|
72
|
+
-> script call graph
|
|
73
|
+
-> layout implementation map
|
|
74
|
+
-> security/RBAC model
|
|
75
|
+
-> workflow candidates
|
|
76
|
+
-> feature clusters
|
|
77
|
+
-> migration risks
|
|
78
|
+
-> retrieve/ask/export
|
|
79
|
+
-> classify question intent
|
|
80
|
+
-> retrieve facts + findings + evidence chunks
|
|
81
|
+
-> build bounded context pack
|
|
82
|
+
-> answer with citations or export pack
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Why SQLite first
|
|
86
|
+
|
|
87
|
+
SQLite gives the CLI a single-file, copyable, inspectable, offline store. It supports transactions, graph-ish relationship tables, FTS5, and optional vector search via `sqlite-vec`.
|
|
88
|
+
|
|
89
|
+
Use Qdrant only when:
|
|
90
|
+
|
|
91
|
+
- a project is too large for comfortable local vector search
|
|
92
|
+
- multiple users need a shared vector index
|
|
93
|
+
- the CLI runs as a service rather than a project-local tool
|
|
94
|
+
|
|
95
|
+
Even with Qdrant enabled, SQLite remains the source of truth. Qdrant stores derived vector payloads keyed by SQLite chunk IDs.
|
|
96
|
+
|
|
97
|
+
## Analysis levels
|
|
98
|
+
|
|
99
|
+
### Level 0: extracted facts
|
|
100
|
+
|
|
101
|
+
- tables
|
|
102
|
+
- fields
|
|
103
|
+
- relationships/table occurrences
|
|
104
|
+
- scripts and script steps
|
|
105
|
+
- layouts and layout objects
|
|
106
|
+
- value lists
|
|
107
|
+
- custom functions
|
|
108
|
+
- privilege sets/accounts/extended privileges
|
|
109
|
+
- menus/file references
|
|
110
|
+
|
|
111
|
+
### Level 1: structural graphs
|
|
112
|
+
|
|
113
|
+
- field dependency graph
|
|
114
|
+
- script call graph
|
|
115
|
+
- layout to table occurrence map
|
|
116
|
+
- button/trigger to script activation map
|
|
117
|
+
- security capability matrix
|
|
118
|
+
|
|
119
|
+
### Level 2: migration semantics
|
|
120
|
+
|
|
121
|
+
- CRUD surfaces
|
|
122
|
+
- workflow candidates
|
|
123
|
+
- feature clusters
|
|
124
|
+
- business rules
|
|
125
|
+
- calculated field translation risks
|
|
126
|
+
- UI parity targets
|
|
127
|
+
- security/RBAC mappings
|
|
128
|
+
|
|
129
|
+
### Level 3: External LLM support hooks
|
|
130
|
+
|
|
131
|
+
- question intent routing
|
|
132
|
+
- retrieval context packs
|
|
133
|
+
- answer contracts for external LLMs
|
|
134
|
+
- contradiction/unknown reporting requirements
|
|
135
|
+
- exportable markdown/JSON context packets
|
|
136
|
+
|
|
137
|
+
FM2Web does not call an internal LLM. Its job is to make the extracted FileMaker evidence easy for another LLM/agent to consume safely.
|
|
138
|
+
|
|
139
|
+
## LLM grounding rule
|
|
140
|
+
|
|
141
|
+
Every non-trivial answer must cite one of:
|
|
142
|
+
|
|
143
|
+
- `entities.id`
|
|
144
|
+
- `relationships.id`
|
|
145
|
+
- `evidence.id`
|
|
146
|
+
- `findings.id`
|
|
147
|
+
- artifact path + span when available
|
|
148
|
+
|
|
149
|
+
If evidence is missing, the correct answer is an explicit unknown with the closest available facts.
|