You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -27,63 +25,96 @@ It is illegal to `-am` when running tests!
27
25
It is illegal to `-q` when running tests!
28
26
29
27
> **Clarification:** For **strictly behavior‑neutral refactors** that are already **fully exercised by existing tests**, or for **bugfixes with an existing failing test**, you may use **Routine B — Change without new tests**. In that case you must capture **pre‑change passing evidence** at the smallest scope that hits the code you’re about to edit, prove **Hit Proof**, then show **post‑change passing evidence** from the **same selection**.
30
-
> **No exceptions for any behavior‑changing change** — for those, you must follow **Routine A — Full TDD**.
28
+
> **No exceptions for any behavior‑changing change** — for those, you must follow **Routine A — Full TDD** or **Routine D — ExecPlans**.
31
29
32
30
---
33
31
34
-
## Three Routines: Choose Your Path
32
+
## Four Routines: Choose Your Path
35
33
36
34
**Routine A — Full TDD (Default)**
37
35
**Routine B — Change without new tests (Proportional, gated)**
38
36
**Routine C — Spike/Investigate (No production changes)**
37
+
**Routine D — ExecPlans: Complex features or significant refactors**
39
38
40
39
### Decision quickstart
41
40
42
-
1.**Is new externally observable behavior required?**
43
-
→ **Yes:****Routine A (Full TDD)**. Add the smallest failing test first.
41
+
1.**Is ExecPlans required (complex feature, significant refactor or requested by the user)?**
42
+
→ **Yes:****Routine D (ExecPlans)**. Use an ExecPlan (as described in .agent/PLANS.md) from design to implementation.
44
43
→ **No:** continue.
45
44
46
-
2.**Does a failing test already exist in this repo that pinpoints the issue?**
47
-
→ **Yes:****Routine B (Bugfix using existing failing test).**
48
-
→ **No:** continue.
45
+
2**Is new externally observable behavior required?**
46
+
→ **Yes:****Routine A (Full TDD)**. Add the smallest failing test first.
47
+
→ **No:** continue.
49
48
50
-
3.**Is the edit strictly behavior‑neutral, local in scope, and clearly hit by existing tests?**
51
-
→ **Yes:****Routine B (Refactor/micro‑perf/documentation/build).**
52
-
→ **No or unsure:** continue.
49
+
3**Does a failing test already exist in this repo that pinpoints the issue?**
50
+
→ **Yes:****Routine B (Bugfix using existing failing test).**
51
+
→ **No:** continue.
53
52
54
-
4.**Is this purely an investigation/design spike with no production code changes?**
55
-
→ **Yes:****Routine C (Spike/Investigate).**
56
-
→ **No or unsure:****Routine A.**
53
+
4**Is the edit strictly behavior‑neutral, local in scope, and clearly hit by existing tests?**
54
+
→ **Yes:****Routine B (Refactor/micro‑perf/documentation/build).**
55
+
→ **No or unsure:** continue.
56
+
57
+
5**Is this purely an investigation/design spike with no production code changes?**
58
+
→ **Yes:****Routine C (Spike/Investigate).**
59
+
→ **No or unsure:****Routine A.**
57
60
58
61
**When in doubt, choose Routine A (Full TDD).** Ambiguity is risk; tests are insurance.
59
62
60
63
---
61
64
65
+
## ExecPlans
66
+
67
+
When writing complex features or significant refactors, use an ExecPlan (as described in PLANS.md) from design to implementation.
68
+
62
69
## PIOSEE Decision Model (Adopted)
63
70
64
-
Use PIOSEE on every task to structure thinking and execution. It complements the routines below and ties directly into the Traceability trio (Description, Evidence, Plan).
71
+
Use this as a compact, repeatable loop for anything from a one‑line bug fix to a multi‑quarter program.
72
+
73
+
### P — **Problem**
74
+
75
+
**Goal:** State the core problem and what “good” looks like.
76
+
**Ask:** Who’s affected? What outcome is required? What happens if we do nothing?
**Ask:** What do logs/metrics/user feedback say? What constraints (security, compliance, budget, SLA/SLO)? What assumptions must we test?
83
+
84
+
### O — **Options**
85
+
86
+
**Goal:** Generate viable ways forward, including “do nothing.”
87
+
**Ask:** What are 2–4 distinct approaches (patch, redesign, buy vs. build, defer)? What risks, costs, and second‑order effects?
88
+
**Tip:** Check guardrails: reliability, security/privacy, accessibility, performance, operability, unit economics.
89
+
90
+
### S — **Select**
91
+
92
+
**Goal:** Decide deliberately and document why.
93
+
**Ask:** Which option best meets the success criteria under constraints? Who is the decision owner? What’s the fallback/abort condition?
94
+
**Tip:** Use lightweight scoring (e.g., Impact×Confidence÷Effort) to avoid bike‑shedding.
65
95
66
-
- Problem: restate the task in one sentence, note constraints/timebox, and identify likely routine (A/B/C).
67
-
- Information: inspect modules and AGENTS.md, gather environment constraints, locate existing tests/reports, and search code to localize the work.
68
-
- Options: list 2–3 viable approaches (routine choice, test scope, fix location) and weigh them with the Proportionality Model.
69
-
- Select: choose one option and routine; update the Living Plan with exactly one `in_progress` step.
70
-
- Execute: follow the Working Loop and house rules; for Routine A add the smallest failing test first; capture an Evidence block after each grouped action.
71
-
- Evaluate: check against the Definition of Done; if gaps remain, adjust the plan or change routine; record final Evidence and a brief retrospective.
96
+
### E — **Execute**
72
97
73
-
PIOSEE → Traceability trio mapping
74
-
- P/I/O → Description
75
-
- S → Plan (one `in_progress`)
76
-
- E/E → Evidence and Verification
98
+
**Goal:** Ship safely and visibly.
99
+
**Ask:** What is the smallest safe slice? How do we de‑risk (feature flag, canary, dark launch, rollback)? Who owns what?
100
+
**Checklist:** Traces/logs/alerts; security & privacy checks; docs & changelog; incident plan if relevant.
77
101
78
-
For documentation‑only edits and other Routine B cases, still run PIOSEE briefly to confirm neutrality and reversibility.
102
+
### E — **Evaluate**
103
+
104
+
**Goal:** Verify outcomes and learn.
105
+
**Ask:** Did metrics hit targets? Any regressions or side effects? What will we keep/change next loop?
**Tip:** If outcomes miss, either **iterate** (new Options) or **reframe** (back to Problem).
108
+
109
+
---
79
110
80
111
### Benchmarking workflow (repository-wide)
81
112
82
113
The `scripts/run-single-benchmark.sh` helper is the supported path for spot-checking performance optimisations. It builds the chosen module with the `benchmarks` profile, constrains the benchmark selection to a single `@Benchmark` method, and when `--enable-jfr` is supplied it enforces repeatable profiling defaults (no warmup, ten 10-second measurements, one fork) while clearly reporting the destination of the generated JFR recording. Lean on this script whenever you need a reproducible measurement harness.
83
114
84
115
## Proportionality Model (Think before you test)
85
116
86
-
Score the change on these lenses. If any are **High**, prefer **Routine A**.
117
+
Score the change on these lenses. If any are **High**, prefer **Routine A or D**.
-**Blast radius:** number of modules/classes touched; public vs internal.
@@ -105,7 +136,7 @@ Score the change on these lenses. If any are **High**, prefer **Routine A**.
105
136
* Relevant module tests pass; failures triaged or crisply explained.
106
137
* Only necessary files changed; headers correct for new files.
107
138
* Clear final summary: what changed, why, where, how verified, next steps.
108
-
***Evidence present:** failing test output (pre‑fix) and passing output (post‑fix) are shown for Routine A; for Routine B show **pre/post green** from the **same selection** plus **Hit Proof**.
139
+
***Evidence present:** failing test output (pre‑fix) and passing output (post‑fix) are shown for Routine A; for Routine B show **pre/post green** from the **same selection** plus **Hit Proof**; for Routine D NO EVIDENCE.
109
140
110
141
### No Monkey‑Patching or Band‑Aid Fixes (Non‑Negotiable)
111
142
@@ -245,8 +276,8 @@ It is illegal to `-q` when running tests!
245
276
The Maven reactor resolves inter-module dependencies from the configured local Maven repository (here: `.m2_repo`).
246
277
Running `install` publishes your changed modules there so downstream modules and tests pick up the correct versions.
247
278
248
-
* Always run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install | tail -200` before you start working. This command typically takes up to 30 seconds. Never use a small timeout than 30,000 ms.
249
-
* Always run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick install | tail -200` before any `verify` or test runs.
279
+
* Always run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick clean install | tail -200` before you start working. This command typically takes up to 30 seconds. Never use a shorter timeout than 30,000 ms.
280
+
* Always run `mvn -o -Dmaven.repo.local=.m2_repo -Pquick clean install | tail -200` before any `verify` or test runs.
250
281
* If offline resolution fails due to a missing dependency or plugin, rerun the exact `install` command once without `-o`, then return offline.
251
282
* Skipping this step can lead to stale or missing artifacts during tests, producing confusing compilation or linkage errors.
252
283
* Always use a workspace-local Maven repository: append `-Dmaven.repo.local=.m2_repo` to all Maven commands (install, verify, formatter, etc.).
@@ -340,6 +371,14 @@ It is illegal to `-q` when running tests!
340
371
341
372
---
342
373
374
+
## Routine D — ExecPlans
375
+
376
+
> Use for **complex features or significant refactors**.
377
+
378
+
When writing complex features or significant refactors, use an ExecPlan (as described in .agent/PLANS.md) from design to implementation.
379
+
380
+
---
381
+
343
382
## Where to Draw the Line — A Short Debate
344
383
345
384
> **Purist:** “All changes must start with a failing test.”
@@ -353,7 +392,7 @@ It is illegal to `-q` when running tests!
353
392
* Logging/message tweaks **not** asserted by tests.
354
393
* Build/CI config that doesn’t alter runtime behavior.
355
394
356
-
**Out‑of‑scope (use Routine A)**
395
+
**Out‑of‑scope (use Routine A/D)**
357
396
* Changing query results, serialization, or parsing behavior.
358
397
* Altering error messages that tests assert.
359
398
* Anything touching concurrency, timeouts, IO, or ordering.
@@ -365,7 +404,7 @@ It is illegal to `-q` when running tests!
365
404
## Working Loop
366
405
367
406
* **PIOSEE first:** restate Problem, gather Information, list Options; then Select, Execute, Evaluate.
368
-
* **Plan:** small, verifiable steps; keep one `in_progress`.
407
+
* **Plan:** small, verifiable steps; keep one `in_progress`, or follow PLANS.md (ExecPlans)
* Add explicit imports for every dependency you use instead of sprinkling fully qualified names through the code.
487
+
* When an import exists, reference the simple class name; repeating the package inline is noisy and easy to get wrong.
488
+
445
489
---
446
490
447
491
## Source File Headers
@@ -505,6 +549,23 @@ Do **not** modify existing headers’ years.
505
549
* `sed -n '1,200p' path/to/File.java`
506
550
* `sed -n '201,400p' path/to/File.java`
507
551
552
+
### Inspecting Git Changes Without Reverting
553
+
554
+
* Never run `git checkout -- <file>` or `git restore --worktree <file>` just to peek at history — those commands mutate the working tree, try to grab `.git/index.lock`, and often require escalated privileges in this environment. Prefer read-only inspection.
555
+
* To compare your edits against the last commit, use `git diff -- path/to/File.java` (working tree) or `git diff --cached -- path/to/File.java` (staged changes). Add `HEAD` to diff against the committed baseline explicitly: `git diff HEAD -- path/to/File.java`.
556
+
* To view a committed version without touching the working tree, stream it directly: `git show HEAD:path/to/File.java | sed -n '1,120p'`. Swap `HEAD` with any commit hash or ref (`HEAD~2`, `feature~3`, etc.) to inspect older revisions.
557
+
* When you need a disposable copy of a historical file, write it to a temp file instead of checking it out:
558
+
`tmp=$(mktemp /tmp/file.XXXXXX); git show <commit>:path/to/File.java > "$tmp"; ${EDITOR:-less} "$tmp"`. Remove the temp file when done.
559
+
* `git log -n 5 -- path/to/File.java` and `git show <commit> --stat -- path/to/File.java` are also safe ways to understand how the file evolved — all without altering the repo state.
560
+
* Need to compare against a specific commit (local or remote) instead of just `HEAD`? Use `git diff <commit> -- path/to/File.java` or `git diff origin/main -- path/to/File.java` to see exactly what changed relative to that reference while keeping the working tree untouched.
561
+
* For a quick read-only side-by-side, rely on process substitution: `diff -u <(git show HEAD:path/to/File.java) <(cat path/to/File.java)` displays how your edits differ from the committed version without staging or resetting anything. `git difftool -y HEAD -- path/to/File.java` is another safe option if you prefer an external viewer.
562
+
* To study an older revision in depth, first list the relevant commits with `git log --oneline --follow -- path/to/File.java`, then stream any revision to a temp file for offline inspection:
563
+
`tmp=$(mktemp /tmp/rdf4j-file.XXXXXX)`
564
+
`git show <commit>:path/to/File.java > "$tmp"`
565
+
`${EDITOR:-less} "$tmp" && rm "$tmp"`
566
+
This pattern never touches the tracked file and avoids locking `.git/index`.
567
+
* Need a whole-directory snapshot for archaeology? `git archive <commit> path/to/dir | tar -x -C /tmp/readonly-snapshot` extracts a copy under `/tmp` that you can browse freely, then delete when finished.
568
+
508
569
---
509
570
510
571
## Autonomy Rules (Act > Ask)
@@ -534,6 +595,7 @@ Do **not** modify existing headers’ years.
534
595
*Routine A:* failing output (pre‑fix) and passing output (post‑fix).
535
596
*Routine B:* pre‑ and post‑green snippets from the **same selection** + **Hit Proof**.
536
597
*Routine C:* artifacts from investigation (logs/notes/measurements) and proposed next steps.
598
+
*Routine D:* NO EVIDENCE REQUIRED.
537
599
* **Assumptions:** key assumptions and autonomous decisions.
538
600
* **Limitations:** anything left or risky edge cases.
0 commit comments