Skip to content

Commit f78785f

Browse files
committed
docs: define m2 explicit local import adapter contract
1 parent f32f068 commit f78785f

11 files changed

Lines changed: 687 additions & 0 deletions

docs/adr/0012-m2-local-extraction-import-scope.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,3 +212,23 @@ The next allowed step is:
212212
```text
213213
m2_explicit_local_import_adapter_contract
214214
```
215+
216+
## Explicit Local-Import Adapter Contract
217+
218+
The next contract-only boundary is documented in:
219+
220+
```text
221+
docs/m2-explicit-local-import-adapter-contract.md
222+
tests/fixtures/m2_explicit_local_import_adapter_scope.synthetic.json
223+
scripts/check_m2_explicit_local_import_adapter_contract.py
224+
```
225+
226+
It limits a future adapter to one explicitly supplied workspace-private export file and a
227+
metadata-summary-first dry-run. It does not read or parse a local export, import a DB, build an
228+
index, construct a graph, or complete any original M2 criterion.
229+
230+
The next allowed step is:
231+
232+
```text
233+
m2_explicit_local_import_adapter_dry_run
234+
```

docs/devlog/DECISIONS_PENDING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Decisions Pending
22

3+
- The M2 explicit local-import adapter contract is defined. Implement
4+
`m2_explicit_local_import_adapter_dry_run` next for one explicit workspace-private export file.
5+
- Keep file-content reads, parsing, real DB import, line-index construction, context-graph
6+
construction, and every original M2 completion flag false in that dry-run.
37
- The M2 synthetic context-graph builder review gate is implemented. Define
48
`m2_explicit_local_import_adapter_contract` next without reading a local export or implementing
59
the adapter.

docs/devlog/KNOWN_RISKS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Known Risks
22

3+
- The M2 explicit local-import adapter contract is static guardrail work only. Do not describe it
4+
as permission to read or parse an export, import a DB, build an index, or construct a graph.
5+
- A future `m2_explicit_local_import_adapter_dry_run` must accept one explicit workspace-private
6+
file only and summarize filesystem metadata without reading file contents.
37
- The M2 synthetic context-graph builder review gate is redacted evidence only. A passing review is
48
permission to define `m2_explicit_local_import_adapter_contract`, not to read a local export or
59
implement an adapter.

docs/devlog/NEXT_ACTIONS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Next Actions
22

3+
After the original M2 explicit local-import adapter contract:
4+
5+
1. Treat `docs/m2-explicit-local-import-adapter-contract.md`,
6+
`tests/fixtures/m2_explicit_local_import_adapter_scope.synthetic.json`, and
7+
`scripts/check_m2_explicit_local_import_adapter_contract.py` as the one-file private-input
8+
guardrail.
9+
2. Keep local-export reads, parsing, real DB import, indexing, graph construction, automatic
10+
discovery, and every original M2 completion flag blocked.
11+
3. Implement only a metadata-summary dry-run for one explicit workspace-private file next.
12+
13+
Recommended next safe step:
14+
15+
- Implement `m2_explicit_local_import_adapter_dry_run`.
16+
17+
---
18+
319
After the original M2 synthetic context-graph builder review gate:
420

521
1. Treat `scripts/review_m2_synthetic_context_graph_builder_dry_run.py` and

docs/devlog/SESSION_SUMMARY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Session Summary
22

3+
Original M2 explicit local-import adapter contract is implemented.
4+
5+
Completed in the latest session:
6+
- Added `docs/m2-explicit-local-import-adapter-contract.md`,
7+
`tests/fixtures/m2_explicit_local_import_adapter_scope.synthetic.json`, and
8+
`scripts/check_m2_explicit_local_import_adapter_contract.py`.
9+
- The contract limits a future adapter dry-run to one explicitly supplied workspace-private export
10+
file under `workspace/local-private/extraction-indexing/input/`.
11+
- The contract keeps implementation, local-export reads, parsing, real DB import, index
12+
construction, graph construction, and every original M2 completion flag blocked.
13+
- Wired the fixture-only checker into `scripts/check_all.py`.
14+
- The only approved next step is `m2_explicit_local_import_adapter_dry_run`.
15+
316
Original M2 synthetic context-graph builder review gate is implemented.
417

518
Completed in the latest session:
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# M2 Explicit Local-Import Adapter Contract
2+
3+
Original `M2 - Local extraction import` remains active and incomplete. This static contract defines
4+
the boundary for a later explicit local-import adapter. It does not read or parse a local export,
5+
import a database, build a line index, build a context graph, or complete any original M2
6+
criterion.
7+
8+
## Explicit Input Boundary
9+
10+
A future adapter may accept exactly one user-selected export file under:
11+
12+
```text
13+
workspace/local-private/extraction-indexing/input/
14+
```
15+
16+
The user must copy or place the export under the ignored workspace root and pass its exact path.
17+
The future adapter must not infer, discover, or search for an export.
18+
19+
This contract does not approve:
20+
21+
- directories as adapter inputs;
22+
- external absolute paths;
23+
- recursive discovery or arbitrary drive traversal;
24+
- automatic Steam or game-install scanning;
25+
- reading the selected file in this contract slice.
26+
27+
## Future Dry-Run Boundary
28+
29+
The first future implementation must remain metadata-summary-only. It may report:
30+
31+
- whether the explicit file exists;
32+
- whether the selected input is a file;
33+
- the file size in bytes;
34+
- redacted blocker categories;
35+
- schema compatibility as deferred.
36+
37+
Future private output is allowed only under:
38+
39+
```text
40+
workspace/local-private/extraction-indexing/import/
41+
```
42+
43+
Tracked output must not contain local paths, filenames, file contents, extracted text, payloads,
44+
logs, screenshots, OCR output, save data, decompiled data, provider payloads, or runtime evidence.
45+
46+
## Safety Boundary
47+
48+
This contract does not permit:
49+
50+
- real local-export reads or parsing;
51+
- real DB import;
52+
- line-index or context-graph construction from private input;
53+
- automatic Steam, game-install, or drive scanning;
54+
- BepInEx or game-log reads;
55+
- screenshots, OCR, saves, or decompiled-code work;
56+
- current-line capture, UI text reading, Unity scanning, hooks, or Harmony patches;
57+
- provider execution or companion HTTP contract changes;
58+
- committed extracted text, payloads, indexes, or private paths.
59+
60+
## Fixture And Checker
61+
62+
The machine-readable scope fixture is:
63+
64+
```text
65+
docs/m2-explicit-local-import-adapter-contract.md
66+
tests/fixtures/m2_explicit_local_import_adapter_scope.synthetic.json
67+
scripts/check_m2_explicit_local_import_adapter_contract.py
68+
```
69+
70+
Validate the contract with:
71+
72+
```powershell
73+
python scripts/check_m2_explicit_local_import_adapter_contract.py --quiet
74+
```
75+
76+
The next allowed step is:
77+
78+
```text
79+
m2_explicit_local_import_adapter_dry_run
80+
```

docs/m2-synthetic-context-graph-contract.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,16 @@ The next allowed step is:
132132
```text
133133
m2_explicit_local_import_adapter_contract
134134
```
135+
136+
## Explicit Local-Import Adapter Contract
137+
138+
The next contract-only boundary is documented in:
139+
140+
```text
141+
docs/m2-explicit-local-import-adapter-contract.md
142+
tests/fixtures/m2_explicit_local_import_adapter_scope.synthetic.json
143+
scripts/check_m2_explicit_local_import_adapter_contract.py
144+
```
145+
146+
It permits only a later metadata-summary dry-run for one explicit workspace-private export file.
147+
It does not approve local-export reads, parsing, DB import, indexing, or graph construction.

scripts/check_all.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,14 @@ def main() -> int:
341341
"--quiet",
342342
],
343343
),
344+
(
345+
"M2 explicit local-import adapter contract",
346+
[
347+
sys.executable,
348+
"scripts/check_m2_explicit_local_import_adapter_contract.py",
349+
"--quiet",
350+
],
351+
),
344352
(
345353
"BepInEx bridge safety smoke",
346354
[

0 commit comments

Comments
 (0)