easy-coding-harness 0.10.0-beta.0 → 0.10.0-beta.2
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 +31 -0
- package/README.md +9 -3
- package/dist/cli.js +331 -46
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/common/bundled-skills/ec-init/SKILL.md +8 -0
- package/templates/common/bundled-skills/ec-meta/references/local-architecture/README.md +9 -2
- package/templates/common/bundled-skills/ec-meta/references/platform-files/README.md +1 -1
- package/templates/common/skills/ec-analysis/SKILL.md +38 -0
- package/templates/common/skills/ec-config/SKILL.md +68 -0
- package/templates/common/skills/ec-implementing/SKILL.md +11 -0
- package/templates/common/skills/ec-memory/SKILL.md +4 -0
- package/templates/common/skills/ec-reviewing/SKILL.md +6 -0
- package/templates/common/skills/ec-task-management/SKILL.md +6 -31
- package/templates/common/skills/ec-tdd-init/SKILL.md +99 -0
- package/templates/common/skills/ec-verification/SKILL.md +53 -1
- package/templates/common/skills/ec-workflow/SKILL.md +16 -4
- package/templates/main-constraint/AGENTS.md.tpl +13 -3
- package/templates/main-constraint/CLAUDE.md.tpl +13 -3
- package/templates/runtime/tools/easy_coding_java_coverage.py +317 -0
- package/templates/runtime/tools/easy_coding_tdd_readiness.py +306 -0
- package/templates/shared-hooks/easy_coding_state.py +846 -13
- package/templates/shared-hooks/inject-subagent-context.py +5 -0
package/package.json
CHANGED
|
@@ -85,6 +85,11 @@ initialization standard. Check each item:
|
|
|
85
85
|
and non-empty?
|
|
86
86
|
- **Project profile**: `project.yaml` exists with `mode` and `test` fields (ec-init owns it;
|
|
87
87
|
`config.yaml` is CLI-owned — not ec-init's concern)?
|
|
88
|
+
- **TDD runtime contract**: CLI-owned `config.yaml` has schema 5 TDD defaults and both
|
|
89
|
+
`.easy-coding/tools/easy_coding_java_coverage.py` and
|
|
90
|
+
`.easy-coding/tools/easy_coding_tdd_readiness.py` exist? Missing fields or tools mean
|
|
91
|
+
`easy-coding upgrade` is required; ec-init must not repair them directly. Project-specific
|
|
92
|
+
JaCoCo/GitLab readiness remains owned by `ec-tdd-init`, not `ec-init`.
|
|
88
93
|
- **Platform hook config freshness**: for each installed platform in `.easy-coding/config.yaml`,
|
|
89
94
|
read the platform hook config and verify managed Easy Coding hook commands use the portable
|
|
90
95
|
relative hook launcher bound to this project root's `project.id`. If `project.id` is missing,
|
|
@@ -154,6 +159,9 @@ agent must be able to see what was generated and on what evidence.
|
|
|
154
159
|
tests live, naming conventions, coverage expectations, which classes of code this project
|
|
155
160
|
tests vs skips. Also fill `project.yaml` `test.framework` and `test.command` with commands
|
|
156
161
|
you verified exist (read package.json scripts or equivalent — do not guess).
|
|
162
|
+
If effective TDD is disabled, do not inspect JaCoCo or GitLab and do not add TDD-specific
|
|
163
|
+
requirements. If it is enabled for Java, additionally document JUnit/JaCoCo commands,
|
|
164
|
+
production/test source roots, XML report paths, and the existing GitLab TEST-stage gate.
|
|
157
165
|
5. **Memory migration probe** — Check for old-format memory files:
|
|
158
166
|
- `.easy-coding/memory/long/MEMORY.md` exists but lacks `memory_schema: 2` frontmatter
|
|
159
167
|
- `.easy-coding/memory/long/BUSINESS.md` or `TECHNICAL.md` missing
|
|
@@ -53,8 +53,15 @@ advances every legal edge after mechanical gates.
|
|
|
53
53
|
Workflow mode is independently configured as adaptive/fast/standard/strict; ANALYSIS freezes
|
|
54
54
|
adaptive to a concrete mode, and every new code task still enters REVIEW. REVIEW evidence is
|
|
55
55
|
bound to the final implementation fingerprint, VERIFICATION evidence is bound to implementation
|
|
56
|
-
and config fingerprints, and MEMORY keeps the conditional long-memory threshold gate.
|
|
57
|
-
|
|
56
|
+
and config fingerprints, and MEMORY keeps the conditional long-memory threshold gate.
|
|
57
|
+
|
|
58
|
+
Java TDD is a third independent, default-off control managed by `ec-config`. Session overrides
|
|
59
|
+
project configuration; ANALYSIS freezes enabled state and the 1..100 changed-line threshold
|
|
60
|
+
(default 90) on entry to IMPLEMENT. Disabled TDD changes no ordinary workflow test depth. Enabled
|
|
61
|
+
TDD adds lifecycle evidence, a TDD review dimension, and the same JaCoCo diff gate locally and in
|
|
62
|
+
GitLab TEST-stage CI.
|
|
63
|
+
|
|
64
|
+
The active task pointer lives in `sessions/{agent}-{session-id}.json` (with an agent-prefixed PPID fallback only
|
|
58
65
|
when a hook payload has no logical session ID);
|
|
59
66
|
when the task reaches `COMPLETE` or `CLOSED`, the state API clears `current_task` so the
|
|
60
67
|
session returns to Ready. Each task's stage persists in its `task.json`. Hooks inject the
|
|
@@ -14,7 +14,7 @@ What lives in each platform directory and how the three platforms differ.
|
|
|
14
14
|
| Sub-agent defs | `.claude/agents/*.md` | `.codex/agents/*.toml` | `.qoder/agents/*.md` |
|
|
15
15
|
| CN variant | — | — | `.qodercn/` |
|
|
16
16
|
|
|
17
|
-
Each skill is installed as `{skills-dir}/ec-{name}/SKILL.md`. The
|
|
17
|
+
Each skill is installed as `{skills-dir}/ec-{name}/SKILL.md`. The 15 skills are
|
|
18
18
|
platform-agnostic — one template, resolved per platform at write time. The agent's native
|
|
19
19
|
discovery surfaces them under `/ec-` or `$ec-`.
|
|
20
20
|
|
|
@@ -93,6 +93,44 @@ independent write scopes. Better unit contracts reduce later REVIEW rework.
|
|
|
93
93
|
|
|
94
94
|
Code tasks require `test-strategy.md`; explicit `doc`, `analysis`, and `report` tasks do not.
|
|
95
95
|
|
|
96
|
+
## Optional Java TDD analysis
|
|
97
|
+
|
|
98
|
+
Read `effective_tdd_enabled` and `effective_tdd_coverage_threshold` from the state snapshot.
|
|
99
|
+
For a `type=tdd-init` task, treat frozen TDD as off even if the project/session requests it. That
|
|
100
|
+
task is the sole exception allowed to inspect and plan build/CI coverage infrastructure while TDD
|
|
101
|
+
is off. Its scope is infrastructure only: never plan historical business-test backfill or a
|
|
102
|
+
repository-wide coverage target, and explicitly record `coverage scope: changed production lines`.
|
|
103
|
+
|
|
104
|
+
When TDD is disabled, stop here: do not inspect GitLab CI or JaCoCo, do not add TDD fields or
|
|
105
|
+
extra tests, and do not strengthen the selected Workflow Mode's ordinary acceptance depth. This
|
|
106
|
+
zero-cost rule applies to ordinary tasks, not the explicit `tdd-init` infrastructure task above.
|
|
107
|
+
|
|
108
|
+
When TDD is enabled for a Java code task, make `test-strategy.md` record:
|
|
109
|
+
|
|
110
|
+
- detected Java/JUnit build system, exact unit-test command, production/test source roots, and
|
|
111
|
+
JaCoCo XML paths;
|
|
112
|
+
- immutable Git baseline SHA and the configured changed-production-line threshold; design tests
|
|
113
|
+
toward 100% while treating the threshold as the mechanical minimum;
|
|
114
|
+
- feature/bug RED -> GREEN -> REFACTOR evidence, or for pure refactors a pre-change
|
|
115
|
+
characterization GREEN -> post-change GREEN sequence without inventing a RED failure;
|
|
116
|
+
- `.gitlab-ci.yml` and included configuration, the TEST-stage job, JUnit/JaCoCo artifacts, and an
|
|
117
|
+
equivalent changed-line gate. Reuse a gate only when its threshold is at least the configured
|
|
118
|
+
value; otherwise include the CI change in the confirmed implementation scope.
|
|
119
|
+
- current `tdd_readiness_status=ready`; if missing or drifted, stop before IMPLEMENT and route to
|
|
120
|
+
`ec-tdd-init`. Never plan to initialize CI inside an already-enabled TDD feature task.
|
|
121
|
+
|
|
122
|
+
The state API mechanically freezes current Git `HEAD` per repository into `task.tdd_baselines`
|
|
123
|
+
when ANALYSIS advances to IMPLEMENT. Plan both local and GitLab commands with that exact SHA and
|
|
124
|
+
the frozen threshold; never use a mutable `HEAD` fallback at verification time. Non-Canonical TDD
|
|
125
|
+
is limited to one Git repository; multi-repository TDD must use Canonical repository bindings.
|
|
126
|
+
|
|
127
|
+
Also append a `### TDD Mode` section to `dev-spec.md` with enabled state, frozen threshold,
|
|
128
|
+
baseline, local gate, GitLab TEST gate, and lifecycle evidence. Do not add this section when TDD
|
|
129
|
+
is disabled.
|
|
130
|
+
|
|
131
|
+
If the task is not a Java project, explain that Java-only TDD cannot be activated and obtain a
|
|
132
|
+
mode decision before advancing. The CLI never installs JaCoCo or edits CI automatically.
|
|
133
|
+
|
|
96
134
|
## Workflow mode calculation
|
|
97
135
|
|
|
98
136
|
Resolve configured mode from the state snapshot:
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ec-config
|
|
3
|
+
description: Inspect and configure Easy Coding project/session Approval, Workflow, and Java TDD modes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ec-config — mode configuration
|
|
7
|
+
|
|
8
|
+
Communicate in the user's language. A bare invocation is read-only: show the configuration panel
|
|
9
|
+
and available actions. Never mutate project or session settings without an explicit user choice.
|
|
10
|
+
|
|
11
|
+
## Configuration panel
|
|
12
|
+
|
|
13
|
+
Call `snapshot` and show project, session, effective, and frozen task values for:
|
|
14
|
+
|
|
15
|
+
- `approval_mode`;
|
|
16
|
+
- `workflow_mode`;
|
|
17
|
+
- `tdd_enabled` and `tdd_coverage_threshold`.
|
|
18
|
+
|
|
19
|
+
Use the returned fields directly, including `project_tdd_enabled`, `session_tdd_enabled`,
|
|
20
|
+
`effective_tdd_enabled`, their threshold counterparts, `task_tdd_enabled`, and the task's
|
|
21
|
+
per-repository `task_tdd_baselines` frozen state. When `tdd_readiness_status=not_checked` because
|
|
22
|
+
TDD is off, explicitly run the read-only readiness command below before showing readiness:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python3 .easy-coding/tools/easy_coding_tdd_readiness.py --cwd . check
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This explicit configuration-panel check is the only disabled-mode readiness scan; ordinary hooks
|
|
29
|
+
must not inspect build or CI files while TDD is off.
|
|
30
|
+
|
|
31
|
+
Explain precedence as `session override > project config > defaults`. Defaults are Approval
|
|
32
|
+
`guard`, Workflow `adaptive`, TDD disabled, and TDD changed-line coverage threshold 90%. An active
|
|
33
|
+
task freezes its effective TDD values when ANALYSIS advances to IMPLEMENT; later project/session
|
|
34
|
+
changes affect future tasks and ANALYSIS only.
|
|
35
|
+
|
|
36
|
+
## Project configuration
|
|
37
|
+
|
|
38
|
+
Use `easy-coding config` for project settings. The CLI confirms one atomic update of Approval,
|
|
39
|
+
Workflow, TDD, and (when enabled) the threshold. The threshold must be an integer from 1 to 100.
|
|
40
|
+
Enabling TDD is rejected atomically unless `ec-tdd-init` readiness is currently `ready`.
|
|
41
|
+
|
|
42
|
+
## Session configuration
|
|
43
|
+
|
|
44
|
+
After explicit user selection, use the current logical session file:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# approval
|
|
48
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
|
|
49
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
|
|
50
|
+
|
|
51
|
+
# workflow
|
|
52
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-workflow-mode --mode adaptive|fast|standard|strict --agent <agent-id> --session-file <P>
|
|
53
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-workflow-mode --agent <agent-id> --session-file <P>
|
|
54
|
+
|
|
55
|
+
# TDD; omitting threshold preserves an existing session threshold, otherwise project/default 90 applies
|
|
56
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-tdd --enabled true|false [--threshold 1..100] --agent <agent-id> --session-file <P>
|
|
57
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-tdd --agent <agent-id> --session-file <P>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Turning TDD off must preserve the existing Fast/Standard/Strict test depth exactly: do not inspect
|
|
61
|
+
CI, request JaCoCo, add TDD artifacts, run coverage commands, or strengthen acceptance criteria.
|
|
62
|
+
When TDD is on, explain that it applies only to Java code tasks and activates RED/GREEN/REFACTOR,
|
|
63
|
+
TDD review, local changed-line JaCoCo coverage, and GitLab TEST-stage gate planning.
|
|
64
|
+
|
|
65
|
+
Before any project/session enable action, require `tdd_readiness_status=ready`. If it is not ready,
|
|
66
|
+
offer only `ec-tdd-init` or cancellation; never offer or persist "enable now, initialize later".
|
|
67
|
+
Readiness means infrastructure can measure future changed production lines. It does not certify
|
|
68
|
+
repository-wide coverage and does not require tests for unchanged historical code.
|
|
@@ -9,6 +9,16 @@ Use only after ANALYSIS has frozen `task.json.workflow_mode` to `fast`, `standar
|
|
|
9
9
|
`strict`. Read `dev-spec.md`, the latest `plan` record in `execution.jsonl`, relevant RULES
|
|
10
10
|
and ABSTRACT sections, and `test-strategy.md` for code tasks.
|
|
11
11
|
|
|
12
|
+
If frozen `task.tdd_enabled` is not `true`, preserve the existing shift-left behavior exactly;
|
|
13
|
+
do not load the Java coverage tool, require RED/GREEN/REFACTOR, inspect CI, or run extra test
|
|
14
|
+
commands. TDD is an independent opt-in mode, not an implicit consequence of strict workflow.
|
|
15
|
+
|
|
16
|
+
When frozen TDD is enabled, every feature/bug unit must capture a meaningful failing unit test
|
|
17
|
+
before production code (RED), the smallest passing implementation (GREEN), and a green refactor.
|
|
18
|
+
Pure refactors instead capture a passing characterization test before the change and rerun it
|
|
19
|
+
afterward. Never fake RED evidence. Keep tests deterministic, boundary-focused, and minimally
|
|
20
|
+
mocked, and design changed production code toward 100% unit coverage.
|
|
21
|
+
|
|
12
22
|
Communicate with the user in the user's language.
|
|
13
23
|
|
|
14
24
|
## Non-negotiable gates
|
|
@@ -59,6 +69,7 @@ Sub-agents never dispatch other sub-agents or read `.easy-coding` workflow asset
|
|
|
59
69
|
# Task Card
|
|
60
70
|
## Identity Easy Coding implementation unit
|
|
61
71
|
## Workflow Mode {fast|standard|strict}
|
|
72
|
+
## TDD {off | on, frozen changed-line threshold N%}
|
|
62
73
|
## Task {unit description}
|
|
63
74
|
## Source Spec {spec_id@revision + sha256 | NONE}
|
|
64
75
|
## Source Task {source_task_id | NONE}
|
|
@@ -28,6 +28,10 @@ Name it `{memory_id}_{YYYYMMDD}_{smart_name}.md` and set
|
|
|
28
28
|
`.easy-coding/memory/short/`, then register it with
|
|
29
29
|
`memory-short-complete`. Never invent test results or commit hashes.
|
|
30
30
|
|
|
31
|
+
When frozen TDD is enabled, add its threshold, lifecycle evidence, local changed-line result,
|
|
32
|
+
and remote CI status to the short memory's execution evidence. When TDD is off, omit TDD fields
|
|
33
|
+
entirely so ordinary tasks incur no additional memory work.
|
|
34
|
+
|
|
31
35
|
Ask the state API for `memory-instruction`. Distill only when it returns `action:distill`;
|
|
32
36
|
otherwise record `no-op`. Long memory receives reusable facts only, not file dumps, transient
|
|
33
37
|
logs, routine command output, or speculation.
|
|
@@ -21,6 +21,12 @@ a blocking correctness finding. Every Canonical review record includes its `repo
|
|
|
21
21
|
`source_task_id`; emit at least one current-fingerprint record per selected task and required
|
|
22
22
|
review dimension. A global record without source ownership cannot satisfy the gate.
|
|
23
23
|
|
|
24
|
+
When frozen TDD is enabled, add a passed review dimension named exactly `tdd` for each source
|
|
25
|
+
task. Review whether RED/GREEN/REFACTOR (or characterization GREEN for pure refactors) is genuine,
|
|
26
|
+
tests exercise changed behavior and boundaries, mocks do not merely mirror implementation, and
|
|
27
|
+
the local/CI changed-line coverage gates share the frozen threshold. When TDD is off, do not add
|
|
28
|
+
this dimension or raise the ordinary review depth.
|
|
29
|
+
|
|
24
30
|
## Depth by workflow mode
|
|
25
31
|
|
|
26
32
|
- `fast`: main Agent performs one final-diff self-review across correctness, scope, tests, and
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ec-task-management
|
|
3
|
-
description: View and manage Easy Coding
|
|
3
|
+
description: View and manage Easy Coding task lifecycle, ownership, handoff, and closure.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# ec-task-management —
|
|
6
|
+
# ec-task-management — task lifecycle
|
|
7
7
|
|
|
8
8
|
Communicate with the user in the user's language. A bare invocation is read-only: show the
|
|
9
9
|
panel and available actions, but do not mutate a session without an explicit choice.
|
|
@@ -13,44 +13,19 @@ panel and available actions, but do not mutate a session without an explicit cho
|
|
|
13
13
|
Call the state API snapshot and show:
|
|
14
14
|
|
|
15
15
|
- current task, stage, last Agent, and pending transition;
|
|
16
|
-
-
|
|
17
|
-
- `project_workflow_mode`, `session_workflow_mode`, `configured_workflow_mode`;
|
|
18
|
-
- task `concrete_workflow_mode` or ANALYSIS proposal when present;
|
|
16
|
+
- task `concrete_workflow_mode` and frozen TDD state when present;
|
|
19
17
|
- harness enabled/disabled state;
|
|
20
18
|
- active and resumable tasks.
|
|
21
19
|
- for Canonical-backed tasks: source Spec ID/revision/SHA, selected task IDs, repository
|
|
22
20
|
bindings/baseline status, and pending dependency evidence.
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
`session override > project config > approval:guard / workflow:adaptive`
|
|
27
|
-
|
|
28
|
-
## Session settings
|
|
29
|
-
|
|
30
|
-
After explicit user selection:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# approval
|
|
34
|
-
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-approval-mode --mode approve|guard|confirm|auto --agent <agent-id> --session-file <P>
|
|
35
|
-
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-approval-mode --agent <agent-id> --session-file <P>
|
|
36
|
-
|
|
37
|
-
# workflow
|
|
38
|
-
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py set-workflow-mode --mode adaptive|fast|standard|strict --agent <agent-id> --session-file <P>
|
|
39
|
-
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py clear-workflow-mode --agent <agent-id> --session-file <P>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Changing a session setting affects future ANALYSIS proposals. It does not silently rewrite a
|
|
43
|
-
mode already frozen on an active task. During ANALYSIS, regenerate and show the proposal. During
|
|
44
|
-
IMPLEMENT or REVIEW, use `raise-workflow-mode` for a justified increase; lowering is forbidden.
|
|
45
|
-
From VERIFICATION, return to IMPLEMENT first so the raised mode receives fresh REVIEW evidence.
|
|
46
|
-
|
|
47
|
-
Project settings are changed with `easy-coding config`, which edits both dimensions in one
|
|
48
|
-
confirmed interaction.
|
|
22
|
+
Mode inspection and configuration belongs to `ec-config`. If the user asks to change Approval,
|
|
23
|
+
Workflow, TDD, or the TDD coverage threshold, route there and do not mutate those fields here.
|
|
49
24
|
|
|
50
25
|
## Task actions
|
|
51
26
|
|
|
52
27
|
Support listing, creating, selecting, claiming, handing off, and closing tasks through the
|
|
53
|
-
state API. Preserve pending transitions when
|
|
28
|
+
state API. Preserve pending transitions when inspecting tasks. Never infer user
|
|
54
29
|
acceptance from opening this panel.
|
|
55
30
|
|
|
56
31
|
When creating from a Canonical Spec, call `inspect-dev-spec`, display the complete task and
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ec-tdd-init
|
|
3
|
+
description: Initialize or refresh Java changed-line TDD coverage infrastructure before TDD can be enabled.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ec-tdd-init — Java changed-line gate initialization
|
|
7
|
+
|
|
8
|
+
Communicate in the user's language. This skill owns TDD infrastructure readiness, not historical
|
|
9
|
+
test-debt cleanup. It must never bulk-generate tests for existing business code, require
|
|
10
|
+
repository-wide coverage, or modify production behavior merely to raise coverage.
|
|
11
|
+
|
|
12
|
+
## Non-circular ordering
|
|
13
|
+
|
|
14
|
+
The only legal order is:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
TDD off -> initialize infrastructure -> readiness ready -> user explicitly enables TDD
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Run this skill as a dedicated code task with `type=tdd-init`. The state API always freezes that
|
|
21
|
+
task with `tdd_enabled=false`, even when a legacy project/session setting or a suspended task has
|
|
22
|
+
TDD enabled. Never offer "enable now and initialize later". Never enable TDD automatically after
|
|
23
|
+
initialization.
|
|
24
|
+
|
|
25
|
+
## Read-only preflight
|
|
26
|
+
|
|
27
|
+
First run:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
python3 .easy-coding/tools/easy_coding_tdd_readiness.py --cwd . check
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If it returns `ready`, report the recorded build/CI contract and stop without creating a task.
|
|
34
|
+
The user may then use `ec-config` or `easy-coding config` to enable TDD.
|
|
35
|
+
|
|
36
|
+
If it returns `needs_init`, inspect only the infrastructure needed to form a confirmed plan:
|
|
37
|
+
|
|
38
|
+
- Maven/Gradle files and the existing JUnit runner;
|
|
39
|
+
- JaCoCo XML generation configuration;
|
|
40
|
+
- `.gitlab-ci.yml` and its repository-local include chain;
|
|
41
|
+
- TEST-stage job, JUnit/JaCoCo artifacts, and invocation of
|
|
42
|
+
`.easy-coding/tools/easy_coding_java_coverage.py` with task-supplied baseline/threshold values.
|
|
43
|
+
|
|
44
|
+
Do not measure current whole-project coverage. A project with no historical business tests may
|
|
45
|
+
still become ready when the test runner, JaCoCo reporting, and parameterized changed-line gate
|
|
46
|
+
are functional.
|
|
47
|
+
|
|
48
|
+
## Initialization task
|
|
49
|
+
|
|
50
|
+
After the user confirms the exact infrastructure scope, create one task and route it through the
|
|
51
|
+
ordinary workflow:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
{{PYTHON_CMD}} {{platform_config_dir}}/hooks/easy_coding_state.py create-task \
|
|
55
|
+
--task-id <safe-unique-id> --type tdd-init \
|
|
56
|
+
--title "Initialize Java changed-line TDD infrastructure" \
|
|
57
|
+
--agent <agent-id> --session-file <P>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
ANALYSIS may plan build files, GitLab CI files, common scripts, and the readiness receipt. It must
|
|
61
|
+
state `historical coverage required: no` and `coverage scope: changed production lines since each
|
|
62
|
+
future task baseline`. IMPLEMENT changes infrastructure only. It must not add tests whose sole
|
|
63
|
+
purpose is to cover unchanged production code.
|
|
64
|
+
|
|
65
|
+
The reusable GitLab job must consume a baseline SHA and threshold supplied for the future task;
|
|
66
|
+
do not hardcode the initialization commit or the default 90% threshold. The same Python coverage
|
|
67
|
+
tool must be used locally and remotely.
|
|
68
|
+
|
|
69
|
+
## Readiness receipt and verification
|
|
70
|
+
|
|
71
|
+
At the end of IMPLEMENT, after the infrastructure files are stable, record their fingerprints.
|
|
72
|
+
The receipt is part of the implementation and must exist before REVIEW so review/verification
|
|
73
|
+
fingerprints do not change after review. The recorder automatically includes the harness-managed
|
|
74
|
+
`.easy-coding/tools/easy_coding_java_coverage.py` fingerprint:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
python3 .easy-coding/tools/easy_coding_tdd_readiness.py --cwd . record \
|
|
78
|
+
--build-file <pom.xml-or-build.gradle> [--build-file <included-build-file>]... \
|
|
79
|
+
--ci-file .gitlab-ci.yml [--ci-file <repository-local-include>]... \
|
|
80
|
+
--coverage-report <jacoco-xml-pattern> [--coverage-report <pattern>]... \
|
|
81
|
+
--gate-command "python3 .easy-coding/tools/easy_coding_java_coverage.py check --base \$EASY_CODING_TDD_BASE_SHA --threshold \$EASY_CODING_TDD_THRESHOLD" \
|
|
82
|
+
--agent <agent-id>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
REVIEW includes the receipt and its declared infrastructure boundary. VERIFICATION runs the
|
|
86
|
+
frozen Workflow Mode's applicable build/test/CI syntax checks, then performs only the read-only
|
|
87
|
+
readiness check:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
python3 .easy-coding/tools/easy_coding_tdd_readiness.py --cwd . check
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The `VERIFICATION -> MEMORY` gate requires the final check to return `ready`. If any recorded
|
|
94
|
+
build or CI file changes after the receipt was created, readiness becomes `needs_init`; return to
|
|
95
|
+
IMPLEMENT, refresh the receipt, and repeat REVIEW before verifying again. Rerun this skill when
|
|
96
|
+
the same drift occurs after task completion.
|
|
97
|
+
|
|
98
|
+
After completion, tell the user that TDD remains off and provide the explicit project/session
|
|
99
|
+
enable route. Do not treat readiness as consent to enable it.
|
|
@@ -25,6 +25,29 @@ Read-only tasks never enter this stage. Obtain fresh fingerprints before running
|
|
|
25
25
|
- `standard`: run impacted lint/typecheck/test scopes and every must-test item.
|
|
26
26
|
- `strict`: run the project's full applicable lint, typecheck, test, and build gates.
|
|
27
27
|
|
|
28
|
+
These rules remain unchanged when frozen TDD is off: do not discover JaCoCo reports, run the
|
|
29
|
+
coverage tool, inspect GitLab, or add a coverage record. The explicit `type=tdd-init` task is an
|
|
30
|
+
infrastructure exception: run its planned build/CI syntax checks and readiness tool, but do not
|
|
31
|
+
measure repository-wide coverage or append TDD coverage evidence for unchanged production code.
|
|
32
|
+
|
|
33
|
+
When frozen TDD is on, first run the planned Java unit command and generate JaCoCo XML, then run
|
|
34
|
+
the same deterministic gate intended for GitLab:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
python3 .easy-coding/tools/easy_coding_java_coverage.py check \
|
|
38
|
+
--base <task.tdd_baselines[repo-id-or-project]> \
|
|
39
|
+
--threshold <task.tdd_coverage_threshold> [--report <jacoco.xml>]...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The tool measures covered added/modified production Java executable lines only. Deleted,
|
|
43
|
+
comment, blank, import, and test-source lines are excluded by diff/JaCoCo intersection. Missing
|
|
44
|
+
or ambiguous source files and reports older than their modified source fail; zero modified
|
|
45
|
+
executable lines is explicit N/A. Always regenerate JaCoCo XML after the final source change.
|
|
46
|
+
Record CI as pending until the remote pipeline actually passes; local green is not remote green.
|
|
47
|
+
Never substitute `HEAD`, a mutable ref, project defaults, or current session settings for the
|
|
48
|
+
task-frozen baseline SHA and threshold. GitLab must invoke the tool with the same two frozen
|
|
49
|
+
values; a session override therefore requires the CI command/variable for this task to match it.
|
|
50
|
+
|
|
28
51
|
The main Agent may run commands inline. Dispatch verifier sub-agents only when checks are
|
|
29
52
|
independent and parallel execution materially saves time or isolates specialist environments.
|
|
30
53
|
Platform spawn rule: {{platform_spawn_instruction}}
|
|
@@ -48,7 +71,7 @@ Append one record per executed check:
|
|
|
48
71
|
}
|
|
49
72
|
```
|
|
50
73
|
|
|
51
|
-
`check_type` is one of `lint`, `typecheck`, `test`, or `
|
|
74
|
+
`check_type` is one of `lint`, `typecheck`, `test`, `build`, or (TDD only) `coverage`. In `strict`, append current
|
|
52
75
|
evidence for all four types. When a type genuinely does not apply, record `applicable: false`
|
|
53
76
|
and a non-empty `not_applicable_reason`; it does not count as the required applicable executed
|
|
54
77
|
check, and must not be represented by an invented successful command.
|
|
@@ -58,6 +81,35 @@ do not append a later synthetic pass without rerunning the failed command.
|
|
|
58
81
|
|
|
59
82
|
## Coverage and acceptance
|
|
60
83
|
|
|
84
|
+
For TDD coverage, copy the tool output into `coverage`: `baseline_sha`, `covered_lines`,
|
|
85
|
+
`total_lines`, `percentage`, frozen `threshold`, `report_paths`, and `report_sha256`. Set
|
|
86
|
+
`applicable:false` plus the tool's reason only for zero executable modified lines. A percentage
|
|
87
|
+
below the frozen threshold fails even when ordinary tests pass.
|
|
88
|
+
|
|
89
|
+
Append two coverage records per repository (and per Canonical source task): one with
|
|
90
|
+
`coverage_scope:"local"`, and one with `coverage_scope:"gitlab"`. The GitLab record may be
|
|
91
|
+
appended only after the remote job succeeds and must also include:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"ci": {
|
|
96
|
+
"provider": "gitlab",
|
|
97
|
+
"pipeline_url": "https://gitlab.example/.../pipelines/123",
|
|
98
|
+
"job_name": "changed-line-coverage",
|
|
99
|
+
"status": "success"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Both records must preserve the same task-frozen baseline and threshold. A local-only result,
|
|
105
|
+
pending/failed pipeline, missing job identity, or synthetic remote pass cannot satisfy MEMORY.
|
|
106
|
+
|
|
107
|
+
For `type=tdd-init`, the infrastructure receipt must already have been recorded during IMPLEMENT
|
|
108
|
+
and reviewed with the rest of the implementation. Run only `easy_coding_tdd_readiness.py check`
|
|
109
|
+
here. If it reports drift, return to IMPLEMENT to refresh the receipt and repeat REVIEW; never
|
|
110
|
+
rewrite it inside VERIFICATION. The state gate requires `ready` before MEMORY. This does not
|
|
111
|
+
enable TDD; report the explicit `ec-config`/`easy-coding config` next step.
|
|
112
|
+
|
|
61
113
|
- Every must-test item has an executed check.
|
|
62
114
|
- Bug fixes include a regression test when project infrastructure exists.
|
|
63
115
|
- Present changed scope, commands, results, and unverified items.
|
|
@@ -24,18 +24,27 @@ the stage graph. Pre-0.9 in-flight tasks may carry `workflow_mode_legacy:true` f
|
|
|
24
24
|
review-evidence compatibility. Only `workflow_mode_legacy_direct_edge:true`, created from old
|
|
25
25
|
lite semantics or an already-persisted edge, permits one IMPLEMENT -> VERIFICATION transition.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Independent controls
|
|
28
28
|
|
|
29
29
|
- `approval_mode = approve|guard|confirm|auto` controls whether a legal transition waits for a
|
|
30
30
|
user. `confirm` waits only at ANALYSIS -> IMPLEMENT; after that, green REVIEW, VERIFICATION,
|
|
31
31
|
MEMORY, and COMPLETE transitions advance automatically.
|
|
32
32
|
- `workflow_mode = adaptive|fast|standard|strict` controls execution cost and assurance depth.
|
|
33
|
+
- `tdd_enabled` independently activates Java TDD and changed-line coverage. It defaults off;
|
|
34
|
+
`tdd_coverage_threshold` defaults to 90 and accepts integers from 1 to 100.
|
|
33
35
|
|
|
34
36
|
Resolution order for each configured value is session override, then project config, then
|
|
35
37
|
defaults (`guard`, `adaptive`). ANALYSIS resolves `adaptive` to a concrete mode, presents the
|
|
36
38
|
selection and reasons, allows the user to change it within the risk floor, and freezes it when
|
|
37
39
|
ANALYSIS -> IMPLEMENT is applied.
|
|
38
40
|
|
|
41
|
+
TDD resolves with the same session-over-project precedence and freezes its enabled flag and
|
|
42
|
+
threshold on ANALYSIS -> IMPLEMENT. It may be enabled only after `ec-tdd-init` readiness passes;
|
|
43
|
+
there is no enabled-but-pending-initialization state. A dedicated `tdd-init` task always freezes
|
|
44
|
+
TDD off so it can create or repair the required infrastructure without circular gating. When off,
|
|
45
|
+
ordinary tasks add no CI scan, artifacts, commands, coverage work, or stronger acceptance. Use
|
|
46
|
+
`ec-config` for all mode configuration.
|
|
47
|
+
|
|
39
48
|
`confirm` and `auto` do not hide the proposal: show it in the plan. Confirm waits for that one
|
|
40
49
|
plan decision; Auto continues immediately. Both remove later waiting, not quality gates.
|
|
41
50
|
|
|
@@ -81,7 +90,10 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
|
|
|
81
90
|
|
|
82
91
|
When multiple selected tasks depend on the same target, disambiguate creation evidence with
|
|
83
92
|
`<source-task-id>-><dependency-task-id>=<evidence>`.
|
|
84
|
-
4.
|
|
93
|
+
4. When the user explicitly invokes `ec-tdd-init`, let that skill own preflight and create a
|
|
94
|
+
`type=tdd-init` code task only after scope confirmation. Do not reinterpret it as an ordinary
|
|
95
|
+
TDD-enabled feature task and do not require readiness before creating it.
|
|
96
|
+
5. Match the user's intent against `current_task` and the active task list before resuming.
|
|
85
97
|
If the user names or clearly matches another task, confirm the switch and call
|
|
86
98
|
`claim-task --task-id <id> --agent <agent-id> --session-file <P>`. Do not execute task A
|
|
87
99
|
under task B's request.
|
|
@@ -93,10 +105,10 @@ plan decision; Auto continues immediately. Both remove later waiting, not qualit
|
|
|
93
105
|
to the requested deliverable. Feature, bugfix, refactor, performance, and workflow changes
|
|
94
106
|
are code tasks. Use `doc`, `analysis`, or `report` only when the user explicitly requested
|
|
95
107
|
a no-code deliverable; never downgrade a code request to the read-only completion path.
|
|
96
|
-
|
|
108
|
+
6. Resume the matched/current task, then load only state-relevant assets. Do not read five full
|
|
97
109
|
memories at every startup; ANALYSIS searches memory metadata and opens relevant entries on
|
|
98
110
|
demand.
|
|
99
|
-
|
|
111
|
+
7. If another Agent last owned the task, summarize the stored handoff before continuing.
|
|
100
112
|
|
|
101
113
|
## Stage dispatch
|
|
102
114
|
|
|
@@ -13,8 +13,10 @@ then a blank line. Do not render the machine breadcrumbs to the user.
|
|
|
13
13
|
|
|
14
14
|
`{approval-mode}` is the effective approval mode and `{workflow-mode}` is the configured or
|
|
15
15
|
task-frozen execution mode; session overrides take precedence over project settings.
|
|
16
|
+
When effective/frozen TDD is enabled, insert `· **TDD**` immediately after Workflow. When it is
|
|
17
|
+
disabled, omit the TDD segment entirely and preserve the existing status-line format.
|
|
16
18
|
|
|
17
|
-
- Ready: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm,
|
|
19
|
+
- Ready: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm, `ec-task-management` to manage tasks, or `ec-config` to inspect or change modes
|
|
18
20
|
- Waiting init: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Waiting init · Use `ec-init` to initialize
|
|
19
21
|
- Active task: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}`
|
|
20
22
|
- Handoff: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}` · Handoff -> `{source-agent}`
|
|
@@ -31,7 +33,7 @@ Trigger Easy Coding skills with your platform prefix — Codex: `$ec-*`, Qoder:
|
|
|
31
33
|
- `ec-brainstorming` — design exploration before building (hard design gate)
|
|
32
34
|
- `ec-analysis` `ec-implementing` `ec-reviewing` `ec-verification` — workflow stages
|
|
33
35
|
- `ec-memory` — short/long memory archive
|
|
34
|
-
- `ec-task-management` — task
|
|
36
|
+
- `ec-task-management` — task lifecycle panel · `ec-config` — Approval/Workflow/TDD settings · `ec-tdd-init` — Java changed-line gate initialization · `ec-task-close` — interrupt a task
|
|
35
37
|
- `ec-no-harness` — bypass only Easy Coding for the current session
|
|
36
38
|
- `ec-git` — git discipline · `ec-meta` — understand/customize the harness
|
|
37
39
|
|
|
@@ -45,6 +47,14 @@ First run `ec-init`; daily work goes through `ec-workflow`.
|
|
|
45
47
|
Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
|
|
46
48
|
automatically. Every new code task runs REVIEW; no mode changes scope, delivery form, or
|
|
47
49
|
evidence gates.
|
|
50
|
+
- TDD is session override > project `behavior.tdd_enabled` > `false`; its changed-line threshold
|
|
51
|
+
is session override > project `behavior.tdd_coverage_threshold` > `90`. ANALYSIS -> IMPLEMENT
|
|
52
|
+
freezes both. TDD may be enabled only after `ec-tdd-init` records valid infrastructure readiness;
|
|
53
|
+
there is no enable-now/init-later state. The dedicated `tdd-init` task always freezes TDD off and
|
|
54
|
+
initializes only changed-line coverage infrastructure, never historical business-test coverage.
|
|
55
|
+
Disabled TDD adds no CI scan, JaCoCo work, commands, artifacts, or stronger gates. Enabled TDD
|
|
56
|
+
applies only to Java code tasks and requires lifecycle, review, local coverage, and GitLab
|
|
57
|
+
TEST-stage evidence for production lines changed since the task baseline.
|
|
48
58
|
- Confirmation-required edges use `pending_transition`; automatic edges use the restricted
|
|
49
59
|
`auto-transition` API. A read-only task creates no test-strategy.md, never enters REVIEW,
|
|
50
60
|
VERIFICATION, or MEMORY, and writes no task memory.
|
|
@@ -84,7 +94,7 @@ First run `ec-init`; daily work goes through `ec-workflow`.
|
|
|
84
94
|
|
|
85
95
|
- Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
|
|
86
96
|
do not hand-edit session files, `current_task`, task `status`, `stage_history`,
|
|
87
|
-
`pending_transition`, workflow
|
|
97
|
+
`pending_transition`, workflow/TDD proposal or freeze fields, `memory_progress`, or `last_agent`.
|
|
88
98
|
- The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
|
|
89
99
|
`--session-file <P>` when changing the current task or stage.
|
|
90
100
|
- Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
|
|
@@ -13,8 +13,10 @@ then a blank line. Do not render the machine breadcrumbs to the user.
|
|
|
13
13
|
|
|
14
14
|
`{approval-mode}` is the effective approval mode and `{workflow-mode}` is the configured or
|
|
15
15
|
task-frozen execution mode; session overrides take precedence over project settings.
|
|
16
|
+
When effective/frozen TDD is enabled, insert `· **TDD**` immediately after Workflow. When it is
|
|
17
|
+
disabled, omit the TDD segment entirely and preserve the existing status-line format.
|
|
16
18
|
|
|
17
|
-
- Ready: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm,
|
|
19
|
+
- Ready: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Ready · Use `ec-workflow` to start or resume a task, `ec-brainstorming` to brainstorm, `ec-task-management` to manage tasks, or `ec-config` to inspect or change modes
|
|
18
20
|
- Waiting init: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · Waiting init · Use `ec-init` to initialize
|
|
19
21
|
- Active task: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}`
|
|
20
22
|
- Handoff: > **Easy Coding** · **Approval: {approval-mode}** · **Workflow: {workflow-mode}** · `{current-task}` · `{workflow-state}` · Handoff -> `{source-agent}`
|
|
@@ -29,7 +31,7 @@ platform prefixes such as `/` or `$`. If no status line is injected, do not inve
|
|
|
29
31
|
- `/ec-brainstorming` — design exploration before building (hard design gate)
|
|
30
32
|
- `/ec-analysis` `/ec-implementing` `/ec-reviewing` `/ec-verification` — workflow stages
|
|
31
33
|
- `/ec-memory` — short/long memory archive
|
|
32
|
-
- `/ec-task-management` — task
|
|
34
|
+
- `/ec-task-management` — task lifecycle panel · `/ec-config` — Approval/Workflow/TDD settings · `/ec-tdd-init` — Java changed-line gate initialization · `/ec-task-close` — interrupt a task
|
|
33
35
|
- `/ec-no-harness` — bypass only Easy Coding for the current session
|
|
34
36
|
- `/ec-git` — git discipline · `/ec-meta` — understand/customize the harness
|
|
35
37
|
|
|
@@ -43,6 +45,14 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
|
|
|
43
45
|
Confirm approval waits only at ANALYSIS -> IMPLEMENT, then advances green later stages
|
|
44
46
|
automatically. Every new code task runs REVIEW; no mode changes scope, delivery form, or
|
|
45
47
|
evidence gates.
|
|
48
|
+
- TDD is session override > project `behavior.tdd_enabled` > `false`; its changed-line threshold
|
|
49
|
+
is session override > project `behavior.tdd_coverage_threshold` > `90`. ANALYSIS -> IMPLEMENT
|
|
50
|
+
freezes both. TDD may be enabled only after `ec-tdd-init` records valid infrastructure readiness;
|
|
51
|
+
there is no enable-now/init-later state. The dedicated `tdd-init` task always freezes TDD off and
|
|
52
|
+
initializes only changed-line coverage infrastructure, never historical business-test coverage.
|
|
53
|
+
Disabled TDD adds no CI scan, JaCoCo work, commands, artifacts, or stronger gates. Enabled TDD
|
|
54
|
+
applies only to Java code tasks and requires lifecycle, review, local coverage, and GitLab
|
|
55
|
+
TEST-stage evidence for production lines changed since the task baseline.
|
|
46
56
|
- Confirmation-required edges use `pending_transition`; automatic edges use the restricted
|
|
47
57
|
`auto-transition` API. A read-only task creates no test-strategy.md, never enters REVIEW,
|
|
48
58
|
VERIFICATION, or MEMORY, and writes no task memory.
|
|
@@ -82,7 +92,7 @@ First run `/ec-init`; daily work goes through `/ec-workflow`.
|
|
|
82
92
|
|
|
83
93
|
- Workflow state operations go through `{{platform_config_dir}}/hooks/easy_coding_state.py`;
|
|
84
94
|
do not hand-edit session files, `current_task`, task `status`, `stage_history`,
|
|
85
|
-
`pending_transition`, workflow
|
|
95
|
+
`pending_transition`, workflow/TDD proposal or freeze fields, `memory_progress`, or `last_agent`.
|
|
86
96
|
- The hook injects `[easy-coding:session-file:P]`; pass that path to the state script with
|
|
87
97
|
`--session-file <P>` when changing the current task or stage.
|
|
88
98
|
- Workflow session files live at `{{workflow_state_path}}`; the CLI only installs files and
|