refactor: simplify distillation data layout

This commit is contained in:
Jerry
2026-07-27 17:40:16 +08:00
parent 8895178844
commit c8dbc51549
34 changed files with 132 additions and 7791 deletions
@@ -10,11 +10,10 @@ published library and require repeated support before promoting any experience.
## Required workflow
1. Put source `.step` or `.stp` files in
`workspace/teacher/inbox/`. Only deterministic ingestion and Agent B may
access this vault.
2. Parse every new, content-unique STEP into visible private JSON under
`workspace/teacher/evidence/`:
1. Put source `.step` or `.stp` files directly in `input/`. Git ignores this
directory; only deterministic ingestion and Agent B may access it.
2. Parse every new, content-unique STEP into private JSON under
`runs/evidence/`:
```bash
../../scripts/cad-experience extract-folder
@@ -26,11 +25,11 @@ published library and require repeated support before promoting any experience.
../../scripts/cad-experience prepare
```
4. Read `workspace/promotion/candidates/semantic-batch.json` completely. Act as the semantic
4. Read `runs/review/semantic-batch.json` completely. Act as the semantic
distiller: compare families, parameter roles, datum roles, canonical
reconstruction stages, feature cardinality classes, relations, prior
vocabulary, failure rules, and validation targets; then author
`workspace/promotion/candidates/experience-draft.json` using
`runs/review/experience-draft.json` using
`references/llm-review-contract.md`.
Propose methods, invariants, and family-level `reconstruction_grammar`
@@ -44,7 +43,7 @@ published library and require repeated support before promoting any experience.
```bash
../../scripts/cad-experience publish \
--draft ../../workspace/promotion/candidates/experience-draft.json
--draft ../../runs/review/experience-draft.json
```
The publisher recomputes support from the private corpus, rejects numeric
@@ -55,14 +54,14 @@ published library and require repeated support before promoting any experience.
```bash
python scripts/cad_experience.py audit \
../../workspace/promotion/promoted/library.json
../../output/library.json
```
7. Query only the published library for creation, modification, or rebuilding:
```bash
python scripts/cad_experience.py query \
../../workspace/promotion/promoted/library.json \
../../output/library.json \
--family flanged_hub_adapter \
--features base_flange,hollow_sleeve,counterbore
```
@@ -88,8 +87,10 @@ required.
family without publishing any teacher dimensions.
- Exact source paths, hashes, dimensions, coordinates, and face references are
permitted in private case JSON and forbidden in the published library.
- Keep input/output as a human-visible staging area and induction corpus. Never
use it directly during creation, modification, or reconstruction.
- Keep `input/` and `runs/` as a local-only induction corpus. Never use them
directly during ordinary creation, modification, or reconstruction.
- Commit only the verified runtime library in `output/`; never commit source
STEP files, extracted evidence, review drafts, reports, or rebuilt parts.
- A semantic candidate is not a trusted design method until repeated,
independently sourced cases satisfy the promotion policy.
@@ -2,8 +2,8 @@
Case JSON is private evidence used only during induction. It may contain exact
parameters, but the inducer never copies those fields into published experience.
Store source STEP files in `workspace/teacher/inbox` and generated private
evidence in `workspace/teacher/evidence`.
Store source STEP files in `input/` and generated private evidence in
`runs/evidence/`.
Do not pass either folder or a case JSON to cad-router or a CAD backend.
Creation, modification, and reconstruction may consume only the promoted public
@@ -1,10 +1,10 @@
# LLM semantic review contract
Read the sanitized `work/review/semantic-batch.json`, not raw STEP geometry.
Read the sanitized `runs/review/semantic-batch.json`, not raw STEP geometry.
Maintain stable proposal identifiers when an existing candidate expresses the
same method.
Write `work/review/experience-draft.json` with this shape:
Write `runs/review/experience-draft.json` with this shape:
```json
{
@@ -618,17 +618,15 @@ def plugin_root() -> Path:
def default_library_path() -> Path:
return (
plugin_root()
/ "workspace"
/ "promotion"
/ "promoted"
/ "library.json"
)
return plugin_root() / "output" / "library.json"
def parser_root() -> Path:
return plugin_root() / "workspace" / "teacher"
def input_root() -> Path:
return plugin_root() / "input"
def runs_root() -> Path:
return plugin_root() / "runs"
def step_files(root: Path) -> list[Path]:
@@ -684,7 +682,7 @@ def extract_folder(input_dir: Path, output_dir: Path) -> dict[str, Any]:
def default_review_dir() -> Path:
return plugin_root() / "workspace" / "promotion" / "candidates"
return runs_root() / "review"
def prepare_semantic_batch(
@@ -1088,15 +1086,15 @@ def build_parser() -> argparse.ArgumentParser:
extract_folder_parser = subparsers.add_parser("extract-folder")
extract_folder_parser.add_argument(
"--input", type=Path, default=parser_root() / "inbox"
"--input", type=Path, default=input_root()
)
extract_folder_parser.add_argument(
"--output", type=Path, default=parser_root() / "evidence"
"--output", type=Path, default=runs_root() / "evidence"
)
prepare_parser = subparsers.add_parser("prepare")
prepare_parser.add_argument(
"--input", type=Path, default=parser_root() / "evidence"
"--input", type=Path, default=runs_root() / "evidence"
)
prepare_parser.add_argument(
"--library", type=Path, default=default_library_path()
@@ -1110,7 +1108,7 @@ def build_parser() -> argparse.ArgumentParser:
publish_parser = subparsers.add_parser("publish")
publish_parser.add_argument("--draft", type=Path, required=True)
publish_parser.add_argument(
"--input", type=Path, default=parser_root() / "evidence"
"--input", type=Path, default=runs_root() / "evidence"
)
publish_parser.add_argument(
"--library", type=Path, default=default_library_path()
@@ -1125,7 +1123,7 @@ def build_parser() -> argparse.ArgumentParser:
help="LLM-authored proposal draft. Without this, publishing is blocked.",
)
distill_parser.add_argument(
"--input", type=Path, default=parser_root() / "evidence"
"--input", type=Path, default=runs_root() / "evidence"
)
distill_parser.add_argument(
"--library", type=Path, default=default_library_path()