@jjchill/probity-rules 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.5
4
+
5
+ The Kotlin and KMP TDD judge no longer blocks a behavior-preserving
6
+ extraction under green (#48).
7
+
8
+ - **Moving tested logic into a helper is allowed as a refactor, not
9
+ only as green.** The 0.4.4 instruction for #46 described the move
10
+ only as a green step for a failing test. The judge then read it as
11
+ the sole way an extraction could pass, and required a fresh red for
12
+ a plain refactor. Removing duplicated logic from two use cases was
13
+ blocked with every test green: "the move-existing-logic allowance
14
+ requires ... a failing test needing this call path". The
15
+ instruction now names both phases. In green, the move serves a
16
+ failing test. In refactor, no failing test is needed when the most
17
+ recent relevant test or build run passed and none is outstanding.
18
+ It also says a move includes rewiring a caller to the helper, and
19
+ renaming the helper, its parameters or its result type. A helper
20
+ with logic that appears nowhere in the session, or a move that adds
21
+ a branch, still needs its own red.
22
+ Live judge on a replica of the recorded #48 session (green build,
23
+ both copies grepped, no failing test): adding the helper was allowed
24
+ 2 of 6 times on 0.4.4 and 8 of 8 on 0.4.5. Rewiring a caller passed
25
+ on both. Controls stayed denied 8 of 8 on 0.4.5: a helper with new
26
+ logic under green, moved logic plus a new branch, and the three
27
+ 0.4.4 controls.
28
+
3
29
  ## 0.4.4
4
30
 
5
31
  Fixes for a one-test Kotlin write that reached the AI judge and was
@@ -10,7 +10,7 @@ const KOTLIN_TDD_ADDENDUM = `## Kotlin/JVM TDD clarification
10
10
  - Kotlin-specific exception to the generic placeholder guidance: when a targeted, relevant Kotlin test executes a \`TODO()\` placeholder and reports \`kotlin.NotImplementedError\`, that runtime failure is a clean red. Do not require a second run that reaches an assertion before replacing the placeholder. The implementation remains bounded by the assertions present in the relevant test source visible in the recent session.
11
11
  - A compile, unresolved-import, or signature failure is not a clean red. It authorizes only placeholder, signature, or scaffolding work needed to make the test runnable; it does not authorize implementing the asserted behavior.
12
12
  - One observed failing test may require one cohesive green write across multiple methods or branches when every changed method and branch is required by assertions present in that same relevant test source. No artificial test rerun is required between parts of that one atomic write. If the relevant assertions are not visible in the recent session, the red authorizes placeholder or scaffolding work only; do not infer that it authorizes production behavior.
13
- - Moving existing, tested logic is not new behavior. Suppose a green write moves logic that production code already has into a shared helper, including any small result type the helper needs, so that the code path an observed failing test needs can call it. That is the minimum green for that test, not over-implementation, as long as the same logic appears in the current file content or in a production file read or edited in the recent session. The behavior already exists and is covered; only its location changes. The helper keeps every branch the existing logic has, and the result cases for them, even when the new failing test asserts only one of them: those branches are moved, not added, and the first caller's tests cover them. Do not require the helper to be trimmed to what the new test asserts, and do not require the logic to be duplicated in the second caller instead. A helper holding logic that appears nowhere else in the session is still new behavior and needs its own red.
13
+ - Moving existing, tested logic is not new behavior. A write that moves logic production code already has into a shared helper, or that replaces that logic in a caller with a call to such a helper, changes where the behavior lives, not what it is. It counts as a move when the same logic, branch for branch, appears in the current file content or in production code the recent session shows (read, grepped, or edited). Renaming the helper, its parameters, or its result type (for example a small sealed result replacing each caller's own) is part of the move. A move is allowed in two phases. In green, when an observed failing test needs a second caller to reach the logic, the move is the minimum green: the helper keeps every branch the existing logic has, even if the new test asserts only one, and do not require the logic to be duplicated instead. In refactor, no failing test is needed: when the most recent relevant test or build run in the session passed and no failing test is outstanding, the move is the refactor step, and demanding a new failing test for it is wrong. Either way, a helper holding logic that appears nowhere else in the session, or a move that adds a branch or behavior the existing logic lacks, is new behavior and needs its own red.
14
14
  - Git staging and git-index state are irrelevant. Judge only the recent session evidence, current file content, and pending action; do not require a test or production file to be staged.`;
15
15
  /**
16
16
  * Kotlin sessions commonly include Gradle output plus several source reads between
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjchill/probity-rules",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "Versioned Probity rule presets and CLI tooling for the agent-skills catalog (test-driven-development, ports-and-adapters, acceptance-testing, spec-test parity, ubiquitous-language) — see hooks/PROBITY.md.",
5
5
  "license": "MIT",
6
6
  "repository": {