Skip to content

docs: seed Golden Context#336

Merged
Tyler Pina (tylerpina) merged 3 commits into
masterfrom
docs/seed-golden-context
May 12, 2026
Merged

docs: seed Golden Context#336
Tyler Pina (tylerpina) merged 3 commits into
masterfrom
docs/seed-golden-context

Conversation

@tylerpina
Copy link
Copy Markdown
Contributor

@tylerpina Tyler Pina (tylerpina) commented May 11, 2026

Summary

Seeds the full Golden Context artifact set into contentful.java — a pure-Java SDK for Contentful's Content Delivery and Preview APIs.

Coverage: Before → After

Artifact Before After
README.md Exists (user-facing only) Enriched — agent navigation table appended
ARCHITECTURE.md Missing Created
AGENTS.md Missing Created
CONTRIBUTING.md Exists (minimal) Enriched — testing, commit convention, branch strategy, release process, CI table appended
docs/ADRs/ Missing Created — 7 ADRs + index
docs/specs/ Missing Scaffolded with .gitkeep + README
.bito.yaml Missing Created
.bito/guidelines/ Missing Created — review-posture, repo-truth-and-boundaries, domain-invariants

Artifacts Created

  • ARCHITECTURE.md — System context diagram, internal package map, data flow through the post-processing pipeline (localize → map → raw fields → rich text → link resolution), key dependencies table with ADR cross-references, configuration reference, Android specifics, release and distribution details.
  • AGENTS.md — Quick reference table, 13 sharp edges/invariants, key conventions, integration points, build verification loop.
  • CONTRIBUTING.md (enriched) — Added: testing section, commit convention, branch strategy, release process with Maven commands, CI/CD table.
  • README.md (enriched) — Added: "For Agents & Contributors" navigation table at bottom.
  • .bito.yaml — Comprehensive review mode, Bito guidelines enabled.
  • .bito/guidelines/review-posture.txt — SDK-specific review posture (public API contract, Android compat, post-processing pipeline focus).
  • .bito/guidelines/repo-truth-and-boundaries.txt — Doc-grounded review rules, Java 8 / Android 21 target enforcement, ADR update requirements.
  • .bito/guidelines/domain-invariants.txt — Exhaustive invariants: post-processing pipeline order, link resolution behavior, public API contract, Android compatibility, sensitive data, TransformQuery, sync, cross-space, release.
  • docs/specs/README.md — Scaffold with format guide.

ADRs Generated

ADR Title Source
0001 Maven as Build Tool pom.xml analysis
0002 Retrofit + OkHttp as HTTP Layer pom.xml + CDAClient.java analysis
0003 RxJava 3 for Reactive Access pom.xml + ObserveQuery.java analysis
0004 Automatic In-Memory Link Resolution Glean contractor handover doc, ResourceFactory.java
0005 Dev Container for Reproducible Dev Environment .devcontainer/ + Slack DX-822 thread
0006 TransformQuery: Annotation-Based Entry Mapping Glean contractor handover doc, TransformQuery.java
0007 Cross-Space Reference Resolution (v10.6.0) README + git log (PR #332)

Redactions Applied (Public Repo)

  • ARCHITECTURE.md: Replaced "private key stored in 1Password" → "private key managed by Contentful infrastructure team"
  • CONTRIBUTING.md: Replaced "stored in 1Password" → "obtain from your team lead"

Flagged Items

  • RxJava as non-optional dependency: RxJava 3 is included for all consumers even if they don't use reactive patterns, adding ~3 MB to the transitive footprint. A future improvement could make it optional via a separate artifact. Flagged in ADR 0003.
  • Checkstyle version: pom.xml pins Checkstyle 8.29 (released 2020) in a plugin dependency override — worth evaluating an upgrade.
  • Dependabot alert: GitHub flagged 1 high-severity vulnerability on the default branch at push time — unrelated to this PR, but worth addressing.
  • Release GPG key process: The release process requires a team-managed GPG key not documented in the repo. Consider a more explicit handoff document for future maintainers.
  • Integration tests: Integration tests exist but are not run in CI (require live Contentful credentials). No documentation on how to configure and run them was found in CONTRIBUTING.md prior to this PR — consider adding that as a follow-up.

Test Plan

  • Verify all links in AGENTS.md resolve to real files
  • Verify ./mvnw -B test still passes in the devcontainer
  • Spot-check ADR content against actual source code behavior
  • Confirm no internal/sensitive content is present (redaction pass completed above)

🤖 Generated with Claude Code

Summary by Bito

Seeds the full Golden Context artifact set into contentful.java — a pure-Java SDK for Contentful's Content Delivery and Preview APIs, adding comprehensive documentation and configuration for architecture, agents, contributions, ADRs, and automated review tools.

Detailed Changes
  • Adds .bito.yaml with comprehensive review mode settings and custom guidelines for domain invariants, repo boundaries, and review posture in .bito/guidelines/.
  • Creates ARCHITECTURE.md documenting system context, internal package maps, data flow through the post-processing pipeline, key dependencies with ADR cross-references, configuration reference, and Android specifics.
  • Creates AGENTS.md with a quick reference table, 13 sharp edges/invariants, key conventions, integration points, and build verification loop.
  • Enriches CONTRIBUTING.md by adding testing section, commit convention, branch strategy, release process with Maven commands, and CI/CD table.
  • Enriches README.md by appending "For Agents & Contributors" navigation table at the bottom.
  • Creates docs/ADRs/ with 7 ADRs (0001-0007) and index.md documenting decisions on Maven build tool, Retrofit+OkHttp HTTP layer, RxJava 3 reactive access, automatic link resolution, dev containers, TransformQuery annotation mapping, and cross-space resolution.
  • Scaffolds docs/specs/ with .gitkeep and README.md providing format guide for implementation-level specs.

Add ARCHITECTURE.md, AGENTS.md, 7 ADRs, Bito review config, docs/specs
scaffold, and agent navigation sections to README and CONTRIBUTING.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bito-code-review
Copy link
Copy Markdown

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted Summary
Other Improvements - Bito Configuration and Guidelines
Adds Bito configuration file and three guideline files defining domain invariants, repo boundaries, and review posture for automated code review.
Documentation - Architecture Documentation
Creates comprehensive architecture documentation covering system context, package maps, data flow, dependencies, configuration, and Android specifics.
Documentation - Agent Documentation
Creates agent-focused documentation with quick reference table, sharp edges, invariants, conventions, and integration points.
Documentation - Contributing and README Updates
Enriches CONTRIBUTING.md with testing, commit conventions, branch strategy, release process, and CI table; appends agent navigation table to README.md.
Documentation - Architecture Decision Records
Creates 7 ADRs documenting key decisions on build tools, HTTP layer, reactive access, link resolution, dev containers, TransformQuery, and cross-space references, plus an index.
Documentation - Specifications Scaffold
Scaffolds specs directory with .gitkeep and README explaining the spec format for implementation-level documentation.

@bito-code-review
Copy link
Copy Markdown

Functional Validation by Bito

SourceRequirement / Code AreaStatusNotes
DX-822, DX-843Create a reproducible dev environment for the contentful.java SDK✅ MetRequirement already implemented in existing code at .devcontainer/devcontainer.json and .devcontainer/Dockerfile.
.bito.yaml, domain-invariants.txt, repo-truth-and-boundaries.txt, review-posture.txt, AGENTS.md, ARCHITECTURE.md, CONTRIBUTING.md, README.md, 0001-maven-as-build-tool.md, 0002-retrofit-okhttp-as-http-layer.md, 0003-rxjava3-reactive-access.md, 0004-automatic-link-resolution.md, 0005-devcontainer-for-reproducible-dev-env.md, 0006-transform-query-annotation-mapping.md, 0007-cross-space-reference-resolution.md, README.md, README.mdAdded development tooling and documentation files including .bito.yaml, .bito/guidelines/domain-invariants.txt, .bito/guidelines/repo-truth-and-boundaries.txt, .bito/guidelines/review-posture.txt, AGENTS.md, ARCHITECTURE.md, CONTRIBUTING.md, README.md, docs/ADRs/0001-maven-as-build-tool.md, docs/ADRs/0002-retrofit-okhttp-as-http-layer.md, docs/ADRs/0003-rxjava3-reactive-access.md, docs/ADRs/0004-automatic-link-resolution.md, docs/ADRs/0005-devcontainer-for-reproducible-dev-env.md, docs/ADRs/0006-transform-query-annotation-mapping.md, docs/ADRs/0007-cross-space-reference-resolution.md, docs/ADRs/README.md, and docs/specs/README.md.⭕ Out of ScopeAdded development tooling and documentation files including .bito.yaml, .bito/guidelines/domain-invariants.txt, .bito/guidelines/repo-truth-and-boundaries.txt, .bito/guidelines/review-posture.txt, AGENTS.md, ARCHITECTURE.md, CONTRIBUTING.md, README.md, docs/ADRs/0001-maven-as-build-tool.md, docs/ADRs/0002-retrofit-okhttp-as-http-layer.md, docs/ADRs/0003-rxjava3-reactive-access.md, docs/ADRs/0004-automatic-link-resolution.md, docs/ADRs/0005-devcontainer-for-reproducible-dev-env.md, docs/ADRs/0006-transform-query-annotation-mapping.md, docs/ADRs/0007-cross-space-reference-resolution.md, docs/ADRs/README.md, and docs/specs/README.md.

@bito-code-review
Copy link
Copy Markdown

Impact Analysis by Bito

Interaction Diagram
sequenceDiagram
participant Dev as Developer
participant Repo as Repository
participant Config as .bito.yaml<br/>🟩 Added | ●●○ Medium
Dev->>Repo: Submit MR with new configuration files
Repo->>Config: Add .bito.yaml with guidelines
Config->>Repo: File created successfully
Repo->>Dev: MR ready for review
Dev->>Repo: Review guidelines in .bito.yaml
Repo->>Dev: Guidelines applied to future reviews
Dev->>Repo: Merge MR
Repo->>Config: Persist configuration
Config->>Repo: Configuration active
Repo->>Dev: Changes deployed
Dev->>Repo: Confirm no code functionality changed
Loading

This MR adds configuration and documentation files (.bito.yaml and associated guidelines) to improve review processes and document invariants, but does not modify any code functionality or system behavior. No upstream or downstream impacts detected in repository scan or cross-repo dependency analysis.

Code Paths Analyzed

Impact:
No functional changes. This PR adds comprehensive documentation and project context files only.

Flow:
N/A - Documentation-only changes with no code execution paths modified.

Direct Changes (Diff Files):
• .bito.yaml [1-24] — New Bito configuration file for PR review automation
• .bito/guidelines/domain-invariants.txt [27-79] — New domain invariants documentation for reviewers
• .bito/guidelines/repo-truth-and-boundaries.txt [82-94] — New guidelines for repository documentation alignment
• .bito/guidelines/review-posture.txt [97-109] — New PR review posture guidelines
• AGENTS.md [112-177] — New agent guide with quick reference and sharp edges
• ARCHITECTURE.md [180-304] — New architecture documentation with system context and data flow
• CONTRIBUTING.md [308-379] — Extended contributing guide with testing, commit conventions, and release process
• README.md [383-403] — Added agent/contributor reference section
• docs/ADRs/0001-maven-as-build-tool.md [406-432] — New ADR documenting Maven as build tool decision
• docs/ADRs/0002-retrofit-okhttp-as-http-layer.md [435-463] — New ADR documenting HTTP layer technology choice
• docs/ADRs/0003-rxjava3-reactive-access.md [466-491] — New ADR documenting RxJava 3 adoption
• docs/ADRs/0004-automatic-link-resolution.md [494-523] — New ADR documenting link resolution design
• docs/ADRs/0005-devcontainer-for-reproducible-dev-env.md [526-554] — New ADR documenting devcontainer adoption
• docs/ADRs/0006-transform-query-annotation-mapping.md [557-585] — New ADR documenting TransformQuery feature
• docs/ADRs/0007-cross-space-reference-resolution.md [588-620] — New ADR documenting cross-space resolution feature
• docs/ADRs/README.md [623-663] — New ADR index and format documentation
• docs/specs/README.md [666-699] — New specs directory documentation

Repository Impact:
Developer onboarding and agent-assisted reviews: New documentation significantly improves context for contributors and automated review tools
CI/CD configuration: .bito.yaml enables automated PR review features

Cross-Repository Dependencies:
None.

Database/Caching Impact:
• None

API Contract Violations:
None.

Infrastructure Dependencies:
None.

Additional Insights:
Documentation accuracy verification: Reviewers should verify that documented invariants (e.g., post-processing pipeline order, Android API 21 minimum, Java 8 target) match actual code implementation

Testing Recommendations

Frontend Impact:
None.

Service Integration:
None.

Data Serialization:
None.

Privacy Compliance:
None.

Backward Compatibility:
None.

OAuth Functionality:
• None

Reliability Testing:
• None

Additional Insights:
• Verify that documented domain invariants in .bito/guidelines/domain-invariants.txt match actual code behavior
• Confirm that AGENTS.md integration points (rich-text-renderer-java downstream consumer) are accurate
• Validate that ADR dates and version references (e.g., v10.6.0 for cross-space) match release history

Analysis based on known dependency patterns and edges. Actual impact may vary.

Copy link
Copy Markdown

@bito-code-review bito-code-review Bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #23d976

Actionable Suggestions - 4
  • CONTRIBUTING.md - 1
  • ARCHITECTURE.md - 1
  • AGENTS.md - 1
  • docs/ADRs/0006-transform-query-annotation-mapping.md - 1
Review Details
  • Files reviewed - 17 · Commit Range: 4208397..4208397
    • .bito.yaml
    • .bito/guidelines/domain-invariants.txt
    • .bito/guidelines/repo-truth-and-boundaries.txt
    • .bito/guidelines/review-posture.txt
    • AGENTS.md
    • ARCHITECTURE.md
    • CONTRIBUTING.md
    • README.md
    • docs/ADRs/0001-maven-as-build-tool.md
    • docs/ADRs/0002-retrofit-okhttp-as-http-layer.md
    • docs/ADRs/0003-rxjava3-reactive-access.md
    • docs/ADRs/0004-automatic-link-resolution.md
    • docs/ADRs/0005-devcontainer-for-reproducible-dev-env.md
    • docs/ADRs/0006-transform-query-annotation-mapping.md
    • docs/ADRs/0007-cross-space-reference-resolution.md
    • docs/ADRs/README.md
    • docs/specs/README.md
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at jared.jolton@contentful.com.

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread CONTRIBUTING.md Outdated
Comment on lines +47 to +48
- **Integration tests** require a live Contentful space and environment variables — not run in CI by default.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Inaccurate Integration Test Docs

The documentation states that integration tests require environment variables and are not run in CI by default, but inspection shows they use hardcoded values (e.g., space 'cfexampleapi') and are included in the CI 'mvn test' run. This could mislead contributors.

Code Review Run #23d976


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Comment thread ARCHITECTURE.md Outdated
- `ResourceUtils.mapResources()` — indexes assets and entries by ID
- `ResourceUtils.setRawFields()` — preserves the unprocessed field map for rich text access
- `RichTextFactory.resolveRichTextField()` — parses rich text JSON into the `CDARich*` node tree
- `ResourceUtils.resolveLinks()` — traverses the includes and replaces link stubs with the actual `CDAResource` objects (in-memory object graph)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Misleading link resolution doc

The description of ResourceUtils.resolveLinks() implies all link stubs are replaced with actual objects, but per ADR 0004 and AGENTS.md, unresolved links beyond depth 10 remain as placeholders. This could mislead developers expecting complete resolution.

Citations

Code Review Run #23d976


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Comment thread AGENTS.md Outdated
- **Android: never depend on `okhttp-jvm` directly when using `okhttp-android`** — exclude `okhttp-jvm` from this library to avoid duplicate-class errors on Android (see README and ADR 0002).
- **`TlsSocketFactory` only activates below Android API 20** — do not remove or gate it differently; it protects older devices.
- **`TransformQuery.observeAndTransform()` auto-injects a `select` filter** — if the annotation scanner has a bug, fields are silently dropped, not thrown as errors. Always validate field mapping in tests.
- **`logSensitiveData` defaults to `false`** — never flip this to `true` in production builds; auth tokens would be logged.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Incorrect Default Documentation

The documentation claims logSensitiveData defaults to false, but CDAClient.java line 583 initializes it to true in the Builder. This inconsistency could mislead developers about the default logging behavior for sensitive data.

Code Review Run #23d976


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them


## Context

Consumers often want to map CDA Entry responses to their own domain model classes rather than working with the generic `CDAEntry` + field maps. Without a mapping layer, consumers write repetitive boilerplate to extract typed fields from `CDAEntry.getField()`. A code generation approach (similar to ORM annotation processors) was considered but adds build complexity.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Grammar Typo

The '+' in 'generic CDAEntry + field maps' should be 'and' to fix the grammar error in the ADR context.

Code suggestion
Check the AI-generated fix before applying
Suggested change
Consumers often want to map CDA Entry responses to their own domain model classes rather than working with the generic `CDAEntry` + field maps. Without a mapping layer, consumers write repetitive boilerplate to extract typed fields from `CDAEntry.getField()`. A code generation approach (similar to ORM annotation processors) was considered but adds build complexity.
Consumers often want to map CDA Entry responses to their own domain model classes rather than working with the generic `CDAEntry` and field maps. Without a mapping layer, consumers write repetitive boilerplate to extract typed fields from `CDAEntry.getField()`. A code generation approach (similar to ORM annotation processors) was considered but adds build complexity.

Code Review Run #23d976


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@bito-code-review
Copy link
Copy Markdown

✅ Review Settings Overridden

Status: Overridden Successfully

Guidelines:

  • Accepted:

    • General : Domain Invariants
  • Rejected: Review Posture (parse error),Repo Truth And Alignment (parse error)

Note: Extra guidelines beyond 3 general purpose guidelines and 1 language specific guideline per language are not processed. Guidelines are fetched from the source branch.

Tyler Pina (tylerpina) and others added 2 commits May 12, 2026 11:12
- AGENTS.md: clarify that .select() with fields.* requires .withContentType()
  first (client-side IllegalStateException, not an API error); sys-only
  selections have no such requirement
- ARCHITECTURE.md: fix resolveLinks() description — it iterates entry
  content-type field definitions and looks up from the indexed maps, not
  "traverses the includes"; silently drops unresolved links
- CONTRIBUTING.md: correct integration test setup — credentials are
  hardcoded in test classes, no env vars needed; clarify tests run locally
  only, not in CI
- CONTRIBUTING.md: replace bare mvn with ./mvnw in release steps
Fix grammar typo in ADR 0006 (+ → and), correct logSensitiveData default
in AGENTS.md (false → true, matching CDAClient.java line 583), and fix
integration test CI claim in CONTRIBUTING.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tylerpina Tyler Pina (tylerpina) marked this pull request as ready for review May 12, 2026 17:31
@tylerpina Tyler Pina (tylerpina) requested a review from a team as a code owner May 12, 2026 17:31
@tylerpina Tyler Pina (tylerpina) merged commit 9e617cb into master May 12, 2026
9 checks passed
@tylerpina Tyler Pina (tylerpina) deleted the docs/seed-golden-context branch May 12, 2026 17:31
@bito-code-review
Copy link
Copy Markdown

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

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