Skip to content

1.11 Implement manifest validation and extension discovery #12

Description

@goofmint

Part of Phase 1 — Core skeleton (tasks.md Task 1.11).

Summary

Implement extension discovery, Manifest validation, contribution registration without code execution, and API-version checking.

Details

  • Discovery order: embedded builtin/ registry → ~/.config/tecode/extensions/*/<workspace>/.tecode/extensions/*/ (Req 2.1).
  • Hand-rolled validator in core/host/validate.ts with precise, path-annotated error messages (no runtime schema library — binary size).
  • Invalid manifest → record HostError { extensionId?, path, message }, skip the extension, continue startup (Req 2.4).
  • Duplicate IDs: later discovery wins (workspace > user > builtin); shadowed one reported as a warning.
  • Registration walks contributes into: command registry (lazy commands), keymap layers, slot registry (lazy views), config schema registry, language registry, theme registry — without importing index.ts (Req 2.2).
  • API-version check: same major, host minor >= requested; incompatible → skipped with surfaced error (Req 2.7).

Completion requirements

  • Invalid manifest fixtures are skipped with useful errors; startup completes
  • Shadowing order verified with same-ID fixtures across the three locations
  • A module-load spy proves no extension index.ts executes during registration
  • API-version accept/reject matrix tested (same major/minor, older minor, newer minor, different major)
  • bun test and lint pass

References

  • requirements.md: Req 2.1–2.4, 2.7
  • design.md: §4.1, §4.3

Dependencies

Blocked by: 1.3 (#4), 1.4 (#5), 1.10 (#11).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions