| name | native-translate |
| description | Classify a Rust construct's Mycelium native-translation strategy using the ratified DN-111 native-equivalence taxonomy — Native Equivalent · Idiomatic Remapping · Approximation · Interop Bridge (DN-110's Adaptation/Solution/Approximation/Bridge handles are permanent aliases). Runs DN-110 §9's six-step decision procedure: verify-first against the corpus, identify the underlying PROBLEM (not Rust's mechanism), classify by the {exact?}×{native?} generator, apply the DN-109 §3.2 auto-fire ratchet, and emit a register-style record with an honest, never-upgraded guarantee tag (VR-5). |
| when_to_use | Use whenever you need to decide "what is Mycelium's native answer to this Rust construct, and how faithful is it" — classifying a DN-99 register row, a transpiler gap-closure decision, a new `lower`/`derive` sugar, or a sugar-index `native_strategy` cell. Not a code generator: it produces a classification + citation, not the implementation. If the classification needs judgment the corpus can't ground, it says so (`unclassified # needs-review`) rather than guessing. |
| allowed-tools | Bash(git grep:*), Bash(grep:*), Bash(python3:*), Read, Grep, Glob |
/native-translate — the DN-111 native-equivalence classifier
Operational form of M-1056, spec'd by DN-110 §9 ("skill-derivable — the /native-translate
methodology") and vocabulary'd by DN-111 (the ratified canonical taxonomy). Input: one Rust
construct or surface gap. Output: a classified, cited native-translation record. This is a
classification procedure, not a decision engine or a code generator — it names the
relationship, it does not build the mechanism (DN-110/DN-54) or auto-fire a mapping (DN-109's
ratchet owns that).
The taxonomy (DN-111 §4) — four categories, generated by two questions
┌─ direct, structure-preserving ── Native Equivalent (alias: Adaptation)
┌─ exact? yes ──┤
│ └─ reformed, different form ────── Idiomatic Remapping (alias: Solution)
Rust ───┤
construct│ ┌─ native form + explicit residue ─ Approximation (alias: Approximation)
└─ exact? no ───┤
└─ cross a foreign boundary ─────── Interop Bridge (alias: Bridge)
Q1 — Exact? Does a fully-native Mycelium form preserve observable semantics exactly?
Q2a (if yes) — Direct or reformed? One named native construct maps structure-preservingly
(Native Equivalent), or the same problem needs a structurally different native convention
(Idiomatic Remapping — value-semantics functional update, errors-as-values, bounded control,
explicit swap)? Q2b (if no) — Residue or boundary? A native form exists with an explicit,
bounded delta (Approximation), or faithfulness requires crossing an FFI/wild/foreign-syntax
edge (Interop Bridge)?
The spectrum is monotone (equivalence decreases left→right) and time-indexed: under the
unfrozen kernel (ADR-045) a construct migrates leftward as the language closes gaps — every
classification is honestly "as of <tree-state>", never a permanent property (DN-111 §8.4).
The six-step procedure (DN-110 §9)
Step 1 — Verify-first (mitigation #14). Before classifying, confirm the construct isn't
already closed. Prefer mcp__tero__query_by_id / mcp__tero__text_search over git grep (VR-5 —
cited over hand-grep) against the DN-99 register (docs/notes/DN-99-Surface-Gap-Closure-Register.md)
and the offline index (docs/tero-index/INDEX.md if the MCP tools aren't available); grep
crates/mycelium-l1 / lib/compiler for an existing node or closure. If already closed, record
the landed basis — don't re-decide.
Step 2 — Identify the underlying PROBLEM, not Rust's mechanism. Ask "what does this construct
accomplish for the programmer?", never "what Rust feature is it?" (DN-109 F1). #[derive(Clone)]'s
problem is "generate a structural operation for a type," not "run a proc-macro."
Step 3 — Classify against the taxonomy (decision tree, correlated with — but orthogonal to —
DN-109's L4 decidability axis Mechanical/Heuristic/Judgment; DN-111 §6):
- Direct, first-class, auto-emittable, semantics-preserving native equivalent exists? →
Native Equivalent. Lookup: DN-99
closed/cl rows; the lexicon's Active constructs;
docs/sugar-index/INDEX.md.
- Else, does Mycelium solve the same problem via a different native convention? →
Idiomatic Remapping. Lookup: DN-106 (mutation→functional update), RFC-0007 §4.8 (
for),
DN-94/RT1 (excluded shared-mut), DN-99 idiom different-path rows. Safe/mechanical → auto-emit
candidate; needs judgment syn can't supply (aliasing, boundedness) → flag with
suggested_idiom, never a bare refusal.
- Else, is there a close native form with a real, explicit delta? → Approximation.
Rule: the delta MUST be stated, honest, never-silent (VR-5) — tag the gap, don't paper over it.
- Else (no full native form yet) → Interop Bridge. A temporary, clearly-marked crossing
(transpiler flag,
wild/FFI boundary, library-with-parser) with a suggested_idiom; bare
never-silent refusal is the last resort (DN-106 principle 2).
Step 4 — Apply the DN-109 §3.2 ratchet to any auto-fire. Auto-emit only if the mapping is (1)
semantics-preserving under value semantics, (2) inserts no swap (S1), (3) upgrades no guarantee
tag (VR-5), (4) is EXPLAIN-recorded. Any clause failing → downgrade Native-Equivalent/Idiomatic-
Remapping-auto to a flagged Approximation/Interop-Bridge.
Step 5 — Sugar-specific case. If the native answer is "a mechanically-lowering surface sugar"
(DN-106 gap-closure default), it should be authored as a lower-rule (DN-54 §6, zero L0-node
growth, reveal-able M-1051) — confirm the construct is NOT in DN-106's deliberate-exclusion set
first.
Step 6 — Produce the artifact — see the record schema below. Emit into the consuming register
(DN-99 row / DN-109 idiom_choices manifest / sugar-index native_strategy cell) — one shared
EXPLAIN trail, never a parallel artifact (DN-109 §7-c "extend, don't add").
Honesty posture per category (VR-5 ceiling — never upgraded past this basis)
| Category | Tag ceiling | Never-silent obligation |
|---|
| Native Equivalent | up to Exact/Proven where the underlying construct supports it | a mapping needing a swap or hygiene flag is not auto-fire — downgrade (Step 4) |
| Idiomatic Remapping | Exact only when the reformulation is provably semantics-preserving | exact-under-a-precondition (non-aliasing, boundedness) that fails degrades to Approximation/Interop Bridge — the tag drops with it |
| Approximation | at most Empirical (Declared if the bound is unmeasured); never Exact/Proven | the delta is the deliverable — recorded, EXPLAIN-able, flagged (G2) |
| Interop Bridge | describes the boundary, claims no native semantics | always flagged, carries a suggested_idiom; bare refusal is the last resort |
The (construct, context) trap — classify a pair, not a construct (DN-111 §8.1)
The same Rust construct can land in different cells depending on a semantic fact the syntax
doesn't reveal (canonical case: &mut — non-aliasing is Idiomatic Remapping, aliasing is
Approximation/Interop Bridge, and syn cannot prove which without MIR borrowck). When context
is unresolved, record the set of candidate cells with the discriminating precondition — never
assert a single cell as if it were unconditional. Two related seams to watch, not to hide
(DN-111 §8.2/§8.3): Native-Equivalent vs. Idiomatic-Remapping turns on whether the native answer
is "one named construct" or "a re-expression," and Approximation vs. Interop-Bridge turns on
whether the content stays expressed in native Mycelium (Approximation) or is foreign
data/syntax carried across (Interop Bridge) — wild itself folds both ends (a first-class native
construct whose role is the bridge).
The output artifact — record schema
construct: "<Rust construct or surface gap, e.g. `#[derive(Clone)]`>"
problem: "<what it accomplishes for the programmer — Step 2>"
context: "<the discriminating precondition, if the classification is context-dependent — §8.1>"
class: NativeEquivalent | IdiomaticRemapping | Approximation | InteropBridge
alias: Adaptation | Solution | Approximation | Bridge
native_target: "<the Mycelium construct/mechanism, with file:line or DN cite>"
delta: "<explicit residue — required for Approximation, empty for exact classes>"
tag: Exact | Proven | Empirical | Declared
decidability: Mechanical | Heuristic | Judgment
as_of: "<tree state classified against — tag stamped by Step 1, DN-111 §8.4>"
If a classification can't be grounded in a cited landed mechanism or register-verified closure,
emit class: unclassified # needs-review — <what's missing> instead of guessing (VR-5, house
rule #4) — mark it, don't fabricate a confident cell.
Worked example (grounded — from DN-111 §5.1)
construct: "Rust `#[derive(Clone, PartialEq)]`"
problem: "generate a structural operation for a type"
class: NativeEquivalent
alias: Adaptation
native_target: "`lower Name = <rhs>` + `derive Name for T` (DN-54/M-812, landed; parse.myc:3670)"
delta: ""
tag: Empirical
decidability: Mechanical
as_of: "dev tip 45927ea4 (2026-07-10)"
Consumers
- DN-99 register (
docs/notes/DN-99-Surface-Gap-Closure-Register.md) — a row's Closure approach column is this skill's native_target + class.
- DN-109
idiom_choices EXPLAIN manifest — gains a class field alongside its decidability
bucket (DN-111 §6, one trail).
- Sugar-index
native_strategy column (tools/grammar/sugar.yaml →
tools/grammar/sugar_index.py → docs/sugar-index/) — one class cell per sugar row, this
skill's output vocabulary verbatim.