Skip to content

Add agent guidance and quality profile for Zero-Allocation Hashing#100

Merged
peter-lawrey merged 20 commits into
developfrom
adv/develop
Apr 29, 2026
Merged

Add agent guidance and quality profile for Zero-Allocation Hashing#100
peter-lawrey merged 20 commits into
developfrom
adv/develop

Conversation

@peter-lawrey

@peter-lawrey peter-lawrey commented Nov 21, 2025

Copy link
Copy Markdown
Member

This PR adds contributor and AI-agent guidance for Zero-Allocation Hashing, expands the project documentation set, and introduces an optional quality profile for Checkstyle and SpotBugs.

What changed

  • Added AGENTS.md with Chronicle-wide contribution guidance covering:

    • British English and ISO-8859-1 text policy
    • Javadoc expectations
    • build and verification commands
    • commit and PR etiquette
    • documentation workflow expectations
    • Nine-Box requirement and decision tagging
    • module-specific notes for Zero-Allocation Hashing
  • Added CLAUDE.md with repository-specific guidance for Claude Code, including:

    • project overview
    • common Maven commands
    • architecture notes
    • key abstractions such as LongHashFunction, LongTupleHashFunction, and Access
    • algorithm and memory-access notes
    • development patterns for adding algorithms and access strategies
  • Added durable project documentation:

    • decision-log.adoc
    • project-requirements.adoc
  • Standardised existing AsciiDoc files by:

    • promoting document titles to top-level headings
    • adding :toc:, :lang: en-GB, and :source-highlighter: rouge
    • removing standalone toc::[] entries
    • replacing non-ISO-8859-1 punctuation and symbols with portable textual forms
  • Added a quality Maven profile that runs:

    • Checkstyle with Chronicle quality rules
    • SpotBugs with shared Chronicle filters
  • Renamed the JDK activation profile from jdk21-profile to jdk17-profile and widened activation to JDK 17+ while still compiling with maven.compiler.release=8.

  • Made small source cleanups required by quality checks:

    • documented DualHashFunction
    • added Checkstyle suppressions for legacy public factory names such as city_1_1, murmur_3, and wy_3
    • fixed Javadoc indentation in LongHashFunction
    • added explicit @Override annotations in Primitives

Why

The repository now has explicit instructions for both human contributors and AI agents, reducing drift in style, documentation, and review expectations. The added requirements and decision logs make the existing architecture easier to preserve and extend, especially for future clean-room or agent-assisted work.

The quality profile gives maintainers a repeatable way to run Chronicle’s shared static-analysis gates without changing the default build path.

@peter-lawrey peter-lawrey changed the title Adv/develop Add AI agent guidance and restructure Zero-Allocation Hashing docs Nov 21, 2025
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
25.6% Duplication on New Code (required ≤ 10%)

See analysis details on SonarQube Cloud

@tgd tgd removed their request for review April 28, 2026 08:59
@peter-lawrey peter-lawrey self-assigned this Apr 29, 2026
Pruning back the cosmetic churn that crept in via the lint/refactor
commits and fixing real bugs in the new docs.

Reverts to develop:
- WyHash.java, XXH3.java: undo _wymum/wyMum and XXH3_*/xxh3* renames so
  the source keeps visual parity with the upstream xxHash/wyHash C
  references. The same parity gap is already handled with
  @SuppressWarnings("checkstyle:MethodName") in LongHashFunction (kept).
- MurmurHash_3.java: undo the main 16-byte loop reorder (no JMH evidence
  attached) and revert the re-indented commented-out megaSwitch scratch.
- XxHash.java: undo the hashLong(long) seed init reorder.
- Access.java, Primitives.java, CityAndFarmHash_1_1.java: revert
  one-liner -> 4-line expansions and the static-private vs private-static
  reorderings. Kept @OverRide annotations on ByteOrderHelperReverse (real
  fix, not churn).
- .gitignore, java-stub Math.java/Unsafe.java, sun/nio/ch/DirectBuffer.java,
  *Test.java: revert blank-line-only changes.
- src/main/java/sun/nio/ch/package-info.java: removed - shipping a
  package-info for a JDK-owned package risks split-package issues; the
  existing DirectBuffer stub did not need it.

Bug fixes kept on this branch:
- DualHashFunction.java: Javadoc now precedes @ParametersAreNonnullByDefault
  (was placed between annotation and class declaration).
- XXH3.java:180 indentation fix (carried by the develop checkout).
- README.adoc: deduplicate :lang: and :source-highlighter: attributes that
  had been written twice; promote heading to level-0 = to match the other
  docs that gained :toc:.
- algorithm-profiles.adoc, architecture-overview.adoc, testing-strategy.adoc:
  restore :pp: ++ attribute so C{pp} expands to C++ (had been removed
  while the {pp} references were retained).
- architecture-overview.adoc: revert "MurmurHash3" -> "MurmurHash_3" in
  prose (only the Java class has the underscore; the algorithm name does
  not).
- CLAUDE.md: factory list corrected to farmNa/farmUo (was farmHashNa/
  farmHashUo); add xx128low; British-English the spellings; replace the
  duplicated ADR list with a pointer to decision-log.adoc; add -Pquality
  command; switch javadoc URL to https.
- AGENTS.md: drop trailing period on title; remove orphan AIDE reference;
  fix "across in" typo; fix bullet that lost its * marker; fix bullet
  list mixing * and -; replace the bogus `mvn -pl ... -am` instruction
  (single-module repo) with `mvn -Pquality verify`.
- project-requirements.adoc: rewrite IDs under the Nine-Box taxonomy
  (FN/NF-P/NF-S/NF-O) mandated by AGENTS.md; spell out the --add-opens
  flags; note the MurmurHash_3 / XxHash class names; drop the unused
  C-NNN constraints prefix.
- decision-log.adoc: add Date:: rows (template compliance); apply
  British-English spellings.

Net effect: same merged behaviour, ~600 fewer churn lines, no broken
{pp} references, doc IDs match the policy, Javadoc placement valid.
@sonarqubecloud

Copy link
Copy Markdown

@peter-lawrey peter-lawrey changed the title Add AI agent guidance and restructure Zero-Allocation Hashing docs Add agent guidance and quality profile for Zero-Allocation Hashing Apr 29, 2026
@peter-lawrey peter-lawrey merged commit 4a69691 into develop Apr 29, 2026
10 of 11 checks passed
@peter-lawrey peter-lawrey deleted the adv/develop branch April 29, 2026 14:42
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.

2 participants