Note
This page is generated from CONTRIBUTING.md. Edit the repository file, not this copy.
Contributing to LeanCorpus
Most contributions affect one part of the monorepo. You do not need to understand the complete search engine before making a useful change.
Choose your route
| I want to work on... | Start here |
|---|---|
| Indexing, search, codecs, storage, mapping or diagnostics | Continue with this guide |
| Analysers, tokenisers, filters, stemmers or languages | Contributing to Rowles.Text |
| Tests, benchmarks, profiling or repository tooling | Contributing to DevOps and tests |
| Documentation | Documentation contributor guide |
| A runnable example | Examples guide |
| Internal architecture | Contributor documentation |
Make your first change
1. Prepare the repository
From the repository root:
pwsh -NoProfile -File ./devops.ps1 bootstrap
./devops build
On Windows PowerShell:
pwsh -NoProfile -File ./devops.ps1 bootstrap
./devops.ps1 build
devops.ps1 bootstrap restores the pinned tools, builds and tests the managed host, then publishes and validates the current-RID apphost. build confirms that the normal Release configuration compiles.
Tip
Run ./devops --help for the current command contract. Use the repository entry point instead of assembling an undocumented sequence of dotnet commands.
2. Find the owning subsystem
Production code and its normal test area are paired:
| Production work | Implementation | Tests |
|---|---|---|
| Search | src/core/Rowles.LeanCorpus/Search/ |
src/devops/tests/Rowles.LeanCorpus.Tests.Core/Search/ |
| Indexing and lifecycle | src/core/Rowles.LeanCorpus/Index/ |
src/devops/tests/Rowles.LeanCorpus.Tests.Core/Index/ |
| Storage and files | src/core/Rowles.LeanCorpus/Store/ |
src/devops/tests/Rowles.LeanCorpus.Tests.Core/Store/ |
| Binary codecs | src/core/Rowles.LeanCorpus/Codecs/ |
src/devops/tests/Rowles.LeanCorpus.Tests.Core/CodecKit/ |
| Document mapping | src/core/Rowles.LeanCorpus/Mapping/ |
src/devops/tests/Rowles.LeanCorpus.Tests.Core/Mapping/ |
| Text analysis | src/core/Rowles.Text/Analysis/ |
src/devops/tests/Rowles.Text.Tests/ |
When a change crosses boundaries, put the implementation with the subsystem that owns the behaviour and give the test every accurate Area trait.
3. Run one focused test selection
For a search change:
pwsh ./devops.ps1 test -Suite core -Area Search
For an indexing change:
pwsh ./devops.ps1 test -Suite core -Area Index
For a Rowles.Text filter:
pwsh ./devops.ps1 test -Suite text -Area Filters
A focused selection should fail for the behaviour you are changing before it passes with the implementation.
4. Make the change and add evidence
Keep the change coherent:
- update the owning implementation;
- add or update tests at the closest useful level;
- preserve public and on-disk compatibility unless the change intentionally alters it;
- update XML documentation and examples when public behaviour changes;
- avoid unrelated formatting or refactoring.
Important
Native AOT, codec formats, index metadata, file lifetimes and Windows filesystem behaviour are first-class contracts. A focused Linux unit test cannot prove a platform-specific, persistence or native-publish claim.
5. Run affected tests
Before handing the change over:
pwsh ./devops.ps1 test affected
pwsh ./devops.ps1 test affected -Commit HEAD
pwsh ./devops.ps1 test affected -Commit caf4bd5
pwsh ./devops.ps1 test affected -Range HEAD~3..HEAD
Plain affected uses only modified, staged and untracked non-ignored files.
-Commit uses only the chosen commit (first parent, or the empty tree for a root
commit); -Range uses only the explicit range. Both ignore unrelated dirty state.
The options are mutually exclusive. Invalid revisions, unmapped paths and zero
targets remain hard failures.
Affected selection maps changed production paths through .config/devops/code-areas.json and runs tests carrying the matching Area traits.
If a new source path or subsystem is not mapped, update code-areas.json as part of the same change.
6. Add the extra validation your claim needs
| Change | Additional validation |
|---|---|
| Public API or normal implementation | ./devops build |
| Native AOT-sensitive path | pwsh ./devops.ps1 aot |
| Package or dependency boundary | pwsh ./devops.ps1 test -Suite architecture |
| Both target frameworks | Build with -Framework net10.0 and -Framework net11.0 |
| Performance claim | Relevant BenchmarkDotNet suite with controlled provenance |
| Documentation or examples | ./devops docs build --skip-benchmarks |
| Windows-specific behaviour | Validate on Windows and state the environment |
For a quick benchmark smoke run:
pwsh ./devops.ps1 benchmark -Suite query -Strat fast
Use -Controlled when comparing a repeatable, bounded workload. Do not make performance claims from a Debug build or one noisy sample.
7. Decide whether users need a changelog entry
Update the current release entry in the stream that owns the change:
| Change | Changelog |
|---|---|
Rowles.LeanCorpus and the LeanCorpus.Compression.* packages |
changelog/engine/unreleased.md |
Rowles.Text (standalone analysis package) |
changelog/text/unreleased.md |
| Community Server, Orchard Search and Studio packages | changelog/server/ |
| Managed DevOps tooling | changelog/devops/unreleased.md |
If a stream has no unreleased.md after a release, create it from that stream's _template.md.
Analysis source is compiled into both Rowles.Text and LeanCorpus (ADR021), so a shared analysis change gets a complete, separately worded entry in both the engine and Text changelogs.
Add an entry for:
- new features or public APIs;
- changed public behaviour;
- important performance improvements;
- compatibility changes;
- significant bug fixes.
End every item with its commit link. Documentation, benchmark and test-only changes, internal clean-ups, and fixes to behaviour that never shipped in a released version do not need a release note.
Test vocabulary
The detailed rules live in the DevOps and tests guide.
| Term | Meaning |
|---|---|
| Suite | The project to run, such as core, text or architecture |
| Category | The role of the test: Unit, Integration or Chaos |
| Area | The production contract protected by the test |
| Technique | How the test works, such as property-based, state-machine or metamorphic testing |
Generated files
Warning
Do not manually edit generated content under artifacts/. Change the source,
configuration or generator instead.
Before submitting
- [ ] The change solves one coherent problem.
- [ ] Tests protect observable behaviour.
- [ ]
pwsh ./devops.ps1 test affectedhas been run. - [ ] Compatibility and platform claims have matching evidence.
- [ ] Public documentation and examples remain accurate.
- [ ] The changelog was updated when users should know.
- [ ] Generated output was not edited directly.
For a major architectural change, discuss the design before building a large implementation around assumptions that have not been agreed.