0%

Project-neutral keying and path normalization (D1a)

Goal

A shared cache object built in one project renders no other project’s directory in dwarf, diagnostics, or a runtime .trace() string.

Implementation Sketch

Derived from compiler_repo/docs/ori_lang/proposals/approved/cache-lifecycle-proposal.md. Implement the work items below in order; each maps to a design bullet in the approved proposal.

Spec References

  • Approved proposal: compiler_repo/docs/ori_lang/proposals/approved/cache-lifecycle-proposal.md
  • Umbrella invariant T4: compiler_repo/docs/ori_lang/proposals/approved/toolchain-philosophy-proposal.md

Work Items

  • Remove source-spelling and canonical-source from request_digest; add the stable logical module identity so byte-identical source at different module paths does not collide
  • Normalize source paths to a project-root-relative form before they enter DWARF at emission, with the consuming project’s root supplied at link time; agree with SOURCE_DATE_EPOCH treatment
  • Re-anchor DWARF/CodeView paths to the consuming project’s root in the compiler diagnostic renderer and debugger discovery
  • Normalize emit_trace_injection to store the root-relative form into TraceEntry.file (no re-anchor — a root-relative trace path is the correct terminal form)
  • Negative gate: block removal of the path fields until EVERY path surface — DWARF/CodeView, runtime TraceEntry.file, any future embedding — is normalized