Skip to content

feat(provenance): add core data structures and traits#8970

Open
ematipico wants to merge 1 commit intofeat/config-debuggingfrom
01-22-feat_provenance_add_core_data_structures_and_traits
Open

feat(provenance): add core data structures and traits#8970
ematipico wants to merge 1 commit intofeat/config-debuggingfrom
01-22-feat_provenance_add_core_data_structures_and_traits

Conversation

@ematipico
Copy link
Member

@ematipico ematipico commented Feb 5, 2026

Summary

This PR starts a feature that will allow for debugging configuration files, and discover which configuration changed a certain default.

This work is going to be shipped using stacked PRs using graphite (first time).

All PRs are going to be merged into feat/config-debugging. That branch, at the moment, contains some MD files that I used to generate a plan using AI.

This PR starts by creating the necessary traints for tracking the changed properties, using a trait called Provenance

Code is generated with AI and reviewed by me.

Test Plan

N/A

Docs

Phase 1 of Configuration Provenance Tracking feature.

Adds foundational types for tracking where configuration values come from:
- FieldQuery: Represents field paths using AstPtr for thread-safe, memory-efficient storage
- ProvenanceSource: Enum identifying config sources (base, extends, overrides, etc.)
- ProvenanceEntry: Records a field being set with its source and merge order
- OverrideProvenanceMetadata: Stores override patterns for lazy file-specific evaluation

All types include comprehensive unit tests. No integration with config loading yet.
@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2026

🦋 Changeset detected

Latest commit: 3fd4971

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@biomejs/biome Minor
@biomejs/cli-win32-x64 Minor
@biomejs/cli-win32-arm64 Minor
@biomejs/cli-darwin-x64 Minor
@biomejs/cli-darwin-arm64 Minor
@biomejs/cli-linux-x64 Minor
@biomejs/cli-linux-arm64 Minor
@biomejs/cli-linux-x64-musl Minor
@biomejs/cli-linux-arm64-musl Minor
@biomejs/wasm-web Minor
@biomejs/wasm-bundler Minor
@biomejs/wasm-nodejs Minor
@biomejs/backend-jsonrpc Patch
@biomejs/js-api Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member Author

ematipico commented Feb 5, 2026

@ematipico ematipico self-assigned this Feb 5, 2026
@github-actions github-actions bot added A-CLI Area: CLI A-Core Area: core A-Project Area: project A-Linter Area: linter A-Parser Area: parser A-Formatter Area: formatter A-Tooling Area: internal tools A-LSP Area: language server protocol L-JavaScript Language: JavaScript and super languages L-CSS Language: CSS L-JSON Language: JSON and super languages A-Diagnostic Area: diagnostocis L-HTML Language: HTML and super languages L-Grit Language: GritQL A-Type-Inference Area: type inference labels Feb 5, 2026
@ematipico ematipico force-pushed the feat/config-debugging branch from 52149fa to 6ccd85c Compare February 5, 2026 08:33
pub enum FieldQuerySegment {
/// A named field: stores a pointer to the JsonMemberName node
/// AstPtr is thread-safe (Send + Sync) and only 8 bytes
Field(AstPtr<JsonMemberName>),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a crucial part of the design. A query e.g. formatter.indentStyle is resolved against its a configuration file. A configuration file is resolved using its CST, so we store a pointer to possible node, so we store strings all over. It's possible this design will change once we're closer to its completion


/// Check if this override applies to the given file path
pub fn matches_file(&self, path: &Utf8Path) -> bool {
self.matchers.iter().any(|m| m.matches(path))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems iter().any() is not the same as matches_with_exceptions. matches_with_exceptions checks patterns from the end so the last matching pattern decides the result, and it supports ! exclude patterns. any() returns true on the first match, so it can be wrong for patterns like ["**/*.js", "!**/*.test.js"]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI A-Core Area: core A-Diagnostic Area: diagnostocis A-Formatter Area: formatter A-Linter Area: linter A-LSP Area: language server protocol A-Parser Area: parser A-Project Area: project A-Tooling Area: internal tools A-Type-Inference Area: type inference L-CSS Language: CSS L-Grit Language: GritQL L-HTML Language: HTML and super languages L-JavaScript Language: JavaScript and super languages L-JSON Language: JSON and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants