Walking skeleton — thinnest end-to-end SCIP slice
Goal
Prove the full emit->serialize->import pipe end-to-end on one symbol before any accuracy work, so every later section extends a working spine rather than integrating cold.
Implementation Sketch
- oric’s CLI dispatch is a
match command.as_str()ladder atcompiler_repo/compiler/oric/src/main.rs:59(arms"build":60,"run":81,"check":201,"fmt":232). - Add an
"emit-scip"arm that mirrors the"check"arm’s frontend setup, then walks the typed IR. - Command handlers live under
compiler_repo/compiler/oric/src/commands/with apub usere-export block incompiler_repo/compiler/oric/src/commands/mod.rs:74-92; add a newemit_scipmodule +pub use emit_scip::emit_scip_file. - The typed IR is obtained via the Salsa query
typed()(compiler_repo/compiler/oric/src/query/mod.rs:229) +typed_pool()(:255);report_frontend_errors(compiler_repo/compiler/oric/src/commands/mod.rs:122) returns aFrontendResult { type_result, pool }already wired forcheck_file. - For the skeleton, emit one
SymbolInformationper top-level function name inTypedModule.functions(compiler_repo/compiler/ori_types/src/output/typed_module.rs:132). - No scip crate exists in the workspace today (grounded:
grep scip compiler_repo/compiler/*/Cargo.tomlis empty) — adding the SCIP protobuf dependency is part of section-01’s work; the skeleton MAY emit a hand-rolled minimal index to de-risk before the dependency lands. - The importer side reuses the symbol MERGE batch at
intel_repo/neo4j/extract_symbols.py:600-620(MERGE (s:Symbol ...)+MERGE (f)-[:DECLARES]->(s)at:619).
Spec References
- SCIP protobuf schema (Sourcegraph scip.proto):
Index { metadata, documents: [Document] },Document { relative_path, symbols: [SymbolInformation], occurrences: [Occurrence] }. - PC-2 typed-IR contract:
typeck.md §PC-2(every ExprId carries a resolved Idx; all method calls statically resolved). - No Ori spec clause governs SCIP output (tooling surface).
Work Items
- Stand up the thinnest end-to-end slice: oric emits ONE trivial SCIP definition SymbolInformation for a single top-level
@fnfrom a real .ori file, and the intel_repo importer ingests that one symbol into Neo4j. No resolution, no occurrences, no provenance yet — only the pipe fromoric emit-scip-> index.scip -> Neo4j :Symbol node.
Test Coverage
- L1 Parse — COVERED: the skeleton runs
oric emit-scipon a real .ori file, which requires the file to parse. - L12 Production entry point — COVERED: the criterion drives the REAL
oric emit-scipCLI on a REAL target and pipes the result through the REAL importer, asserting the Neo4j :Symbol node exists end-to-end. - L2 Typecheck — COVERED (shallow): the skeleton reads
TypedModule.functions, which requires a clean type-check; deep trait-dispatch resolution is section-02’s concern. - L3 Canonicalize / L4 ARC-AIMS / L5 Eval / L6 LLVM-debug / L7 LLVM-release / L8 AOT — N/A: the emitter reads typed IR after PC-2, runs no program, lowers no runtime, emits no native binary.
- L9 Dual-execution parity — N/A: emitter, not an eval-path.
- L10 Leak check — N/A:
ORI_CHECK_LEAKSinstruments Ori-program RC at runtime; this compile-time subcommand never runs the program. - L11 Spec conformance — N/A: SCIP emission is tooling output, not spec-defined Ori language behavior.