Skip to content

Record where each default selection came from, and fields an evaluation computes - #52

Merged
clhodapp merged 1 commit into
mainfrom
feat/selection-records
Oct 21, 2026
Merged

clhodapp merged 1 commit into
mainfrom
feat/selection-records

Conversation

@clhodapp

@clhodapp clhodapp commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Two changes that let caisson record how a configuration selected its modules, the moduleImports and defaultModuleImports fields of design section 5.

  • Default selections are records. Each entry of a manifest's defaultModuleImports is now { select; file; level; } instead of a bare selection function. select is the selection, and file the file that gave it, as the integration of that level records it. level is the name path of the level, which caisson-core adds when it passes the default beneath. An integration gives its additions in forChildren.extraDefaultModuleImports as { select; file; }.
  • recordFromEvaluation. mkConfiguration takes the names of fields an evaluation computes for its manifest, and evaluate returns their values under record. The names are declared up front because a manifest's field names must be known before anything evaluates: the evaluation reads its own manifest, so names that depended on it would recurse. Each view records what its own evaluation returned. As with record, a name mkConfiguration writes is refused.

The events paragraph that #51 added to the mkConfiguration comment had landed in the middle of the forChildren paragraph. It now follows it.

Tests.

  • lifecycleDefaultAdditionsReachWhatIsBeneath gives its additions as records, and checks the file and level of each entry three levels down.
  • The new lifecycleAnEvaluationRecordsTheFieldsItsIntegrationNames checks that each view records what its own evaluation returned, and that naming history is refused.

The hermetic suite passes, 129 tests, and so does nix flake check.

nix-caisson/caisson#127 uses both.

🤖 Generated with Claude Code

…aluation computes

Each entry of a manifest's `defaultModuleImports` is now a record,
`{ select; file; level; }`, not a bare selection function: `select`
is the selection, `file` the file that gave it, as the integration of
the level records it, and `level` the name path of that level, which
caisson-core adds when it passes the default beneath. An integration
gives its additions in `forChildren.extraDefaultModuleImports` as
`{ select; file; }`.

`mkConfiguration` takes `recordFromEvaluation`, the names of fields an
evaluation computes for its manifest, and `evaluate` returns their
values under `record`. The names are declared because the names of a
manifest's fields are known before anything evaluates. Each view
records what its evaluation returned. As with `record`, a name
mkConfiguration writes is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@clhodapp clhodapp self-assigned this Oct 20, 2026
@clhodapp
clhodapp merged commit 502690f into main Oct 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant