StarLang: make the .star loader a closed validated language boundary #41

Closed
opened 2026-07-25 14:20:55 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-25 14:20:55 +00:00 (Migrated from github.com)

Goal

Turn the existing load-star-form prototype into a working .star file loader that returns validated normalized specification IR rather than merely returning one Common Lisp reader form.

Current state

prototypes/star-lang/common-lisp/core-surface-prototype.lisp currently:

  • opens a pathname;
  • binds *read-eval* to nil;
  • reads exactly one top-level form;
  • returns the raw form.

This is enough for the fixture, but it is not yet a closed StarLang language boundary. It still inherits the active Common Lisp package/readtable behavior, interns symbols, accepts reader syntax outside the StarLang grammar, and leaves compilation/semantic validation to the caller.

Required behavior

Implement a file-level loader that:

  1. accepts a .star pathname and reads exactly one spec-library unit;
  2. uses a closed/restricted reader or explicit parser for the StarLang surface grammar;
  3. does not execute reader evaluation or accept unrelated Common Lisp dispatch syntax;
  4. does not permit package-qualified symbols or uncontrolled package interning;
  5. compiles the parsed unit through compile-spec-library;
  6. returns validated normalized IR on success;
  7. returns structured StarLang conditions with pathname and useful source-position context on failure;
  8. preserves comments and ordinary whitespace behavior;
  9. performs no network access and no remote import resolution in this issue.

TDD acceptance cases

Add failing tests first for:

  • the existing fec-core.star fixture loads and compiles;
  • empty file;
  • multiple top-level forms;
  • non-spec-library top-level form;
  • malformed list/string syntax;
  • #. reader evaluation syntax;
  • unsupported dispatch syntax such as structure/pathname/vector reader forms;
  • package-qualified symbols;
  • duplicate declarations and invalid field/type declarations propagating as structured StarLang errors;
  • no package symbol-count growth from attacker-controlled identifiers after rejected inputs;
  • exact returned IR equals the direct compile-spec-library result for the fixture.

Boundaries

  • Keep remote URL imports and digest-locked import resolution for a follow-up issue.
  • Do not introduce EVAL or unrestricted reader macros.
  • Preserve the runtime-neutral normalized IR and optional runtime adapters.
  • CI must fail honestly on assertion failure, crash, timeout, fixture error, or zero selected tests.

Completion evidence

  • exact test command and output;
  • git diff --check;
  • StarLang Common Lisp workflow result;
  • research/index status updated without promoting an unapproved implementation design.
## Goal Turn the existing `load-star-form` prototype into a working `.star` file loader that returns validated normalized specification IR rather than merely returning one Common Lisp reader form. ## Current state `prototypes/star-lang/common-lisp/core-surface-prototype.lisp` currently: - opens a pathname; - binds `*read-eval*` to `nil`; - reads exactly one top-level form; - returns the raw form. This is enough for the fixture, but it is not yet a closed StarLang language boundary. It still inherits the active Common Lisp package/readtable behavior, interns symbols, accepts reader syntax outside the StarLang grammar, and leaves compilation/semantic validation to the caller. ## Required behavior Implement a file-level loader that: 1. accepts a `.star` pathname and reads exactly one `spec-library` unit; 2. uses a closed/restricted reader or explicit parser for the StarLang surface grammar; 3. does not execute reader evaluation or accept unrelated Common Lisp dispatch syntax; 4. does not permit package-qualified symbols or uncontrolled package interning; 5. compiles the parsed unit through `compile-spec-library`; 6. returns validated normalized IR on success; 7. returns structured StarLang conditions with pathname and useful source-position context on failure; 8. preserves comments and ordinary whitespace behavior; 9. performs no network access and no remote import resolution in this issue. ## TDD acceptance cases Add failing tests first for: - the existing `fec-core.star` fixture loads and compiles; - empty file; - multiple top-level forms; - non-`spec-library` top-level form; - malformed list/string syntax; - `#.` reader evaluation syntax; - unsupported dispatch syntax such as structure/pathname/vector reader forms; - package-qualified symbols; - duplicate declarations and invalid field/type declarations propagating as structured StarLang errors; - no package symbol-count growth from attacker-controlled identifiers after rejected inputs; - exact returned IR equals the direct `compile-spec-library` result for the fixture. ## Boundaries - Keep remote URL imports and digest-locked import resolution for a follow-up issue. - Do not introduce `EVAL` or unrestricted reader macros. - Preserve the runtime-neutral normalized IR and optional runtime adapters. - CI must fail honestly on assertion failure, crash, timeout, fixture error, or zero selected tests. ## Completion evidence - exact test command and output; - `git diff --check`; - StarLang Common Lisp workflow result; - research/index status updated without promoting an unapproved implementation design.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/starintel-auto-research#41
No description provided.