|
| 1 | +# Copilot Crawl Track — README |
| 2 | + |
| 3 | +This directory (`.copilot-track/crawl/`) holds AI-assisted crawl-and-modernisation artefacts for the **MarkLogic Java Client API** repository. It is not part of the production library; contents are for developer guidance and AI context only. |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## What Is the Crawl Track? |
| 8 | + |
| 9 | +The crawl track is an incremental, evidence-driven workflow for making large-scale changes to this codebase using AI assistance (GitHub Copilot / agent mode). Changes are broken into small, reviewable PRs that form a **chain** — each PR builds on the previous one. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Chain-PR Pattern |
| 14 | + |
| 15 | +A chain-PR is a sequence of pull requests where each PR: |
| 16 | + |
| 17 | +1. Targets the **previous PR's branch** (not `main`) as its base, creating a linear dependency chain. |
| 18 | +2. Carries a **single, focused concern** (e.g., "migrate HTTP client from HttpClient to OkHttp", "update Jackson version", "replace deprecated API calls in DocMgr"). |
| 19 | +3. Is reviewed and merged in order — do **not** merge PR N+1 before PR N is merged and its branch updated. |
| 20 | + |
| 21 | +``` |
| 22 | +main ← PR-1 (foundation) ← PR-2 (layer A) ← PR-3 (layer B) ← ... |
| 23 | +``` |
| 24 | + |
| 25 | +When the base PR merges, rebase subsequent PRs down the chain to keep them conflict-free: |
| 26 | + |
| 27 | +```bash |
| 28 | +git fetch origin |
| 29 | +git checkout feature/crawl-layer-B |
| 30 | +git rebase origin/feature/crawl-layer-A |
| 31 | +git push --force-with-lease |
| 32 | +``` |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +## Evidence in PRs |
| 37 | + |
| 38 | +Every crawl PR must include evidence that the change is safe. Accepted evidence types: |
| 39 | + |
| 40 | +| Evidence | Where to add it | |
| 41 | +| ------------------------------------------------ | -------------------------------------------------------------------------- | |
| 42 | +| Passing CI green-check (unit + functional tests) | Shown automatically on the PR by Jenkins | |
| 43 | +| Before/after compile output | Paste in PR description under `## Build evidence` | |
| 44 | +| Test-coverage delta | Add `## Test delta` section; attach Gradle test report if coverage dropped | |
| 45 | +| Copilot prompt used | Add `## Prompt used` section (see below) | |
| 46 | +| Manual verification steps | Add `## Manual verification` with exact commands run | |
| 47 | + |
| 48 | +PRs that lack evidence will be marked **needs-evidence** and not merged. |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +## Prompt Usage |
| 53 | + |
| 54 | +AI prompts that drove a crawl change belong in the PR description under `## Prompt used`. This creates an audit trail and lets reviewers reproduce or adjust the change. |
| 55 | + |
| 56 | +**Template:** |
| 57 | + |
| 58 | +```markdown |
| 59 | +## Prompt used |
| 60 | + |
| 61 | +> Agent mode, model: claude-sonnet-4-6 |
| 62 | +> |
| 63 | +> "Migrate all usages of `com.marklogic.client.impl.OkHttpServices` constructor that |
| 64 | +> pass a plain `String` password to instead use `char[]` and call `Arrays.fill` after use. |
| 65 | +> Do not modify test files. Only change files under marklogic-client-api/src/main/." |
| 66 | +
|
| 67 | +Files changed by prompt: <!-- list them --> |
| 68 | +Files reviewed manually: <!-- list them --> |
| 69 | +``` |
| 70 | + |
| 71 | +Storing prompts in PRs helps future crawl passes understand _why_ a change was made, not just _what_ changed. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Adding New Crawl Artefacts |
| 76 | + |
| 77 | +Place any generated files, diff summaries, or migration notes inside this directory as flat Markdown or JSON files. Suggested naming: |
| 78 | + |
| 79 | +``` |
| 80 | +.copilot-track/crawl/ |
| 81 | +├── README.md ← this file |
| 82 | +├── 001-<topic>.md ← plan / notes for crawl step 1 |
| 83 | +├── 002-<topic>.md ← plan / notes for crawl step 2 |
| 84 | +└── ... |
| 85 | +``` |
| 86 | + |
| 87 | +Keep each step file small (< 200 lines). Reference `ai-track-docs/` for system-level context. |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +## Related Docs |
| 92 | + |
| 93 | +- [ai-track-docs/SYSTEM-OVERVIEW.md](../../ai-track-docs/SYSTEM-OVERVIEW.md) — what this project does and how it is structured |
| 94 | +- [ai-track-docs/build-test.md](../../ai-track-docs/build-test.md) — how to build and run tests locally |
| 95 | +- [ai-track-docs/architecture.mmd](../../ai-track-docs/architecture.mmd) — Mermaid architecture diagram |
0 commit comments