Intent Phase 4 follow-up: include declForeign in hash/store persistence

t-736·WorkTask·
·
·
Created3 weeks ago·Updated3 weeks ago·pipeline runs →

Dependencies

Description

Edit

Fix content-addressing and store persistence to include declForeign.

Current state:

  • declForeign exists in AST.
  • Store hash canonicalization and persistence ignore foreign payload.
  • Two declarations differing only in foreign code can collide to same content hash.

Required behavior: 1. Include declForeign in canonical serialization used by computeHash. 2. Persist foreign metadata in store schema (e.g. foreign_lang, foreign_code) and round-trip it in queries/show output where appropriate. 3. Ensure intent load + store operations preserve distinction between declarations that differ only by foreign code. 4. Migration/backward compatibility: existing DBs should remain readable; schema upgrade path must be safe.

Tests:

  • Hash test: identical decl except foreign body should yield different content hashes.
  • Store test: loading two such decls should produce two stored defs, no alias collision.
  • Resolve/show tests should display expected distinct entries.

Acceptance:

  • Content-addressed identity reflects foreign payload; no collisions from foreign-only differences.

Timeline (1)