Skip to content

Document source group API in the grimoire#789

Merged
jackfirth merged 10 commits into
masterfrom
grimoire-file-group
Jul 5, 2026
Merged

Document source group API in the grimoire#789
jackfirth merged 10 commits into
masterfrom
grimoire-file-group

Conversation

@jackfirth

Copy link
Copy Markdown
Owner

Continuing from #785, this PR documents how Resyntax searches for files to refactor.

jackfirth and others added 3 commits July 4, 2026 16:09
File portions were an intermediate pairing of a file path with a set
of line numbers used during file group resolution. They predate the
range set merging that file-groups-resolve performs, which makes them
obsolete: resolution now produces entries mapping file sources to line
range sets directly, and nothing outside the module ever used file
portions. Removing them also removes a latent contract mismatch, since
the file-portion constructor accepted mutable range sets while
file-portion-lines promised immutable ones.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude <claude@users.noreply.github.com>
@jackfirth jackfirth added the documentation Improvements or additions to documentation label Jul 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 1 file in this pull request and found no issues.

@coveralls

coveralls commented Jul 5, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 93.878% (+0.04%) from 93.837% — grimoire-file-group into master

Co-Authored-By: Claude <claude@users.noreply.github.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 1 file in this pull request and found no issues.

Also, move the source group section to just after the source section in the grimoire.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 1 file in this pull request and found no issues.

- "install" should have been "analyze" for Git repositories
- The diff-based line restriction includes a margin of context lines,
  not just the touched lines
- Single-source groups correspond to file sources specifically, not
  source? values in general (which include string sources)
- Make the bullet labels parallel

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 1 file in this pull request and found no issues.

jackfirth and others added 2 commits July 4, 2026 22:10
Source groups now form a commutative monoid: source-group-union
combines any number of groups into one, and empty-source-group is the
identity element. Since unioning is also idempotent, they're in fact a
bounded join-semilattice. The laws hold up to equal?, which is achieved
by an internal union-source-group struct that holds a normalized set of
non-union subgroups: flattening makes union associative, set semantics
make it commutative and idempotent, and collapsing singleton and empty
sets makes the identity law hold exactly rather than up to wrapping.

Consequently, source-groups-resolve is now source-group-resolve and
takes a single group; the CLI unions its target flags into one group
before resolving.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
source-group-union-all accepts any sequence of source groups, so
callers with collections don't need apply and list coercions; the
varargs source-group-union is now a convenience wrapper around it. The
CLI unions its vector of target flags with it directly.

The kind-specific predicates are no longer exported, since source
groups shouldn't be discriminated by kind, and the constructors now
just promise source-group? values.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 2 files in this pull request and found no issues.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 2 files in this pull request and found no issues.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 2 files in this pull request and found no issues.

@jackfirth jackfirth marked this pull request as ready for review July 5, 2026 06:30
@jackfirth jackfirth enabled auto-merge (squash) July 5, 2026 06:32

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 2 files in this pull request and found no issues.

@jackfirth jackfirth merged commit 868214e into master Jul 5, 2026
6 checks passed
@jackfirth jackfirth deleted the grimoire-file-group branch July 5, 2026 06:36

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Resyntax analyzed 2 files in this pull request and found no issues.

@jackfirth jackfirth changed the title Document file group API in the grimoire Document source group API in the grimoire Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants